@penggy/element-ui 2.4.11

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 (790) hide show
  1. package/CHANGELOG.en-US.md +748 -0
  2. package/CHANGELOG.es.md +756 -0
  3. package/CHANGELOG.zh-CN.md +748 -0
  4. package/LICENSE +21 -0
  5. package/README.md +237 -0
  6. package/lib/alert.js +343 -0
  7. package/lib/aside.js +277 -0
  8. package/lib/autocomplete.js +767 -0
  9. package/lib/badge.js +316 -0
  10. package/lib/breadcrumb-item.js +303 -0
  11. package/lib/breadcrumb.js +290 -0
  12. package/lib/button-group.js +267 -0
  13. package/lib/button.js +345 -0
  14. package/lib/card.js +280 -0
  15. package/lib/carousel-item.js +378 -0
  16. package/lib/carousel.js +532 -0
  17. package/lib/cascader.js +1338 -0
  18. package/lib/checkbox-button.js +446 -0
  19. package/lib/checkbox-group.js +310 -0
  20. package/lib/checkbox.js +481 -0
  21. package/lib/col.js +172 -0
  22. package/lib/collapse-item.js +404 -0
  23. package/lib/collapse.js +326 -0
  24. package/lib/color-picker.js +1826 -0
  25. package/lib/container.js +288 -0
  26. package/lib/date-picker.js +4396 -0
  27. package/lib/dialog.js +490 -0
  28. package/lib/directives/mousewheel.js +26 -0
  29. package/lib/directives/repeat-click.js +30 -0
  30. package/lib/dropdown-item.js +305 -0
  31. package/lib/dropdown-menu.js +330 -0
  32. package/lib/dropdown.js +623 -0
  33. package/lib/element-ui.common.js +32381 -0
  34. package/lib/footer.js +277 -0
  35. package/lib/form-item.js +610 -0
  36. package/lib/form.js +428 -0
  37. package/lib/header.js +277 -0
  38. package/lib/icon.js +270 -0
  39. package/lib/index.js +1 -0
  40. package/lib/input-number.js +590 -0
  41. package/lib/input.js +735 -0
  42. package/lib/loading.js +616 -0
  43. package/lib/locale/format.js +56 -0
  44. package/lib/locale/index.js +63 -0
  45. package/lib/locale/lang/af-ZA.js +112 -0
  46. package/lib/locale/lang/ar.js +111 -0
  47. package/lib/locale/lang/bg.js +112 -0
  48. package/lib/locale/lang/ca.js +111 -0
  49. package/lib/locale/lang/cs-CZ.js +114 -0
  50. package/lib/locale/lang/da.js +111 -0
  51. package/lib/locale/lang/de.js +113 -0
  52. package/lib/locale/lang/ee.js +112 -0
  53. package/lib/locale/lang/el.js +112 -0
  54. package/lib/locale/lang/en.js +112 -0
  55. package/lib/locale/lang/es.js +111 -0
  56. package/lib/locale/lang/eu.js +112 -0
  57. package/lib/locale/lang/fa.js +112 -0
  58. package/lib/locale/lang/fi.js +112 -0
  59. package/lib/locale/lang/fr.js +111 -0
  60. package/lib/locale/lang/he.js +112 -0
  61. package/lib/locale/lang/hu.js +111 -0
  62. package/lib/locale/lang/id.js +112 -0
  63. package/lib/locale/lang/it.js +111 -0
  64. package/lib/locale/lang/ja.js +112 -0
  65. package/lib/locale/lang/km.js +112 -0
  66. package/lib/locale/lang/ko.js +112 -0
  67. package/lib/locale/lang/ku.js +112 -0
  68. package/lib/locale/lang/kz.js +112 -0
  69. package/lib/locale/lang/lt.js +112 -0
  70. package/lib/locale/lang/lv.js +112 -0
  71. package/lib/locale/lang/mn.js +112 -0
  72. package/lib/locale/lang/nb-NO.js +111 -0
  73. package/lib/locale/lang/nl.js +112 -0
  74. package/lib/locale/lang/pl.js +112 -0
  75. package/lib/locale/lang/pt-br.js +112 -0
  76. package/lib/locale/lang/pt.js +112 -0
  77. package/lib/locale/lang/ro.js +112 -0
  78. package/lib/locale/lang/ru-RU.js +112 -0
  79. package/lib/locale/lang/sk.js +114 -0
  80. package/lib/locale/lang/sl.js +112 -0
  81. package/lib/locale/lang/sr.js +112 -0
  82. package/lib/locale/lang/sv-SE.js +112 -0
  83. package/lib/locale/lang/ta.js +111 -0
  84. package/lib/locale/lang/th.js +112 -0
  85. package/lib/locale/lang/tk.js +112 -0
  86. package/lib/locale/lang/tr-TR.js +112 -0
  87. package/lib/locale/lang/ua.js +112 -0
  88. package/lib/locale/lang/ug-CN.js +112 -0
  89. package/lib/locale/lang/vi.js +112 -0
  90. package/lib/locale/lang/zh-CN.js +112 -0
  91. package/lib/locale/lang/zh-TW.js +112 -0
  92. package/lib/main.js +269 -0
  93. package/lib/menu-item-group.js +302 -0
  94. package/lib/menu-item.js +444 -0
  95. package/lib/menu.js +915 -0
  96. package/lib/message-box.js +917 -0
  97. package/lib/message.js +483 -0
  98. package/lib/mixins/emitter.js +36 -0
  99. package/lib/mixins/focus.js +15 -0
  100. package/lib/mixins/locale.js +17 -0
  101. package/lib/mixins/migrating.js +64 -0
  102. package/lib/notification.js +539 -0
  103. package/lib/option-group.js +327 -0
  104. package/lib/option.js +443 -0
  105. package/lib/pagination.js +1000 -0
  106. package/lib/popover.js +545 -0
  107. package/lib/progress.js +406 -0
  108. package/lib/radio-button.js +389 -0
  109. package/lib/radio-group.js +370 -0
  110. package/lib/radio.js +402 -0
  111. package/lib/rate.js +607 -0
  112. package/lib/row.js +144 -0
  113. package/lib/scrollbar.js +441 -0
  114. package/lib/select.js +1691 -0
  115. package/lib/slider.js +938 -0
  116. package/lib/spinner.js +284 -0
  117. package/lib/step.js +439 -0
  118. package/lib/steps.js +338 -0
  119. package/lib/submenu.js +689 -0
  120. package/lib/switch.js +445 -0
  121. package/lib/tab-pane.js +316 -0
  122. package/lib/table-column.js +670 -0
  123. package/lib/table.js +3941 -0
  124. package/lib/tabs.js +960 -0
  125. package/lib/tag.js +292 -0
  126. package/lib/theme-chalk/alert.css +1 -0
  127. package/lib/theme-chalk/aside.css +1 -0
  128. package/lib/theme-chalk/autocomplete.css +1 -0
  129. package/lib/theme-chalk/badge.css +1 -0
  130. package/lib/theme-chalk/base.css +1 -0
  131. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  132. package/lib/theme-chalk/breadcrumb.css +1 -0
  133. package/lib/theme-chalk/button-group.css +0 -0
  134. package/lib/theme-chalk/button.css +1 -0
  135. package/lib/theme-chalk/card.css +1 -0
  136. package/lib/theme-chalk/carousel-item.css +1 -0
  137. package/lib/theme-chalk/carousel.css +1 -0
  138. package/lib/theme-chalk/cascader.css +1 -0
  139. package/lib/theme-chalk/checkbox-button.css +0 -0
  140. package/lib/theme-chalk/checkbox-group.css +0 -0
  141. package/lib/theme-chalk/checkbox.css +1 -0
  142. package/lib/theme-chalk/col.css +1 -0
  143. package/lib/theme-chalk/collapse-item.css +0 -0
  144. package/lib/theme-chalk/collapse.css +1 -0
  145. package/lib/theme-chalk/color-picker.css +1 -0
  146. package/lib/theme-chalk/container.css +1 -0
  147. package/lib/theme-chalk/date-picker.css +1 -0
  148. package/lib/theme-chalk/dialog.css +1 -0
  149. package/lib/theme-chalk/display.css +1 -0
  150. package/lib/theme-chalk/dropdown-item.css +0 -0
  151. package/lib/theme-chalk/dropdown-menu.css +0 -0
  152. package/lib/theme-chalk/dropdown.css +1 -0
  153. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  154. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  155. package/lib/theme-chalk/footer.css +1 -0
  156. package/lib/theme-chalk/form-item.css +0 -0
  157. package/lib/theme-chalk/form.css +1 -0
  158. package/lib/theme-chalk/header.css +1 -0
  159. package/lib/theme-chalk/icon.css +1 -0
  160. package/lib/theme-chalk/index.css +1 -0
  161. package/lib/theme-chalk/input-number.css +1 -0
  162. package/lib/theme-chalk/input.css +1 -0
  163. package/lib/theme-chalk/loading.css +1 -0
  164. package/lib/theme-chalk/main.css +1 -0
  165. package/lib/theme-chalk/menu-item-group.css +0 -0
  166. package/lib/theme-chalk/menu-item.css +0 -0
  167. package/lib/theme-chalk/menu.css +1 -0
  168. package/lib/theme-chalk/message-box.css +1 -0
  169. package/lib/theme-chalk/message.css +1 -0
  170. package/lib/theme-chalk/notification.css +1 -0
  171. package/lib/theme-chalk/option-group.css +1 -0
  172. package/lib/theme-chalk/option.css +1 -0
  173. package/lib/theme-chalk/pagination.css +1 -0
  174. package/lib/theme-chalk/popover.css +1 -0
  175. package/lib/theme-chalk/popper.css +1 -0
  176. package/lib/theme-chalk/progress.css +1 -0
  177. package/lib/theme-chalk/radio-button.css +1 -0
  178. package/lib/theme-chalk/radio-group.css +1 -0
  179. package/lib/theme-chalk/radio.css +1 -0
  180. package/lib/theme-chalk/rate.css +1 -0
  181. package/lib/theme-chalk/reset.css +1 -0
  182. package/lib/theme-chalk/row.css +1 -0
  183. package/lib/theme-chalk/scrollbar.css +1 -0
  184. package/lib/theme-chalk/select-dropdown.css +1 -0
  185. package/lib/theme-chalk/select.css +1 -0
  186. package/lib/theme-chalk/slider.css +1 -0
  187. package/lib/theme-chalk/spinner.css +1 -0
  188. package/lib/theme-chalk/step.css +1 -0
  189. package/lib/theme-chalk/steps.css +1 -0
  190. package/lib/theme-chalk/submenu.css +0 -0
  191. package/lib/theme-chalk/switch.css +1 -0
  192. package/lib/theme-chalk/tab-pane.css +0 -0
  193. package/lib/theme-chalk/table-column.css +1 -0
  194. package/lib/theme-chalk/table.css +1 -0
  195. package/lib/theme-chalk/tabs.css +1 -0
  196. package/lib/theme-chalk/tag.css +1 -0
  197. package/lib/theme-chalk/time-picker.css +1 -0
  198. package/lib/theme-chalk/time-select.css +1 -0
  199. package/lib/theme-chalk/tooltip.css +1 -0
  200. package/lib/theme-chalk/transfer.css +1 -0
  201. package/lib/theme-chalk/tree.css +1 -0
  202. package/lib/theme-chalk/upload.css +1 -0
  203. package/lib/time-picker.js +2553 -0
  204. package/lib/time-select.js +1839 -0
  205. package/lib/tooltip.js +397 -0
  206. package/lib/transfer.js +883 -0
  207. package/lib/transitions/collapse-transition.js +91 -0
  208. package/lib/tree.js +2138 -0
  209. package/lib/umd/locale/af-ZA.js +128 -0
  210. package/lib/umd/locale/ar.js +127 -0
  211. package/lib/umd/locale/bg.js +128 -0
  212. package/lib/umd/locale/ca.js +127 -0
  213. package/lib/umd/locale/cs-CZ.js +130 -0
  214. package/lib/umd/locale/da.js +127 -0
  215. package/lib/umd/locale/de.js +129 -0
  216. package/lib/umd/locale/ee.js +128 -0
  217. package/lib/umd/locale/el.js +128 -0
  218. package/lib/umd/locale/en.js +128 -0
  219. package/lib/umd/locale/es.js +127 -0
  220. package/lib/umd/locale/eu.js +128 -0
  221. package/lib/umd/locale/fa.js +128 -0
  222. package/lib/umd/locale/fi.js +128 -0
  223. package/lib/umd/locale/fr.js +127 -0
  224. package/lib/umd/locale/he.js +128 -0
  225. package/lib/umd/locale/hu.js +127 -0
  226. package/lib/umd/locale/id.js +128 -0
  227. package/lib/umd/locale/it.js +127 -0
  228. package/lib/umd/locale/ja.js +128 -0
  229. package/lib/umd/locale/km.js +128 -0
  230. package/lib/umd/locale/ko.js +128 -0
  231. package/lib/umd/locale/ku.js +128 -0
  232. package/lib/umd/locale/kz.js +128 -0
  233. package/lib/umd/locale/lt.js +128 -0
  234. package/lib/umd/locale/lv.js +128 -0
  235. package/lib/umd/locale/mn.js +128 -0
  236. package/lib/umd/locale/nb-NO.js +127 -0
  237. package/lib/umd/locale/nl.js +128 -0
  238. package/lib/umd/locale/pl.js +128 -0
  239. package/lib/umd/locale/pt-br.js +128 -0
  240. package/lib/umd/locale/pt.js +128 -0
  241. package/lib/umd/locale/ro.js +128 -0
  242. package/lib/umd/locale/ru-RU.js +128 -0
  243. package/lib/umd/locale/sk.js +130 -0
  244. package/lib/umd/locale/sl.js +128 -0
  245. package/lib/umd/locale/sr.js +128 -0
  246. package/lib/umd/locale/sv-SE.js +128 -0
  247. package/lib/umd/locale/ta.js +127 -0
  248. package/lib/umd/locale/th.js +128 -0
  249. package/lib/umd/locale/tk.js +128 -0
  250. package/lib/umd/locale/tr-TR.js +128 -0
  251. package/lib/umd/locale/ua.js +128 -0
  252. package/lib/umd/locale/ug-CN.js +128 -0
  253. package/lib/umd/locale/vi.js +128 -0
  254. package/lib/umd/locale/zh-CN.js +128 -0
  255. package/lib/umd/locale/zh-TW.js +128 -0
  256. package/lib/upload.js +1301 -0
  257. package/lib/utils/after-leave.js +35 -0
  258. package/lib/utils/aria-dialog.js +104 -0
  259. package/lib/utils/aria-utils.js +125 -0
  260. package/lib/utils/clickoutside.js +79 -0
  261. package/lib/utils/date.js +345 -0
  262. package/lib/utils/dom.js +188 -0
  263. package/lib/utils/menu/aria-menubar.js +24 -0
  264. package/lib/utils/menu/aria-menuitem.js +62 -0
  265. package/lib/utils/menu/aria-submenu.js +69 -0
  266. package/lib/utils/merge.js +21 -0
  267. package/lib/utils/popper.js +1261 -0
  268. package/lib/utils/popup/index.js +241 -0
  269. package/lib/utils/popup/popup-manager.js +205 -0
  270. package/lib/utils/resize-event.js +57 -0
  271. package/lib/utils/scroll-into-view.js +38 -0
  272. package/lib/utils/scrollbar-width.js +39 -0
  273. package/lib/utils/shared.js +12 -0
  274. package/lib/utils/util.js +138 -0
  275. package/lib/utils/vdom.js +20 -0
  276. package/lib/utils/vue-popper.js +204 -0
  277. package/package.json +143 -0
  278. package/packages/alert/index.js +8 -0
  279. package/packages/alert/src/main.vue +88 -0
  280. package/packages/aside/index.js +8 -0
  281. package/packages/aside/src/main.vue +20 -0
  282. package/packages/autocomplete/index.js +8 -0
  283. package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -0
  284. package/packages/autocomplete/src/autocomplete.vue +269 -0
  285. package/packages/badge/index.js +8 -0
  286. package/packages/badge/src/main.vue +53 -0
  287. package/packages/breadcrumb/index.js +8 -0
  288. package/packages/breadcrumb/src/breadcrumb-item.vue +41 -0
  289. package/packages/breadcrumb/src/breadcrumb.vue +34 -0
  290. package/packages/breadcrumb-item/index.js +8 -0
  291. package/packages/button/index.js +8 -0
  292. package/packages/button/src/button-group.vue +10 -0
  293. package/packages/button/src/button.vue +78 -0
  294. package/packages/button-group/index.js +8 -0
  295. package/packages/card/index.js +8 -0
  296. package/packages/card/src/main.vue +23 -0
  297. package/packages/carousel/index.js +8 -0
  298. package/packages/carousel/src/item.vue +114 -0
  299. package/packages/carousel/src/main.vue +262 -0
  300. package/packages/carousel-item/index.js +8 -0
  301. package/packages/cascader/index.js +8 -0
  302. package/packages/cascader/src/main.vue +456 -0
  303. package/packages/cascader/src/menu.vue +376 -0
  304. package/packages/checkbox/index.js +8 -0
  305. package/packages/checkbox/src/checkbox-button.vue +191 -0
  306. package/packages/checkbox/src/checkbox-group.vue +48 -0
  307. package/packages/checkbox/src/checkbox.vue +219 -0
  308. package/packages/checkbox-button/index.js +8 -0
  309. package/packages/checkbox-group/index.js +8 -0
  310. package/packages/col/index.js +9 -0
  311. package/packages/col/src/col.js +71 -0
  312. package/packages/collapse/index.js +9 -0
  313. package/packages/collapse/src/collapse-item.vue +113 -0
  314. package/packages/collapse/src/collapse.vue +73 -0
  315. package/packages/collapse-item/index.js +8 -0
  316. package/packages/color-picker/index.js +8 -0
  317. package/packages/color-picker/src/color.js +316 -0
  318. package/packages/color-picker/src/components/alpha-slider.vue +132 -0
  319. package/packages/color-picker/src/components/hue-slider.vue +123 -0
  320. package/packages/color-picker/src/components/picker-dropdown.vue +121 -0
  321. package/packages/color-picker/src/components/predefine.vue +61 -0
  322. package/packages/color-picker/src/components/sv-panel.vue +100 -0
  323. package/packages/color-picker/src/draggable.js +36 -0
  324. package/packages/color-picker/src/main.vue +188 -0
  325. package/packages/container/index.js +8 -0
  326. package/packages/container/src/main.vue +33 -0
  327. package/packages/date-picker/index.js +8 -0
  328. package/packages/date-picker/src/basic/date-table.vue +437 -0
  329. package/packages/date-picker/src/basic/month-table.vue +105 -0
  330. package/packages/date-picker/src/basic/time-spinner.vue +301 -0
  331. package/packages/date-picker/src/basic/year-table.vue +101 -0
  332. package/packages/date-picker/src/panel/date-range.vue +640 -0
  333. package/packages/date-picker/src/panel/date.vue +579 -0
  334. package/packages/date-picker/src/panel/time-range.vue +248 -0
  335. package/packages/date-picker/src/panel/time-select.vue +177 -0
  336. package/packages/date-picker/src/panel/time.vue +186 -0
  337. package/packages/date-picker/src/picker/date-picker.js +40 -0
  338. package/packages/date-picker/src/picker/time-picker.js +39 -0
  339. package/packages/date-picker/src/picker/time-select.js +21 -0
  340. package/packages/date-picker/src/picker.vue +924 -0
  341. package/packages/date-picker/src/util/index.js +273 -0
  342. package/packages/dialog/index.js +8 -0
  343. package/packages/dialog/src/component.vue +201 -0
  344. package/packages/dropdown/index.js +8 -0
  345. package/packages/dropdown/src/dropdown-item.vue +35 -0
  346. package/packages/dropdown/src/dropdown-menu.vue +60 -0
  347. package/packages/dropdown/src/dropdown.vue +271 -0
  348. package/packages/dropdown-item/index.js +8 -0
  349. package/packages/dropdown-menu/index.js +8 -0
  350. package/packages/footer/index.js +8 -0
  351. package/packages/footer/src/main.vue +20 -0
  352. package/packages/form/index.js +8 -0
  353. package/packages/form/src/form-item.vue +290 -0
  354. package/packages/form/src/form.vue +148 -0
  355. package/packages/form-item/index.js +8 -0
  356. package/packages/header/index.js +8 -0
  357. package/packages/header/src/main.vue +20 -0
  358. package/packages/icon/index.js +8 -0
  359. package/packages/icon/src/icon.vue +13 -0
  360. package/packages/input/index.js +8 -0
  361. package/packages/input/src/calcTextareaHeight.js +104 -0
  362. package/packages/input/src/input.vue +349 -0
  363. package/packages/input-number/index.js +8 -0
  364. package/packages/input-number/src/input-number.vue +255 -0
  365. package/packages/loading/index.js +11 -0
  366. package/packages/loading/src/directive.js +128 -0
  367. package/packages/loading/src/index.js +106 -0
  368. package/packages/loading/src/loading.vue +41 -0
  369. package/packages/main/index.js +8 -0
  370. package/packages/main/src/main.vue +12 -0
  371. package/packages/menu/index.js +8 -0
  372. package/packages/menu/src/menu-item-group.vue +45 -0
  373. package/packages/menu/src/menu-item.vue +112 -0
  374. package/packages/menu/src/menu-mixin.js +44 -0
  375. package/packages/menu/src/menu.vue +311 -0
  376. package/packages/menu/src/submenu.vue +335 -0
  377. package/packages/menu-item/index.js +8 -0
  378. package/packages/menu-item-group/index.js +8 -0
  379. package/packages/message/index.js +2 -0
  380. package/packages/message/src/main.js +72 -0
  381. package/packages/message/src/main.vue +112 -0
  382. package/packages/message-box/index.js +2 -0
  383. package/packages/message-box/src/main.js +216 -0
  384. package/packages/message-box/src/main.vue +327 -0
  385. package/packages/notification/index.js +2 -0
  386. package/packages/notification/src/main.js +93 -0
  387. package/packages/notification/src/main.vue +152 -0
  388. package/packages/option/index.js +8 -0
  389. package/packages/option-group/index.js +8 -0
  390. package/packages/pagination/index.js +8 -0
  391. package/packages/pagination/src/pager.vue +163 -0
  392. package/packages/pagination/src/pagination.js +430 -0
  393. package/packages/popover/index.js +14 -0
  394. package/packages/popover/src/directive.js +20 -0
  395. package/packages/popover/src/main.vue +207 -0
  396. package/packages/progress/index.js +8 -0
  397. package/packages/progress/src/progress.vue +138 -0
  398. package/packages/radio/index.js +8 -0
  399. package/packages/radio/src/radio-button.vue +114 -0
  400. package/packages/radio/src/radio-group.vue +100 -0
  401. package/packages/radio/src/radio.vue +126 -0
  402. package/packages/radio-button/index.js +8 -0
  403. package/packages/radio-group/index.js +8 -0
  404. package/packages/rate/index.js +8 -0
  405. package/packages/rate/src/main.vue +350 -0
  406. package/packages/row/index.js +9 -0
  407. package/packages/row/src/row.js +47 -0
  408. package/packages/scrollbar/index.js +8 -0
  409. package/packages/scrollbar/src/bar.js +88 -0
  410. package/packages/scrollbar/src/main.js +130 -0
  411. package/packages/scrollbar/src/util.js +34 -0
  412. package/packages/select/index.js +8 -0
  413. package/packages/select/src/navigation-mixin.js +54 -0
  414. package/packages/select/src/option-group.vue +60 -0
  415. package/packages/select/src/option.vue +159 -0
  416. package/packages/select/src/select-dropdown.vue +74 -0
  417. package/packages/select/src/select.vue +878 -0
  418. package/packages/slider/index.js +8 -0
  419. package/packages/slider/src/button.vue +235 -0
  420. package/packages/slider/src/main.vue +385 -0
  421. package/packages/spinner/index.js +8 -0
  422. package/packages/spinner/src/spinner.vue +27 -0
  423. package/packages/step/index.js +8 -0
  424. package/packages/steps/README.md +69 -0
  425. package/packages/steps/index.js +8 -0
  426. package/packages/steps/src/step.vue +180 -0
  427. package/packages/steps/src/steps.vue +68 -0
  428. package/packages/submenu/index.js +8 -0
  429. package/packages/switch/index.js +9 -0
  430. package/packages/switch/src/component.vue +163 -0
  431. package/packages/tab-pane/index.js +8 -0
  432. package/packages/table/index.js +8 -0
  433. package/packages/table/src/dropdown.js +28 -0
  434. package/packages/table/src/filter-panel.vue +203 -0
  435. package/packages/table/src/layout-observer.js +68 -0
  436. package/packages/table/src/table-body.js +392 -0
  437. package/packages/table/src/table-column.js +462 -0
  438. package/packages/table/src/table-footer.js +147 -0
  439. package/packages/table/src/table-header.js +522 -0
  440. package/packages/table/src/table-layout.js +231 -0
  441. package/packages/table/src/table-store.js +657 -0
  442. package/packages/table/src/table.vue +660 -0
  443. package/packages/table/src/util.js +122 -0
  444. package/packages/table-column/index.js +8 -0
  445. package/packages/tabs/index.js +8 -0
  446. package/packages/tabs/src/tab-bar.vue +57 -0
  447. package/packages/tabs/src/tab-nav.vue +280 -0
  448. package/packages/tabs/src/tab-pane.vue +58 -0
  449. package/packages/tabs/src/tabs.vue +185 -0
  450. package/packages/tag/index.js +8 -0
  451. package/packages/tag/src/tag.vue +39 -0
  452. package/packages/theme-chalk/README.md +33 -0
  453. package/packages/theme-chalk/lib/alert.css +1 -0
  454. package/packages/theme-chalk/lib/aside.css +1 -0
  455. package/packages/theme-chalk/lib/autocomplete.css +1 -0
  456. package/packages/theme-chalk/lib/badge.css +1 -0
  457. package/packages/theme-chalk/lib/base.css +1 -0
  458. package/packages/theme-chalk/lib/breadcrumb-item.css +0 -0
  459. package/packages/theme-chalk/lib/breadcrumb.css +1 -0
  460. package/packages/theme-chalk/lib/button-group.css +0 -0
  461. package/packages/theme-chalk/lib/button.css +1 -0
  462. package/packages/theme-chalk/lib/card.css +1 -0
  463. package/packages/theme-chalk/lib/carousel-item.css +1 -0
  464. package/packages/theme-chalk/lib/carousel.css +1 -0
  465. package/packages/theme-chalk/lib/cascader.css +1 -0
  466. package/packages/theme-chalk/lib/checkbox-button.css +0 -0
  467. package/packages/theme-chalk/lib/checkbox-group.css +0 -0
  468. package/packages/theme-chalk/lib/checkbox.css +1 -0
  469. package/packages/theme-chalk/lib/col.css +1 -0
  470. package/packages/theme-chalk/lib/collapse-item.css +0 -0
  471. package/packages/theme-chalk/lib/collapse.css +1 -0
  472. package/packages/theme-chalk/lib/color-picker.css +1 -0
  473. package/packages/theme-chalk/lib/container.css +1 -0
  474. package/packages/theme-chalk/lib/date-picker.css +1 -0
  475. package/packages/theme-chalk/lib/dialog.css +1 -0
  476. package/packages/theme-chalk/lib/display.css +1 -0
  477. package/packages/theme-chalk/lib/dropdown-item.css +0 -0
  478. package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
  479. package/packages/theme-chalk/lib/dropdown.css +1 -0
  480. package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
  481. package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
  482. package/packages/theme-chalk/lib/footer.css +1 -0
  483. package/packages/theme-chalk/lib/form-item.css +0 -0
  484. package/packages/theme-chalk/lib/form.css +1 -0
  485. package/packages/theme-chalk/lib/header.css +1 -0
  486. package/packages/theme-chalk/lib/icon.css +1 -0
  487. package/packages/theme-chalk/lib/index.css +1 -0
  488. package/packages/theme-chalk/lib/input-number.css +1 -0
  489. package/packages/theme-chalk/lib/input.css +1 -0
  490. package/packages/theme-chalk/lib/loading.css +1 -0
  491. package/packages/theme-chalk/lib/main.css +1 -0
  492. package/packages/theme-chalk/lib/menu-item-group.css +0 -0
  493. package/packages/theme-chalk/lib/menu-item.css +0 -0
  494. package/packages/theme-chalk/lib/menu.css +1 -0
  495. package/packages/theme-chalk/lib/message-box.css +1 -0
  496. package/packages/theme-chalk/lib/message.css +1 -0
  497. package/packages/theme-chalk/lib/notification.css +1 -0
  498. package/packages/theme-chalk/lib/option-group.css +1 -0
  499. package/packages/theme-chalk/lib/option.css +1 -0
  500. package/packages/theme-chalk/lib/pagination.css +1 -0
  501. package/packages/theme-chalk/lib/popover.css +1 -0
  502. package/packages/theme-chalk/lib/popper.css +1 -0
  503. package/packages/theme-chalk/lib/progress.css +1 -0
  504. package/packages/theme-chalk/lib/radio-button.css +1 -0
  505. package/packages/theme-chalk/lib/radio-group.css +1 -0
  506. package/packages/theme-chalk/lib/radio.css +1 -0
  507. package/packages/theme-chalk/lib/rate.css +1 -0
  508. package/packages/theme-chalk/lib/reset.css +1 -0
  509. package/packages/theme-chalk/lib/row.css +1 -0
  510. package/packages/theme-chalk/lib/scrollbar.css +1 -0
  511. package/packages/theme-chalk/lib/select-dropdown.css +1 -0
  512. package/packages/theme-chalk/lib/select.css +1 -0
  513. package/packages/theme-chalk/lib/slider.css +1 -0
  514. package/packages/theme-chalk/lib/spinner.css +1 -0
  515. package/packages/theme-chalk/lib/step.css +1 -0
  516. package/packages/theme-chalk/lib/steps.css +1 -0
  517. package/packages/theme-chalk/lib/submenu.css +0 -0
  518. package/packages/theme-chalk/lib/switch.css +1 -0
  519. package/packages/theme-chalk/lib/tab-pane.css +0 -0
  520. package/packages/theme-chalk/lib/table-column.css +1 -0
  521. package/packages/theme-chalk/lib/table.css +1 -0
  522. package/packages/theme-chalk/lib/tabs.css +1 -0
  523. package/packages/theme-chalk/lib/tag.css +1 -0
  524. package/packages/theme-chalk/lib/time-picker.css +1 -0
  525. package/packages/theme-chalk/lib/time-select.css +1 -0
  526. package/packages/theme-chalk/lib/tooltip.css +1 -0
  527. package/packages/theme-chalk/lib/transfer.css +1 -0
  528. package/packages/theme-chalk/lib/tree.css +1 -0
  529. package/packages/theme-chalk/lib/upload.css +1 -0
  530. package/packages/theme-chalk/package.json +35 -0
  531. package/packages/theme-chalk/src/alert.scss +105 -0
  532. package/packages/theme-chalk/src/aside.scss +7 -0
  533. package/packages/theme-chalk/src/autocomplete.scss +82 -0
  534. package/packages/theme-chalk/src/badge.scss +57 -0
  535. package/packages/theme-chalk/src/base.scss +2 -0
  536. package/packages/theme-chalk/src/breadcrumb-item.scss +0 -0
  537. package/packages/theme-chalk/src/breadcrumb.scss +55 -0
  538. package/packages/theme-chalk/src/button-group.scss +0 -0
  539. package/packages/theme-chalk/src/button.scss +260 -0
  540. package/packages/theme-chalk/src/card.scss +32 -0
  541. package/packages/theme-chalk/src/carousel-item.scss +50 -0
  542. package/packages/theme-chalk/src/carousel.scss +134 -0
  543. package/packages/theme-chalk/src/cascader.scss +180 -0
  544. package/packages/theme-chalk/src/checkbox-button.scss +0 -0
  545. package/packages/theme-chalk/src/checkbox-group.scss +0 -0
  546. package/packages/theme-chalk/src/checkbox.scss +358 -0
  547. package/packages/theme-chalk/src/col.scss +156 -0
  548. package/packages/theme-chalk/src/collapse-item.scss +0 -0
  549. package/packages/theme-chalk/src/collapse.scss +57 -0
  550. package/packages/theme-chalk/src/color-picker.scss +384 -0
  551. package/packages/theme-chalk/src/common/popup.scss +41 -0
  552. package/packages/theme-chalk/src/common/transition.scss +99 -0
  553. package/packages/theme-chalk/src/common/var.scss +713 -0
  554. package/packages/theme-chalk/src/container.scss +14 -0
  555. package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -0
  556. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +104 -0
  557. package/packages/theme-chalk/src/date-picker/date-table.scss +151 -0
  558. package/packages/theme-chalk/src/date-picker/month-table.scss +40 -0
  559. package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -0
  560. package/packages/theme-chalk/src/date-picker/picker.scss +190 -0
  561. package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -0
  562. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -0
  563. package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -0
  564. package/packages/theme-chalk/src/date-picker/year-table.scss +44 -0
  565. package/packages/theme-chalk/src/date-picker.scss +12 -0
  566. package/packages/theme-chalk/src/dialog.scss +122 -0
  567. package/packages/theme-chalk/src/display.scss +12 -0
  568. package/packages/theme-chalk/src/dropdown-item.scss +0 -0
  569. package/packages/theme-chalk/src/dropdown-menu.scss +0 -0
  570. package/packages/theme-chalk/src/dropdown.scss +169 -0
  571. package/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
  572. package/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
  573. package/packages/theme-chalk/src/footer.scss +8 -0
  574. package/packages/theme-chalk/src/form-item.scss +0 -0
  575. package/packages/theme-chalk/src/form.scss +174 -0
  576. package/packages/theme-chalk/src/header.scss +8 -0
  577. package/packages/theme-chalk/src/icon.scss +186 -0
  578. package/packages/theme-chalk/src/index.scss +67 -0
  579. package/packages/theme-chalk/src/input-number.scss +180 -0
  580. package/packages/theme-chalk/src/input.scss +310 -0
  581. package/packages/theme-chalk/src/loading.scss +96 -0
  582. package/packages/theme-chalk/src/main.scss +12 -0
  583. package/packages/theme-chalk/src/menu-item-group.scss +0 -0
  584. package/packages/theme-chalk/src/menu-item.scss +0 -0
  585. package/packages/theme-chalk/src/menu.scss +289 -0
  586. package/packages/theme-chalk/src/message-box.scss +223 -0
  587. package/packages/theme-chalk/src/message.scss +120 -0
  588. package/packages/theme-chalk/src/mixins/_button.scss +81 -0
  589. package/packages/theme-chalk/src/mixins/config.scss +4 -0
  590. package/packages/theme-chalk/src/mixins/function.scss +44 -0
  591. package/packages/theme-chalk/src/mixins/mixins.scss +190 -0
  592. package/packages/theme-chalk/src/mixins/utils.scss +39 -0
  593. package/packages/theme-chalk/src/notification.scss +98 -0
  594. package/packages/theme-chalk/src/option-group.scss +42 -0
  595. package/packages/theme-chalk/src/option.scss +36 -0
  596. package/packages/theme-chalk/src/pagination.scss +295 -0
  597. package/packages/theme-chalk/src/popover.scss +39 -0
  598. package/packages/theme-chalk/src/popper.scss +101 -0
  599. package/packages/theme-chalk/src/progress.scss +130 -0
  600. package/packages/theme-chalk/src/radio-button.scss +113 -0
  601. package/packages/theme-chalk/src/radio-group.scss +9 -0
  602. package/packages/theme-chalk/src/radio.scss +198 -0
  603. package/packages/theme-chalk/src/rate.scss +49 -0
  604. package/packages/theme-chalk/src/reset.scss +79 -0
  605. package/packages/theme-chalk/src/row.scss +39 -0
  606. package/packages/theme-chalk/src/scrollbar.scss +71 -0
  607. package/packages/theme-chalk/src/select-dropdown.scss +59 -0
  608. package/packages/theme-chalk/src/select.scss +148 -0
  609. package/packages/theme-chalk/src/slider.scss +228 -0
  610. package/packages/theme-chalk/src/spinner.scss +44 -0
  611. package/packages/theme-chalk/src/step.scss +317 -0
  612. package/packages/theme-chalk/src/steps.scss +20 -0
  613. package/packages/theme-chalk/src/submenu.scss +0 -0
  614. package/packages/theme-chalk/src/switch.scss +116 -0
  615. package/packages/theme-chalk/src/tab-pane.scss +0 -0
  616. package/packages/theme-chalk/src/table-column.scss +97 -0
  617. package/packages/theme-chalk/src/table.scss +552 -0
  618. package/packages/theme-chalk/src/tabs.scss +587 -0
  619. package/packages/theme-chalk/src/tag.scss +146 -0
  620. package/packages/theme-chalk/src/time-picker.scss +8 -0
  621. package/packages/theme-chalk/src/time-select.scss +37 -0
  622. package/packages/theme-chalk/src/tooltip.scss +141 -0
  623. package/packages/theme-chalk/src/transfer.scss +227 -0
  624. package/packages/theme-chalk/src/tree.scss +122 -0
  625. package/packages/theme-chalk/src/upload.scss +602 -0
  626. package/packages/time-picker/index.js +8 -0
  627. package/packages/time-select/index.js +8 -0
  628. package/packages/tooltip/index.js +8 -0
  629. package/packages/tooltip/src/main.js +216 -0
  630. package/packages/transfer/index.js +8 -0
  631. package/packages/transfer/src/main.vue +231 -0
  632. package/packages/transfer/src/transfer-panel.vue +251 -0
  633. package/packages/tree/index.js +8 -0
  634. package/packages/tree/src/model/node.js +481 -0
  635. package/packages/tree/src/model/tree-store.js +333 -0
  636. package/packages/tree/src/model/util.js +27 -0
  637. package/packages/tree/src/tree-node.vue +277 -0
  638. package/packages/tree/src/tree.vue +495 -0
  639. package/packages/upload/index.js +8 -0
  640. package/packages/upload/src/ajax.js +85 -0
  641. package/packages/upload/src/index.vue +315 -0
  642. package/packages/upload/src/upload-dragger.vue +70 -0
  643. package/packages/upload/src/upload-list.vue +103 -0
  644. package/packages/upload/src/upload.vue +211 -0
  645. package/src/directives/mousewheel.js +18 -0
  646. package/src/directives/repeat-click.js +24 -0
  647. package/src/index.js +251 -0
  648. package/src/locale/format.js +46 -0
  649. package/src/locale/index.js +48 -0
  650. package/src/locale/lang/af-ZA.js +109 -0
  651. package/src/locale/lang/ar.js +108 -0
  652. package/src/locale/lang/bg.js +109 -0
  653. package/src/locale/lang/ca.js +108 -0
  654. package/src/locale/lang/cs-CZ.js +111 -0
  655. package/src/locale/lang/da.js +108 -0
  656. package/src/locale/lang/de.js +110 -0
  657. package/src/locale/lang/ee.js +109 -0
  658. package/src/locale/lang/el.js +109 -0
  659. package/src/locale/lang/en.js +109 -0
  660. package/src/locale/lang/es.js +108 -0
  661. package/src/locale/lang/eu.js +109 -0
  662. package/src/locale/lang/fa.js +109 -0
  663. package/src/locale/lang/fi.js +109 -0
  664. package/src/locale/lang/fr.js +108 -0
  665. package/src/locale/lang/he.js +109 -0
  666. package/src/locale/lang/hu.js +108 -0
  667. package/src/locale/lang/id.js +109 -0
  668. package/src/locale/lang/it.js +108 -0
  669. package/src/locale/lang/ja.js +109 -0
  670. package/src/locale/lang/km.js +109 -0
  671. package/src/locale/lang/ko.js +109 -0
  672. package/src/locale/lang/ku.js +109 -0
  673. package/src/locale/lang/kz.js +109 -0
  674. package/src/locale/lang/lt.js +109 -0
  675. package/src/locale/lang/lv.js +109 -0
  676. package/src/locale/lang/mn.js +109 -0
  677. package/src/locale/lang/nb-NO.js +108 -0
  678. package/src/locale/lang/nl.js +109 -0
  679. package/src/locale/lang/pl.js +109 -0
  680. package/src/locale/lang/pt-br.js +109 -0
  681. package/src/locale/lang/pt.js +109 -0
  682. package/src/locale/lang/ro.js +109 -0
  683. package/src/locale/lang/ru-RU.js +109 -0
  684. package/src/locale/lang/sk.js +111 -0
  685. package/src/locale/lang/sl.js +109 -0
  686. package/src/locale/lang/sr.js +109 -0
  687. package/src/locale/lang/sv-SE.js +109 -0
  688. package/src/locale/lang/ta.js +108 -0
  689. package/src/locale/lang/th.js +109 -0
  690. package/src/locale/lang/tk.js +109 -0
  691. package/src/locale/lang/tr-TR.js +109 -0
  692. package/src/locale/lang/ua.js +109 -0
  693. package/src/locale/lang/ug-CN.js +109 -0
  694. package/src/locale/lang/vi.js +109 -0
  695. package/src/locale/lang/zh-CN.js +109 -0
  696. package/src/locale/lang/zh-TW.js +109 -0
  697. package/src/mixins/emitter.js +33 -0
  698. package/src/mixins/focus.js +9 -0
  699. package/src/mixins/locale.js +9 -0
  700. package/src/mixins/migrating.js +51 -0
  701. package/src/transitions/collapse-transition.js +77 -0
  702. package/src/utils/after-leave.js +27 -0
  703. package/src/utils/aria-dialog.js +90 -0
  704. package/src/utils/aria-utils.js +121 -0
  705. package/src/utils/clickoutside.js +76 -0
  706. package/src/utils/date.js +344 -0
  707. package/src/utils/dom.js +174 -0
  708. package/src/utils/menu/aria-menubar.js +14 -0
  709. package/src/utils/menu/aria-menuitem.js +49 -0
  710. package/src/utils/menu/aria-submenu.js +59 -0
  711. package/src/utils/merge.js +15 -0
  712. package/src/utils/popper.js +1276 -0
  713. package/src/utils/popup/index.js +226 -0
  714. package/src/utils/popup/popup-manager.js +194 -0
  715. package/src/utils/resize-event.js +35 -0
  716. package/src/utils/scroll-into-view.js +27 -0
  717. package/src/utils/scrollbar-width.js +29 -0
  718. package/src/utils/shared.js +7 -0
  719. package/src/utils/util.js +122 -0
  720. package/src/utils/vdom.js +9 -0
  721. package/src/utils/vue-popper.js +200 -0
  722. package/types/alert.d.ts +27 -0
  723. package/types/aside.d.ts +7 -0
  724. package/types/autocomplete.d.ts +78 -0
  725. package/types/badge.d.ts +16 -0
  726. package/types/breadcrumb-item.d.ts +10 -0
  727. package/types/breadcrumb.d.ts +10 -0
  728. package/types/button-group.d.ts +4 -0
  729. package/types/button.d.ts +37 -0
  730. package/types/card.d.ts +26 -0
  731. package/types/carousel-item.d.ts +10 -0
  732. package/types/carousel.d.ts +53 -0
  733. package/types/cascader.d.ts +57 -0
  734. package/types/checkbox-button.d.ts +22 -0
  735. package/types/checkbox-group.d.ts +22 -0
  736. package/types/checkbox.d.ts +34 -0
  737. package/types/col.d.ts +46 -0
  738. package/types/collapse-item.d.ts +23 -0
  739. package/types/collapse.d.ts +10 -0
  740. package/types/color-picker.d.ts +21 -0
  741. package/types/component.d.ts +13 -0
  742. package/types/container.d.ts +7 -0
  743. package/types/date-picker.d.ts +124 -0
  744. package/types/dialog.d.ts +59 -0
  745. package/types/dropdown-item.d.ts +13 -0
  746. package/types/dropdown-menu.d.ts +4 -0
  747. package/types/dropdown.d.ts +26 -0
  748. package/types/element-ui.d.ts +294 -0
  749. package/types/footer.d.ts +7 -0
  750. package/types/form-item.d.ts +37 -0
  751. package/types/form.d.ts +82 -0
  752. package/types/header.d.ts +7 -0
  753. package/types/index.d.ts +4 -0
  754. package/types/input-number.d.ts +44 -0
  755. package/types/input.d.ts +98 -0
  756. package/types/loading.d.ts +62 -0
  757. package/types/main.d.ts +4 -0
  758. package/types/menu-item-group.d.ts +7 -0
  759. package/types/menu-item.d.ts +10 -0
  760. package/types/menu.d.ts +46 -0
  761. package/types/message-box.d.ts +176 -0
  762. package/types/message.d.ts +75 -0
  763. package/types/notification.d.ts +84 -0
  764. package/types/option-group.d.ts +10 -0
  765. package/types/option.d.ts +13 -0
  766. package/types/pagination.d.ts +40 -0
  767. package/types/popover.d.ts +65 -0
  768. package/types/progress.d.ts +31 -0
  769. package/types/radio-button.d.ts +16 -0
  770. package/types/radio-group.d.ts +18 -0
  771. package/types/radio.d.ts +19 -0
  772. package/types/rate.d.ts +52 -0
  773. package/types/row.d.ts +25 -0
  774. package/types/select.d.ts +90 -0
  775. package/types/slider.d.ts +62 -0
  776. package/types/step.d.ts +34 -0
  777. package/types/steps.d.ts +28 -0
  778. package/types/submenu.d.ts +22 -0
  779. package/types/switch.d.ts +40 -0
  780. package/types/tab-pane.d.ts +19 -0
  781. package/types/table-column.d.ts +117 -0
  782. package/types/table.d.ts +157 -0
  783. package/types/tabs.d.ts +31 -0
  784. package/types/tag.d.ts +24 -0
  785. package/types/time-picker.d.ts +63 -0
  786. package/types/time-select.d.ts +56 -0
  787. package/types/tooltip.d.ts +49 -0
  788. package/types/transfer.d.ts +73 -0
  789. package/types/tree.d.ts +264 -0
  790. package/types/upload.d.ts +124 -0
package/lib/table.js ADDED
@@ -0,0 +1,3941 @@
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, {
41
+ /******/ configurable: false,
42
+ /******/ enumerable: true,
43
+ /******/ get: getter
44
+ /******/ });
45
+ /******/ }
46
+ /******/ };
47
+ /******/
48
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
49
+ /******/ __webpack_require__.n = function(module) {
50
+ /******/ var getter = module && module.__esModule ?
51
+ /******/ function getDefault() { return module['default']; } :
52
+ /******/ function getModuleExports() { return module; };
53
+ /******/ __webpack_require__.d(getter, 'a', getter);
54
+ /******/ return getter;
55
+ /******/ };
56
+ /******/
57
+ /******/ // Object.prototype.hasOwnProperty.call
58
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
59
+ /******/
60
+ /******/ // __webpack_public_path__
61
+ /******/ __webpack_require__.p = "/dist/";
62
+ /******/
63
+ /******/ // Load entry module and return exports
64
+ /******/ return __webpack_require__(__webpack_require__.s = 159);
65
+ /******/ })
66
+ /************************************************************************/
67
+ /******/ ({
68
+
69
+ /***/ 0:
70
+ /***/ (function(module, exports) {
71
+
72
+ /* globals __VUE_SSR_CONTEXT__ */
73
+
74
+ // IMPORTANT: Do NOT use ES2015 features in this file.
75
+ // This module is a runtime utility for cleaner component module output and will
76
+ // be included in the final webpack user bundle.
77
+
78
+ module.exports = function normalizeComponent (
79
+ rawScriptExports,
80
+ compiledTemplate,
81
+ functionalTemplate,
82
+ injectStyles,
83
+ scopeId,
84
+ moduleIdentifier /* server only */
85
+ ) {
86
+ var esModule
87
+ var scriptExports = rawScriptExports = rawScriptExports || {}
88
+
89
+ // ES6 modules interop
90
+ var type = typeof rawScriptExports.default
91
+ if (type === 'object' || type === 'function') {
92
+ esModule = rawScriptExports
93
+ scriptExports = rawScriptExports.default
94
+ }
95
+
96
+ // Vue.extend constructor export interop
97
+ var options = typeof scriptExports === 'function'
98
+ ? scriptExports.options
99
+ : scriptExports
100
+
101
+ // render functions
102
+ if (compiledTemplate) {
103
+ options.render = compiledTemplate.render
104
+ options.staticRenderFns = compiledTemplate.staticRenderFns
105
+ options._compiled = true
106
+ }
107
+
108
+ // functional template
109
+ if (functionalTemplate) {
110
+ options.functional = true
111
+ }
112
+
113
+ // scopedId
114
+ if (scopeId) {
115
+ options._scopeId = scopeId
116
+ }
117
+
118
+ var hook
119
+ if (moduleIdentifier) { // server build
120
+ hook = function (context) {
121
+ // 2.3 injection
122
+ context =
123
+ context || // cached call
124
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
125
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
126
+ // 2.2 with runInNewContext: true
127
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
128
+ context = __VUE_SSR_CONTEXT__
129
+ }
130
+ // inject component styles
131
+ if (injectStyles) {
132
+ injectStyles.call(this, context)
133
+ }
134
+ // register component module identifier for async chunk inferrence
135
+ if (context && context._registeredComponents) {
136
+ context._registeredComponents.add(moduleIdentifier)
137
+ }
138
+ }
139
+ // used by ssr in case component is cached and beforeCreate
140
+ // never gets called
141
+ options._ssrRegister = hook
142
+ } else if (injectStyles) {
143
+ hook = injectStyles
144
+ }
145
+
146
+ if (hook) {
147
+ var functional = options.functional
148
+ var existing = functional
149
+ ? options.render
150
+ : options.beforeCreate
151
+
152
+ if (!functional) {
153
+ // inject component registration as beforeCreate hook
154
+ options.beforeCreate = existing
155
+ ? [].concat(existing, hook)
156
+ : [hook]
157
+ } else {
158
+ // for template-only hot-reload because in that case the render fn doesn't
159
+ // go through the normalizer
160
+ options._injectStyles = hook
161
+ // register for functioal component in vue file
162
+ options.render = function renderWithStyleInjection (h, context) {
163
+ hook.call(context)
164
+ return existing(h, context)
165
+ }
166
+ }
167
+ }
168
+
169
+ return {
170
+ esModule: esModule,
171
+ exports: scriptExports,
172
+ options: options
173
+ }
174
+ }
175
+
176
+
177
+ /***/ }),
178
+
179
+ /***/ 10:
180
+ /***/ (function(module, exports) {
181
+
182
+ module.exports = require("element-ui/lib/utils/clickoutside");
183
+
184
+ /***/ }),
185
+
186
+ /***/ 13:
187
+ /***/ (function(module, exports) {
188
+
189
+ module.exports = require("element-ui/lib/utils/popup");
190
+
191
+ /***/ }),
192
+
193
+ /***/ 14:
194
+ /***/ (function(module, exports) {
195
+
196
+ module.exports = require("throttle-debounce/debounce");
197
+
198
+ /***/ }),
199
+
200
+ /***/ 159:
201
+ /***/ (function(module, exports, __webpack_require__) {
202
+
203
+ "use strict";
204
+
205
+
206
+ exports.__esModule = true;
207
+
208
+ var _table = __webpack_require__(160);
209
+
210
+ var _table2 = _interopRequireDefault(_table);
211
+
212
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
213
+
214
+ /* istanbul ignore next */
215
+ _table2.default.install = function (Vue) {
216
+ Vue.component(_table2.default.name, _table2.default);
217
+ };
218
+
219
+ exports.default = _table2.default;
220
+
221
+ /***/ }),
222
+
223
+ /***/ 16:
224
+ /***/ (function(module, exports) {
225
+
226
+ module.exports = require("element-ui/lib/checkbox");
227
+
228
+ /***/ }),
229
+
230
+ /***/ 160:
231
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
232
+
233
+ "use strict";
234
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
235
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__ = __webpack_require__(161);
236
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__);
237
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f7bd8fe_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__ = __webpack_require__(173);
238
+ var normalizeComponent = __webpack_require__(0)
239
+ /* script */
240
+
241
+ /* template */
242
+
243
+ /* template functional */
244
+ var __vue_template_functional__ = false
245
+ /* styles */
246
+ var __vue_styles__ = null
247
+ /* scopeId */
248
+ var __vue_scopeId__ = null
249
+ /* moduleIdentifier (server only) */
250
+ var __vue_module_identifier__ = null
251
+ var Component = normalizeComponent(
252
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default.a,
253
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f7bd8fe_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__["a" /* default */],
254
+ __vue_template_functional__,
255
+ __vue_styles__,
256
+ __vue_scopeId__,
257
+ __vue_module_identifier__
258
+ )
259
+
260
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
261
+
262
+
263
+ /***/ }),
264
+
265
+ /***/ 161:
266
+ /***/ (function(module, exports, __webpack_require__) {
267
+
268
+ "use strict";
269
+
270
+
271
+ exports.__esModule = true;
272
+
273
+ var _checkbox = __webpack_require__(16);
274
+
275
+ var _checkbox2 = _interopRequireDefault(_checkbox);
276
+
277
+ var _debounce = __webpack_require__(14);
278
+
279
+ var _debounce2 = _interopRequireDefault(_debounce);
280
+
281
+ var _resizeEvent = __webpack_require__(18);
282
+
283
+ var _mousewheel = __webpack_require__(162);
284
+
285
+ var _mousewheel2 = _interopRequireDefault(_mousewheel);
286
+
287
+ var _locale = __webpack_require__(5);
288
+
289
+ var _locale2 = _interopRequireDefault(_locale);
290
+
291
+ var _migrating = __webpack_require__(8);
292
+
293
+ var _migrating2 = _interopRequireDefault(_migrating);
294
+
295
+ var _tableStore = __webpack_require__(164);
296
+
297
+ var _tableStore2 = _interopRequireDefault(_tableStore);
298
+
299
+ var _tableLayout = __webpack_require__(165);
300
+
301
+ var _tableLayout2 = _interopRequireDefault(_tableLayout);
302
+
303
+ var _tableBody = __webpack_require__(166);
304
+
305
+ var _tableBody2 = _interopRequireDefault(_tableBody);
306
+
307
+ var _tableHeader = __webpack_require__(167);
308
+
309
+ var _tableHeader2 = _interopRequireDefault(_tableHeader);
310
+
311
+ var _tableFooter = __webpack_require__(172);
312
+
313
+ var _tableFooter2 = _interopRequireDefault(_tableFooter);
314
+
315
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
316
+
317
+ var tableIdSeed = 1; //
318
+ //
319
+ //
320
+ //
321
+ //
322
+ //
323
+ //
324
+ //
325
+ //
326
+ //
327
+ //
328
+ //
329
+ //
330
+ //
331
+ //
332
+ //
333
+ //
334
+ //
335
+ //
336
+ //
337
+ //
338
+ //
339
+ //
340
+ //
341
+ //
342
+ //
343
+ //
344
+ //
345
+ //
346
+ //
347
+ //
348
+ //
349
+ //
350
+ //
351
+ //
352
+ //
353
+ //
354
+ //
355
+ //
356
+ //
357
+ //
358
+ //
359
+ //
360
+ //
361
+ //
362
+ //
363
+ //
364
+ //
365
+ //
366
+ //
367
+ //
368
+ //
369
+ //
370
+ //
371
+ //
372
+ //
373
+ //
374
+ //
375
+ //
376
+ //
377
+ //
378
+ //
379
+ //
380
+ //
381
+ //
382
+ //
383
+ //
384
+ //
385
+ //
386
+ //
387
+ //
388
+ //
389
+ //
390
+ //
391
+ //
392
+ //
393
+ //
394
+ //
395
+ //
396
+ //
397
+ //
398
+ //
399
+ //
400
+ //
401
+ //
402
+ //
403
+ //
404
+ //
405
+ //
406
+ //
407
+ //
408
+ //
409
+ //
410
+ //
411
+ //
412
+ //
413
+ //
414
+ //
415
+ //
416
+ //
417
+ //
418
+ //
419
+ //
420
+ //
421
+ //
422
+ //
423
+ //
424
+ //
425
+ //
426
+ //
427
+ //
428
+ //
429
+ //
430
+ //
431
+ //
432
+ //
433
+ //
434
+ //
435
+ //
436
+ //
437
+ //
438
+ //
439
+ //
440
+ //
441
+ //
442
+ //
443
+ //
444
+ //
445
+ //
446
+ //
447
+ //
448
+ //
449
+ //
450
+ //
451
+ //
452
+ //
453
+ //
454
+ //
455
+ //
456
+ //
457
+ //
458
+ //
459
+ //
460
+ //
461
+ //
462
+ //
463
+ //
464
+ //
465
+ //
466
+ //
467
+ //
468
+ //
469
+ //
470
+ //
471
+ //
472
+ //
473
+ //
474
+ //
475
+ //
476
+ //
477
+ //
478
+ //
479
+ //
480
+ //
481
+ //
482
+ //
483
+ //
484
+ //
485
+ //
486
+ //
487
+ //
488
+ //
489
+ //
490
+ //
491
+ //
492
+ //
493
+ //
494
+ //
495
+ //
496
+ //
497
+ //
498
+ //
499
+ //
500
+ //
501
+ //
502
+ //
503
+ //
504
+ //
505
+ //
506
+ //
507
+ //
508
+ //
509
+ //
510
+ //
511
+ //
512
+ //
513
+ //
514
+ //
515
+ //
516
+ //
517
+ //
518
+ //
519
+ //
520
+ //
521
+ //
522
+ //
523
+ //
524
+ //
525
+ //
526
+ //
527
+ //
528
+ //
529
+ //
530
+ //
531
+
532
+ exports.default = {
533
+ name: 'ElTable',
534
+
535
+ mixins: [_locale2.default, _migrating2.default],
536
+
537
+ directives: {
538
+ Mousewheel: _mousewheel2.default
539
+ },
540
+
541
+ props: {
542
+ data: {
543
+ type: Array,
544
+ default: function _default() {
545
+ return [];
546
+ }
547
+ },
548
+
549
+ size: String,
550
+
551
+ width: [String, Number],
552
+
553
+ height: [String, Number],
554
+
555
+ maxHeight: [String, Number],
556
+
557
+ fit: {
558
+ type: Boolean,
559
+ default: true
560
+ },
561
+
562
+ stripe: Boolean,
563
+
564
+ border: Boolean,
565
+
566
+ rowKey: [String, Function],
567
+
568
+ context: {},
569
+
570
+ showHeader: {
571
+ type: Boolean,
572
+ default: true
573
+ },
574
+
575
+ showSummary: Boolean,
576
+
577
+ sumText: String,
578
+
579
+ summaryMethod: Function,
580
+
581
+ rowClassName: [String, Function],
582
+
583
+ rowStyle: [Object, Function],
584
+
585
+ cellClassName: [String, Function],
586
+
587
+ cellStyle: [Object, Function],
588
+
589
+ headerRowClassName: [String, Function],
590
+
591
+ headerRowStyle: [Object, Function],
592
+
593
+ headerCellClassName: [String, Function],
594
+
595
+ headerCellStyle: [Object, Function],
596
+
597
+ highlightCurrentRow: Boolean,
598
+
599
+ currentRowKey: [String, Number],
600
+
601
+ emptyText: String,
602
+
603
+ expandRowKeys: Array,
604
+
605
+ defaultExpandAll: Boolean,
606
+
607
+ defaultSort: Object,
608
+
609
+ tooltipEffect: String,
610
+
611
+ spanMethod: Function,
612
+
613
+ selectOnIndeterminate: {
614
+ type: Boolean,
615
+ default: true
616
+ }
617
+ },
618
+
619
+ components: {
620
+ TableHeader: _tableHeader2.default,
621
+ TableFooter: _tableFooter2.default,
622
+ TableBody: _tableBody2.default,
623
+ ElCheckbox: _checkbox2.default
624
+ },
625
+
626
+ methods: {
627
+ getMigratingConfig: function getMigratingConfig() {
628
+ return {
629
+ events: {
630
+ expand: 'expand is renamed to expand-change'
631
+ }
632
+ };
633
+ },
634
+ setCurrentRow: function setCurrentRow(row) {
635
+ this.store.commit('setCurrentRow', row);
636
+ },
637
+ toggleRowSelection: function toggleRowSelection(row, selected) {
638
+ this.store.toggleRowSelection(row, selected);
639
+ this.store.updateAllSelected();
640
+ },
641
+ toggleRowExpansion: function toggleRowExpansion(row, expanded) {
642
+ this.store.toggleRowExpansion(row, expanded);
643
+ },
644
+ clearSelection: function clearSelection() {
645
+ this.store.clearSelection();
646
+ },
647
+ clearFilter: function clearFilter(columnKeys) {
648
+ this.store.clearFilter(columnKeys);
649
+ },
650
+ clearSort: function clearSort() {
651
+ this.store.clearSort();
652
+ },
653
+ handleMouseLeave: function handleMouseLeave() {
654
+ this.store.commit('setHoverRow', null);
655
+ if (this.hoverState) this.hoverState = null;
656
+ },
657
+ updateScrollY: function updateScrollY() {
658
+ this.layout.updateScrollY();
659
+ this.layout.updateColumnsWidth();
660
+ },
661
+ handleFixedMousewheel: function handleFixedMousewheel(event, data) {
662
+ var bodyWrapper = this.bodyWrapper;
663
+ if (Math.abs(data.spinY) > 0) {
664
+ var currentScrollTop = bodyWrapper.scrollTop;
665
+ if (data.pixelY < 0 && currentScrollTop !== 0) {
666
+ event.preventDefault();
667
+ }
668
+ if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
669
+ event.preventDefault();
670
+ }
671
+ bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
672
+ } else {
673
+ bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
674
+ }
675
+ },
676
+ handleHeaderFooterMousewheel: function handleHeaderFooterMousewheel(event, data) {
677
+ var pixelX = data.pixelX,
678
+ pixelY = data.pixelY;
679
+
680
+ if (Math.abs(pixelX) >= Math.abs(pixelY)) {
681
+ event.preventDefault();
682
+ this.bodyWrapper.scrollLeft += data.pixelX / 5;
683
+ }
684
+ },
685
+ bindEvents: function bindEvents() {
686
+ var _$refs = this.$refs,
687
+ headerWrapper = _$refs.headerWrapper,
688
+ footerWrapper = _$refs.footerWrapper;
689
+
690
+ var refs = this.$refs;
691
+ var self = this;
692
+
693
+ this.bodyWrapper.addEventListener('scroll', function () {
694
+ if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
695
+ if (footerWrapper) footerWrapper.scrollLeft = this.scrollLeft;
696
+ if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
697
+ if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
698
+ var maxScrollLeftPosition = this.scrollWidth - this.offsetWidth - 1;
699
+ var scrollLeft = this.scrollLeft;
700
+ if (scrollLeft >= maxScrollLeftPosition) {
701
+ self.scrollPosition = 'right';
702
+ } else if (scrollLeft === 0) {
703
+ self.scrollPosition = 'left';
704
+ } else {
705
+ self.scrollPosition = 'middle';
706
+ }
707
+ });
708
+
709
+ if (this.fit) {
710
+ (0, _resizeEvent.addResizeListener)(this.$el, this.resizeListener);
711
+ }
712
+ },
713
+ resizeListener: function resizeListener() {
714
+ if (!this.$ready) return;
715
+ var shouldUpdateLayout = false;
716
+ var el = this.$el;
717
+ var _resizeState = this.resizeState,
718
+ oldWidth = _resizeState.width,
719
+ oldHeight = _resizeState.height;
720
+
721
+
722
+ var width = el.offsetWidth;
723
+ if (oldWidth !== width) {
724
+ shouldUpdateLayout = true;
725
+ }
726
+
727
+ var height = el.offsetHeight;
728
+ if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
729
+ shouldUpdateLayout = true;
730
+ }
731
+
732
+ if (shouldUpdateLayout) {
733
+ this.resizeState.width = width;
734
+ this.resizeState.height = height;
735
+ this.doLayout();
736
+ }
737
+ },
738
+ doLayout: function doLayout() {
739
+ this.layout.updateColumnsWidth();
740
+ if (this.shouldUpdateHeight) {
741
+ this.layout.updateElsHeight();
742
+ }
743
+ },
744
+ sort: function sort(prop, order) {
745
+ this.store.commit('sort', { prop: prop, order: order });
746
+ },
747
+ toggleAllSelection: function toggleAllSelection() {
748
+ this.store.commit('toggleAllSelection');
749
+ }
750
+ },
751
+
752
+ created: function created() {
753
+ var _this = this;
754
+
755
+ this.tableId = 'el-table_' + tableIdSeed++;
756
+ this.debouncedUpdateLayout = (0, _debounce2.default)(50, function () {
757
+ return _this.doLayout();
758
+ });
759
+ },
760
+
761
+
762
+ computed: {
763
+ tableSize: function tableSize() {
764
+ return this.size || (this.$ELEMENT || {}).size;
765
+ },
766
+ bodyWrapper: function bodyWrapper() {
767
+ return this.$refs.bodyWrapper;
768
+ },
769
+ shouldUpdateHeight: function shouldUpdateHeight() {
770
+ return this.height || this.maxHeight || this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0;
771
+ },
772
+ selection: function selection() {
773
+ return this.store.states.selection;
774
+ },
775
+ columns: function columns() {
776
+ return this.store.states.columns;
777
+ },
778
+ tableData: function tableData() {
779
+ return this.store.states.data;
780
+ },
781
+ fixedColumns: function fixedColumns() {
782
+ return this.store.states.fixedColumns;
783
+ },
784
+ rightFixedColumns: function rightFixedColumns() {
785
+ return this.store.states.rightFixedColumns;
786
+ },
787
+ bodyWidth: function bodyWidth() {
788
+ var _layout = this.layout,
789
+ bodyWidth = _layout.bodyWidth,
790
+ scrollY = _layout.scrollY,
791
+ gutterWidth = _layout.gutterWidth;
792
+
793
+ return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
794
+ },
795
+ bodyHeight: function bodyHeight() {
796
+ if (this.height) {
797
+ return {
798
+ height: this.layout.bodyHeight ? this.layout.bodyHeight + 'px' : ''
799
+ };
800
+ } else if (this.maxHeight) {
801
+ return {
802
+ 'max-height': (this.showHeader ? this.maxHeight - this.layout.headerHeight - this.layout.footerHeight : this.maxHeight - this.layout.footerHeight) + 'px'
803
+ };
804
+ }
805
+ return {};
806
+ },
807
+ fixedBodyHeight: function fixedBodyHeight() {
808
+ if (this.height) {
809
+ return {
810
+ height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
811
+ };
812
+ } else if (this.maxHeight) {
813
+ var maxHeight = this.layout.scrollX ? this.maxHeight - this.layout.gutterWidth : this.maxHeight;
814
+
815
+ if (this.showHeader) {
816
+ maxHeight -= this.layout.headerHeight;
817
+ }
818
+
819
+ maxHeight -= this.layout.footerHeight;
820
+
821
+ return {
822
+ 'max-height': maxHeight + 'px'
823
+ };
824
+ }
825
+
826
+ return {};
827
+ },
828
+ fixedHeight: function fixedHeight() {
829
+ if (this.maxHeight) {
830
+ if (this.showSummary) {
831
+ return {
832
+ bottom: 0
833
+ };
834
+ }
835
+ return {
836
+ bottom: this.layout.scrollX && this.data.length ? this.layout.gutterWidth + 'px' : ''
837
+ };
838
+ } else {
839
+ if (this.showSummary) {
840
+ return {
841
+ height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
842
+ };
843
+ }
844
+ return {
845
+ height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
846
+ };
847
+ }
848
+ }
849
+ },
850
+
851
+ watch: {
852
+ height: {
853
+ immediate: true,
854
+ handler: function handler(value) {
855
+ this.layout.setHeight(value);
856
+ }
857
+ },
858
+
859
+ maxHeight: {
860
+ immediate: true,
861
+ handler: function handler(value) {
862
+ this.layout.setMaxHeight(value);
863
+ }
864
+ },
865
+
866
+ currentRowKey: function currentRowKey(newVal) {
867
+ this.store.setCurrentRowKey(newVal);
868
+ },
869
+
870
+
871
+ data: {
872
+ immediate: true,
873
+ handler: function handler(value) {
874
+ var _this2 = this;
875
+
876
+ this.store.commit('setData', value);
877
+ if (this.$ready) {
878
+ this.$nextTick(function () {
879
+ _this2.doLayout();
880
+ });
881
+ }
882
+ }
883
+ },
884
+
885
+ expandRowKeys: {
886
+ immediate: true,
887
+ handler: function handler(newVal) {
888
+ if (newVal) {
889
+ this.store.setExpandRowKeys(newVal);
890
+ }
891
+ }
892
+ }
893
+ },
894
+
895
+ destroyed: function destroyed() {
896
+ if (this.resizeListener) (0, _resizeEvent.removeResizeListener)(this.$el, this.resizeListener);
897
+ },
898
+ mounted: function mounted() {
899
+ var _this3 = this;
900
+
901
+ this.bindEvents();
902
+ this.store.updateColumns();
903
+ this.doLayout();
904
+
905
+ this.resizeState = {
906
+ width: this.$el.offsetWidth,
907
+ height: this.$el.offsetHeight
908
+ };
909
+
910
+ // init filters
911
+ this.store.states.columns.forEach(function (column) {
912
+ if (column.filteredValue && column.filteredValue.length) {
913
+ _this3.store.commit('filterChange', {
914
+ column: column,
915
+ values: column.filteredValue,
916
+ silent: true
917
+ });
918
+ }
919
+ });
920
+
921
+ this.$ready = true;
922
+ },
923
+ data: function data() {
924
+ var store = new _tableStore2.default(this, {
925
+ rowKey: this.rowKey,
926
+ defaultExpandAll: this.defaultExpandAll,
927
+ selectOnIndeterminate: this.selectOnIndeterminate
928
+ });
929
+ var layout = new _tableLayout2.default({
930
+ store: store,
931
+ table: this,
932
+ fit: this.fit,
933
+ showHeader: this.showHeader
934
+ });
935
+ return {
936
+ layout: layout,
937
+ store: store,
938
+ isHidden: false,
939
+ renderExpanded: null,
940
+ resizeProxyVisible: false,
941
+ resizeState: {
942
+ width: null,
943
+ height: null
944
+ },
945
+ // 是否拥有多级表头
946
+ isGroup: false,
947
+ scrollPosition: 'left'
948
+ };
949
+ }
950
+ };
951
+
952
+ /***/ }),
953
+
954
+ /***/ 162:
955
+ /***/ (function(module, exports, __webpack_require__) {
956
+
957
+ "use strict";
958
+
959
+
960
+ exports.__esModule = true;
961
+
962
+ var _normalizeWheel = __webpack_require__(163);
963
+
964
+ var _normalizeWheel2 = _interopRequireDefault(_normalizeWheel);
965
+
966
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
967
+
968
+ var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
969
+
970
+ var mousewheel = function mousewheel(element, callback) {
971
+ if (element && element.addEventListener) {
972
+ element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function (event) {
973
+ var normalized = (0, _normalizeWheel2.default)(event);
974
+ callback && callback.apply(this, [event, normalized]);
975
+ });
976
+ }
977
+ };
978
+
979
+ exports.default = {
980
+ bind: function bind(el, binding) {
981
+ mousewheel(el, binding.value);
982
+ }
983
+ };
984
+
985
+ /***/ }),
986
+
987
+ /***/ 163:
988
+ /***/ (function(module, exports) {
989
+
990
+ module.exports = require("normalize-wheel");
991
+
992
+ /***/ }),
993
+
994
+ /***/ 164:
995
+ /***/ (function(module, exports, __webpack_require__) {
996
+
997
+ "use strict";
998
+
999
+
1000
+ exports.__esModule = true;
1001
+
1002
+ var _vue = __webpack_require__(4);
1003
+
1004
+ var _vue2 = _interopRequireDefault(_vue);
1005
+
1006
+ var _debounce = __webpack_require__(14);
1007
+
1008
+ var _debounce2 = _interopRequireDefault(_debounce);
1009
+
1010
+ var _merge = __webpack_require__(9);
1011
+
1012
+ var _merge2 = _interopRequireDefault(_merge);
1013
+
1014
+ var _dom = __webpack_require__(3);
1015
+
1016
+ var _util = __webpack_require__(48);
1017
+
1018
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1019
+
1020
+ var sortData = function sortData(data, states) {
1021
+ var sortingColumn = states.sortingColumn;
1022
+ if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
1023
+ return data;
1024
+ }
1025
+ return (0, _util.orderBy)(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
1026
+ };
1027
+
1028
+ var getKeysMap = function getKeysMap(array, rowKey) {
1029
+ var arrayMap = {};
1030
+ (array || []).forEach(function (row, index) {
1031
+ arrayMap[(0, _util.getRowIdentity)(row, rowKey)] = { row: row, index: index };
1032
+ });
1033
+ return arrayMap;
1034
+ };
1035
+
1036
+ var toggleRowSelection = function toggleRowSelection(states, row, selected) {
1037
+ var changed = false;
1038
+ var selection = states.selection;
1039
+ var index = selection.indexOf(row);
1040
+ if (typeof selected === 'undefined') {
1041
+ if (index === -1) {
1042
+ selection.push(row);
1043
+ changed = true;
1044
+ } else {
1045
+ selection.splice(index, 1);
1046
+ changed = true;
1047
+ }
1048
+ } else {
1049
+ if (selected && index === -1) {
1050
+ selection.push(row);
1051
+ changed = true;
1052
+ } else if (!selected && index > -1) {
1053
+ selection.splice(index, 1);
1054
+ changed = true;
1055
+ }
1056
+ }
1057
+
1058
+ return changed;
1059
+ };
1060
+
1061
+ var toggleRowExpansion = function toggleRowExpansion(states, row, expanded) {
1062
+ var changed = false;
1063
+ var expandRows = states.expandRows;
1064
+ if (typeof expanded !== 'undefined') {
1065
+ var index = expandRows.indexOf(row);
1066
+ if (expanded) {
1067
+ if (index === -1) {
1068
+ expandRows.push(row);
1069
+ changed = true;
1070
+ }
1071
+ } else {
1072
+ if (index !== -1) {
1073
+ expandRows.splice(index, 1);
1074
+ changed = true;
1075
+ }
1076
+ }
1077
+ } else {
1078
+ var _index = expandRows.indexOf(row);
1079
+ if (_index === -1) {
1080
+ expandRows.push(row);
1081
+ changed = true;
1082
+ } else {
1083
+ expandRows.splice(_index, 1);
1084
+ changed = true;
1085
+ }
1086
+ }
1087
+
1088
+ return changed;
1089
+ };
1090
+
1091
+ var TableStore = function TableStore(table) {
1092
+ var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1093
+
1094
+ if (!table) {
1095
+ throw new Error('Table is required.');
1096
+ }
1097
+ this.table = table;
1098
+
1099
+ this.states = {
1100
+ rowKey: null,
1101
+ _columns: [],
1102
+ originColumns: [],
1103
+ columns: [],
1104
+ fixedColumns: [],
1105
+ rightFixedColumns: [],
1106
+ leafColumns: [],
1107
+ fixedLeafColumns: [],
1108
+ rightFixedLeafColumns: [],
1109
+ leafColumnsLength: 0,
1110
+ fixedLeafColumnsLength: 0,
1111
+ rightFixedLeafColumnsLength: 0,
1112
+ isComplex: false,
1113
+ filteredData: null,
1114
+ data: null,
1115
+ sortingColumn: null,
1116
+ sortProp: null,
1117
+ sortOrder: null,
1118
+ isAllSelected: false,
1119
+ selection: [],
1120
+ reserveSelection: false,
1121
+ selectable: null,
1122
+ currentRow: null,
1123
+ hoverRow: null,
1124
+ filters: {},
1125
+ expandRows: [],
1126
+ defaultExpandAll: false,
1127
+ selectOnIndeterminate: false
1128
+ };
1129
+
1130
+ for (var prop in initialState) {
1131
+ if (initialState.hasOwnProperty(prop) && this.states.hasOwnProperty(prop)) {
1132
+ this.states[prop] = initialState[prop];
1133
+ }
1134
+ }
1135
+ };
1136
+
1137
+ TableStore.prototype.mutations = {
1138
+ setData: function setData(states, data) {
1139
+ var _this = this;
1140
+
1141
+ var dataInstanceChanged = states._data !== data;
1142
+ states._data = data;
1143
+
1144
+ Object.keys(states.filters).forEach(function (columnId) {
1145
+ var values = states.filters[columnId];
1146
+ if (!values || values.length === 0) return;
1147
+ var column = (0, _util.getColumnById)(_this.states, columnId);
1148
+ if (column && column.filterMethod) {
1149
+ data = data.filter(function (row) {
1150
+ return values.some(function (value) {
1151
+ return column.filterMethod.call(null, value, row, column);
1152
+ });
1153
+ });
1154
+ }
1155
+ });
1156
+
1157
+ states.filteredData = data;
1158
+ states.data = sortData(data || [], states);
1159
+
1160
+ this.updateCurrentRow();
1161
+
1162
+ var rowKey = states.rowKey;
1163
+
1164
+ if (!states.reserveSelection) {
1165
+ if (dataInstanceChanged) {
1166
+ this.clearSelection();
1167
+ } else {
1168
+ this.cleanSelection();
1169
+ }
1170
+ this.updateAllSelected();
1171
+ } else {
1172
+ if (rowKey) {
1173
+ (function () {
1174
+ var selection = states.selection;
1175
+ var selectedMap = getKeysMap(selection, rowKey);
1176
+
1177
+ states.data.forEach(function (row) {
1178
+ var rowId = (0, _util.getRowIdentity)(row, rowKey);
1179
+ var rowInfo = selectedMap[rowId];
1180
+ if (rowInfo) {
1181
+ selection[rowInfo.index] = row;
1182
+ }
1183
+ });
1184
+
1185
+ _this.updateAllSelected();
1186
+ })();
1187
+ } else {
1188
+ console.warn('WARN: rowKey is required when reserve-selection is enabled.');
1189
+ }
1190
+ }
1191
+
1192
+ var defaultExpandAll = states.defaultExpandAll;
1193
+ if (defaultExpandAll) {
1194
+ this.states.expandRows = (states.data || []).slice(0);
1195
+ } else if (rowKey) {
1196
+ // update expandRows to new rows according to rowKey
1197
+ var ids = getKeysMap(this.states.expandRows, rowKey);
1198
+ var expandRows = [];
1199
+ for (var _iterator = states.data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1200
+ var _ref;
1201
+
1202
+ if (_isArray) {
1203
+ if (_i >= _iterator.length) break;
1204
+ _ref = _iterator[_i++];
1205
+ } else {
1206
+ _i = _iterator.next();
1207
+ if (_i.done) break;
1208
+ _ref = _i.value;
1209
+ }
1210
+
1211
+ var row = _ref;
1212
+
1213
+ var rowId = (0, _util.getRowIdentity)(row, rowKey);
1214
+ if (ids[rowId]) {
1215
+ expandRows.push(row);
1216
+ }
1217
+ }
1218
+ this.states.expandRows = expandRows;
1219
+ } else {
1220
+ // clear the old rows
1221
+ this.states.expandRows = [];
1222
+ }
1223
+
1224
+ _vue2.default.nextTick(function () {
1225
+ return _this.table.updateScrollY();
1226
+ });
1227
+ },
1228
+ changeSortCondition: function changeSortCondition(states, options) {
1229
+ var _this2 = this;
1230
+
1231
+ states.data = sortData(states.filteredData || states._data || [], states);
1232
+
1233
+ var _table = this.table,
1234
+ $el = _table.$el,
1235
+ highlightCurrentRow = _table.highlightCurrentRow;
1236
+
1237
+ if ($el && highlightCurrentRow) {
1238
+ var data = states.data;
1239
+ var tr = $el.querySelector('tbody').children;
1240
+ var rows = [].filter.call(tr, function (row) {
1241
+ return (0, _dom.hasClass)(row, 'el-table__row');
1242
+ });
1243
+ var row = rows[data.indexOf(states.currentRow)];
1244
+
1245
+ [].forEach.call(rows, function (row) {
1246
+ return (0, _dom.removeClass)(row, 'current-row');
1247
+ });
1248
+ (0, _dom.addClass)(row, 'current-row');
1249
+ }
1250
+
1251
+ if (!options || !options.silent) {
1252
+ this.table.$emit('sort-change', {
1253
+ column: this.states.sortingColumn,
1254
+ prop: this.states.sortProp,
1255
+ order: this.states.sortOrder
1256
+ });
1257
+ }
1258
+
1259
+ _vue2.default.nextTick(function () {
1260
+ return _this2.table.updateScrollY();
1261
+ });
1262
+ },
1263
+ sort: function sort(states, options) {
1264
+ var _this3 = this;
1265
+
1266
+ var prop = options.prop,
1267
+ order = options.order;
1268
+
1269
+ if (prop) {
1270
+ states.sortProp = prop;
1271
+ states.sortOrder = order || 'ascending';
1272
+ _vue2.default.nextTick(function () {
1273
+ for (var i = 0, length = states.columns.length; i < length; i++) {
1274
+ var column = states.columns[i];
1275
+ if (column.property === states.sortProp) {
1276
+ column.order = states.sortOrder;
1277
+ states.sortingColumn = column;
1278
+ break;
1279
+ }
1280
+ }
1281
+
1282
+ if (states.sortingColumn) {
1283
+ _this3.commit('changeSortCondition');
1284
+ }
1285
+ });
1286
+ }
1287
+ },
1288
+ filterChange: function filterChange(states, options) {
1289
+ var _this4 = this;
1290
+
1291
+ var column = options.column,
1292
+ values = options.values,
1293
+ silent = options.silent,
1294
+ multi = options.multi;
1295
+
1296
+ if (values && !Array.isArray(values)) {
1297
+ values = [values];
1298
+ }
1299
+ var filters = {};
1300
+
1301
+ if (multi) {
1302
+ column.forEach(function (col) {
1303
+ states.filters[col.id] = values;
1304
+ filters[col.columnKey || col.id] = values;
1305
+ });
1306
+ } else {
1307
+ var prop = column.property;
1308
+
1309
+ if (prop) {
1310
+ states.filters[column.id] = values;
1311
+ filters[column.columnKey || column.id] = values;
1312
+ }
1313
+ }
1314
+
1315
+ var data = states._data;
1316
+
1317
+ Object.keys(states.filters).forEach(function (columnId) {
1318
+ var values = states.filters[columnId];
1319
+ if (!values || values.length === 0) return;
1320
+ var column = (0, _util.getColumnById)(_this4.states, columnId);
1321
+ if (column && column.filterMethod) {
1322
+ data = data.filter(function (row) {
1323
+ return values.some(function (value) {
1324
+ return column.filterMethod.call(null, value, row, column);
1325
+ });
1326
+ });
1327
+ }
1328
+ });
1329
+
1330
+ states.filteredData = data;
1331
+ states.data = sortData(data, states);
1332
+
1333
+ if (!silent) {
1334
+ this.table.$emit('filter-change', filters);
1335
+ }
1336
+
1337
+ _vue2.default.nextTick(function () {
1338
+ return _this4.table.updateScrollY();
1339
+ });
1340
+ },
1341
+ insertColumn: function insertColumn(states, column, index, parent) {
1342
+ var array = states._columns;
1343
+ if (parent) {
1344
+ array = parent.children;
1345
+ if (!array) array = parent.children = [];
1346
+ }
1347
+
1348
+ if (typeof index !== 'undefined') {
1349
+ array.splice(index, 0, column);
1350
+ } else {
1351
+ array.push(column);
1352
+ }
1353
+
1354
+ if (column.type === 'selection') {
1355
+ states.selectable = column.selectable;
1356
+ states.reserveSelection = column.reserveSelection;
1357
+ }
1358
+
1359
+ if (this.table.$ready) {
1360
+ this.updateColumns(); // hack for dynamics insert column
1361
+ this.scheduleLayout();
1362
+ }
1363
+ },
1364
+ removeColumn: function removeColumn(states, column, parent) {
1365
+ var array = states._columns;
1366
+ if (parent) {
1367
+ array = parent.children;
1368
+ if (!array) array = parent.children = [];
1369
+ }
1370
+ if (array) {
1371
+ array.splice(array.indexOf(column), 1);
1372
+ }
1373
+
1374
+ if (this.table.$ready) {
1375
+ this.updateColumns(); // hack for dynamics remove column
1376
+ this.scheduleLayout();
1377
+ }
1378
+ },
1379
+ setHoverRow: function setHoverRow(states, row) {
1380
+ states.hoverRow = row;
1381
+ },
1382
+ setCurrentRow: function setCurrentRow(states, row) {
1383
+ var oldCurrentRow = states.currentRow;
1384
+ states.currentRow = row;
1385
+
1386
+ if (oldCurrentRow !== row) {
1387
+ this.table.$emit('current-change', row, oldCurrentRow);
1388
+ }
1389
+ },
1390
+ rowSelectedChanged: function rowSelectedChanged(states, row) {
1391
+ var changed = toggleRowSelection(states, row);
1392
+ var selection = states.selection;
1393
+
1394
+ if (changed) {
1395
+ var table = this.table;
1396
+ table.$emit('selection-change', selection ? selection.slice() : []);
1397
+ table.$emit('select', selection, row);
1398
+ }
1399
+
1400
+ this.updateAllSelected();
1401
+ },
1402
+
1403
+
1404
+ toggleAllSelection: (0, _debounce2.default)(10, function (states) {
1405
+ var data = states.data || [];
1406
+ if (data.length === 0) return;
1407
+ var selection = this.states.selection;
1408
+ // when only some rows are selected (but not all), select or deselect all of them
1409
+ // depending on the value of selectOnIndeterminate
1410
+ var value = states.selectOnIndeterminate ? !states.isAllSelected : !(states.isAllSelected || selection.length);
1411
+ var selectionChanged = false;
1412
+
1413
+ data.forEach(function (item, index) {
1414
+ if (states.selectable) {
1415
+ if (states.selectable.call(null, item, index) && toggleRowSelection(states, item, value)) {
1416
+ selectionChanged = true;
1417
+ }
1418
+ } else {
1419
+ if (toggleRowSelection(states, item, value)) {
1420
+ selectionChanged = true;
1421
+ }
1422
+ }
1423
+ });
1424
+
1425
+ var table = this.table;
1426
+ if (selectionChanged) {
1427
+ table.$emit('selection-change', selection ? selection.slice() : []);
1428
+ }
1429
+ table.$emit('select-all', selection);
1430
+ states.isAllSelected = value;
1431
+ })
1432
+ };
1433
+
1434
+ var doFlattenColumns = function doFlattenColumns(columns) {
1435
+ var result = [];
1436
+ columns.forEach(function (column) {
1437
+ if (column.children) {
1438
+ result.push.apply(result, doFlattenColumns(column.children));
1439
+ } else {
1440
+ result.push(column);
1441
+ }
1442
+ });
1443
+ return result;
1444
+ };
1445
+
1446
+ TableStore.prototype.updateColumns = function () {
1447
+ var states = this.states;
1448
+ var _columns = states._columns || [];
1449
+ states.fixedColumns = _columns.filter(function (column) {
1450
+ return column.fixed === true || column.fixed === 'left';
1451
+ });
1452
+ states.rightFixedColumns = _columns.filter(function (column) {
1453
+ return column.fixed === 'right';
1454
+ });
1455
+
1456
+ if (states.fixedColumns.length > 0 && _columns[0] && _columns[0].type === 'selection' && !_columns[0].fixed) {
1457
+ _columns[0].fixed = true;
1458
+ states.fixedColumns.unshift(_columns[0]);
1459
+ }
1460
+
1461
+ var notFixedColumns = _columns.filter(function (column) {
1462
+ return !column.fixed;
1463
+ });
1464
+ states.originColumns = [].concat(states.fixedColumns).concat(notFixedColumns).concat(states.rightFixedColumns);
1465
+
1466
+ var leafColumns = doFlattenColumns(notFixedColumns);
1467
+ var fixedLeafColumns = doFlattenColumns(states.fixedColumns);
1468
+ var rightFixedLeafColumns = doFlattenColumns(states.rightFixedColumns);
1469
+
1470
+ states.leafColumnsLength = leafColumns.length;
1471
+ states.fixedLeafColumnsLength = fixedLeafColumns.length;
1472
+ states.rightFixedLeafColumnsLength = rightFixedLeafColumns.length;
1473
+
1474
+ states.columns = [].concat(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
1475
+ states.isComplex = states.fixedColumns.length > 0 || states.rightFixedColumns.length > 0;
1476
+ };
1477
+
1478
+ TableStore.prototype.isSelected = function (row) {
1479
+ return (this.states.selection || []).indexOf(row) > -1;
1480
+ };
1481
+
1482
+ TableStore.prototype.clearSelection = function () {
1483
+ var states = this.states;
1484
+ states.isAllSelected = false;
1485
+ var oldSelection = states.selection;
1486
+ if (states.selection.length) {
1487
+ states.selection = [];
1488
+ }
1489
+ if (oldSelection.length > 0) {
1490
+ this.table.$emit('selection-change', states.selection ? states.selection.slice() : []);
1491
+ }
1492
+ };
1493
+
1494
+ TableStore.prototype.setExpandRowKeys = function (rowKeys) {
1495
+ var expandRows = [];
1496
+ var data = this.states.data;
1497
+ var rowKey = this.states.rowKey;
1498
+ if (!rowKey) throw new Error('[Table] prop row-key should not be empty.');
1499
+ var keysMap = getKeysMap(data, rowKey);
1500
+ rowKeys.forEach(function (key) {
1501
+ var info = keysMap[key];
1502
+ if (info) {
1503
+ expandRows.push(info.row);
1504
+ }
1505
+ });
1506
+
1507
+ this.states.expandRows = expandRows;
1508
+ };
1509
+
1510
+ TableStore.prototype.toggleRowSelection = function (row, selected) {
1511
+ var changed = toggleRowSelection(this.states, row, selected);
1512
+ if (changed) {
1513
+ this.table.$emit('selection-change', this.states.selection ? this.states.selection.slice() : []);
1514
+ }
1515
+ };
1516
+
1517
+ TableStore.prototype.toggleRowExpansion = function (row, expanded) {
1518
+ var changed = toggleRowExpansion(this.states, row, expanded);
1519
+ if (changed) {
1520
+ this.table.$emit('expand-change', row, this.states.expandRows);
1521
+ this.scheduleLayout();
1522
+ }
1523
+ };
1524
+
1525
+ TableStore.prototype.isRowExpanded = function (row) {
1526
+ var _states = this.states,
1527
+ _states$expandRows = _states.expandRows,
1528
+ expandRows = _states$expandRows === undefined ? [] : _states$expandRows,
1529
+ rowKey = _states.rowKey;
1530
+
1531
+ if (rowKey) {
1532
+ var expandMap = getKeysMap(expandRows, rowKey);
1533
+ return !!expandMap[(0, _util.getRowIdentity)(row, rowKey)];
1534
+ }
1535
+ return expandRows.indexOf(row) !== -1;
1536
+ };
1537
+
1538
+ TableStore.prototype.cleanSelection = function () {
1539
+ var selection = this.states.selection || [];
1540
+ var data = this.states.data;
1541
+ var rowKey = this.states.rowKey;
1542
+ var deleted = void 0;
1543
+ if (rowKey) {
1544
+ deleted = [];
1545
+ var selectedMap = getKeysMap(selection, rowKey);
1546
+ var dataMap = getKeysMap(data, rowKey);
1547
+ for (var key in selectedMap) {
1548
+ if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
1549
+ deleted.push(selectedMap[key].row);
1550
+ }
1551
+ }
1552
+ } else {
1553
+ deleted = selection.filter(function (item) {
1554
+ return data.indexOf(item) === -1;
1555
+ });
1556
+ }
1557
+
1558
+ deleted.forEach(function (deletedItem) {
1559
+ selection.splice(selection.indexOf(deletedItem), 1);
1560
+ });
1561
+
1562
+ if (deleted.length) {
1563
+ this.table.$emit('selection-change', selection ? selection.slice() : []);
1564
+ }
1565
+ };
1566
+
1567
+ TableStore.prototype.clearFilter = function (columnKeys) {
1568
+ var _this5 = this;
1569
+
1570
+ var states = this.states;
1571
+ var _table$$refs = this.table.$refs,
1572
+ tableHeader = _table$$refs.tableHeader,
1573
+ fixedTableHeader = _table$$refs.fixedTableHeader,
1574
+ rightFixedTableHeader = _table$$refs.rightFixedTableHeader;
1575
+
1576
+ var panels = {};
1577
+
1578
+ if (tableHeader) panels = (0, _merge2.default)(panels, tableHeader.filterPanels);
1579
+ if (fixedTableHeader) panels = (0, _merge2.default)(panels, fixedTableHeader.filterPanels);
1580
+ if (rightFixedTableHeader) panels = (0, _merge2.default)(panels, rightFixedTableHeader.filterPanels);
1581
+
1582
+ var keys = Object.keys(panels);
1583
+ if (!keys.length) return;
1584
+
1585
+ if (typeof columnKeys === 'string') {
1586
+ columnKeys = [columnKeys];
1587
+ }
1588
+ if (Array.isArray(columnKeys)) {
1589
+ (function () {
1590
+ var columns = columnKeys.map(function (key) {
1591
+ return (0, _util.getColumnByKey)(states, key);
1592
+ });
1593
+ keys.forEach(function (key) {
1594
+ var column = columns.find(function (col) {
1595
+ return col.id === key;
1596
+ });
1597
+ if (column) {
1598
+ panels[key].filteredValue = [];
1599
+ }
1600
+ });
1601
+ _this5.commit('filterChange', {
1602
+ column: columns,
1603
+ value: [],
1604
+ silent: true,
1605
+ multi: true
1606
+ });
1607
+ })();
1608
+ } else {
1609
+ keys.forEach(function (key) {
1610
+ panels[key].filteredValue = [];
1611
+ });
1612
+
1613
+ states.filters = {};
1614
+
1615
+ this.commit('filterChange', {
1616
+ column: {},
1617
+ values: [],
1618
+ silent: true
1619
+ });
1620
+ }
1621
+ };
1622
+
1623
+ TableStore.prototype.clearSort = function () {
1624
+ var states = this.states;
1625
+ if (!states.sortingColumn) return;
1626
+ states.sortingColumn.order = null;
1627
+ states.sortProp = null;
1628
+ states.sortOrder = null;
1629
+
1630
+ this.commit('changeSortCondition', {
1631
+ silent: true
1632
+ });
1633
+ };
1634
+
1635
+ TableStore.prototype.updateAllSelected = function () {
1636
+ var states = this.states;
1637
+ var selection = states.selection,
1638
+ rowKey = states.rowKey,
1639
+ selectable = states.selectable,
1640
+ data = states.data;
1641
+
1642
+ if (!data || data.length === 0) {
1643
+ states.isAllSelected = false;
1644
+ return;
1645
+ }
1646
+
1647
+ var selectedMap = void 0;
1648
+ if (rowKey) {
1649
+ selectedMap = getKeysMap(states.selection, rowKey);
1650
+ }
1651
+
1652
+ var isSelected = function isSelected(row) {
1653
+ if (selectedMap) {
1654
+ return !!selectedMap[(0, _util.getRowIdentity)(row, rowKey)];
1655
+ } else {
1656
+ return selection.indexOf(row) !== -1;
1657
+ }
1658
+ };
1659
+
1660
+ var isAllSelected = true;
1661
+ var selectedCount = 0;
1662
+ for (var i = 0, j = data.length; i < j; i++) {
1663
+ var item = data[i];
1664
+ var isRowSelectable = selectable && selectable.call(null, item, i);
1665
+ if (!isSelected(item)) {
1666
+ if (!selectable || isRowSelectable) {
1667
+ isAllSelected = false;
1668
+ break;
1669
+ }
1670
+ } else {
1671
+ selectedCount++;
1672
+ }
1673
+ }
1674
+
1675
+ if (selectedCount === 0) isAllSelected = false;
1676
+
1677
+ states.isAllSelected = isAllSelected;
1678
+ };
1679
+
1680
+ TableStore.prototype.scheduleLayout = function (updateColumns) {
1681
+ if (updateColumns) {
1682
+ this.updateColumns();
1683
+ }
1684
+ this.table.debouncedUpdateLayout();
1685
+ };
1686
+
1687
+ TableStore.prototype.setCurrentRowKey = function (key) {
1688
+ var states = this.states;
1689
+ var rowKey = states.rowKey;
1690
+ if (!rowKey) throw new Error('[Table] row-key should not be empty.');
1691
+ var data = states.data || [];
1692
+ var keysMap = getKeysMap(data, rowKey);
1693
+ var info = keysMap[key];
1694
+ states.currentRow = info ? info.row : null;
1695
+ };
1696
+
1697
+ TableStore.prototype.updateCurrentRow = function () {
1698
+ var states = this.states;
1699
+ var table = this.table;
1700
+ var data = states.data || [];
1701
+ var oldCurrentRow = states.currentRow;
1702
+
1703
+ if (data.indexOf(oldCurrentRow) === -1) {
1704
+ if (states.rowKey && oldCurrentRow) {
1705
+ var newCurrentRow = null;
1706
+ for (var i = 0; i < data.length; i++) {
1707
+ var item = data[i];
1708
+ if (item && item[states.rowKey] === oldCurrentRow[states.rowKey]) {
1709
+ newCurrentRow = item;
1710
+ break;
1711
+ }
1712
+ }
1713
+ if (newCurrentRow) {
1714
+ states.currentRow = newCurrentRow;
1715
+ return;
1716
+ }
1717
+ }
1718
+ states.currentRow = null;
1719
+
1720
+ if (states.currentRow !== oldCurrentRow) {
1721
+ table.$emit('current-change', null, oldCurrentRow);
1722
+ }
1723
+ }
1724
+ };
1725
+
1726
+ TableStore.prototype.commit = function (name) {
1727
+ var mutations = this.mutations;
1728
+ if (mutations[name]) {
1729
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1730
+ args[_key - 1] = arguments[_key];
1731
+ }
1732
+
1733
+ mutations[name].apply(this, [this.states].concat(args));
1734
+ } else {
1735
+ throw new Error('Action not found: ' + name);
1736
+ }
1737
+ };
1738
+
1739
+ exports.default = TableStore;
1740
+
1741
+ /***/ }),
1742
+
1743
+ /***/ 165:
1744
+ /***/ (function(module, exports, __webpack_require__) {
1745
+
1746
+ "use strict";
1747
+
1748
+
1749
+ exports.__esModule = true;
1750
+
1751
+ var _scrollbarWidth = __webpack_require__(38);
1752
+
1753
+ var _scrollbarWidth2 = _interopRequireDefault(_scrollbarWidth);
1754
+
1755
+ var _vue = __webpack_require__(4);
1756
+
1757
+ var _vue2 = _interopRequireDefault(_vue);
1758
+
1759
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1760
+
1761
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1762
+
1763
+ var TableLayout = function () {
1764
+ function TableLayout(options) {
1765
+ _classCallCheck(this, TableLayout);
1766
+
1767
+ this.observers = [];
1768
+ this.table = null;
1769
+ this.store = null;
1770
+ this.columns = null;
1771
+ this.fit = true;
1772
+ this.showHeader = true;
1773
+
1774
+ this.height = null;
1775
+ this.scrollX = false;
1776
+ this.scrollY = false;
1777
+ this.bodyWidth = null;
1778
+ this.fixedWidth = null;
1779
+ this.rightFixedWidth = null;
1780
+ this.tableHeight = null;
1781
+ this.headerHeight = 44; // Table Header Height
1782
+ this.appendHeight = 0; // Append Slot Height
1783
+ this.footerHeight = 44; // Table Footer Height
1784
+ this.viewportHeight = null; // Table Height - Scroll Bar Height
1785
+ this.bodyHeight = null; // Table Height - Table Header Height
1786
+ this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
1787
+ this.gutterWidth = (0, _scrollbarWidth2.default)();
1788
+
1789
+ for (var name in options) {
1790
+ if (options.hasOwnProperty(name)) {
1791
+ this[name] = options[name];
1792
+ }
1793
+ }
1794
+
1795
+ if (!this.table) {
1796
+ throw new Error('table is required for Table Layout');
1797
+ }
1798
+ if (!this.store) {
1799
+ throw new Error('store is required for Table Layout');
1800
+ }
1801
+ }
1802
+
1803
+ TableLayout.prototype.updateScrollY = function updateScrollY() {
1804
+ var height = this.height;
1805
+ if (typeof height !== 'string' && typeof height !== 'number') return;
1806
+ var bodyWrapper = this.table.bodyWrapper;
1807
+ if (this.table.$el && bodyWrapper) {
1808
+ var body = bodyWrapper.querySelector('.el-table__body');
1809
+ this.scrollY = body.offsetHeight > this.bodyHeight;
1810
+ }
1811
+ };
1812
+
1813
+ TableLayout.prototype.setHeight = function setHeight(value) {
1814
+ var _this = this;
1815
+
1816
+ var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'height';
1817
+
1818
+ if (_vue2.default.prototype.$isServer) return;
1819
+ var el = this.table.$el;
1820
+ if (typeof value === 'string' && /^\d+$/.test(value)) {
1821
+ value = Number(value);
1822
+ }
1823
+ this.height = value;
1824
+
1825
+ if (!el && (value || value === 0)) return _vue2.default.nextTick(function () {
1826
+ return _this.setHeight(value, prop);
1827
+ });
1828
+
1829
+ if (typeof value === 'number') {
1830
+ el.style[prop] = value + 'px';
1831
+
1832
+ this.updateElsHeight();
1833
+ } else if (typeof value === 'string') {
1834
+ el.style[prop] = value;
1835
+ this.updateElsHeight();
1836
+ }
1837
+ };
1838
+
1839
+ TableLayout.prototype.setMaxHeight = function setMaxHeight(value) {
1840
+ return this.setHeight(value, 'max-height');
1841
+ };
1842
+
1843
+ TableLayout.prototype.updateElsHeight = function updateElsHeight() {
1844
+ var _this2 = this;
1845
+
1846
+ if (!this.table.$ready) return _vue2.default.nextTick(function () {
1847
+ return _this2.updateElsHeight();
1848
+ });
1849
+ var _table$$refs = this.table.$refs,
1850
+ headerWrapper = _table$$refs.headerWrapper,
1851
+ appendWrapper = _table$$refs.appendWrapper,
1852
+ footerWrapper = _table$$refs.footerWrapper;
1853
+
1854
+ this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0;
1855
+
1856
+ if (this.showHeader && !headerWrapper) return;
1857
+ var headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
1858
+ if (this.showHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
1859
+ return _vue2.default.nextTick(function () {
1860
+ return _this2.updateElsHeight();
1861
+ });
1862
+ }
1863
+ var tableHeight = this.tableHeight = this.table.$el.clientHeight;
1864
+ if (this.height !== null && (!isNaN(this.height) || typeof this.height === 'string')) {
1865
+ var footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0;
1866
+ this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
1867
+ }
1868
+ this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight;
1869
+
1870
+ var noData = !this.table.data || this.table.data.length === 0;
1871
+ this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
1872
+
1873
+ this.updateScrollY();
1874
+ this.notifyObservers('scrollable');
1875
+ };
1876
+
1877
+ TableLayout.prototype.getFlattenColumns = function getFlattenColumns() {
1878
+ var flattenColumns = [];
1879
+ var columns = this.table.columns;
1880
+ columns.forEach(function (column) {
1881
+ if (column.isColumnGroup) {
1882
+ flattenColumns.push.apply(flattenColumns, column.columns);
1883
+ } else {
1884
+ flattenColumns.push(column);
1885
+ }
1886
+ });
1887
+
1888
+ return flattenColumns;
1889
+ };
1890
+
1891
+ TableLayout.prototype.updateColumnsWidth = function updateColumnsWidth() {
1892
+ if (_vue2.default.prototype.$isServer) return;
1893
+ var fit = this.fit;
1894
+ var bodyWidth = this.table.$el.clientWidth;
1895
+ var bodyMinWidth = 0;
1896
+
1897
+ var flattenColumns = this.getFlattenColumns();
1898
+ var flexColumns = flattenColumns.filter(function (column) {
1899
+ return typeof column.width !== 'number';
1900
+ });
1901
+
1902
+ flattenColumns.forEach(function (column) {
1903
+ // Clean those columns whose width changed from flex to unflex
1904
+ if (typeof column.width === 'number' && column.realWidth) column.realWidth = null;
1905
+ });
1906
+
1907
+ if (flexColumns.length > 0 && fit) {
1908
+ flattenColumns.forEach(function (column) {
1909
+ bodyMinWidth += column.width || column.minWidth || 80;
1910
+ });
1911
+
1912
+ var scrollYWidth = this.scrollY ? this.gutterWidth : 0;
1913
+
1914
+ if (bodyMinWidth <= bodyWidth - scrollYWidth) {
1915
+ // DON'T HAVE SCROLL BAR
1916
+ this.scrollX = false;
1917
+
1918
+ var totalFlexWidth = bodyWidth - scrollYWidth - bodyMinWidth;
1919
+
1920
+ if (flexColumns.length === 1) {
1921
+ flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth;
1922
+ } else {
1923
+ (function () {
1924
+ var allColumnsWidth = flexColumns.reduce(function (prev, column) {
1925
+ return prev + (column.minWidth || 80);
1926
+ }, 0);
1927
+ var flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
1928
+ var noneFirstWidth = 0;
1929
+
1930
+ flexColumns.forEach(function (column, index) {
1931
+ if (index === 0) return;
1932
+ var flexWidth = Math.floor((column.minWidth || 80) * flexWidthPerPixel);
1933
+ noneFirstWidth += flexWidth;
1934
+ column.realWidth = (column.minWidth || 80) + flexWidth;
1935
+ });
1936
+
1937
+ flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
1938
+ })();
1939
+ }
1940
+ } else {
1941
+ // HAVE HORIZONTAL SCROLL BAR
1942
+ this.scrollX = true;
1943
+ flexColumns.forEach(function (column) {
1944
+ column.realWidth = column.minWidth;
1945
+ });
1946
+ }
1947
+
1948
+ this.bodyWidth = Math.max(bodyMinWidth, bodyWidth);
1949
+ this.table.resizeState.width = this.bodyWidth;
1950
+ } else {
1951
+ flattenColumns.forEach(function (column) {
1952
+ if (!column.width && !column.minWidth) {
1953
+ column.realWidth = 80;
1954
+ } else {
1955
+ column.realWidth = column.width || column.minWidth;
1956
+ }
1957
+
1958
+ bodyMinWidth += column.realWidth;
1959
+ });
1960
+ this.scrollX = bodyMinWidth > bodyWidth;
1961
+
1962
+ this.bodyWidth = bodyMinWidth;
1963
+ }
1964
+
1965
+ var fixedColumns = this.store.states.fixedColumns;
1966
+
1967
+ if (fixedColumns.length > 0) {
1968
+ var fixedWidth = 0;
1969
+ fixedColumns.forEach(function (column) {
1970
+ fixedWidth += column.realWidth || column.width;
1971
+ });
1972
+
1973
+ this.fixedWidth = fixedWidth;
1974
+ }
1975
+
1976
+ var rightFixedColumns = this.store.states.rightFixedColumns;
1977
+ if (rightFixedColumns.length > 0) {
1978
+ var rightFixedWidth = 0;
1979
+ rightFixedColumns.forEach(function (column) {
1980
+ rightFixedWidth += column.realWidth || column.width;
1981
+ });
1982
+
1983
+ this.rightFixedWidth = rightFixedWidth;
1984
+ }
1985
+
1986
+ this.notifyObservers('columns');
1987
+ };
1988
+
1989
+ TableLayout.prototype.addObserver = function addObserver(observer) {
1990
+ this.observers.push(observer);
1991
+ };
1992
+
1993
+ TableLayout.prototype.removeObserver = function removeObserver(observer) {
1994
+ var index = this.observers.indexOf(observer);
1995
+ if (index !== -1) {
1996
+ this.observers.splice(index, 1);
1997
+ }
1998
+ };
1999
+
2000
+ TableLayout.prototype.notifyObservers = function notifyObservers(event) {
2001
+ var _this3 = this;
2002
+
2003
+ var observers = this.observers;
2004
+ observers.forEach(function (observer) {
2005
+ switch (event) {
2006
+ case 'columns':
2007
+ observer.onColumnsChange(_this3);
2008
+ break;
2009
+ case 'scrollable':
2010
+ observer.onScrollableChange(_this3);
2011
+ break;
2012
+ default:
2013
+ throw new Error('Table Layout don\'t have event ' + event + '.');
2014
+ }
2015
+ });
2016
+ };
2017
+
2018
+ return TableLayout;
2019
+ }();
2020
+
2021
+ exports.default = TableLayout;
2022
+
2023
+ /***/ }),
2024
+
2025
+ /***/ 166:
2026
+ /***/ (function(module, exports, __webpack_require__) {
2027
+
2028
+ "use strict";
2029
+
2030
+
2031
+ exports.__esModule = true;
2032
+
2033
+ 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; };
2034
+
2035
+ var _util = __webpack_require__(48);
2036
+
2037
+ var _dom = __webpack_require__(3);
2038
+
2039
+ var _checkbox = __webpack_require__(16);
2040
+
2041
+ var _checkbox2 = _interopRequireDefault(_checkbox);
2042
+
2043
+ var _tooltip = __webpack_require__(22);
2044
+
2045
+ var _tooltip2 = _interopRequireDefault(_tooltip);
2046
+
2047
+ var _debounce = __webpack_require__(14);
2048
+
2049
+ var _debounce2 = _interopRequireDefault(_debounce);
2050
+
2051
+ var _layoutObserver = __webpack_require__(39);
2052
+
2053
+ var _layoutObserver2 = _interopRequireDefault(_layoutObserver);
2054
+
2055
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2056
+
2057
+ exports.default = {
2058
+ name: 'ElTableBody',
2059
+
2060
+ mixins: [_layoutObserver2.default],
2061
+
2062
+ components: {
2063
+ ElCheckbox: _checkbox2.default,
2064
+ ElTooltip: _tooltip2.default
2065
+ },
2066
+
2067
+ props: {
2068
+ store: {
2069
+ required: true
2070
+ },
2071
+ stripe: Boolean,
2072
+ context: {},
2073
+ rowClassName: [String, Function],
2074
+ rowStyle: [Object, Function],
2075
+ fixed: String,
2076
+ highlight: Boolean
2077
+ },
2078
+
2079
+ render: function render(h) {
2080
+ var _this = this;
2081
+
2082
+ var columnsHidden = this.columns.map(function (column, index) {
2083
+ return _this.isColumnHidden(index);
2084
+ });
2085
+ return h(
2086
+ 'table',
2087
+ {
2088
+ 'class': 'el-table__body',
2089
+ attrs: { cellspacing: '0',
2090
+ cellpadding: '0',
2091
+ border: '0' }
2092
+ },
2093
+ [h(
2094
+ 'colgroup',
2095
+ null,
2096
+ [this._l(this.columns, function (column) {
2097
+ return h(
2098
+ 'col',
2099
+ {
2100
+ attrs: { name: column.id }
2101
+ },
2102
+ []
2103
+ );
2104
+ })]
2105
+ ), h(
2106
+ 'tbody',
2107
+ null,
2108
+ [this._l(this.data, function (row, $index) {
2109
+ return [h(
2110
+ 'tr',
2111
+ {
2112
+ style: _this.rowStyle ? _this.getRowStyle(row, $index) : null,
2113
+ key: _this.table.rowKey ? _this.getKeyOfRow(row, $index) : $index,
2114
+ on: {
2115
+ 'dblclick': function dblclick($event) {
2116
+ return _this.handleDoubleClick($event, row);
2117
+ },
2118
+ 'click': function click($event) {
2119
+ return _this.handleClick($event, row);
2120
+ },
2121
+ 'contextmenu': function contextmenu($event) {
2122
+ return _this.handleContextMenu($event, row);
2123
+ },
2124
+ 'mouseenter': function mouseenter(_) {
2125
+ return _this.handleMouseEnter($index);
2126
+ },
2127
+ 'mouseleave': function mouseleave(_) {
2128
+ return _this.handleMouseLeave();
2129
+ }
2130
+ },
2131
+
2132
+ 'class': [_this.getRowClass(row, $index)] },
2133
+ [_this._l(_this.columns, function (column, cellIndex) {
2134
+ var _getSpan = _this.getSpan(row, column, $index, cellIndex),
2135
+ rowspan = _getSpan.rowspan,
2136
+ colspan = _getSpan.colspan;
2137
+
2138
+ if (!rowspan || !colspan) {
2139
+ return '';
2140
+ } else {
2141
+ return h(
2142
+ 'td',
2143
+ {
2144
+ style: _this.getCellStyle($index, cellIndex, row, column),
2145
+ 'class': _this.getCellClass($index, cellIndex, row, column),
2146
+ attrs: { rowspan: rowspan,
2147
+ colspan: colspan
2148
+ },
2149
+ on: {
2150
+ 'mouseenter': function mouseenter($event) {
2151
+ return _this.handleCellMouseEnter($event, row);
2152
+ },
2153
+ 'mouseleave': _this.handleCellMouseLeave
2154
+ }
2155
+ },
2156
+ [column.renderCell.call(_this._renderProxy, h, {
2157
+ row: row,
2158
+ column: column,
2159
+ $index: $index,
2160
+ store: _this.store,
2161
+ _self: _this.context || _this.table.$vnode.context
2162
+ }, columnsHidden[cellIndex])]
2163
+ );
2164
+ }
2165
+ })]
2166
+ ), _this.store.isRowExpanded(row) ? h(
2167
+ 'tr',
2168
+ null,
2169
+ [h(
2170
+ 'td',
2171
+ {
2172
+ attrs: { colspan: _this.columns.length },
2173
+ 'class': 'el-table__expanded-cell' },
2174
+ [_this.table.renderExpanded ? _this.table.renderExpanded(h, { row: row, $index: $index, store: _this.store }) : '']
2175
+ )]
2176
+ ) : ''];
2177
+ }).concat(h(
2178
+ 'el-tooltip',
2179
+ {
2180
+ attrs: { effect: this.table.tooltipEffect, placement: 'top', content: this.tooltipContent },
2181
+ ref: 'tooltip' },
2182
+ []
2183
+ ))]
2184
+ )]
2185
+ );
2186
+ },
2187
+
2188
+
2189
+ watch: {
2190
+ 'store.states.hoverRow': function storeStatesHoverRow(newVal, oldVal) {
2191
+ if (!this.store.states.isComplex) return;
2192
+ var el = this.$el;
2193
+ if (!el) return;
2194
+ var tr = el.querySelector('tbody').children;
2195
+ var rows = [].filter.call(tr, function (row) {
2196
+ return (0, _dom.hasClass)(row, 'el-table__row');
2197
+ });
2198
+ var oldRow = rows[oldVal];
2199
+ var newRow = rows[newVal];
2200
+ if (oldRow) {
2201
+ (0, _dom.removeClass)(oldRow, 'hover-row');
2202
+ }
2203
+ if (newRow) {
2204
+ (0, _dom.addClass)(newRow, 'hover-row');
2205
+ }
2206
+ },
2207
+ 'store.states.currentRow': function storeStatesCurrentRow(newVal, oldVal) {
2208
+ if (!this.highlight) return;
2209
+ var el = this.$el;
2210
+ if (!el) return;
2211
+ var data = this.store.states.data;
2212
+ var tr = el.querySelector('tbody').children;
2213
+ var rows = [].filter.call(tr, function (row) {
2214
+ return (0, _dom.hasClass)(row, 'el-table__row');
2215
+ });
2216
+ var oldRow = rows[data.indexOf(oldVal)];
2217
+ var newRow = rows[data.indexOf(newVal)];
2218
+ if (oldRow) {
2219
+ (0, _dom.removeClass)(oldRow, 'current-row');
2220
+ } else {
2221
+ [].forEach.call(rows, function (row) {
2222
+ return (0, _dom.removeClass)(row, 'current-row');
2223
+ });
2224
+ }
2225
+ if (newRow) {
2226
+ (0, _dom.addClass)(newRow, 'current-row');
2227
+ }
2228
+ }
2229
+ },
2230
+
2231
+ computed: {
2232
+ table: function table() {
2233
+ return this.$parent;
2234
+ },
2235
+ data: function data() {
2236
+ return this.store.states.data;
2237
+ },
2238
+ columnsCount: function columnsCount() {
2239
+ return this.store.states.columns.length;
2240
+ },
2241
+ leftFixedLeafCount: function leftFixedLeafCount() {
2242
+ return this.store.states.fixedLeafColumnsLength;
2243
+ },
2244
+ rightFixedLeafCount: function rightFixedLeafCount() {
2245
+ return this.store.states.rightFixedLeafColumnsLength;
2246
+ },
2247
+ leftFixedCount: function leftFixedCount() {
2248
+ return this.store.states.fixedColumns.length;
2249
+ },
2250
+ rightFixedCount: function rightFixedCount() {
2251
+ return this.store.states.rightFixedColumns.length;
2252
+ },
2253
+ columns: function columns() {
2254
+ return this.store.states.columns;
2255
+ }
2256
+ },
2257
+
2258
+ data: function data() {
2259
+ return {
2260
+ tooltipContent: ''
2261
+ };
2262
+ },
2263
+ created: function created() {
2264
+ this.activateTooltip = (0, _debounce2.default)(50, function (tooltip) {
2265
+ return tooltip.handleShowPopper();
2266
+ });
2267
+ },
2268
+
2269
+
2270
+ methods: {
2271
+ getKeyOfRow: function getKeyOfRow(row, index) {
2272
+ var rowKey = this.table.rowKey;
2273
+ if (rowKey) {
2274
+ return (0, _util.getRowIdentity)(row, rowKey);
2275
+ }
2276
+ return index;
2277
+ },
2278
+ isColumnHidden: function isColumnHidden(index) {
2279
+ if (this.fixed === true || this.fixed === 'left') {
2280
+ return index >= this.leftFixedLeafCount;
2281
+ } else if (this.fixed === 'right') {
2282
+ return index < this.columnsCount - this.rightFixedLeafCount;
2283
+ } else {
2284
+ return index < this.leftFixedLeafCount || index >= this.columnsCount - this.rightFixedLeafCount;
2285
+ }
2286
+ },
2287
+ getSpan: function getSpan(row, column, rowIndex, columnIndex) {
2288
+ var rowspan = 1;
2289
+ var colspan = 1;
2290
+
2291
+ var fn = this.table.spanMethod;
2292
+ if (typeof fn === 'function') {
2293
+ var result = fn({
2294
+ row: row,
2295
+ column: column,
2296
+ rowIndex: rowIndex,
2297
+ columnIndex: columnIndex
2298
+ });
2299
+
2300
+ if (Array.isArray(result)) {
2301
+ rowspan = result[0];
2302
+ colspan = result[1];
2303
+ } else if ((typeof result === 'undefined' ? 'undefined' : _typeof(result)) === 'object') {
2304
+ rowspan = result.rowspan;
2305
+ colspan = result.colspan;
2306
+ }
2307
+ }
2308
+
2309
+ return {
2310
+ rowspan: rowspan,
2311
+ colspan: colspan
2312
+ };
2313
+ },
2314
+ getRowStyle: function getRowStyle(row, rowIndex) {
2315
+ var rowStyle = this.table.rowStyle;
2316
+ if (typeof rowStyle === 'function') {
2317
+ return rowStyle.call(null, {
2318
+ row: row,
2319
+ rowIndex: rowIndex
2320
+ });
2321
+ }
2322
+ return rowStyle;
2323
+ },
2324
+ getRowClass: function getRowClass(row, rowIndex) {
2325
+ var classes = ['el-table__row'];
2326
+ if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
2327
+ classes.push('current-row');
2328
+ }
2329
+
2330
+ if (this.stripe && rowIndex % 2 === 1) {
2331
+ classes.push('el-table__row--striped');
2332
+ }
2333
+ var rowClassName = this.table.rowClassName;
2334
+ if (typeof rowClassName === 'string') {
2335
+ classes.push(rowClassName);
2336
+ } else if (typeof rowClassName === 'function') {
2337
+ classes.push(rowClassName.call(null, {
2338
+ row: row,
2339
+ rowIndex: rowIndex
2340
+ }));
2341
+ }
2342
+
2343
+ if (this.store.states.expandRows.indexOf(row) > -1) {
2344
+ classes.push('expanded');
2345
+ }
2346
+
2347
+ return classes.join(' ');
2348
+ },
2349
+ getCellStyle: function getCellStyle(rowIndex, columnIndex, row, column) {
2350
+ var cellStyle = this.table.cellStyle;
2351
+ if (typeof cellStyle === 'function') {
2352
+ return cellStyle.call(null, {
2353
+ rowIndex: rowIndex,
2354
+ columnIndex: columnIndex,
2355
+ row: row,
2356
+ column: column
2357
+ });
2358
+ }
2359
+ return cellStyle;
2360
+ },
2361
+ getCellClass: function getCellClass(rowIndex, columnIndex, row, column) {
2362
+ var classes = [column.id, column.align, column.className];
2363
+
2364
+ if (this.isColumnHidden(columnIndex)) {
2365
+ classes.push('is-hidden');
2366
+ }
2367
+
2368
+ var cellClassName = this.table.cellClassName;
2369
+ if (typeof cellClassName === 'string') {
2370
+ classes.push(cellClassName);
2371
+ } else if (typeof cellClassName === 'function') {
2372
+ classes.push(cellClassName.call(null, {
2373
+ rowIndex: rowIndex,
2374
+ columnIndex: columnIndex,
2375
+ row: row,
2376
+ column: column
2377
+ }));
2378
+ }
2379
+
2380
+ return classes.join(' ');
2381
+ },
2382
+ handleCellMouseEnter: function handleCellMouseEnter(event, row) {
2383
+ var table = this.table;
2384
+ var cell = (0, _util.getCell)(event);
2385
+
2386
+ if (cell) {
2387
+ var column = (0, _util.getColumnByCell)(table, cell);
2388
+ var hoverState = table.hoverState = { cell: cell, column: column, row: row };
2389
+ table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
2390
+ }
2391
+
2392
+ // 判断是否text-overflow, 如果是就显示tooltip
2393
+ var cellChild = event.target.querySelector('.cell');
2394
+ if (!((0, _dom.hasClass)(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
2395
+ return;
2396
+ }
2397
+ // use range width instead of scrollWidth to determine whether the text is overflowing
2398
+ // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
2399
+ var range = document.createRange();
2400
+ range.setStart(cellChild, 0);
2401
+ range.setEnd(cellChild, cellChild.childNodes.length);
2402
+ var rangeWidth = range.getBoundingClientRect().width;
2403
+ var padding = (parseInt((0, _dom.getStyle)(cellChild, 'paddingLeft'), 10) || 0) + (parseInt((0, _dom.getStyle)(cellChild, 'paddingRight'), 10) || 0);
2404
+ if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
2405
+ var tooltip = this.$refs.tooltip;
2406
+ // TODO 会引起整个 Table 的重新渲染,需要优化
2407
+ this.tooltipContent = cell.innerText || cell.textContent;
2408
+ tooltip.referenceElm = cell;
2409
+ tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
2410
+ tooltip.doDestroy();
2411
+ tooltip.setExpectedState(true);
2412
+ this.activateTooltip(tooltip);
2413
+ }
2414
+ },
2415
+ handleCellMouseLeave: function handleCellMouseLeave(event) {
2416
+ var tooltip = this.$refs.tooltip;
2417
+ if (tooltip) {
2418
+ tooltip.setExpectedState(false);
2419
+ tooltip.handleClosePopper();
2420
+ }
2421
+ var cell = (0, _util.getCell)(event);
2422
+ if (!cell) return;
2423
+
2424
+ var oldHoverState = this.table.hoverState || {};
2425
+ this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
2426
+ },
2427
+ handleMouseEnter: function handleMouseEnter(index) {
2428
+ this.store.commit('setHoverRow', index);
2429
+ },
2430
+ handleMouseLeave: function handleMouseLeave() {
2431
+ this.store.commit('setHoverRow', null);
2432
+ },
2433
+ handleContextMenu: function handleContextMenu(event, row) {
2434
+ this.handleEvent(event, row, 'contextmenu');
2435
+ },
2436
+ handleDoubleClick: function handleDoubleClick(event, row) {
2437
+ this.handleEvent(event, row, 'dblclick');
2438
+ },
2439
+ handleClick: function handleClick(event, row) {
2440
+ this.store.commit('setCurrentRow', row);
2441
+ this.handleEvent(event, row, 'click');
2442
+ },
2443
+ handleEvent: function handleEvent(event, row, name) {
2444
+ var table = this.table;
2445
+ var cell = (0, _util.getCell)(event);
2446
+ var column = void 0;
2447
+ if (cell) {
2448
+ column = (0, _util.getColumnByCell)(table, cell);
2449
+ if (column) {
2450
+ table.$emit('cell-' + name, row, column, cell, event);
2451
+ }
2452
+ }
2453
+ table.$emit('row-' + name, row, event, column);
2454
+ },
2455
+ handleExpandClick: function handleExpandClick(row, e) {
2456
+ e.stopPropagation();
2457
+ this.store.toggleRowExpansion(row);
2458
+ }
2459
+ }
2460
+ };
2461
+
2462
+ /***/ }),
2463
+
2464
+ /***/ 167:
2465
+ /***/ (function(module, exports, __webpack_require__) {
2466
+
2467
+ "use strict";
2468
+
2469
+
2470
+ exports.__esModule = true;
2471
+
2472
+ var _dom = __webpack_require__(3);
2473
+
2474
+ var _checkbox = __webpack_require__(16);
2475
+
2476
+ var _checkbox2 = _interopRequireDefault(_checkbox);
2477
+
2478
+ var _tag = __webpack_require__(25);
2479
+
2480
+ var _tag2 = _interopRequireDefault(_tag);
2481
+
2482
+ var _vue = __webpack_require__(4);
2483
+
2484
+ var _vue2 = _interopRequireDefault(_vue);
2485
+
2486
+ var _filterPanel = __webpack_require__(168);
2487
+
2488
+ var _filterPanel2 = _interopRequireDefault(_filterPanel);
2489
+
2490
+ var _layoutObserver = __webpack_require__(39);
2491
+
2492
+ var _layoutObserver2 = _interopRequireDefault(_layoutObserver);
2493
+
2494
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2495
+
2496
+ var getAllColumns = function getAllColumns(columns) {
2497
+ var result = [];
2498
+ columns.forEach(function (column) {
2499
+ if (column.children) {
2500
+ result.push(column);
2501
+ result.push.apply(result, getAllColumns(column.children));
2502
+ } else {
2503
+ result.push(column);
2504
+ }
2505
+ });
2506
+ return result;
2507
+ };
2508
+
2509
+ var convertToRows = function convertToRows(originColumns) {
2510
+ var maxLevel = 1;
2511
+ var traverse = function traverse(column, parent) {
2512
+ if (parent) {
2513
+ column.level = parent.level + 1;
2514
+ if (maxLevel < column.level) {
2515
+ maxLevel = column.level;
2516
+ }
2517
+ }
2518
+ if (column.children) {
2519
+ var colSpan = 0;
2520
+ column.children.forEach(function (subColumn) {
2521
+ traverse(subColumn, column);
2522
+ colSpan += subColumn.colSpan;
2523
+ });
2524
+ column.colSpan = colSpan;
2525
+ } else {
2526
+ column.colSpan = 1;
2527
+ }
2528
+ };
2529
+
2530
+ originColumns.forEach(function (column) {
2531
+ column.level = 1;
2532
+ traverse(column);
2533
+ });
2534
+
2535
+ var rows = [];
2536
+ for (var i = 0; i < maxLevel; i++) {
2537
+ rows.push([]);
2538
+ }
2539
+
2540
+ var allColumns = getAllColumns(originColumns);
2541
+
2542
+ allColumns.forEach(function (column) {
2543
+ if (!column.children) {
2544
+ column.rowSpan = maxLevel - column.level + 1;
2545
+ } else {
2546
+ column.rowSpan = 1;
2547
+ }
2548
+ rows[column.level - 1].push(column);
2549
+ });
2550
+
2551
+ return rows;
2552
+ };
2553
+
2554
+ exports.default = {
2555
+ name: 'ElTableHeader',
2556
+
2557
+ mixins: [_layoutObserver2.default],
2558
+
2559
+ render: function render(h) {
2560
+ var _this = this;
2561
+
2562
+ var originColumns = this.store.states.originColumns;
2563
+ var columnRows = convertToRows(originColumns, this.columns);
2564
+ // 是否拥有多级表头
2565
+ var isGroup = columnRows.length > 1;
2566
+ if (isGroup) this.$parent.isGroup = true;
2567
+ return h(
2568
+ 'table',
2569
+ {
2570
+ 'class': 'el-table__header',
2571
+ attrs: { cellspacing: '0',
2572
+ cellpadding: '0',
2573
+ border: '0' }
2574
+ },
2575
+ [h(
2576
+ 'colgroup',
2577
+ null,
2578
+ [this._l(this.columns, function (column) {
2579
+ return h(
2580
+ 'col',
2581
+ {
2582
+ attrs: { name: column.id }
2583
+ },
2584
+ []
2585
+ );
2586
+ }), this.hasGutter ? h(
2587
+ 'col',
2588
+ {
2589
+ attrs: { name: 'gutter' }
2590
+ },
2591
+ []
2592
+ ) : '']
2593
+ ), h(
2594
+ 'thead',
2595
+ { 'class': [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] },
2596
+ [this._l(columnRows, function (columns, rowIndex) {
2597
+ return h(
2598
+ 'tr',
2599
+ {
2600
+ style: _this.getHeaderRowStyle(rowIndex),
2601
+ 'class': _this.getHeaderRowClass(rowIndex)
2602
+ },
2603
+ [_this._l(columns, function (column, cellIndex) {
2604
+ return h(
2605
+ 'th',
2606
+ {
2607
+ attrs: {
2608
+ colspan: column.colSpan,
2609
+ rowspan: column.rowSpan
2610
+ },
2611
+ on: {
2612
+ 'mousemove': function mousemove($event) {
2613
+ return _this.handleMouseMove($event, column);
2614
+ },
2615
+ 'mouseout': _this.handleMouseOut,
2616
+ 'mousedown': function mousedown($event) {
2617
+ return _this.handleMouseDown($event, column);
2618
+ },
2619
+ 'click': function click($event) {
2620
+ return _this.handleHeaderClick($event, column);
2621
+ },
2622
+ 'contextmenu': function contextmenu($event) {
2623
+ return _this.handleHeaderContextMenu($event, column);
2624
+ }
2625
+ },
2626
+
2627
+ style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
2628
+ 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
2629
+ key: column.id },
2630
+ [h(
2631
+ 'div',
2632
+ { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
2633
+ [column.renderHeader ? column.renderHeader.call(_this._renderProxy, h, { column: column, $index: cellIndex, store: _this.store, _self: _this.$parent.$vnode.context }) : column.label, column.sortable ? h(
2634
+ 'span',
2635
+ { 'class': 'caret-wrapper', on: {
2636
+ 'click': function click($event) {
2637
+ return _this.handleSortClick($event, column);
2638
+ }
2639
+ }
2640
+ },
2641
+ [h(
2642
+ 'i',
2643
+ { 'class': 'sort-caret ascending', on: {
2644
+ 'click': function click($event) {
2645
+ return _this.handleSortClick($event, column, 'ascending');
2646
+ }
2647
+ }
2648
+ },
2649
+ []
2650
+ ), h(
2651
+ 'i',
2652
+ { 'class': 'sort-caret descending', on: {
2653
+ 'click': function click($event) {
2654
+ return _this.handleSortClick($event, column, 'descending');
2655
+ }
2656
+ }
2657
+ },
2658
+ []
2659
+ )]
2660
+ ) : '', column.filterable ? h(
2661
+ 'span',
2662
+ { 'class': 'el-table__column-filter-trigger', on: {
2663
+ 'click': function click($event) {
2664
+ return _this.handleFilterClick($event, column);
2665
+ }
2666
+ }
2667
+ },
2668
+ [h(
2669
+ 'i',
2670
+ { 'class': ['el-icon-arrow-down', column.filterOpened ? 'el-icon-arrow-up' : ''] },
2671
+ []
2672
+ )]
2673
+ ) : '']
2674
+ )]
2675
+ );
2676
+ }), _this.hasGutter ? h(
2677
+ 'th',
2678
+ { 'class': 'gutter' },
2679
+ []
2680
+ ) : '']
2681
+ );
2682
+ })]
2683
+ )]
2684
+ );
2685
+ },
2686
+
2687
+
2688
+ props: {
2689
+ fixed: String,
2690
+ store: {
2691
+ required: true
2692
+ },
2693
+ border: Boolean,
2694
+ defaultSort: {
2695
+ type: Object,
2696
+ default: function _default() {
2697
+ return {
2698
+ prop: '',
2699
+ order: ''
2700
+ };
2701
+ }
2702
+ }
2703
+ },
2704
+
2705
+ components: {
2706
+ ElCheckbox: _checkbox2.default,
2707
+ ElTag: _tag2.default
2708
+ },
2709
+
2710
+ computed: {
2711
+ table: function table() {
2712
+ return this.$parent;
2713
+ },
2714
+ isAllSelected: function isAllSelected() {
2715
+ return this.store.states.isAllSelected;
2716
+ },
2717
+ columnsCount: function columnsCount() {
2718
+ return this.store.states.columns.length;
2719
+ },
2720
+ leftFixedCount: function leftFixedCount() {
2721
+ return this.store.states.fixedColumns.length;
2722
+ },
2723
+ rightFixedCount: function rightFixedCount() {
2724
+ return this.store.states.rightFixedColumns.length;
2725
+ },
2726
+ leftFixedLeafCount: function leftFixedLeafCount() {
2727
+ return this.store.states.fixedLeafColumnsLength;
2728
+ },
2729
+ rightFixedLeafCount: function rightFixedLeafCount() {
2730
+ return this.store.states.rightFixedLeafColumnsLength;
2731
+ },
2732
+ columns: function columns() {
2733
+ return this.store.states.columns;
2734
+ },
2735
+ hasGutter: function hasGutter() {
2736
+ return !this.fixed && this.tableLayout.gutterWidth;
2737
+ }
2738
+ },
2739
+
2740
+ created: function created() {
2741
+ this.filterPanels = {};
2742
+ },
2743
+ mounted: function mounted() {
2744
+ var _defaultSort = this.defaultSort,
2745
+ prop = _defaultSort.prop,
2746
+ order = _defaultSort.order;
2747
+
2748
+ this.store.commit('sort', { prop: prop, order: order });
2749
+ },
2750
+ beforeDestroy: function beforeDestroy() {
2751
+ var panels = this.filterPanels;
2752
+ for (var prop in panels) {
2753
+ if (panels.hasOwnProperty(prop) && panels[prop]) {
2754
+ panels[prop].$destroy(true);
2755
+ }
2756
+ }
2757
+ },
2758
+
2759
+
2760
+ methods: {
2761
+ isCellHidden: function isCellHidden(index, columns) {
2762
+ var start = 0;
2763
+ for (var i = 0; i < index; i++) {
2764
+ start += columns[i].colSpan;
2765
+ }
2766
+ var after = start + columns[index].colSpan - 1;
2767
+ if (this.fixed === true || this.fixed === 'left') {
2768
+ return after >= this.leftFixedLeafCount;
2769
+ } else if (this.fixed === 'right') {
2770
+ return start < this.columnsCount - this.rightFixedLeafCount;
2771
+ } else {
2772
+ return after < this.leftFixedLeafCount || start >= this.columnsCount - this.rightFixedLeafCount;
2773
+ }
2774
+ },
2775
+ getHeaderRowStyle: function getHeaderRowStyle(rowIndex) {
2776
+ var headerRowStyle = this.table.headerRowStyle;
2777
+ if (typeof headerRowStyle === 'function') {
2778
+ return headerRowStyle.call(null, { rowIndex: rowIndex });
2779
+ }
2780
+ return headerRowStyle;
2781
+ },
2782
+ getHeaderRowClass: function getHeaderRowClass(rowIndex) {
2783
+ var classes = [];
2784
+
2785
+ var headerRowClassName = this.table.headerRowClassName;
2786
+ if (typeof headerRowClassName === 'string') {
2787
+ classes.push(headerRowClassName);
2788
+ } else if (typeof headerRowClassName === 'function') {
2789
+ classes.push(headerRowClassName.call(null, { rowIndex: rowIndex }));
2790
+ }
2791
+
2792
+ return classes.join(' ');
2793
+ },
2794
+ getHeaderCellStyle: function getHeaderCellStyle(rowIndex, columnIndex, row, column) {
2795
+ var headerCellStyle = this.table.headerCellStyle;
2796
+ if (typeof headerCellStyle === 'function') {
2797
+ return headerCellStyle.call(null, {
2798
+ rowIndex: rowIndex,
2799
+ columnIndex: columnIndex,
2800
+ row: row,
2801
+ column: column
2802
+ });
2803
+ }
2804
+ return headerCellStyle;
2805
+ },
2806
+ getHeaderCellClass: function getHeaderCellClass(rowIndex, columnIndex, row, column) {
2807
+ var classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];
2808
+
2809
+ if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
2810
+ classes.push('is-hidden');
2811
+ }
2812
+
2813
+ if (!column.children) {
2814
+ classes.push('is-leaf');
2815
+ }
2816
+
2817
+ if (column.sortable) {
2818
+ classes.push('is-sortable');
2819
+ }
2820
+
2821
+ var headerCellClassName = this.table.headerCellClassName;
2822
+ if (typeof headerCellClassName === 'string') {
2823
+ classes.push(headerCellClassName);
2824
+ } else if (typeof headerCellClassName === 'function') {
2825
+ classes.push(headerCellClassName.call(null, {
2826
+ rowIndex: rowIndex,
2827
+ columnIndex: columnIndex,
2828
+ row: row,
2829
+ column: column
2830
+ }));
2831
+ }
2832
+
2833
+ return classes.join(' ');
2834
+ },
2835
+ toggleAllSelection: function toggleAllSelection(event) {
2836
+ event.stopPropagation();
2837
+ this.store.commit('toggleAllSelection');
2838
+ },
2839
+ handleFilterClick: function handleFilterClick(event, column) {
2840
+ event.stopPropagation();
2841
+ var target = event.target;
2842
+ var cell = target.tagName === 'TH' ? target : target.parentNode;
2843
+ cell = cell.querySelector('.el-table__column-filter-trigger') || cell;
2844
+ var table = this.$parent;
2845
+
2846
+ var filterPanel = this.filterPanels[column.id];
2847
+
2848
+ if (filterPanel && column.filterOpened) {
2849
+ filterPanel.showPopper = false;
2850
+ return;
2851
+ }
2852
+
2853
+ if (!filterPanel) {
2854
+ filterPanel = new _vue2.default(_filterPanel2.default);
2855
+ this.filterPanels[column.id] = filterPanel;
2856
+ if (column.filterPlacement) {
2857
+ filterPanel.placement = column.filterPlacement;
2858
+ }
2859
+ filterPanel.table = table;
2860
+ filterPanel.cell = cell;
2861
+ filterPanel.column = column;
2862
+ !this.$isServer && filterPanel.$mount(document.createElement('div'));
2863
+ }
2864
+
2865
+ setTimeout(function () {
2866
+ filterPanel.showPopper = true;
2867
+ }, 16);
2868
+ },
2869
+ handleHeaderClick: function handleHeaderClick(event, column) {
2870
+ if (!column.filters && column.sortable) {
2871
+ this.handleSortClick(event, column);
2872
+ } else if (column.filterable && !column.sortable) {
2873
+ this.handleFilterClick(event, column);
2874
+ }
2875
+
2876
+ this.$parent.$emit('header-click', column, event);
2877
+ },
2878
+ handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
2879
+ this.$parent.$emit('header-contextmenu', column, event);
2880
+ },
2881
+ handleMouseDown: function handleMouseDown(event, column) {
2882
+ var _this2 = this;
2883
+
2884
+ if (this.$isServer) return;
2885
+ if (column.children && column.children.length > 0) return;
2886
+ /* istanbul ignore if */
2887
+ if (this.draggingColumn && this.border) {
2888
+ (function () {
2889
+ _this2.dragging = true;
2890
+
2891
+ _this2.$parent.resizeProxyVisible = true;
2892
+
2893
+ var table = _this2.$parent;
2894
+ var tableEl = table.$el;
2895
+ var tableLeft = tableEl.getBoundingClientRect().left;
2896
+ var columnEl = _this2.$el.querySelector('th.' + column.id);
2897
+ var columnRect = columnEl.getBoundingClientRect();
2898
+ var minLeft = columnRect.left - tableLeft + 30;
2899
+
2900
+ (0, _dom.addClass)(columnEl, 'noclick');
2901
+
2902
+ _this2.dragState = {
2903
+ startMouseLeft: event.clientX,
2904
+ startLeft: columnRect.right - tableLeft,
2905
+ startColumnLeft: columnRect.left - tableLeft,
2906
+ tableLeft: tableLeft
2907
+ };
2908
+
2909
+ var resizeProxy = table.$refs.resizeProxy;
2910
+ resizeProxy.style.left = _this2.dragState.startLeft + 'px';
2911
+
2912
+ document.onselectstart = function () {
2913
+ return false;
2914
+ };
2915
+ document.ondragstart = function () {
2916
+ return false;
2917
+ };
2918
+
2919
+ var handleMouseMove = function handleMouseMove(event) {
2920
+ var deltaLeft = event.clientX - _this2.dragState.startMouseLeft;
2921
+ var proxyLeft = _this2.dragState.startLeft + deltaLeft;
2922
+
2923
+ resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
2924
+ };
2925
+
2926
+ var handleMouseUp = function handleMouseUp() {
2927
+ if (_this2.dragging) {
2928
+ var _dragState = _this2.dragState,
2929
+ startColumnLeft = _dragState.startColumnLeft,
2930
+ startLeft = _dragState.startLeft;
2931
+
2932
+ var finalLeft = parseInt(resizeProxy.style.left, 10);
2933
+ var columnWidth = finalLeft - startColumnLeft;
2934
+ column.width = column.realWidth = columnWidth;
2935
+ table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
2936
+
2937
+ _this2.store.scheduleLayout();
2938
+
2939
+ document.body.style.cursor = '';
2940
+ _this2.dragging = false;
2941
+ _this2.draggingColumn = null;
2942
+ _this2.dragState = {};
2943
+
2944
+ table.resizeProxyVisible = false;
2945
+ }
2946
+
2947
+ document.removeEventListener('mousemove', handleMouseMove);
2948
+ document.removeEventListener('mouseup', handleMouseUp);
2949
+ document.onselectstart = null;
2950
+ document.ondragstart = null;
2951
+
2952
+ setTimeout(function () {
2953
+ (0, _dom.removeClass)(columnEl, 'noclick');
2954
+ }, 0);
2955
+ };
2956
+
2957
+ document.addEventListener('mousemove', handleMouseMove);
2958
+ document.addEventListener('mouseup', handleMouseUp);
2959
+ })();
2960
+ }
2961
+ },
2962
+ handleMouseMove: function handleMouseMove(event, column) {
2963
+ if (column.children && column.children.length > 0) return;
2964
+ var target = event.target;
2965
+ while (target && target.tagName !== 'TH') {
2966
+ target = target.parentNode;
2967
+ }
2968
+
2969
+ if (!column || !column.resizable) return;
2970
+
2971
+ if (!this.dragging && this.border) {
2972
+ var rect = target.getBoundingClientRect();
2973
+
2974
+ var bodyStyle = document.body.style;
2975
+ if (rect.width > 12 && rect.right - event.pageX < 8) {
2976
+ bodyStyle.cursor = 'col-resize';
2977
+ if ((0, _dom.hasClass)(target, 'is-sortable')) {
2978
+ target.style.cursor = 'col-resize';
2979
+ }
2980
+ this.draggingColumn = column;
2981
+ } else if (!this.dragging) {
2982
+ bodyStyle.cursor = '';
2983
+ if ((0, _dom.hasClass)(target, 'is-sortable')) {
2984
+ target.style.cursor = 'pointer';
2985
+ }
2986
+ this.draggingColumn = null;
2987
+ }
2988
+ }
2989
+ },
2990
+ handleMouseOut: function handleMouseOut() {
2991
+ if (this.$isServer) return;
2992
+ document.body.style.cursor = '';
2993
+ },
2994
+ toggleOrder: function toggleOrder(_ref) {
2995
+ var order = _ref.order,
2996
+ sortOrders = _ref.sortOrders;
2997
+
2998
+ if (order === '') return sortOrders[0];
2999
+ var index = sortOrders.indexOf(order || null);
3000
+ return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
3001
+ },
3002
+ handleSortClick: function handleSortClick(event, column, givenOrder) {
3003
+ event.stopPropagation();
3004
+ var order = givenOrder || this.toggleOrder(column);
3005
+
3006
+ var target = event.target;
3007
+ while (target && target.tagName !== 'TH') {
3008
+ target = target.parentNode;
3009
+ }
3010
+
3011
+ if (target && target.tagName === 'TH') {
3012
+ if ((0, _dom.hasClass)(target, 'noclick')) {
3013
+ (0, _dom.removeClass)(target, 'noclick');
3014
+ return;
3015
+ }
3016
+ }
3017
+
3018
+ if (!column.sortable) return;
3019
+
3020
+ var states = this.store.states;
3021
+ var sortProp = states.sortProp;
3022
+ var sortOrder = void 0;
3023
+ var sortingColumn = states.sortingColumn;
3024
+
3025
+ if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
3026
+ if (sortingColumn) {
3027
+ sortingColumn.order = null;
3028
+ }
3029
+ states.sortingColumn = column;
3030
+ sortProp = column.property;
3031
+ }
3032
+
3033
+ if (!order) {
3034
+ sortOrder = column.order = null;
3035
+ states.sortingColumn = null;
3036
+ sortProp = null;
3037
+ } else {
3038
+ sortOrder = column.order = order;
3039
+ }
3040
+
3041
+ states.sortProp = sortProp;
3042
+ states.sortOrder = sortOrder;
3043
+
3044
+ this.store.commit('changeSortCondition');
3045
+ }
3046
+ },
3047
+
3048
+ data: function data() {
3049
+ return {
3050
+ draggingColumn: null,
3051
+ dragging: false,
3052
+ dragState: {}
3053
+ };
3054
+ }
3055
+ };
3056
+
3057
+ /***/ }),
3058
+
3059
+ /***/ 168:
3060
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3061
+
3062
+ "use strict";
3063
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
3064
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_filter_panel_vue__ = __webpack_require__(169);
3065
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_filter_panel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_filter_panel_vue__);
3066
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c30520c_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_filter_panel_vue__ = __webpack_require__(171);
3067
+ var normalizeComponent = __webpack_require__(0)
3068
+ /* script */
3069
+
3070
+ /* template */
3071
+
3072
+ /* template functional */
3073
+ var __vue_template_functional__ = false
3074
+ /* styles */
3075
+ var __vue_styles__ = null
3076
+ /* scopeId */
3077
+ var __vue_scopeId__ = null
3078
+ /* moduleIdentifier (server only) */
3079
+ var __vue_module_identifier__ = null
3080
+ var Component = normalizeComponent(
3081
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_filter_panel_vue___default.a,
3082
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c30520c_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_filter_panel_vue__["a" /* default */],
3083
+ __vue_template_functional__,
3084
+ __vue_styles__,
3085
+ __vue_scopeId__,
3086
+ __vue_module_identifier__
3087
+ )
3088
+
3089
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
3090
+
3091
+
3092
+ /***/ }),
3093
+
3094
+ /***/ 169:
3095
+ /***/ (function(module, exports, __webpack_require__) {
3096
+
3097
+ "use strict";
3098
+
3099
+
3100
+ exports.__esModule = true;
3101
+
3102
+ var _vuePopper = __webpack_require__(7);
3103
+
3104
+ var _vuePopper2 = _interopRequireDefault(_vuePopper);
3105
+
3106
+ var _popup = __webpack_require__(13);
3107
+
3108
+ var _locale = __webpack_require__(5);
3109
+
3110
+ var _locale2 = _interopRequireDefault(_locale);
3111
+
3112
+ var _clickoutside = __webpack_require__(10);
3113
+
3114
+ var _clickoutside2 = _interopRequireDefault(_clickoutside);
3115
+
3116
+ var _dropdown = __webpack_require__(170);
3117
+
3118
+ var _dropdown2 = _interopRequireDefault(_dropdown);
3119
+
3120
+ var _checkbox = __webpack_require__(16);
3121
+
3122
+ var _checkbox2 = _interopRequireDefault(_checkbox);
3123
+
3124
+ var _checkboxGroup = __webpack_require__(40);
3125
+
3126
+ var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
3127
+
3128
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3129
+
3130
+ exports.default = {
3131
+ name: 'ElTableFilterPanel',
3132
+
3133
+ mixins: [_vuePopper2.default, _locale2.default],
3134
+
3135
+ directives: {
3136
+ Clickoutside: _clickoutside2.default
3137
+ },
3138
+
3139
+ components: {
3140
+ ElCheckbox: _checkbox2.default,
3141
+ ElCheckboxGroup: _checkboxGroup2.default
3142
+ },
3143
+
3144
+ props: {
3145
+ placement: {
3146
+ type: String,
3147
+ default: 'bottom-end'
3148
+ }
3149
+ },
3150
+
3151
+ customRender: function customRender(h) {
3152
+ return h(
3153
+ 'div',
3154
+ { 'class': 'el-table-filter' },
3155
+ [h(
3156
+ 'div',
3157
+ { 'class': 'el-table-filter__content' },
3158
+ []
3159
+ ), h(
3160
+ 'div',
3161
+ { 'class': 'el-table-filter__bottom' },
3162
+ [h(
3163
+ 'button',
3164
+ {
3165
+ on: {
3166
+ 'click': this.handleConfirm
3167
+ }
3168
+ },
3169
+ [this.t('el.table.confirmFilter')]
3170
+ ), h(
3171
+ 'button',
3172
+ {
3173
+ on: {
3174
+ 'click': this.handleReset
3175
+ }
3176
+ },
3177
+ [this.t('el.table.resetFilter')]
3178
+ )]
3179
+ )]
3180
+ );
3181
+ },
3182
+
3183
+
3184
+ methods: {
3185
+ isActive: function isActive(filter) {
3186
+ return filter.value === this.filterValue;
3187
+ },
3188
+ handleOutsideClick: function handleOutsideClick() {
3189
+ var _this = this;
3190
+
3191
+ setTimeout(function () {
3192
+ _this.showPopper = false;
3193
+ }, 16);
3194
+ },
3195
+ handleConfirm: function handleConfirm() {
3196
+ this.confirmFilter(this.filteredValue);
3197
+ this.handleOutsideClick();
3198
+ },
3199
+ handleReset: function handleReset() {
3200
+ this.filteredValue = [];
3201
+ this.confirmFilter(this.filteredValue);
3202
+ this.handleOutsideClick();
3203
+ },
3204
+ handleSelect: function handleSelect(filterValue) {
3205
+ this.filterValue = filterValue;
3206
+
3207
+ if (typeof filterValue !== 'undefined' && filterValue !== null) {
3208
+ this.confirmFilter(this.filteredValue);
3209
+ } else {
3210
+ this.confirmFilter([]);
3211
+ }
3212
+
3213
+ this.handleOutsideClick();
3214
+ },
3215
+ confirmFilter: function confirmFilter(filteredValue) {
3216
+ this.table.store.commit('filterChange', {
3217
+ column: this.column,
3218
+ values: filteredValue
3219
+ });
3220
+ this.table.store.updateAllSelected();
3221
+ }
3222
+ },
3223
+
3224
+ data: function data() {
3225
+ return {
3226
+ table: null,
3227
+ cell: null,
3228
+ column: null
3229
+ };
3230
+ },
3231
+
3232
+
3233
+ computed: {
3234
+ filters: function filters() {
3235
+ return this.column && this.column.filters;
3236
+ },
3237
+
3238
+
3239
+ filterValue: {
3240
+ get: function get() {
3241
+ return (this.column.filteredValue || [])[0];
3242
+ },
3243
+ set: function set(value) {
3244
+ if (this.filteredValue) {
3245
+ if (typeof value !== 'undefined' && value !== null) {
3246
+ this.filteredValue.splice(0, 1, value);
3247
+ } else {
3248
+ this.filteredValue.splice(0, 1);
3249
+ }
3250
+ }
3251
+ }
3252
+ },
3253
+
3254
+ filteredValue: {
3255
+ get: function get() {
3256
+ if (this.column) {
3257
+ return this.column.filteredValue || [];
3258
+ }
3259
+ return [];
3260
+ },
3261
+ set: function set(value) {
3262
+ if (this.column) {
3263
+ this.column.filteredValue = value;
3264
+ }
3265
+ }
3266
+ },
3267
+
3268
+ multiple: function multiple() {
3269
+ if (this.column) {
3270
+ return this.column.filterMultiple;
3271
+ }
3272
+ return true;
3273
+ }
3274
+ },
3275
+
3276
+ mounted: function mounted() {
3277
+ var _this2 = this;
3278
+
3279
+ this.popperElm = this.$el;
3280
+ this.referenceElm = this.cell;
3281
+ this.table.bodyWrapper.addEventListener('scroll', function () {
3282
+ _this2.updatePopper();
3283
+ });
3284
+
3285
+ this.$watch('showPopper', function (value) {
3286
+ if (_this2.column) _this2.column.filterOpened = value;
3287
+ if (value) {
3288
+ _dropdown2.default.open(_this2);
3289
+ } else {
3290
+ _dropdown2.default.close(_this2);
3291
+ }
3292
+ });
3293
+ },
3294
+
3295
+ watch: {
3296
+ showPopper: function showPopper(val) {
3297
+ if (val === true && parseInt(this.popperJS._popper.style.zIndex, 10) < _popup.PopupManager.zIndex) {
3298
+ this.popperJS._popper.style.zIndex = _popup.PopupManager.nextZIndex();
3299
+ }
3300
+ }
3301
+ }
3302
+ }; //
3303
+ //
3304
+ //
3305
+ //
3306
+ //
3307
+ //
3308
+ //
3309
+ //
3310
+ //
3311
+ //
3312
+ //
3313
+ //
3314
+ //
3315
+ //
3316
+ //
3317
+ //
3318
+ //
3319
+ //
3320
+ //
3321
+ //
3322
+ //
3323
+ //
3324
+ //
3325
+ //
3326
+ //
3327
+ //
3328
+ //
3329
+ //
3330
+ //
3331
+ //
3332
+ //
3333
+ //
3334
+ //
3335
+ //
3336
+ //
3337
+ //
3338
+ //
3339
+ //
3340
+ //
3341
+ //
3342
+ //
3343
+ //
3344
+ //
3345
+ //
3346
+
3347
+ /***/ }),
3348
+
3349
+ /***/ 170:
3350
+ /***/ (function(module, exports, __webpack_require__) {
3351
+
3352
+ "use strict";
3353
+
3354
+
3355
+ exports.__esModule = true;
3356
+
3357
+ var _vue = __webpack_require__(4);
3358
+
3359
+ var _vue2 = _interopRequireDefault(_vue);
3360
+
3361
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3362
+
3363
+ var dropdowns = [];
3364
+
3365
+ !_vue2.default.prototype.$isServer && document.addEventListener('click', function (event) {
3366
+ dropdowns.forEach(function (dropdown) {
3367
+ var target = event.target;
3368
+ if (!dropdown || !dropdown.$el) return;
3369
+ if (target === dropdown.$el || dropdown.$el.contains(target)) {
3370
+ return;
3371
+ }
3372
+ dropdown.handleOutsideClick && dropdown.handleOutsideClick(event);
3373
+ });
3374
+ });
3375
+
3376
+ exports.default = {
3377
+ open: function open(instance) {
3378
+ if (instance) {
3379
+ dropdowns.push(instance);
3380
+ }
3381
+ },
3382
+ close: function close(instance) {
3383
+ var index = dropdowns.indexOf(instance);
3384
+ if (index !== -1) {
3385
+ dropdowns.splice(instance, 1);
3386
+ }
3387
+ }
3388
+ };
3389
+
3390
+ /***/ }),
3391
+
3392
+ /***/ 171:
3393
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3394
+
3395
+ "use strict";
3396
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"}},[(_vm.multiple)?_c('div',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleOutsideClick),expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:(_vm.showPopper),expression:"showPopper"}],staticClass:"el-table-filter"},[_c('div',{staticClass:"el-table-filter__content"},[_c('el-scrollbar',{attrs:{"wrap-class":"el-table-filter__wrap"}},[_c('el-checkbox-group',{staticClass:"el-table-filter__checkbox-group",model:{value:(_vm.filteredValue),callback:function ($$v) {_vm.filteredValue=$$v},expression:"filteredValue"}},_vm._l((_vm.filters),function(filter){return _c('el-checkbox',{key:filter.value,attrs:{"label":filter.value}},[_vm._v(_vm._s(filter.text))])}))],1)],1),_c('div',{staticClass:"el-table-filter__bottom"},[_c('button',{class:{ 'is-disabled': _vm.filteredValue.length === 0 },attrs:{"disabled":_vm.filteredValue.length === 0},on:{"click":_vm.handleConfirm}},[_vm._v(_vm._s(_vm.t('el.table.confirmFilter')))]),_c('button',{on:{"click":_vm.handleReset}},[_vm._v(_vm._s(_vm.t('el.table.resetFilter')))])])]):_c('div',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleOutsideClick),expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:(_vm.showPopper),expression:"showPopper"}],staticClass:"el-table-filter"},[_c('ul',{staticClass:"el-table-filter__list"},[_c('li',{staticClass:"el-table-filter__list-item",class:{ 'is-active': _vm.filterValue === undefined || _vm.filterValue === null },on:{"click":function($event){_vm.handleSelect(null)}}},[_vm._v(_vm._s(_vm.t('el.table.clearFilter')))]),_vm._l((_vm.filters),function(filter){return _c('li',{key:filter.value,staticClass:"el-table-filter__list-item",class:{ 'is-active': _vm.isActive(filter) },attrs:{"label":filter.value},on:{"click":function($event){_vm.handleSelect(filter.value)}}},[_vm._v(_vm._s(filter.text))])})],2)])])}
3397
+ var staticRenderFns = []
3398
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
3399
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
3400
+
3401
+ /***/ }),
3402
+
3403
+ /***/ 172:
3404
+ /***/ (function(module, exports, __webpack_require__) {
3405
+
3406
+ "use strict";
3407
+
3408
+
3409
+ exports.__esModule = true;
3410
+
3411
+ var _layoutObserver = __webpack_require__(39);
3412
+
3413
+ var _layoutObserver2 = _interopRequireDefault(_layoutObserver);
3414
+
3415
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3416
+
3417
+ exports.default = {
3418
+ name: 'ElTableFooter',
3419
+
3420
+ mixins: [_layoutObserver2.default],
3421
+
3422
+ render: function render(h) {
3423
+ var _this = this;
3424
+
3425
+ var sums = [];
3426
+ if (this.summaryMethod) {
3427
+ sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
3428
+ } else {
3429
+ this.columns.forEach(function (column, index) {
3430
+ if (index === 0) {
3431
+ sums[index] = _this.sumText;
3432
+ return;
3433
+ }
3434
+ var values = _this.store.states.data.map(function (item) {
3435
+ return Number(item[column.property]);
3436
+ });
3437
+ var precisions = [];
3438
+ var notNumber = true;
3439
+ values.forEach(function (value) {
3440
+ if (!isNaN(value)) {
3441
+ notNumber = false;
3442
+ var decimal = ('' + value).split('.')[1];
3443
+ precisions.push(decimal ? decimal.length : 0);
3444
+ }
3445
+ });
3446
+ var precision = Math.max.apply(null, precisions);
3447
+ if (!notNumber) {
3448
+ sums[index] = values.reduce(function (prev, curr) {
3449
+ var value = Number(curr);
3450
+ if (!isNaN(value)) {
3451
+ return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
3452
+ } else {
3453
+ return prev;
3454
+ }
3455
+ }, 0);
3456
+ } else {
3457
+ sums[index] = '';
3458
+ }
3459
+ });
3460
+ }
3461
+
3462
+ return h(
3463
+ 'table',
3464
+ {
3465
+ 'class': 'el-table__footer',
3466
+ attrs: { cellspacing: '0',
3467
+ cellpadding: '0',
3468
+ border: '0' }
3469
+ },
3470
+ [h(
3471
+ 'colgroup',
3472
+ null,
3473
+ [this._l(this.columns, function (column) {
3474
+ return h(
3475
+ 'col',
3476
+ {
3477
+ attrs: { name: column.id }
3478
+ },
3479
+ []
3480
+ );
3481
+ }), this.hasGutter ? h(
3482
+ 'col',
3483
+ {
3484
+ attrs: { name: 'gutter' }
3485
+ },
3486
+ []
3487
+ ) : '']
3488
+ ), h(
3489
+ 'tbody',
3490
+ { 'class': [{ 'has-gutter': this.hasGutter }] },
3491
+ [h(
3492
+ 'tr',
3493
+ null,
3494
+ [this._l(this.columns, function (column, cellIndex) {
3495
+ return h(
3496
+ 'td',
3497
+ {
3498
+ attrs: {
3499
+ colspan: column.colSpan,
3500
+ rowspan: column.rowSpan
3501
+ },
3502
+ 'class': [column.id, column.headerAlign, column.className || '', _this.isCellHidden(cellIndex, _this.columns) ? 'is-hidden' : '', !column.children ? 'is-leaf' : '', column.labelClassName] },
3503
+ [h(
3504
+ 'div',
3505
+ { 'class': ['cell', column.labelClassName] },
3506
+ [sums[cellIndex]]
3507
+ )]
3508
+ );
3509
+ }), this.hasGutter ? h(
3510
+ 'th',
3511
+ { 'class': 'gutter' },
3512
+ []
3513
+ ) : '']
3514
+ )]
3515
+ )]
3516
+ );
3517
+ },
3518
+
3519
+
3520
+ props: {
3521
+ fixed: String,
3522
+ store: {
3523
+ required: true
3524
+ },
3525
+ summaryMethod: Function,
3526
+ sumText: String,
3527
+ border: Boolean,
3528
+ defaultSort: {
3529
+ type: Object,
3530
+ default: function _default() {
3531
+ return {
3532
+ prop: '',
3533
+ order: ''
3534
+ };
3535
+ }
3536
+ }
3537
+ },
3538
+
3539
+ computed: {
3540
+ table: function table() {
3541
+ return this.$parent;
3542
+ },
3543
+ isAllSelected: function isAllSelected() {
3544
+ return this.store.states.isAllSelected;
3545
+ },
3546
+ columnsCount: function columnsCount() {
3547
+ return this.store.states.columns.length;
3548
+ },
3549
+ leftFixedCount: function leftFixedCount() {
3550
+ return this.store.states.fixedColumns.length;
3551
+ },
3552
+ rightFixedCount: function rightFixedCount() {
3553
+ return this.store.states.rightFixedColumns.length;
3554
+ },
3555
+ columns: function columns() {
3556
+ return this.store.states.columns;
3557
+ },
3558
+ hasGutter: function hasGutter() {
3559
+ return !this.fixed && this.tableLayout.gutterWidth;
3560
+ }
3561
+ },
3562
+
3563
+ methods: {
3564
+ isCellHidden: function isCellHidden(index, columns) {
3565
+ if (this.fixed === true || this.fixed === 'left') {
3566
+ return index >= this.leftFixedCount;
3567
+ } else if (this.fixed === 'right') {
3568
+ var before = 0;
3569
+ for (var i = 0; i < index; i++) {
3570
+ before += columns[i].colSpan;
3571
+ }
3572
+ return before < this.columnsCount - this.rightFixedCount;
3573
+ } else {
3574
+ return index < this.leftFixedCount || index >= this.columnsCount - this.rightFixedCount;
3575
+ }
3576
+ }
3577
+ }
3578
+ };
3579
+
3580
+ /***/ }),
3581
+
3582
+ /***/ 173:
3583
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3584
+
3585
+ "use strict";
3586
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-table",class:[{
3587
+ 'el-table--fit': _vm.fit,
3588
+ 'el-table--striped': _vm.stripe,
3589
+ 'el-table--border': _vm.border || _vm.isGroup,
3590
+ 'el-table--hidden': _vm.isHidden,
3591
+ 'el-table--group': _vm.isGroup,
3592
+ 'el-table--fluid-height': _vm.maxHeight,
3593
+ 'el-table--scrollable-x': _vm.layout.scrollX,
3594
+ 'el-table--scrollable-y': _vm.layout.scrollY,
3595
+ 'el-table--enable-row-hover': !_vm.store.states.isComplex,
3596
+ 'el-table--enable-row-transition': (_vm.store.states.data || []).length !== 0 && (_vm.store.states.data || []).length < 100
3597
+ }, _vm.tableSize ? ("el-table--" + _vm.tableSize) : ''],on:{"mouseleave":function($event){_vm.handleMouseLeave($event)}}},[_c('div',{ref:"hiddenColumns",staticClass:"hidden-columns"},[_vm._t("default")],2),(_vm.showHeader)?_c('div',{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:(_vm.handleHeaderFooterMousewheel),expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[_c('table-header',{ref:"tableHeader",style:({
3598
+ width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + 'px' : ''
3599
+ }),attrs:{"store":_vm.store,"border":_vm.border,"default-sort":_vm.defaultSort}})],1):_vm._e(),_c('div',{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[_vm.layout.scrollX ? ("is-scrolling-" + _vm.scrollPosition) : 'is-scrolling-none'],style:([_vm.bodyHeight])},[_c('table-body',{style:({
3600
+ width: _vm.bodyWidth
3601
+ }),attrs:{"context":_vm.context,"store":_vm.store,"stripe":_vm.stripe,"row-class-name":_vm.rowClassName,"row-style":_vm.rowStyle,"highlight":_vm.highlightCurrentRow}}),(!_vm.data || _vm.data.length === 0)?_c('div',{ref:"emptyBlock",staticClass:"el-table__empty-block",style:({
3602
+ width: _vm.bodyWidth
3603
+ })},[_c('span',{staticClass:"el-table__empty-text"},[_vm._t("empty",[_vm._v(_vm._s(_vm.emptyText || _vm.t('el.table.emptyText')))])],2)]):_vm._e(),(_vm.$slots.append)?_c('div',{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[_vm._t("append")],2):_vm._e()],1),(_vm.showSummary)?_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.data && _vm.data.length > 0),expression:"data && data.length > 0"},{name:"mousewheel",rawName:"v-mousewheel",value:(_vm.handleHeaderFooterMousewheel),expression:"handleHeaderFooterMousewheel"}],ref:"footerWrapper",staticClass:"el-table__footer-wrapper"},[_c('table-footer',{style:({
3604
+ width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + 'px' : ''
3605
+ }),attrs:{"store":_vm.store,"border":_vm.border,"sum-text":_vm.sumText || _vm.t('el.table.sumText'),"summary-method":_vm.summaryMethod,"default-sort":_vm.defaultSort}})],1):_vm._e(),(_vm.fixedColumns.length > 0)?_c('div',{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:(_vm.handleFixedMousewheel),expression:"handleFixedMousewheel"}],ref:"fixedWrapper",staticClass:"el-table__fixed",style:([{
3606
+ width: _vm.layout.fixedWidth ? _vm.layout.fixedWidth + 'px' : ''
3607
+ },
3608
+ _vm.fixedHeight])},[(_vm.showHeader)?_c('div',{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[_c('table-header',{ref:"fixedTableHeader",style:({
3609
+ width: _vm.bodyWidth
3610
+ }),attrs:{"fixed":"left","border":_vm.border,"store":_vm.store}})],1):_vm._e(),_c('div',{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:([{
3611
+ top: _vm.layout.headerHeight + 'px'
3612
+ },
3613
+ _vm.fixedBodyHeight])},[_c('table-body',{style:({
3614
+ width: _vm.bodyWidth
3615
+ }),attrs:{"fixed":"left","store":_vm.store,"stripe":_vm.stripe,"highlight":_vm.highlightCurrentRow,"row-class-name":_vm.rowClassName,"row-style":_vm.rowStyle}}),(_vm.$slots.append)?_c('div',{staticClass:"el-table__append-gutter",style:({
3616
+ height: _vm.layout.appendHeight + 'px'
3617
+ })}):_vm._e()],1),(_vm.showSummary)?_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.data && _vm.data.length > 0),expression:"data && data.length > 0"}],ref:"fixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[_c('table-footer',{style:({
3618
+ width: _vm.bodyWidth
3619
+ }),attrs:{"fixed":"left","border":_vm.border,"sum-text":_vm.sumText || _vm.t('el.table.sumText'),"summary-method":_vm.summaryMethod,"store":_vm.store}})],1):_vm._e()]):_vm._e(),(_vm.rightFixedColumns.length > 0)?_c('div',{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:(_vm.handleFixedMousewheel),expression:"handleFixedMousewheel"}],ref:"rightFixedWrapper",staticClass:"el-table__fixed-right",style:([{
3620
+ width: _vm.layout.rightFixedWidth ? _vm.layout.rightFixedWidth + 'px' : '',
3621
+ right: _vm.layout.scrollY ? (_vm.border ? _vm.layout.gutterWidth : (_vm.layout.gutterWidth || 0)) + 'px' : ''
3622
+ },
3623
+ _vm.fixedHeight])},[(_vm.showHeader)?_c('div',{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[_c('table-header',{ref:"rightFixedTableHeader",style:({
3624
+ width: _vm.bodyWidth
3625
+ }),attrs:{"fixed":"right","border":_vm.border,"store":_vm.store}})],1):_vm._e(),_c('div',{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:([{
3626
+ top: _vm.layout.headerHeight + 'px'
3627
+ },
3628
+ _vm.fixedBodyHeight])},[_c('table-body',{style:({
3629
+ width: _vm.bodyWidth
3630
+ }),attrs:{"fixed":"right","store":_vm.store,"stripe":_vm.stripe,"row-class-name":_vm.rowClassName,"row-style":_vm.rowStyle,"highlight":_vm.highlightCurrentRow}})],1),(_vm.showSummary)?_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.data && _vm.data.length > 0),expression:"data && data.length > 0"}],ref:"rightFixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[_c('table-footer',{style:({
3631
+ width: _vm.bodyWidth
3632
+ }),attrs:{"fixed":"right","border":_vm.border,"sum-text":_vm.sumText || _vm.t('el.table.sumText'),"summary-method":_vm.summaryMethod,"store":_vm.store}})],1):_vm._e()]):_vm._e(),(_vm.rightFixedColumns.length > 0)?_c('div',{ref:"rightFixedPatch",staticClass:"el-table__fixed-right-patch",style:({
3633
+ width: _vm.layout.scrollY ? _vm.layout.gutterWidth + 'px' : '0',
3634
+ height: _vm.layout.headerHeight + 'px'
3635
+ })}):_vm._e(),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.resizeProxyVisible),expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])}
3636
+ var staticRenderFns = []
3637
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
3638
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
3639
+
3640
+ /***/ }),
3641
+
3642
+ /***/ 18:
3643
+ /***/ (function(module, exports) {
3644
+
3645
+ module.exports = require("element-ui/lib/utils/resize-event");
3646
+
3647
+ /***/ }),
3648
+
3649
+ /***/ 2:
3650
+ /***/ (function(module, exports) {
3651
+
3652
+ module.exports = require("element-ui/lib/utils/util");
3653
+
3654
+ /***/ }),
3655
+
3656
+ /***/ 22:
3657
+ /***/ (function(module, exports) {
3658
+
3659
+ module.exports = require("element-ui/lib/tooltip");
3660
+
3661
+ /***/ }),
3662
+
3663
+ /***/ 25:
3664
+ /***/ (function(module, exports) {
3665
+
3666
+ module.exports = require("element-ui/lib/tag");
3667
+
3668
+ /***/ }),
3669
+
3670
+ /***/ 3:
3671
+ /***/ (function(module, exports) {
3672
+
3673
+ module.exports = require("element-ui/lib/utils/dom");
3674
+
3675
+ /***/ }),
3676
+
3677
+ /***/ 38:
3678
+ /***/ (function(module, exports) {
3679
+
3680
+ module.exports = require("element-ui/lib/utils/scrollbar-width");
3681
+
3682
+ /***/ }),
3683
+
3684
+ /***/ 39:
3685
+ /***/ (function(module, exports, __webpack_require__) {
3686
+
3687
+ "use strict";
3688
+
3689
+
3690
+ exports.__esModule = true;
3691
+ exports.default = {
3692
+ created: function created() {
3693
+ this.tableLayout.addObserver(this);
3694
+ },
3695
+ destroyed: function destroyed() {
3696
+ this.tableLayout.removeObserver(this);
3697
+ },
3698
+
3699
+
3700
+ computed: {
3701
+ tableLayout: function tableLayout() {
3702
+ var layout = this.layout;
3703
+ if (!layout && this.table) {
3704
+ layout = this.table.layout;
3705
+ }
3706
+ if (!layout) {
3707
+ throw new Error('Can not find table layout.');
3708
+ }
3709
+ return layout;
3710
+ }
3711
+ },
3712
+
3713
+ mounted: function mounted() {
3714
+ this.onColumnsChange(this.tableLayout);
3715
+ this.onScrollableChange(this.tableLayout);
3716
+ },
3717
+ updated: function updated() {
3718
+ if (this.__updated__) return;
3719
+ this.onColumnsChange(this.tableLayout);
3720
+ this.onScrollableChange(this.tableLayout);
3721
+ this.__updated__ = true;
3722
+ },
3723
+
3724
+
3725
+ methods: {
3726
+ onColumnsChange: function onColumnsChange() {
3727
+ var cols = this.$el.querySelectorAll('colgroup > col');
3728
+ if (!cols.length) return;
3729
+ var flattenColumns = this.tableLayout.getFlattenColumns();
3730
+ var columnsMap = {};
3731
+ flattenColumns.forEach(function (column) {
3732
+ columnsMap[column.id] = column;
3733
+ });
3734
+ for (var i = 0, j = cols.length; i < j; i++) {
3735
+ var col = cols[i];
3736
+ var name = col.getAttribute('name');
3737
+ var column = columnsMap[name];
3738
+ if (column) {
3739
+ col.setAttribute('width', column.realWidth || column.width);
3740
+ }
3741
+ }
3742
+ },
3743
+ onScrollableChange: function onScrollableChange(layout) {
3744
+ var cols = this.$el.querySelectorAll('colgroup > col[name=gutter]');
3745
+ for (var i = 0, j = cols.length; i < j; i++) {
3746
+ var col = cols[i];
3747
+ col.setAttribute('width', layout.scrollY ? layout.gutterWidth : '0');
3748
+ }
3749
+ var ths = this.$el.querySelectorAll('th.gutter');
3750
+ for (var _i = 0, _j = ths.length; _i < _j; _i++) {
3751
+ var th = ths[_i];
3752
+ th.style.width = layout.scrollY ? layout.gutterWidth + 'px' : '0';
3753
+ th.style.display = layout.scrollY ? '' : 'none';
3754
+ }
3755
+ }
3756
+ }
3757
+ };
3758
+
3759
+ /***/ }),
3760
+
3761
+ /***/ 4:
3762
+ /***/ (function(module, exports) {
3763
+
3764
+ module.exports = require("vue");
3765
+
3766
+ /***/ }),
3767
+
3768
+ /***/ 40:
3769
+ /***/ (function(module, exports) {
3770
+
3771
+ module.exports = require("element-ui/lib/checkbox-group");
3772
+
3773
+ /***/ }),
3774
+
3775
+ /***/ 48:
3776
+ /***/ (function(module, exports, __webpack_require__) {
3777
+
3778
+ "use strict";
3779
+
3780
+
3781
+ exports.__esModule = true;
3782
+ exports.getRowIdentity = exports.getColumnByCell = exports.getColumnByKey = exports.getColumnById = exports.orderBy = exports.getCell = undefined;
3783
+
3784
+ 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; };
3785
+
3786
+ var _util = __webpack_require__(2);
3787
+
3788
+ var getCell = exports.getCell = function getCell(event) {
3789
+ var cell = event.target;
3790
+
3791
+ while (cell && cell.tagName.toUpperCase() !== 'HTML') {
3792
+ if (cell.tagName.toUpperCase() === 'TD') {
3793
+ return cell;
3794
+ }
3795
+ cell = cell.parentNode;
3796
+ }
3797
+
3798
+ return null;
3799
+ };
3800
+
3801
+ var isObject = function isObject(obj) {
3802
+ return obj !== null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object';
3803
+ };
3804
+
3805
+ var orderBy = exports.orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
3806
+ if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
3807
+ return array;
3808
+ }
3809
+ if (typeof reverse === 'string') {
3810
+ reverse = reverse === 'descending' ? -1 : 1;
3811
+ } else {
3812
+ reverse = reverse && reverse < 0 ? -1 : 1;
3813
+ }
3814
+ var getKey = sortMethod ? null : function (value, index) {
3815
+ if (sortBy) {
3816
+ if (!Array.isArray(sortBy)) {
3817
+ sortBy = [sortBy];
3818
+ }
3819
+ return sortBy.map(function (by) {
3820
+ if (typeof by === 'string') {
3821
+ return (0, _util.getValueByPath)(value, by);
3822
+ } else {
3823
+ return by(value, index, array);
3824
+ }
3825
+ });
3826
+ }
3827
+ if (sortKey !== '$key') {
3828
+ if (isObject(value) && '$value' in value) value = value.$value;
3829
+ }
3830
+ return [isObject(value) ? (0, _util.getValueByPath)(value, sortKey) : value];
3831
+ };
3832
+ var compare = function compare(a, b) {
3833
+ if (sortMethod) {
3834
+ return sortMethod(a.value, b.value);
3835
+ }
3836
+ for (var i = 0, len = a.key.length; i < len; i++) {
3837
+ if (a.key[i] < b.key[i]) {
3838
+ return -1;
3839
+ }
3840
+ if (a.key[i] > b.key[i]) {
3841
+ return 1;
3842
+ }
3843
+ }
3844
+ return 0;
3845
+ };
3846
+ return array.map(function (value, index) {
3847
+ return {
3848
+ value: value,
3849
+ index: index,
3850
+ key: getKey ? getKey(value, index) : null
3851
+ };
3852
+ }).sort(function (a, b) {
3853
+ var order = compare(a, b);
3854
+ if (!order) {
3855
+ // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
3856
+ order = a.index - b.index;
3857
+ }
3858
+ return order * reverse;
3859
+ }).map(function (item) {
3860
+ return item.value;
3861
+ });
3862
+ };
3863
+
3864
+ var getColumnById = exports.getColumnById = function getColumnById(table, columnId) {
3865
+ var column = null;
3866
+ table.columns.forEach(function (item) {
3867
+ if (item.id === columnId) {
3868
+ column = item;
3869
+ }
3870
+ });
3871
+ return column;
3872
+ };
3873
+
3874
+ var getColumnByKey = exports.getColumnByKey = function getColumnByKey(table, columnKey) {
3875
+ var column = null;
3876
+ for (var i = 0; i < table.columns.length; i++) {
3877
+ var item = table.columns[i];
3878
+ if (item.columnKey === columnKey) {
3879
+ column = item;
3880
+ break;
3881
+ }
3882
+ }
3883
+ return column;
3884
+ };
3885
+
3886
+ var getColumnByCell = exports.getColumnByCell = function getColumnByCell(table, cell) {
3887
+ var matches = (cell.className || '').match(/el-table_[^\s]+/gm);
3888
+ if (matches) {
3889
+ return getColumnById(table, matches[0]);
3890
+ }
3891
+ return null;
3892
+ };
3893
+
3894
+ var getRowIdentity = exports.getRowIdentity = function getRowIdentity(row, rowKey) {
3895
+ if (!row) throw new Error('row is required when get row identity');
3896
+ if (typeof rowKey === 'string') {
3897
+ if (rowKey.indexOf('.') < 0) {
3898
+ return row[rowKey];
3899
+ }
3900
+ var key = rowKey.split('.');
3901
+ var current = row;
3902
+ for (var i = 0; i < key.length; i++) {
3903
+ current = current[key[i]];
3904
+ }
3905
+ return current;
3906
+ } else if (typeof rowKey === 'function') {
3907
+ return rowKey.call(null, row);
3908
+ }
3909
+ };
3910
+
3911
+ /***/ }),
3912
+
3913
+ /***/ 5:
3914
+ /***/ (function(module, exports) {
3915
+
3916
+ module.exports = require("element-ui/lib/mixins/locale");
3917
+
3918
+ /***/ }),
3919
+
3920
+ /***/ 7:
3921
+ /***/ (function(module, exports) {
3922
+
3923
+ module.exports = require("element-ui/lib/utils/vue-popper");
3924
+
3925
+ /***/ }),
3926
+
3927
+ /***/ 8:
3928
+ /***/ (function(module, exports) {
3929
+
3930
+ module.exports = require("element-ui/lib/mixins/migrating");
3931
+
3932
+ /***/ }),
3933
+
3934
+ /***/ 9:
3935
+ /***/ (function(module, exports) {
3936
+
3937
+ module.exports = require("element-ui/lib/utils/merge");
3938
+
3939
+ /***/ })
3940
+
3941
+ /******/ });