bkui-vue 0.0.1-beta.23 → 0.0.1-beta.230

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 (608) hide show
  1. package/dist/index.cjs.js +173 -0
  2. package/dist/index.esm.js +38108 -0
  3. package/dist/index.umd.js +173 -0
  4. package/dist/style.css +1 -5099
  5. package/dist/style.variable.css +1 -0
  6. package/lib/affix/affix.css +3 -0
  7. package/lib/affix/affix.d.ts +47 -0
  8. package/lib/affix/affix.less +5 -0
  9. package/lib/affix/affix.variable.css +122 -0
  10. package/lib/affix/index.d.ts +143 -0
  11. package/lib/affix/index.js +1 -0
  12. package/lib/alert/alert.css +5 -3
  13. package/lib/alert/alert.less +7 -3
  14. package/lib/alert/alert.variable.css +34 -6
  15. package/lib/alert/index.js +1 -1
  16. package/lib/animate-number/index.js +1 -1
  17. package/lib/backtop/backtop.css +8 -0
  18. package/lib/backtop/backtop.d.ts +2 -2
  19. package/lib/backtop/backtop.less +8 -0
  20. package/lib/backtop/backtop.variable.css +37 -3
  21. package/lib/backtop/index.d.ts +7 -7
  22. package/lib/backtop/index.js +1 -10
  23. package/lib/badge/badge.css +5 -5
  24. package/lib/badge/badge.d.ts +28 -7
  25. package/lib/badge/badge.less +5 -6
  26. package/lib/badge/badge.variable.css +34 -8
  27. package/lib/badge/index.d.ts +68 -18
  28. package/lib/badge/index.js +1 -1
  29. package/lib/breadcrumb/breadcrumb.css +51 -0
  30. package/lib/breadcrumb/breadcrumb.variable.css +80 -3
  31. package/lib/breadcrumb/index.js +1 -1
  32. package/lib/button/button.css +87 -49
  33. package/lib/button/button.d.ts +28 -7
  34. package/lib/button/button.less +74 -41
  35. package/lib/button/button.variable.css +116 -52
  36. package/lib/button/index.d.ts +45 -12
  37. package/lib/button/index.js +1 -1
  38. package/lib/card/card.css +96 -1
  39. package/lib/card/card.d.ts +47 -6
  40. package/lib/card/card.less +50 -2
  41. package/lib/card/card.variable.css +125 -4
  42. package/lib/card/index.d.ts +113 -17
  43. package/lib/card/index.js +1 -1
  44. package/lib/cascader/cascader-panel.d.ts +100 -0
  45. package/lib/cascader/cascader.css +173 -0
  46. package/lib/cascader/cascader.d.ts +303 -0
  47. package/lib/cascader/cascader.less +196 -0
  48. package/lib/cascader/cascader.variable.css +292 -0
  49. package/lib/cascader/index.d.ts +868 -0
  50. package/lib/cascader/index.js +1 -0
  51. package/lib/cascader/interface.d.ts +51 -0
  52. package/lib/cascader/node.d.ts +31 -0
  53. package/lib/cascader/store.d.ts +23 -0
  54. package/lib/checkbox/checkbox-group.d.ts +16 -0
  55. package/lib/checkbox/checkbox.css +38 -6
  56. package/lib/checkbox/checkbox.d.ts +16 -14
  57. package/lib/checkbox/checkbox.less +48 -6
  58. package/lib/checkbox/checkbox.variable.css +67 -9
  59. package/lib/checkbox/common.d.ts +3 -3
  60. package/lib/checkbox/index.d.ts +40 -23
  61. package/lib/checkbox/index.js +1 -1
  62. package/lib/checkbox/type.d.ts +2 -6
  63. package/lib/code-diff/code-diff.css +72 -1
  64. package/lib/code-diff/code-diff.d.ts +10 -1
  65. package/lib/code-diff/code-diff.less +94 -1
  66. package/lib/code-diff/code-diff.variable.css +101 -4
  67. package/lib/code-diff/index.d.ts +151 -3
  68. package/lib/code-diff/index.js +1 -0
  69. package/lib/collapse/collapse-panel.d.ts +72 -0
  70. package/lib/collapse/collapse.css +28 -12
  71. package/lib/collapse/collapse.d.ts +11 -52
  72. package/lib/collapse/collapse.less +54 -29
  73. package/lib/collapse/collapse.variable.css +147 -12
  74. package/lib/collapse/index.d.ts +113 -16
  75. package/lib/collapse/index.js +1 -1
  76. package/lib/collapse/props.d.ts +121 -0
  77. package/lib/collapse/utils.d.ts +11 -0
  78. package/lib/color-picker/color-picker.css +275 -0
  79. package/lib/color-picker/color-picker.d.ts +144 -0
  80. package/lib/color-picker/color-picker.less +325 -0
  81. package/lib/color-picker/color-picker.variable.css +394 -0
  82. package/lib/color-picker/components/color-input.d.ts +42 -0
  83. package/lib/color-picker/components/hue-slider.d.ts +41 -0
  84. package/lib/color-picker/components/input-container.d.ts +42 -0
  85. package/lib/color-picker/components/recommend-colors.d.ts +51 -0
  86. package/lib/color-picker/components/saturation-panel.d.ts +41 -0
  87. package/lib/color-picker/index.d.ts +254 -0
  88. package/lib/color-picker/index.js +1 -0
  89. package/lib/color-picker/utils.d.ts +37 -0
  90. package/lib/components.d.ts +28 -7
  91. package/lib/components.js +1 -0
  92. package/lib/container/col.d.ts +51 -0
  93. package/lib/container/container.css +91 -0
  94. package/lib/container/container.d.ts +83 -0
  95. package/lib/container/container.less +20 -0
  96. package/lib/container/container.variable.css +210 -0
  97. package/lib/container/index.d.ts +223 -0
  98. package/lib/container/index.js +1 -0
  99. package/lib/container/row.d.ts +4 -0
  100. package/lib/date-picker/base/confirm.d.ts +74 -0
  101. package/lib/date-picker/base/date-table.d.ts +102 -0
  102. package/lib/date-picker/base/picker-dropdown.d.ts +73 -0
  103. package/lib/date-picker/base/time-spinner.d.ts +153 -0
  104. package/lib/date-picker/date-picker.css +18 -2
  105. package/lib/date-picker/date-picker.d.ts +40 -13
  106. package/lib/date-picker/date-picker.less +23 -2
  107. package/lib/date-picker/date-picker.variable.css +47 -5
  108. package/lib/date-picker/index.d.ts +100 -39
  109. package/lib/date-picker/index.js +1 -1
  110. package/lib/date-picker/interface.d.ts +9 -0
  111. package/lib/date-picker/panel/date-range.d.ts +452 -0
  112. package/lib/date-picker/panel/date.d.ts +550 -0
  113. package/lib/date-picker/panel/time.d.ts +450 -0
  114. package/lib/date-picker/props.d.ts +51 -1
  115. package/lib/date-picker/time-picker.d.ts +381 -0
  116. package/lib/date-picker/utils.d.ts +22 -1
  117. package/lib/dialog/dialog.css +144 -22
  118. package/lib/dialog/dialog.d.ts +275 -58
  119. package/lib/dialog/dialog.less +97 -23
  120. package/lib/dialog/dialog.variable.css +144 -22
  121. package/lib/dialog/index.d.ts +607 -130
  122. package/lib/dialog/index.js +1 -1
  123. package/lib/dialog/props.d.ts +138 -0
  124. package/lib/directives/ellipsis.d.ts +7 -0
  125. package/lib/directives/index.d.ts +1 -0
  126. package/lib/directives/index.js +2 -15
  127. package/lib/directives/index.js.LICENSE.txt +14 -0
  128. package/lib/directives/tooltips.d.ts +1 -1
  129. package/lib/dist.index.js +1 -0
  130. package/lib/divider/divider.d.ts +1 -1
  131. package/lib/divider/divider.variable.css +29 -3
  132. package/lib/divider/index.d.ts +4 -4
  133. package/lib/divider/index.js +1 -1
  134. package/lib/divider/props.d.ts +21 -0
  135. package/lib/dropdown/const.d.ts +4 -0
  136. package/lib/dropdown/dropdown.css +13 -7
  137. package/lib/dropdown/dropdown.d.ts +34 -3
  138. package/lib/dropdown/dropdown.less +47 -34
  139. package/lib/dropdown/dropdown.variable.css +42 -10
  140. package/lib/dropdown/index.d.ts +71 -10
  141. package/lib/dropdown/index.js +1 -1
  142. package/lib/exception/exception.css +40 -14
  143. package/lib/exception/exception.d.ts +10 -3
  144. package/lib/exception/exception.less +59 -22
  145. package/lib/exception/exception.variable.css +69 -17
  146. package/lib/exception/index.d.ts +23 -8
  147. package/lib/exception/index.js +1 -1
  148. package/lib/exception/typings/index.d.ts +4 -0
  149. package/lib/fixed-navbar/fixed-navbar.d.ts +16 -2
  150. package/lib/fixed-navbar/fixed-navbar.variable.css +29 -3
  151. package/lib/fixed-navbar/index.d.ts +40 -5
  152. package/lib/fixed-navbar/index.js +1 -1
  153. package/lib/form/compose-form-item.d.ts +16 -0
  154. package/lib/form/form-item.d.ts +16 -5
  155. package/lib/form/form.css +96 -12
  156. package/lib/form/form.d.ts +28 -11
  157. package/lib/form/form.less +144 -45
  158. package/lib/form/form.variable.css +215 -12
  159. package/lib/form/index.d.ts +88 -30
  160. package/lib/form/index.js +1 -1
  161. package/lib/form/type.d.ts +8 -6
  162. package/lib/form/validator.d.ts +1 -0
  163. package/lib/icon/angle-double-down-line.js +1 -15
  164. package/lib/icon/angle-double-left-line.js +1 -15
  165. package/lib/icon/angle-double-left.js +1 -15
  166. package/lib/icon/angle-double-right-line.js +1 -15
  167. package/lib/icon/angle-double-right.js +1 -15
  168. package/lib/icon/angle-double-up-line.js +1 -15
  169. package/lib/icon/angle-down-fill.js +1 -15
  170. package/lib/icon/angle-down-line.js +1 -15
  171. package/lib/icon/angle-down.js +1 -15
  172. package/lib/icon/angle-left.js +1 -15
  173. package/lib/icon/angle-right.js +1 -15
  174. package/lib/icon/angle-up-fill.js +1 -15
  175. package/lib/icon/angle-up.js +1 -15
  176. package/lib/icon/archive-fill.d.ts +4 -0
  177. package/lib/icon/archive-fill.js +1 -0
  178. package/lib/icon/arrows-left.js +1 -15
  179. package/lib/icon/arrows-right.js +1 -15
  180. package/lib/icon/audio-fill.d.ts +4 -0
  181. package/lib/icon/audio-fill.js +1 -0
  182. package/lib/icon/bk.js +1 -15
  183. package/lib/icon/circle.js +1 -15
  184. package/lib/icon/close-line.d.ts +4 -0
  185. package/lib/icon/close-line.js +1 -0
  186. package/lib/icon/close.js +1 -15
  187. package/lib/icon/code.js +1 -15
  188. package/lib/icon/cog-shape.js +1 -15
  189. package/lib/icon/collapse-left.js +1 -15
  190. package/lib/icon/copy.js +1 -15
  191. package/lib/icon/data-shape.d.ts +4 -0
  192. package/lib/icon/data-shape.js +1 -0
  193. package/lib/icon/del.d.ts +4 -0
  194. package/lib/icon/del.js +1 -0
  195. package/lib/icon/doc-fill.d.ts +4 -0
  196. package/lib/icon/doc-fill.js +1 -0
  197. package/lib/icon/done.js +1 -15
  198. package/lib/icon/down-shape.js +1 -15
  199. package/lib/icon/down-small.js +1 -15
  200. package/lib/icon/edit-line.d.ts +4 -0
  201. package/lib/icon/edit-line.js +1 -0
  202. package/lib/icon/ellipsis.js +1 -15
  203. package/lib/icon/enlarge-line.d.ts +4 -0
  204. package/lib/icon/enlarge-line.js +1 -0
  205. package/lib/icon/error.js +1 -15
  206. package/lib/icon/excel-fill.d.ts +4 -0
  207. package/lib/icon/excel-fill.js +1 -0
  208. package/lib/icon/exclamation-circle-shape.d.ts +4 -0
  209. package/lib/icon/exclamation-circle-shape.js +1 -0
  210. package/lib/icon/eye.js +1 -15
  211. package/lib/icon/filliscreen-line.d.ts +4 -0
  212. package/lib/icon/filliscreen-line.js +1 -0
  213. package/lib/icon/folder-open.js +1 -15
  214. package/lib/icon/folder-shape-open.js +1 -15
  215. package/lib/icon/folder-shape.js +1 -15
  216. package/lib/icon/folder.js +1 -15
  217. package/lib/icon/funnel.d.ts +4 -0
  218. package/lib/icon/funnel.js +1 -0
  219. package/lib/icon/help-document-fill.js +1 -15
  220. package/lib/icon/help-fill.js +1 -15
  221. package/lib/icon/help.js +1 -15
  222. package/lib/icon/image-fill.d.ts +4 -0
  223. package/lib/icon/img-error.d.ts +4 -0
  224. package/lib/icon/img-error.js +1 -0
  225. package/lib/icon/img-placehoulder.d.ts +4 -0
  226. package/lib/icon/img-placehoulder.js +1 -0
  227. package/lib/icon/index.d.ts +27 -1
  228. package/lib/icon/index.js +1 -15
  229. package/lib/icon/info-line.js +1 -15
  230. package/lib/icon/info.js +1 -15
  231. package/lib/icon/left-shape.js +1 -15
  232. package/lib/icon/left-turn-line.d.ts +4 -0
  233. package/lib/icon/left-turn-line.js +1 -0
  234. package/lib/icon/narrow-line.d.ts +4 -0
  235. package/lib/icon/narrow-line.js +1 -0
  236. package/lib/icon/original .d.ts +4 -0
  237. package/lib/icon/original .js +1 -0
  238. package/lib/icon/pdf-fill.d.ts +4 -0
  239. package/lib/icon/pdf-fill.js +1 -0
  240. package/lib/icon/play-shape.js +1 -15
  241. package/lib/icon/plus.js +1 -15
  242. package/lib/icon/ppt-fill.d.ts +4 -0
  243. package/lib/icon/ppt-fill.js +1 -0
  244. package/lib/icon/qq.js +1 -15
  245. package/lib/icon/right-shape.js +1 -15
  246. package/lib/icon/right-turn-line.d.ts +4 -0
  247. package/lib/icon/right-turn-line.js +1 -0
  248. package/lib/icon/search.js +1 -15
  249. package/lib/icon/share.js +1 -15
  250. package/lib/icon/spinner.js +1 -15
  251. package/lib/icon/success.js +1 -15
  252. package/lib/icon/switcher-loading.js +1 -15
  253. package/lib/icon/text-file.js +1 -15
  254. package/lib/icon/text-fill.d.ts +4 -0
  255. package/lib/icon/text-fill.js +1 -0
  256. package/lib/icon/transfer.d.ts +4 -0
  257. package/lib/icon/transfer.js +1 -0
  258. package/lib/icon/tree-application-shape.js +1 -15
  259. package/lib/icon/unfull-screen.d.ts +4 -0
  260. package/lib/icon/unfull-screen.js +1 -0
  261. package/lib/icon/unvisible.js +1 -15
  262. package/lib/icon/up-shape.js +1 -15
  263. package/lib/icon/upload.d.ts +4 -0
  264. package/lib/icon/upload.js +1 -0
  265. package/lib/icon/video-fill.d.ts +4 -0
  266. package/lib/icon/video-fill.js +1 -0
  267. package/lib/icon/warn.js +1 -15
  268. package/lib/icon/weixin.js +1 -15
  269. package/lib/image/image-viewer.css +142 -0
  270. package/lib/image/image-viewer.d.ts +73 -0
  271. package/lib/image/image-viewer.less +168 -0
  272. package/lib/image/image-viewer.variable.css +142 -0
  273. package/lib/image/image.css +37 -0
  274. package/lib/image/image.d.ts +93 -0
  275. package/lib/image/image.less +44 -0
  276. package/lib/image/image.variable.css +37 -0
  277. package/lib/image/index.d.ts +246 -0
  278. package/lib/image/index.js +1 -0
  279. package/lib/image/props.d.ts +71 -0
  280. package/lib/index.d.ts +1 -1
  281. package/lib/index.js +1 -0
  282. package/lib/info-box/index.d.ts +6 -0
  283. package/lib/info-box/index.js +1 -0
  284. package/lib/info-box/info-box.css +37 -0
  285. package/lib/info-box/info-box.d.ts +26 -0
  286. package/lib/info-box/info-box.less +50 -0
  287. package/lib/info-box/info-box.variable.css +37 -0
  288. package/lib/input/index.d.ts +171 -60
  289. package/lib/input/index.js +1 -15
  290. package/lib/input/input.css +216 -18
  291. package/lib/input/input.d.ts +116 -16
  292. package/lib/input/input.less +157 -17
  293. package/lib/input/input.variable.css +242 -17
  294. package/lib/link/index.d.ts +4 -4
  295. package/lib/link/index.js +1 -1
  296. package/lib/link/link.css +12 -12
  297. package/lib/link/link.d.ts +1 -1
  298. package/lib/link/link.less +16 -14
  299. package/lib/link/link.variable.css +41 -15
  300. package/lib/loading/index.d.ts +107 -13
  301. package/lib/loading/index.js +1 -1
  302. package/lib/loading/loading.css +83 -31
  303. package/lib/loading/loading.d.ts +74 -5
  304. package/lib/loading/loading.less +28 -30
  305. package/lib/loading/loading.variable.css +112 -34
  306. package/lib/menu/index.d.ts +16 -24
  307. package/lib/menu/index.js +1 -1
  308. package/lib/menu/menu.css +51 -0
  309. package/lib/menu/menu.d.ts +7 -16
  310. package/lib/menu/menu.variable.css +80 -3
  311. package/lib/menu/submenu.variable.css +29 -3
  312. package/lib/message/index.js +1 -1
  313. package/lib/message/message.css +24 -3
  314. package/lib/message/message.less +27 -2
  315. package/lib/message/message.variable.css +53 -6
  316. package/lib/message/messageConstructor.d.ts +43 -7
  317. package/lib/modal/index.d.ts +508 -78
  318. package/lib/modal/index.js +1 -1
  319. package/lib/modal/modal.css +63 -1
  320. package/lib/modal/modal.d.ts +194 -30
  321. package/lib/modal/modal.less +36 -1
  322. package/lib/modal/modal.variable.css +63 -1
  323. package/lib/modal/props.mixin.d.ts +82 -13
  324. package/lib/navigation/index.d.ts +310 -1
  325. package/lib/navigation/index.js +1 -1
  326. package/lib/navigation/navigation.css +1 -1
  327. package/lib/navigation/navigation.d.ts +10 -1
  328. package/lib/navigation/navigation.less +1 -1
  329. package/lib/navigation/navigation.variable.css +30 -4
  330. package/lib/notify/index.js +1 -1
  331. package/lib/notify/notify.css +24 -4
  332. package/lib/notify/notify.less +27 -4
  333. package/lib/notify/notify.variable.css +53 -7
  334. package/lib/notify/notifyConstructor.d.ts +51 -7
  335. package/lib/pagination/index.d.ts +38 -23
  336. package/lib/pagination/index.js +1 -1
  337. package/lib/pagination/pagination.css +54 -28
  338. package/lib/pagination/pagination.d.ts +17 -7
  339. package/lib/pagination/pagination.less +58 -31
  340. package/lib/pagination/pagination.variable.css +83 -31
  341. package/lib/pagination/type.d.ts +1 -1
  342. package/lib/plugin-popover/index.d.ts +27 -0
  343. package/lib/plugin-popover/index.js +1 -0
  344. package/lib/plugins/index.d.ts +1 -0
  345. package/lib/plugins/index.js +1 -0
  346. package/lib/popover/index.d.ts +146 -21
  347. package/lib/popover/index.js +1 -1
  348. package/lib/popover/popover.css +3 -0
  349. package/lib/popover/popover.d.ts +67 -8
  350. package/lib/popover/popover.less +2 -0
  351. package/lib/popover/popover.variable.css +32 -3
  352. package/lib/popover/props.d.ts +34 -2
  353. package/lib/popover2/arrow.d.ts +2 -0
  354. package/lib/popover2/const.d.ts +16 -0
  355. package/lib/popover2/content.d.ts +24 -0
  356. package/lib/popover2/index.d.ts +545 -0
  357. package/lib/popover2/index.js +1 -0
  358. package/lib/popover2/plugin-popover.d.ts +12 -0
  359. package/lib/popover2/popover2.css +25 -0
  360. package/lib/popover2/popover2.d.ts +228 -0
  361. package/lib/popover2/popover2.less +35 -0
  362. package/lib/popover2/popover2.variable.css +144 -0
  363. package/lib/popover2/props.d.ts +118 -0
  364. package/lib/popover2/reference.d.ts +2 -0
  365. package/lib/popover2/root.d.ts +16 -0
  366. package/lib/popover2/use-floating.d.ts +31 -0
  367. package/lib/popover2/use-platform.d.ts +30 -0
  368. package/lib/popover2/use-popover-init.d.ts +22 -0
  369. package/lib/popover2/use-popper-id.d.ts +6 -0
  370. package/lib/popover2/utils.d.ts +2 -0
  371. package/lib/preset.js +1 -0
  372. package/lib/process/index.d.ts +9 -9
  373. package/lib/process/index.js +1 -15
  374. package/lib/process/process.css +13 -0
  375. package/lib/process/process.d.ts +2 -2
  376. package/lib/process/process.less +17 -0
  377. package/lib/process/process.variable.css +42 -3
  378. package/lib/progress/index.d.ts +10 -10
  379. package/lib/progress/index.js +1 -1
  380. package/lib/progress/progress.css +51 -0
  381. package/lib/progress/progress.d.ts +3 -3
  382. package/lib/progress/progress.variable.css +80 -3
  383. package/lib/radio/common.d.ts +5 -5
  384. package/lib/radio/index.d.ts +29 -18
  385. package/lib/radio/index.js +1 -1
  386. package/lib/radio/radio-button.d.ts +7 -8
  387. package/lib/radio/radio-group.d.ts +16 -0
  388. package/lib/radio/radio.css +61 -56
  389. package/lib/radio/radio.d.ts +4 -4
  390. package/lib/radio/radio.less +181 -172
  391. package/lib/radio/radio.variable.css +93 -62
  392. package/lib/radio/type.d.ts +9 -4
  393. package/lib/rate/index.d.ts +24 -1
  394. package/lib/rate/index.js +1 -1
  395. package/lib/rate/rate.d.ts +11 -0
  396. package/lib/rate/star.d.ts +1 -1
  397. package/lib/resize-layout/index.d.ts +336 -0
  398. package/lib/resize-layout/index.js +1 -0
  399. package/lib/resize-layout/resize-layout.css +177 -0
  400. package/lib/resize-layout/resize-layout.d.ts +127 -0
  401. package/lib/resize-layout/resize-layout.less +217 -0
  402. package/lib/resize-layout/resize-layout.variable.css +296 -0
  403. package/lib/search-select/index.d.ts +681 -0
  404. package/lib/search-select/index.js +1 -0
  405. package/lib/search-select/input.d.ts +85 -0
  406. package/lib/search-select/menu.d.ts +83 -0
  407. package/lib/search-select/search-select.css +423 -0
  408. package/lib/search-select/search-select.d.ts +273 -0
  409. package/lib/search-select/search-select.less +375 -0
  410. package/lib/search-select/search-select.variable.css +542 -0
  411. package/lib/search-select/selected.d.ts +137 -0
  412. package/lib/search-select/utils.d.ts +79 -0
  413. package/lib/select/common.d.ts +20 -31
  414. package/lib/select/index.d.ts +1422 -451
  415. package/lib/select/index.js +1 -15
  416. package/lib/select/option.d.ts +16 -4
  417. package/lib/select/optionGroup.d.ts +1 -77
  418. package/lib/select/select.css +265 -80
  419. package/lib/select/select.d.ts +553 -126
  420. package/lib/select/select.less +366 -185
  421. package/lib/select/select.variable.css +295 -84
  422. package/lib/select/selectTagInput.d.ts +93 -0
  423. package/lib/select/type.d.ts +39 -0
  424. package/lib/shared/dom.d.ts +3 -0
  425. package/lib/shared/{bk-helper-core.d.ts → helper.d.ts} +0 -0
  426. package/lib/shared/hooks/use-form-item.d.ts +2 -0
  427. package/lib/shared/hooks/use-form.d.ts +2 -0
  428. package/lib/shared/index.d.ts +27 -4
  429. package/lib/shared/index.js +1 -1
  430. package/lib/shared/{bk-mask-manager.d.ts → mask-manager.d.ts} +6 -2
  431. package/lib/shared/{bk-pop-manager.d.ts → pop-manager.d.ts} +8 -4
  432. package/lib/shared/{bk-popover.d.ts → popover.d.ts} +6 -2
  433. package/lib/shared/token.d.ts +4 -0
  434. package/lib/shared/utils.d.ts +13 -0
  435. package/lib/shared/vue-types.d.ts +4 -0
  436. package/lib/sideslider/index.d.ts +391 -76
  437. package/lib/sideslider/index.js +1 -1
  438. package/lib/sideslider/sideslider.css +55 -10
  439. package/lib/sideslider/sideslider.d.ts +181 -33
  440. package/lib/sideslider/sideslider.less +72 -13
  441. package/lib/sideslider/sideslider.variable.css +84 -13
  442. package/lib/slider/index.d.ts +414 -1
  443. package/lib/slider/index.js +1 -15
  444. package/lib/slider/slider-button.d.ts +5 -0
  445. package/lib/slider/slider.d.ts +14 -2
  446. package/lib/slider/slider.variable.css +29 -3
  447. package/lib/steps/index.d.ts +4 -4
  448. package/lib/steps/index.js +1 -15
  449. package/lib/steps/steps.css +14 -3
  450. package/lib/steps/steps.d.ts +1 -1
  451. package/lib/steps/steps.less +23 -3
  452. package/lib/steps/steps.variable.css +43 -6
  453. package/lib/styles/index.d.ts +12 -0
  454. package/lib/styles/mixins/clearfix.css +8 -0
  455. package/lib/styles/mixins/clearfix.less +10 -0
  456. package/lib/styles/mixins/clearfix.variable.css +8 -0
  457. package/lib/styles/mixins/mixins.css +51 -0
  458. package/lib/styles/mixins/mixins.less +2 -0
  459. package/lib/styles/mixins/mixins.variable.css +51 -0
  460. package/lib/styles/mixins/scroll.css +17 -0
  461. package/lib/styles/mixins/scroll.less +22 -0
  462. package/lib/styles/mixins/scroll.variable.css +136 -0
  463. package/lib/styles/reset.css +36 -0
  464. package/lib/styles/reset.less +26 -0
  465. package/lib/styles/reset.variable.css +36 -0
  466. package/lib/styles/themes/themes.less +38 -3
  467. package/lib/swiper/index.d.ts +181 -0
  468. package/lib/swiper/index.js +1 -0
  469. package/lib/swiper/swiper.css +91 -0
  470. package/lib/swiper/swiper.d.ts +65 -0
  471. package/lib/swiper/swiper.less +107 -0
  472. package/lib/swiper/swiper.variable.css +91 -0
  473. package/lib/switcher/index.d.ts +34 -11
  474. package/lib/switcher/index.js +1 -1
  475. package/lib/switcher/switcher.css +57 -6
  476. package/lib/switcher/switcher.d.ts +15 -4
  477. package/lib/switcher/switcher.less +5 -26
  478. package/lib/switcher/switcher.variable.css +86 -9
  479. package/lib/tab/index.d.ts +107 -219
  480. package/lib/tab/index.js +1 -1
  481. package/lib/tab/props.d.ts +194 -0
  482. package/lib/tab/tab-nav.d.ts +66 -87
  483. package/lib/tab/tab-panel.d.ts +40 -15
  484. package/lib/tab/tab.css +25 -1
  485. package/lib/tab/tab.d.ts +17 -41
  486. package/lib/tab/tab.less +31 -19
  487. package/lib/tab/tab.variable.css +54 -4
  488. package/lib/table/components/index.d.ts +3 -0
  489. package/lib/table/components/table-cell.d.ts +38 -0
  490. package/lib/table/components/table-column.d.ts +142 -0
  491. package/lib/table/components/table-row.d.ts +2 -0
  492. package/lib/table/const.d.ts +108 -1
  493. package/lib/table/index.d.ts +781 -27
  494. package/lib/table/index.js +1 -10
  495. package/lib/table/plugins/body-empty.d.ts +40 -0
  496. package/lib/table/plugins/col-group.d.ts +38 -0
  497. package/lib/table/plugins/common.d.ts +6 -0
  498. package/lib/table/plugins/head-filter.css +71 -0
  499. package/lib/table/plugins/head-filter.d.ts +26 -0
  500. package/lib/table/plugins/head-filter.less +92 -0
  501. package/lib/table/plugins/head-filter.variable.css +190 -0
  502. package/lib/table/plugins/head-sort.css +25 -0
  503. package/lib/table/plugins/head-sort.d.ts +22 -0
  504. package/lib/table/plugins/head-sort.less +31 -0
  505. package/lib/table/plugins/head-sort.variable.css +144 -0
  506. package/lib/table/plugins/index.d.ts +5 -0
  507. package/lib/table/plugins/settings.css +129 -0
  508. package/lib/table/plugins/settings.d.ts +37 -0
  509. package/lib/table/plugins/settings.less +157 -0
  510. package/lib/table/plugins/settings.variable.css +248 -0
  511. package/lib/table/plugins/use-active-columns.d.ts +16 -0
  512. package/lib/table/plugins/use-column-resize.d.ts +15 -0
  513. package/lib/table/plugins/use-fixed-column.d.ts +12 -0
  514. package/lib/table/plugins/use-pagination.d.ts +16 -0
  515. package/lib/table/plugins/use-scroll-loading.d.ts +5 -0
  516. package/lib/table/props.d.ts +282 -7
  517. package/lib/table/render.d.ts +53 -6
  518. package/lib/table/table.css +1143 -17
  519. package/lib/table/table.d.ts +196 -13
  520. package/lib/table/table.less +237 -25
  521. package/lib/table/table.variable.css +1182 -30
  522. package/lib/table/use-column.d.ts +11 -0
  523. package/lib/table/use-common.d.ts +97 -0
  524. package/lib/table/utils.d.ts +65 -9
  525. package/lib/table-column/index.d.ts +336 -0
  526. package/lib/table-column/index.js +1 -0
  527. package/lib/tag/index.d.ts +7 -7
  528. package/lib/tag/index.js +1 -1
  529. package/lib/tag/tag.css +57 -18
  530. package/lib/tag/tag.d.ts +2 -2
  531. package/lib/tag/tag.less +58 -15
  532. package/lib/tag/tag.variable.css +86 -21
  533. package/lib/tag-input/common.d.ts +36 -0
  534. package/lib/tag-input/index.d.ts +1211 -0
  535. package/lib/tag-input/index.js +1 -0
  536. package/lib/tag-input/list-tag-render.d.ts +44 -0
  537. package/lib/tag-input/tag-input.css +209 -0
  538. package/lib/tag-input/tag-input.d.ts +536 -0
  539. package/lib/tag-input/tag-input.less +251 -0
  540. package/lib/tag-input/tag-input.variable.css +328 -0
  541. package/lib/tag-input/tag-props.d.ts +216 -0
  542. package/lib/tag-input/tag-render.d.ts +35 -0
  543. package/lib/time-picker/index.d.ts +904 -0
  544. package/lib/time-picker/index.js +1 -0
  545. package/lib/time-picker/time-picker.css +215 -0
  546. package/lib/time-picker/time-picker.less +260 -0
  547. package/lib/time-picker/time-picker.variable.css +334 -0
  548. package/lib/timeline/index.d.ts +6 -6
  549. package/lib/timeline/index.js +1 -1
  550. package/lib/timeline/timeline.css +5 -5
  551. package/lib/timeline/timeline.d.ts +1 -1
  552. package/lib/timeline/timeline.less +6 -5
  553. package/lib/timeline/timeline.variable.css +34 -8
  554. package/lib/transfer/const.d.ts +5 -0
  555. package/lib/transfer/index.d.ts +339 -1
  556. package/lib/transfer/index.js +1 -1
  557. package/lib/transfer/props.d.ts +54 -0
  558. package/lib/transfer/transfer.css +89 -86
  559. package/lib/transfer/transfer.d.ts +70 -95
  560. package/lib/transfer/transfer.less +93 -113
  561. package/lib/transfer/transfer.variable.css +123 -94
  562. package/lib/tree/constant.d.ts +57 -0
  563. package/lib/tree/index.d.ts +419 -48
  564. package/lib/tree/index.js +1 -1
  565. package/lib/tree/props.d.ts +124 -0
  566. package/lib/tree/tree.css +183 -11
  567. package/lib/tree/tree.d.ts +194 -23
  568. package/lib/tree/tree.less +72 -10
  569. package/lib/tree/tree.variable.css +302 -11
  570. package/lib/tree/use-empty.d.ts +6 -0
  571. package/lib/tree/use-node-action.d.ts +12 -0
  572. package/lib/tree/use-node-async.d.ts +5 -0
  573. package/lib/tree/use-node-attribute.d.ts +33 -0
  574. package/lib/tree/use-node-drag.d.ts +3 -0
  575. package/lib/tree/use-search.d.ts +11 -0
  576. package/lib/tree/use-tree-init.d.ts +15 -0
  577. package/lib/tree/util.d.ts +5 -7
  578. package/lib/upload/index.d.ts +566 -0
  579. package/lib/upload/index.js +1 -0
  580. package/lib/upload/props.d.ts +111 -0
  581. package/lib/upload/upload-list.d.ts +47 -0
  582. package/lib/upload/upload-trigger.d.ts +51 -0
  583. package/lib/upload/upload.css +425 -0
  584. package/lib/upload/upload.d.ts +246 -0
  585. package/lib/upload/upload.less +464 -0
  586. package/lib/upload/upload.type.d.ts +78 -0
  587. package/lib/upload/upload.variable.css +544 -0
  588. package/lib/upload/use-ajax-upload.d.ts +3 -0
  589. package/lib/upload/use-file-handler.d.ts +44 -0
  590. package/lib/virtual-render/index.d.ts +27 -4
  591. package/lib/virtual-render/index.js +1 -10
  592. package/lib/virtual-render/props.d.ts +10 -0
  593. package/lib/virtual-render/use-tag-render.d.ts +7 -0
  594. package/lib/virtual-render/v-virtual-render.d.ts +0 -1
  595. package/lib/virtual-render/virtual-render.css +17 -24
  596. package/lib/virtual-render/virtual-render.d.ts +14 -3
  597. package/lib/virtual-render/virtual-render.less +2 -31
  598. package/lib/virtual-render/virtual-render.variable.css +136 -24
  599. package/lib/volar.components.d.ts +101 -0
  600. package/package.json +59 -46
  601. package/README_EN.md +0 -93
  602. package/dist/bkui-vue.cjs.js +0 -18938
  603. package/dist/bkui-vue.esm.js +0 -18887
  604. package/dist/bkui-vue.umd.js +0 -18941
  605. package/lib/form/common.d.ts +0 -3
  606. package/lib/icon/icon.js +0 -15
  607. package/lib/styles/index.js +0 -1
  608. package/lib/use-form.d.ts +0 -3
package/lib/tree/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("../shared"),require("vue"),require("../icon/"),require("../virtual-render"),require("crypto")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon/","../virtual-render","crypto"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e._,e["@bkui-vue/virtual-render"],e.require$$0)}(this,(function(e,n,t,r,o,i){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(o),a=u(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(s);var f=c(s.exports),d={exports:{}};!function(e){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports}(d);var p=c(d.exports),v={data:n.PropTypes.arrayOf(n.PropTypes.any).def([]),label:n.PropTypes.oneOfType([n.PropTypes.func.def(void 0),n.PropTypes.string.def("label")]),children:n.PropTypes.string.def("children"),indent:n.PropTypes.number.def(18),lineHeight:n.PropTypes.number.def(32),levelLine:n.PropTypes.oneOfType([n.PropTypes.bool.def(!1),n.PropTypes.func.def(void 0),n.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:n.PropTypes.bool.def(!1),prefixIcon:n.PropTypes.oneOfType([n.PropTypes.func.def((function(){})),n.PropTypes.bool.def(!1)]).def(!0),async:n.PropTypes.shape({callback:n.PropTypes.func.def(null),cache:n.PropTypes.bool.def(!0)}),offsetLeft:n.PropTypes.number.def(15)},_={exports:{}},y={exports:{}},h={exports:{}};!function(e){e.exports=function(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var n=h.exports;e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var x={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(x);var b={exports:{}};!function(e){var n=h.exports;e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(b);var g={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var n=y.exports,t=x.exports,r=b.exports,o=g.exports;e.exports=function(e){return n(e)||t(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(_);for(var m=c(_.exports),O=a.default,T=function(){return O.randomBytes(16)},j=[],k=0;k<256;++k)j[k]=(k+256).toString(16).substr(1);var P,I,N=function(e,n){var t=n||0,r=j;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},w=T,A=N,S=0,V=0;var C=function(e,n,t){var r=n&&t||0,o=n||[],i=(e=e||{}).node||P,u=void 0!==e.clockseq?e.clockseq:I;if(null==i||null==u){var l=w();null==i&&(i=P=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==u&&(u=I=16383&(l[6]<<8|l[7]))}var a=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:V+1,s=a-S+(c-V)/1e4;if(s<0&&void 0===e.clockseq&&(u=u+1&16383),(s<0||a>S)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");S=a,V=c,I=u;var f=(1e4*(268435455&(a+=122192928e5))+c)%4294967296;o[r++]=f>>>24&255,o[r++]=f>>>16&255,o[r++]=f>>>8&255,o[r++]=255&f;var d=a/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=u>>>8|128,o[r++]=255&u;for(var p=0;p<6;++p)o[r+p]=i[p];return n||A(o)},L=T,M=N;var q=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||L)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||M(o)},D=C,R=q,H=R;H.v1=D,H.v4=R;var E=H,$=void 0,F="1px dashed #c3cdd7",B=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.data,o=e.children,i=[],u=0,l=new Map;function a(e){return(t||[]).some((function(n){return n.__uuid===e&&n.__isOpen}))}function c(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=0;s<e.length;s++){var d=e[s];if(Array.isArray(d))c(d,n,t,r);else if("object"===f(d)&&null!==d){var v=d.__uuid||E.v4(),_=a(v),y=null!==r?"".concat(r,"-").concat(s):"".concat(s),h=p({__depth:n,__index:s,__uuid:v,__parentId:t,__parentPath:r,__hasChild:!!(d[o]||[]).length,__path:y,__isRoot:null===t,__order:u,__isOpen:_,__checked:!1},o,null);Object.assign(d,{__uuid:v}),l.set(v,h),u+=1,i.push(Object.assign(Object.assign({},d),p({},o,null))),Object.prototype.hasOwnProperty.call(d,o)&&c(d[o]||[],n+1,v,y)}}}return c(n||r),[i,l]},U=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],u=e[n];return"boolean"==typeof u?u?r:o:W(t,e,n,i)},W=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n[t];if("string"==typeof o)return"object"===f(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply($,[e].concat(m(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},z=function(e,n){return W(e,n,"label")},G=function(e,n){return e.get(n)||{}},J=function(e,n,t){var r;return null===(r=G(e,n))||void 0===r?void 0:r[t]},K=function(e,n){return{"--level-line":U(n,"levelLine",e,F,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},Q=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.schema,o=J(r,e.__uuid,"__depth");return Object.assign({"--depth":o},"function"==typeof n.levelLine?{"--level-line":U(n,"levelLine",e,F,null,["node"])}:{})},X=function(e,n,t){var r=G(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},Y=function(e,n){return{"is-checked":(G(n,e.__uuid)||{}).__checked,"bk-node-row":!0}},Z=function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})},ee=t.defineComponent({name:"Tree",props:v,setup:function(e,n){var o=B(e),i=[],u=t.reactive({data:o[0],schema:o[1],levelLineSchema:{}});t.watch((function(){return[e.data]}),(function(n){var t=B(e,n,l.value);u.data=t[0],u.schema=t[1]}),{deep:!0});var l=t.computed((function(){return Array.from(u.schema.values())})),a=function(e){return u.schema.get(e)},c=function(e,n){var t;return null===(t=a(e.__uuid))||void 0===t?void 0:t[n]},s=function(e,n,t){return u.schema.set(e.__uuid,Object.assign(Object.assign({},a(e.__uuid)),p({},n,t)))},d=function(e){return c(e,"__path")},v=function(e){return c(e,"__isRoot")},_=function(e){return c(e,"__isOpen")},y=function(e){return c(e,"__hasChild")},h=t.computed((function(){return u.data.filter((function(e){return T(e)}))})),x=function(e){var n;return"object"===f(e)?_(e):"string"==typeof e&&(null===(n=a(e))||void 0===n?void 0:n.__isOpen)},b=function(e){return x(e)?t.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):t.createVNode(r.Folder,{class:"bk-tree-icon"},null)},g=function(e){if("string"==typeof e)return e;if("object"===f(e)&&null!==e){if(e.__v_isVNode)return e;var n=e.node,r=e.className,o=e.text,i=e.style;return t.h(n,{class:r,style:i},o)}return null},m=function(n,t){if("object"===f(n)&&null!==n){s(t,"__isOpen",!0);var r=Array.isArray(n)?n:[n];!function(e,n,t,r,o){Z(e,n,t,p({},r,o))}(d(t),e.data,e.children,e.children,r)}},O=function(n){if(n.async){var t=e.async||{},r=t.callback,o=void 0===r?null:r,i=t.cache,u=void 0===i||i;"function"!=typeof o||n.cached?console.error("async need to set prop: asyncLoad with function wich will return promise object"):(Object.assign(n,{loading:!0}),o(n,(function(e){return m(e,n)})).then((function(e){return m(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){Z(d(n),e.data,e.children,Object.assign({loading:!1},u?{cached:!0}:{}))})))}y(n)&&function(e){var n=!x(e);s(e,"__isOpen",n),n||h.value.filter((function(n){return String.prototype.startsWith.call(d(n),d(e))})).forEach((function(e){return s(e,"__isOpen",n)}))}(n)},T=function(e){return v(e)||x(e)||x(c(e,"__parentId"))};return{renderData:h,flatData:u,hanldeTreeNodeClick:O,handleNodeContentClick:function(e){i.includes(e.__uuid)||(i.forEach((function(e){return s({__uuid:e},"__checked",!1)})),i.length=0,s(e,"__checked",!0),i.push(e.__uuid),_(e)||O(e),n.emit("check",e,a(e.__uuid)))},handleNodeActionClick:function(e){O(e)},getActionIcon:function(n){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(v(n),y(n)||n.async,x(n),"action",n))?g(o):("default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(y(n)||n.async)?x(n)?t.createVNode(r.DownShape,null,null):t.createVNode(r.RightShape,null,null):null},getRootIcon:b,getVirtualLines:function(n){if(!e.levelLine)return null;var r=c(n,"__depth")+1;return new Array(r).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(v(n))return!1;var t=d(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),i=parseInt(o,10);r.push("".concat(i+1));var u=r.join("-");return l.value.some((function(e){return e.__path===u}))}(e,n)})).filter((function(e){return e>0})).map((function(e){return t.createVNode("span",{class:"node-virtual-line",style:(n=r-e,{"--depth":n})},null);var n}))},getNodePrefixIcon:function(n){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(v(n),y(n)||n.async,x(n),"node_type",n))?g(o):"default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon?v(n)||y(n)?b(n):t.createVNode(r.TextFile,{class:"bk-tree-icon"},null):null},getLoadingIcon:function(e){return e.loading?t.createVNode(r.Spinner,null,null):""}}},render:function(){var e=this,n=this.$props,r=function(r){return t.createVNode("div",{class:Y(r,e.flatData.schema)},[t.createVNode("div",{class:X(r,e.flatData.schema,n),style:Q(r,n,e.flatData)},[t.createVNode("span",{class:"node-action",onClick:function(){return e.handleNodeActionClick(r)}},[e.getActionIcon(r)]),t.createVNode("span",{class:"node-content",onClick:function(){return e.handleNodeContentClick(r)}},[[e.getNodePrefixIcon(r),e.getLoadingIcon(r)],t.createVNode("span",null,[z(r,n)])]),e.getVirtualLines(r)])])};return t.createVNode(l.default,{class:"bk-tree",style:K(null,n),list:this.renderData,lineHeight:n.lineHeight,enabled:n.virtualRender,throttleDelay:0},{default:function(e){return(e.data||[]).map(r)}})}}),ne=n.withInstall(ee);e.default=ne,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("vue"),require("../virtual-render"),require("../exception"),require("../checkbox"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../virtual-render","../exception","../checkbox","../icon"],n);else{var t="object"==typeof exports?n(require("../shared"),require("vue"),require("../virtual-render"),require("../exception"),require("../checkbox"),require("../icon")):n(e["../shared"],e.vue,e["../virtual-render"],e["../exception"],e["../checkbox"],e["../icon"]);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(self,((e,n,t,r,o,i)=>(()=>{var a={8022:(e,n,t)=>{var r=t(4481),o=t(6426),i=o;i.v1=r,i.v4=o,e.exports=i},8725:e=>{for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},9157:e=>{var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}},4481:(e,n,t)=>{var r,o,i=t(9157),a=t(8725),l=0,c=0;e.exports=function(e,n,t){var u=n&&t||0,s=n||[],d=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==f){var p=i();null==d&&(d=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==f&&(f=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,N=v-l+(y-c)/1e4;if(N<0&&void 0===e.clockseq&&(f=f+1&16383),(N<0||v>l)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=v,c=y,o=f;var _=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[u++]=_>>>24&255,s[u++]=_>>>16&255,s[u++]=_>>>8&255,s[u++]=255&_;var h=v/4294967296*1e4&268435455;s[u++]=h>>>8&255,s[u++]=255&h,s[u++]=h>>>24&15|16,s[u++]=h>>>16&255,s[u++]=f>>>8|128,s[u++]=255&f;for(var I=0;I<6;++I)s[u+I]=d[I];return n||a(s)}},6426:(e,n,t)=>{var r=t(9157),o=t(8725);e.exports=function(e,n,t){var i=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var l=0;l<16;++l)n[i+l]=a[l];return n||o(a)}},5800:e=>{"use strict";e.exports=o},9911:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},4212:n=>{"use strict";n.exports=e},3511:e=>{"use strict";e.exports=t},748:e=>{"use strict";e.exports=n}},l={};function c(e){var n=l[e];if(void 0!==n)return n.exports;var t=l[e]={exports:{}};return a[e](t,t.exports,c),t.exports}c.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return c.d(n,{a:n}),n},c.d=(e,n)=>{for(var t in n)c.o(n,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},c.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";c.r(u),c.d(u,{default:()=>K});var e,n,t,r=c(4212),o=c(748),i=c(3511),a=c.n(i);function l(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}!function(e){e.NODE_CLICK="nodeClick",e.NODE_COLLAPSE="nodeCollapse",e.NODE_EXPAND="nodeExpand",e.NODE_CHECKED="nodeChecked",e.NODE_DRAG_START="nodeDragStart",e.NODE_DRAG_OVER="nodeDragOver",e.NODE_DRAG_LEAVE="nodeDragLeave",e.NODE_DROP="nodeDrop"}(t||(t={}));var s,d=function(){return!0},f=(l(e={},t.NODE_CLICK,d),l(e,t.NODE_COLLAPSE,d),l(e,t.NODE_EXPAND,d),l(e,t.NODE_CHECKED,d),l(e,t.NODE_DRAG_START,d),l(e,t.NODE_DRAG_OVER,d),l(e,t.NODE_DRAG_LEAVE,d),l(e,t.NODE_DROP,d),e);!function(e){e.DEPTH="__depth",e.INDEX="__index",e.UUID="__uuid",e.PARENT_ID="__parent_id",e.HAS_CHILD="__has_child",e.PATH="__path",e.IS_ROOT="__is_root",e.ORDER="__order",e.IS_OPEN="__is_open",e.IS_CHECKED="__is_checked",e.IS_SELECTED="__is_selected",e.IS_ASYNC_INIT="__is_async_init",e.IS_MATCH="__is_match",e.IS_NULL="__IS_NULL",e.IS_CACHED="__is_cached",e.IS_ASYNC="__is_async",e.IS_LOADING="__is_loading",e.TREE_NODE_ATTR="__attr__"}(s||(s={}));var p=(l(n={},s.IS_OPEN,"isOpen"),l(n,s.IS_SELECTED,"selected"),l(n,s.IS_MATCH,"isMatch"),l(n,s.HAS_CHILD,"hasChild"),l(n,s.IS_CHECKED,"checked"),l(n,s.IS_ASYNC,"async"),l(n,s.IS_LOADING,"loading"),l(n,s.IS_ROOT,"isRoot"),n),v={data:r.PropTypes.arrayOf(r.PropTypes.any).def([]),label:r.PropTypes.oneOfType([r.PropTypes.func.def(void 0),r.PropTypes.string.def("label")]),nodeKey:r.PropTypes.string.def(void 0),children:r.PropTypes.string.def("children"),indent:r.PropTypes.number.def(18),lineHeight:r.PropTypes.number.def(32),levelLine:r.PropTypes.oneOfType([r.PropTypes.bool.def(!1),r.PropTypes.func.def(void 0),r.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:r.PropTypes.bool.def(!1),prefixIcon:r.PropTypes.oneOfType([r.PropTypes.func.def((function(){})),r.PropTypes.bool.def(!1)]).def(!0),async:r.PropTypes.shape({callback:r.PropTypes.func.def(void 0),cache:r.PropTypes.bool.def(!0),deepAutoOpen:r.PropTypes.commonType(["once","every"],"columnType").def("once")}),offsetLeft:r.PropTypes.number.def(5),search:r.PropTypes.oneOfType([r.PropTypes.shape({value:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string,r.PropTypes.bool]).def(""),match:r.PropTypes.oneOfType([r.PropTypes.commonType(["fuzzy","full"],"TreeSearchMatchType"),r.PropTypes.func]),resultType:r.PropTypes.commonType(["tree","list"],"TreeSearchResultType").def("tree"),openResultNode:r.PropTypes.bool}),r.PropTypes.string,r.PropTypes.number,r.PropTypes.bool]).def(void 0),emptyText:r.PropTypes.string.def("没有数据"),draggable:r.PropTypes.bool.def(!1),disableDrag:r.PropTypes.func.def(null),disableDrop:r.PropTypes.func.def(null),dragSort:r.PropTypes.bool.def(!1),selectable:r.PropTypes.oneOfType([r.PropTypes.bool,r.PropTypes.func]).def(!0),disabledFolderSelectable:r.PropTypes.bool.def(!1),showCheckbox:r.PropTypes.bool.def(!1),showNodeTypeIcon:r.PropTypes.bool.def(!0),selected:r.PropTypes.oneOfType([r.PropTypes.string,null,r.PropTypes.number,r.PropTypes.object]).def(null),autoCheckChildren:r.PropTypes.bool.def(!0),autoOpenParentNode:r.PropTypes.bool.def(!0),expandAll:r.PropTypes.bool.def(!1),nodeContentAction:r.PropTypes.oneOfType([r.PropTypes.arrayOf(r.PropTypes.commonType(["click","selected","expand","collapse"])),r.PropTypes.func.def((function(){return["selected"]}))]).def(["selected","expand","click"])},y=c(9911),N=c.n(y);function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}var h=c(5800),I=c.n(h),E=c(6870);const S=function(e,n){var t=function(n){return e.schema.get(n)},r=function(e,n){var r;return null===(r=t(e[s.UUID]))||void 0===r?void 0:r[n]},o=function(n,r,o){e.schema.set(n[s.UUID],Object.assign(Object.assign({},t(n[s.UUID])),l({},r,o)))},i=function(e){return r(e,s.PATH)},a=function(e){return r(e,s.UUID)},c=function(e){return r(e,s.IS_ROOT)},u=function(e){return r(e,s.IS_OPEN)},d=function(e){return r(e,s.HAS_CHILD)},f=function(e){return r(e,s.IS_MATCH)},v=function(e){return r(e,s.IS_CHECKED)},y=function(e){return r(e,s.PARENT_ID)},N=function(e){return r(l({},s.UUID,e),s.PARENT_ID)},h=function(e){var n;return"object"===_(e)?u(e):"string"==typeof e&&(null===(n=t(e))||void 0===n?void 0:n[s.IS_OPEN])},I=function(e){return e.split("-").reduce((function(e,t){var r=Number(t);return Array.isArray(e)?e[r]:e[n.children][r]}),n.data)},E=function(e){return I(i(l({},s.UUID,e)))},S=function(e){var n;return l(n={},p[s.IS_LOADING],r(e,s.IS_LOADING)),l(n,p[s.HAS_CHILD],d(e)),l(n,p[s.IS_MATCH],f(e)),l(n,p[s.IS_CHECKED],v(e)),l(n,p[s.IS_OPEN],u(e)),l(n,p[s.IS_ROOT],c(e)),l(n,"fullPath",r(e,s.PATH)),l(n,"uuid",a(e)),l(n,"parentId",r(e,s.PARENT_ID)),n};return{getSchemaVal:t,getNodeAttr:r,getNodeId:a,getNodeParentId:y,getNodeParentIdById:N,getParentNodeData:function(e){return c(l({},s.UUID,e))?l({},n.children,n.data):E(N(e))},getParentNode:function(e){return t(y(e))},setNodeAttr:o,getNodePath:i,isRootNode:c,isNodeOpened:u,hasChildNode:d,isItemOpen:h,isNodeChecked:v,isNodeMatched:f,isNodeLoading:function(e){return r(e,s.IS_LOADING)},checkNodeIsOpen:function(e){return c(e)||function(e){return h(r(e,s.PARENT_ID))}(e)},getSourceNodeByPath:I,getSourceNodeByUID:E,deleteNodeSchema:function(n){return e.schema.delete(n)},resolveScopedSlotParam:S,setTreeNodeLoading:function(e,n){o(e,s.IS_LOADING,n)},extendNodeAttr:function(e){return Object.assign(Object.assign({},e),l({},s.TREE_NODE_ATTR,S(e)))},getChildNodes:function(n){var t=e.schema;return Array.prototype.filter.call(Array.from(t.keys()),(function(e){return t.get(e)[s.PARENT_ID]===n[s.UUID]}))}}};function D(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function g(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return D(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=void 0,m="1px dashed #c3cdd7",A=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=e[n];return"boolean"==typeof a?a?r:o:C(t,e,n,i)},C=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=n[t];if("string"==typeof o)return"object"===_(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply(T,[e].concat(g(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},b=function(e,n){return C(e,n,"label")},O=function(e,n){return e.get(n)||{}},P=function(e,n,t){var r;return null===(r=O(e,n))||void 0===r?void 0:r[t]},L=function(e,n){return{"--level-line":A(n,"levelLine",e,m,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},U=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.schema,o=P(r,e[s.UUID],s.DEPTH);return Object.assign({"--depth":o},"function"==typeof n.levelLine?{"--level-line":A(n,"levelLine",e,m,null,["node"])}:{})},x=function(e,n,t){var r=O(n,e[s.UUID])||{};return{"is-root":r.__is_root,"bk-tree-node":!0,"is-open":r.__is_open,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},R=function(e,n){var t=O(n,e[s.UUID])||{};return l({"is-checked":t.__is_checked,"is-selected":t.__is_selected,"node-folder":e.is_folder,"node-leaf":e.is_leaf},(0,r.resolveClassName)("node-row"),!0)},k=function(e){return null==e?{__IS_NULL:!0}:"string"==typeof e||"number"==typeof e||"symbol"===_(e)?l({},s.UUID,e):(Object.prototype.hasOwnProperty.call(e,s.UUID)||console.error("setNodeAction Error: node id cannot found"),e)};const H=function(e,n){var t=S(n,e),r=t.setNodeAttr,o=t.getNodePath,i=t.getNodeAttr,a=t.resolveScopedSlotParam,c=t.setTreeNodeLoading,u=function(n,t){if("object"===_(n)&&null!==n){r(t,s.IS_OPEN,!0);var i=Array.isArray(n)?n:[n];return function(e,n,t,r,o){!function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})}(e,n,t,l({},r,o))}(o(t),e.data,e.children,e.children,i),Promise.resolve(n)}return Promise.resolve(n)},d=function(n){var t=e.async||{},o=t.callback,l=void 0===o?null:o,d=t.cache,f=void 0===d||d;if("function"==typeof l&&i(n,s.IS_ASYNC)){if(r(n,s.IS_ASYNC_INIT,!0),!i(n,s.IS_CACHED)){r(n,s.IS_CACHED,f);var p=a(n),v=l(n,(function(e){return u(e,n)}),p);if("object"===_(v)&&null!==v)return c(n,!0),v instanceof Promise?Promise.resolve(v.then((function(e){return u(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){c(n,!1),r(n,s.IS_CACHED,!0)}))):(u(v,n),c(n,!1),Promise.resolve(!0))}return Promise.resolve(!0)}return Promise.resolve(!0)};return{asyncNodeClick:d,deepAutoOpen:function e(){var t=n.data.filter((function(e){return i(e,s.IS_ASYNC)&&e[p[s.IS_OPEN]]&&!i(e,s.IS_ASYNC_INIT)}));t.length&&Promise.all(t.map((function(e){return d(e)}))).then((function(){e()})).catch((function(e){console.warn(e)}))}}},w=function(e,n,i,a,c,u){var d=e.selected,f=S(i,e),p=f.setNodeAttr,v=f.getNodePath,y=f.getSchemaVal,N=f.getNodeAttr,h=f.getNodeId,D=f.getChildNodes,g=f.isRootNode,T=f.hasChildNode,m=f.isItemOpen,A=f.isNodeOpened,C=f.isNodeLoading,O=f.isNodeChecked,P=f.getParentNode,L=f.resolveScopedSlotParam,w=f.extendNodeAttr,j=u.registerNextLoop,V=H(e,i),M=V.asyncNodeClick,K=V.deepAutoOpen,G=function(e){if("string"==typeof e)return e;if("object"===_(e)&&null!==e){if(e.__v_isVNode)return e;var n=e.node,t=e.className,r=e.text,i=e.style;return(0,o.h)(n,{class:t,style:i},r)}return null},q=function(t){if(n.slots.nodeAction)return n.slots.nodeAction(w(t));var i=null;return C(t)?function(e){var t,r,i;return(null!==(i=null===(r=(t=n.slots).nodeLoading)||void 0===r?void 0:r.call(t,w(e)))&&void 0!==i?i:C(e))?(0,o.createVNode)(E.Spinner,null,null):""}(t):"function"==typeof e.prefixIcon&&"default"!==(i=e.prefixIcon(w(t),"node_action"))?G(i):("default"===i||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(T(t)||t.async||!e.autoCheckChildren)?m(t)?(0,o.createVNode)(E.DownShape,{class:(0,r.resolveClassName)("node-prefix")},null):(0,o.createVNode)(E.RightShape,{class:(0,r.resolveClassName)("node-prefix")},null):null},Y=function(t){if(!e.showNodeTypeIcon)return null;if(n.slots.nodeType)return n.slots.nodeType(w(t));var i=null;return"function"==typeof e.prefixIcon&&"default"!==(i=e.prefixIcon(w(t),"node_type"))?G(i):"default"===i||"boolean"==typeof e.prefixIcon&&e.prefixIcon?g(t)||T(t)?function(e){return m(e)?(0,o.createVNode)(E.FolderShapeOpen,{class:[(0,r.resolveClassName)("tree-icon"),(0,r.resolveClassName)("node-prefix")]},null):(0,o.createVNode)(E.Folder,{class:[(0,r.resolveClassName)("tree-icon"),(0,r.resolveClassName)("node-prefix")]},null)}(t):(0,o.createVNode)(E.TextFile,{class:[(0,r.resolveClassName)("tree-icon"),(0,r.resolveClassName)("node-prefix")]},null):null},X=function e(n,t){var r=P(n);r&&(p(r,s.IS_CHECKED,t),g(r)||e(r,t))},z=function e(n,t,r){D(n).forEach((function(n){p(l({},s.UUID,n),t,r),e(l({},s.UUID,n),t,r)}))},F=function(e,r){p(e,s.IS_CHECKED,!!r),z(e,s.IS_CHECKED,!!r),X(e,r),n.emit(t.NODE_CHECKED,c.value.filter((function(e){return O(e)})).map((function(e){return e[s.UUID]})))},J=function(e){return O(e)&&!c.value.filter((function(n){var t;return null===(t=v(n))||void 0===t?void 0:t.startsWith(v(e))})).every((function(e){return O(e)}))},B=function(e){return O(e)||c.value.filter((function(n){var t;return null===(t=v(n))||void 0===t?void 0:t.startsWith(v(e))})).some((function(e){return O(e)}))},W=function(n){return e.showCheckbox?(0,o.createVNode)(I(),{size:"small",modelValue:B(n),indeterminate:J(n),onChange:function(e){return F(n,e)}},null):null},$=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=null===r?!m(e):!!r;if(a||z(e,s.IS_OPEN,a),p(e,s.IS_OPEN,a),i){var l=m(e)?t.NODE_EXPAND:t.NODE_COLLAPSE;n.emit(l,e,L(e),y(e[s.UUID]),o)}},Q=function(e,n,t){Array.isArray(e)?e.forEach((function(e){return p(k(e),n,t)})):p(k(e),n,t)},Z=function e(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=k(n);if(!o[s.IS_NULL])if(r)if(t){if(Q(o,s.IS_OPEN,!0),!g(o)){var i=N(o,s.PARENT_ID);e(i,!0,!0)}}else $(o,!1,null,!1);else Q(o,s.IS_OPEN,t)},ee=function(e,n){A(e)?$(e,!1,n):M(e).finally((function(){N(e,s.IS_LOADING)?j("setNodeOpenedAfterLoading",{type:"once",fn:function(){return $(e,!0,n)}}):$(e,!0,n)}))},ne=function n(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Array.isArray(t)?t:[t];if(a.length){var c=k(a[0]);c[s.IS_NULL]||(!e.selectable||"function"==typeof e.selectable&&!e.selectable(t)||e.disabledFolderSelectable&&!0===(null==t?void 0:t.is_folder)?console.warn("props.selectable is false or undefined, please set selectable with true"):(null!=d&&p(l({},s.UUID,d),s.IS_SELECTED,!r),e.selected&&e.selected!==d&&p(l({},s.UUID,e.selected),s.IS_SELECTED,!r),p(c,s.IS_SELECTED,r),d=h(c),i&&1===a.length&&Z(c,!0,!0),N(c,s.IS_ASYNC)&&M(c).then((function(){(0,o.nextTick)((function(){a.shift(),n(a,r,i)}))}))))}},te=function(n){if(!e.levelLine)return null;var t=N(n,s.DEPTH)+1;return new Array(t).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(g(n))return!1;var t=v(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),i=parseInt(o,10);r.push("".concat(i+1));var a=r.join("-");return c.value.some((function(e){return e[s.PATH]===a}))}(e,n)})).filter((function(e){return e>0})).map((function(e){return(0,o.createVNode)("span",{class:"node-virtual-line",style:(n=t-e,{"--depth":n})},null);var n}))};return{renderTreeNode:function(a){var l,c,u,d,f;return(0,o.createVNode)("div",{"data-tree-node":h(a),key:h(a),class:R(a,i.schema)},[(0,o.createVNode)("div",{class:x(a,i.schema,e),style:U(a,e,i),onClick:function(r){return function(r,o){var i,a=(i=r,"function"==typeof e.nodeContentAction?Reflect.apply(e.nodeContentAction,void 0,[{node:i}]):"string"==typeof e.nodeContentAction?[e.nodeContentAction]:Array.isArray(e.nodeContentAction)?e.nodeContentAction:["selected","expand","click"]);if(a.includes("selected")&&ne(r,!0,!1),a.includes("expand")&&(A(r)||ee(r,o)),a.includes("collapse")&&A(r)&&ee(r,o),a.includes("click")){var l=t.NODE_CLICK;n.emit(l,r,L(r),y(r[s.UUID]),o)}}(a,r)}},[(0,o.createVNode)("div",{class:[(0,r.resolveClassName)("node-action")],onClick:function(e){return function(e,n){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),ee(n,e)}(e,a)}},[q(a)]),(0,o.createVNode)("div",{class:(0,r.resolveClassName)("node-content")},[[W(a),Y(a)],(0,o.createVNode)("span",{class:(0,r.resolveClassName)("node-text")},[null!==(u=null===(c=(l=n.slots).node)||void 0===c?void 0:c.call(l,w(a)))&&void 0!==u?u:[b(a,e)]]),null===(f=(d=n.slots).nodeAppend)||void 0===f?void 0:f.call(d,w(a))]),te(a)])])},handleTreeNodeClick:ee,deepAutoOpen:K,asyncNodeClick:M,setNodeAction:Q,setNodeOpened:$,setSelect:ne,setOpen:Z}};var j=c(8022),V=void 0;const M=(0,o.defineComponent)({name:"Tree",props:v,emits:f,setup:function(e,n){var i=function(e){var n,t=function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=e.data,i=e.children,a=[],c=[],u=0,d=new Map;function f(e,n,t,r){if(null!=e&&d.has(e)&&![s.UUID,s.PARENT_ID].includes(n)){var o=d.get(e);Object.prototype.hasOwnProperty.call(o,n)&&"function"==typeof r&&Reflect.apply(r,self,[o,n,t])&&(Object.assign(o,l({},n,t)),f(o[s.PARENT_ID],n,t,r))}}function v(n){var t=null;return"string"==typeof e.nodeKey&&(t=n[e.nodeKey]||(0,j.v4)()),t||n[s.UUID]||(0,j.v4)()}var y=(l(n={},s.IS_OPEN,(function(){return!!e.expandAll})),l(n,s.IS_CHECKED,(function(){return!1})),l(n,s.IS_MATCH,(function(){return!0})),l(n,s.IS_SELECTED,(function(n){return e.selected===n})),l(n,s.IS_CACHED,(function(){return!1})),l(n,s.IS_ASYNC,(function(){return null})),l(n,s.IS_LOADING,(function(){return!1})),n);function N(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=o;void 0===o&&"function"==typeof y[t]&&(i=y[t](e,n));var a=p[t];if(Object.prototype.hasOwnProperty.call(n,a))return n[a];var l=(r||[]).find((function(n){return n[s.UUID]===e})),c=void 0;return l&&(c=l[t]),null==c&&(c=i),c}function h(n,t){return!!e.selectable&&N(n,t,s.IS_SELECTED,e.selected===n)}function I(e,n,t){var r,o=N(e,n,s.IS_OPEN),i=!d.has(t)||(null===(r=d.get(t))||void 0===r?void 0:r[s.IS_OPEN]);return o&&i}function E(e){return!e[s.IS_OPEN]}function S(n){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,p=n.length,y=0;y<p;y++){var D=n[y];if(Array.isArray(D))S(D,t,r,o);else if("object"===_(D)&&null!==D){var g,T,m=null!==o?"".concat(o,"-").concat(y):"".concat(y),A="".concat(v(D)),C=!!(D[i]||[]).length,b=N(A,D,s.IS_OPEN);e.autoOpenParentNode?b&&f(r,s.IS_OPEN,!0,E):b=I(A,D,r),Object.assign(D,l({},s.UUID,A));var O=e.showCheckbox&&N(A,D,s.IS_CHECKED);O&&a.push(A),d.set(A,(l(g={},s.DEPTH,t),l(g,s.INDEX,y),l(g,s.UUID,A),l(g,s.PARENT_ID,r),l(g,s.HAS_CHILD,C),l(g,s.PATH,m),l(g,s.IS_ROOT,null===r),l(g,s.ORDER,u),l(g,s.IS_SELECTED,h(A,D)),l(g,s.IS_MATCH,N(A,D,s.IS_MATCH)),l(g,s.IS_OPEN,b),l(g,s.IS_CHECKED,O),l(g,s.IS_CACHED,N(A,D,s.IS_CACHED)),l(g,s.IS_ASYNC,N(A,D,s.IS_ASYNC)),l(g,s.IS_LOADING,N(A,D,s.IS_LOADING)),l(g,i,null),g)),u+=1,c.push(Object.assign(Object.assign({},JSON.parse(JSON.stringify(D,(function(n,t){return n===e.children?null:t})))),(l(T={},s.IS_OPEN,b),l(T,i,null),T))),Object.prototype.hasOwnProperty.call(D,i)&&S(D[i]||[],t+1,A,m)}}}return S(t||o),e.showCheckbox&&(null==a||a.forEach((function(e){Array.from(d.values()).filter((function(n){var t;return null===(t=n[s.PATH])||void 0===t?void 0:t.startsWith(d.get(e)[s.PATH])})).forEach((function(e){return Object.assign(e,l({},s.IS_CHECKED,!0))})),f(e,s.IS_CHECKED,!0,(function(){return!0}))}))),[c,d]},r=t(e),i=new Map,a=[],c=[],u=(0,o.reactive)({data:r[0],schema:r[1],levelLineSchema:{}}),d=(0,o.computed)((function(){return Array.from(u.schema.values())})),f=H(e,u),v=f.asyncNodeClick,y=f.deepAutoOpen,N=function(e,n){(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&i.has(e)&&i.delete(e),i.set(e,n)},h=function(e){var n,t=function(e){return"function"==typeof e?{type:"loop",fn:e}:"object"===_(e)&&"string"==typeof e.type&&"function"==typeof e.fn?e:(console.error("loop event error",e),null)}(e);return null!==t&&Reflect.apply(t.fn,V,[]),null!==(n=null==t?void 0:t.type)&&void 0!==n?n:"once"};return(0,o.watch)((function(){return[e.data]}),(function(n){var r,o,a=t(e,n,d.value);u.data=a[0],u.schema=a[1],(null===(r=e.async)||void 0===r?void 0:r.callback)&&"every"===(null===(o=e.async)||void 0===o?void 0:o.deepAutoOpen)&&y(),Array.from(i.keys()).forEach((function(e){var n=i.get(e);if(Array.isArray(n)){var t=[];n.forEach((function(e,n){"once"===h(e)&&t.unshift(n)})),t.length&&t.forEach((function(e){return n.splice(e,1)})),0===n.length&&i.delete(e)}else"once"===h(n)&&i.delete(e)}))}),{deep:!0}),e.selectable&&(0,o.onMounted)((function(){(0,o.watch)((function(){return e.selected}),(function(e){c.length=0,a.forEach((function(n){Reflect.apply(n,V,[e]),c.push((function(){return Reflect.apply(n,V,[e])}))})),N("afterSelectWatch",c)}),{immediate:!0})})),(null===(n=e.async)||void 0===n?void 0:n.callback)&&y(),{flatData:u,schemaValues:d,asyncNodeClick:v,deepAutoOpen:y,afterDataUpdate:function(e){N("afterDataUpdate",e)},registerNextLoop:N,onSelected:function(e){a.push(e)}}}(e),c=i.flatData,u=i.schemaValues,d=i.onSelected,f=i.registerNextLoop,v=S(c,e),y=v.setNodeAttr,h=v.checkNodeIsOpen,I=v.getNodeAttr,E=v.getNodePath,D=v.isRootNode,g=v.isNodeOpened,T=v.isNodeChecked,m=v.isNodeMatched,A=v.hasChildNode,C=function(e){var n,t=(0,o.toRef)(e,"search"),r=null!==(n=e.search)&&void 0!==n?n:{},i=r.openResultNode,a=void 0!==i&&i,l=r.resultType,c=void 0===l?"tree":l,u=function(e){return["string","number","boolean"].includes(_(e))},s=function(e,n){return e===n},d=function(e,n){return new RegExp("".concat(e),"i").test("".concat(n))},f=function(e,n){return Reflect.apply(e,void 0,n)},p=void 0===t.value||!1===t.value,v=(0,o.computed)((function(){return!1!==t.value&&(u(t.value)?"".concat(t.value).length>0:"object"===_(t.value))}));return{searchFn:function(e,n){if(p)return!0;if(u(t.value))return f(d,[t.value,e,n]);var r=t.value,o=r.value,i=void 0===o?"":o,a=r.match,l=void 0===a?"fuzzy":a,c="function"==typeof l?l:"fuzzy"===l?d:s;return 0==="".concat(i).length||f(c,[i,e,n])},refSearch:t,isSearchActive:v,isSearchDisabled:p,openResultNode:a,resultType:c,isTreeUI:"tree"===c}}(e),O=C.searchFn,P=C.isSearchActive,U=C.refSearch,x=C.openResultNode,R=C.isTreeUI;C.isSearchDisabled||(0,o.watch)([U],(function(){c.data.forEach((function(n){var t=O(b(n,e),n);y(n,s.IS_MATCH,t),x&&X(n,!0,!0)}))}));var M=(0,o.computed)((function(){return c.data.filter((function(e){return h(e)&&function(e){return!P.value||(I(e,s.IS_MATCH)||!!R&&u.value.some((function(n){var t;return(null===(t=n[s.PATH])||void 0===t?void 0:t.startsWith(E(e)))&&n[s.IS_MATCH]})))}(e)}))})),K=w(e,n,c,0,u,{registerNextLoop:f}),G=K.renderTreeNode,q=K.handleTreeNodeClick,Y=K.setNodeOpened,X=K.setOpen,z=K.setNodeAction,F=K.setSelect,J=K.asyncNodeClick;d((function(n){F(n,!0,e.autoOpenParentNode)})),n.expose({handleTreeNodeClick:q,isNodeChecked:T,isRootNode:D,isNodeOpened:g,isNodeMatched:m,hasChildNode:A,setOpen:X,setChecked:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];z(k(e),s.IS_CHECKED,n)},setNodeAction:z,setNodeOpened:Y,setSelect:F,asyncNodeClick:J,getData:function(){return c}});var B=(0,o.ref)(),W=function(e,n){var t=n.slots;return{renderEmpty:function(n){var r,i;return(0,o.createVNode)(N(),{scene:"part",type:n},{default:function(){return[null!==(i=null===(r=t.default)||void 0===r?void 0:r.call(t))&&void 0!==i?i:e.emptyText]}})}}}(e,n),$=W.renderEmpty;return function(e,n,r,i){var a=S(i,e),c=a.getSourceNodeByUID,u=a.getNodeParentIdById,d=a.getParentNodeData,f=a.getNodeAttr,p=a.getNodePath,v=a.isRootNode,y=(0,o.computed)((function(){return"function"==typeof e.disableDrag})),N=(0,o.computed)((function(){return"function"==typeof e.disableDrop})),_=function(e){return e.target.closest("[data-tree-node]")},h=function(e){var n,t=null===(n=null==e?void 0:e.dataset)||void 0===n?void 0:n.treeNode;return c(t)},I=function e(n){_(n).removeEventListener("mouseup",e)},E=function(n){var t=_(n),r=h(t);!1===r.draggable||y.value&&e.disableDrag(r)?t.classList.add("bk-tree-drag-disabled"):(t.setAttribute("draggable","true"),t.addEventListener("mouseup",I))},D=function(r){r.preventDefault();var o=_(r),i=h(o);if(n.emit(t.NODE_DRAG_OVER,r,o,i),N.value&&(null==e?void 0:e.disableDrop(i)))return r.dataTransfer.effectAllowed="move",r.dataTransfer.dropEffect="none",void o.classList.add("bk-tree-drop-disabled");o.classList.add("bk-tree-drop-active");var a=r.dataTransfer.getData("node-id"),l=o.getAttribute("data-tree-node"),c=m(a,l)?"move":"none";r.dataTransfer.effectAllowed=c,r.dataTransfer.dropEffect=c},g=function(e){e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move";var r=_(e);e.dataTransfer.setData("text/plain",""),e.dataTransfer.setData("node-id",r.getAttribute("data-tree-node")),n.emit(t.NODE_DRAG_START,e,r)},T=function(r){r.preventDefault(),r.stopPropagation();var o=_(r);o.classList.remove("bk-tree-drop-active","bk-tree-drop-disabled");var i=h(o);if(!N.value||!e.disableDrop(i)){var a=r.dataTransfer.getData("node-id"),l=o.getAttribute("data-tree-node");Reflect.apply(e.dragSort?A:C,void 0,[a,l]),n.emit(t.NODE_DROP,r,o,i)}},m=function(e,n){var t=p(l({},s.UUID,e)),r=p(l({},s.UUID,n));return u(e)===u(n)||-1===t.indexOf(r)&&-1===r.indexOf(t)},A=function(n,t){if(m(n,t)){var r=JSON.parse(JSON.stringify(c(n))),o=JSON.parse(JSON.stringify(c(t))),i=d(n),a=d(t),u=f(l({},s.UUID,n),s.INDEX),p=f(l({},s.UUID,t),s.INDEX);null==i||i[e.children].splice(u,1,o),null==a||a[e.children].splice(p,1,r)}},C=function(n,t){var r=c(n),o=c(t),i=null;if(v(l({},s.UUID,n)))i=e.data;else{var a=u(n);if(null!=a){i=c(a);var d=f(l({},s.UUID,n),s.INDEX);null==i||i[e.children].splice(d,1)}}o[e.children]||(o[e.children]=[]),o[e.children].unshift(r)},b=function(e){e.preventDefault();var r=_(e);r.classList.remove("bk-tree-drop-active","bk-tree-drop-disabled"),n.emit(t.NODE_DRAG_LEAVE,e,r)};(0,o.onMounted)((function(){if(e.draggable&&r.value){var n=r.value.$el;n.addEventListener("mousedown",E),n.addEventListener("dragstart",g),n.addEventListener("dragover",D),n.addEventListener("dragleave",b),n.addEventListener("drop",T)}})),(0,o.onUnmounted)((function(){if(e.draggable&&r.value){var n=r.value.$el;n.removeEventListener("mousedown",E),n.removeEventListener("dragstart",g),n.removeEventListener("dragover",D),n.removeEventListener("dragleave",b),n.removeEventListener("drop",T)}}))}(e,n,B,c),function(){return(0,o.createVNode)(a(),{class:(0,r.resolveClassName)("tree"),style:L(null,e),list:M.value,lineHeight:e.lineHeight,enabled:e.virtualRender,contentClassName:(0,r.resolveClassName)("container"),throttleDelay:0,ref:B},{default:function(e){return function(e){if(e.length)return e.map(G);var n=P.value?"search-empty":"empty";return $(n)}(e.data||[])}})}}}),K=(0,r.withInstall)(M)})(),u})()));
@@ -19,6 +19,15 @@ export declare const treeProps: {
19
19
  * 指定节点标签为节点对象的某个属性值
20
20
  */
21
21
  label: import("vue-types").VueTypeDef<any>;
22
+ /**
23
+ * 每个树节点用来作为唯一标识的属性,此标识应该是唯一的
24
+ * 如果设置系统会默认自动生成唯一id
25
+ */
26
+ nodeKey: import("vue-types").VueTypeValidableDef<string> & {
27
+ default: string;
28
+ } & {
29
+ default: string;
30
+ };
22
31
  /**
23
32
  * 子节点 Key, 用于读取子节点
24
33
  * 默认 children
@@ -80,10 +89,125 @@ export declare const treeProps: {
80
89
  } & {
81
90
  default: number;
82
91
  };
92
+ /**
93
+ * 搜索配置
94
+ * 可以为一个配置项 SearchOption
95
+ * 或者直接为一个字符串,如果直接为字符串则模糊匹配此值
96
+ */
97
+ search: import("vue-types").VueTypeDef<string | number | boolean | SearchOption> & {
98
+ default: string | number | boolean | (() => SearchOption);
99
+ };
100
+ emptyText: import("vue-types").VueTypeValidableDef<string> & {
101
+ default: string;
102
+ } & {
103
+ default: string;
104
+ };
105
+ draggable: import("vue-types").VueTypeValidableDef<boolean> & {
106
+ default: boolean;
107
+ } & {
108
+ default: boolean;
109
+ };
110
+ disableDrag: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
111
+ default: (...args: any[]) => any;
112
+ } & {
113
+ default: (...args: any[]) => any;
114
+ };
115
+ disableDrop: import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
116
+ default: (...args: any[]) => any;
117
+ } & {
118
+ default: (...args: any[]) => any;
119
+ };
120
+ /**
121
+ * 节点拖拽时可交换位置(开启拖拽可交换位置后将不支持改变层级)
122
+ */
123
+ dragSort: import("vue-types").VueTypeValidableDef<boolean> & {
124
+ default: boolean;
125
+ } & {
126
+ default: boolean;
127
+ };
128
+ /**
129
+ * 节点是否可以选中
130
+ */
131
+ selectable: import("vue-types").VueTypeDef<any> & {
132
+ default: any;
133
+ };
134
+ disabledFolderSelectable: import("vue-types").VueTypeValidableDef<boolean> & {
135
+ default: boolean;
136
+ } & {
137
+ default: boolean;
138
+ };
139
+ /**
140
+ * 是否支持多选
141
+ */
142
+ showCheckbox: import("vue-types").VueTypeValidableDef<boolean> & {
143
+ default: boolean;
144
+ } & {
145
+ default: boolean;
146
+ };
147
+ /**
148
+ * 是否显示节点类型Icon
149
+ */
150
+ showNodeTypeIcon: import("vue-types").VueTypeValidableDef<boolean> & {
151
+ default: boolean;
152
+ } & {
153
+ default: boolean;
154
+ };
155
+ /**
156
+ * 默认选中的节点id,selectable为false时无效
157
+ */
158
+ selected: import("vue-types").VueTypeDef<string | number | {
159
+ [key: string]: any;
160
+ }> & {
161
+ default: string | number | (() => {
162
+ [key: string]: any;
163
+ });
164
+ };
165
+ /**
166
+ * 是否自动检查当前节点是否有子节点
167
+ * 节点前面的展开收起Icon会根据判定值做改变
168
+ * 如果需要自已控制,请设置为false
169
+ */
170
+ autoCheckChildren: import("vue-types").VueTypeValidableDef<boolean> & {
171
+ default: boolean;
172
+ } & {
173
+ default: boolean;
174
+ };
175
+ /**
176
+ * 如果设置了某一个叶子节点状态为展开,是否自动展开所有父级节点
177
+ * 默认为true,如果设置为false,则每层状态需要自己控制
178
+ */
179
+ autoOpenParentNode: import("vue-types").VueTypeValidableDef<boolean> & {
180
+ default: boolean;
181
+ } & {
182
+ default: boolean;
183
+ };
184
+ /**
185
+ * 默认是否展开所有节点
186
+ */
187
+ expandAll: import("vue-types").VueTypeValidableDef<boolean> & {
188
+ default: boolean;
189
+ } & {
190
+ default: boolean;
191
+ };
192
+ /**
193
+ * 节点内容点击行为
194
+ * 此处配置每个节点除了展开\收起箭头之外的内容块时的行为
195
+ * 默认为 ['selected', 'expand', 'click'],点击内容块为选中当前节点
196
+ */
197
+ nodeContentAction: import("vue-types").VueTypeDef<any> & {
198
+ default: any;
199
+ };
83
200
  };
84
201
  declare type AsyncOption = {
85
202
  callback: (item: any, cb: any) => Promise<any>;
86
203
  cache: Boolean;
204
+ deepAutoOpen?: string;
205
+ };
206
+ export declare type SearchOption = {
207
+ value: string | number | boolean;
208
+ match: string | Function;
209
+ resultType: string;
210
+ openResultNode: boolean;
87
211
  };
88
212
  export declare type TreePropTypes = Readonly<ExtractPropTypes<typeof treeProps>>;
89
213
  export {};
package/lib/tree/tree.css CHANGED
@@ -1,20 +1,154 @@
1
+ .bk-F-scroll-x {
2
+ overflow-x: auto;
3
+ scrollbar-color: #a0a0a0 transparent;
4
+ scrollbar-width: thin;
5
+ }
6
+ .bk-F-scroll-x::-webkit-scrollbar {
7
+ height: 6px;
8
+ }
9
+ .bk-F-scroll-y {
10
+ overflow-y: auto;
11
+ }
12
+ .bk-F-scroll-y::-webkit-scrollbar {
13
+ width: 4px;
14
+ }
15
+ .bk-F-scroll-y::-webkit-scrollbar-thumb {
16
+ border-radius: 4px;
17
+ }
18
+ .bk-virtual-render {
19
+ position: relative;
20
+ }
21
+ .bk-virtual-render .bk-virtual-content,
22
+ .bk-virtual-render.bk-virtual-content {
23
+ position: absolute;
24
+ top: 0;
25
+ bottom: 0;
26
+ left: 0;
27
+ width: 100%;
28
+ height: 100%;
29
+ }
30
+ .bk-virtual-render .bk-virtual-section {
31
+ width: 1px;
32
+ background: transparent;
33
+ }
34
+ .bk-checkbox {
35
+ display: inline-flex;
36
+ justify-self: center;
37
+ font-size: 14px;
38
+ line-height: 18px;
39
+ letter-spacing: normal;
40
+ color: #63656e;
41
+ cursor: pointer;
42
+ user-select: none;
43
+ }
44
+ .bk-checkbox ~ .bk-checkbox {
45
+ margin-left: 30px;
46
+ }
47
+ .bk-checkbox.is-checked .bk-checkbox-input {
48
+ background: #3a84ff;
49
+ border-color: #3a84ff;
50
+ transition: all 0.1s;
51
+ }
52
+ .bk-checkbox.is-checked .bk-checkbox-input.small::after {
53
+ width: 3px;
54
+ height: 6px;
55
+ }
56
+ .bk-checkbox.is-checked .bk-checkbox-input::after {
57
+ position: absolute;
58
+ top: 50%;
59
+ left: 50%;
60
+ width: 4px;
61
+ height: 8px;
62
+ border: 2px solid #fff;
63
+ border-top: 0;
64
+ border-left: 0;
65
+ content: '';
66
+ transform: translate(-50%, -60%) scaleY(1) rotate(45deg);
67
+ transform-origin: center;
68
+ }
69
+ .bk-checkbox.is-indeterminated .bk-checkbox-input {
70
+ background: #3a84ff;
71
+ border-color: #3a84ff;
72
+ transition: all 0.1s;
73
+ }
74
+ .bk-checkbox.is-indeterminated .bk-checkbox-input.small::after {
75
+ width: 6px;
76
+ height: 2px;
77
+ }
78
+ .bk-checkbox.is-indeterminated .bk-checkbox-input::after {
79
+ position: absolute;
80
+ top: 50%;
81
+ left: 50%;
82
+ width: 8px;
83
+ height: 2px;
84
+ background: #fff;
85
+ border: none;
86
+ border-radius: 2px;
87
+ content: '';
88
+ transform: translate(-50%, -50%);
89
+ }
90
+ .bk-checkbox.is-disabled {
91
+ color: #c4c6cc;
92
+ cursor: not-allowed;
93
+ }
94
+ .bk-checkbox.is-disabled .bk-checkbox-input {
95
+ background: #fafbfd;
96
+ border-color: #dcdee5;
97
+ }
98
+ .bk-checkbox.is-disabled .bk-checkbox-input::after {
99
+ background: #dcdee5;
100
+ }
101
+ .bk-checkbox.is-disabled.is-checked .bk-checkbox-input {
102
+ background: #dcdee5;
103
+ }
104
+ .bk-checkbox .bk-checkbox-input {
105
+ position: relative;
106
+ display: inline-block;
107
+ width: 16px;
108
+ height: 16px;
109
+ margin-right: 5px;
110
+ vertical-align: middle;
111
+ border: 1px solid #979ba5;
112
+ border-radius: 2px;
113
+ }
114
+ .bk-checkbox .bk-checkbox-input.small {
115
+ width: 14px;
116
+ height: 14px;
117
+ }
118
+ .bk-checkbox .bk-checkbox-original {
119
+ position: absolute;
120
+ top: 0;
121
+ left: 0;
122
+ z-index: -1;
123
+ width: 0;
124
+ height: 0;
125
+ }
126
+ .bk-checkbox .bk-checkbox-label {
127
+ display: inline-block;
128
+ vertical-align: middle;
129
+ }
130
+ .bk-tree {
131
+ font-size: 14px;
132
+ }
1
133
  .bk-tree .bk-node-row {
2
134
  padding-left: calc(var(--offset-left));
3
135
  }
4
- .bk-tree .bk-node-row.is-checked {
5
- background-color: #EBF2FF;
136
+ .bk-tree .bk-node-row.is-selected {
137
+ background-color: #ebf2ff;
6
138
  }
7
- .bk-tree .bk-tree-node {
139
+ .bk-tree-node {
8
140
  position: relative;
141
+ display: flex;
9
142
  height: var(--lineHeight);
10
143
  padding-left: 0;
11
144
  line-height: var(--lineHeight);
12
145
  cursor: pointer;
146
+ align-items: center;
13
147
  }
14
- .bk-tree .bk-tree-node:not(.is-root) {
148
+ .bk-tree-node:not(.is-root) {
15
149
  margin-left: calc(var(--depth)*var(--indent));
16
150
  }
17
- .bk-tree .bk-tree-node:not(.is-root).level-line::before {
151
+ .bk-tree-node:not(.is-root).level-line::before {
18
152
  position: absolute;
19
153
  top: calc(50% + 1px);
20
154
  left: calc(0px - var(--indent) + 6px);
@@ -25,18 +159,56 @@
25
159
  border-bottom: var(--level-line);
26
160
  content: '';
27
161
  }
28
- .bk-tree .bk-tree-node .node-virtual-line {
29
- display: inline-block;
162
+ .bk-tree-node.is-open .bk-node-action {
163
+ color: #63656e;
164
+ }
165
+ .bk-tree-node .node-virtual-line {
30
166
  position: absolute;
31
- left: calc(var(--depth) * var(--indent) * -1 + 6px);
32
167
  top: -12px;
33
168
  bottom: 50%;
169
+ left: calc(var(--depth) * var(--indent) * -1 + 6px);
170
+ display: inline-block;
34
171
  width: 0;
35
172
  border-left: var(--level-line);
36
173
  }
37
- .bk-tree .bk-tree-node .bk-tree-icon {
174
+ .bk-tree-node .bk-node-prefix {
175
+ display: flex;
176
+ width: 14px;
177
+ height: 14px;
178
+ align-items: center;
179
+ justify-content: center;
180
+ }
181
+ .bk-tree-node .bk-node-action {
182
+ margin-right: 6px;
183
+ color: #979ba5;
184
+ }
185
+ .bk-tree-node .bk-tree-icon {
38
186
  margin: 0 6px 0 4px;
39
187
  }
40
- .bk-tree .bk-tree-node .node-content {
41
- display: inline-block;
188
+ .bk-tree-node .bk-node-content {
189
+ display: flex;
190
+ flex: 1;
191
+ align-items: center;
192
+ min-width: 0;
193
+ }
194
+ .bk-tree-node .bk-node-content .bk-checkbox {
195
+ margin: 0;
196
+ }
197
+ .bk-tree-node .bk-node-content .bk-checkbox .bk-checkbox-input {
198
+ margin: 0;
199
+ }
200
+ .bk-tree-node .bk-node-content .bk-node-text {
201
+ flex: 1;
202
+ overflow: hidden;
203
+ text-overflow: ellipsis;
204
+ white-space: nowrap;
205
+ }
206
+ .bk-tree-drop-active {
207
+ background: #f5f7fa;
208
+ }
209
+ .bk-tree-drop-disabled {
210
+ background: #ffd5d5;
211
+ }
212
+ .bk-tree-drop-disabled .bk-tree-node {
213
+ cursor: no-drop;
42
214
  }