cy-element-ui 1.0.87 → 1.1.1

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 (959) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +148 -172
  3. package/lib/index.js +1 -58539
  4. package/package.json +150 -159
  5. package/packages/alert/index.js +8 -8
  6. package/packages/alert/src/main.vue +94 -94
  7. package/packages/aside/index.js +8 -8
  8. package/packages/aside/src/main.vue +20 -20
  9. package/packages/autocomplete/index.js +8 -8
  10. package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -76
  11. package/packages/autocomplete/src/autocomplete.vue +285 -285
  12. package/packages/avatar/index.js +8 -8
  13. package/packages/avatar/src/main.vue +107 -107
  14. package/packages/backtop/index.js +8 -8
  15. package/packages/backtop/src/main.vue +110 -110
  16. package/packages/badge/index.js +8 -8
  17. package/packages/badge/src/main.vue +53 -53
  18. package/packages/breadcrumb/index.js +8 -8
  19. package/packages/breadcrumb/src/breadcrumb-item.vue +41 -41
  20. package/packages/breadcrumb/src/breadcrumb.vue +34 -34
  21. package/packages/breadcrumb-item/index.js +8 -8
  22. package/packages/button/index.js +8 -8
  23. package/packages/button/src/button-group.vue +10 -10
  24. package/packages/button/src/button.vue +78 -78
  25. package/packages/button-group/index.js +8 -8
  26. package/packages/calendar/index.js +8 -8
  27. package/packages/calendar/src/date-table.vue +200 -200
  28. package/packages/calendar/src/main.vue +280 -280
  29. package/packages/card/index.js +8 -8
  30. package/packages/card/src/main.vue +23 -23
  31. package/packages/carousel/index.js +8 -8
  32. package/packages/carousel/src/item.vue +138 -138
  33. package/packages/carousel/src/main.vue +315 -315
  34. package/packages/carousel-item/index.js +8 -8
  35. package/packages/cascader/index.js +8 -8
  36. package/packages/cascader/src/cascader.vue +663 -663
  37. package/packages/cascader-panel/index.js +8 -8
  38. package/packages/cascader-panel/src/cascader-menu.vue +138 -138
  39. package/packages/cascader-panel/src/cascader-node.vue +246 -246
  40. package/packages/cascader-panel/src/cascader-panel.vue +391 -391
  41. package/packages/cascader-panel/src/node.js +166 -165
  42. package/packages/cascader-panel/src/store.js +58 -57
  43. package/packages/checkbox/index.js +8 -8
  44. package/packages/checkbox/src/checkbox-button.vue +199 -199
  45. package/packages/checkbox/src/checkbox-group.vue +48 -48
  46. package/packages/checkbox/src/checkbox.vue +222 -222
  47. package/packages/checkbox-button/index.js +8 -8
  48. package/packages/checkbox-group/index.js +8 -8
  49. package/packages/col/index.js +9 -9
  50. package/packages/col/src/col.js +71 -71
  51. package/packages/collapse/index.js +9 -9
  52. package/packages/collapse/src/collapse-item.vue +114 -114
  53. package/packages/collapse/src/collapse.vue +73 -73
  54. package/packages/collapse-item/index.js +8 -8
  55. package/packages/color-picker/index.js +8 -8
  56. package/packages/color-picker/src/color.js +317 -317
  57. package/packages/color-picker/src/components/alpha-slider.vue +132 -132
  58. package/packages/color-picker/src/components/hue-slider.vue +123 -123
  59. package/packages/color-picker/src/components/picker-dropdown.vue +121 -121
  60. package/packages/color-picker/src/components/predefine.vue +61 -61
  61. package/packages/color-picker/src/components/sv-panel.vue +100 -100
  62. package/packages/color-picker/src/draggable.js +36 -36
  63. package/packages/color-picker/src/main.vue +188 -188
  64. package/packages/container/index.js +8 -8
  65. package/packages/container/src/main.vue +33 -33
  66. package/packages/date-picker/index.js +8 -8
  67. package/packages/date-picker/src/basic/date-table.vue +441 -441
  68. package/packages/date-picker/src/basic/month-table.vue +269 -268
  69. package/packages/date-picker/src/basic/time-spinner.vue +304 -304
  70. package/packages/date-picker/src/basic/year-table.vue +111 -111
  71. package/packages/date-picker/src/panel/date-range.vue +680 -680
  72. package/packages/date-picker/src/panel/date.vue +609 -609
  73. package/packages/date-picker/src/panel/month-range.vue +289 -289
  74. package/packages/date-picker/src/panel/time-range.vue +248 -248
  75. package/packages/date-picker/src/panel/time-select.vue +178 -178
  76. package/packages/date-picker/src/panel/time.vue +186 -186
  77. package/packages/date-picker/src/picker/date-picker.js +43 -43
  78. package/packages/date-picker/src/picker/time-picker.js +39 -39
  79. package/packages/date-picker/src/picker/time-select.js +21 -21
  80. package/packages/date-picker/src/picker.vue +932 -390
  81. package/packages/descriptions/index.js +8 -8
  82. package/packages/descriptions/src/descriptions-item.js +30 -30
  83. package/packages/descriptions/src/descriptions-row.js +116 -116
  84. package/packages/descriptions/src/index.js +180 -180
  85. package/packages/descriptions-item/index.js +8 -8
  86. package/packages/dialog/index.js +8 -8
  87. package/packages/dialog/src/component.vue +212 -212
  88. package/packages/divider/index.js +8 -8
  89. package/packages/divider/src/main.vue +37 -37
  90. package/packages/drawer/index.js +8 -8
  91. package/packages/drawer/src/main.vue +205 -205
  92. package/packages/dropdown/index.js +8 -8
  93. package/packages/dropdown/src/dropdown-item.vue +37 -37
  94. package/packages/dropdown/src/dropdown-menu.vue +63 -63
  95. package/packages/dropdown/src/dropdown.vue +293 -293
  96. package/packages/dropdown-item/index.js +8 -8
  97. package/packages/dropdown-menu/index.js +8 -8
  98. package/packages/empty/index.js +7 -7
  99. package/packages/empty/src/img-empty.vue +132 -132
  100. package/packages/empty/src/index.vue +50 -50
  101. package/packages/footer/index.js +8 -8
  102. package/packages/footer/src/main.vue +20 -20
  103. package/packages/form/index.js +8 -8
  104. package/packages/form/src/form-item.vue +294 -334
  105. package/packages/form/src/form.vue +182 -182
  106. package/packages/form/src/label-wrap.vue +78 -0
  107. package/packages/form-item/index.js +8 -8
  108. package/packages/header/index.js +8 -8
  109. package/packages/header/src/main.vue +20 -20
  110. package/packages/icon/index.js +8 -8
  111. package/packages/icon/src/icon.vue +13 -13
  112. package/packages/image/index.js +8 -8
  113. package/packages/image/src/image-viewer.vue +330 -330
  114. package/packages/image/src/main.vue +249 -249
  115. package/packages/infinite-scroll/index.js +8 -8
  116. package/packages/infinite-scroll/src/main.js +150 -149
  117. package/packages/input/index.js +8 -8
  118. package/packages/input/src/calcTextareaHeight.js +104 -104
  119. package/packages/input/src/input.vue +440 -440
  120. package/packages/input-number/index.js +8 -8
  121. package/packages/input-number/src/input-number.vue +286 -286
  122. package/packages/link/index.js +8 -8
  123. package/packages/link/src/main.vue +53 -53
  124. package/packages/loading/index.js +11 -11
  125. package/packages/loading/src/directive.js +133 -133
  126. package/packages/loading/src/index.js +106 -106
  127. package/packages/loading/src/loading.vue +41 -41
  128. package/packages/main/index.js +8 -8
  129. package/packages/main/src/main.vue +12 -12
  130. package/packages/menu/index.js +8 -8
  131. package/packages/menu/src/menu-item-group.vue +45 -45
  132. package/packages/menu/src/menu-item.vue +112 -112
  133. package/packages/menu/src/menu-mixin.js +44 -44
  134. package/packages/menu/src/menu.vue +325 -325
  135. package/packages/menu/src/submenu.vue +349 -348
  136. package/packages/menu-item/index.js +8 -8
  137. package/packages/menu-item-group/index.js +8 -8
  138. package/packages/message/index.js +2 -2
  139. package/packages/message/src/main.js +91 -91
  140. package/packages/message/src/main.vue +117 -117
  141. package/packages/message-box/index.js +2 -2
  142. package/packages/message-box/src/main.js +216 -216
  143. package/packages/message-box/src/main.vue +332 -332
  144. package/packages/notification/index.js +2 -2
  145. package/packages/notification/src/main.js +94 -94
  146. package/packages/notification/src/main.vue +152 -152
  147. package/packages/option/index.js +8 -8
  148. package/packages/option-group/index.js +8 -8
  149. package/packages/page-header/index.js +8 -8
  150. package/packages/page-header/src/main.vue +30 -30
  151. package/packages/pagination/index.js +8 -8
  152. package/packages/pagination/src/pager.vue +163 -163
  153. package/packages/pagination/src/pagination.js +386 -386
  154. package/packages/popconfirm/index.js +8 -8
  155. package/packages/popconfirm/src/main.vue +104 -104
  156. package/packages/popover/index.js +14 -14
  157. package/packages/popover/src/directive.js +20 -20
  158. package/packages/popover/src/main.vue +237 -237
  159. package/packages/progress/index.js +8 -8
  160. package/packages/progress/src/progress.vue +235 -235
  161. package/packages/radio/index.js +8 -8
  162. package/packages/radio/src/radio-button.vue +115 -115
  163. package/packages/radio/src/radio-group.vue +113 -113
  164. package/packages/radio/src/radio.vue +134 -134
  165. package/packages/radio-button/index.js +8 -8
  166. package/packages/radio-group/index.js +8 -8
  167. package/packages/rate/index.js +8 -8
  168. package/packages/rate/src/main.vue +348 -348
  169. package/packages/result/index.js +8 -8
  170. package/packages/result/src/icon-error.vue +13 -13
  171. package/packages/result/src/icon-info.vue +13 -13
  172. package/packages/result/src/icon-success.vue +13 -13
  173. package/packages/result/src/icon-warning.vue +13 -13
  174. package/packages/result/src/index.vue +65 -65
  175. package/packages/row/index.js +9 -9
  176. package/packages/row/src/row.js +44 -44
  177. package/packages/scrollbar/index.js +8 -8
  178. package/packages/scrollbar/src/bar.js +92 -92
  179. package/packages/scrollbar/src/main.js +130 -130
  180. package/packages/scrollbar/src/util.js +34 -34
  181. package/packages/select/index.js +8 -8
  182. package/packages/select/src/navigation-mixin.js +54 -54
  183. package/packages/select/src/option-group.vue +60 -60
  184. package/packages/select/src/option.vue +168 -168
  185. package/packages/select/src/select-dropdown.vue +74 -74
  186. package/packages/select/src/select.vue +900 -900
  187. package/packages/skeleton/index.js +8 -8
  188. package/packages/skeleton/src/img-placeholder.vue +16 -16
  189. package/packages/skeleton/src/index.vue +76 -76
  190. package/packages/skeleton/src/item.vue +22 -22
  191. package/packages/skeleton-item/index.js +8 -8
  192. package/packages/slider/index.js +8 -8
  193. package/packages/slider/src/button.vue +238 -238
  194. package/packages/slider/src/main.vue +427 -427
  195. package/packages/slider/src/marker.js +18 -18
  196. package/packages/spinner/index.js +8 -8
  197. package/packages/spinner/src/spinner.vue +27 -27
  198. package/packages/statistic/index.js +8 -8
  199. package/packages/statistic/src/main.vue +204 -203
  200. package/packages/step/index.js +8 -8
  201. package/packages/steps/README.md +69 -69
  202. package/packages/steps/index.js +8 -8
  203. package/packages/steps/src/step.vue +184 -184
  204. package/packages/steps/src/steps.vue +68 -68
  205. package/packages/submenu/index.js +8 -8
  206. package/packages/switch/index.js +9 -9
  207. package/packages/switch/src/component.vue +174 -174
  208. package/packages/tab-pane/index.js +8 -8
  209. package/packages/table/index.js +8 -8
  210. package/packages/table/src/config.js +124 -124
  211. package/packages/table/src/dropdown.js +28 -28
  212. package/packages/table/src/filter-panel.vue +194 -194
  213. package/packages/table/src/layout-observer.js +68 -68
  214. package/packages/table/src/store/current.js +76 -76
  215. package/packages/table/src/store/expand.js +65 -65
  216. package/packages/table/src/store/helper.js +41 -41
  217. package/packages/table/src/store/index.js +147 -147
  218. package/packages/table/src/store/tree.js +209 -209
  219. package/packages/table/src/store/watcher.js +381 -381
  220. package/packages/table/src/table-body.js +469 -469
  221. package/packages/table/src/table-column.js +319 -319
  222. package/packages/table/src/table-footer.js +153 -153
  223. package/packages/table/src/table-header.js +511 -511
  224. package/packages/table/src/table-layout.js +249 -249
  225. package/packages/table/src/table-row.js +101 -101
  226. package/packages/table/src/table.vue +712 -718
  227. package/packages/table/src/util.js +273 -273
  228. package/packages/table-column/index.js +8 -8
  229. package/packages/tabs/index.js +8 -8
  230. package/packages/tabs/src/tab-bar.vue +57 -57
  231. package/packages/tabs/src/tab-nav.vue +294 -294
  232. package/packages/tabs/src/tab-pane.vue +56 -56
  233. package/packages/tabs/src/tabs.vue +191 -191
  234. package/packages/tag/index.js +8 -8
  235. package/packages/tag/src/tag.vue +58 -58
  236. package/packages/theme-chalk/README.md +33 -33
  237. package/packages/theme-chalk/gulpfile.js +25 -27
  238. package/packages/theme-chalk/package.json +35 -35
  239. package/packages/theme-chalk/src/alert.scss +147 -147
  240. package/packages/theme-chalk/src/aside.scss +7 -7
  241. package/packages/theme-chalk/src/autocomplete.scss +80 -80
  242. package/packages/theme-chalk/src/avatar.scss +51 -51
  243. package/packages/theme-chalk/src/backtop.scss +22 -22
  244. package/packages/theme-chalk/src/badge.scss +57 -57
  245. package/packages/theme-chalk/src/base.scss +2 -2
  246. package/packages/theme-chalk/src/breadcrumb.scss +55 -55
  247. package/packages/theme-chalk/src/button.scss +262 -262
  248. package/packages/theme-chalk/src/calendar.scss +79 -79
  249. package/packages/theme-chalk/src/card.scss +32 -32
  250. package/packages/theme-chalk/src/carousel-item.scss +50 -50
  251. package/packages/theme-chalk/src/carousel.scss +161 -161
  252. package/packages/theme-chalk/src/cascader-panel.scss +120 -120
  253. package/packages/theme-chalk/src/cascader.scss +182 -182
  254. package/packages/theme-chalk/src/checkbox.scss +359 -359
  255. package/packages/theme-chalk/src/col.scss +156 -156
  256. package/packages/theme-chalk/src/collapse.scss +63 -63
  257. package/packages/theme-chalk/src/color-picker.scss +384 -384
  258. package/packages/theme-chalk/src/common/popup.scss +42 -42
  259. package/packages/theme-chalk/src/common/transition.scss +99 -99
  260. package/packages/theme-chalk/src/common/var.scss +1028 -1028
  261. package/packages/theme-chalk/src/container.scss +14 -14
  262. package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -97
  263. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
  264. package/packages/theme-chalk/src/date-picker/date-table.scss +151 -151
  265. package/packages/theme-chalk/src/date-picker/month-table.scss +82 -82
  266. package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -117
  267. package/packages/theme-chalk/src/date-picker/picker.scss +197 -197
  268. package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -85
  269. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
  270. package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -110
  271. package/packages/theme-chalk/src/date-picker/year-table.scss +51 -51
  272. package/packages/theme-chalk/src/date-picker.scss +11 -11
  273. package/packages/theme-chalk/src/descriptions-item.scss +42 -42
  274. package/packages/theme-chalk/src/descriptions.scss +111 -111
  275. package/packages/theme-chalk/src/dialog.scss +123 -123
  276. package/packages/theme-chalk/src/display.scss +12 -12
  277. package/packages/theme-chalk/src/divider.scss +47 -47
  278. package/packages/theme-chalk/src/drawer.scss +219 -219
  279. package/packages/theme-chalk/src/dropdown.scss +182 -182
  280. package/packages/theme-chalk/src/empty.scss +45 -45
  281. package/packages/theme-chalk/src/footer.scss +8 -8
  282. package/packages/theme-chalk/src/form.scss +167 -167
  283. package/packages/theme-chalk/src/header.scss +8 -8
  284. package/packages/theme-chalk/src/icon.scss +1167 -1167
  285. package/packages/theme-chalk/src/image.scss +179 -179
  286. package/packages/theme-chalk/src/index.scss +87 -87
  287. package/packages/theme-chalk/src/input-number.scss +261 -180
  288. package/packages/theme-chalk/src/input.scss +360 -360
  289. package/packages/theme-chalk/src/link.scss +81 -81
  290. package/packages/theme-chalk/src/loading.scss +96 -96
  291. package/packages/theme-chalk/src/main.scss +12 -12
  292. package/packages/theme-chalk/src/menu.scss +289 -289
  293. package/packages/theme-chalk/src/message-box.scss +226 -226
  294. package/packages/theme-chalk/src/message.scss +120 -120
  295. package/packages/theme-chalk/src/mixins/_button.scss +81 -81
  296. package/packages/theme-chalk/src/mixins/config.scss +4 -4
  297. package/packages/theme-chalk/src/mixins/function.scss +44 -44
  298. package/packages/theme-chalk/src/mixins/mixins.scss +191 -196
  299. package/packages/theme-chalk/src/mixins/utils.scss +39 -39
  300. package/packages/theme-chalk/src/notification.scss +99 -99
  301. package/packages/theme-chalk/src/option-group.scss +42 -42
  302. package/packages/theme-chalk/src/option.scss +36 -36
  303. package/packages/theme-chalk/src/page-header.scss +41 -41
  304. package/packages/theme-chalk/src/pagination.scss +295 -295
  305. package/packages/theme-chalk/src/popconfirm.scss +16 -16
  306. package/packages/theme-chalk/src/popover.scss +40 -40
  307. package/packages/theme-chalk/src/popper.scss +101 -101
  308. package/packages/theme-chalk/src/progress.scss +141 -141
  309. package/packages/theme-chalk/src/radio-button.scss +113 -113
  310. package/packages/theme-chalk/src/radio-group.scss +9 -9
  311. package/packages/theme-chalk/src/radio.scss +199 -199
  312. package/packages/theme-chalk/src/rate.scss +49 -49
  313. package/packages/theme-chalk/src/reset.scss +79 -79
  314. package/packages/theme-chalk/src/result.scss +61 -61
  315. package/packages/theme-chalk/src/row.scss +43 -43
  316. package/packages/theme-chalk/src/scrollbar.scss +72 -72
  317. package/packages/theme-chalk/src/select-dropdown.scss +62 -62
  318. package/packages/theme-chalk/src/select.scss +152 -152
  319. package/packages/theme-chalk/src/skeleton-item.scss +84 -84
  320. package/packages/theme-chalk/src/skeleton.scss +40 -40
  321. package/packages/theme-chalk/src/slider.scss +250 -250
  322. package/packages/theme-chalk/src/spinner.scss +44 -44
  323. package/packages/theme-chalk/src/statistic.scss +38 -38
  324. package/packages/theme-chalk/src/step.scss +317 -317
  325. package/packages/theme-chalk/src/steps.scss +20 -20
  326. package/packages/theme-chalk/src/switch.scss +116 -116
  327. package/packages/theme-chalk/src/table-column.scss +97 -97
  328. package/packages/theme-chalk/src/table.scss +564 -564
  329. package/packages/theme-chalk/src/tabs.scss +602 -602
  330. package/packages/theme-chalk/src/tag.scss +163 -163
  331. package/packages/theme-chalk/src/time-picker.scss +8 -8
  332. package/packages/theme-chalk/src/time-select.scss +37 -37
  333. package/packages/theme-chalk/src/timeline-item.scss +86 -86
  334. package/packages/theme-chalk/src/timeline.scss +14 -14
  335. package/packages/theme-chalk/src/tooltip.scss +141 -141
  336. package/packages/theme-chalk/src/transfer.scss +227 -227
  337. package/packages/theme-chalk/src/tree.scss +123 -123
  338. package/packages/theme-chalk/src/upload.scss +603 -603
  339. package/packages/time-picker/index.js +8 -8
  340. package/packages/time-select/index.js +8 -8
  341. package/packages/timeline/index.js +8 -8
  342. package/packages/timeline/src/item.vue +73 -73
  343. package/packages/timeline/src/main.vue +33 -33
  344. package/packages/timeline-item/index.js +8 -8
  345. package/packages/tooltip/index.js +8 -8
  346. package/packages/tooltip/src/main.js +242 -242
  347. package/packages/transfer/index.js +8 -8
  348. package/packages/transfer/src/main.vue +231 -231
  349. package/packages/transfer/src/transfer-panel.vue +251 -251
  350. package/packages/tree/index.js +8 -8
  351. package/packages/tree/src/model/node.js +484 -484
  352. package/packages/tree/src/model/tree-store.js +340 -340
  353. package/packages/tree/src/model/util.js +27 -27
  354. package/packages/tree/src/tree-node.vue +279 -279
  355. package/packages/tree/src/tree.vue +496 -496
  356. package/packages/upload/index.js +8 -8
  357. package/packages/upload/src/ajax.js +85 -85
  358. package/packages/upload/src/index.vue +338 -338
  359. package/packages/upload/src/upload-dragger.vue +70 -70
  360. package/packages/upload/src/upload-list.vue +105 -105
  361. package/packages/upload/src/upload.vue +211 -211
  362. package/src/directives/mousewheel.js +18 -18
  363. package/src/directives/repeat-click.js +26 -26
  364. package/src/index.js +202 -216
  365. package/src/locale/format.js +46 -45
  366. package/src/locale/index.js +48 -48
  367. package/src/locale/lang/en.js +123 -123
  368. package/src/locale/lang/zh-CN.js +123 -123
  369. package/src/locale/lang/zh-TW.js +123 -123
  370. package/src/mixins/emitter.js +33 -33
  371. package/src/mixins/focus.js +9 -9
  372. package/src/mixins/locale.js +9 -9
  373. package/src/mixins/migrating.js +54 -54
  374. package/src/transitions/collapse-transition.js +77 -77
  375. package/src/utils/after-leave.js +27 -27
  376. package/src/utils/aria-dialog.js +90 -90
  377. package/src/utils/aria-utils.js +122 -122
  378. package/src/utils/clickoutside.js +76 -76
  379. package/src/utils/date-util.js +282 -282
  380. package/src/utils/date.js +368 -368
  381. package/src/utils/dom.js +227 -227
  382. package/src/utils/lodash.js +18075 -18075
  383. package/src/utils/menu/aria-menubar.js +14 -14
  384. package/src/utils/menu/aria-menuitem.js +49 -49
  385. package/src/utils/menu/aria-submenu.js +59 -59
  386. package/src/utils/merge.js +15 -15
  387. package/src/utils/popper.js +1276 -1276
  388. package/src/utils/popup/index.js +218 -218
  389. package/src/utils/popup/popup-manager.js +194 -194
  390. package/src/utils/resize-event.js +36 -36
  391. package/src/utils/scroll-into-view.js +27 -27
  392. package/src/utils/scrollbar-width.js +29 -29
  393. package/src/utils/shared.js +7 -7
  394. package/src/utils/types.js +40 -40
  395. package/src/utils/util.js +245 -245
  396. package/src/utils/vdom.js +5 -5
  397. package/src/utils/vue-popper.js +198 -198
  398. package/types/alert.d.ts +31 -31
  399. package/types/aside.d.ts +7 -7
  400. package/types/autocomplete.d.ts +78 -78
  401. package/types/avatar.d.ts +20 -20
  402. package/types/backtop.d.ts +16 -16
  403. package/types/badge.d.ts +16 -16
  404. package/types/breadcrumb-item.d.ts +10 -10
  405. package/types/breadcrumb.d.ts +10 -10
  406. package/types/button-group.d.ts +4 -4
  407. package/types/button.d.ts +37 -37
  408. package/types/calendar.d.ts +15 -15
  409. package/types/card.d.ts +26 -26
  410. package/types/carousel-item.d.ts +10 -10
  411. package/types/carousel.d.ts +57 -57
  412. package/types/cascader-panel.d.ts +72 -72
  413. package/types/cascader.d.ts +65 -65
  414. package/types/checkbox-button.d.ts +22 -22
  415. package/types/checkbox-group.d.ts +22 -22
  416. package/types/checkbox.d.ts +34 -34
  417. package/types/col.d.ts +46 -46
  418. package/types/collapse-item.d.ts +26 -26
  419. package/types/collapse.d.ts +10 -10
  420. package/types/color-picker.d.ts +21 -21
  421. package/types/component.d.ts +13 -13
  422. package/types/container.d.ts +7 -7
  423. package/types/date-picker.d.ts +124 -124
  424. package/types/descriptions-item.d.ts +37 -37
  425. package/types/descriptions.d.ts +52 -52
  426. package/types/dialog.d.ts +62 -62
  427. package/types/divider.d.ts +12 -12
  428. package/types/drawer.d.ts +63 -63
  429. package/types/dropdown-item.d.ts +16 -16
  430. package/types/dropdown-menu.d.ts +4 -4
  431. package/types/dropdown.d.ts +38 -38
  432. package/types/element-ui.d.ts +1 -22
  433. package/types/empty.d.ts +31 -31
  434. package/types/footer.d.ts +7 -7
  435. package/types/form-item.d.ts +37 -37
  436. package/types/form.d.ts +82 -82
  437. package/types/header.d.ts +7 -7
  438. package/types/icon.d.ts +7 -7
  439. package/types/image.d.ts +43 -43
  440. package/types/index.d.ts +4 -4
  441. package/types/infinite-scroll.d.ts +5 -5
  442. package/types/input-number.d.ts +47 -47
  443. package/types/input.d.ts +107 -107
  444. package/types/link.d.ts +25 -25
  445. package/types/loading.d.ts +62 -62
  446. package/types/main.d.ts +4 -4
  447. package/types/menu-item-group.d.ts +7 -7
  448. package/types/menu-item.d.ts +10 -10
  449. package/types/menu.d.ts +46 -46
  450. package/types/message-box.d.ts +176 -176
  451. package/types/message.d.ts +90 -90
  452. package/types/notification.d.ts +84 -84
  453. package/types/option-group.d.ts +10 -10
  454. package/types/option.d.ts +13 -13
  455. package/types/page-header.d.ts +10 -10
  456. package/types/pagination.d.ts +43 -43
  457. package/types/popconfirm.d.ts +29 -29
  458. package/types/popover.d.ts +71 -71
  459. package/types/progress.d.ts +37 -37
  460. package/types/radio-button.d.ts +16 -16
  461. package/types/radio-group.d.ts +18 -18
  462. package/types/radio.d.ts +19 -19
  463. package/types/rate.d.ts +64 -64
  464. package/types/result.d.ts +33 -33
  465. package/types/row.d.ts +25 -25
  466. package/types/select.d.ts +90 -90
  467. package/types/skeleton-item.d.ts +7 -7
  468. package/types/skeleton.d.ts +33 -33
  469. package/types/slider.d.ts +68 -68
  470. package/types/spinner.d.ts +16 -16
  471. package/types/statistic.d.ts +37 -37
  472. package/types/step.d.ts +34 -34
  473. package/types/steps.d.ts +28 -28
  474. package/types/submenu.d.ts +22 -22
  475. package/types/switch.d.ts +43 -43
  476. package/types/tab-pane.d.ts +19 -19
  477. package/types/table-column.d.ts +117 -117
  478. package/types/table.d.ts +177 -177
  479. package/types/tabs.d.ts +31 -31
  480. package/types/tag.d.ts +28 -28
  481. package/types/time-picker.d.ts +63 -63
  482. package/types/time-select.d.ts +56 -56
  483. package/types/timeline-item.d.ts +20 -20
  484. package/types/timeline.d.ts +6 -6
  485. package/types/tooltip.d.ts +52 -52
  486. package/types/transfer.d.ts +73 -73
  487. package/types/tree.d.ts +266 -266
  488. package/types/upload.d.ts +124 -124
  489. package/web-types.json +4195 -4195
  490. package/lib/alert.js +0 -402
  491. package/lib/aside.js +0 -270
  492. package/lib/autocomplete.js +0 -4651
  493. package/lib/avatar.js +0 -363
  494. package/lib/backtop.js +0 -386
  495. package/lib/badge.js +0 -313
  496. package/lib/breadcrumb-item.js +0 -309
  497. package/lib/breadcrumb.js +0 -287
  498. package/lib/button-group.js +0 -256
  499. package/lib/button.js +0 -332
  500. package/lib/calendar.js +0 -2373
  501. package/lib/card.js +0 -289
  502. package/lib/carousel-item.js +0 -755
  503. package/lib/carousel.js +0 -719
  504. package/lib/cascader-panel.js +0 -3623
  505. package/lib/cascader.js +0 -7498
  506. package/lib/checkbox-button.js +0 -573
  507. package/lib/checkbox-group.js +0 -344
  508. package/lib/checkbox.js +0 -603
  509. package/lib/col.js +0 -177
  510. package/lib/collapse-item.js +0 -1156
  511. package/lib/collapse.js +0 -323
  512. package/lib/color-picker.js +0 -5600
  513. package/lib/container.js +0 -281
  514. package/lib/date-picker.js +0 -9871
  515. package/lib/descriptions-item.js +0 -140
  516. package/lib/descriptions.js +0 -512
  517. package/lib/dialog.js +0 -1736
  518. package/lib/directives/mousewheel.js +0 -26
  519. package/lib/directives/repeat-click.js +0 -33
  520. package/lib/divider.js +0 -297
  521. package/lib/drawer.js +0 -1316
  522. package/lib/dropdown-item.js +0 -332
  523. package/lib/dropdown-menu.js +0 -2545
  524. package/lib/dropdown.js +0 -1579
  525. package/lib/element-ui.common.js +0 -54072
  526. package/lib/empty.js +0 -1186
  527. package/lib/fileUpload.js +0 -3276
  528. package/lib/footer.js +0 -270
  529. package/lib/form-item.js +0 -1129
  530. package/lib/form.js +0 -471
  531. package/lib/header.js +0 -270
  532. package/lib/icon.js +0 -260
  533. package/lib/image.js +0 -2386
  534. package/lib/infinite-scroll.js +0 -591
  535. package/lib/input-number.js +0 -2093
  536. package/lib/input.js +0 -1358
  537. package/lib/link.js +0 -308
  538. package/lib/loading.js +0 -1349
  539. package/lib/locale/format.js +0 -55
  540. package/lib/locale/index.js +0 -63
  541. package/lib/locale/lang/af-ZA.js +0 -126
  542. package/lib/locale/lang/ar.js +0 -125
  543. package/lib/locale/lang/az.js +0 -126
  544. package/lib/locale/lang/bg.js +0 -126
  545. package/lib/locale/lang/bn.js +0 -126
  546. package/lib/locale/lang/ca.js +0 -125
  547. package/lib/locale/lang/cs-CZ.js +0 -128
  548. package/lib/locale/lang/da.js +0 -125
  549. package/lib/locale/lang/de.js +0 -127
  550. package/lib/locale/lang/ee.js +0 -126
  551. package/lib/locale/lang/el.js +0 -126
  552. package/lib/locale/lang/en.js +0 -126
  553. package/lib/locale/lang/eo.js +0 -126
  554. package/lib/locale/lang/es.js +0 -125
  555. package/lib/locale/lang/eu.js +0 -126
  556. package/lib/locale/lang/fa.js +0 -126
  557. package/lib/locale/lang/fi.js +0 -126
  558. package/lib/locale/lang/fr.js +0 -125
  559. package/lib/locale/lang/he.js +0 -126
  560. package/lib/locale/lang/hr.js +0 -126
  561. package/lib/locale/lang/hu.js +0 -125
  562. package/lib/locale/lang/hy-AM.js +0 -126
  563. package/lib/locale/lang/id.js +0 -126
  564. package/lib/locale/lang/is.js +0 -126
  565. package/lib/locale/lang/it.js +0 -125
  566. package/lib/locale/lang/ja.js +0 -126
  567. package/lib/locale/lang/kg.js +0 -126
  568. package/lib/locale/lang/km.js +0 -126
  569. package/lib/locale/lang/ko.js +0 -126
  570. package/lib/locale/lang/ku.js +0 -126
  571. package/lib/locale/lang/kz.js +0 -126
  572. package/lib/locale/lang/lo-LA.js +0 -126
  573. package/lib/locale/lang/lt.js +0 -126
  574. package/lib/locale/lang/lv.js +0 -126
  575. package/lib/locale/lang/mn.js +0 -126
  576. package/lib/locale/lang/ms.js +0 -125
  577. package/lib/locale/lang/nb-NO.js +0 -125
  578. package/lib/locale/lang/nl.js +0 -126
  579. package/lib/locale/lang/pl.js +0 -126
  580. package/lib/locale/lang/pt-br.js +0 -126
  581. package/lib/locale/lang/pt.js +0 -126
  582. package/lib/locale/lang/ro.js +0 -126
  583. package/lib/locale/lang/ru-RU.js +0 -126
  584. package/lib/locale/lang/si.js +0 -126
  585. package/lib/locale/lang/sk.js +0 -128
  586. package/lib/locale/lang/sl.js +0 -126
  587. package/lib/locale/lang/sr-Latn.js +0 -126
  588. package/lib/locale/lang/sr.js +0 -126
  589. package/lib/locale/lang/sv-SE.js +0 -126
  590. package/lib/locale/lang/sw.js +0 -126
  591. package/lib/locale/lang/ta.js +0 -125
  592. package/lib/locale/lang/th.js +0 -126
  593. package/lib/locale/lang/tk.js +0 -126
  594. package/lib/locale/lang/tr-TR.js +0 -126
  595. package/lib/locale/lang/ua.js +0 -126
  596. package/lib/locale/lang/ug-CN.js +0 -126
  597. package/lib/locale/lang/uz-UZ.js +0 -126
  598. package/lib/locale/lang/vi.js +0 -126
  599. package/lib/locale/lang/zh-CN.js +0 -126
  600. package/lib/locale/lang/zh-TW.js +0 -126
  601. package/lib/main.js +0 -257
  602. package/lib/menu-item-group.js +0 -296
  603. package/lib/menu-item.js +0 -3344
  604. package/lib/menu.js +0 -1556
  605. package/lib/message-box.js +0 -3564
  606. package/lib/message.js +0 -1601
  607. package/lib/mixins/emitter.js +0 -36
  608. package/lib/mixins/focus.js +0 -15
  609. package/lib/mixins/locale.js +0 -17
  610. package/lib/mixins/migrating.js +0 -69
  611. package/lib/notification.js +0 -1662
  612. package/lib/option-group.js +0 -364
  613. package/lib/option.js +0 -835
  614. package/lib/page-header.js +0 -908
  615. package/lib/pagination.js +0 -6855
  616. package/lib/popconfirm.js +0 -3708
  617. package/lib/popover.js +0 -3118
  618. package/lib/progress.js +0 -542
  619. package/lib/radio-button.js +0 -456
  620. package/lib/radio-group.js +0 -412
  621. package/lib/radio.js +0 -482
  622. package/lib/rate.js +0 -1278
  623. package/lib/result.js +0 -528
  624. package/lib/row.js +0 -149
  625. package/lib/scrollbar.js +0 -1108
  626. package/lib/select.js +0 -6134
  627. package/lib/selectDisplayInput.js +0 -355
  628. package/lib/skeleton-item.js +0 -322
  629. package/lib/skeleton.js +0 -345
  630. package/lib/slider.js +0 -5231
  631. package/lib/spinner.js +0 -293
  632. package/lib/statistic.js +0 -9999
  633. package/lib/step.js +0 -476
  634. package/lib/steps.js +0 -745
  635. package/lib/subTitle.js +0 -284
  636. package/lib/submenu.js +0 -3021
  637. package/lib/switch.js +0 -970
  638. package/lib/tab-pane.js +0 -318
  639. package/lib/tabDialog.js +0 -2264
  640. package/lib/table-column.js +0 -1800
  641. package/lib/table.js +0 -8803
  642. package/lib/tabs.js +0 -1329
  643. package/lib/tag.js +0 -304
  644. package/lib/theme-chalk/README.md +0 -33
  645. package/lib/theme-chalk/base.css +0 -1
  646. package/lib/theme-chalk/element.css +0 -1
  647. package/lib/theme-chalk/fileUpload.css +0 -1
  648. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  649. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  650. package/lib/theme-chalk/gulpfile.js +0 -27
  651. package/lib/theme-chalk/index.css +0 -1
  652. package/lib/theme-chalk/package.json +0 -35
  653. package/lib/theme-chalk/selectDisplayInput.css +0 -1
  654. package/lib/theme-chalk/src/alert.scss +0 -147
  655. package/lib/theme-chalk/src/aside.scss +0 -7
  656. package/lib/theme-chalk/src/autocomplete.scss +0 -80
  657. package/lib/theme-chalk/src/avatar.scss +0 -51
  658. package/lib/theme-chalk/src/backtop.scss +0 -22
  659. package/lib/theme-chalk/src/badge.scss +0 -57
  660. package/lib/theme-chalk/src/base.scss +0 -2
  661. package/lib/theme-chalk/src/breadcrumb-item.scss +0 -0
  662. package/lib/theme-chalk/src/breadcrumb.scss +0 -55
  663. package/lib/theme-chalk/src/button-group.scss +0 -0
  664. package/lib/theme-chalk/src/button.scss +0 -262
  665. package/lib/theme-chalk/src/calendar.scss +0 -79
  666. package/lib/theme-chalk/src/card.scss +0 -32
  667. package/lib/theme-chalk/src/carousel-item.scss +0 -50
  668. package/lib/theme-chalk/src/carousel.scss +0 -161
  669. package/lib/theme-chalk/src/cascader-panel.scss +0 -120
  670. package/lib/theme-chalk/src/cascader.scss +0 -182
  671. package/lib/theme-chalk/src/checkbox-button.scss +0 -0
  672. package/lib/theme-chalk/src/checkbox-group.scss +0 -0
  673. package/lib/theme-chalk/src/checkbox.scss +0 -359
  674. package/lib/theme-chalk/src/col.scss +0 -156
  675. package/lib/theme-chalk/src/collapse-item.scss +0 -0
  676. package/lib/theme-chalk/src/collapse.scss +0 -63
  677. package/lib/theme-chalk/src/color-picker.scss +0 -384
  678. package/lib/theme-chalk/src/common/popup.scss +0 -42
  679. package/lib/theme-chalk/src/common/transition.scss +0 -99
  680. package/lib/theme-chalk/src/common/var.scss +0 -1028
  681. package/lib/theme-chalk/src/container.scss +0 -14
  682. package/lib/theme-chalk/src/date-picker/date-picker.scss +0 -97
  683. package/lib/theme-chalk/src/date-picker/date-range-picker.scss +0 -101
  684. package/lib/theme-chalk/src/date-picker/date-table.scss +0 -151
  685. package/lib/theme-chalk/src/date-picker/month-table.scss +0 -82
  686. package/lib/theme-chalk/src/date-picker/picker-panel.scss +0 -117
  687. package/lib/theme-chalk/src/date-picker/picker.scss +0 -197
  688. package/lib/theme-chalk/src/date-picker/time-picker.scss +0 -85
  689. package/lib/theme-chalk/src/date-picker/time-range-picker.scss +0 -31
  690. package/lib/theme-chalk/src/date-picker/time-spinner.scss +0 -110
  691. package/lib/theme-chalk/src/date-picker/year-table.scss +0 -51
  692. package/lib/theme-chalk/src/date-picker.scss +0 -12
  693. package/lib/theme-chalk/src/descriptions-item.scss +0 -42
  694. package/lib/theme-chalk/src/descriptions.scss +0 -111
  695. package/lib/theme-chalk/src/dialog.scss +0 -123
  696. package/lib/theme-chalk/src/display.scss +0 -12
  697. package/lib/theme-chalk/src/divider.scss +0 -47
  698. package/lib/theme-chalk/src/drawer.scss +0 -219
  699. package/lib/theme-chalk/src/dropdown-item.scss +0 -0
  700. package/lib/theme-chalk/src/dropdown-menu.scss +0 -0
  701. package/lib/theme-chalk/src/dropdown.scss +0 -182
  702. package/lib/theme-chalk/src/empty.scss +0 -45
  703. package/lib/theme-chalk/src/fonts/element-icons.ttf +0 -0
  704. package/lib/theme-chalk/src/fonts/element-icons.woff +0 -0
  705. package/lib/theme-chalk/src/footer.scss +0 -8
  706. package/lib/theme-chalk/src/form-item.scss +0 -0
  707. package/lib/theme-chalk/src/form.scss +0 -167
  708. package/lib/theme-chalk/src/header.scss +0 -8
  709. package/lib/theme-chalk/src/icon.scss +0 -1167
  710. package/lib/theme-chalk/src/image.scss +0 -179
  711. package/lib/theme-chalk/src/index.scss +0 -87
  712. package/lib/theme-chalk/src/infinite-scroll.scss +0 -0
  713. package/lib/theme-chalk/src/infiniteScroll.scss +0 -0
  714. package/lib/theme-chalk/src/input-number.scss +0 -180
  715. package/lib/theme-chalk/src/input.scss +0 -360
  716. package/lib/theme-chalk/src/link.scss +0 -81
  717. package/lib/theme-chalk/src/loading.scss +0 -96
  718. package/lib/theme-chalk/src/main.scss +0 -12
  719. package/lib/theme-chalk/src/menu-item-group.scss +0 -0
  720. package/lib/theme-chalk/src/menu-item.scss +0 -0
  721. package/lib/theme-chalk/src/menu.scss +0 -289
  722. package/lib/theme-chalk/src/message-box.scss +0 -226
  723. package/lib/theme-chalk/src/message.scss +0 -120
  724. package/lib/theme-chalk/src/mixins/_button.scss +0 -81
  725. package/lib/theme-chalk/src/mixins/config.scss +0 -4
  726. package/lib/theme-chalk/src/mixins/function.scss +0 -44
  727. package/lib/theme-chalk/src/mixins/mixins.scss +0 -196
  728. package/lib/theme-chalk/src/mixins/utils.scss +0 -39
  729. package/lib/theme-chalk/src/notification.scss +0 -99
  730. package/lib/theme-chalk/src/option-group.scss +0 -42
  731. package/lib/theme-chalk/src/option.scss +0 -36
  732. package/lib/theme-chalk/src/page-header.scss +0 -41
  733. package/lib/theme-chalk/src/pagination.scss +0 -295
  734. package/lib/theme-chalk/src/popconfirm.scss +0 -16
  735. package/lib/theme-chalk/src/popover.scss +0 -40
  736. package/lib/theme-chalk/src/popper.scss +0 -101
  737. package/lib/theme-chalk/src/progress.scss +0 -141
  738. package/lib/theme-chalk/src/radio-button.scss +0 -113
  739. package/lib/theme-chalk/src/radio-group.scss +0 -9
  740. package/lib/theme-chalk/src/radio.scss +0 -199
  741. package/lib/theme-chalk/src/rate.scss +0 -49
  742. package/lib/theme-chalk/src/reset.scss +0 -79
  743. package/lib/theme-chalk/src/result.scss +0 -61
  744. package/lib/theme-chalk/src/row.scss +0 -43
  745. package/lib/theme-chalk/src/scrollbar.scss +0 -72
  746. package/lib/theme-chalk/src/select-dropdown.scss +0 -62
  747. package/lib/theme-chalk/src/select.scss +0 -152
  748. package/lib/theme-chalk/src/skeleton-item.scss +0 -84
  749. package/lib/theme-chalk/src/skeleton.scss +0 -40
  750. package/lib/theme-chalk/src/slider.scss +0 -250
  751. package/lib/theme-chalk/src/spinner.scss +0 -44
  752. package/lib/theme-chalk/src/statistic.scss +0 -38
  753. package/lib/theme-chalk/src/step.scss +0 -317
  754. package/lib/theme-chalk/src/steps.scss +0 -20
  755. package/lib/theme-chalk/src/submenu.scss +0 -0
  756. package/lib/theme-chalk/src/switch.scss +0 -116
  757. package/lib/theme-chalk/src/tab-pane.scss +0 -0
  758. package/lib/theme-chalk/src/table-column.scss +0 -97
  759. package/lib/theme-chalk/src/table.scss +0 -564
  760. package/lib/theme-chalk/src/tabs.scss +0 -602
  761. package/lib/theme-chalk/src/tag.scss +0 -163
  762. package/lib/theme-chalk/src/time-picker.scss +0 -8
  763. package/lib/theme-chalk/src/time-select.scss +0 -37
  764. package/lib/theme-chalk/src/timeline-item.scss +0 -86
  765. package/lib/theme-chalk/src/timeline.scss +0 -14
  766. package/lib/theme-chalk/src/tooltip.scss +0 -141
  767. package/lib/theme-chalk/src/transfer.scss +0 -227
  768. package/lib/theme-chalk/src/tree.scss +0 -123
  769. package/lib/theme-chalk/src/upload.scss +0 -603
  770. package/lib/theme-chalk/subTitle.css +0 -1
  771. package/lib/theme-chalk/tabDialog.css +0 -1
  772. package/lib/theme-chalk/treeSelect.css +0 -1
  773. package/lib/theme-cy/base.css +0 -1
  774. package/lib/theme-cy/element.css +0 -1
  775. package/lib/theme-cy/fileUpload.css +0 -1
  776. package/lib/theme-cy/index.css +0 -1
  777. package/lib/theme-cy/selectDisplayInput.css +0 -1
  778. package/lib/theme-cy/subTitle.css +0 -1
  779. package/lib/theme-cy/tabDialog.css +0 -1
  780. package/lib/theme-cy/treeSelect.css +0 -1
  781. package/lib/time-picker.js +0 -6881
  782. package/lib/time-select.js +0 -5892
  783. package/lib/timeline-item.js +0 -329
  784. package/lib/timeline.js +0 -275
  785. package/lib/tooltip.js +0 -2950
  786. package/lib/transfer.js +0 -2998
  787. package/lib/transitions/collapse-transition.js +0 -91
  788. package/lib/tree.js +0 -3470
  789. package/lib/treeSelect.js +0 -4058
  790. package/lib/umd/locale/af-ZA.js +0 -142
  791. package/lib/umd/locale/ar.js +0 -141
  792. package/lib/umd/locale/az.js +0 -141
  793. package/lib/umd/locale/bg.js +0 -142
  794. package/lib/umd/locale/bn.js +0 -141
  795. package/lib/umd/locale/ca.js +0 -141
  796. package/lib/umd/locale/cs-CZ.js +0 -144
  797. package/lib/umd/locale/da.js +0 -141
  798. package/lib/umd/locale/de.js +0 -143
  799. package/lib/umd/locale/ee.js +0 -142
  800. package/lib/umd/locale/el.js +0 -142
  801. package/lib/umd/locale/en.js +0 -142
  802. package/lib/umd/locale/eo.js +0 -142
  803. package/lib/umd/locale/es.js +0 -141
  804. package/lib/umd/locale/eu.js +0 -142
  805. package/lib/umd/locale/fa.js +0 -142
  806. package/lib/umd/locale/fi.js +0 -142
  807. package/lib/umd/locale/fr.js +0 -141
  808. package/lib/umd/locale/he.js +0 -142
  809. package/lib/umd/locale/hr.js +0 -142
  810. package/lib/umd/locale/hu.js +0 -141
  811. package/lib/umd/locale/hy-AM.js +0 -142
  812. package/lib/umd/locale/id.js +0 -142
  813. package/lib/umd/locale/is.js +0 -142
  814. package/lib/umd/locale/it.js +0 -141
  815. package/lib/umd/locale/ja.js +0 -142
  816. package/lib/umd/locale/kg.js +0 -142
  817. package/lib/umd/locale/km.js +0 -142
  818. package/lib/umd/locale/ko.js +0 -142
  819. package/lib/umd/locale/ku.js +0 -142
  820. package/lib/umd/locale/kz.js +0 -142
  821. package/lib/umd/locale/lo-LA.js +0 -141
  822. package/lib/umd/locale/lt.js +0 -142
  823. package/lib/umd/locale/lv.js +0 -142
  824. package/lib/umd/locale/mn.js +0 -142
  825. package/lib/umd/locale/ms.js +0 -141
  826. package/lib/umd/locale/nb-NO.js +0 -141
  827. package/lib/umd/locale/nl.js +0 -142
  828. package/lib/umd/locale/pl.js +0 -142
  829. package/lib/umd/locale/pt-br.js +0 -142
  830. package/lib/umd/locale/pt.js +0 -142
  831. package/lib/umd/locale/ro.js +0 -142
  832. package/lib/umd/locale/ru-RU.js +0 -142
  833. package/lib/umd/locale/si.js +0 -142
  834. package/lib/umd/locale/sk.js +0 -144
  835. package/lib/umd/locale/sl.js +0 -142
  836. package/lib/umd/locale/sr-Latn.js +0 -142
  837. package/lib/umd/locale/sr.js +0 -142
  838. package/lib/umd/locale/sv-SE.js +0 -142
  839. package/lib/umd/locale/sw.js +0 -142
  840. package/lib/umd/locale/ta.js +0 -141
  841. package/lib/umd/locale/th.js +0 -142
  842. package/lib/umd/locale/tk.js +0 -142
  843. package/lib/umd/locale/tr-TR.js +0 -142
  844. package/lib/umd/locale/ua.js +0 -142
  845. package/lib/umd/locale/ug-CN.js +0 -142
  846. package/lib/umd/locale/uz-UZ.js +0 -142
  847. package/lib/umd/locale/vi.js +0 -142
  848. package/lib/umd/locale/zh-CN.js +0 -142
  849. package/lib/umd/locale/zh-TW.js +0 -142
  850. package/lib/upload.js +0 -2337
  851. package/lib/utils/after-leave.js +0 -35
  852. package/lib/utils/aria-dialog.js +0 -104
  853. package/lib/utils/aria-utils.js +0 -126
  854. package/lib/utils/clickoutside.js +0 -79
  855. package/lib/utils/date-util.js +0 -310
  856. package/lib/utils/date.js +0 -369
  857. package/lib/utils/dom.js +0 -234
  858. package/lib/utils/lodash.js +0 -9421
  859. package/lib/utils/menu/aria-menubar.js +0 -24
  860. package/lib/utils/menu/aria-menuitem.js +0 -62
  861. package/lib/utils/menu/aria-submenu.js +0 -69
  862. package/lib/utils/merge.js +0 -21
  863. package/lib/utils/popper.js +0 -1261
  864. package/lib/utils/popup/index.js +0 -233
  865. package/lib/utils/popup/popup-manager.js +0 -205
  866. package/lib/utils/resize-event.js +0 -59
  867. package/lib/utils/scroll-into-view.js +0 -38
  868. package/lib/utils/scrollbar-width.js +0 -39
  869. package/lib/utils/shared.js +0 -12
  870. package/lib/utils/types.js +0 -52
  871. package/lib/utils/util.js +0 -272
  872. package/lib/utils/vdom.js +0 -13
  873. package/lib/utils/vue-popper.js +0 -202
  874. package/packages/fileUpload/index.js +0 -8
  875. package/packages/fileUpload/src/main.vue +0 -430
  876. package/packages/selectDisplayInput/index.js +0 -8
  877. package/packages/selectDisplayInput/src/main.vue +0 -75
  878. package/packages/subTitle/index.js +0 -8
  879. package/packages/subTitle/src/main.vue +0 -33
  880. package/packages/tabDialog/index.js +0 -23
  881. package/packages/tabDialog/src/dialog/drag.js +0 -63
  882. package/packages/tabDialog/src/dialog/dragHeight.js +0 -34
  883. package/packages/tabDialog/src/dialog/dragWidth.js +0 -30
  884. package/packages/tabDialog/src/main.vue +0 -277
  885. package/packages/theme-cy/README.md +0 -38
  886. package/packages/theme-cy/gulpfile.js +0 -27
  887. package/packages/theme-cy/package.json +0 -35
  888. package/packages/theme-cy/src/base.scss +0 -3
  889. package/packages/theme-cy/src/element.scss +0 -45
  890. package/packages/theme-cy/src/fileUpload.scss +0 -30
  891. package/packages/theme-cy/src/index.scss +0 -7
  892. package/packages/theme-cy/src/selectDisplayInput.scss +0 -76
  893. package/packages/theme-cy/src/subTitle.scss +0 -26
  894. package/packages/theme-cy/src/tabDialog.scss +0 -43
  895. package/packages/theme-cy/src/treeSelect.scss +0 -98
  896. package/packages/treeSelect/index.js +0 -8
  897. package/packages/treeSelect/src/main.vue +0 -325
  898. package/src/locale/lang/af-ZA.js +0 -123
  899. package/src/locale/lang/ar.js +0 -122
  900. package/src/locale/lang/az.js +0 -126
  901. package/src/locale/lang/bg.js +0 -123
  902. package/src/locale/lang/bn.js +0 -126
  903. package/src/locale/lang/ca.js +0 -122
  904. package/src/locale/lang/cs-CZ.js +0 -125
  905. package/src/locale/lang/da.js +0 -122
  906. package/src/locale/lang/de.js +0 -124
  907. package/src/locale/lang/ee.js +0 -123
  908. package/src/locale/lang/el.js +0 -123
  909. package/src/locale/lang/eo.js +0 -123
  910. package/src/locale/lang/es.js +0 -122
  911. package/src/locale/lang/eu.js +0 -123
  912. package/src/locale/lang/fa.js +0 -123
  913. package/src/locale/lang/fi.js +0 -123
  914. package/src/locale/lang/fr.js +0 -122
  915. package/src/locale/lang/he.js +0 -123
  916. package/src/locale/lang/hr.js +0 -123
  917. package/src/locale/lang/hu.js +0 -122
  918. package/src/locale/lang/hy-AM.js +0 -123
  919. package/src/locale/lang/id.js +0 -123
  920. package/src/locale/lang/is.js +0 -124
  921. package/src/locale/lang/it.js +0 -122
  922. package/src/locale/lang/ja.js +0 -123
  923. package/src/locale/lang/kg.js +0 -123
  924. package/src/locale/lang/km.js +0 -123
  925. package/src/locale/lang/ko.js +0 -123
  926. package/src/locale/lang/ku.js +0 -123
  927. package/src/locale/lang/kz.js +0 -123
  928. package/src/locale/lang/lo-LA.js +0 -126
  929. package/src/locale/lang/lt.js +0 -123
  930. package/src/locale/lang/lv.js +0 -123
  931. package/src/locale/lang/mn.js +0 -123
  932. package/src/locale/lang/ms.js +0 -122
  933. package/src/locale/lang/nb-NO.js +0 -122
  934. package/src/locale/lang/nl.js +0 -123
  935. package/src/locale/lang/pl.js +0 -123
  936. package/src/locale/lang/pt-br.js +0 -123
  937. package/src/locale/lang/pt.js +0 -123
  938. package/src/locale/lang/ro.js +0 -123
  939. package/src/locale/lang/ru-RU.js +0 -123
  940. package/src/locale/lang/si.js +0 -123
  941. package/src/locale/lang/sk.js +0 -125
  942. package/src/locale/lang/sl.js +0 -123
  943. package/src/locale/lang/sr-Latn.js +0 -123
  944. package/src/locale/lang/sr.js +0 -123
  945. package/src/locale/lang/sv-SE.js +0 -123
  946. package/src/locale/lang/sw.js +0 -123
  947. package/src/locale/lang/ta.js +0 -122
  948. package/src/locale/lang/th.js +0 -123
  949. package/src/locale/lang/tk.js +0 -123
  950. package/src/locale/lang/tr-TR.js +0 -123
  951. package/src/locale/lang/ua.js +0 -123
  952. package/src/locale/lang/ug-CN.js +0 -123
  953. package/src/locale/lang/uz-UZ.js +0 -123
  954. package/src/locale/lang/vi.js +0 -123
  955. package/types/fileUpload.d.ts +0 -5
  956. package/types/selectDisplayInput.d.ts +0 -5
  957. package/types/subTitle.d.ts +0 -5
  958. package/types/tabDialog.d.ts +0 -5
  959. package/types/treeSelect.d.ts +0 -5
package/lib/tree.js DELETED
@@ -1,3470 +0,0 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "/dist/";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 65);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("vue");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
-
100
- "use strict";
101
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
102
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
103
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
104
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
105
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
106
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
107
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
108
- /* unused harmony export setStyle */
109
- /* unused harmony export isScroll */
110
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
111
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
112
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
113
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
114
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
115
-
116
- /* istanbul ignore next */
117
-
118
-
119
-
120
- var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
121
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
122
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
123
- var ieVersion = isServer ? 0 : Number(document.documentMode);
124
-
125
- /* istanbul ignore next */
126
- var trim = function trim(string) {
127
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
128
- };
129
- /* istanbul ignore next */
130
- var camelCase = function camelCase(name) {
131
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
132
- return offset ? letter.toUpperCase() : letter;
133
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
134
- };
135
-
136
- /* istanbul ignore next */
137
- var on = function () {
138
- if (!isServer && document.addEventListener) {
139
- return function (element, event, handler) {
140
- if (element && event && handler) {
141
- element.addEventListener(event, handler, false);
142
- }
143
- };
144
- } else {
145
- return function (element, event, handler) {
146
- if (element && event && handler) {
147
- element.attachEvent('on' + event, handler);
148
- }
149
- };
150
- }
151
- }();
152
-
153
- /* istanbul ignore next */
154
- var off = function () {
155
- if (!isServer && document.removeEventListener) {
156
- return function (element, event, handler) {
157
- if (element && event) {
158
- element.removeEventListener(event, handler, false);
159
- }
160
- };
161
- } else {
162
- return function (element, event, handler) {
163
- if (element && event) {
164
- element.detachEvent('on' + event, handler);
165
- }
166
- };
167
- }
168
- }();
169
-
170
- /* istanbul ignore next */
171
- var once = function once(el, event, fn) {
172
- var listener = function listener() {
173
- if (fn) {
174
- fn.apply(this, arguments);
175
- }
176
- off(el, event, listener);
177
- };
178
- on(el, event, listener);
179
- };
180
-
181
- /* istanbul ignore next */
182
- function hasClass(el, cls) {
183
- if (!el || !cls) return false;
184
- if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
185
- if (el.classList) {
186
- return el.classList.contains(cls);
187
- } else {
188
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
189
- }
190
- };
191
-
192
- /* istanbul ignore next */
193
- function addClass(el, cls) {
194
- if (!el) return;
195
- var curClass = el.className;
196
- var classes = (cls || '').split(' ');
197
-
198
- for (var i = 0, j = classes.length; i < j; i++) {
199
- var clsName = classes[i];
200
- if (!clsName) continue;
201
-
202
- if (el.classList) {
203
- el.classList.add(clsName);
204
- } else if (!hasClass(el, clsName)) {
205
- curClass += ' ' + clsName;
206
- }
207
- }
208
- if (!el.classList) {
209
- el.setAttribute('class', curClass);
210
- }
211
- };
212
-
213
- /* istanbul ignore next */
214
- function removeClass(el, cls) {
215
- if (!el || !cls) return;
216
- var classes = cls.split(' ');
217
- var curClass = ' ' + el.className + ' ';
218
-
219
- for (var i = 0, j = classes.length; i < j; i++) {
220
- var clsName = classes[i];
221
- if (!clsName) continue;
222
-
223
- if (el.classList) {
224
- el.classList.remove(clsName);
225
- } else if (hasClass(el, clsName)) {
226
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
227
- }
228
- }
229
- if (!el.classList) {
230
- el.setAttribute('class', trim(curClass));
231
- }
232
- };
233
-
234
- /* istanbul ignore next */
235
- var getStyle = ieVersion < 9 ? function (element, styleName) {
236
- if (isServer) return;
237
- if (!element || !styleName) return null;
238
- styleName = camelCase(styleName);
239
- if (styleName === 'float') {
240
- styleName = 'styleFloat';
241
- }
242
- try {
243
- switch (styleName) {
244
- case 'opacity':
245
- try {
246
- return element.filters.item('alpha').opacity / 100;
247
- } catch (e) {
248
- return 1.0;
249
- }
250
- default:
251
- return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
252
- }
253
- } catch (e) {
254
- return element.style[styleName];
255
- }
256
- } : function (element, styleName) {
257
- if (isServer) return;
258
- if (!element || !styleName) return null;
259
- styleName = camelCase(styleName);
260
- if (styleName === 'float') {
261
- styleName = 'cssFloat';
262
- }
263
- try {
264
- var computed = document.defaultView.getComputedStyle(element, '');
265
- return element.style[styleName] || computed ? computed[styleName] : null;
266
- } catch (e) {
267
- return element.style[styleName];
268
- }
269
- };
270
-
271
- /* istanbul ignore next */
272
- function setStyle(element, styleName, value) {
273
- if (!element || !styleName) return;
274
-
275
- if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
276
- for (var prop in styleName) {
277
- if (styleName.hasOwnProperty(prop)) {
278
- setStyle(element, prop, styleName[prop]);
279
- }
280
- }
281
- } else {
282
- styleName = camelCase(styleName);
283
- if (styleName === 'opacity' && ieVersion < 9) {
284
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
285
- } else {
286
- element.style[styleName] = value;
287
- }
288
- }
289
- };
290
-
291
- var isScroll = function isScroll(el, vertical) {
292
- if (isServer) return;
293
-
294
- var determinedDirection = vertical !== null && vertical !== undefined;
295
- var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
296
-
297
- return overflow.match(/(scroll|auto|overlay)/);
298
- };
299
-
300
- var getScrollContainer = function getScrollContainer(el, vertical) {
301
- if (isServer) return;
302
-
303
- var parent = el;
304
- while (parent) {
305
- if ([window, document, document.documentElement].includes(parent)) {
306
- return window;
307
- }
308
- if (isScroll(parent, vertical)) {
309
- return parent;
310
- }
311
- parent = parent.parentNode;
312
- }
313
-
314
- return parent;
315
- };
316
-
317
- var isInContainer = function isInContainer(el, container) {
318
- if (isServer || !el || !container) return false;
319
-
320
- var elRect = el.getBoundingClientRect();
321
- var containerRect = void 0;
322
-
323
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
324
- containerRect = {
325
- top: 0,
326
- right: window.innerWidth,
327
- bottom: window.innerHeight,
328
- left: 0
329
- };
330
- } else {
331
- containerRect = container.getBoundingClientRect();
332
- }
333
-
334
- return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
335
- };
336
-
337
- /***/ }),
338
-
339
- /***/ 11:
340
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
341
-
342
- "use strict";
343
-
344
- // EXPORTS
345
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; });
346
-
347
- // UNUSED EXPORTS: use, i18n
348
-
349
- // CONCATENATED MODULE: ./src/locale/lang/zh-CN.js
350
- /* harmony default export */ var zh_CN = ({
351
- el: {
352
- colorpicker: {
353
- confirm: '确定',
354
- clear: '清空'
355
- },
356
- datepicker: {
357
- now: '此刻',
358
- today: '今天',
359
- cancel: '取消',
360
- clear: '清空',
361
- confirm: '确定',
362
- selectDate: '选择日期',
363
- selectTime: '选择时间',
364
- startDate: '开始日期',
365
- startTime: '开始时间',
366
- endDate: '结束日期',
367
- endTime: '结束时间',
368
- prevYear: '前一年',
369
- nextYear: '后一年',
370
- prevMonth: '上个月',
371
- nextMonth: '下个月',
372
- year: '年',
373
- month1: '1 月',
374
- month2: '2 月',
375
- month3: '3 月',
376
- month4: '4 月',
377
- month5: '5 月',
378
- month6: '6 月',
379
- month7: '7 月',
380
- month8: '8 月',
381
- month9: '9 月',
382
- month10: '10 月',
383
- month11: '11 月',
384
- month12: '12 月',
385
- // week: '周次',
386
- weeks: {
387
- sun: '日',
388
- mon: '一',
389
- tue: '二',
390
- wed: '三',
391
- thu: '四',
392
- fri: '五',
393
- sat: '六'
394
- },
395
- months: {
396
- jan: '一月',
397
- feb: '二月',
398
- mar: '三月',
399
- apr: '四月',
400
- may: '五月',
401
- jun: '六月',
402
- jul: '七月',
403
- aug: '八月',
404
- sep: '九月',
405
- oct: '十月',
406
- nov: '十一月',
407
- dec: '十二月'
408
- }
409
- },
410
- select: {
411
- loading: '加载中',
412
- noMatch: '无匹配数据',
413
- noData: '无数据',
414
- placeholder: '请选择'
415
- },
416
- cascader: {
417
- noMatch: '无匹配数据',
418
- loading: '加载中',
419
- placeholder: '请选择',
420
- noData: '暂无数据'
421
- },
422
- pagination: {
423
- goto: '前往',
424
- pagesize: '条/页',
425
- total: '共 {total} 条',
426
- pageClassifier: '页'
427
- },
428
- messagebox: {
429
- title: '提示',
430
- confirm: '确定',
431
- cancel: '取消',
432
- error: '输入的数据不合法!'
433
- },
434
- upload: {
435
- deleteTip: '按 delete 键可删除',
436
- delete: '删除',
437
- preview: '查看图片',
438
- continue: '继续上传'
439
- },
440
- table: {
441
- emptyText: '暂无数据',
442
- confirmFilter: '筛选',
443
- resetFilter: '重置',
444
- clearFilter: '全部',
445
- sumText: '合计'
446
- },
447
- tree: {
448
- emptyText: '暂无数据'
449
- },
450
- transfer: {
451
- noMatch: '无匹配数据',
452
- noData: '无数据',
453
- titles: ['列表 1', '列表 2'],
454
- filterPlaceholder: '请输入搜索内容',
455
- noCheckedFormat: '共 {total} 项',
456
- hasCheckedFormat: '已选 {checked}/{total} 项'
457
- },
458
- image: {
459
- error: '加载失败'
460
- },
461
- pageHeader: {
462
- title: '返回'
463
- },
464
- popconfirm: {
465
- confirmButtonText: '确定',
466
- cancelButtonText: '取消'
467
- },
468
- empty: {
469
- description: '暂无数据'
470
- }
471
- }
472
- });
473
- // EXTERNAL MODULE: external "vue"
474
- var external_vue_ = __webpack_require__(0);
475
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
476
-
477
- // EXTERNAL MODULE: external "deepmerge"
478
- var external_deepmerge_ = __webpack_require__(15);
479
- var external_deepmerge_default = /*#__PURE__*/__webpack_require__.n(external_deepmerge_);
480
-
481
- // EXTERNAL MODULE: ./src/utils/util.js
482
- var util = __webpack_require__(3);
483
-
484
- // CONCATENATED MODULE: ./src/locale/format.js
485
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
486
-
487
-
488
-
489
- var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
490
- /**
491
- * String format template
492
- * - Inspired:
493
- * https://github.com/Matt-Esch/string-template/index.js
494
- */
495
- /* harmony default export */ var format = (function (Vue) {
496
- /**
497
- * template
498
- *
499
- * @param {String} string
500
- * @param {Array} ...args
501
- * @return {String}
502
- */
503
-
504
- function template(string) {
505
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
506
- args[_key - 1] = arguments[_key];
507
- }
508
-
509
- if (args.length === 1 && _typeof(args[0]) === 'object') {
510
- args = args[0];
511
- }
512
-
513
- if (!args || !args.hasOwnProperty) {
514
- args = {};
515
- }
516
-
517
- return string.replace(RE_NARGS, function (match, prefix, i, index) {
518
- var result = void 0;
519
-
520
- if (string[index - 1] === '{' && string[index + match.length] === '}') {
521
- return i;
522
- } else {
523
- result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null;
524
- if (result === null || result === undefined) {
525
- return '';
526
- }
527
-
528
- return result;
529
- }
530
- });
531
- }
532
-
533
- return template;
534
- });
535
- // CONCATENATED MODULE: ./src/locale/index.js
536
-
537
-
538
-
539
-
540
-
541
- var locale_format = format(external_vue_default.a);
542
- var lang = zh_CN;
543
- var merged = false;
544
- var locale_i18nHandler = function i18nHandler() {
545
- var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t;
546
- if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) {
547
- if (!merged) {
548
- merged = true;
549
- external_vue_default.a.locale(external_vue_default.a.config.lang, external_deepmerge_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true }));
550
- }
551
- return vuei18n.apply(this, arguments);
552
- }
553
- };
554
-
555
- var t = function t(path, options) {
556
- var value = locale_i18nHandler.apply(this, arguments);
557
- if (value !== null && value !== undefined) return value;
558
-
559
- var array = path.split('.');
560
- var current = lang;
561
-
562
- for (var i = 0, j = array.length; i < j; i++) {
563
- var property = array[i];
564
- value = current[property];
565
- if (i === j - 1) return locale_format(value, options);
566
- if (!value) return '';
567
- current = value;
568
- }
569
- return '';
570
- };
571
-
572
- var use = function use(l) {
573
- lang = l || lang;
574
- };
575
-
576
- var i18n = function i18n(fn) {
577
- locale_i18nHandler = fn || locale_i18nHandler;
578
- };
579
-
580
- /* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n });
581
-
582
- /***/ }),
583
-
584
- /***/ 15:
585
- /***/ (function(module, exports) {
586
-
587
- module.exports = require("deepmerge");
588
-
589
- /***/ }),
590
-
591
- /***/ 2:
592
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
593
-
594
- "use strict";
595
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
596
- /* globals __VUE_SSR_CONTEXT__ */
597
-
598
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
599
- // This module is a runtime utility for cleaner component module output and will
600
- // be included in the final webpack user bundle.
601
-
602
- function normalizeComponent(
603
- scriptExports,
604
- render,
605
- staticRenderFns,
606
- functionalTemplate,
607
- injectStyles,
608
- scopeId,
609
- moduleIdentifier /* server only */,
610
- shadowMode /* vue-cli only */
611
- ) {
612
- // Vue.extend constructor export interop
613
- var options =
614
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
615
-
616
- // render functions
617
- if (render) {
618
- options.render = render
619
- options.staticRenderFns = staticRenderFns
620
- options._compiled = true
621
- }
622
-
623
- // functional template
624
- if (functionalTemplate) {
625
- options.functional = true
626
- }
627
-
628
- // scopedId
629
- if (scopeId) {
630
- options._scopeId = 'data-v-' + scopeId
631
- }
632
-
633
- var hook
634
- if (moduleIdentifier) {
635
- // server build
636
- hook = function (context) {
637
- // 2.3 injection
638
- context =
639
- context || // cached call
640
- (this.$vnode && this.$vnode.ssrContext) || // stateful
641
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
642
- // 2.2 with runInNewContext: true
643
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
644
- context = __VUE_SSR_CONTEXT__
645
- }
646
- // inject component styles
647
- if (injectStyles) {
648
- injectStyles.call(this, context)
649
- }
650
- // register component module identifier for async chunk inferrence
651
- if (context && context._registeredComponents) {
652
- context._registeredComponents.add(moduleIdentifier)
653
- }
654
- }
655
- // used by ssr in case component is cached and beforeCreate
656
- // never gets called
657
- options._ssrRegister = hook
658
- } else if (injectStyles) {
659
- hook = shadowMode
660
- ? function () {
661
- injectStyles.call(
662
- this,
663
- (options.functional ? this.parent : this).$root.$options.shadowRoot
664
- )
665
- }
666
- : injectStyles
667
- }
668
-
669
- if (hook) {
670
- if (options.functional) {
671
- // for template-only hot-reload because in that case the render fn doesn't
672
- // go through the normalizer
673
- options._injectStyles = hook
674
- // register for functional component in vue file
675
- var originalRender = options.render
676
- options.render = function renderWithStyleInjection(h, context) {
677
- hook.call(context)
678
- return originalRender(h, context)
679
- }
680
- } else {
681
- // inject component registration as beforeCreate hook
682
- var existing = options.beforeCreate
683
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
684
- }
685
- }
686
-
687
- return {
688
- exports: scriptExports,
689
- options: options
690
- }
691
- }
692
-
693
-
694
- /***/ }),
695
-
696
- /***/ 26:
697
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
698
-
699
- "use strict";
700
- // ESM COMPAT FLAG
701
- __webpack_require__.r(__webpack_exports__);
702
-
703
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=template&id=507ff861
704
- var render = function render() {
705
- var _vm = this,
706
- _c = _vm._self._c
707
- return _c(
708
- "label",
709
- {
710
- staticClass: "el-checkbox",
711
- class: [
712
- _vm.border && _vm.checkboxSize
713
- ? "el-checkbox--" + _vm.checkboxSize
714
- : "",
715
- { "is-disabled": _vm.isDisabled },
716
- { "is-bordered": _vm.border },
717
- { "is-checked": _vm.isChecked },
718
- ],
719
- attrs: { id: _vm.id },
720
- },
721
- [
722
- _c(
723
- "span",
724
- {
725
- staticClass: "el-checkbox__input",
726
- class: {
727
- "is-disabled": _vm.isDisabled,
728
- "is-checked": _vm.isChecked,
729
- "is-indeterminate": _vm.indeterminate,
730
- "is-focus": _vm.focus,
731
- },
732
- attrs: {
733
- tabindex: _vm.indeterminate ? 0 : false,
734
- role: _vm.indeterminate ? "checkbox" : false,
735
- "aria-checked": _vm.indeterminate ? "mixed" : false,
736
- },
737
- },
738
- [
739
- _c("span", { staticClass: "el-checkbox__inner" }),
740
- _vm.trueLabel || _vm.falseLabel
741
- ? _c("input", {
742
- directives: [
743
- {
744
- name: "model",
745
- rawName: "v-model",
746
- value: _vm.model,
747
- expression: "model",
748
- },
749
- ],
750
- staticClass: "el-checkbox__original",
751
- attrs: {
752
- type: "checkbox",
753
- "aria-hidden": _vm.indeterminate ? "true" : "false",
754
- name: _vm.name,
755
- disabled: _vm.isDisabled,
756
- "true-value": _vm.trueLabel,
757
- "false-value": _vm.falseLabel,
758
- },
759
- domProps: {
760
- checked: Array.isArray(_vm.model)
761
- ? _vm._i(_vm.model, null) > -1
762
- : _vm._q(_vm.model, _vm.trueLabel),
763
- },
764
- on: {
765
- change: [
766
- function ($event) {
767
- var $$a = _vm.model,
768
- $$el = $event.target,
769
- $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
770
- if (Array.isArray($$a)) {
771
- var $$v = null,
772
- $$i = _vm._i($$a, $$v)
773
- if ($$el.checked) {
774
- $$i < 0 && (_vm.model = $$a.concat([$$v]))
775
- } else {
776
- $$i > -1 &&
777
- (_vm.model = $$a
778
- .slice(0, $$i)
779
- .concat($$a.slice($$i + 1)))
780
- }
781
- } else {
782
- _vm.model = $$c
783
- }
784
- },
785
- _vm.handleChange,
786
- ],
787
- focus: function ($event) {
788
- _vm.focus = true
789
- },
790
- blur: function ($event) {
791
- _vm.focus = false
792
- },
793
- },
794
- })
795
- : _c("input", {
796
- directives: [
797
- {
798
- name: "model",
799
- rawName: "v-model",
800
- value: _vm.model,
801
- expression: "model",
802
- },
803
- ],
804
- staticClass: "el-checkbox__original",
805
- attrs: {
806
- type: "checkbox",
807
- "aria-hidden": _vm.indeterminate ? "true" : "false",
808
- disabled: _vm.isDisabled,
809
- name: _vm.name,
810
- },
811
- domProps: {
812
- value: _vm.label,
813
- checked: Array.isArray(_vm.model)
814
- ? _vm._i(_vm.model, _vm.label) > -1
815
- : _vm.model,
816
- },
817
- on: {
818
- change: [
819
- function ($event) {
820
- var $$a = _vm.model,
821
- $$el = $event.target,
822
- $$c = $$el.checked ? true : false
823
- if (Array.isArray($$a)) {
824
- var $$v = _vm.label,
825
- $$i = _vm._i($$a, $$v)
826
- if ($$el.checked) {
827
- $$i < 0 && (_vm.model = $$a.concat([$$v]))
828
- } else {
829
- $$i > -1 &&
830
- (_vm.model = $$a
831
- .slice(0, $$i)
832
- .concat($$a.slice($$i + 1)))
833
- }
834
- } else {
835
- _vm.model = $$c
836
- }
837
- },
838
- _vm.handleChange,
839
- ],
840
- focus: function ($event) {
841
- _vm.focus = true
842
- },
843
- blur: function ($event) {
844
- _vm.focus = false
845
- },
846
- },
847
- }),
848
- ]
849
- ),
850
- _vm.$slots.default || _vm.label
851
- ? _c(
852
- "span",
853
- { staticClass: "el-checkbox__label" },
854
- [
855
- _vm._t("default"),
856
- !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
857
- ],
858
- 2
859
- )
860
- : _vm._e(),
861
- ]
862
- )
863
- }
864
- var staticRenderFns = []
865
- render._withStripped = true
866
-
867
-
868
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=507ff861
869
-
870
- // EXTERNAL MODULE: ./src/mixins/emitter.js
871
- var emitter = __webpack_require__(6);
872
-
873
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
874
-
875
-
876
-
877
- /* harmony default export */ var checkboxvue_type_script_lang_js = ({
878
- name: 'ElCheckbox',
879
-
880
- mixins: [emitter["a" /* default */]],
881
-
882
- inject: {
883
- elForm: {
884
- default: ''
885
- },
886
- elFormItem: {
887
- default: ''
888
- }
889
- },
890
-
891
- componentName: 'ElCheckbox',
892
-
893
- data: function data() {
894
- return {
895
- selfModel: false,
896
- focus: false,
897
- isLimitExceeded: false
898
- };
899
- },
900
-
901
-
902
- computed: {
903
- model: {
904
- get: function get() {
905
- return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
906
- },
907
- set: function set(val) {
908
- if (this.isGroup) {
909
- this.isLimitExceeded = false;
910
- this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
911
-
912
- this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
913
-
914
- this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
915
- } else {
916
- this.$emit('input', val);
917
- this.selfModel = val;
918
- }
919
- }
920
- },
921
-
922
- isChecked: function isChecked() {
923
- if ({}.toString.call(this.model) === '[object Boolean]') {
924
- return this.model;
925
- } else if (Array.isArray(this.model)) {
926
- return this.model.indexOf(this.label) > -1;
927
- } else if (this.model !== null && this.model !== undefined) {
928
- return this.model === this.trueLabel;
929
- }
930
- },
931
- isGroup: function isGroup() {
932
- var parent = this.$parent;
933
- while (parent) {
934
- if (parent.$options.componentName !== 'ElCheckboxGroup') {
935
- parent = parent.$parent;
936
- } else {
937
- this._checkboxGroup = parent;
938
- return true;
939
- }
940
- }
941
- return false;
942
- },
943
- store: function store() {
944
- return this._checkboxGroup ? this._checkboxGroup.value : this.value;
945
- },
946
-
947
-
948
- /* used to make the isDisabled judgment under max/min props */
949
- isLimitDisabled: function isLimitDisabled() {
950
- var _checkboxGroup = this._checkboxGroup,
951
- max = _checkboxGroup.max,
952
- min = _checkboxGroup.min;
953
-
954
- return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
955
- },
956
- isDisabled: function isDisabled() {
957
- return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
958
- },
959
- _elFormItemSize: function _elFormItemSize() {
960
- return (this.elFormItem || {}).elFormItemSize;
961
- },
962
- checkboxSize: function checkboxSize() {
963
- var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
964
- return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
965
- }
966
- },
967
-
968
- props: {
969
- value: {},
970
- label: {},
971
- indeterminate: Boolean,
972
- disabled: Boolean,
973
- checked: Boolean,
974
- name: String,
975
- trueLabel: [String, Number],
976
- falseLabel: [String, Number],
977
- id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
978
- controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
979
- border: Boolean,
980
- size: String
981
- },
982
-
983
- methods: {
984
- addToStore: function addToStore() {
985
- if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
986
- this.model.push(this.label);
987
- } else {
988
- this.model = this.trueLabel || true;
989
- }
990
- },
991
- handleChange: function handleChange(ev) {
992
- var _this = this;
993
-
994
- if (this.isLimitExceeded) return;
995
- var value = void 0;
996
- if (ev.target.checked) {
997
- value = this.trueLabel === undefined ? true : this.trueLabel;
998
- } else {
999
- value = this.falseLabel === undefined ? false : this.falseLabel;
1000
- }
1001
- this.$emit('change', value, ev);
1002
- this.$nextTick(function () {
1003
- if (_this.isGroup) {
1004
- _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
1005
- }
1006
- });
1007
- }
1008
- },
1009
-
1010
- created: function created() {
1011
- this.checked && this.addToStore();
1012
- },
1013
- mounted: function mounted() {
1014
- // 为indeterminate元素 添加aria-controls 属性
1015
- if (this.indeterminate) {
1016
- this.$el.setAttribute('aria-controls', this.controls);
1017
- }
1018
- },
1019
-
1020
-
1021
- watch: {
1022
- value: function value(_value) {
1023
- this.dispatch('ElFormItem', 'el.form.change', _value);
1024
- }
1025
- }
1026
- });
1027
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
1028
- /* harmony default export */ var src_checkboxvue_type_script_lang_js = (checkboxvue_type_script_lang_js);
1029
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1030
- var componentNormalizer = __webpack_require__(2);
1031
-
1032
- // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
1033
-
1034
-
1035
-
1036
-
1037
-
1038
- /* normalize component */
1039
-
1040
- var component = Object(componentNormalizer["a" /* default */])(
1041
- src_checkboxvue_type_script_lang_js,
1042
- render,
1043
- staticRenderFns,
1044
- false,
1045
- null,
1046
- null,
1047
- null
1048
-
1049
- )
1050
-
1051
- /* harmony default export */ var src_checkbox = (component.exports);
1052
- // CONCATENATED MODULE: ./packages/checkbox/index.js
1053
-
1054
-
1055
- /* istanbul ignore next */
1056
- src_checkbox.install = function (Vue) {
1057
- Vue.component(src_checkbox.name, src_checkbox);
1058
- };
1059
-
1060
- /* harmony default export */ var packages_checkbox = __webpack_exports__["default"] = (src_checkbox);
1061
-
1062
- /***/ }),
1063
-
1064
- /***/ 3:
1065
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1066
-
1067
- "use strict";
1068
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
1069
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
1070
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
1071
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
1072
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
1073
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
1074
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
1075
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
1076
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
1077
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
1078
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
1079
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
1080
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
1081
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
1082
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
1083
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
1084
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
1085
- /* unused harmony export looseEqual */
1086
- /* unused harmony export arrayEquals */
1087
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
1088
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
1089
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
1090
- /* unused harmony export objToArray */
1091
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
1092
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1093
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1094
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
1095
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1096
-
1097
-
1098
-
1099
-
1100
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1101
-
1102
- function noop() {};
1103
-
1104
- function hasOwn(obj, key) {
1105
- return hasOwnProperty.call(obj, key);
1106
- };
1107
-
1108
- function extend(to, _from) {
1109
- for (var key in _from) {
1110
- to[key] = _from[key];
1111
- }
1112
- return to;
1113
- };
1114
-
1115
- function toObject(arr) {
1116
- var res = {};
1117
- for (var i = 0; i < arr.length; i++) {
1118
- if (arr[i]) {
1119
- extend(res, arr[i]);
1120
- }
1121
- }
1122
- return res;
1123
- };
1124
-
1125
- var getValueByPath = function getValueByPath(object, prop) {
1126
- prop = prop || '';
1127
- var paths = prop.split('.');
1128
- var current = object;
1129
- var result = null;
1130
- for (var i = 0, j = paths.length; i < j; i++) {
1131
- var path = paths[i];
1132
- if (!current) break;
1133
-
1134
- if (i === j - 1) {
1135
- result = current[path];
1136
- break;
1137
- }
1138
- current = current[path];
1139
- }
1140
- return result;
1141
- };
1142
-
1143
- function getPropByPath(obj, path, strict) {
1144
- var tempObj = obj;
1145
- path = path.replace(/\[(\w+)\]/g, '.$1');
1146
- path = path.replace(/^\./, '');
1147
-
1148
- var keyArr = path.split('.');
1149
- var i = 0;
1150
- for (var len = keyArr.length; i < len - 1; ++i) {
1151
- if (!tempObj && !strict) break;
1152
- var key = keyArr[i];
1153
- if (key in tempObj) {
1154
- tempObj = tempObj[key];
1155
- } else {
1156
- if (strict) {
1157
- throw new Error('please transfer a valid prop path to form item!');
1158
- }
1159
- break;
1160
- }
1161
- }
1162
- return {
1163
- o: tempObj,
1164
- k: keyArr[i],
1165
- v: tempObj ? tempObj[keyArr[i]] : null
1166
- };
1167
- };
1168
-
1169
- var generateId = function generateId() {
1170
- return Math.floor(Math.random() * 10000);
1171
- };
1172
-
1173
- var valueEquals = function valueEquals(a, b) {
1174
- // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
1175
- if (a === b) return true;
1176
- if (!(a instanceof Array)) return false;
1177
- if (!(b instanceof Array)) return false;
1178
- if (a.length !== b.length) return false;
1179
- for (var i = 0; i !== a.length; ++i) {
1180
- if (a[i] !== b[i]) return false;
1181
- }
1182
- return true;
1183
- };
1184
-
1185
- var escapeRegexpString = function escapeRegexpString() {
1186
- var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1187
- return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
1188
- };
1189
-
1190
- // TODO: use native Array.find, Array.findIndex when IE support is dropped
1191
- var arrayFindIndex = function arrayFindIndex(arr, pred) {
1192
- for (var i = 0; i !== arr.length; ++i) {
1193
- if (pred(arr[i])) {
1194
- return i;
1195
- }
1196
- }
1197
- return -1;
1198
- };
1199
-
1200
- var arrayFind = function arrayFind(arr, pred) {
1201
- var idx = arrayFindIndex(arr, pred);
1202
- return idx !== -1 ? arr[idx] : undefined;
1203
- };
1204
-
1205
- // coerce truthy value to array
1206
- var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
1207
- if (Array.isArray(val)) {
1208
- return val;
1209
- } else if (val) {
1210
- return [val];
1211
- } else {
1212
- return [];
1213
- }
1214
- };
1215
-
1216
- var isIE = function isIE() {
1217
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
1218
- };
1219
-
1220
- var isEdge = function isEdge() {
1221
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
1222
- };
1223
-
1224
- var isFirefox = function isFirefox() {
1225
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
1226
- };
1227
-
1228
- var autoprefixer = function autoprefixer(style) {
1229
- if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
1230
- var rules = ['transform', 'transition', 'animation'];
1231
- var prefixes = ['ms-', 'webkit-'];
1232
- rules.forEach(function (rule) {
1233
- var value = style[rule];
1234
- if (rule && value) {
1235
- prefixes.forEach(function (prefix) {
1236
- style[prefix + rule] = value;
1237
- });
1238
- }
1239
- });
1240
- return style;
1241
- };
1242
-
1243
- var kebabCase = function kebabCase(str) {
1244
- var hyphenateRE = /([^-])([A-Z])/g;
1245
- return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
1246
- };
1247
-
1248
- var capitalize = function capitalize(str) {
1249
- if (!Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
1250
- return str.charAt(0).toUpperCase() + str.slice(1);
1251
- };
1252
-
1253
- var looseEqual = function looseEqual(a, b) {
1254
- var isObjectA = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
1255
- var isObjectB = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
1256
- if (isObjectA && isObjectB) {
1257
- return JSON.stringify(a) === JSON.stringify(b);
1258
- } else if (!isObjectA && !isObjectB) {
1259
- return String(a) === String(b);
1260
- } else {
1261
- return false;
1262
- }
1263
- };
1264
-
1265
- var arrayEquals = function arrayEquals(arrayA, arrayB) {
1266
- arrayA = arrayA || [];
1267
- arrayB = arrayB || [];
1268
-
1269
- if (arrayA.length !== arrayB.length) {
1270
- return false;
1271
- }
1272
-
1273
- for (var i = 0; i < arrayA.length; i++) {
1274
- if (!looseEqual(arrayA[i], arrayB[i])) {
1275
- return false;
1276
- }
1277
- }
1278
-
1279
- return true;
1280
- };
1281
-
1282
- var isEqual = function isEqual(value1, value2) {
1283
- if (Array.isArray(value1) && Array.isArray(value2)) {
1284
- return arrayEquals(value1, value2);
1285
- }
1286
- return looseEqual(value1, value2);
1287
- };
1288
-
1289
- var isEmpty = function isEmpty(val) {
1290
- // null or undefined
1291
- if (val == null) return true;
1292
-
1293
- if (typeof val === 'boolean') return false;
1294
-
1295
- if (typeof val === 'number') return !val;
1296
-
1297
- if (val instanceof Error) return val.message === '';
1298
-
1299
- switch (Object.prototype.toString.call(val)) {
1300
- // String or Array
1301
- case '[object String]':
1302
- case '[object Array]':
1303
- return !val.length;
1304
-
1305
- // Map or Set or File
1306
- case '[object File]':
1307
- case '[object Map]':
1308
- case '[object Set]':
1309
- {
1310
- return !val.size;
1311
- }
1312
- // Plain Object
1313
- case '[object Object]':
1314
- {
1315
- return !Object.keys(val).length;
1316
- }
1317
- }
1318
-
1319
- return false;
1320
- };
1321
-
1322
- function rafThrottle(fn) {
1323
- var locked = false;
1324
- return function () {
1325
- var _this = this;
1326
-
1327
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1328
- args[_key] = arguments[_key];
1329
- }
1330
-
1331
- if (locked) return;
1332
- locked = true;
1333
- window.requestAnimationFrame(function (_) {
1334
- fn.apply(_this, args);
1335
- locked = false;
1336
- });
1337
- };
1338
- }
1339
-
1340
- function objToArray(obj) {
1341
- if (Array.isArray(obj)) {
1342
- return obj;
1343
- }
1344
- return isEmpty(obj) ? [] : [obj];
1345
- }
1346
-
1347
- var isMac = function isMac() {
1348
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
1349
- };
1350
-
1351
- /***/ }),
1352
-
1353
- /***/ 40:
1354
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1355
-
1356
- "use strict";
1357
- /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
1358
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1359
-
1360
-
1361
-
1362
- var Transition = function () {
1363
- function Transition() {
1364
- _classCallCheck(this, Transition);
1365
- }
1366
-
1367
- Transition.prototype.beforeEnter = function beforeEnter(el) {
1368
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
1369
- if (!el.dataset) el.dataset = {};
1370
-
1371
- el.dataset.oldPaddingTop = el.style.paddingTop;
1372
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
1373
-
1374
- el.style.height = '0';
1375
- el.style.paddingTop = 0;
1376
- el.style.paddingBottom = 0;
1377
- };
1378
-
1379
- Transition.prototype.enter = function enter(el) {
1380
- el.dataset.oldOverflow = el.style.overflow;
1381
- if (el.scrollHeight !== 0) {
1382
- el.style.height = el.scrollHeight + 'px';
1383
- el.style.paddingTop = el.dataset.oldPaddingTop;
1384
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
1385
- } else {
1386
- el.style.height = '';
1387
- el.style.paddingTop = el.dataset.oldPaddingTop;
1388
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
1389
- }
1390
-
1391
- el.style.overflow = 'hidden';
1392
- };
1393
-
1394
- Transition.prototype.afterEnter = function afterEnter(el) {
1395
- // for safari: remove class then reset height is necessary
1396
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
1397
- el.style.height = '';
1398
- el.style.overflow = el.dataset.oldOverflow;
1399
- };
1400
-
1401
- Transition.prototype.beforeLeave = function beforeLeave(el) {
1402
- if (!el.dataset) el.dataset = {};
1403
- el.dataset.oldPaddingTop = el.style.paddingTop;
1404
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
1405
- el.dataset.oldOverflow = el.style.overflow;
1406
-
1407
- el.style.height = el.scrollHeight + 'px';
1408
- el.style.overflow = 'hidden';
1409
- };
1410
-
1411
- Transition.prototype.leave = function leave(el) {
1412
- if (el.scrollHeight !== 0) {
1413
- // for safari: add class after set height, or it will jump to zero height suddenly, weired
1414
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
1415
- el.style.height = 0;
1416
- el.style.paddingTop = 0;
1417
- el.style.paddingBottom = 0;
1418
- }
1419
- };
1420
-
1421
- Transition.prototype.afterLeave = function afterLeave(el) {
1422
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
1423
- el.style.height = '';
1424
- el.style.overflow = el.dataset.oldOverflow;
1425
- el.style.paddingTop = el.dataset.oldPaddingTop;
1426
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
1427
- };
1428
-
1429
- return Transition;
1430
- }();
1431
-
1432
- /* harmony default export */ __webpack_exports__["a"] = ({
1433
- name: 'ElCollapseTransition',
1434
- functional: true,
1435
- render: function render(h, _ref) {
1436
- var children = _ref.children;
1437
-
1438
- var data = {
1439
- on: new Transition()
1440
- };
1441
-
1442
- return h('transition', data, children);
1443
- }
1444
- });
1445
-
1446
- /***/ }),
1447
-
1448
- /***/ 5:
1449
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1450
-
1451
- "use strict";
1452
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
1453
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
1454
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
1455
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
1456
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
1457
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
1458
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1459
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1460
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1461
-
1462
-
1463
-
1464
- function isString(obj) {
1465
- return Object.prototype.toString.call(obj) === '[object String]';
1466
- }
1467
-
1468
- function isObject(obj) {
1469
- return Object.prototype.toString.call(obj) === '[object Object]';
1470
- }
1471
-
1472
- function isHtmlElement(node) {
1473
- return node && node.nodeType === Node.ELEMENT_NODE;
1474
- }
1475
-
1476
- /**
1477
- * - Inspired:
1478
- * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
1479
- */
1480
- var isFunction = function isFunction(functionToCheck) {
1481
- var getType = {};
1482
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1483
- };
1484
-
1485
- if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
1486
- isFunction = function isFunction(obj) {
1487
- return typeof obj === 'function' || false;
1488
- };
1489
- }
1490
-
1491
-
1492
-
1493
- var isUndefined = function isUndefined(val) {
1494
- return val === void 0;
1495
- };
1496
-
1497
- var isDefined = function isDefined(val) {
1498
- return val !== undefined && val !== null;
1499
- };
1500
-
1501
- /***/ }),
1502
-
1503
- /***/ 6:
1504
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1505
-
1506
- "use strict";
1507
- function _broadcast(componentName, eventName, params) {
1508
- this.$children.forEach(function (child) {
1509
- var name = child.$options.componentName;
1510
-
1511
- if (name === componentName) {
1512
- child.$emit.apply(child, [eventName].concat(params));
1513
- } else {
1514
- _broadcast.apply(child, [componentName, eventName].concat([params]));
1515
- }
1516
- });
1517
- }
1518
- /* harmony default export */ __webpack_exports__["a"] = ({
1519
- methods: {
1520
- dispatch: function dispatch(componentName, eventName, params) {
1521
- var parent = this.$parent || this.$root;
1522
- var name = parent.$options.componentName;
1523
-
1524
- while (parent && (!name || name !== componentName)) {
1525
- parent = parent.$parent;
1526
-
1527
- if (parent) {
1528
- name = parent.$options.componentName;
1529
- }
1530
- }
1531
- if (parent) {
1532
- parent.$emit.apply(parent, [eventName].concat(params));
1533
- }
1534
- },
1535
- broadcast: function broadcast(componentName, eventName, params) {
1536
- _broadcast.call(this, componentName, eventName, params);
1537
- }
1538
- }
1539
- });
1540
-
1541
- /***/ }),
1542
-
1543
- /***/ 65:
1544
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1545
-
1546
- "use strict";
1547
- // ESM COMPAT FLAG
1548
- __webpack_require__.r(__webpack_exports__);
1549
-
1550
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=template&id=67c8dc07
1551
- var render = function render() {
1552
- var _vm = this,
1553
- _c = _vm._self._c
1554
- return _c(
1555
- "div",
1556
- {
1557
- staticClass: "el-tree",
1558
- class: {
1559
- "el-tree--highlight-current": _vm.highlightCurrent,
1560
- "is-dragging": !!_vm.dragState.draggingNode,
1561
- "is-drop-not-allow": !_vm.dragState.allowDrop,
1562
- "is-drop-inner": _vm.dragState.dropType === "inner",
1563
- },
1564
- attrs: { role: "tree" },
1565
- },
1566
- [
1567
- _vm._l(_vm.root.childNodes, function (child) {
1568
- return _c("el-tree-node", {
1569
- key: _vm.getNodeKey(child),
1570
- attrs: {
1571
- node: child,
1572
- props: _vm.props,
1573
- "render-after-expand": _vm.renderAfterExpand,
1574
- "show-checkbox": _vm.showCheckbox,
1575
- "render-content": _vm.renderContent,
1576
- },
1577
- on: { "node-expand": _vm.handleNodeExpand },
1578
- })
1579
- }),
1580
- _vm.isEmpty
1581
- ? _c("div", { staticClass: "el-tree__empty-block" }, [
1582
- _c("span", { staticClass: "el-tree__empty-text" }, [
1583
- _vm._v(_vm._s(_vm.emptyText)),
1584
- ]),
1585
- ])
1586
- : _vm._e(),
1587
- _c("div", {
1588
- directives: [
1589
- {
1590
- name: "show",
1591
- rawName: "v-show",
1592
- value: _vm.dragState.showDropIndicator,
1593
- expression: "dragState.showDropIndicator",
1594
- },
1595
- ],
1596
- ref: "dropIndicator",
1597
- staticClass: "el-tree__drop-indicator",
1598
- }),
1599
- ],
1600
- 2
1601
- )
1602
- }
1603
- var staticRenderFns = []
1604
- render._withStripped = true
1605
-
1606
-
1607
- // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=67c8dc07
1608
-
1609
- // EXTERNAL MODULE: ./src/utils/merge.js
1610
- var merge = __webpack_require__(7);
1611
-
1612
- // CONCATENATED MODULE: ./packages/tree/src/model/util.js
1613
- var NODE_KEY = '$treeNodeId';
1614
-
1615
- var markNodeData = function markNodeData(node, data) {
1616
- if (!data || data[NODE_KEY]) return;
1617
- Object.defineProperty(data, NODE_KEY, {
1618
- value: node.id,
1619
- enumerable: false,
1620
- configurable: false,
1621
- writable: false
1622
- });
1623
- };
1624
-
1625
- var util_getNodeKey = function getNodeKey(key, data) {
1626
- if (!key) return data[NODE_KEY];
1627
- return data[key];
1628
- };
1629
-
1630
- var findNearestComponent = function findNearestComponent(element, componentName) {
1631
- var target = element;
1632
- while (target && target.tagName !== 'BODY') {
1633
- if (target.__vue__ && target.__vue__.$options.name === componentName) {
1634
- return target.__vue__;
1635
- }
1636
- target = target.parentNode;
1637
- }
1638
- return null;
1639
- };
1640
- // EXTERNAL MODULE: ./src/utils/util.js
1641
- var util = __webpack_require__(3);
1642
-
1643
- // CONCATENATED MODULE: ./packages/tree/src/model/node.js
1644
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1645
-
1646
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1647
-
1648
-
1649
-
1650
-
1651
-
1652
- var getChildState = function getChildState(node) {
1653
- var all = true;
1654
- var none = true;
1655
- var allWithoutDisable = true;
1656
- for (var i = 0, j = node.length; i < j; i++) {
1657
- var n = node[i];
1658
- if (n.checked !== true || n.indeterminate) {
1659
- all = false;
1660
- if (!n.disabled) {
1661
- allWithoutDisable = false;
1662
- }
1663
- }
1664
- if (n.checked !== false || n.indeterminate) {
1665
- none = false;
1666
- }
1667
- }
1668
-
1669
- return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
1670
- };
1671
-
1672
- var reInitChecked = function reInitChecked(node) {
1673
- if (node.childNodes.length === 0 || node.loading) return;
1674
-
1675
- var _getChildState = getChildState(node.childNodes),
1676
- all = _getChildState.all,
1677
- none = _getChildState.none,
1678
- half = _getChildState.half;
1679
-
1680
- if (all) {
1681
- node.checked = true;
1682
- node.indeterminate = false;
1683
- } else if (half) {
1684
- node.checked = false;
1685
- node.indeterminate = true;
1686
- } else if (none) {
1687
- node.checked = false;
1688
- node.indeterminate = false;
1689
- }
1690
-
1691
- var parent = node.parent;
1692
- if (!parent || parent.level === 0) return;
1693
-
1694
- if (!node.store.checkStrictly) {
1695
- reInitChecked(parent);
1696
- }
1697
- };
1698
-
1699
- var getPropertyFromData = function getPropertyFromData(node, prop) {
1700
- var props = node.store.props;
1701
- var data = node.data || {};
1702
- var config = props[prop];
1703
-
1704
- if (typeof config === 'function') {
1705
- return config(data, node);
1706
- } else if (typeof config === 'string') {
1707
- return data[config];
1708
- } else if (typeof config === 'undefined') {
1709
- var dataProp = data[prop];
1710
- return dataProp === undefined ? '' : dataProp;
1711
- }
1712
- };
1713
-
1714
- var nodeIdSeed = 0;
1715
-
1716
- var node_Node = function () {
1717
- function Node(options) {
1718
- _classCallCheck(this, Node);
1719
-
1720
- this.id = nodeIdSeed++;
1721
- this.text = null;
1722
- this.checked = false;
1723
- this.indeterminate = false;
1724
- this.data = null;
1725
- this.expanded = false;
1726
- this.parent = null;
1727
- this.visible = true;
1728
- this.isCurrent = false;
1729
-
1730
- for (var name in options) {
1731
- if (options.hasOwnProperty(name)) {
1732
- this[name] = options[name];
1733
- }
1734
- }
1735
-
1736
- // internal
1737
- this.level = 0;
1738
- this.loaded = false;
1739
- this.childNodes = [];
1740
- this.loading = false;
1741
-
1742
- if (this.parent) {
1743
- this.level = this.parent.level + 1;
1744
- }
1745
-
1746
- var store = this.store;
1747
- if (!store) {
1748
- throw new Error('[Node]store is required!');
1749
- }
1750
- store.registerNode(this);
1751
-
1752
- var props = store.props;
1753
- if (props && typeof props.isLeaf !== 'undefined') {
1754
- var isLeaf = getPropertyFromData(this, 'isLeaf');
1755
- if (typeof isLeaf === 'boolean') {
1756
- this.isLeafByUser = isLeaf;
1757
- }
1758
- }
1759
-
1760
- if (store.lazy !== true && this.data) {
1761
- this.setData(this.data);
1762
-
1763
- if (store.defaultExpandAll) {
1764
- this.expanded = true;
1765
- }
1766
- } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
1767
- this.expand();
1768
- }
1769
- if (!Array.isArray(this.data)) {
1770
- markNodeData(this, this.data);
1771
- }
1772
- if (!this.data) return;
1773
- var defaultExpandedKeys = store.defaultExpandedKeys;
1774
- var key = store.key;
1775
- if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
1776
- this.expand(null, store.autoExpandParent);
1777
- }
1778
-
1779
- if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
1780
- store.currentNode = this;
1781
- store.currentNode.isCurrent = true;
1782
- }
1783
-
1784
- if (store.lazy) {
1785
- store._initDefaultCheckedNode(this);
1786
- }
1787
-
1788
- this.updateLeafState();
1789
- }
1790
-
1791
- Node.prototype.setData = function setData(data) {
1792
- if (!Array.isArray(data)) {
1793
- markNodeData(this, data);
1794
- }
1795
-
1796
- this.data = data;
1797
- this.childNodes = [];
1798
-
1799
- var children = void 0;
1800
- if (this.level === 0 && this.data instanceof Array) {
1801
- children = this.data;
1802
- } else {
1803
- children = getPropertyFromData(this, 'children') || [];
1804
- }
1805
-
1806
- for (var i = 0, j = children.length; i < j; i++) {
1807
- this.insertChild({ data: children[i] });
1808
- }
1809
- };
1810
-
1811
- Node.prototype.contains = function contains(target) {
1812
- var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1813
-
1814
- var walk = function walk(parent) {
1815
- var children = parent.childNodes || [];
1816
- var result = false;
1817
- for (var i = 0, j = children.length; i < j; i++) {
1818
- var child = children[i];
1819
- if (child === target || deep && walk(child)) {
1820
- result = true;
1821
- break;
1822
- }
1823
- }
1824
- return result;
1825
- };
1826
-
1827
- return walk(this);
1828
- };
1829
-
1830
- Node.prototype.remove = function remove() {
1831
- var parent = this.parent;
1832
- if (parent) {
1833
- parent.removeChild(this);
1834
- }
1835
- };
1836
-
1837
- Node.prototype.insertChild = function insertChild(child, index, batch) {
1838
- if (!child) throw new Error('insertChild error: child is required.');
1839
-
1840
- if (!(child instanceof Node)) {
1841
- if (!batch) {
1842
- var children = this.getChildren(true) || [];
1843
- if (children.indexOf(child.data) === -1) {
1844
- if (typeof index === 'undefined' || index < 0) {
1845
- children.push(child.data);
1846
- } else {
1847
- children.splice(index, 0, child.data);
1848
- }
1849
- }
1850
- }
1851
- Object(merge["a" /* default */])(child, {
1852
- parent: this,
1853
- store: this.store
1854
- });
1855
- child = new Node(child);
1856
- }
1857
-
1858
- child.level = this.level + 1;
1859
-
1860
- if (typeof index === 'undefined' || index < 0) {
1861
- this.childNodes.push(child);
1862
- } else {
1863
- this.childNodes.splice(index, 0, child);
1864
- }
1865
-
1866
- this.updateLeafState();
1867
- };
1868
-
1869
- Node.prototype.insertBefore = function insertBefore(child, ref) {
1870
- var index = void 0;
1871
- if (ref) {
1872
- index = this.childNodes.indexOf(ref);
1873
- }
1874
- this.insertChild(child, index);
1875
- };
1876
-
1877
- Node.prototype.insertAfter = function insertAfter(child, ref) {
1878
- var index = void 0;
1879
- if (ref) {
1880
- index = this.childNodes.indexOf(ref);
1881
- if (index !== -1) index += 1;
1882
- }
1883
- this.insertChild(child, index);
1884
- };
1885
-
1886
- Node.prototype.removeChild = function removeChild(child) {
1887
- var children = this.getChildren() || [];
1888
- var dataIndex = children.indexOf(child.data);
1889
- if (dataIndex > -1) {
1890
- children.splice(dataIndex, 1);
1891
- }
1892
-
1893
- var index = this.childNodes.indexOf(child);
1894
-
1895
- if (index > -1) {
1896
- this.store && this.store.deregisterNode(child);
1897
- child.parent = null;
1898
- this.childNodes.splice(index, 1);
1899
- }
1900
-
1901
- this.updateLeafState();
1902
- };
1903
-
1904
- Node.prototype.removeChildByData = function removeChildByData(data) {
1905
- var targetNode = null;
1906
-
1907
- for (var i = 0; i < this.childNodes.length; i++) {
1908
- if (this.childNodes[i].data === data) {
1909
- targetNode = this.childNodes[i];
1910
- break;
1911
- }
1912
- }
1913
-
1914
- if (targetNode) {
1915
- this.removeChild(targetNode);
1916
- }
1917
- };
1918
-
1919
- Node.prototype.expand = function expand(callback, expandParent) {
1920
- var _this = this;
1921
-
1922
- var done = function done() {
1923
- if (expandParent) {
1924
- var parent = _this.parent;
1925
- while (parent.level > 0) {
1926
- parent.expanded = true;
1927
- parent = parent.parent;
1928
- }
1929
- }
1930
- _this.expanded = true;
1931
- if (callback) callback();
1932
- };
1933
-
1934
- if (this.shouldLoadData()) {
1935
- this.loadData(function (data) {
1936
- if (data instanceof Array) {
1937
- if (_this.checked) {
1938
- _this.setChecked(true, true);
1939
- } else if (!_this.store.checkStrictly) {
1940
- reInitChecked(_this);
1941
- }
1942
- done();
1943
- }
1944
- });
1945
- } else {
1946
- done();
1947
- }
1948
- };
1949
-
1950
- Node.prototype.doCreateChildren = function doCreateChildren(array) {
1951
- var _this2 = this;
1952
-
1953
- var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1954
-
1955
- array.forEach(function (item) {
1956
- _this2.insertChild(Object(merge["a" /* default */])({ data: item }, defaultProps), undefined, true);
1957
- });
1958
- };
1959
-
1960
- Node.prototype.collapse = function collapse() {
1961
- this.expanded = false;
1962
- };
1963
-
1964
- Node.prototype.shouldLoadData = function shouldLoadData() {
1965
- return this.store.lazy === true && this.store.load && !this.loaded;
1966
- };
1967
-
1968
- Node.prototype.updateLeafState = function updateLeafState() {
1969
- if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
1970
- this.isLeaf = this.isLeafByUser;
1971
- return;
1972
- }
1973
- var childNodes = this.childNodes;
1974
- if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
1975
- this.isLeaf = !childNodes || childNodes.length === 0;
1976
- return;
1977
- }
1978
- this.isLeaf = false;
1979
- };
1980
-
1981
- Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
1982
- var _this3 = this;
1983
-
1984
- this.indeterminate = value === 'half';
1985
- this.checked = value === true;
1986
-
1987
- if (this.store.checkStrictly) return;
1988
-
1989
- if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
1990
- var _getChildState2 = getChildState(this.childNodes),
1991
- all = _getChildState2.all,
1992
- allWithoutDisable = _getChildState2.allWithoutDisable;
1993
-
1994
- if (!this.isLeaf && !all && allWithoutDisable) {
1995
- this.checked = false;
1996
- value = false;
1997
- }
1998
-
1999
- var handleDescendants = function handleDescendants() {
2000
- if (deep) {
2001
- var childNodes = _this3.childNodes;
2002
- for (var i = 0, j = childNodes.length; i < j; i++) {
2003
- var child = childNodes[i];
2004
- passValue = passValue || value !== false;
2005
- var isCheck = child.disabled ? child.checked : passValue;
2006
- child.setChecked(isCheck, deep, true, passValue);
2007
- }
2008
-
2009
- var _getChildState3 = getChildState(childNodes),
2010
- half = _getChildState3.half,
2011
- _all = _getChildState3.all;
2012
-
2013
- if (!_all) {
2014
- _this3.checked = _all;
2015
- _this3.indeterminate = half;
2016
- }
2017
- }
2018
- };
2019
-
2020
- if (this.shouldLoadData()) {
2021
- // Only work on lazy load data.
2022
- this.loadData(function () {
2023
- handleDescendants();
2024
- reInitChecked(_this3);
2025
- }, {
2026
- checked: value !== false
2027
- });
2028
- return;
2029
- } else {
2030
- handleDescendants();
2031
- }
2032
- }
2033
-
2034
- var parent = this.parent;
2035
- if (!parent || parent.level === 0) return;
2036
-
2037
- if (!recursion) {
2038
- reInitChecked(parent);
2039
- }
2040
- };
2041
-
2042
- Node.prototype.getChildren = function getChildren() {
2043
- var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2044
- // this is data
2045
- if (this.level === 0) return this.data;
2046
- var data = this.data;
2047
- if (!data) return null;
2048
-
2049
- var props = this.store.props;
2050
- var children = 'children';
2051
- if (props) {
2052
- children = props.children || 'children';
2053
- }
2054
-
2055
- if (data[children] === undefined) {
2056
- data[children] = null;
2057
- }
2058
-
2059
- if (forceInit && !data[children]) {
2060
- data[children] = [];
2061
- }
2062
-
2063
- return data[children];
2064
- };
2065
-
2066
- Node.prototype.updateChildren = function updateChildren() {
2067
- var _this4 = this;
2068
-
2069
- var newData = this.getChildren() || [];
2070
- var oldData = this.childNodes.map(function (node) {
2071
- return node.data;
2072
- });
2073
-
2074
- var newDataMap = {};
2075
- var newNodes = [];
2076
-
2077
- newData.forEach(function (item, index) {
2078
- var key = item[NODE_KEY];
2079
- var isNodeExists = !!key && Object(util["b" /* arrayFindIndex */])(oldData, function (data) {
2080
- return data[NODE_KEY] === key;
2081
- }) >= 0;
2082
- if (isNodeExists) {
2083
- newDataMap[key] = { index: index, data: item };
2084
- } else {
2085
- newNodes.push({ index: index, data: item });
2086
- }
2087
- });
2088
-
2089
- if (!this.store.lazy) {
2090
- oldData.forEach(function (item) {
2091
- if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
2092
- });
2093
- }
2094
-
2095
- newNodes.forEach(function (_ref) {
2096
- var index = _ref.index,
2097
- data = _ref.data;
2098
-
2099
- _this4.insertChild({ data: data }, index);
2100
- });
2101
-
2102
- this.updateLeafState();
2103
- };
2104
-
2105
- Node.prototype.loadData = function loadData(callback) {
2106
- var _this5 = this;
2107
-
2108
- var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2109
-
2110
- if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
2111
- this.loading = true;
2112
-
2113
- var resolve = function resolve(children) {
2114
- _this5.childNodes = [];
2115
-
2116
- _this5.doCreateChildren(children, defaultProps);
2117
- _this5.loaded = true;
2118
- _this5.loading = false;
2119
- _this5.updateLeafState();
2120
- if (callback) {
2121
- callback.call(_this5, children);
2122
- }
2123
- };
2124
-
2125
- this.store.load(this, resolve);
2126
- } else {
2127
- if (callback) {
2128
- callback.call(this);
2129
- }
2130
- }
2131
- };
2132
-
2133
- _createClass(Node, [{
2134
- key: 'label',
2135
- get: function get() {
2136
- return getPropertyFromData(this, 'label');
2137
- }
2138
- }, {
2139
- key: 'key',
2140
- get: function get() {
2141
- var nodeKey = this.store.key;
2142
- if (this.data) return this.data[nodeKey];
2143
- return null;
2144
- }
2145
- }, {
2146
- key: 'disabled',
2147
- get: function get() {
2148
- return getPropertyFromData(this, 'disabled');
2149
- }
2150
- }, {
2151
- key: 'nextSibling',
2152
- get: function get() {
2153
- var parent = this.parent;
2154
- if (parent) {
2155
- var index = parent.childNodes.indexOf(this);
2156
- if (index > -1) {
2157
- return parent.childNodes[index + 1];
2158
- }
2159
- }
2160
- return null;
2161
- }
2162
- }, {
2163
- key: 'previousSibling',
2164
- get: function get() {
2165
- var parent = this.parent;
2166
- if (parent) {
2167
- var index = parent.childNodes.indexOf(this);
2168
- if (index > -1) {
2169
- return index > 0 ? parent.childNodes[index - 1] : null;
2170
- }
2171
- }
2172
- return null;
2173
- }
2174
- }]);
2175
-
2176
- return Node;
2177
- }();
2178
-
2179
- /* harmony default export */ var model_node = (node_Node);
2180
- // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
2181
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2182
-
2183
- function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2184
-
2185
-
2186
-
2187
-
2188
- var tree_store_TreeStore = function () {
2189
- function TreeStore(options) {
2190
- var _this = this;
2191
-
2192
- tree_store_classCallCheck(this, TreeStore);
2193
-
2194
- this.currentNode = null;
2195
- this.currentNodeKey = null;
2196
-
2197
- for (var option in options) {
2198
- if (options.hasOwnProperty(option)) {
2199
- this[option] = options[option];
2200
- }
2201
- }
2202
-
2203
- this.nodesMap = {};
2204
-
2205
- this.root = new model_node({
2206
- data: this.data,
2207
- store: this
2208
- });
2209
-
2210
- if (this.lazy && this.load) {
2211
- var loadFn = this.load;
2212
- loadFn(this.root, function (data) {
2213
- _this.root.doCreateChildren(data);
2214
- _this._initDefaultCheckedNodes();
2215
- });
2216
- } else {
2217
- this._initDefaultCheckedNodes();
2218
- }
2219
- }
2220
-
2221
- TreeStore.prototype.filter = function filter(value) {
2222
- var filterNodeMethod = this.filterNodeMethod;
2223
- var lazy = this.lazy;
2224
- var traverse = function traverse(node) {
2225
- var childNodes = node.root ? node.root.childNodes : node.childNodes;
2226
-
2227
- childNodes.forEach(function (child) {
2228
- child.visible = filterNodeMethod.call(child, value, child.data, child);
2229
-
2230
- traverse(child);
2231
- });
2232
-
2233
- if (!node.visible && childNodes.length) {
2234
- var allHidden = true;
2235
- allHidden = !childNodes.some(function (child) {
2236
- return child.visible;
2237
- });
2238
-
2239
- if (node.root) {
2240
- node.root.visible = allHidden === false;
2241
- } else {
2242
- node.visible = allHidden === false;
2243
- }
2244
- }
2245
- if (!value) return;
2246
-
2247
- if (node.visible && !node.isLeaf && !lazy) node.expand();
2248
- };
2249
-
2250
- traverse(this);
2251
- };
2252
-
2253
- TreeStore.prototype.setData = function setData(newVal) {
2254
- var instanceChanged = newVal !== this.root.data;
2255
- if (instanceChanged) {
2256
- this.root.setData(newVal);
2257
- this._initDefaultCheckedNodes();
2258
- } else {
2259
- this.root.updateChildren();
2260
- }
2261
- };
2262
-
2263
- TreeStore.prototype.getNode = function getNode(data) {
2264
- if (data instanceof model_node) return data;
2265
- var key = (typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
2266
- return this.nodesMap[key] || null;
2267
- };
2268
-
2269
- TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
2270
- var refNode = this.getNode(refData);
2271
- refNode.parent.insertBefore({ data: data }, refNode);
2272
- };
2273
-
2274
- TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
2275
- var refNode = this.getNode(refData);
2276
- refNode.parent.insertAfter({ data: data }, refNode);
2277
- };
2278
-
2279
- TreeStore.prototype.remove = function remove(data) {
2280
- var node = this.getNode(data);
2281
-
2282
- if (node && node.parent) {
2283
- if (node === this.currentNode) {
2284
- this.currentNode = null;
2285
- }
2286
- node.parent.removeChild(node);
2287
- }
2288
- };
2289
-
2290
- TreeStore.prototype.append = function append(data, parentData) {
2291
- var parentNode = parentData ? this.getNode(parentData) : this.root;
2292
-
2293
- if (parentNode) {
2294
- parentNode.insertChild({ data: data });
2295
- }
2296
- };
2297
-
2298
- TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
2299
- var _this2 = this;
2300
-
2301
- var defaultCheckedKeys = this.defaultCheckedKeys || [];
2302
- var nodesMap = this.nodesMap;
2303
-
2304
- defaultCheckedKeys.forEach(function (checkedKey) {
2305
- var node = nodesMap[checkedKey];
2306
-
2307
- if (node) {
2308
- node.setChecked(true, !_this2.checkStrictly);
2309
- }
2310
- });
2311
- };
2312
-
2313
- TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
2314
- var defaultCheckedKeys = this.defaultCheckedKeys || [];
2315
-
2316
- if (defaultCheckedKeys.indexOf(node.key) !== -1) {
2317
- node.setChecked(true, !this.checkStrictly);
2318
- }
2319
- };
2320
-
2321
- TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
2322
- if (newVal !== this.defaultCheckedKeys) {
2323
- this.defaultCheckedKeys = newVal;
2324
- this._initDefaultCheckedNodes();
2325
- }
2326
- };
2327
-
2328
- TreeStore.prototype.registerNode = function registerNode(node) {
2329
- var key = this.key;
2330
- if (!key || !node || !node.data) return;
2331
-
2332
- var nodeKey = node.key;
2333
- if (nodeKey !== undefined) this.nodesMap[node.key] = node;
2334
- };
2335
-
2336
- TreeStore.prototype.deregisterNode = function deregisterNode(node) {
2337
- var _this3 = this;
2338
-
2339
- var key = this.key;
2340
- if (!key || !node || !node.data) return;
2341
-
2342
- node.childNodes.forEach(function (child) {
2343
- _this3.deregisterNode(child);
2344
- });
2345
-
2346
- delete this.nodesMap[node.key];
2347
- };
2348
-
2349
- TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
2350
- var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2351
- var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2352
-
2353
- var checkedNodes = [];
2354
- var traverse = function traverse(node) {
2355
- var childNodes = node.root ? node.root.childNodes : node.childNodes;
2356
-
2357
- childNodes.forEach(function (child) {
2358
- if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
2359
- checkedNodes.push(child.data);
2360
- }
2361
-
2362
- traverse(child);
2363
- });
2364
- };
2365
-
2366
- traverse(this);
2367
-
2368
- return checkedNodes;
2369
- };
2370
-
2371
- TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
2372
- var _this4 = this;
2373
-
2374
- var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2375
-
2376
- return this.getCheckedNodes(leafOnly).map(function (data) {
2377
- return (data || {})[_this4.key];
2378
- });
2379
- };
2380
-
2381
- TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
2382
- var nodes = [];
2383
- var traverse = function traverse(node) {
2384
- var childNodes = node.root ? node.root.childNodes : node.childNodes;
2385
-
2386
- childNodes.forEach(function (child) {
2387
- if (child.indeterminate) {
2388
- nodes.push(child.data);
2389
- }
2390
-
2391
- traverse(child);
2392
- });
2393
- };
2394
-
2395
- traverse(this);
2396
-
2397
- return nodes;
2398
- };
2399
-
2400
- TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
2401
- var _this5 = this;
2402
-
2403
- return this.getHalfCheckedNodes().map(function (data) {
2404
- return (data || {})[_this5.key];
2405
- });
2406
- };
2407
-
2408
- TreeStore.prototype._getAllNodes = function _getAllNodes() {
2409
- var allNodes = [];
2410
- var nodesMap = this.nodesMap;
2411
- for (var nodeKey in nodesMap) {
2412
- if (nodesMap.hasOwnProperty(nodeKey)) {
2413
- allNodes.push(nodesMap[nodeKey]);
2414
- }
2415
- }
2416
-
2417
- return allNodes;
2418
- };
2419
-
2420
- TreeStore.prototype.updateChildren = function updateChildren(key, data) {
2421
- var node = this.nodesMap[key];
2422
- if (!node) return;
2423
- var childNodes = node.childNodes;
2424
- for (var i = childNodes.length - 1; i >= 0; i--) {
2425
- var child = childNodes[i];
2426
- this.remove(child.data);
2427
- }
2428
- for (var _i = 0, j = data.length; _i < j; _i++) {
2429
- var _child = data[_i];
2430
- this.append(_child, node.data);
2431
- }
2432
- };
2433
-
2434
- TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
2435
- var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2436
- var checkedKeys = arguments[2];
2437
-
2438
- var allNodes = this._getAllNodes().sort(function (a, b) {
2439
- return b.level - a.level;
2440
- });
2441
- var cache = Object.create(null);
2442
- var keys = Object.keys(checkedKeys);
2443
- allNodes.forEach(function (node) {
2444
- return node.setChecked(false, false);
2445
- });
2446
- for (var i = 0, j = allNodes.length; i < j; i++) {
2447
- var node = allNodes[i];
2448
- var nodeKey = node.data[key].toString();
2449
- var checked = keys.indexOf(nodeKey) > -1;
2450
- if (!checked) {
2451
- if (node.checked && !cache[nodeKey]) {
2452
- node.setChecked(false, false);
2453
- }
2454
- continue;
2455
- }
2456
-
2457
- var parent = node.parent;
2458
- while (parent && parent.level > 0) {
2459
- cache[parent.data[key]] = true;
2460
- parent = parent.parent;
2461
- }
2462
-
2463
- if (node.isLeaf || this.checkStrictly) {
2464
- node.setChecked(true, false);
2465
- continue;
2466
- }
2467
- node.setChecked(true, true);
2468
-
2469
- if (leafOnly) {
2470
- (function () {
2471
- node.setChecked(false, false);
2472
- var traverse = function traverse(node) {
2473
- var childNodes = node.childNodes;
2474
- childNodes.forEach(function (child) {
2475
- if (!child.isLeaf) {
2476
- child.setChecked(false, false);
2477
- }
2478
- traverse(child);
2479
- });
2480
- };
2481
- traverse(node);
2482
- })();
2483
- }
2484
- }
2485
- };
2486
-
2487
- TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
2488
- var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2489
-
2490
- var key = this.key;
2491
- var checkedKeys = {};
2492
- array.forEach(function (item) {
2493
- checkedKeys[(item || {})[key]] = true;
2494
- });
2495
-
2496
- this._setCheckedKeys(key, leafOnly, checkedKeys);
2497
- };
2498
-
2499
- TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
2500
- var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2501
-
2502
- this.defaultCheckedKeys = keys;
2503
- var key = this.key;
2504
- var checkedKeys = {};
2505
- keys.forEach(function (key) {
2506
- checkedKeys[key] = true;
2507
- });
2508
-
2509
- this._setCheckedKeys(key, leafOnly, checkedKeys);
2510
- };
2511
-
2512
- TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
2513
- var _this6 = this;
2514
-
2515
- keys = keys || [];
2516
- this.defaultExpandedKeys = keys;
2517
-
2518
- keys.forEach(function (key) {
2519
- var node = _this6.getNode(key);
2520
- if (node) node.expand(null, _this6.autoExpandParent);
2521
- });
2522
- };
2523
-
2524
- TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
2525
- var node = this.getNode(data);
2526
-
2527
- if (node) {
2528
- node.setChecked(!!checked, deep);
2529
- }
2530
- };
2531
-
2532
- TreeStore.prototype.getCurrentNode = function getCurrentNode() {
2533
- return this.currentNode;
2534
- };
2535
-
2536
- TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
2537
- var prevCurrentNode = this.currentNode;
2538
- if (prevCurrentNode) {
2539
- prevCurrentNode.isCurrent = false;
2540
- }
2541
- this.currentNode = currentNode;
2542
- this.currentNode.isCurrent = true;
2543
- };
2544
-
2545
- TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
2546
- var key = node[this.key];
2547
- var currNode = this.nodesMap[key];
2548
- this.setCurrentNode(currNode);
2549
- };
2550
-
2551
- TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
2552
- if (key === null || key === undefined) {
2553
- this.currentNode && (this.currentNode.isCurrent = false);
2554
- this.currentNode = null;
2555
- return;
2556
- }
2557
- var node = this.getNode(key);
2558
- if (node) {
2559
- this.setCurrentNode(node);
2560
- }
2561
- };
2562
-
2563
- return TreeStore;
2564
- }();
2565
-
2566
- /* harmony default export */ var tree_store = (tree_store_TreeStore);
2567
- ;
2568
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=template&id=05df13c2
2569
- var tree_nodevue_type_template_id_05df13c2_render = function render() {
2570
- var _vm = this,
2571
- _c = _vm._self._c
2572
- return _c(
2573
- "div",
2574
- {
2575
- directives: [
2576
- {
2577
- name: "show",
2578
- rawName: "v-show",
2579
- value: _vm.node.visible,
2580
- expression: "node.visible",
2581
- },
2582
- ],
2583
- ref: "node",
2584
- staticClass: "el-tree-node",
2585
- class: {
2586
- "is-expanded": _vm.expanded,
2587
- "is-current": _vm.node.isCurrent,
2588
- "is-hidden": !_vm.node.visible,
2589
- "is-focusable": !_vm.node.disabled,
2590
- "is-checked": !_vm.node.disabled && _vm.node.checked,
2591
- },
2592
- attrs: {
2593
- role: "treeitem",
2594
- tabindex: "-1",
2595
- "aria-expanded": _vm.expanded,
2596
- "aria-disabled": _vm.node.disabled,
2597
- "aria-checked": _vm.node.checked,
2598
- draggable: _vm.tree.draggable,
2599
- },
2600
- on: {
2601
- click: function ($event) {
2602
- $event.stopPropagation()
2603
- return _vm.handleClick.apply(null, arguments)
2604
- },
2605
- contextmenu: ($event) => this.handleContextMenu($event),
2606
- dragstart: function ($event) {
2607
- $event.stopPropagation()
2608
- return _vm.handleDragStart.apply(null, arguments)
2609
- },
2610
- dragover: function ($event) {
2611
- $event.stopPropagation()
2612
- return _vm.handleDragOver.apply(null, arguments)
2613
- },
2614
- dragend: function ($event) {
2615
- $event.stopPropagation()
2616
- return _vm.handleDragEnd.apply(null, arguments)
2617
- },
2618
- drop: function ($event) {
2619
- $event.stopPropagation()
2620
- return _vm.handleDrop.apply(null, arguments)
2621
- },
2622
- },
2623
- },
2624
- [
2625
- _c(
2626
- "div",
2627
- {
2628
- staticClass: "el-tree-node__content",
2629
- style: {
2630
- "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px",
2631
- },
2632
- },
2633
- [
2634
- _c("span", {
2635
- class: [
2636
- {
2637
- "is-leaf": _vm.node.isLeaf,
2638
- expanded: !_vm.node.isLeaf && _vm.expanded,
2639
- },
2640
- "el-tree-node__expand-icon",
2641
- _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right",
2642
- ],
2643
- on: {
2644
- click: function ($event) {
2645
- $event.stopPropagation()
2646
- return _vm.handleExpandIconClick.apply(null, arguments)
2647
- },
2648
- },
2649
- }),
2650
- _vm.showCheckbox
2651
- ? _c("el-checkbox", {
2652
- attrs: {
2653
- indeterminate: _vm.node.indeterminate,
2654
- disabled: !!_vm.node.disabled,
2655
- },
2656
- on: { change: _vm.handleCheckChange },
2657
- nativeOn: {
2658
- click: function ($event) {
2659
- $event.stopPropagation()
2660
- },
2661
- },
2662
- model: {
2663
- value: _vm.node.checked,
2664
- callback: function ($$v) {
2665
- _vm.$set(_vm.node, "checked", $$v)
2666
- },
2667
- expression: "node.checked",
2668
- },
2669
- })
2670
- : _vm._e(),
2671
- _vm.node.loading
2672
- ? _c("span", {
2673
- staticClass: "el-tree-node__loading-icon el-icon-loading",
2674
- })
2675
- : _vm._e(),
2676
- _c("node-content", { attrs: { node: _vm.node } }),
2677
- ],
2678
- 1
2679
- ),
2680
- _c("el-collapse-transition", [
2681
- !_vm.renderAfterExpand || _vm.childNodeRendered
2682
- ? _c(
2683
- "div",
2684
- {
2685
- directives: [
2686
- {
2687
- name: "show",
2688
- rawName: "v-show",
2689
- value: _vm.expanded,
2690
- expression: "expanded",
2691
- },
2692
- ],
2693
- staticClass: "el-tree-node__children",
2694
- attrs: { role: "group", "aria-expanded": _vm.expanded },
2695
- },
2696
- _vm._l(_vm.node.childNodes, function (child) {
2697
- return _c("el-tree-node", {
2698
- key: _vm.getNodeKey(child),
2699
- attrs: {
2700
- "render-content": _vm.renderContent,
2701
- "render-after-expand": _vm.renderAfterExpand,
2702
- "show-checkbox": _vm.showCheckbox,
2703
- node: child,
2704
- },
2705
- on: { "node-expand": _vm.handleChildNodeExpand },
2706
- })
2707
- }),
2708
- 1
2709
- )
2710
- : _vm._e(),
2711
- ]),
2712
- ],
2713
- 1
2714
- )
2715
- }
2716
- var tree_nodevue_type_template_id_05df13c2_staticRenderFns = []
2717
- tree_nodevue_type_template_id_05df13c2_render._withStripped = true
2718
-
2719
-
2720
- // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=05df13c2
2721
-
2722
- // EXTERNAL MODULE: ./src/transitions/collapse-transition.js
2723
- var collapse_transition = __webpack_require__(40);
2724
-
2725
- // EXTERNAL MODULE: ./packages/checkbox/index.js + 5 modules
2726
- var packages_checkbox = __webpack_require__(26);
2727
-
2728
- // EXTERNAL MODULE: ./src/mixins/emitter.js
2729
- var emitter = __webpack_require__(6);
2730
-
2731
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=script&lang=js
2732
-
2733
-
2734
-
2735
-
2736
-
2737
-
2738
- /* harmony default export */ var tree_nodevue_type_script_lang_js = ({
2739
- name: 'ElTreeNode',
2740
-
2741
- componentName: 'ElTreeNode',
2742
-
2743
- mixins: [emitter["a" /* default */]],
2744
-
2745
- props: {
2746
- node: {
2747
- default: function _default() {
2748
- return {};
2749
- }
2750
- },
2751
- props: {},
2752
- renderContent: Function,
2753
- renderAfterExpand: {
2754
- type: Boolean,
2755
- default: true
2756
- },
2757
- showCheckbox: {
2758
- type: Boolean,
2759
- default: false
2760
- }
2761
- },
2762
-
2763
- components: {
2764
- ElCollapseTransition: collapse_transition["a" /* default */],
2765
- ElCheckbox: packages_checkbox["default"],
2766
- NodeContent: {
2767
- props: {
2768
- node: {
2769
- required: true
2770
- }
2771
- },
2772
- render: function render(h) {
2773
- var parent = this.$parent;
2774
- var tree = parent.tree;
2775
- var node = this.node;
2776
- var data = node.data,
2777
- store = node.store;
2778
-
2779
- return parent.renderContent ? parent.renderContent.call(parent._renderProxy, h, { _self: tree.$vnode.context, node: node, data: data, store: store }) : tree.$scopedSlots.default ? tree.$scopedSlots.default({ node: node, data: data }) : h(
2780
- 'span',
2781
- { 'class': 'el-tree-node__label' },
2782
- [node.label]
2783
- );
2784
- }
2785
- }
2786
- },
2787
-
2788
- data: function data() {
2789
- return {
2790
- tree: null,
2791
- expanded: false,
2792
- childNodeRendered: false,
2793
- oldChecked: null,
2794
- oldIndeterminate: null
2795
- };
2796
- },
2797
-
2798
-
2799
- watch: {
2800
- 'node.indeterminate': function nodeIndeterminate(val) {
2801
- this.handleSelectChange(this.node.checked, val);
2802
- },
2803
- 'node.checked': function nodeChecked(val) {
2804
- this.handleSelectChange(val, this.node.indeterminate);
2805
- },
2806
- 'node.expanded': function nodeExpanded(val) {
2807
- var _this = this;
2808
-
2809
- this.$nextTick(function () {
2810
- return _this.expanded = val;
2811
- });
2812
- if (val) {
2813
- this.childNodeRendered = true;
2814
- }
2815
- }
2816
- },
2817
-
2818
- methods: {
2819
- getNodeKey: function getNodeKey(node) {
2820
- return util_getNodeKey(this.tree.nodeKey, node.data);
2821
- },
2822
- handleSelectChange: function handleSelectChange(checked, indeterminate) {
2823
- if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
2824
- this.tree.$emit('check-change', this.node.data, checked, indeterminate);
2825
- }
2826
- this.oldChecked = checked;
2827
- this.indeterminate = indeterminate;
2828
- },
2829
- handleClick: function handleClick() {
2830
- var store = this.tree.store;
2831
- store.setCurrentNode(this.node);
2832
- this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
2833
- this.tree.currentNode = this;
2834
- if (this.tree.expandOnClickNode) {
2835
- this.handleExpandIconClick();
2836
- }
2837
- if (this.tree.checkOnClickNode && !this.node.disabled) {
2838
- this.handleCheckChange(null, {
2839
- target: { checked: !this.node.checked }
2840
- });
2841
- }
2842
- this.tree.$emit('node-click', this.node.data, this.node, this);
2843
- },
2844
- handleContextMenu: function handleContextMenu(event) {
2845
- if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
2846
- event.stopPropagation();
2847
- event.preventDefault();
2848
- }
2849
- this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
2850
- },
2851
- handleExpandIconClick: function handleExpandIconClick() {
2852
- if (this.node.isLeaf) return;
2853
- if (this.expanded) {
2854
- this.tree.$emit('node-collapse', this.node.data, this.node, this);
2855
- this.node.collapse();
2856
- } else {
2857
- this.node.expand();
2858
- this.$emit('node-expand', this.node.data, this.node, this);
2859
- }
2860
- },
2861
- handleCheckChange: function handleCheckChange(value, ev) {
2862
- var _this2 = this;
2863
-
2864
- this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
2865
- this.$nextTick(function () {
2866
- var store = _this2.tree.store;
2867
- _this2.tree.$emit('check', _this2.node.data, {
2868
- checkedNodes: store.getCheckedNodes(),
2869
- checkedKeys: store.getCheckedKeys(),
2870
- halfCheckedNodes: store.getHalfCheckedNodes(),
2871
- halfCheckedKeys: store.getHalfCheckedKeys()
2872
- });
2873
- });
2874
- },
2875
- handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
2876
- this.broadcast('ElTreeNode', 'tree-node-expand', node);
2877
- this.tree.$emit('node-expand', nodeData, node, instance);
2878
- },
2879
- handleDragStart: function handleDragStart(event) {
2880
- if (!this.tree.draggable) return;
2881
- this.tree.$emit('tree-node-drag-start', event, this);
2882
- },
2883
- handleDragOver: function handleDragOver(event) {
2884
- if (!this.tree.draggable) return;
2885
- this.tree.$emit('tree-node-drag-over', event, this);
2886
- event.preventDefault();
2887
- },
2888
- handleDrop: function handleDrop(event) {
2889
- event.preventDefault();
2890
- },
2891
- handleDragEnd: function handleDragEnd(event) {
2892
- if (!this.tree.draggable) return;
2893
- this.tree.$emit('tree-node-drag-end', event, this);
2894
- }
2895
- },
2896
-
2897
- created: function created() {
2898
- var _this3 = this;
2899
-
2900
- var parent = this.$parent;
2901
-
2902
- if (parent.isTree) {
2903
- this.tree = parent;
2904
- } else {
2905
- this.tree = parent.tree;
2906
- }
2907
-
2908
- var tree = this.tree;
2909
- if (!tree) {
2910
- console.warn('Can not find node\'s tree.');
2911
- }
2912
-
2913
- var props = tree.props || {};
2914
- var childrenKey = props['children'] || 'children';
2915
-
2916
- this.$watch('node.data.' + childrenKey, function () {
2917
- _this3.node.updateChildren();
2918
- });
2919
-
2920
- if (this.node.expanded) {
2921
- this.expanded = true;
2922
- this.childNodeRendered = true;
2923
- }
2924
-
2925
- if (this.tree.accordion) {
2926
- this.$on('tree-node-expand', function (node) {
2927
- if (_this3.node !== node) {
2928
- _this3.node.collapse();
2929
- }
2930
- });
2931
- }
2932
- }
2933
- });
2934
- // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js
2935
- /* harmony default export */ var src_tree_nodevue_type_script_lang_js = (tree_nodevue_type_script_lang_js);
2936
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2937
- var componentNormalizer = __webpack_require__(2);
2938
-
2939
- // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
2940
-
2941
-
2942
-
2943
-
2944
-
2945
- /* normalize component */
2946
-
2947
- var component = Object(componentNormalizer["a" /* default */])(
2948
- src_tree_nodevue_type_script_lang_js,
2949
- tree_nodevue_type_template_id_05df13c2_render,
2950
- tree_nodevue_type_template_id_05df13c2_staticRenderFns,
2951
- false,
2952
- null,
2953
- null,
2954
- null
2955
-
2956
- )
2957
-
2958
- /* harmony default export */ var tree_node = (component.exports);
2959
- // EXTERNAL MODULE: ./src/locale/index.js + 2 modules
2960
- var locale = __webpack_require__(11);
2961
-
2962
- // EXTERNAL MODULE: ./src/utils/dom.js
2963
- var dom = __webpack_require__(1);
2964
-
2965
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=script&lang=js
2966
-
2967
-
2968
-
2969
-
2970
-
2971
-
2972
-
2973
-
2974
- /* harmony default export */ var treevue_type_script_lang_js = ({
2975
- name: 'ElTree',
2976
-
2977
- mixins: [emitter["a" /* default */]],
2978
-
2979
- components: {
2980
- ElTreeNode: tree_node
2981
- },
2982
-
2983
- data: function data() {
2984
- return {
2985
- store: null,
2986
- root: null,
2987
- currentNode: null,
2988
- treeItems: null,
2989
- checkboxItems: [],
2990
- dragState: {
2991
- showDropIndicator: false,
2992
- draggingNode: null,
2993
- dropNode: null,
2994
- allowDrop: true
2995
- }
2996
- };
2997
- },
2998
-
2999
-
3000
- props: {
3001
- data: {
3002
- type: Array
3003
- },
3004
- emptyText: {
3005
- type: String,
3006
- default: function _default() {
3007
- return Object(locale["a" /* t */])('el.tree.emptyText');
3008
- }
3009
- },
3010
- renderAfterExpand: {
3011
- type: Boolean,
3012
- default: true
3013
- },
3014
- nodeKey: String,
3015
- checkStrictly: Boolean,
3016
- defaultExpandAll: Boolean,
3017
- expandOnClickNode: {
3018
- type: Boolean,
3019
- default: true
3020
- },
3021
- checkOnClickNode: Boolean,
3022
- checkDescendants: {
3023
- type: Boolean,
3024
- default: false
3025
- },
3026
- autoExpandParent: {
3027
- type: Boolean,
3028
- default: true
3029
- },
3030
- defaultCheckedKeys: Array,
3031
- defaultExpandedKeys: Array,
3032
- currentNodeKey: [String, Number],
3033
- renderContent: Function,
3034
- showCheckbox: {
3035
- type: Boolean,
3036
- default: false
3037
- },
3038
- draggable: {
3039
- type: Boolean,
3040
- default: false
3041
- },
3042
- allowDrag: Function,
3043
- allowDrop: Function,
3044
- props: {
3045
- default: function _default() {
3046
- return {
3047
- children: 'children',
3048
- label: 'label',
3049
- disabled: 'disabled'
3050
- };
3051
- }
3052
- },
3053
- lazy: {
3054
- type: Boolean,
3055
- default: false
3056
- },
3057
- highlightCurrent: Boolean,
3058
- load: Function,
3059
- filterNodeMethod: Function,
3060
- accordion: Boolean,
3061
- indent: {
3062
- type: Number,
3063
- default: 18
3064
- },
3065
- iconClass: String
3066
- },
3067
-
3068
- computed: {
3069
- children: {
3070
- set: function set(value) {
3071
- this.data = value;
3072
- },
3073
- get: function get() {
3074
- return this.data;
3075
- }
3076
- },
3077
-
3078
- treeItemArray: function treeItemArray() {
3079
- return Array.prototype.slice.call(this.treeItems);
3080
- },
3081
- isEmpty: function isEmpty() {
3082
- var childNodes = this.root.childNodes;
3083
-
3084
- return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
3085
- var visible = _ref.visible;
3086
- return !visible;
3087
- });
3088
- }
3089
- },
3090
-
3091
- watch: {
3092
- defaultCheckedKeys: function defaultCheckedKeys(newVal) {
3093
- this.store.setDefaultCheckedKey(newVal);
3094
- },
3095
- defaultExpandedKeys: function defaultExpandedKeys(newVal) {
3096
- this.store.defaultExpandedKeys = newVal;
3097
- this.store.setDefaultExpandedKeys(newVal);
3098
- },
3099
- data: function data(newVal) {
3100
- this.store.setData(newVal);
3101
- },
3102
- checkboxItems: function checkboxItems(val) {
3103
- Array.prototype.forEach.call(val, function (checkbox) {
3104
- checkbox.setAttribute('tabindex', -1);
3105
- });
3106
- },
3107
- checkStrictly: function checkStrictly(newVal) {
3108
- this.store.checkStrictly = newVal;
3109
- }
3110
- },
3111
-
3112
- methods: {
3113
- filter: function filter(value) {
3114
- if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
3115
- this.store.filter(value);
3116
- },
3117
- getNodeKey: function getNodeKey(node) {
3118
- return util_getNodeKey(this.nodeKey, node.data);
3119
- },
3120
- getNodePath: function getNodePath(data) {
3121
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
3122
- var node = this.store.getNode(data);
3123
- if (!node) return [];
3124
- var path = [node.data];
3125
- var parent = node.parent;
3126
- while (parent && parent !== this.root) {
3127
- path.push(parent.data);
3128
- parent = parent.parent;
3129
- }
3130
- return path.reverse();
3131
- },
3132
- getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
3133
- return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
3134
- },
3135
- getCheckedKeys: function getCheckedKeys(leafOnly) {
3136
- return this.store.getCheckedKeys(leafOnly);
3137
- },
3138
- getCurrentNode: function getCurrentNode() {
3139
- var currentNode = this.store.getCurrentNode();
3140
- return currentNode ? currentNode.data : null;
3141
- },
3142
- getCurrentKey: function getCurrentKey() {
3143
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
3144
- var currentNode = this.getCurrentNode();
3145
- return currentNode ? currentNode[this.nodeKey] : null;
3146
- },
3147
- setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
3148
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
3149
- this.store.setCheckedNodes(nodes, leafOnly);
3150
- },
3151
- setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
3152
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
3153
- this.store.setCheckedKeys(keys, leafOnly);
3154
- },
3155
- setChecked: function setChecked(data, checked, deep) {
3156
- this.store.setChecked(data, checked, deep);
3157
- },
3158
- getHalfCheckedNodes: function getHalfCheckedNodes() {
3159
- return this.store.getHalfCheckedNodes();
3160
- },
3161
- getHalfCheckedKeys: function getHalfCheckedKeys() {
3162
- return this.store.getHalfCheckedKeys();
3163
- },
3164
- setCurrentNode: function setCurrentNode(node) {
3165
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
3166
- this.store.setUserCurrentNode(node);
3167
- },
3168
- setCurrentKey: function setCurrentKey(key) {
3169
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
3170
- this.store.setCurrentNodeKey(key);
3171
- },
3172
- getNode: function getNode(data) {
3173
- return this.store.getNode(data);
3174
- },
3175
- remove: function remove(data) {
3176
- this.store.remove(data);
3177
- },
3178
- append: function append(data, parentNode) {
3179
- this.store.append(data, parentNode);
3180
- },
3181
- insertBefore: function insertBefore(data, refNode) {
3182
- this.store.insertBefore(data, refNode);
3183
- },
3184
- insertAfter: function insertAfter(data, refNode) {
3185
- this.store.insertAfter(data, refNode);
3186
- },
3187
- handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
3188
- this.broadcast('ElTreeNode', 'tree-node-expand', node);
3189
- this.$emit('node-expand', nodeData, node, instance);
3190
- },
3191
- updateKeyChildren: function updateKeyChildren(key, data) {
3192
- if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
3193
- this.store.updateChildren(key, data);
3194
- },
3195
- initTabIndex: function initTabIndex() {
3196
- this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
3197
- this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
3198
- var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
3199
- if (checkedItem.length) {
3200
- checkedItem[0].setAttribute('tabindex', 0);
3201
- return;
3202
- }
3203
- this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
3204
- },
3205
- handleKeydown: function handleKeydown(ev) {
3206
- var currentItem = ev.target;
3207
- if (currentItem.className.indexOf('el-tree-node') === -1) return;
3208
- var keyCode = ev.keyCode;
3209
- this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
3210
- var currentIndex = this.treeItemArray.indexOf(currentItem);
3211
- var nextIndex = void 0;
3212
- if ([38, 40].indexOf(keyCode) > -1) {
3213
- // up、down
3214
- ev.preventDefault();
3215
- if (keyCode === 38) {
3216
- // up
3217
- nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
3218
- } else {
3219
- nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
3220
- }
3221
- this.treeItemArray[nextIndex].focus(); // 选中
3222
- }
3223
- if ([37, 39].indexOf(keyCode) > -1) {
3224
- // left、right 展开
3225
- ev.preventDefault();
3226
- currentItem.click(); // 选中
3227
- }
3228
- var hasInput = currentItem.querySelector('[type="checkbox"]');
3229
- if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
3230
- // space enter选中checkbox
3231
- ev.preventDefault();
3232
- hasInput.click();
3233
- }
3234
- }
3235
- },
3236
-
3237
- created: function created() {
3238
- var _this = this;
3239
-
3240
- this.isTree = true;
3241
-
3242
- this.store = new tree_store({
3243
- key: this.nodeKey,
3244
- data: this.data,
3245
- lazy: this.lazy,
3246
- props: this.props,
3247
- load: this.load,
3248
- currentNodeKey: this.currentNodeKey,
3249
- checkStrictly: this.checkStrictly,
3250
- checkDescendants: this.checkDescendants,
3251
- defaultCheckedKeys: this.defaultCheckedKeys,
3252
- defaultExpandedKeys: this.defaultExpandedKeys,
3253
- autoExpandParent: this.autoExpandParent,
3254
- defaultExpandAll: this.defaultExpandAll,
3255
- filterNodeMethod: this.filterNodeMethod
3256
- });
3257
-
3258
- this.root = this.store.root;
3259
-
3260
- var dragState = this.dragState;
3261
- this.$on('tree-node-drag-start', function (event, treeNode) {
3262
- if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
3263
- event.preventDefault();
3264
- return false;
3265
- }
3266
- event.dataTransfer.effectAllowed = 'move';
3267
-
3268
- // wrap in try catch to address IE's error when first param is 'text/plain'
3269
- try {
3270
- // setData is required for draggable to work in FireFox
3271
- // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
3272
- event.dataTransfer.setData('text/plain', '');
3273
- } catch (e) {}
3274
- dragState.draggingNode = treeNode;
3275
- _this.$emit('node-drag-start', treeNode.node, event);
3276
- });
3277
-
3278
- this.$on('tree-node-drag-over', function (event, treeNode) {
3279
- var dropNode = findNearestComponent(event.target, 'ElTreeNode');
3280
- var oldDropNode = dragState.dropNode;
3281
- if (oldDropNode && oldDropNode !== dropNode) {
3282
- Object(dom["i" /* removeClass */])(oldDropNode.$el, 'is-drop-inner');
3283
- }
3284
- var draggingNode = dragState.draggingNode;
3285
- if (!draggingNode || !dropNode) return;
3286
-
3287
- var dropPrev = true;
3288
- var dropInner = true;
3289
- var dropNext = true;
3290
- var userAllowDropInner = true;
3291
- if (typeof _this.allowDrop === 'function') {
3292
- dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
3293
- userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
3294
- dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
3295
- }
3296
- event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
3297
- if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
3298
- if (oldDropNode) {
3299
- _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
3300
- }
3301
- _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
3302
- }
3303
-
3304
- if (dropPrev || dropInner || dropNext) {
3305
- dragState.dropNode = dropNode;
3306
- }
3307
-
3308
- if (dropNode.node.nextSibling === draggingNode.node) {
3309
- dropNext = false;
3310
- }
3311
- if (dropNode.node.previousSibling === draggingNode.node) {
3312
- dropPrev = false;
3313
- }
3314
- if (dropNode.node.contains(draggingNode.node, false)) {
3315
- dropInner = false;
3316
- }
3317
- if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
3318
- dropPrev = false;
3319
- dropInner = false;
3320
- dropNext = false;
3321
- }
3322
-
3323
- var targetPosition = dropNode.$el.getBoundingClientRect();
3324
- var treePosition = _this.$el.getBoundingClientRect();
3325
-
3326
- var dropType = void 0;
3327
- var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
3328
- var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
3329
-
3330
- var indicatorTop = -9999;
3331
- var distance = event.clientY - targetPosition.top;
3332
- if (distance < targetPosition.height * prevPercent) {
3333
- dropType = 'before';
3334
- } else if (distance > targetPosition.height * nextPercent) {
3335
- dropType = 'after';
3336
- } else if (dropInner) {
3337
- dropType = 'inner';
3338
- } else {
3339
- dropType = 'none';
3340
- }
3341
-
3342
- var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
3343
- var dropIndicator = _this.$refs.dropIndicator;
3344
- if (dropType === 'before') {
3345
- indicatorTop = iconPosition.top - treePosition.top;
3346
- } else if (dropType === 'after') {
3347
- indicatorTop = iconPosition.bottom - treePosition.top;
3348
- }
3349
- dropIndicator.style.top = indicatorTop + 'px';
3350
- dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
3351
-
3352
- if (dropType === 'inner') {
3353
- Object(dom["a" /* addClass */])(dropNode.$el, 'is-drop-inner');
3354
- } else {
3355
- Object(dom["i" /* removeClass */])(dropNode.$el, 'is-drop-inner');
3356
- }
3357
-
3358
- dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
3359
- dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
3360
- dragState.dropType = dropType;
3361
- _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
3362
- });
3363
-
3364
- this.$on('tree-node-drag-end', function (event) {
3365
- var draggingNode = dragState.draggingNode,
3366
- dropType = dragState.dropType,
3367
- dropNode = dragState.dropNode;
3368
-
3369
- event.preventDefault();
3370
- event.dataTransfer.dropEffect = 'move';
3371
-
3372
- if (draggingNode && dropNode) {
3373
- var draggingNodeCopy = { data: draggingNode.node.data };
3374
- if (dropType !== 'none') {
3375
- draggingNode.node.remove();
3376
- }
3377
- if (dropType === 'before') {
3378
- dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
3379
- } else if (dropType === 'after') {
3380
- dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
3381
- } else if (dropType === 'inner') {
3382
- dropNode.node.insertChild(draggingNodeCopy);
3383
- }
3384
- if (dropType !== 'none') {
3385
- _this.store.registerNode(draggingNodeCopy);
3386
- }
3387
-
3388
- Object(dom["i" /* removeClass */])(dropNode.$el, 'is-drop-inner');
3389
-
3390
- _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
3391
- if (dropType !== 'none') {
3392
- _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
3393
- }
3394
- }
3395
- if (draggingNode && !dropNode) {
3396
- _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
3397
- }
3398
-
3399
- dragState.showDropIndicator = false;
3400
- dragState.draggingNode = null;
3401
- dragState.dropNode = null;
3402
- dragState.allowDrop = true;
3403
- });
3404
- },
3405
- mounted: function mounted() {
3406
- this.initTabIndex();
3407
- this.$el.addEventListener('keydown', this.handleKeydown);
3408
- },
3409
- updated: function updated() {
3410
- this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
3411
- this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
3412
- }
3413
- });
3414
- // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js
3415
- /* harmony default export */ var src_treevue_type_script_lang_js = (treevue_type_script_lang_js);
3416
- // CONCATENATED MODULE: ./packages/tree/src/tree.vue
3417
-
3418
-
3419
-
3420
-
3421
-
3422
- /* normalize component */
3423
-
3424
- var tree_component = Object(componentNormalizer["a" /* default */])(
3425
- src_treevue_type_script_lang_js,
3426
- render,
3427
- staticRenderFns,
3428
- false,
3429
- null,
3430
- null,
3431
- null
3432
-
3433
- )
3434
-
3435
- /* harmony default export */ var tree = (tree_component.exports);
3436
- // CONCATENATED MODULE: ./packages/tree/index.js
3437
-
3438
-
3439
- /* istanbul ignore next */
3440
- tree.install = function (Vue) {
3441
- Vue.component(tree.name, tree);
3442
- };
3443
-
3444
- /* harmony default export */ var packages_tree = __webpack_exports__["default"] = (tree);
3445
-
3446
- /***/ }),
3447
-
3448
- /***/ 7:
3449
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3450
-
3451
- "use strict";
3452
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
3453
- for (var i = 1, j = arguments.length; i < j; i++) {
3454
- var source = arguments[i] || {};
3455
- for (var prop in source) {
3456
- if (source.hasOwnProperty(prop)) {
3457
- var value = source[prop];
3458
- if (value !== undefined) {
3459
- target[prop] = value;
3460
- }
3461
- }
3462
- }
3463
- }
3464
-
3465
- return target;
3466
- });;
3467
-
3468
- /***/ })
3469
-
3470
- /******/ });