nd-autosize-elementui 2.15.15 → 2.15.17

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 (632) hide show
  1. package/lib/autocomplete.js +16 -16
  2. package/lib/calendar.js +10 -10
  3. package/lib/carousel-item.js +2 -2
  4. package/lib/carousel.js +2 -2
  5. package/lib/cascader-panel.js +18 -18
  6. package/lib/cascader.js +30 -30
  7. package/lib/checkbox-button.js +2 -2
  8. package/lib/checkbox-group.js +2 -2
  9. package/lib/checkbox.js +2 -2
  10. package/lib/collapse-item.js +6 -6
  11. package/lib/color-picker.js +12 -12
  12. package/lib/date-picker.js +28 -28
  13. package/lib/descriptions.js +2 -2
  14. package/lib/dialog.js +6 -6
  15. package/lib/directives/repeat-click.js +2 -2
  16. package/lib/drawer.js +4 -4
  17. package/lib/dropdown-item.js +2 -2
  18. package/lib/dropdown-menu.js +2 -2
  19. package/lib/dropdown.js +12 -12
  20. package/lib/element-ui.common.js +78 -78
  21. package/lib/empty.js +2 -2
  22. package/lib/form-item.js +6 -6
  23. package/lib/form.js +2 -2
  24. package/lib/image.js +10 -10
  25. package/lib/infinite-scroll.js +4 -4
  26. package/lib/input-number.js +6 -6
  27. package/lib/input.js +8 -8
  28. package/lib/loading.js +8 -8
  29. package/lib/locale/format.js +1 -1
  30. package/lib/locale/index.js +1 -1
  31. package/lib/menu-item.js +4 -4
  32. package/lib/menu.js +6 -6
  33. package/lib/message-box.js +18 -18
  34. package/lib/message.js +6 -6
  35. package/lib/mixins/locale.js +1 -1
  36. package/lib/mixins/migrating.js +2 -2
  37. package/lib/notification.js +6 -6
  38. package/lib/option-group.js +2 -2
  39. package/lib/option.js +4 -4
  40. package/lib/page-header.js +2 -2
  41. package/lib/pagination.js +10 -10
  42. package/lib/popconfirm.js +6 -6
  43. package/lib/popover.js +6 -6
  44. package/lib/radio-button.js +2 -2
  45. package/lib/radio-group.js +2 -2
  46. package/lib/radio.js +2 -2
  47. package/lib/rate.js +6 -6
  48. package/lib/scrollbar.js +8 -8
  49. package/lib/select.js +26 -26
  50. package/lib/slider.js +6 -6
  51. package/lib/statistic.js +2 -2
  52. package/lib/steps.js +2 -2
  53. package/lib/submenu.js +6 -6
  54. package/lib/switch.js +6 -6
  55. package/lib/table-column.js +4 -4
  56. package/lib/table.js +28 -28
  57. package/lib/tabs.js +4 -4
  58. package/lib/time-picker.js +22 -22
  59. package/lib/time-select.js +16 -16
  60. package/lib/tooltip.js +6 -6
  61. package/lib/transfer.js +14 -14
  62. package/lib/transitions/collapse-transition.js +1 -1
  63. package/lib/tree.js +14 -14
  64. package/lib/upload.js +6 -6
  65. package/lib/utils/clickoutside.js +1 -1
  66. package/lib/utils/date-util.js +2 -2
  67. package/lib/utils/popup/index.js +2 -2
  68. package/lib/utils/popup/popup-manager.js +1 -1
  69. package/lib/utils/util.js +1 -1
  70. package/lib/utils/vdom.js +1 -1
  71. package/lib/utils/vue-popper.js +1 -1
  72. package/package.json +2 -147
  73. package/LICENSE +0 -21
  74. package/README.md +0 -148
  75. package/packages/alert/index.js +0 -8
  76. package/packages/alert/src/main.vue +0 -94
  77. package/packages/aside/index.js +0 -8
  78. package/packages/aside/src/main.vue +0 -20
  79. package/packages/autocomplete/index.js +0 -8
  80. package/packages/autocomplete/src/autocomplete-suggestions.vue +0 -76
  81. package/packages/autocomplete/src/autocomplete.vue +0 -285
  82. package/packages/avatar/index.js +0 -8
  83. package/packages/avatar/src/main.vue +0 -107
  84. package/packages/backtop/index.js +0 -8
  85. package/packages/backtop/src/main.vue +0 -110
  86. package/packages/badge/index.js +0 -8
  87. package/packages/badge/src/main.vue +0 -53
  88. package/packages/breadcrumb/index.js +0 -8
  89. package/packages/breadcrumb/src/breadcrumb-item.vue +0 -41
  90. package/packages/breadcrumb/src/breadcrumb.vue +0 -34
  91. package/packages/breadcrumb-item/index.js +0 -8
  92. package/packages/button/index.js +0 -8
  93. package/packages/button/src/button-group.vue +0 -10
  94. package/packages/button/src/button.vue +0 -78
  95. package/packages/button-group/index.js +0 -8
  96. package/packages/calendar/index.js +0 -8
  97. package/packages/calendar/src/date-table.vue +0 -200
  98. package/packages/calendar/src/main.vue +0 -280
  99. package/packages/card/index.js +0 -8
  100. package/packages/card/src/main.vue +0 -23
  101. package/packages/carousel/index.js +0 -8
  102. package/packages/carousel/src/item.vue +0 -138
  103. package/packages/carousel/src/main.vue +0 -315
  104. package/packages/carousel-item/index.js +0 -8
  105. package/packages/cascader/index.js +0 -8
  106. package/packages/cascader/src/cascader.vue +0 -663
  107. package/packages/cascader-panel/index.js +0 -8
  108. package/packages/cascader-panel/src/cascader-menu.vue +0 -138
  109. package/packages/cascader-panel/src/cascader-node.vue +0 -246
  110. package/packages/cascader-panel/src/cascader-panel.vue +0 -391
  111. package/packages/cascader-panel/src/node.js +0 -166
  112. package/packages/cascader-panel/src/store.js +0 -58
  113. package/packages/checkbox/index.js +0 -8
  114. package/packages/checkbox/src/checkbox-button.vue +0 -199
  115. package/packages/checkbox/src/checkbox-group.vue +0 -48
  116. package/packages/checkbox/src/checkbox.vue +0 -222
  117. package/packages/checkbox-button/index.js +0 -8
  118. package/packages/checkbox-group/index.js +0 -8
  119. package/packages/col/index.js +0 -9
  120. package/packages/col/src/col.js +0 -71
  121. package/packages/collapse/index.js +0 -9
  122. package/packages/collapse/src/collapse-item.vue +0 -114
  123. package/packages/collapse/src/collapse.vue +0 -73
  124. package/packages/collapse-item/index.js +0 -8
  125. package/packages/color-picker/index.js +0 -8
  126. package/packages/color-picker/src/color.js +0 -317
  127. package/packages/color-picker/src/components/alpha-slider.vue +0 -132
  128. package/packages/color-picker/src/components/hue-slider.vue +0 -123
  129. package/packages/color-picker/src/components/picker-dropdown.vue +0 -121
  130. package/packages/color-picker/src/components/predefine.vue +0 -61
  131. package/packages/color-picker/src/components/sv-panel.vue +0 -100
  132. package/packages/color-picker/src/draggable.js +0 -36
  133. package/packages/color-picker/src/main.vue +0 -188
  134. package/packages/container/index.js +0 -8
  135. package/packages/container/src/main.vue +0 -33
  136. package/packages/date-picker/index.js +0 -8
  137. package/packages/date-picker/src/basic/date-table.vue +0 -441
  138. package/packages/date-picker/src/basic/month-table.vue +0 -269
  139. package/packages/date-picker/src/basic/time-spinner.vue +0 -304
  140. package/packages/date-picker/src/basic/year-table.vue +0 -111
  141. package/packages/date-picker/src/panel/date-range.vue +0 -680
  142. package/packages/date-picker/src/panel/date.vue +0 -609
  143. package/packages/date-picker/src/panel/month-range.vue +0 -289
  144. package/packages/date-picker/src/panel/time-range.vue +0 -248
  145. package/packages/date-picker/src/panel/time-select.vue +0 -178
  146. package/packages/date-picker/src/panel/time.vue +0 -186
  147. package/packages/date-picker/src/picker/date-picker.js +0 -43
  148. package/packages/date-picker/src/picker/time-picker.js +0 -39
  149. package/packages/date-picker/src/picker/time-select.js +0 -21
  150. package/packages/date-picker/src/picker.vue +0 -956
  151. package/packages/descriptions/index.js +0 -8
  152. package/packages/descriptions/src/descriptions-item.js +0 -30
  153. package/packages/descriptions/src/descriptions-row.js +0 -116
  154. package/packages/descriptions/src/index.js +0 -180
  155. package/packages/descriptions-item/index.js +0 -8
  156. package/packages/dialog/index.js +0 -8
  157. package/packages/dialog/src/component.vue +0 -212
  158. package/packages/divider/index.js +0 -8
  159. package/packages/divider/src/main.vue +0 -37
  160. package/packages/drawer/index.js +0 -8
  161. package/packages/drawer/src/main.vue +0 -205
  162. package/packages/dropdown/index.js +0 -8
  163. package/packages/dropdown/src/dropdown-item.vue +0 -37
  164. package/packages/dropdown/src/dropdown-menu.vue +0 -63
  165. package/packages/dropdown/src/dropdown.vue +0 -293
  166. package/packages/dropdown-item/index.js +0 -8
  167. package/packages/dropdown-menu/index.js +0 -8
  168. package/packages/empty/index.js +0 -7
  169. package/packages/empty/src/img-empty.vue +0 -132
  170. package/packages/empty/src/index.vue +0 -50
  171. package/packages/footer/index.js +0 -8
  172. package/packages/footer/src/main.vue +0 -20
  173. package/packages/form/index.js +0 -8
  174. package/packages/form/src/form-item.vue +0 -324
  175. package/packages/form/src/form.vue +0 -182
  176. package/packages/form/src/label-wrap.vue +0 -78
  177. package/packages/form-item/index.js +0 -8
  178. package/packages/header/index.js +0 -8
  179. package/packages/header/src/main.vue +0 -20
  180. package/packages/icon/index.js +0 -8
  181. package/packages/icon/src/icon.vue +0 -13
  182. package/packages/image/index.js +0 -8
  183. package/packages/image/src/image-viewer.vue +0 -330
  184. package/packages/image/src/main.vue +0 -249
  185. package/packages/infinite-scroll/index.js +0 -8
  186. package/packages/infinite-scroll/src/main.js +0 -150
  187. package/packages/input/index.js +0 -8
  188. package/packages/input/src/calcTextareaHeight.js +0 -104
  189. package/packages/input/src/input.vue +0 -440
  190. package/packages/input-number/index.js +0 -8
  191. package/packages/input-number/src/input-number.vue +0 -283
  192. package/packages/link/index.js +0 -8
  193. package/packages/link/src/main.vue +0 -53
  194. package/packages/loading/index.js +0 -11
  195. package/packages/loading/src/directive.js +0 -133
  196. package/packages/loading/src/index.js +0 -106
  197. package/packages/loading/src/loading.vue +0 -41
  198. package/packages/main/index.js +0 -8
  199. package/packages/main/src/main.vue +0 -12
  200. package/packages/menu/index.js +0 -8
  201. package/packages/menu/src/menu-item-group.vue +0 -45
  202. package/packages/menu/src/menu-item.vue +0 -112
  203. package/packages/menu/src/menu-mixin.js +0 -44
  204. package/packages/menu/src/menu.vue +0 -325
  205. package/packages/menu/src/submenu.vue +0 -349
  206. package/packages/menu-item/index.js +0 -8
  207. package/packages/menu-item-group/index.js +0 -8
  208. package/packages/message/index.js +0 -2
  209. package/packages/message/src/main.js +0 -91
  210. package/packages/message/src/main.vue +0 -117
  211. package/packages/message-box/index.js +0 -2
  212. package/packages/message-box/src/main.js +0 -216
  213. package/packages/message-box/src/main.vue +0 -332
  214. package/packages/notification/index.js +0 -2
  215. package/packages/notification/src/main.js +0 -94
  216. package/packages/notification/src/main.vue +0 -152
  217. package/packages/option/index.js +0 -8
  218. package/packages/option-group/index.js +0 -8
  219. package/packages/page-header/index.js +0 -8
  220. package/packages/page-header/src/main.vue +0 -30
  221. package/packages/pagination/index.js +0 -8
  222. package/packages/pagination/src/pager.vue +0 -163
  223. package/packages/pagination/src/pagination.js +0 -386
  224. package/packages/popconfirm/index.js +0 -8
  225. package/packages/popconfirm/src/main.vue +0 -104
  226. package/packages/popover/index.js +0 -14
  227. package/packages/popover/src/directive.js +0 -20
  228. package/packages/popover/src/main.vue +0 -237
  229. package/packages/progress/index.js +0 -8
  230. package/packages/progress/src/progress.vue +0 -235
  231. package/packages/radio/index.js +0 -8
  232. package/packages/radio/src/radio-button.vue +0 -115
  233. package/packages/radio/src/radio-group.vue +0 -113
  234. package/packages/radio/src/radio.vue +0 -134
  235. package/packages/radio-button/index.js +0 -8
  236. package/packages/radio-group/index.js +0 -8
  237. package/packages/rate/index.js +0 -8
  238. package/packages/rate/src/main.vue +0 -348
  239. package/packages/result/index.js +0 -8
  240. package/packages/result/src/icon-error.vue +0 -13
  241. package/packages/result/src/icon-info.vue +0 -13
  242. package/packages/result/src/icon-success.vue +0 -13
  243. package/packages/result/src/icon-warning.vue +0 -13
  244. package/packages/result/src/index.vue +0 -65
  245. package/packages/row/index.js +0 -9
  246. package/packages/row/src/row.js +0 -44
  247. package/packages/scrollbar/index.js +0 -8
  248. package/packages/scrollbar/src/bar.js +0 -92
  249. package/packages/scrollbar/src/main.js +0 -130
  250. package/packages/scrollbar/src/util.js +0 -34
  251. package/packages/select/index.js +0 -8
  252. package/packages/select/src/navigation-mixin.js +0 -54
  253. package/packages/select/src/option-group.vue +0 -60
  254. package/packages/select/src/option.vue +0 -168
  255. package/packages/select/src/select-dropdown.vue +0 -74
  256. package/packages/select/src/select.vue +0 -900
  257. package/packages/skeleton/index.js +0 -8
  258. package/packages/skeleton/src/img-placeholder.vue +0 -16
  259. package/packages/skeleton/src/index.vue +0 -76
  260. package/packages/skeleton/src/item.vue +0 -22
  261. package/packages/skeleton-item/index.js +0 -8
  262. package/packages/slider/index.js +0 -8
  263. package/packages/slider/src/button.vue +0 -238
  264. package/packages/slider/src/main.vue +0 -427
  265. package/packages/slider/src/marker.js +0 -18
  266. package/packages/spinner/index.js +0 -8
  267. package/packages/spinner/src/spinner.vue +0 -27
  268. package/packages/statistic/index.js +0 -8
  269. package/packages/statistic/src/main.vue +0 -204
  270. package/packages/step/index.js +0 -8
  271. package/packages/steps/README.md +0 -69
  272. package/packages/steps/index.js +0 -8
  273. package/packages/steps/src/step.vue +0 -184
  274. package/packages/steps/src/steps.vue +0 -68
  275. package/packages/submenu/index.js +0 -8
  276. package/packages/switch/index.js +0 -9
  277. package/packages/switch/src/component.vue +0 -174
  278. package/packages/tab-pane/index.js +0 -8
  279. package/packages/table/index.js +0 -8
  280. package/packages/table/src/config.js +0 -124
  281. package/packages/table/src/dropdown.js +0 -28
  282. package/packages/table/src/filter-panel.vue +0 -194
  283. package/packages/table/src/layout-observer.js +0 -68
  284. package/packages/table/src/store/current.js +0 -76
  285. package/packages/table/src/store/expand.js +0 -65
  286. package/packages/table/src/store/helper.js +0 -41
  287. package/packages/table/src/store/index.js +0 -147
  288. package/packages/table/src/store/tree.js +0 -209
  289. package/packages/table/src/store/watcher.js +0 -381
  290. package/packages/table/src/table-body.js +0 -469
  291. package/packages/table/src/table-column.js +0 -319
  292. package/packages/table/src/table-footer.js +0 -153
  293. package/packages/table/src/table-header.js +0 -511
  294. package/packages/table/src/table-layout.js +0 -249
  295. package/packages/table/src/table-row.js +0 -101
  296. package/packages/table/src/table.vue +0 -712
  297. package/packages/table/src/util.js +0 -273
  298. package/packages/table-column/index.js +0 -8
  299. package/packages/tabs/index.js +0 -8
  300. package/packages/tabs/src/tab-bar.vue +0 -57
  301. package/packages/tabs/src/tab-nav.vue +0 -294
  302. package/packages/tabs/src/tab-pane.vue +0 -56
  303. package/packages/tabs/src/tabs.vue +0 -191
  304. package/packages/tag/index.js +0 -8
  305. package/packages/tag/src/tag.vue +0 -58
  306. package/packages/theme-chalk/README.md +0 -33
  307. package/packages/theme-chalk/gulpfile.js +0 -25
  308. package/packages/theme-chalk/package.json +0 -35
  309. package/packages/theme-chalk/src/alert.scss +0 -147
  310. package/packages/theme-chalk/src/aside.scss +0 -7
  311. package/packages/theme-chalk/src/autocomplete.scss +0 -80
  312. package/packages/theme-chalk/src/avatar.scss +0 -51
  313. package/packages/theme-chalk/src/backtop.scss +0 -22
  314. package/packages/theme-chalk/src/badge.scss +0 -57
  315. package/packages/theme-chalk/src/base.scss +0 -2
  316. package/packages/theme-chalk/src/breadcrumb-item.scss +0 -0
  317. package/packages/theme-chalk/src/breadcrumb.scss +0 -55
  318. package/packages/theme-chalk/src/button-group.scss +0 -0
  319. package/packages/theme-chalk/src/button.scss +0 -262
  320. package/packages/theme-chalk/src/calendar.scss +0 -79
  321. package/packages/theme-chalk/src/card.scss +0 -32
  322. package/packages/theme-chalk/src/carousel-item.scss +0 -50
  323. package/packages/theme-chalk/src/carousel.scss +0 -161
  324. package/packages/theme-chalk/src/cascader-panel.scss +0 -120
  325. package/packages/theme-chalk/src/cascader.scss +0 -182
  326. package/packages/theme-chalk/src/checkbox-button.scss +0 -0
  327. package/packages/theme-chalk/src/checkbox-group.scss +0 -0
  328. package/packages/theme-chalk/src/checkbox.scss +0 -359
  329. package/packages/theme-chalk/src/col.scss +0 -156
  330. package/packages/theme-chalk/src/collapse-item.scss +0 -0
  331. package/packages/theme-chalk/src/collapse.scss +0 -63
  332. package/packages/theme-chalk/src/color-picker.scss +0 -384
  333. package/packages/theme-chalk/src/common/popup.scss +0 -42
  334. package/packages/theme-chalk/src/common/transition.scss +0 -99
  335. package/packages/theme-chalk/src/common/var.scss +0 -1028
  336. package/packages/theme-chalk/src/container.scss +0 -14
  337. package/packages/theme-chalk/src/date-picker/date-picker.scss +0 -97
  338. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +0 -101
  339. package/packages/theme-chalk/src/date-picker/date-table.scss +0 -151
  340. package/packages/theme-chalk/src/date-picker/month-table.scss +0 -82
  341. package/packages/theme-chalk/src/date-picker/picker-panel.scss +0 -117
  342. package/packages/theme-chalk/src/date-picker/picker.scss +0 -197
  343. package/packages/theme-chalk/src/date-picker/time-picker.scss +0 -85
  344. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +0 -31
  345. package/packages/theme-chalk/src/date-picker/time-spinner.scss +0 -110
  346. package/packages/theme-chalk/src/date-picker/year-table.scss +0 -51
  347. package/packages/theme-chalk/src/date-picker.scss +0 -12
  348. package/packages/theme-chalk/src/descriptions-item.scss +0 -42
  349. package/packages/theme-chalk/src/descriptions.scss +0 -111
  350. package/packages/theme-chalk/src/dialog.scss +0 -123
  351. package/packages/theme-chalk/src/display.scss +0 -12
  352. package/packages/theme-chalk/src/divider.scss +0 -47
  353. package/packages/theme-chalk/src/drawer.scss +0 -219
  354. package/packages/theme-chalk/src/dropdown-item.scss +0 -0
  355. package/packages/theme-chalk/src/dropdown-menu.scss +0 -0
  356. package/packages/theme-chalk/src/dropdown.scss +0 -182
  357. package/packages/theme-chalk/src/empty.scss +0 -45
  358. package/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
  359. package/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
  360. package/packages/theme-chalk/src/footer.scss +0 -8
  361. package/packages/theme-chalk/src/form-item.scss +0 -0
  362. package/packages/theme-chalk/src/form.scss +0 -167
  363. package/packages/theme-chalk/src/header.scss +0 -8
  364. package/packages/theme-chalk/src/icon.scss +0 -1167
  365. package/packages/theme-chalk/src/image.scss +0 -179
  366. package/packages/theme-chalk/src/index.scss +0 -87
  367. package/packages/theme-chalk/src/infinite-scroll.scss +0 -0
  368. package/packages/theme-chalk/src/infiniteScroll.scss +0 -0
  369. package/packages/theme-chalk/src/input-number.scss +0 -180
  370. package/packages/theme-chalk/src/input.scss +0 -360
  371. package/packages/theme-chalk/src/link.scss +0 -81
  372. package/packages/theme-chalk/src/loading.scss +0 -96
  373. package/packages/theme-chalk/src/main.scss +0 -12
  374. package/packages/theme-chalk/src/menu-item-group.scss +0 -0
  375. package/packages/theme-chalk/src/menu-item.scss +0 -0
  376. package/packages/theme-chalk/src/menu.scss +0 -289
  377. package/packages/theme-chalk/src/message-box.scss +0 -226
  378. package/packages/theme-chalk/src/message.scss +0 -120
  379. package/packages/theme-chalk/src/mixins/_button.scss +0 -81
  380. package/packages/theme-chalk/src/mixins/config.scss +0 -4
  381. package/packages/theme-chalk/src/mixins/function.scss +0 -44
  382. package/packages/theme-chalk/src/mixins/mixins.scss +0 -190
  383. package/packages/theme-chalk/src/mixins/utils.scss +0 -39
  384. package/packages/theme-chalk/src/notification.scss +0 -99
  385. package/packages/theme-chalk/src/option-group.scss +0 -42
  386. package/packages/theme-chalk/src/option.scss +0 -36
  387. package/packages/theme-chalk/src/page-header.scss +0 -41
  388. package/packages/theme-chalk/src/pagination.scss +0 -295
  389. package/packages/theme-chalk/src/popconfirm.scss +0 -16
  390. package/packages/theme-chalk/src/popover.scss +0 -40
  391. package/packages/theme-chalk/src/popper.scss +0 -101
  392. package/packages/theme-chalk/src/progress.scss +0 -141
  393. package/packages/theme-chalk/src/radio-button.scss +0 -113
  394. package/packages/theme-chalk/src/radio-group.scss +0 -9
  395. package/packages/theme-chalk/src/radio.scss +0 -199
  396. package/packages/theme-chalk/src/rate.scss +0 -49
  397. package/packages/theme-chalk/src/reset.scss +0 -79
  398. package/packages/theme-chalk/src/result.scss +0 -61
  399. package/packages/theme-chalk/src/row.scss +0 -43
  400. package/packages/theme-chalk/src/scrollbar.scss +0 -72
  401. package/packages/theme-chalk/src/select-dropdown.scss +0 -62
  402. package/packages/theme-chalk/src/select.scss +0 -152
  403. package/packages/theme-chalk/src/skeleton-item.scss +0 -84
  404. package/packages/theme-chalk/src/skeleton.scss +0 -40
  405. package/packages/theme-chalk/src/slider.scss +0 -250
  406. package/packages/theme-chalk/src/spinner.scss +0 -44
  407. package/packages/theme-chalk/src/statistic.scss +0 -38
  408. package/packages/theme-chalk/src/step.scss +0 -317
  409. package/packages/theme-chalk/src/steps.scss +0 -20
  410. package/packages/theme-chalk/src/submenu.scss +0 -0
  411. package/packages/theme-chalk/src/switch.scss +0 -116
  412. package/packages/theme-chalk/src/tab-pane.scss +0 -0
  413. package/packages/theme-chalk/src/table-column.scss +0 -97
  414. package/packages/theme-chalk/src/table.scss +0 -564
  415. package/packages/theme-chalk/src/tabs.scss +0 -602
  416. package/packages/theme-chalk/src/tag.scss +0 -163
  417. package/packages/theme-chalk/src/time-picker.scss +0 -8
  418. package/packages/theme-chalk/src/time-select.scss +0 -37
  419. package/packages/theme-chalk/src/timeline-item.scss +0 -86
  420. package/packages/theme-chalk/src/timeline.scss +0 -14
  421. package/packages/theme-chalk/src/tooltip.scss +0 -141
  422. package/packages/theme-chalk/src/transfer.scss +0 -227
  423. package/packages/theme-chalk/src/tree.scss +0 -123
  424. package/packages/theme-chalk/src/upload.scss +0 -603
  425. package/packages/time-picker/index.js +0 -8
  426. package/packages/time-select/index.js +0 -8
  427. package/packages/timeline/index.js +0 -8
  428. package/packages/timeline/src/item.vue +0 -73
  429. package/packages/timeline/src/main.vue +0 -33
  430. package/packages/timeline-item/index.js +0 -8
  431. package/packages/tooltip/index.js +0 -8
  432. package/packages/tooltip/src/main.js +0 -257
  433. package/packages/transfer/index.js +0 -8
  434. package/packages/transfer/src/main.vue +0 -231
  435. package/packages/transfer/src/transfer-panel.vue +0 -251
  436. package/packages/tree/index.js +0 -8
  437. package/packages/tree/src/model/node.js +0 -484
  438. package/packages/tree/src/model/tree-store.js +0 -340
  439. package/packages/tree/src/model/util.js +0 -27
  440. package/packages/tree/src/tree-node.vue +0 -279
  441. package/packages/tree/src/tree.vue +0 -496
  442. package/packages/upload/index.js +0 -8
  443. package/packages/upload/src/ajax.js +0 -85
  444. package/packages/upload/src/index.vue +0 -338
  445. package/packages/upload/src/upload-dragger.vue +0 -70
  446. package/packages/upload/src/upload-list.vue +0 -105
  447. package/packages/upload/src/upload.vue +0 -211
  448. package/src/directives/mousewheel.js +0 -18
  449. package/src/directives/repeat-click.js +0 -26
  450. package/src/index.js +0 -309
  451. package/src/locale/format.js +0 -46
  452. package/src/locale/index.js +0 -48
  453. package/src/locale/lang/af-ZA.js +0 -123
  454. package/src/locale/lang/ar.js +0 -122
  455. package/src/locale/lang/az.js +0 -126
  456. package/src/locale/lang/bg.js +0 -123
  457. package/src/locale/lang/bn.js +0 -126
  458. package/src/locale/lang/ca.js +0 -122
  459. package/src/locale/lang/cs-CZ.js +0 -125
  460. package/src/locale/lang/da.js +0 -122
  461. package/src/locale/lang/de.js +0 -124
  462. package/src/locale/lang/ee.js +0 -123
  463. package/src/locale/lang/el.js +0 -123
  464. package/src/locale/lang/en.js +0 -123
  465. package/src/locale/lang/eo.js +0 -123
  466. package/src/locale/lang/es.js +0 -122
  467. package/src/locale/lang/eu.js +0 -123
  468. package/src/locale/lang/fa.js +0 -123
  469. package/src/locale/lang/fi.js +0 -123
  470. package/src/locale/lang/fr.js +0 -122
  471. package/src/locale/lang/he.js +0 -123
  472. package/src/locale/lang/hr.js +0 -123
  473. package/src/locale/lang/hu.js +0 -122
  474. package/src/locale/lang/hy-AM.js +0 -123
  475. package/src/locale/lang/id.js +0 -123
  476. package/src/locale/lang/is.js +0 -124
  477. package/src/locale/lang/it.js +0 -122
  478. package/src/locale/lang/ja.js +0 -123
  479. package/src/locale/lang/kg.js +0 -123
  480. package/src/locale/lang/km.js +0 -123
  481. package/src/locale/lang/ko.js +0 -123
  482. package/src/locale/lang/ku.js +0 -123
  483. package/src/locale/lang/kz.js +0 -123
  484. package/src/locale/lang/lo-LA.js +0 -126
  485. package/src/locale/lang/lt.js +0 -123
  486. package/src/locale/lang/lv.js +0 -123
  487. package/src/locale/lang/mn.js +0 -123
  488. package/src/locale/lang/ms.js +0 -122
  489. package/src/locale/lang/nb-NO.js +0 -122
  490. package/src/locale/lang/nl.js +0 -123
  491. package/src/locale/lang/pl.js +0 -123
  492. package/src/locale/lang/pt-br.js +0 -123
  493. package/src/locale/lang/pt.js +0 -123
  494. package/src/locale/lang/ro.js +0 -123
  495. package/src/locale/lang/ru-RU.js +0 -123
  496. package/src/locale/lang/si.js +0 -123
  497. package/src/locale/lang/sk.js +0 -125
  498. package/src/locale/lang/sl.js +0 -123
  499. package/src/locale/lang/sr-Latn.js +0 -123
  500. package/src/locale/lang/sr.js +0 -123
  501. package/src/locale/lang/sv-SE.js +0 -123
  502. package/src/locale/lang/sw.js +0 -123
  503. package/src/locale/lang/ta.js +0 -122
  504. package/src/locale/lang/th.js +0 -123
  505. package/src/locale/lang/tk.js +0 -123
  506. package/src/locale/lang/tr-TR.js +0 -123
  507. package/src/locale/lang/ua.js +0 -123
  508. package/src/locale/lang/ug-CN.js +0 -123
  509. package/src/locale/lang/uz-UZ.js +0 -123
  510. package/src/locale/lang/vi.js +0 -123
  511. package/src/locale/lang/zh-CN.js +0 -123
  512. package/src/locale/lang/zh-TW.js +0 -123
  513. package/src/mixins/emitter.js +0 -33
  514. package/src/mixins/focus.js +0 -9
  515. package/src/mixins/locale.js +0 -9
  516. package/src/mixins/migrating.js +0 -54
  517. package/src/transitions/collapse-transition.js +0 -77
  518. package/src/utils/after-leave.js +0 -27
  519. package/src/utils/aria-dialog.js +0 -90
  520. package/src/utils/aria-utils.js +0 -122
  521. package/src/utils/clickoutside.js +0 -76
  522. package/src/utils/date-util.js +0 -282
  523. package/src/utils/date.js +0 -368
  524. package/src/utils/dom.js +0 -227
  525. package/src/utils/lodash.js +0 -18075
  526. package/src/utils/menu/aria-menubar.js +0 -14
  527. package/src/utils/menu/aria-menuitem.js +0 -49
  528. package/src/utils/menu/aria-submenu.js +0 -59
  529. package/src/utils/merge.js +0 -15
  530. package/src/utils/popper.js +0 -1276
  531. package/src/utils/popup/index.js +0 -218
  532. package/src/utils/popup/popup-manager.js +0 -194
  533. package/src/utils/resize-event.js +0 -36
  534. package/src/utils/scroll-into-view.js +0 -27
  535. package/src/utils/scrollbar-width.js +0 -29
  536. package/src/utils/shared.js +0 -7
  537. package/src/utils/types.js +0 -40
  538. package/src/utils/util.js +0 -245
  539. package/src/utils/vdom.js +0 -5
  540. package/src/utils/vue-popper.js +0 -218
  541. package/types/alert.d.ts +0 -31
  542. package/types/aside.d.ts +0 -7
  543. package/types/autocomplete.d.ts +0 -78
  544. package/types/avatar.d.ts +0 -20
  545. package/types/backtop.d.ts +0 -16
  546. package/types/badge.d.ts +0 -16
  547. package/types/breadcrumb-item.d.ts +0 -10
  548. package/types/breadcrumb.d.ts +0 -10
  549. package/types/button-group.d.ts +0 -4
  550. package/types/button.d.ts +0 -37
  551. package/types/calendar.d.ts +0 -15
  552. package/types/card.d.ts +0 -26
  553. package/types/carousel-item.d.ts +0 -10
  554. package/types/carousel.d.ts +0 -57
  555. package/types/cascader-panel.d.ts +0 -72
  556. package/types/cascader.d.ts +0 -65
  557. package/types/checkbox-button.d.ts +0 -22
  558. package/types/checkbox-group.d.ts +0 -22
  559. package/types/checkbox.d.ts +0 -34
  560. package/types/col.d.ts +0 -46
  561. package/types/collapse-item.d.ts +0 -26
  562. package/types/collapse.d.ts +0 -10
  563. package/types/color-picker.d.ts +0 -21
  564. package/types/component.d.ts +0 -13
  565. package/types/container.d.ts +0 -7
  566. package/types/date-picker.d.ts +0 -124
  567. package/types/descriptions-item.d.ts +0 -37
  568. package/types/descriptions.d.ts +0 -52
  569. package/types/dialog.d.ts +0 -62
  570. package/types/divider.d.ts +0 -12
  571. package/types/drawer.d.ts +0 -63
  572. package/types/dropdown-item.d.ts +0 -16
  573. package/types/dropdown-menu.d.ts +0 -4
  574. package/types/dropdown.d.ts +0 -38
  575. package/types/element-ui.d.ts +0 -382
  576. package/types/empty.d.ts +0 -31
  577. package/types/footer.d.ts +0 -7
  578. package/types/form-item.d.ts +0 -37
  579. package/types/form.d.ts +0 -82
  580. package/types/header.d.ts +0 -7
  581. package/types/icon.d.ts +0 -7
  582. package/types/image.d.ts +0 -43
  583. package/types/index.d.ts +0 -4
  584. package/types/infinite-scroll.d.ts +0 -6
  585. package/types/input-number.d.ts +0 -47
  586. package/types/input.d.ts +0 -107
  587. package/types/link.d.ts +0 -25
  588. package/types/loading.d.ts +0 -62
  589. package/types/main.d.ts +0 -4
  590. package/types/menu-item-group.d.ts +0 -7
  591. package/types/menu-item.d.ts +0 -10
  592. package/types/menu.d.ts +0 -46
  593. package/types/message-box.d.ts +0 -176
  594. package/types/message.d.ts +0 -90
  595. package/types/notification.d.ts +0 -84
  596. package/types/option-group.d.ts +0 -10
  597. package/types/option.d.ts +0 -13
  598. package/types/page-header.d.ts +0 -10
  599. package/types/pagination.d.ts +0 -43
  600. package/types/popconfirm.d.ts +0 -29
  601. package/types/popover.d.ts +0 -71
  602. package/types/progress.d.ts +0 -37
  603. package/types/radio-button.d.ts +0 -16
  604. package/types/radio-group.d.ts +0 -18
  605. package/types/radio.d.ts +0 -19
  606. package/types/rate.d.ts +0 -64
  607. package/types/result.d.ts +0 -33
  608. package/types/row.d.ts +0 -25
  609. package/types/select.d.ts +0 -90
  610. package/types/skeleton-item.d.ts +0 -7
  611. package/types/skeleton.d.ts +0 -33
  612. package/types/slider.d.ts +0 -68
  613. package/types/spinner.d.ts +0 -16
  614. package/types/statistic.d.ts +0 -37
  615. package/types/step.d.ts +0 -34
  616. package/types/steps.d.ts +0 -28
  617. package/types/submenu.d.ts +0 -22
  618. package/types/switch.d.ts +0 -43
  619. package/types/tab-pane.d.ts +0 -19
  620. package/types/table-column.d.ts +0 -117
  621. package/types/table.d.ts +0 -177
  622. package/types/tabs.d.ts +0 -31
  623. package/types/tag.d.ts +0 -28
  624. package/types/time-picker.d.ts +0 -63
  625. package/types/time-select.d.ts +0 -56
  626. package/types/timeline-item.d.ts +0 -20
  627. package/types/timeline.d.ts +0 -6
  628. package/types/tooltip.d.ts +0 -52
  629. package/types/transfer.d.ts +0 -73
  630. package/types/tree.d.ts +0 -266
  631. package/types/upload.d.ts +0 -124
  632. package/web-types.json +0 -4195
@@ -1,273 +0,0 @@
1
- import { getValueByPath } from 'element-ui/src/utils/util';
2
-
3
- export const getCell = function(event) {
4
- let cell = event.target;
5
-
6
- while (cell && cell.tagName.toUpperCase() !== 'HTML') {
7
- if (cell.tagName.toUpperCase() === 'TD') {
8
- return cell;
9
- }
10
- cell = cell.parentNode;
11
- }
12
-
13
- return null;
14
- };
15
-
16
- const isObject = function(obj) {
17
- return obj !== null && typeof obj === 'object';
18
- };
19
-
20
- export const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
21
- if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
22
- return array;
23
- }
24
- if (typeof reverse === 'string') {
25
- reverse = reverse === 'descending' ? -1 : 1;
26
- } else {
27
- reverse = (reverse && reverse < 0) ? -1 : 1;
28
- }
29
- const getKey = sortMethod ? null : function(value, index) {
30
- if (sortBy) {
31
- if (!Array.isArray(sortBy)) {
32
- sortBy = [sortBy];
33
- }
34
- return sortBy.map(function(by) {
35
- if (typeof by === 'string') {
36
- return getValueByPath(value, by);
37
- } else {
38
- return by(value, index, array);
39
- }
40
- });
41
- }
42
- if (sortKey !== '$key') {
43
- if (isObject(value) && '$value' in value) value = value.$value;
44
- }
45
- return [isObject(value) ? getValueByPath(value, sortKey) : value];
46
- };
47
- const compare = function(a, b) {
48
- if (sortMethod) {
49
- return sortMethod(a.value, b.value);
50
- }
51
- for (let i = 0, len = a.key.length; i < len; i++) {
52
- if (a.key[i] < b.key[i]) {
53
- return -1;
54
- }
55
- if (a.key[i] > b.key[i]) {
56
- return 1;
57
- }
58
- }
59
- return 0;
60
- };
61
- return array.map(function(value, index) {
62
- return {
63
- value: value,
64
- index: index,
65
- key: getKey ? getKey(value, index) : null
66
- };
67
- }).sort(function(a, b) {
68
- let order = compare(a, b);
69
- if (!order) {
70
- // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
71
- order = a.index - b.index;
72
- }
73
- return order * reverse;
74
- }).map(item => item.value);
75
- };
76
-
77
- export const getColumnById = function(table, columnId) {
78
- let column = null;
79
- table.columns.forEach(function(item) {
80
- if (item.id === columnId) {
81
- column = item;
82
- }
83
- });
84
- return column;
85
- };
86
-
87
- export const getColumnByKey = function(table, columnKey) {
88
- let column = null;
89
- for (let i = 0; i < table.columns.length; i++) {
90
- const item = table.columns[i];
91
- if (item.columnKey === columnKey) {
92
- column = item;
93
- break;
94
- }
95
- }
96
- return column;
97
- };
98
-
99
- export const getColumnByCell = function(table, cell) {
100
- const matches = (cell.className || '').match(/el-table_[^\s]+/gm);
101
- if (matches) {
102
- return getColumnById(table, matches[0]);
103
- }
104
- return null;
105
- };
106
-
107
- export const getRowIdentity = (row, rowKey) => {
108
- if (!row) throw new Error('row is required when get row identity');
109
- if (typeof rowKey === 'string') {
110
- if (rowKey.indexOf('.') < 0) {
111
- return row[rowKey];
112
- }
113
- let key = rowKey.split('.');
114
- let current = row;
115
- for (let i = 0; i < key.length; i++) {
116
- current = current[key[i]];
117
- }
118
- return current;
119
- } else if (typeof rowKey === 'function') {
120
- return rowKey.call(null, row);
121
- }
122
- };
123
-
124
- export const getKeysMap = function(array, rowKey) {
125
- const arrayMap = {};
126
- (array || []).forEach((row, index) => {
127
- arrayMap[getRowIdentity(row, rowKey)] = { row, index };
128
- });
129
- return arrayMap;
130
- };
131
-
132
- function hasOwn(obj, key) {
133
- return Object.prototype.hasOwnProperty.call(obj, key);
134
- }
135
-
136
- export function mergeOptions(defaults, config) {
137
- const options = {};
138
- let key;
139
- for (key in defaults) {
140
- options[key] = defaults[key];
141
- }
142
- for (key in config) {
143
- if (hasOwn(config, key)) {
144
- const value = config[key];
145
- if (typeof value !== 'undefined') {
146
- options[key] = value;
147
- }
148
- }
149
- }
150
- return options;
151
- }
152
-
153
- export function parseWidth(width) {
154
- if (width !== undefined) {
155
- width = parseInt(width, 10);
156
- if (isNaN(width)) {
157
- width = null;
158
- }
159
- }
160
- return width;
161
- }
162
-
163
- export function parseMinWidth(minWidth) {
164
- if (typeof minWidth !== 'undefined') {
165
- minWidth = parseWidth(minWidth);
166
- if (isNaN(minWidth)) {
167
- minWidth = 80;
168
- }
169
- }
170
- return minWidth;
171
- };
172
-
173
- export function parseHeight(height) {
174
- if (typeof height === 'number') {
175
- return height;
176
- }
177
- if (typeof height === 'string') {
178
- if (/^\d+(?:px)?$/.test(height)) {
179
- return parseInt(height, 10);
180
- } else {
181
- return height;
182
- }
183
- }
184
- return null;
185
- }
186
-
187
- // https://github.com/reduxjs/redux/blob/master/src/compose.js
188
- export function compose(...funcs) {
189
- if (funcs.length === 0) {
190
- return arg => arg;
191
- }
192
- if (funcs.length === 1) {
193
- return funcs[0];
194
- }
195
- return funcs.reduce((a, b) => (...args) => a(b(...args)));
196
- }
197
-
198
- export function toggleRowStatus(statusArr, row, newVal) {
199
- let changed = false;
200
- const index = statusArr.indexOf(row);
201
- const included = index !== -1;
202
-
203
- const addRow = () => {
204
- statusArr.push(row);
205
- changed = true;
206
- };
207
- const removeRow = () => {
208
- statusArr.splice(index, 1);
209
- changed = true;
210
- };
211
-
212
- if (typeof newVal === 'boolean') {
213
- if (newVal && !included) {
214
- addRow();
215
- } else if (!newVal && included) {
216
- removeRow();
217
- }
218
- } else {
219
- if (included) {
220
- removeRow();
221
- } else {
222
- addRow();
223
- }
224
- }
225
- return changed;
226
- }
227
-
228
- export function walkTreeNode(root, cb, childrenKey = 'children', lazyKey = 'hasChildren') {
229
- const isNil = (array) => !(Array.isArray(array) && array.length);
230
-
231
- function _walker(parent, children, level) {
232
- cb(parent, children, level);
233
- children.forEach(item => {
234
- if (item[lazyKey]) {
235
- cb(item, null, level + 1);
236
- return;
237
- }
238
- const children = item[childrenKey];
239
- if (!isNil(children)) {
240
- _walker(item, children, level + 1);
241
- }
242
- });
243
- }
244
-
245
- root.forEach(item => {
246
- if (item[lazyKey]) {
247
- cb(item, null, 0);
248
- return;
249
- }
250
- const children = item[childrenKey];
251
- if (!isNil(children)) {
252
- _walker(item, children, 0);
253
- }
254
- });
255
- }
256
-
257
- export const objectEquals = function(objectA, objectB) {
258
- // 取对象a和b的属性名
259
- let aProps = Object.getOwnPropertyNames(objectA);
260
- let bProps = Object.getOwnPropertyNames(objectB);
261
- // 判断属性名的length是否一致
262
- if (aProps.length !== bProps.length) {
263
- return false;
264
- }
265
- // 循环取出属性名,再判断属性值是否一致
266
- for (let i = 0; i < aProps.length; i++) {
267
- let propName = aProps[i];
268
- if (objectA[propName] !== objectB[propName]) {
269
- return false;
270
- }
271
- }
272
- return true;
273
- };
@@ -1,8 +0,0 @@
1
- import ElTableColumn from '../table/src/table-column';
2
-
3
- /* istanbul ignore next */
4
- ElTableColumn.install = function(Vue) {
5
- Vue.component(ElTableColumn.name, ElTableColumn);
6
- };
7
-
8
- export default ElTableColumn;
@@ -1,8 +0,0 @@
1
- import ElTabs from './src/tabs';
2
-
3
- /* istanbul ignore next */
4
- ElTabs.install = function(Vue) {
5
- Vue.component(ElTabs.name, ElTabs);
6
- };
7
-
8
- export default ElTabs;
@@ -1,57 +0,0 @@
1
- <template>
2
- <div class="el-tabs__active-bar" :class="`is-${ rootTabs.tabPosition }`" :style="barStyle"></div>
3
- </template>
4
- <script>
5
- import { arrayFind } from 'element-ui/src/utils/util';
6
- export default {
7
- name: 'TabBar',
8
-
9
- props: {
10
- tabs: Array
11
- },
12
-
13
- inject: ['rootTabs'],
14
-
15
- computed: {
16
- barStyle: {
17
- get() {
18
- let style = {};
19
- let offset = 0;
20
- let tabSize = 0;
21
- const sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
22
- const sizeDir = sizeName === 'width' ? 'x' : 'y';
23
- const firstUpperCase = str => {
24
- return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
25
- };
26
- this.tabs.every((tab, index) => {
27
- let $el = arrayFind(this.$parent.$refs.tabs || [], t => t.id.replace('tab-', '') === tab.paneName);
28
- if (!$el) { return false; }
29
-
30
- if (!tab.active) {
31
- offset += $el[`client${firstUpperCase(sizeName)}`];
32
- return true;
33
- } else {
34
- tabSize = $el[`client${firstUpperCase(sizeName)}`];
35
- const tabStyles = window.getComputedStyle($el);
36
- if (sizeName === 'width' && this.tabs.length > 1) {
37
- tabSize -= parseFloat(tabStyles.paddingLeft) + parseFloat(tabStyles.paddingRight);
38
- }
39
- if (sizeName === 'width') {
40
- offset += parseFloat(tabStyles.paddingLeft);
41
- }
42
- return false;
43
- }
44
- });
45
-
46
- const transform = `translate${firstUpperCase(sizeDir)}(${offset}px)`;
47
- style[sizeName] = tabSize + 'px';
48
- style.transform = transform;
49
- style.msTransform = transform;
50
- style.webkitTransform = transform;
51
-
52
- return style;
53
- }
54
- }
55
- }
56
- };
57
- </script>
@@ -1,294 +0,0 @@
1
- <script>
2
- import TabBar from './tab-bar';
3
- import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
4
-
5
- function noop() {}
6
- const firstUpperCase = str => {
7
- return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
8
- };
9
-
10
- export default {
11
- name: 'TabNav',
12
-
13
- components: {
14
- TabBar
15
- },
16
-
17
- inject: ['rootTabs'],
18
-
19
- props: {
20
- panes: Array,
21
- currentName: String,
22
- editable: Boolean,
23
- onTabClick: {
24
- type: Function,
25
- default: noop
26
- },
27
- onTabRemove: {
28
- type: Function,
29
- default: noop
30
- },
31
- type: String,
32
- stretch: Boolean
33
- },
34
-
35
- data() {
36
- return {
37
- scrollable: false,
38
- navOffset: 0,
39
- isFocus: false,
40
- focusable: true
41
- };
42
- },
43
-
44
- computed: {
45
- navStyle() {
46
- const dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
47
- return {
48
- transform: `translate${dir}(-${this.navOffset}px)`
49
- };
50
- },
51
- sizeName() {
52
- return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
53
- }
54
- },
55
-
56
- methods: {
57
- scrollPrev() {
58
- const containerSize = this.$refs.navScroll[`offset${firstUpperCase(this.sizeName)}`];
59
- const currentOffset = this.navOffset;
60
-
61
- if (!currentOffset) return;
62
-
63
- let newOffset = currentOffset > containerSize
64
- ? currentOffset - containerSize
65
- : 0;
66
-
67
- this.navOffset = newOffset;
68
- },
69
- scrollNext() {
70
- const navSize = this.$refs.nav[`offset${firstUpperCase(this.sizeName)}`];
71
- const containerSize = this.$refs.navScroll[`offset${firstUpperCase(this.sizeName)}`];
72
- const currentOffset = this.navOffset;
73
-
74
- if (navSize - currentOffset <= containerSize) return;
75
-
76
- let newOffset = navSize - currentOffset > containerSize * 2
77
- ? currentOffset + containerSize
78
- : (navSize - containerSize);
79
-
80
- this.navOffset = newOffset;
81
- },
82
- scrollToActiveTab() {
83
- if (!this.scrollable) return;
84
- const nav = this.$refs.nav;
85
- const activeTab = this.$el.querySelector('.is-active');
86
- if (!activeTab) return;
87
- const navScroll = this.$refs.navScroll;
88
- const isHorizontal = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1;
89
- const activeTabBounding = activeTab.getBoundingClientRect();
90
- const navScrollBounding = navScroll.getBoundingClientRect();
91
- const maxOffset = isHorizontal
92
- ? nav.offsetWidth - navScrollBounding.width
93
- : nav.offsetHeight - navScrollBounding.height;
94
- const currentOffset = this.navOffset;
95
- let newOffset = currentOffset;
96
-
97
- if (isHorizontal) {
98
- if (activeTabBounding.left < navScrollBounding.left) {
99
- newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
100
- }
101
- if (activeTabBounding.right > navScrollBounding.right) {
102
- newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
103
- }
104
- } else {
105
- if (activeTabBounding.top < navScrollBounding.top) {
106
- newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
107
- }
108
- if (activeTabBounding.bottom > navScrollBounding.bottom) {
109
- newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
110
- }
111
- }
112
- newOffset = Math.max(newOffset, 0);
113
- this.navOffset = Math.min(newOffset, maxOffset);
114
- },
115
- update() {
116
- if (!this.$refs.nav) return;
117
- const sizeName = this.sizeName;
118
- const navSize = this.$refs.nav[`offset${firstUpperCase(sizeName)}`];
119
- const containerSize = this.$refs.navScroll[`offset${firstUpperCase(sizeName)}`];
120
- const currentOffset = this.navOffset;
121
-
122
- if (containerSize < navSize) {
123
- const currentOffset = this.navOffset;
124
- this.scrollable = this.scrollable || {};
125
- this.scrollable.prev = currentOffset;
126
- this.scrollable.next = currentOffset + containerSize < navSize;
127
- if (navSize - currentOffset < containerSize) {
128
- this.navOffset = navSize - containerSize;
129
- }
130
- } else {
131
- this.scrollable = false;
132
- if (currentOffset > 0) {
133
- this.navOffset = 0;
134
- }
135
- }
136
- },
137
- changeTab(e) {
138
- const keyCode = e.keyCode;
139
- let nextIndex;
140
- let currentIndex, tabList;
141
- if ([37, 38, 39, 40].indexOf(keyCode) !== -1) { // 左右上下键更换tab
142
- tabList = e.currentTarget.querySelectorAll('[role=tab]');
143
- currentIndex = Array.prototype.indexOf.call(tabList, e.target);
144
- } else {
145
- return;
146
- }
147
- if (keyCode === 37 || keyCode === 38) { // left
148
- if (currentIndex === 0) { // first
149
- nextIndex = tabList.length - 1;
150
- } else {
151
- nextIndex = currentIndex - 1;
152
- }
153
- } else { // right
154
- if (currentIndex < tabList.length - 1) { // not last
155
- nextIndex = currentIndex + 1;
156
- } else {
157
- nextIndex = 0;
158
- }
159
- }
160
- tabList[nextIndex].focus(); // 改变焦点元素
161
- tabList[nextIndex].click(); // 选中下一个tab
162
- this.setFocus();
163
- },
164
- setFocus() {
165
- if (this.focusable) {
166
- this.isFocus = true;
167
- }
168
- },
169
- removeFocus() {
170
- this.isFocus = false;
171
- },
172
- visibilityChangeHandler() {
173
- const visibility = document.visibilityState;
174
- if (visibility === 'hidden') {
175
- this.focusable = false;
176
- } else if (visibility === 'visible') {
177
- setTimeout(() => {
178
- this.focusable = true;
179
- }, 50);
180
- }
181
- },
182
- windowBlurHandler() {
183
- this.focusable = false;
184
- },
185
- windowFocusHandler() {
186
- setTimeout(() => {
187
- this.focusable = true;
188
- }, 50);
189
- }
190
- },
191
-
192
- updated() {
193
- this.update();
194
- },
195
-
196
- render(h) {
197
- const {
198
- type,
199
- panes,
200
- editable,
201
- stretch,
202
- onTabClick,
203
- onTabRemove,
204
- navStyle,
205
- scrollable,
206
- scrollNext,
207
- scrollPrev,
208
- changeTab,
209
- setFocus,
210
- removeFocus
211
- } = this;
212
- const scrollBtn = scrollable
213
- ? [
214
- <span class={['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled']} on-click={scrollPrev}><i class="el-icon-arrow-left"></i></span>,
215
- <span class={['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled']} on-click={scrollNext}><i class="el-icon-arrow-right"></i></span>
216
- ] : null;
217
-
218
- const tabs = this._l(panes, (pane, index) => {
219
- let tabName = pane.name || pane.index || index;
220
- const closable = pane.isClosable || editable;
221
-
222
- pane.index = `${index}`;
223
-
224
- const btnClose = closable
225
- ? <span class="el-icon-close" on-click={(ev) => { onTabRemove(pane, ev); }}></span>
226
- : null;
227
-
228
- const tabLabelContent = pane.$slots.label || pane.label;
229
- const tabindex = pane.active ? 0 : -1;
230
- return (
231
- <div
232
- class={{
233
- 'el-tabs__item': true,
234
- [`is-${ this.rootTabs.tabPosition }`]: true,
235
- 'is-active': pane.active,
236
- 'is-disabled': pane.disabled,
237
- 'is-closable': closable,
238
- 'is-focus': this.isFocus
239
- }}
240
- id={`tab-${tabName}`}
241
- key={`tab-${tabName}`}
242
- aria-controls={`pane-${tabName}`}
243
- role="tab"
244
- aria-selected={ pane.active }
245
- ref="tabs"
246
- tabindex={tabindex}
247
- refInFor
248
- on-focus={ ()=> { setFocus(); }}
249
- on-blur ={ ()=> { removeFocus(); }}
250
- on-click={(ev) => { removeFocus(); onTabClick(pane, tabName, ev); }}
251
- on-keydown={(ev) => { if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) { onTabRemove(pane, ev);} }}
252
- >
253
- {tabLabelContent}
254
- {btnClose}
255
- </div>
256
- );
257
- });
258
- return (
259
- <div class={['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', `is-${ this.rootTabs.tabPosition }`]}>
260
- {scrollBtn}
261
- <div class={['el-tabs__nav-scroll']} ref="navScroll">
262
- <div
263
- class={['el-tabs__nav', `is-${ this.rootTabs.tabPosition }`, stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : '']}
264
- ref="nav"
265
- style={navStyle}
266
- role="tablist"
267
- on-keydown={ changeTab }
268
- >
269
- {!type ? <tab-bar tabs={panes}></tab-bar> : null}
270
- {tabs}
271
- </div>
272
- </div>
273
- </div>
274
- );
275
- },
276
-
277
- mounted() {
278
- addResizeListener(this.$el, this.update);
279
- document.addEventListener('visibilitychange', this.visibilityChangeHandler);
280
- window.addEventListener('blur', this.windowBlurHandler);
281
- window.addEventListener('focus', this.windowFocusHandler);
282
- setTimeout(() => {
283
- this.scrollToActiveTab();
284
- }, 0);
285
- },
286
-
287
- beforeDestroy() {
288
- if (this.$el && this.update) removeResizeListener(this.$el, this.update);
289
- document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
290
- window.removeEventListener('blur', this.windowBlurHandler);
291
- window.removeEventListener('focus', this.windowFocusHandler);
292
- }
293
- };
294
- </script>
@@ -1,56 +0,0 @@
1
- <template>
2
- <div
3
- class="el-tab-pane"
4
- v-if="(!lazy || loaded) || active"
5
- v-show="active"
6
- role="tabpanel"
7
- :aria-hidden="!active"
8
- :id="`pane-${paneName}`"
9
- :aria-labelledby="`tab-${paneName}`"
10
- >
11
- <slot></slot>
12
- </div>
13
- </template>
14
- <script>
15
- export default {
16
- name: 'ElTabPane',
17
-
18
- componentName: 'ElTabPane',
19
-
20
- props: {
21
- label: String,
22
- labelContent: Function,
23
- name: String,
24
- closable: Boolean,
25
- disabled: Boolean,
26
- lazy: Boolean
27
- },
28
-
29
- data() {
30
- return {
31
- index: null,
32
- loaded: false
33
- };
34
- },
35
-
36
- computed: {
37
- isClosable() {
38
- return this.closable || this.$parent.closable;
39
- },
40
- active() {
41
- const active = this.$parent.currentName === (this.name || this.index);
42
- if (active) {
43
- this.loaded = true;
44
- }
45
- return active;
46
- },
47
- paneName() {
48
- return this.name || this.index;
49
- }
50
- },
51
-
52
- updated() {
53
- this.$parent.$emit('tab-nav-update');
54
- }
55
- };
56
- </script>