cbvirtua 1.0.36 → 1.0.38

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 (481) hide show
  1. package/package.json +1 -1
  2. package/src/dom.js +227 -0
  3. package/src/index.js +106 -0
  4. package/src/packages/alert/index.js +8 -0
  5. package/src/packages/alert/src/main.vue +94 -0
  6. package/src/packages/aside/index.js +8 -0
  7. package/src/packages/aside/src/main.vue +20 -0
  8. package/src/packages/autocomplete/index.js +8 -0
  9. package/src/packages/autocomplete/src/autocomplete-suggestions.vue +76 -0
  10. package/src/packages/autocomplete/src/autocomplete.vue +285 -0
  11. package/src/packages/avatar/index.js +8 -0
  12. package/src/packages/avatar/src/main.vue +107 -0
  13. package/src/packages/backtop/index.js +8 -0
  14. package/src/packages/backtop/src/main.vue +110 -0
  15. package/src/packages/badge/index.js +8 -0
  16. package/src/packages/badge/src/main.vue +53 -0
  17. package/src/packages/breadcrumb/index.js +8 -0
  18. package/src/packages/breadcrumb/src/breadcrumb-item.vue +41 -0
  19. package/src/packages/breadcrumb/src/breadcrumb.vue +34 -0
  20. package/src/packages/breadcrumb-item/index.js +8 -0
  21. package/src/packages/button/index.js +8 -0
  22. package/src/packages/button/src/button-group.vue +10 -0
  23. package/src/packages/button/src/button.vue +78 -0
  24. package/src/packages/button-group/index.js +8 -0
  25. package/src/packages/calendar/index.js +8 -0
  26. package/src/packages/calendar/src/date-table.vue +200 -0
  27. package/src/packages/calendar/src/main.vue +280 -0
  28. package/src/packages/card/index.js +8 -0
  29. package/src/packages/card/src/main.vue +23 -0
  30. package/src/packages/carousel/index.js +8 -0
  31. package/src/packages/carousel/src/item.vue +138 -0
  32. package/src/packages/carousel/src/main.vue +315 -0
  33. package/src/packages/carousel-item/index.js +8 -0
  34. package/src/packages/cascader/index.js +8 -0
  35. package/src/packages/cascader/src/cascader.vue +663 -0
  36. package/src/packages/cascader-panel/index.js +8 -0
  37. package/src/packages/cascader-panel/src/cascader-menu.vue +138 -0
  38. package/src/packages/cascader-panel/src/cascader-node.vue +246 -0
  39. package/src/packages/cascader-panel/src/cascader-panel.vue +391 -0
  40. package/src/packages/cascader-panel/src/node.js +166 -0
  41. package/src/packages/cascader-panel/src/store.js +58 -0
  42. package/src/packages/checkbox/index.js +8 -0
  43. package/src/packages/checkbox/src/checkbox-button.vue +199 -0
  44. package/src/packages/checkbox/src/checkbox-group.vue +48 -0
  45. package/src/packages/checkbox/src/checkbox.vue +222 -0
  46. package/src/packages/checkbox-button/index.js +8 -0
  47. package/src/packages/checkbox-group/index.js +8 -0
  48. package/src/packages/col/index.js +9 -0
  49. package/src/packages/col/src/col.js +71 -0
  50. package/src/packages/collapse/index.js +9 -0
  51. package/src/packages/collapse/src/collapse-item.vue +114 -0
  52. package/src/packages/collapse/src/collapse.vue +73 -0
  53. package/src/packages/collapse-item/index.js +8 -0
  54. package/src/packages/color-picker/index.js +8 -0
  55. package/src/packages/color-picker/src/color.js +317 -0
  56. package/src/packages/color-picker/src/components/alpha-slider.vue +132 -0
  57. package/src/packages/color-picker/src/components/hue-slider.vue +123 -0
  58. package/src/packages/color-picker/src/components/picker-dropdown.vue +121 -0
  59. package/src/packages/color-picker/src/components/predefine.vue +61 -0
  60. package/src/packages/color-picker/src/components/sv-panel.vue +100 -0
  61. package/src/packages/color-picker/src/draggable.js +36 -0
  62. package/src/packages/color-picker/src/main.vue +188 -0
  63. package/src/packages/container/index.js +8 -0
  64. package/src/packages/container/src/main.vue +33 -0
  65. package/src/packages/date-picker/index.js +8 -0
  66. package/src/packages/date-picker/src/basic/date-table.vue +441 -0
  67. package/src/packages/date-picker/src/basic/month-table.vue +269 -0
  68. package/src/packages/date-picker/src/basic/time-spinner.vue +304 -0
  69. package/src/packages/date-picker/src/basic/year-table.vue +111 -0
  70. package/src/packages/date-picker/src/panel/date-range.vue +680 -0
  71. package/src/packages/date-picker/src/panel/date.vue +609 -0
  72. package/src/packages/date-picker/src/panel/month-range.vue +289 -0
  73. package/src/packages/date-picker/src/panel/time-range.vue +248 -0
  74. package/src/packages/date-picker/src/panel/time-select.vue +178 -0
  75. package/src/packages/date-picker/src/panel/time.vue +186 -0
  76. package/src/packages/date-picker/src/picker/date-picker.js +43 -0
  77. package/src/packages/date-picker/src/picker/time-picker.js +39 -0
  78. package/src/packages/date-picker/src/picker/time-select.js +21 -0
  79. package/src/packages/date-picker/src/picker.vue +956 -0
  80. package/src/packages/descriptions/index.js +8 -0
  81. package/src/packages/descriptions/src/descriptions-item.js +30 -0
  82. package/src/packages/descriptions/src/descriptions-row.js +116 -0
  83. package/src/packages/descriptions/src/index.js +180 -0
  84. package/src/packages/descriptions-item/index.js +8 -0
  85. package/src/packages/dialog/index.js +8 -0
  86. package/src/packages/dialog/src/component.vue +212 -0
  87. package/src/packages/divider/index.js +8 -0
  88. package/src/packages/divider/src/main.vue +37 -0
  89. package/src/packages/drawer/index.js +8 -0
  90. package/src/packages/drawer/src/main.vue +205 -0
  91. package/src/packages/dropdown/index.js +8 -0
  92. package/src/packages/dropdown/src/dropdown-item.vue +37 -0
  93. package/src/packages/dropdown/src/dropdown-menu.vue +63 -0
  94. package/src/packages/dropdown/src/dropdown.vue +293 -0
  95. package/src/packages/dropdown-item/index.js +8 -0
  96. package/src/packages/dropdown-menu/index.js +8 -0
  97. package/src/packages/empty/index.js +7 -0
  98. package/src/packages/empty/src/img-empty.vue +132 -0
  99. package/src/packages/empty/src/index.vue +50 -0
  100. package/src/packages/footer/index.js +8 -0
  101. package/src/packages/footer/src/main.vue +20 -0
  102. package/src/packages/form/index.js +8 -0
  103. package/src/packages/form/src/form-item.vue +324 -0
  104. package/src/packages/form/src/form.vue +182 -0
  105. package/src/packages/form/src/label-wrap.vue +78 -0
  106. package/src/packages/form-item/index.js +8 -0
  107. package/src/packages/header/index.js +8 -0
  108. package/src/packages/header/src/main.vue +20 -0
  109. package/src/packages/icon/index.js +8 -0
  110. package/src/packages/icon/src/icon.vue +13 -0
  111. package/src/packages/image/index.js +8 -0
  112. package/src/packages/image/src/image-viewer.vue +330 -0
  113. package/src/packages/image/src/main.vue +249 -0
  114. package/src/packages/infinite-scroll/index.js +8 -0
  115. package/src/packages/infinite-scroll/src/main.js +150 -0
  116. package/src/packages/input/index.js +8 -0
  117. package/src/packages/input/src/calcTextareaHeight.js +104 -0
  118. package/src/packages/input/src/input.vue +440 -0
  119. package/src/packages/input-number/index.js +8 -0
  120. package/src/packages/input-number/src/input-number.vue +283 -0
  121. package/src/packages/link/index.js +8 -0
  122. package/src/packages/link/src/main.vue +53 -0
  123. package/src/packages/loading/index.js +11 -0
  124. package/src/packages/loading/src/directive.js +133 -0
  125. package/src/packages/loading/src/index.js +106 -0
  126. package/src/packages/loading/src/loading.vue +41 -0
  127. package/src/packages/main/index.js +8 -0
  128. package/src/packages/main/src/main.vue +12 -0
  129. package/src/packages/menu/index.js +8 -0
  130. package/src/packages/menu/src/menu-item-group.vue +45 -0
  131. package/src/packages/menu/src/menu-item.vue +112 -0
  132. package/src/packages/menu/src/menu-mixin.js +44 -0
  133. package/src/packages/menu/src/menu.vue +325 -0
  134. package/src/packages/menu/src/submenu.vue +349 -0
  135. package/src/packages/menu-item/index.js +8 -0
  136. package/src/packages/menu-item-group/index.js +8 -0
  137. package/src/packages/message/index.js +2 -0
  138. package/src/packages/message/src/main.js +91 -0
  139. package/src/packages/message/src/main.vue +117 -0
  140. package/src/packages/message-box/index.js +2 -0
  141. package/src/packages/message-box/src/main.js +216 -0
  142. package/src/packages/message-box/src/main.vue +332 -0
  143. package/src/packages/notification/index.js +2 -0
  144. package/src/packages/notification/src/main.js +94 -0
  145. package/src/packages/notification/src/main.vue +152 -0
  146. package/src/packages/option/index.js +8 -0
  147. package/src/packages/option-group/index.js +8 -0
  148. package/src/packages/page-header/index.js +8 -0
  149. package/src/packages/page-header/src/main.vue +30 -0
  150. package/src/packages/pagination/index.js +8 -0
  151. package/src/packages/pagination/src/pager.vue +163 -0
  152. package/src/packages/pagination/src/pagination.js +386 -0
  153. package/src/packages/popconfirm/index.js +8 -0
  154. package/src/packages/popconfirm/src/main.vue +104 -0
  155. package/src/packages/popover/index.js +14 -0
  156. package/src/packages/popover/src/directive.js +20 -0
  157. package/src/packages/popover/src/main.vue +237 -0
  158. package/src/packages/progress/index.js +8 -0
  159. package/src/packages/progress/src/progress.vue +235 -0
  160. package/src/packages/radio/index.js +8 -0
  161. package/src/packages/radio/src/radio-button.vue +115 -0
  162. package/src/packages/radio/src/radio-group.vue +113 -0
  163. package/src/packages/radio/src/radio.vue +134 -0
  164. package/src/packages/radio-button/index.js +8 -0
  165. package/src/packages/radio-group/index.js +8 -0
  166. package/src/packages/rate/index.js +8 -0
  167. package/src/packages/rate/src/main.vue +348 -0
  168. package/src/packages/result/index.js +8 -0
  169. package/src/packages/result/src/icon-error.vue +13 -0
  170. package/src/packages/result/src/icon-info.vue +13 -0
  171. package/src/packages/result/src/icon-success.vue +13 -0
  172. package/src/packages/result/src/icon-warning.vue +13 -0
  173. package/src/packages/result/src/index.vue +65 -0
  174. package/src/packages/row/index.js +9 -0
  175. package/src/packages/row/src/row.js +44 -0
  176. package/src/packages/scrollbar/index.js +8 -0
  177. package/src/packages/scrollbar/src/bar.js +92 -0
  178. package/src/packages/scrollbar/src/main.js +130 -0
  179. package/src/packages/scrollbar/src/util.js +34 -0
  180. package/src/packages/select/index.js +8 -0
  181. package/src/packages/select/src/navigation-mixin.js +54 -0
  182. package/src/packages/select/src/option-group.vue +60 -0
  183. package/src/packages/select/src/option.vue +168 -0
  184. package/src/packages/select/src/select-dropdown.vue +74 -0
  185. package/src/packages/select/src/select.vue +900 -0
  186. package/src/packages/skeleton/index.js +8 -0
  187. package/src/packages/skeleton/src/img-placeholder.vue +16 -0
  188. package/src/packages/skeleton/src/index.vue +76 -0
  189. package/src/packages/skeleton/src/item.vue +22 -0
  190. package/src/packages/skeleton-item/index.js +8 -0
  191. package/src/packages/slider/index.js +8 -0
  192. package/src/packages/slider/src/button.vue +238 -0
  193. package/src/packages/slider/src/main.vue +427 -0
  194. package/src/packages/slider/src/marker.js +18 -0
  195. package/src/packages/spinner/index.js +8 -0
  196. package/src/packages/spinner/src/spinner.vue +27 -0
  197. package/src/packages/statistic/index.js +8 -0
  198. package/src/packages/statistic/src/main.vue +204 -0
  199. package/src/packages/step/index.js +8 -0
  200. package/src/packages/steps/README.md +69 -0
  201. package/src/packages/steps/index.js +8 -0
  202. package/src/packages/steps/src/step.vue +184 -0
  203. package/src/packages/steps/src/steps.vue +68 -0
  204. package/src/packages/submenu/index.js +8 -0
  205. package/src/packages/switch/index.js +9 -0
  206. package/src/packages/switch/src/component.vue +174 -0
  207. package/src/packages/tab-pane/index.js +8 -0
  208. package/src/packages/table/index.js +8 -0
  209. package/src/packages/table/src/config.js +124 -0
  210. package/src/packages/table/src/dropdown.js +28 -0
  211. package/src/packages/table/src/filter-panel.vue +194 -0
  212. package/src/packages/table/src/layout-observer.js +68 -0
  213. package/src/packages/table/src/store/current.js +76 -0
  214. package/src/packages/table/src/store/expand.js +65 -0
  215. package/src/packages/table/src/store/helper.js +41 -0
  216. package/src/packages/table/src/store/index.js +147 -0
  217. package/src/packages/table/src/store/tree.js +209 -0
  218. package/src/packages/table/src/store/watcher.js +381 -0
  219. package/src/packages/table/src/table-body.js +469 -0
  220. package/src/packages/table/src/table-column.js +319 -0
  221. package/src/packages/table/src/table-footer.js +153 -0
  222. package/src/packages/table/src/table-header.js +511 -0
  223. package/src/packages/table/src/table-layout.js +249 -0
  224. package/src/packages/table/src/table-row.js +101 -0
  225. package/src/packages/table/src/table.vue +712 -0
  226. package/src/packages/table/src/util.js +273 -0
  227. package/src/packages/table-column/index.js +8 -0
  228. package/src/packages/tabs/index.js +8 -0
  229. package/src/packages/tabs/src/tab-bar.vue +57 -0
  230. package/src/packages/tabs/src/tab-nav.vue +294 -0
  231. package/src/packages/tabs/src/tab-pane.vue +56 -0
  232. package/src/packages/tabs/src/tabs.vue +191 -0
  233. package/src/packages/tag/index.js +8 -0
  234. package/src/packages/tag/src/tag.vue +58 -0
  235. package/src/packages/theme-chalk/README.md +33 -0
  236. package/src/packages/theme-chalk/gulpfile.js +25 -0
  237. package/src/packages/theme-chalk/package.json +35 -0
  238. package/src/packages/theme-chalk/src/alert.scss +147 -0
  239. package/src/packages/theme-chalk/src/aside.scss +7 -0
  240. package/src/packages/theme-chalk/src/autocomplete.scss +80 -0
  241. package/src/packages/theme-chalk/src/avatar.scss +51 -0
  242. package/src/packages/theme-chalk/src/backtop.scss +22 -0
  243. package/src/packages/theme-chalk/src/badge.scss +57 -0
  244. package/src/packages/theme-chalk/src/base.scss +2 -0
  245. package/src/packages/theme-chalk/src/breadcrumb-item.scss +0 -0
  246. package/src/packages/theme-chalk/src/breadcrumb.scss +55 -0
  247. package/src/packages/theme-chalk/src/button-group.scss +0 -0
  248. package/src/packages/theme-chalk/src/button.scss +262 -0
  249. package/src/packages/theme-chalk/src/calendar.scss +79 -0
  250. package/src/packages/theme-chalk/src/card.scss +32 -0
  251. package/src/packages/theme-chalk/src/carousel-item.scss +50 -0
  252. package/src/packages/theme-chalk/src/carousel.scss +161 -0
  253. package/src/packages/theme-chalk/src/cascader-panel.scss +120 -0
  254. package/src/packages/theme-chalk/src/cascader.scss +182 -0
  255. package/src/packages/theme-chalk/src/checkbox-button.scss +0 -0
  256. package/src/packages/theme-chalk/src/checkbox-group.scss +0 -0
  257. package/src/packages/theme-chalk/src/checkbox.scss +359 -0
  258. package/src/packages/theme-chalk/src/col.scss +156 -0
  259. package/src/packages/theme-chalk/src/collapse-item.scss +0 -0
  260. package/src/packages/theme-chalk/src/collapse.scss +63 -0
  261. package/src/packages/theme-chalk/src/color-picker.scss +384 -0
  262. package/src/packages/theme-chalk/src/common/popup.scss +42 -0
  263. package/src/packages/theme-chalk/src/common/transition.scss +99 -0
  264. package/src/packages/theme-chalk/src/common/var.scss +1028 -0
  265. package/src/packages/theme-chalk/src/container.scss +14 -0
  266. package/src/packages/theme-chalk/src/date-picker/date-picker.scss +97 -0
  267. package/src/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -0
  268. package/src/packages/theme-chalk/src/date-picker/date-table.scss +151 -0
  269. package/src/packages/theme-chalk/src/date-picker/month-table.scss +82 -0
  270. package/src/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -0
  271. package/src/packages/theme-chalk/src/date-picker/picker.scss +197 -0
  272. package/src/packages/theme-chalk/src/date-picker/time-picker.scss +85 -0
  273. package/src/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -0
  274. package/src/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -0
  275. package/src/packages/theme-chalk/src/date-picker/year-table.scss +51 -0
  276. package/src/packages/theme-chalk/src/date-picker.scss +12 -0
  277. package/src/packages/theme-chalk/src/descriptions-item.scss +42 -0
  278. package/src/packages/theme-chalk/src/descriptions.scss +111 -0
  279. package/src/packages/theme-chalk/src/dialog.scss +123 -0
  280. package/src/packages/theme-chalk/src/display.scss +12 -0
  281. package/src/packages/theme-chalk/src/divider.scss +47 -0
  282. package/src/packages/theme-chalk/src/drawer.scss +219 -0
  283. package/src/packages/theme-chalk/src/dropdown-item.scss +0 -0
  284. package/src/packages/theme-chalk/src/dropdown-menu.scss +0 -0
  285. package/src/packages/theme-chalk/src/dropdown.scss +182 -0
  286. package/src/packages/theme-chalk/src/empty.scss +45 -0
  287. package/src/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
  288. package/src/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
  289. package/src/packages/theme-chalk/src/footer.scss +8 -0
  290. package/src/packages/theme-chalk/src/form-item.scss +0 -0
  291. package/src/packages/theme-chalk/src/form.scss +167 -0
  292. package/src/packages/theme-chalk/src/header.scss +8 -0
  293. package/src/packages/theme-chalk/src/icon.scss +1167 -0
  294. package/src/packages/theme-chalk/src/image.scss +179 -0
  295. package/src/packages/theme-chalk/src/index.scss +87 -0
  296. package/src/packages/theme-chalk/src/infinite-scroll.scss +0 -0
  297. package/src/packages/theme-chalk/src/infiniteScroll.scss +0 -0
  298. package/src/packages/theme-chalk/src/input-number.scss +180 -0
  299. package/src/packages/theme-chalk/src/input.scss +360 -0
  300. package/src/packages/theme-chalk/src/link.scss +81 -0
  301. package/src/packages/theme-chalk/src/loading.scss +96 -0
  302. package/src/packages/theme-chalk/src/main.scss +12 -0
  303. package/src/packages/theme-chalk/src/menu-item-group.scss +0 -0
  304. package/src/packages/theme-chalk/src/menu-item.scss +0 -0
  305. package/src/packages/theme-chalk/src/menu.scss +289 -0
  306. package/src/packages/theme-chalk/src/message-box.scss +226 -0
  307. package/src/packages/theme-chalk/src/message.scss +120 -0
  308. package/src/packages/theme-chalk/src/mixins/_button.scss +81 -0
  309. package/src/packages/theme-chalk/src/mixins/config.scss +4 -0
  310. package/src/packages/theme-chalk/src/mixins/function.scss +44 -0
  311. package/src/packages/theme-chalk/src/mixins/mixins.scss +190 -0
  312. package/src/packages/theme-chalk/src/mixins/utils.scss +39 -0
  313. package/src/packages/theme-chalk/src/notification.scss +99 -0
  314. package/src/packages/theme-chalk/src/option-group.scss +42 -0
  315. package/src/packages/theme-chalk/src/option.scss +36 -0
  316. package/src/packages/theme-chalk/src/page-header.scss +41 -0
  317. package/src/packages/theme-chalk/src/pagination.scss +295 -0
  318. package/src/packages/theme-chalk/src/popconfirm.scss +16 -0
  319. package/src/packages/theme-chalk/src/popover.scss +40 -0
  320. package/src/packages/theme-chalk/src/popper.scss +101 -0
  321. package/src/packages/theme-chalk/src/progress.scss +141 -0
  322. package/src/packages/theme-chalk/src/radio-button.scss +113 -0
  323. package/src/packages/theme-chalk/src/radio-group.scss +9 -0
  324. package/src/packages/theme-chalk/src/radio.scss +199 -0
  325. package/src/packages/theme-chalk/src/rate.scss +49 -0
  326. package/src/packages/theme-chalk/src/reset.scss +79 -0
  327. package/src/packages/theme-chalk/src/result.scss +61 -0
  328. package/src/packages/theme-chalk/src/row.scss +43 -0
  329. package/src/packages/theme-chalk/src/scrollbar.scss +72 -0
  330. package/src/packages/theme-chalk/src/select-dropdown.scss +62 -0
  331. package/src/packages/theme-chalk/src/select.scss +152 -0
  332. package/src/packages/theme-chalk/src/skeleton-item.scss +84 -0
  333. package/src/packages/theme-chalk/src/skeleton.scss +40 -0
  334. package/src/packages/theme-chalk/src/slider.scss +250 -0
  335. package/src/packages/theme-chalk/src/spinner.scss +44 -0
  336. package/src/packages/theme-chalk/src/statistic.scss +38 -0
  337. package/src/packages/theme-chalk/src/step.scss +317 -0
  338. package/src/packages/theme-chalk/src/steps.scss +20 -0
  339. package/src/packages/theme-chalk/src/submenu.scss +0 -0
  340. package/src/packages/theme-chalk/src/switch.scss +116 -0
  341. package/src/packages/theme-chalk/src/tab-pane.scss +0 -0
  342. package/src/packages/theme-chalk/src/table-column.scss +97 -0
  343. package/src/packages/theme-chalk/src/table.scss +564 -0
  344. package/src/packages/theme-chalk/src/tabs.scss +602 -0
  345. package/src/packages/theme-chalk/src/tag.scss +163 -0
  346. package/src/packages/theme-chalk/src/time-picker.scss +8 -0
  347. package/src/packages/theme-chalk/src/time-select.scss +37 -0
  348. package/src/packages/theme-chalk/src/timeline-item.scss +86 -0
  349. package/src/packages/theme-chalk/src/timeline.scss +14 -0
  350. package/src/packages/theme-chalk/src/tooltip.scss +141 -0
  351. package/src/packages/theme-chalk/src/transfer.scss +227 -0
  352. package/src/packages/theme-chalk/src/tree.scss +123 -0
  353. package/src/packages/theme-chalk/src/upload.scss +603 -0
  354. package/src/packages/time-picker/index.js +8 -0
  355. package/src/packages/time-select/index.js +8 -0
  356. package/src/packages/timeline/index.js +8 -0
  357. package/src/packages/timeline/src/item.vue +73 -0
  358. package/src/packages/timeline/src/main.vue +33 -0
  359. package/src/packages/timeline-item/index.js +8 -0
  360. package/src/packages/tooltip/index.js +8 -0
  361. package/src/packages/tooltip/src/main.js +242 -0
  362. package/src/packages/transfer/index.js +8 -0
  363. package/src/packages/transfer/src/main.vue +231 -0
  364. package/src/packages/transfer/src/transfer-panel.vue +251 -0
  365. package/src/packages/tree/index.js +8 -0
  366. package/src/packages/tree/src/model/node.js +484 -0
  367. package/src/packages/tree/src/model/tree-store.js +340 -0
  368. package/src/packages/tree/src/model/util.js +27 -0
  369. package/src/packages/tree/src/tree-node.vue +279 -0
  370. package/src/packages/tree/src/tree.vue +496 -0
  371. package/src/packages/upload/index.js +8 -0
  372. package/src/packages/upload/src/ajax.js +85 -0
  373. package/src/packages/upload/src/index.vue +338 -0
  374. package/src/packages/upload/src/upload-dragger.vue +70 -0
  375. package/src/packages/upload/src/upload-list.vue +105 -0
  376. package/src/packages/upload/src/upload.vue +211 -0
  377. package/src/src/directives/mousewheel.js +18 -0
  378. package/src/src/directives/repeat-click.js +26 -0
  379. package/src/src/index.js +309 -0
  380. package/src/src/locale/format.js +46 -0
  381. package/src/src/locale/index.js +48 -0
  382. package/src/src/locale/lang/af-ZA.js +123 -0
  383. package/src/src/locale/lang/ar.js +122 -0
  384. package/src/src/locale/lang/az.js +126 -0
  385. package/src/src/locale/lang/bg.js +123 -0
  386. package/src/src/locale/lang/bn.js +126 -0
  387. package/src/src/locale/lang/ca.js +122 -0
  388. package/src/src/locale/lang/cs-CZ.js +125 -0
  389. package/src/src/locale/lang/da.js +122 -0
  390. package/src/src/locale/lang/de.js +124 -0
  391. package/src/src/locale/lang/ee.js +123 -0
  392. package/src/src/locale/lang/el.js +123 -0
  393. package/src/src/locale/lang/en.js +123 -0
  394. package/src/src/locale/lang/eo.js +123 -0
  395. package/src/src/locale/lang/es.js +122 -0
  396. package/src/src/locale/lang/eu.js +123 -0
  397. package/src/src/locale/lang/fa.js +123 -0
  398. package/src/src/locale/lang/fi.js +123 -0
  399. package/src/src/locale/lang/fr.js +122 -0
  400. package/src/src/locale/lang/he.js +123 -0
  401. package/src/src/locale/lang/hr.js +123 -0
  402. package/src/src/locale/lang/hu.js +122 -0
  403. package/src/src/locale/lang/hy-AM.js +123 -0
  404. package/src/src/locale/lang/id.js +123 -0
  405. package/src/src/locale/lang/is.js +124 -0
  406. package/src/src/locale/lang/it.js +122 -0
  407. package/src/src/locale/lang/ja.js +123 -0
  408. package/src/src/locale/lang/kg.js +123 -0
  409. package/src/src/locale/lang/km.js +123 -0
  410. package/src/src/locale/lang/ko.js +123 -0
  411. package/src/src/locale/lang/ku.js +123 -0
  412. package/src/src/locale/lang/kz.js +123 -0
  413. package/src/src/locale/lang/lo-LA.js +126 -0
  414. package/src/src/locale/lang/lt.js +123 -0
  415. package/src/src/locale/lang/lv.js +123 -0
  416. package/src/src/locale/lang/mn.js +123 -0
  417. package/src/src/locale/lang/ms.js +122 -0
  418. package/src/src/locale/lang/nb-NO.js +122 -0
  419. package/src/src/locale/lang/nl.js +123 -0
  420. package/src/src/locale/lang/pl.js +123 -0
  421. package/src/src/locale/lang/pt-br.js +123 -0
  422. package/src/src/locale/lang/pt.js +123 -0
  423. package/src/src/locale/lang/ro.js +123 -0
  424. package/src/src/locale/lang/ru-RU.js +123 -0
  425. package/src/src/locale/lang/si.js +123 -0
  426. package/src/src/locale/lang/sk.js +125 -0
  427. package/src/src/locale/lang/sl.js +123 -0
  428. package/src/src/locale/lang/sr-Latn.js +123 -0
  429. package/src/src/locale/lang/sr.js +123 -0
  430. package/src/src/locale/lang/sv-SE.js +123 -0
  431. package/src/src/locale/lang/sw.js +123 -0
  432. package/src/src/locale/lang/ta.js +122 -0
  433. package/src/src/locale/lang/th.js +123 -0
  434. package/src/src/locale/lang/tk.js +123 -0
  435. package/src/src/locale/lang/tr-TR.js +123 -0
  436. package/src/src/locale/lang/ua.js +123 -0
  437. package/src/src/locale/lang/ug-CN.js +123 -0
  438. package/src/src/locale/lang/uz-UZ.js +123 -0
  439. package/src/src/locale/lang/vi.js +123 -0
  440. package/src/src/locale/lang/zh-CN.js +123 -0
  441. package/src/src/locale/lang/zh-TW.js +123 -0
  442. package/src/src/mixins/emitter.js +33 -0
  443. package/src/src/mixins/focus.js +9 -0
  444. package/src/src/mixins/locale.js +9 -0
  445. package/src/src/mixins/migrating.js +54 -0
  446. package/src/src/transitions/collapse-transition.js +77 -0
  447. package/src/src/utils/after-leave.js +27 -0
  448. package/src/src/utils/aria-dialog.js +90 -0
  449. package/src/src/utils/aria-utils.js +122 -0
  450. package/src/src/utils/clickoutside.js +76 -0
  451. package/src/src/utils/date-util.js +282 -0
  452. package/src/src/utils/date.js +368 -0
  453. package/src/src/utils/dom.js +227 -0
  454. package/src/src/utils/lodash.js +18075 -0
  455. package/src/src/utils/menu/aria-menubar.js +14 -0
  456. package/src/src/utils/menu/aria-menuitem.js +49 -0
  457. package/src/src/utils/menu/aria-submenu.js +59 -0
  458. package/src/src/utils/merge.js +15 -0
  459. package/src/src/utils/popper.js +1276 -0
  460. package/src/src/utils/popup/index.js +218 -0
  461. package/src/src/utils/popup/popup-manager.js +194 -0
  462. package/src/src/utils/resize-event.js +36 -0
  463. package/src/src/utils/scroll-into-view.js +27 -0
  464. package/src/src/utils/scrollbar-width.js +29 -0
  465. package/src/src/utils/shared.js +7 -0
  466. package/src/src/utils/types.js +40 -0
  467. package/src/src/utils/util.js +245 -0
  468. package/src/src/utils/vdom.js +5 -0
  469. package/src/src/utils/vue-popper.js +198 -0
  470. package/src//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243.txt" +125 -0
  471. package/.postcssrc.js +0 -18
  472. package/asy.js +0 -32
  473. package/catch.js +0 -176
  474. package/queue.js +0 -125
  475. package/ske.txt +0 -74
  476. package/src/App.vue +0 -38
  477. package/src/assets/logo.png +0 -0
  478. package/src/components/HelloWorld.vue +0 -37
  479. package/src/components/cache.js +0 -1
  480. package/src/components/cache.vue +0 -70
  481. package/src/main.js +0 -8
@@ -0,0 +1,285 @@
1
+ <template>
2
+ <div
3
+ class="el-autocomplete"
4
+ v-clickoutside="close"
5
+ aria-haspopup="listbox"
6
+ role="combobox"
7
+ :aria-expanded="suggestionVisible"
8
+ :aria-owns="id"
9
+ >
10
+ <el-input
11
+ ref="input"
12
+ v-bind="[$props, $attrs]"
13
+ @input="handleInput"
14
+ @change="handleChange"
15
+ @focus="handleFocus"
16
+ @blur="handleBlur"
17
+ @clear="handleClear"
18
+ @keydown.up.native.prevent="highlight(highlightedIndex - 1)"
19
+ @keydown.down.native.prevent="highlight(highlightedIndex + 1)"
20
+ @keydown.enter.native="handleKeyEnter"
21
+ @keydown.native.tab="close"
22
+ >
23
+ <template slot="prepend" v-if="$slots.prepend">
24
+ <slot name="prepend"></slot>
25
+ </template>
26
+ <template slot="append" v-if="$slots.append">
27
+ <slot name="append"></slot>
28
+ </template>
29
+ <template slot="prefix" v-if="$slots.prefix">
30
+ <slot name="prefix"></slot>
31
+ </template>
32
+ <template slot="suffix" v-if="$slots.suffix">
33
+ <slot name="suffix"></slot>
34
+ </template>
35
+ </el-input>
36
+ <el-autocomplete-suggestions
37
+ visible-arrow
38
+ :class="[popperClass ? popperClass : '']"
39
+ :popper-options="popperOptions"
40
+ :append-to-body="popperAppendToBody"
41
+ ref="suggestions"
42
+ :placement="placement"
43
+ :id="id">
44
+ <li
45
+ v-for="(item, index) in suggestions"
46
+ :key="index"
47
+ :class="{'highlighted': highlightedIndex === index}"
48
+ @click="select(item)"
49
+ :id="`${id}-item-${index}`"
50
+ role="option"
51
+ :aria-selected="highlightedIndex === index"
52
+ >
53
+ <slot :item="item">
54
+ {{ item[valueKey] }}
55
+ </slot>
56
+ </li>
57
+ </el-autocomplete-suggestions>
58
+ </div>
59
+ </template>
60
+ <script>
61
+ import debounce from 'throttle-debounce/debounce';
62
+ import ElInput from 'element-ui/packages/input';
63
+ import Clickoutside from 'element-ui/src/utils/clickoutside';
64
+ import ElAutocompleteSuggestions from './autocomplete-suggestions.vue';
65
+ import Emitter from 'element-ui/src/mixins/emitter';
66
+ import Migrating from 'element-ui/src/mixins/migrating';
67
+ import { generateId } from 'element-ui/src/utils/util';
68
+ import Focus from 'element-ui/src/mixins/focus';
69
+
70
+ export default {
71
+ name: 'ElAutocomplete',
72
+
73
+ mixins: [Emitter, Focus('input'), Migrating],
74
+
75
+ inheritAttrs: false,
76
+
77
+ componentName: 'ElAutocomplete',
78
+
79
+ components: {
80
+ ElInput,
81
+ ElAutocompleteSuggestions
82
+ },
83
+
84
+ directives: { Clickoutside },
85
+
86
+ props: {
87
+ valueKey: {
88
+ type: String,
89
+ default: 'value'
90
+ },
91
+ popperClass: String,
92
+ popperOptions: Object,
93
+ placeholder: String,
94
+ clearable: {
95
+ type: Boolean,
96
+ default: false
97
+ },
98
+ disabled: Boolean,
99
+ name: String,
100
+ size: String,
101
+ value: String,
102
+ maxlength: Number,
103
+ minlength: Number,
104
+ autofocus: Boolean,
105
+ fetchSuggestions: Function,
106
+ triggerOnFocus: {
107
+ type: Boolean,
108
+ default: true
109
+ },
110
+ customItem: String,
111
+ selectWhenUnmatched: {
112
+ type: Boolean,
113
+ default: false
114
+ },
115
+ prefixIcon: String,
116
+ suffixIcon: String,
117
+ label: String,
118
+ debounce: {
119
+ type: Number,
120
+ default: 300
121
+ },
122
+ placement: {
123
+ type: String,
124
+ default: 'bottom-start'
125
+ },
126
+ hideLoading: Boolean,
127
+ popperAppendToBody: {
128
+ type: Boolean,
129
+ default: true
130
+ },
131
+ highlightFirstItem: {
132
+ type: Boolean,
133
+ default: false
134
+ }
135
+ },
136
+ data() {
137
+ return {
138
+ activated: false,
139
+ suggestions: [],
140
+ loading: false,
141
+ highlightedIndex: -1,
142
+ suggestionDisabled: false
143
+ };
144
+ },
145
+ computed: {
146
+ suggestionVisible() {
147
+ const suggestions = this.suggestions;
148
+ let isValidData = Array.isArray(suggestions) && suggestions.length > 0;
149
+ return (isValidData || this.loading) && this.activated;
150
+ },
151
+ id() {
152
+ return `el-autocomplete-${generateId()}`;
153
+ }
154
+ },
155
+ watch: {
156
+ suggestionVisible(val) {
157
+ let $input = this.getInput();
158
+ if ($input) {
159
+ this.broadcast('ElAutocompleteSuggestions', 'visible', [val, $input.offsetWidth]);
160
+ }
161
+ }
162
+ },
163
+ methods: {
164
+ getMigratingConfig() {
165
+ return {
166
+ props: {
167
+ 'custom-item': 'custom-item is removed, use scoped slot instead.',
168
+ 'props': 'props is removed, use value-key instead.'
169
+ }
170
+ };
171
+ },
172
+ getData(queryString) {
173
+ if (this.suggestionDisabled) {
174
+ return;
175
+ }
176
+ this.loading = true;
177
+ this.fetchSuggestions(queryString, (suggestions) => {
178
+ this.loading = false;
179
+ if (this.suggestionDisabled) {
180
+ return;
181
+ }
182
+ if (Array.isArray(suggestions)) {
183
+ this.suggestions = suggestions;
184
+ this.highlightedIndex = this.highlightFirstItem ? 0 : -1;
185
+ } else {
186
+ console.error('[Element Error][Autocomplete]autocomplete suggestions must be an array');
187
+ }
188
+ });
189
+ },
190
+ handleInput(value) {
191
+ this.$emit('input', value);
192
+ this.suggestionDisabled = false;
193
+ if (!this.triggerOnFocus && !value) {
194
+ this.suggestionDisabled = true;
195
+ this.suggestions = [];
196
+ return;
197
+ }
198
+ this.debouncedGetData(value);
199
+ },
200
+ handleChange(value) {
201
+ this.$emit('change', value);
202
+ },
203
+ handleFocus(event) {
204
+ this.activated = true;
205
+ this.$emit('focus', event);
206
+ if (this.triggerOnFocus) {
207
+ this.debouncedGetData(this.value);
208
+ }
209
+ },
210
+ handleBlur(event) {
211
+ this.$emit('blur', event);
212
+ },
213
+ handleClear() {
214
+ this.activated = false;
215
+ this.$emit('clear');
216
+ },
217
+ close(e) {
218
+ this.activated = false;
219
+ },
220
+ handleKeyEnter(e) {
221
+ if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
222
+ e.preventDefault();
223
+ this.select(this.suggestions[this.highlightedIndex]);
224
+ } else if (this.selectWhenUnmatched) {
225
+ this.$emit('select', {value: this.value});
226
+ this.$nextTick(_ => {
227
+ this.suggestions = [];
228
+ this.highlightedIndex = -1;
229
+ });
230
+ }
231
+ },
232
+ select(item) {
233
+ this.$emit('input', item[this.valueKey]);
234
+ this.$emit('select', item);
235
+ this.$nextTick(_ => {
236
+ this.suggestions = [];
237
+ this.highlightedIndex = -1;
238
+ });
239
+ },
240
+ highlight(index) {
241
+ if (!this.suggestionVisible || this.loading) { return; }
242
+ if (index < 0) {
243
+ this.highlightedIndex = -1;
244
+ return;
245
+ }
246
+ if (index >= this.suggestions.length) {
247
+ index = this.suggestions.length - 1;
248
+ }
249
+ const suggestion = this.$refs.suggestions.$el.querySelector('.el-autocomplete-suggestion__wrap');
250
+ const suggestionList = suggestion.querySelectorAll('.el-autocomplete-suggestion__list li');
251
+
252
+ let highlightItem = suggestionList[index];
253
+ let scrollTop = suggestion.scrollTop;
254
+ let offsetTop = highlightItem.offsetTop;
255
+
256
+ if (offsetTop + highlightItem.scrollHeight > (scrollTop + suggestion.clientHeight)) {
257
+ suggestion.scrollTop += highlightItem.scrollHeight;
258
+ }
259
+ if (offsetTop < scrollTop) {
260
+ suggestion.scrollTop -= highlightItem.scrollHeight;
261
+ }
262
+ this.highlightedIndex = index;
263
+ let $input = this.getInput();
264
+ $input.setAttribute('aria-activedescendant', `${this.id}-item-${this.highlightedIndex}`);
265
+ },
266
+ getInput() {
267
+ return this.$refs.input.getInput();
268
+ }
269
+ },
270
+ mounted() {
271
+ this.debouncedGetData = debounce(this.debounce, this.getData);
272
+ this.$on('item-click', item => {
273
+ this.select(item);
274
+ });
275
+ let $input = this.getInput();
276
+ $input.setAttribute('role', 'textbox');
277
+ $input.setAttribute('aria-autocomplete', 'list');
278
+ $input.setAttribute('aria-controls', 'id');
279
+ $input.setAttribute('aria-activedescendant', `${this.id}-item-${this.highlightedIndex}`);
280
+ },
281
+ beforeDestroy() {
282
+ this.$refs.suggestions.$destroy();
283
+ }
284
+ };
285
+ </script>
@@ -0,0 +1,8 @@
1
+ import Avatar from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ Avatar.install = function(Vue) {
5
+ Vue.component(Avatar.name, Avatar);
6
+ };
7
+
8
+ export default Avatar;
@@ -0,0 +1,107 @@
1
+ <script>
2
+ export default {
3
+ name: 'ElAvatar',
4
+
5
+ props: {
6
+ size: {
7
+ type: [Number, String],
8
+ validator(val) {
9
+ if (typeof val === 'string') {
10
+ return ['large', 'medium', 'small'].includes(val);
11
+ }
12
+ return typeof val === 'number';
13
+ }
14
+ },
15
+ shape: {
16
+ type: String,
17
+ default: 'circle',
18
+ validator(val) {
19
+ return ['circle', 'square'].includes(val);
20
+ }
21
+ },
22
+ icon: String,
23
+ src: String,
24
+ alt: String,
25
+ srcSet: String,
26
+ error: Function,
27
+ fit: {
28
+ type: String,
29
+ default: 'cover'
30
+ }
31
+ },
32
+
33
+ data() {
34
+ return {
35
+ isImageExist: true
36
+ };
37
+ },
38
+
39
+ computed: {
40
+ avatarClass() {
41
+ const { size, icon, shape } = this;
42
+ let classList = ['el-avatar'];
43
+
44
+ if (size && typeof size === 'string') {
45
+ classList.push(`el-avatar--${size}`);
46
+ }
47
+
48
+ if (icon) {
49
+ classList.push('el-avatar--icon');
50
+ }
51
+
52
+ if (shape) {
53
+ classList.push(`el-avatar--${shape}`);
54
+ }
55
+
56
+ return classList.join(' ');
57
+ }
58
+ },
59
+
60
+ methods: {
61
+ handleError() {
62
+ const { error } = this;
63
+ const errorFlag = error ? error() : undefined;
64
+ if (errorFlag !== false) {
65
+ this.isImageExist = false;
66
+ }
67
+ },
68
+ renderAvatar() {
69
+ const { icon, src, alt, isImageExist, srcSet, fit } = this;
70
+
71
+ if (isImageExist && src) {
72
+ return <img
73
+ src={src}
74
+ onError={this.handleError}
75
+ alt={alt}
76
+ srcSet={srcSet}
77
+ style={{ 'object-fit': fit }}/>;
78
+ }
79
+
80
+ if (icon) {
81
+ return (<i class={icon} />);
82
+ }
83
+
84
+ return this.$slots.default;
85
+ }
86
+ },
87
+
88
+ render() {
89
+ const { avatarClass, size } = this;
90
+
91
+ const sizeStyle = typeof size === 'number' ? {
92
+ height: `${size}px`,
93
+ width: `${size}px`,
94
+ lineHeight: `${size}px`
95
+ } : {};
96
+
97
+ return (
98
+ <span class={ avatarClass } style={ sizeStyle }>
99
+ {
100
+ this.renderAvatar()
101
+ }
102
+ </span>
103
+ );
104
+ }
105
+
106
+ };
107
+ </script>
@@ -0,0 +1,8 @@
1
+ import Backtop from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ Backtop.install = function(Vue) {
5
+ Vue.component(Backtop.name, Backtop);
6
+ };
7
+
8
+ export default Backtop;
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <transition name="el-fade-in">
3
+ <div
4
+ v-if="visible"
5
+ @click.stop="handleClick"
6
+ :style="{
7
+ 'right': styleRight,
8
+ 'bottom': styleBottom
9
+ }"
10
+ class="el-backtop">
11
+ <slot>
12
+ <el-icon name="caret-top"></el-icon>
13
+ </slot>
14
+ </div>
15
+ </transition>
16
+ </template>
17
+
18
+ <script>
19
+ import throttle from 'throttle-debounce/throttle';
20
+
21
+ const cubic = value => Math.pow(value, 3);
22
+ const easeInOutCubic = value => value < 0.5
23
+ ? cubic(value * 2) / 2
24
+ : 1 - cubic((1 - value) * 2) / 2;
25
+
26
+ export default {
27
+ name: 'ElBacktop',
28
+
29
+ props: {
30
+ visibilityHeight: {
31
+ type: Number,
32
+ default: 200
33
+ },
34
+ target: [String],
35
+ right: {
36
+ type: Number,
37
+ default: 40
38
+ },
39
+ bottom: {
40
+ type: Number,
41
+ default: 40
42
+ }
43
+ },
44
+
45
+ data() {
46
+ return {
47
+ el: null,
48
+ container: null,
49
+ visible: false
50
+ };
51
+ },
52
+
53
+ computed: {
54
+ styleBottom() {
55
+ return `${this.bottom}px`;
56
+ },
57
+ styleRight() {
58
+ return `${this.right}px`;
59
+ }
60
+ },
61
+
62
+ mounted() {
63
+ this.init();
64
+ this.throttledScrollHandler = throttle(300, this.onScroll);
65
+ this.container.addEventListener('scroll', this.throttledScrollHandler);
66
+ },
67
+
68
+ methods: {
69
+ init() {
70
+ this.container = document;
71
+ this.el = document.documentElement;
72
+ if (this.target) {
73
+ this.el = document.querySelector(this.target);
74
+ if (!this.el) {
75
+ throw new Error(`target is not existed: ${this.target}`);
76
+ }
77
+ this.container = this.el;
78
+ }
79
+ },
80
+ onScroll() {
81
+ const scrollTop = this.el.scrollTop;
82
+ this.visible = scrollTop >= this.visibilityHeight;
83
+ },
84
+ handleClick(e) {
85
+ this.scrollToTop();
86
+ this.$emit('click', e);
87
+ },
88
+ scrollToTop() {
89
+ const el = this.el;
90
+ const beginTime = Date.now();
91
+ const beginValue = el.scrollTop;
92
+ const rAF = window.requestAnimationFrame || (func => setTimeout(func, 16));
93
+ const frameFunc = () => {
94
+ const progress = (Date.now() - beginTime) / 500;
95
+ if (progress < 1) {
96
+ el.scrollTop = beginValue * (1 - easeInOutCubic(progress));
97
+ rAF(frameFunc);
98
+ } else {
99
+ el.scrollTop = 0;
100
+ }
101
+ };
102
+ rAF(frameFunc);
103
+ }
104
+ },
105
+
106
+ beforeDestroy() {
107
+ this.container.removeEventListener('scroll', this.throttledScrollHandler);
108
+ }
109
+ };
110
+ </script>
@@ -0,0 +1,8 @@
1
+ import Badge from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ Badge.install = function(Vue) {
5
+ Vue.component(Badge.name, Badge);
6
+ };
7
+
8
+ export default Badge;
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div class="el-badge">
3
+ <slot></slot>
4
+ <transition name="el-zoom-in-center">
5
+ <sup
6
+ v-show="!hidden && (content || content === 0 || isDot)"
7
+ v-text="content"
8
+ class="el-badge__content"
9
+ :class="[
10
+ type ? 'el-badge__content--' + type : null,
11
+ {
12
+ 'is-fixed': $slots.default,
13
+ 'is-dot': isDot
14
+ }
15
+ ]">
16
+ </sup>
17
+ </transition>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: 'ElBadge',
24
+
25
+ props: {
26
+ value: [String, Number],
27
+ max: Number,
28
+ isDot: Boolean,
29
+ hidden: Boolean,
30
+ type: {
31
+ type: String,
32
+ validator(val) {
33
+ return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
34
+ }
35
+ }
36
+ },
37
+
38
+ computed: {
39
+ content() {
40
+ if (this.isDot) return;
41
+
42
+ const value = this.value;
43
+ const max = this.max;
44
+
45
+ if (typeof value === 'number' && typeof max === 'number') {
46
+ return max < value ? `${max}+` : value;
47
+ }
48
+
49
+ return value;
50
+ }
51
+ }
52
+ };
53
+ </script>
@@ -0,0 +1,8 @@
1
+ import ElBreadcrumb from './src/breadcrumb';
2
+
3
+ /* istanbul ignore next */
4
+ ElBreadcrumb.install = function(Vue) {
5
+ Vue.component(ElBreadcrumb.name, ElBreadcrumb);
6
+ };
7
+
8
+ export default ElBreadcrumb;
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <span class="el-breadcrumb__item">
3
+ <span
4
+ :class="['el-breadcrumb__inner', to ? 'is-link' : '']"
5
+ ref="link"
6
+ role="link">
7
+ <slot></slot>
8
+ </span>
9
+ <i v-if="separatorClass" class="el-breadcrumb__separator" :class="separatorClass"></i>
10
+ <span v-else class="el-breadcrumb__separator" role="presentation">{{separator}}</span>
11
+ </span>
12
+ </template>
13
+ <script>
14
+ export default {
15
+ name: 'ElBreadcrumbItem',
16
+ props: {
17
+ to: {},
18
+ replace: Boolean
19
+ },
20
+ data() {
21
+ return {
22
+ separator: '',
23
+ separatorClass: ''
24
+ };
25
+ },
26
+
27
+ inject: ['elBreadcrumb'],
28
+
29
+ mounted() {
30
+ this.separator = this.elBreadcrumb.separator;
31
+ this.separatorClass = this.elBreadcrumb.separatorClass;
32
+ const link = this.$refs.link;
33
+ link.setAttribute('role', 'link');
34
+ link.addEventListener('click', _ => {
35
+ const { to, $router } = this;
36
+ if (!to || !$router) return;
37
+ this.replace ? $router.replace(to) : $router.push(to);
38
+ });
39
+ }
40
+ };
41
+ </script>
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div class="el-breadcrumb" aria-label="Breadcrumb" role="navigation">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ name: 'ElBreadcrumb',
9
+
10
+ props: {
11
+ separator: {
12
+ type: String,
13
+ default: '/'
14
+ },
15
+ separatorClass: {
16
+ type: String,
17
+ default: ''
18
+ }
19
+ },
20
+
21
+ provide() {
22
+ return {
23
+ elBreadcrumb: this
24
+ };
25
+ },
26
+
27
+ mounted() {
28
+ const items = this.$el.querySelectorAll('.el-breadcrumb__item');
29
+ if (items.length) {
30
+ items[items.length - 1].setAttribute('aria-current', 'page');
31
+ }
32
+ }
33
+ };
34
+ </script>
@@ -0,0 +1,8 @@
1
+ import ElBreadcrumbItem from '../breadcrumb/src/breadcrumb-item';
2
+
3
+ /* istanbul ignore next */
4
+ ElBreadcrumbItem.install = function(Vue) {
5
+ Vue.component(ElBreadcrumbItem.name, ElBreadcrumbItem);
6
+ };
7
+
8
+ export default ElBreadcrumbItem;
@@ -0,0 +1,8 @@
1
+ import ElButton from './src/button';
2
+
3
+ /* istanbul ignore next */
4
+ ElButton.install = function(Vue) {
5
+ Vue.component(ElButton.name, ElButton);
6
+ };
7
+
8
+ export default ElButton;
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div class="el-button-group">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ name: 'ElButtonGroup'
9
+ };
10
+ </script>