cy-element-ui 1.0.26 → 1.0.28

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 (928) hide show
  1. package/CHANGELOG.md +280 -280
  2. package/LICENSE +21 -21
  3. package/README.md +162 -171
  4. package/lib/alert.js +203 -211
  5. package/lib/aside.js +80 -80
  6. package/lib/autocomplete.js +465 -4583
  7. package/lib/avatar.js +126 -152
  8. package/lib/backtop.js +198 -190
  9. package/lib/badge.js +134 -128
  10. package/lib/breadcrumb-item.js +122 -146
  11. package/lib/breadcrumb.js +96 -97
  12. package/lib/button-group.js +65 -68
  13. package/lib/button.js +87 -67
  14. package/lib/calendar.js +605 -2416
  15. package/lib/card.js +100 -101
  16. package/lib/carousel-item.js +210 -854
  17. package/lib/carousel.js +411 -578
  18. package/lib/cascader-panel.js +1153 -3542
  19. package/lib/cascader.js +893 -7284
  20. package/lib/checkbox-button.js +290 -337
  21. package/lib/checkbox-group.js +105 -176
  22. package/lib/checkbox.js +220 -240
  23. package/lib/col.js +68 -113
  24. package/lib/collapse-item.js +162 -1250
  25. package/lib/collapse.js +123 -163
  26. package/lib/color-picker.js +1242 -5200
  27. package/lib/container.js +88 -98
  28. package/lib/date-picker.js +4023 -8450
  29. package/lib/descriptions-item.js +32 -53
  30. package/lib/descriptions.js +334 -697
  31. package/lib/dialog.js +247 -1721
  32. package/lib/directives/mousewheel.js +20 -14
  33. package/lib/directives/repeat-click.js +30 -27
  34. package/lib/divider.js +116 -109
  35. package/lib/drawer.js +316 -1110
  36. package/lib/dropdown-item.js +111 -159
  37. package/lib/dropdown-menu.js +117 -2445
  38. package/lib/dropdown.js +392 -1795
  39. package/lib/element-ui.common.js +41037 -46119
  40. package/lib/empty.js +203 -1070
  41. package/lib/footer.js +80 -80
  42. package/lib/form-item.js +467 -1222
  43. package/lib/form.js +258 -326
  44. package/lib/header.js +80 -80
  45. package/lib/icon.js +68 -71
  46. package/lib/image.js +743 -2375
  47. package/lib/index.js +1 -1
  48. package/lib/infinite-scroll.js +150 -814
  49. package/lib/input-number.js +444 -2177
  50. package/lib/input.js +517 -1197
  51. package/lib/link.js +135 -117
  52. package/lib/loading.js +372 -1139
  53. package/lib/locale/format.js +53 -42
  54. package/lib/locale/index.js +52 -38
  55. package/lib/locale/lang/af-ZA.js +123 -130
  56. package/lib/locale/lang/ar.js +122 -123
  57. package/lib/locale/lang/az.js +121 -122
  58. package/lib/locale/lang/bg.js +123 -133
  59. package/lib/locale/lang/bn.js +121 -121
  60. package/lib/locale/lang/ca.js +122 -123
  61. package/lib/locale/lang/cs-CZ.js +125 -127
  62. package/lib/locale/lang/da.js +122 -124
  63. package/lib/locale/lang/de.js +124 -126
  64. package/lib/locale/lang/ee.js +123 -125
  65. package/lib/locale/lang/el.js +123 -125
  66. package/lib/locale/lang/en.js +123 -127
  67. package/lib/locale/lang/eo.js +123 -125
  68. package/lib/locale/lang/es.js +122 -123
  69. package/lib/locale/lang/eu.js +123 -128
  70. package/lib/locale/lang/fa.js +123 -125
  71. package/lib/locale/lang/fi.js +123 -125
  72. package/lib/locale/lang/fr.js +122 -125
  73. package/lib/locale/lang/he.js +123 -130
  74. package/lib/locale/lang/hr.js +123 -128
  75. package/lib/locale/lang/hu.js +122 -124
  76. package/lib/locale/lang/hy-AM.js +123 -125
  77. package/lib/locale/lang/id.js +123 -124
  78. package/lib/locale/lang/is.js +123 -124
  79. package/lib/locale/lang/it.js +122 -123
  80. package/lib/locale/lang/ja.js +123 -125
  81. package/lib/locale/lang/kg.js +123 -125
  82. package/lib/locale/lang/km.js +123 -124
  83. package/lib/locale/lang/ko.js +123 -125
  84. package/lib/locale/lang/ku.js +123 -125
  85. package/lib/locale/lang/kz.js +123 -125
  86. package/lib/locale/lang/lo-LA.js +121 -121
  87. package/lib/locale/lang/lt.js +123 -125
  88. package/lib/locale/lang/lv.js +123 -125
  89. package/lib/locale/lang/mn.js +123 -125
  90. package/lib/locale/lang/ms.js +122 -123
  91. package/lib/locale/lang/nb-NO.js +122 -123
  92. package/lib/locale/lang/nl.js +123 -125
  93. package/lib/locale/lang/pl.js +123 -125
  94. package/lib/locale/lang/pt-br.js +123 -124
  95. package/lib/locale/lang/pt.js +123 -133
  96. package/lib/locale/lang/ro.js +123 -125
  97. package/lib/locale/lang/ru-RU.js +123 -124
  98. package/lib/locale/lang/si.js +123 -127
  99. package/lib/locale/lang/sk.js +125 -126
  100. package/lib/locale/lang/sl.js +123 -125
  101. package/lib/locale/lang/sr-Latn.js +123 -124
  102. package/lib/locale/lang/sr.js +123 -128
  103. package/lib/locale/lang/sv-SE.js +123 -128
  104. package/lib/locale/lang/sw.js +123 -127
  105. package/lib/locale/lang/ta.js +122 -130
  106. package/lib/locale/lang/th.js +123 -127
  107. package/lib/locale/lang/tk.js +123 -129
  108. package/lib/locale/lang/tr-TR.js +123 -125
  109. package/lib/locale/lang/ua.js +123 -124
  110. package/lib/locale/lang/ug-CN.js +123 -124
  111. package/lib/locale/lang/uz-UZ.js +123 -124
  112. package/lib/locale/lang/vi.js +123 -124
  113. package/lib/locale/lang/zh-CN.js +123 -124
  114. package/lib/locale/lang/zh-TW.js +123 -128
  115. package/lib/main.js +67 -69
  116. package/lib/menu-item-group.js +111 -105
  117. package/lib/menu-item.js +259 -3549
  118. package/lib/menu.js +559 -1697
  119. package/lib/message-box.js +693 -3422
  120. package/lib/message.js +229 -1663
  121. package/lib/mixins/emitter.js +30 -28
  122. package/lib/mixins/focus.js +11 -10
  123. package/lib/mixins/locale.js +14 -12
  124. package/lib/mixins/migrating.js +65 -58
  125. package/lib/notification.js +269 -1693
  126. package/lib/option-group.js +139 -190
  127. package/lib/option.js +192 -941
  128. package/lib/page-header.js +92 -1014
  129. package/lib/pagination.js +677 -6969
  130. package/lib/popconfirm.js +223 -3936
  131. package/lib/popover.js +368 -3242
  132. package/lib/progress.js +244 -254
  133. package/lib/radio-button.js +226 -259
  134. package/lib/radio-group.js +186 -249
  135. package/lib/radio.js +253 -263
  136. package/lib/rate.js +416 -1395
  137. package/lib/result.js +233 -189
  138. package/lib/row.js +41 -58
  139. package/lib/scrollbar.js +278 -1331
  140. package/lib/select.js +1347 -5731
  141. package/lib/skeleton-item.js +145 -133
  142. package/lib/skeleton.js +172 -163
  143. package/lib/slider.js +702 -5143
  144. package/lib/spinner.js +101 -113
  145. package/lib/{subTitle.js → statistic.js} +335 -94
  146. package/lib/step.js +311 -274
  147. package/lib/steps.js +117 -854
  148. package/lib/submenu.js +448 -2886
  149. package/lib/switch.js +204 -1036
  150. package/lib/tab-pane.js +135 -125
  151. package/lib/table-column.js +751 -1975
  152. package/lib/table.js +3930 -7956
  153. package/lib/tabs.js +605 -1441
  154. package/lib/tag.js +68 -73
  155. package/lib/theme-chalk/README.md +33 -33
  156. package/lib/theme-chalk/package.json +35 -35
  157. package/lib/theme-chalk/src/alert.scss +147 -147
  158. package/lib/theme-chalk/src/aside.scss +7 -7
  159. package/lib/theme-chalk/src/autocomplete.scss +80 -80
  160. package/lib/theme-chalk/src/avatar.scss +51 -51
  161. package/lib/theme-chalk/src/backtop.scss +22 -22
  162. package/lib/theme-chalk/src/badge.scss +57 -57
  163. package/lib/theme-chalk/src/base.scss +2 -2
  164. package/lib/theme-chalk/src/breadcrumb.scss +55 -55
  165. package/lib/theme-chalk/src/button.scss +262 -262
  166. package/lib/theme-chalk/src/calendar.scss +79 -79
  167. package/lib/theme-chalk/src/card.scss +32 -32
  168. package/lib/theme-chalk/src/carousel-item.scss +50 -50
  169. package/lib/theme-chalk/src/carousel.scss +161 -161
  170. package/lib/theme-chalk/src/cascader-panel.scss +120 -120
  171. package/lib/theme-chalk/src/cascader.scss +182 -182
  172. package/lib/theme-chalk/src/checkbox.scss +359 -359
  173. package/lib/theme-chalk/src/col.scss +156 -156
  174. package/lib/theme-chalk/src/collapse.scss +63 -63
  175. package/lib/theme-chalk/src/color-picker.scss +384 -384
  176. package/lib/theme-chalk/src/common/popup.scss +42 -42
  177. package/lib/theme-chalk/src/common/transition.scss +99 -99
  178. package/lib/theme-chalk/src/common/var.scss +1028 -1028
  179. package/lib/theme-chalk/src/container.scss +14 -14
  180. package/lib/theme-chalk/src/date-picker/date-picker.scss +97 -97
  181. package/lib/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
  182. package/lib/theme-chalk/src/date-picker/date-table.scss +151 -151
  183. package/lib/theme-chalk/src/date-picker/month-table.scss +82 -82
  184. package/lib/theme-chalk/src/date-picker/picker-panel.scss +117 -117
  185. package/lib/theme-chalk/src/date-picker/picker.scss +197 -197
  186. package/lib/theme-chalk/src/date-picker/time-picker.scss +85 -85
  187. package/lib/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
  188. package/lib/theme-chalk/src/date-picker/time-spinner.scss +110 -110
  189. package/lib/theme-chalk/src/date-picker/year-table.scss +51 -51
  190. package/lib/theme-chalk/src/date-picker.scss +11 -11
  191. package/lib/theme-chalk/src/descriptions-item.scss +42 -42
  192. package/lib/theme-chalk/src/descriptions.scss +111 -111
  193. package/lib/theme-chalk/src/dialog.scss +123 -123
  194. package/lib/theme-chalk/src/display.scss +12 -12
  195. package/lib/theme-chalk/src/divider.scss +47 -47
  196. package/lib/theme-chalk/src/drawer.scss +219 -219
  197. package/lib/theme-chalk/src/dropdown.scss +182 -182
  198. package/lib/theme-chalk/src/empty.scss +45 -45
  199. package/lib/theme-chalk/src/footer.scss +8 -8
  200. package/lib/theme-chalk/src/form.scss +167 -167
  201. package/lib/theme-chalk/src/header.scss +8 -8
  202. package/lib/theme-chalk/src/icon.scss +1167 -1167
  203. package/lib/theme-chalk/src/image.scss +179 -179
  204. package/lib/theme-chalk/src/index.scss +90 -89
  205. package/lib/theme-chalk/src/input-number.scss +180 -180
  206. package/lib/theme-chalk/src/input.scss +360 -360
  207. package/lib/theme-chalk/src/link.scss +81 -81
  208. package/lib/theme-chalk/src/loading.scss +96 -96
  209. package/lib/theme-chalk/src/main.scss +12 -12
  210. package/lib/theme-chalk/src/menu.scss +289 -289
  211. package/lib/theme-chalk/src/message-box.scss +226 -226
  212. package/lib/theme-chalk/src/message.scss +120 -120
  213. package/lib/theme-chalk/src/mixins/_button.scss +81 -81
  214. package/lib/theme-chalk/src/mixins/config.scss +4 -4
  215. package/lib/theme-chalk/src/mixins/function.scss +44 -44
  216. package/lib/theme-chalk/src/mixins/mixins.scss +190 -190
  217. package/lib/theme-chalk/src/mixins/utils.scss +39 -39
  218. package/lib/theme-chalk/src/notification.scss +99 -99
  219. package/lib/theme-chalk/src/option-group.scss +42 -42
  220. package/lib/theme-chalk/src/option.scss +36 -36
  221. package/lib/theme-chalk/src/page-header.scss +41 -41
  222. package/lib/theme-chalk/src/pagination.scss +295 -295
  223. package/lib/theme-chalk/src/popconfirm.scss +16 -16
  224. package/lib/theme-chalk/src/popover.scss +40 -40
  225. package/lib/theme-chalk/src/popper.scss +101 -101
  226. package/lib/theme-chalk/src/progress.scss +141 -141
  227. package/lib/theme-chalk/src/radio-button.scss +113 -113
  228. package/lib/theme-chalk/src/radio-group.scss +9 -9
  229. package/lib/theme-chalk/src/radio.scss +199 -199
  230. package/lib/theme-chalk/src/rate.scss +49 -49
  231. package/lib/theme-chalk/src/reset.scss +79 -79
  232. package/lib/theme-chalk/src/result.scss +61 -61
  233. package/lib/theme-chalk/src/row.scss +43 -43
  234. package/lib/theme-chalk/src/scrollbar.scss +72 -72
  235. package/lib/theme-chalk/src/select-dropdown.scss +62 -62
  236. package/lib/theme-chalk/src/select.scss +152 -152
  237. package/lib/theme-chalk/src/skeleton-item.scss +84 -84
  238. package/lib/theme-chalk/src/skeleton.scss +40 -40
  239. package/lib/theme-chalk/src/slider.scss +250 -250
  240. package/lib/theme-chalk/src/spinner.scss +44 -44
  241. package/lib/theme-chalk/src/statistic.scss +38 -0
  242. package/lib/theme-chalk/src/step.scss +317 -317
  243. package/lib/theme-chalk/src/steps.scss +20 -20
  244. package/lib/theme-chalk/src/switch.scss +116 -116
  245. package/lib/theme-chalk/src/table-column.scss +97 -97
  246. package/lib/theme-chalk/src/table.scss +564 -564
  247. package/lib/theme-chalk/src/tabs.scss +602 -602
  248. package/lib/theme-chalk/src/tag.scss +163 -163
  249. package/lib/theme-chalk/src/time-picker.scss +8 -8
  250. package/lib/theme-chalk/src/time-select.scss +37 -37
  251. package/lib/theme-chalk/src/timeline-item.scss +86 -86
  252. package/lib/theme-chalk/src/timeline.scss +14 -14
  253. package/lib/theme-chalk/src/tooltip.scss +141 -141
  254. package/lib/theme-chalk/src/transfer.scss +227 -227
  255. package/lib/theme-chalk/src/tree.scss +123 -123
  256. package/lib/theme-chalk/src/upload.scss +603 -603
  257. package/lib/time-picker.js +1837 -6690
  258. package/lib/time-select.js +1240 -6327
  259. package/lib/timeline-item.js +174 -133
  260. package/lib/timeline.js +39 -43
  261. package/lib/tooltip.js +287 -3184
  262. package/lib/transfer.js +625 -2929
  263. package/lib/transitions/collapse-transition.js +87 -69
  264. package/lib/tree.js +1741 -3248
  265. package/lib/treeselect.js +682 -0
  266. package/lib/umd/locale/af-ZA.js +138 -145
  267. package/lib/umd/locale/ar.js +137 -138
  268. package/lib/umd/locale/az.js +137 -139
  269. package/lib/umd/locale/bg.js +138 -148
  270. package/lib/umd/locale/bn.js +137 -138
  271. package/lib/umd/locale/ca.js +137 -138
  272. package/lib/umd/locale/cs-CZ.js +140 -142
  273. package/lib/umd/locale/da.js +137 -139
  274. package/lib/umd/locale/de.js +139 -141
  275. package/lib/umd/locale/ee.js +138 -140
  276. package/lib/umd/locale/el.js +138 -140
  277. package/lib/umd/locale/en.js +138 -142
  278. package/lib/umd/locale/eo.js +138 -140
  279. package/lib/umd/locale/es.js +137 -138
  280. package/lib/umd/locale/eu.js +138 -143
  281. package/lib/umd/locale/fa.js +138 -140
  282. package/lib/umd/locale/fi.js +138 -140
  283. package/lib/umd/locale/fr.js +137 -140
  284. package/lib/umd/locale/he.js +138 -145
  285. package/lib/umd/locale/hr.js +138 -143
  286. package/lib/umd/locale/hu.js +137 -139
  287. package/lib/umd/locale/hy-AM.js +138 -140
  288. package/lib/umd/locale/id.js +138 -139
  289. package/lib/umd/locale/is.js +138 -139
  290. package/lib/umd/locale/it.js +137 -138
  291. package/lib/umd/locale/ja.js +138 -140
  292. package/lib/umd/locale/kg.js +138 -140
  293. package/lib/umd/locale/km.js +138 -139
  294. package/lib/umd/locale/ko.js +138 -140
  295. package/lib/umd/locale/ku.js +138 -140
  296. package/lib/umd/locale/kz.js +138 -140
  297. package/lib/umd/locale/lo-LA.js +137 -138
  298. package/lib/umd/locale/lt.js +138 -140
  299. package/lib/umd/locale/lv.js +138 -140
  300. package/lib/umd/locale/mn.js +138 -140
  301. package/lib/umd/locale/ms.js +137 -138
  302. package/lib/umd/locale/nb-NO.js +137 -138
  303. package/lib/umd/locale/nl.js +138 -140
  304. package/lib/umd/locale/pl.js +138 -140
  305. package/lib/umd/locale/pt-br.js +138 -139
  306. package/lib/umd/locale/pt.js +138 -148
  307. package/lib/umd/locale/ro.js +138 -140
  308. package/lib/umd/locale/ru-RU.js +138 -139
  309. package/lib/umd/locale/si.js +138 -142
  310. package/lib/umd/locale/sk.js +140 -141
  311. package/lib/umd/locale/sl.js +138 -140
  312. package/lib/umd/locale/sr-Latn.js +138 -139
  313. package/lib/umd/locale/sr.js +138 -143
  314. package/lib/umd/locale/sv-SE.js +138 -143
  315. package/lib/umd/locale/sw.js +138 -142
  316. package/lib/umd/locale/ta.js +137 -145
  317. package/lib/umd/locale/th.js +138 -142
  318. package/lib/umd/locale/tk.js +138 -144
  319. package/lib/umd/locale/tr-TR.js +138 -140
  320. package/lib/umd/locale/ua.js +138 -139
  321. package/lib/umd/locale/ug-CN.js +138 -139
  322. package/lib/umd/locale/uz-UZ.js +138 -139
  323. package/lib/umd/locale/vi.js +138 -139
  324. package/lib/umd/locale/zh-CN.js +138 -139
  325. package/lib/umd/locale/zh-TW.js +138 -143
  326. package/lib/upload.js +989 -2375
  327. package/lib/utils/after-leave.js +33 -36
  328. package/lib/utils/aria-dialog.js +89 -71
  329. package/lib/utils/aria-utils.js +101 -92
  330. package/lib/utils/clickoutside.js +67 -59
  331. package/lib/utils/date-util.js +241 -198
  332. package/lib/utils/date.js +369 -14
  333. package/lib/utils/dom.js +183 -167
  334. package/lib/utils/lodash.js +9421 -13
  335. package/lib/utils/menu/aria-menubar.js +18 -13
  336. package/lib/utils/menu/aria-menuitem.js +54 -43
  337. package/lib/utils/menu/aria-submenu.js +59 -50
  338. package/lib/utils/merge.js +17 -15
  339. package/lib/utils/popper.js +1196 -1167
  340. package/lib/utils/popup/index.js +230 -186
  341. package/lib/utils/popup/popup-manager.js +191 -159
  342. package/lib/utils/resize-event.js +44 -29
  343. package/lib/utils/scroll-into-view.js +33 -25
  344. package/lib/utils/scrollbar-width.js +36 -25
  345. package/lib/utils/shared.js +3 -3
  346. package/lib/utils/types.js +35 -22
  347. package/lib/utils/util.js +221 -187
  348. package/lib/utils/vdom.js +9 -5
  349. package/lib/utils/vue-popper.js +195 -173
  350. package/package.json +156 -160
  351. package/packages/alert/index.js +8 -8
  352. package/packages/alert/src/main.vue +94 -94
  353. package/packages/aside/index.js +8 -8
  354. package/packages/aside/src/main.vue +20 -20
  355. package/packages/autocomplete/index.js +8 -8
  356. package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -76
  357. package/packages/autocomplete/src/autocomplete.vue +285 -285
  358. package/packages/avatar/index.js +8 -8
  359. package/packages/avatar/src/main.vue +107 -107
  360. package/packages/backtop/index.js +8 -8
  361. package/packages/backtop/src/main.vue +110 -110
  362. package/packages/badge/index.js +8 -8
  363. package/packages/badge/src/main.vue +53 -53
  364. package/packages/breadcrumb/index.js +8 -8
  365. package/packages/breadcrumb/src/breadcrumb-item.vue +41 -41
  366. package/packages/breadcrumb/src/breadcrumb.vue +34 -34
  367. package/packages/breadcrumb-item/index.js +8 -8
  368. package/packages/button/index.js +8 -8
  369. package/packages/button/src/button-group.vue +10 -10
  370. package/packages/button/src/button.vue +78 -78
  371. package/packages/button-group/index.js +8 -8
  372. package/packages/calendar/index.js +8 -8
  373. package/packages/calendar/src/date-table.vue +200 -200
  374. package/packages/calendar/src/main.vue +280 -280
  375. package/packages/card/index.js +8 -8
  376. package/packages/card/src/main.vue +23 -23
  377. package/packages/carousel/index.js +8 -8
  378. package/packages/carousel/src/item.vue +138 -138
  379. package/packages/carousel/src/main.vue +315 -315
  380. package/packages/carousel-item/index.js +8 -8
  381. package/packages/cascader/index.js +8 -8
  382. package/packages/cascader/src/cascader.vue +663 -663
  383. package/packages/cascader-panel/index.js +8 -8
  384. package/packages/cascader-panel/src/cascader-menu.vue +138 -138
  385. package/packages/cascader-panel/src/cascader-node.vue +246 -246
  386. package/packages/cascader-panel/src/cascader-panel.vue +391 -391
  387. package/packages/cascader-panel/src/node.js +166 -165
  388. package/packages/cascader-panel/src/store.js +58 -57
  389. package/packages/checkbox/index.js +8 -8
  390. package/packages/checkbox/src/checkbox-button.vue +199 -199
  391. package/packages/checkbox/src/checkbox-group.vue +48 -48
  392. package/packages/checkbox/src/checkbox.vue +222 -222
  393. package/packages/checkbox-button/index.js +8 -8
  394. package/packages/checkbox-group/index.js +8 -8
  395. package/packages/col/index.js +9 -9
  396. package/packages/col/src/col.js +71 -71
  397. package/packages/collapse/index.js +9 -9
  398. package/packages/collapse/src/collapse-item.vue +114 -114
  399. package/packages/collapse/src/collapse.vue +73 -73
  400. package/packages/collapse-item/index.js +8 -8
  401. package/packages/color-picker/index.js +8 -8
  402. package/packages/color-picker/src/color.js +317 -317
  403. package/packages/color-picker/src/components/alpha-slider.vue +132 -132
  404. package/packages/color-picker/src/components/hue-slider.vue +123 -123
  405. package/packages/color-picker/src/components/picker-dropdown.vue +121 -121
  406. package/packages/color-picker/src/components/predefine.vue +61 -61
  407. package/packages/color-picker/src/components/sv-panel.vue +100 -100
  408. package/packages/color-picker/src/draggable.js +36 -36
  409. package/packages/color-picker/src/main.vue +188 -188
  410. package/packages/container/index.js +8 -8
  411. package/packages/container/src/main.vue +33 -33
  412. package/packages/date-picker/index.js +8 -8
  413. package/packages/date-picker/src/basic/date-table.vue +441 -441
  414. package/packages/date-picker/src/basic/month-table.vue +269 -268
  415. package/packages/date-picker/src/basic/time-spinner.vue +304 -304
  416. package/packages/date-picker/src/basic/year-table.vue +111 -111
  417. package/packages/date-picker/src/panel/date-range.vue +680 -680
  418. package/packages/date-picker/src/panel/date.vue +609 -609
  419. package/packages/date-picker/src/panel/month-range.vue +289 -289
  420. package/packages/date-picker/src/panel/time-range.vue +248 -248
  421. package/packages/date-picker/src/panel/time-select.vue +178 -178
  422. package/packages/date-picker/src/panel/time.vue +186 -186
  423. package/packages/date-picker/src/picker/date-picker.js +43 -43
  424. package/packages/date-picker/src/picker/time-picker.js +39 -39
  425. package/packages/date-picker/src/picker/time-select.js +21 -21
  426. package/packages/date-picker/src/picker.vue +956 -956
  427. package/packages/descriptions/index.js +8 -8
  428. package/packages/descriptions/src/descriptions-item.js +30 -30
  429. package/packages/descriptions/src/descriptions-row.js +116 -116
  430. package/packages/descriptions/src/index.js +180 -180
  431. package/packages/descriptions-item/index.js +8 -8
  432. package/packages/dialog/index.js +8 -8
  433. package/packages/dialog/src/component.vue +212 -212
  434. package/packages/divider/index.js +8 -8
  435. package/packages/divider/src/main.vue +37 -37
  436. package/packages/drawer/index.js +8 -8
  437. package/packages/drawer/src/main.vue +205 -205
  438. package/packages/dropdown/index.js +8 -8
  439. package/packages/dropdown/src/dropdown-item.vue +37 -37
  440. package/packages/dropdown/src/dropdown-menu.vue +63 -63
  441. package/packages/dropdown/src/dropdown.vue +293 -293
  442. package/packages/dropdown-item/index.js +8 -8
  443. package/packages/dropdown-menu/index.js +8 -8
  444. package/packages/empty/index.js +7 -7
  445. package/packages/empty/src/img-empty.vue +132 -132
  446. package/packages/empty/src/index.vue +50 -50
  447. package/packages/footer/index.js +8 -8
  448. package/packages/footer/src/main.vue +20 -20
  449. package/packages/form/index.js +8 -8
  450. package/packages/form/src/form-item.vue +324 -324
  451. package/packages/form/src/form.vue +182 -182
  452. package/packages/form/src/label-wrap.vue +78 -78
  453. package/packages/form-item/index.js +8 -8
  454. package/packages/header/index.js +8 -8
  455. package/packages/header/src/main.vue +20 -20
  456. package/packages/icon/index.js +8 -8
  457. package/packages/icon/src/icon.vue +13 -13
  458. package/packages/image/index.js +8 -8
  459. package/packages/image/src/image-viewer.vue +330 -330
  460. package/packages/image/src/main.vue +249 -249
  461. package/packages/infinite-scroll/index.js +8 -8
  462. package/packages/infinite-scroll/src/main.js +150 -149
  463. package/packages/input/index.js +8 -8
  464. package/packages/input/src/calcTextareaHeight.js +104 -104
  465. package/packages/input/src/input.vue +440 -440
  466. package/packages/input-number/index.js +8 -8
  467. package/packages/input-number/src/input-number.vue +283 -283
  468. package/packages/link/index.js +8 -8
  469. package/packages/link/src/main.vue +53 -53
  470. package/packages/loading/index.js +11 -11
  471. package/packages/loading/src/directive.js +133 -133
  472. package/packages/loading/src/index.js +106 -106
  473. package/packages/loading/src/loading.vue +41 -41
  474. package/packages/main/index.js +8 -8
  475. package/packages/main/src/main.vue +12 -12
  476. package/packages/menu/index.js +8 -8
  477. package/packages/menu/src/menu-item-group.vue +45 -45
  478. package/packages/menu/src/menu-item.vue +112 -112
  479. package/packages/menu/src/menu-mixin.js +44 -44
  480. package/packages/menu/src/menu.vue +325 -325
  481. package/packages/menu/src/submenu.vue +349 -348
  482. package/packages/menu-item/index.js +8 -8
  483. package/packages/menu-item-group/index.js +8 -8
  484. package/packages/message/index.js +2 -2
  485. package/packages/message/src/main.js +91 -91
  486. package/packages/message/src/main.vue +117 -117
  487. package/packages/message-box/index.js +2 -2
  488. package/packages/message-box/src/main.js +216 -216
  489. package/packages/message-box/src/main.vue +332 -332
  490. package/packages/notification/index.js +2 -2
  491. package/packages/notification/src/main.js +94 -94
  492. package/packages/notification/src/main.vue +152 -152
  493. package/packages/option/index.js +8 -8
  494. package/packages/option-group/index.js +8 -8
  495. package/packages/page-header/index.js +8 -8
  496. package/packages/page-header/src/main.vue +30 -30
  497. package/packages/pagination/index.js +8 -8
  498. package/packages/pagination/src/pager.vue +163 -163
  499. package/packages/pagination/src/pagination.js +386 -386
  500. package/packages/popconfirm/index.js +8 -8
  501. package/packages/popconfirm/src/main.vue +104 -104
  502. package/packages/popover/index.js +14 -14
  503. package/packages/popover/src/directive.js +20 -20
  504. package/packages/popover/src/main.vue +237 -237
  505. package/packages/progress/index.js +8 -8
  506. package/packages/progress/src/progress.vue +235 -235
  507. package/packages/radio/index.js +8 -8
  508. package/packages/radio/src/radio-button.vue +115 -115
  509. package/packages/radio/src/radio-group.vue +113 -113
  510. package/packages/radio/src/radio.vue +134 -134
  511. package/packages/radio-button/index.js +8 -8
  512. package/packages/radio-group/index.js +8 -8
  513. package/packages/rate/index.js +8 -8
  514. package/packages/rate/src/main.vue +348 -348
  515. package/packages/result/index.js +8 -8
  516. package/packages/result/src/icon-error.vue +13 -13
  517. package/packages/result/src/icon-info.vue +13 -13
  518. package/packages/result/src/icon-success.vue +13 -13
  519. package/packages/result/src/icon-warning.vue +13 -13
  520. package/packages/result/src/index.vue +65 -65
  521. package/packages/row/index.js +9 -9
  522. package/packages/row/src/row.js +44 -44
  523. package/packages/scrollbar/index.js +8 -8
  524. package/packages/scrollbar/src/bar.js +92 -92
  525. package/packages/scrollbar/src/main.js +130 -130
  526. package/packages/scrollbar/src/util.js +34 -34
  527. package/packages/select/index.js +8 -8
  528. package/packages/select/src/navigation-mixin.js +54 -54
  529. package/packages/select/src/option-group.vue +60 -60
  530. package/packages/select/src/option.vue +168 -168
  531. package/packages/select/src/select-dropdown.vue +74 -74
  532. package/packages/select/src/select.vue +900 -900
  533. package/packages/skeleton/index.js +8 -8
  534. package/packages/skeleton/src/img-placeholder.vue +16 -16
  535. package/packages/skeleton/src/index.vue +76 -76
  536. package/packages/skeleton/src/item.vue +22 -22
  537. package/packages/skeleton-item/index.js +8 -8
  538. package/packages/slider/index.js +8 -8
  539. package/packages/slider/src/button.vue +238 -238
  540. package/packages/slider/src/main.vue +427 -427
  541. package/packages/slider/src/marker.js +18 -18
  542. package/packages/spinner/index.js +8 -8
  543. package/packages/spinner/src/spinner.vue +27 -27
  544. package/packages/statistic/index.js +8 -0
  545. package/packages/statistic/src/main.vue +204 -0
  546. package/packages/step/index.js +8 -8
  547. package/packages/steps/README.md +69 -69
  548. package/packages/steps/index.js +8 -8
  549. package/packages/steps/src/step.vue +184 -184
  550. package/packages/steps/src/steps.vue +68 -68
  551. package/packages/submenu/index.js +8 -8
  552. package/packages/switch/index.js +9 -9
  553. package/packages/switch/src/component.vue +174 -174
  554. package/packages/tab-pane/index.js +8 -8
  555. package/packages/table/index.js +8 -8
  556. package/packages/table/src/config.js +124 -124
  557. package/packages/table/src/dropdown.js +28 -28
  558. package/packages/table/src/filter-panel.vue +194 -194
  559. package/packages/table/src/layout-observer.js +68 -68
  560. package/packages/table/src/store/current.js +76 -76
  561. package/packages/table/src/store/expand.js +65 -65
  562. package/packages/table/src/store/helper.js +41 -41
  563. package/packages/table/src/store/index.js +147 -147
  564. package/packages/table/src/store/tree.js +209 -209
  565. package/packages/table/src/store/watcher.js +381 -381
  566. package/packages/table/src/table-body.js +469 -469
  567. package/packages/table/src/table-column.js +319 -319
  568. package/packages/table/src/table-footer.js +153 -153
  569. package/packages/table/src/table-header.js +511 -511
  570. package/packages/table/src/table-layout.js +249 -249
  571. package/packages/table/src/table-row.js +101 -101
  572. package/packages/table/src/table.vue +712 -712
  573. package/packages/table/src/util.js +273 -273
  574. package/packages/table-column/index.js +8 -8
  575. package/packages/tabs/index.js +8 -8
  576. package/packages/tabs/src/tab-bar.vue +57 -57
  577. package/packages/tabs/src/tab-nav.vue +294 -294
  578. package/packages/tabs/src/tab-pane.vue +56 -56
  579. package/packages/tabs/src/tabs.vue +191 -191
  580. package/packages/tag/index.js +8 -8
  581. package/packages/tag/src/tag.vue +58 -58
  582. package/packages/theme-chalk/README.md +33 -33
  583. package/packages/theme-chalk/package.json +35 -35
  584. package/packages/theme-chalk/src/alert.scss +147 -147
  585. package/packages/theme-chalk/src/aside.scss +7 -7
  586. package/packages/theme-chalk/src/autocomplete.scss +80 -80
  587. package/packages/theme-chalk/src/avatar.scss +51 -51
  588. package/packages/theme-chalk/src/backtop.scss +22 -22
  589. package/packages/theme-chalk/src/badge.scss +57 -57
  590. package/packages/theme-chalk/src/base.scss +2 -2
  591. package/packages/theme-chalk/src/breadcrumb.scss +55 -55
  592. package/packages/theme-chalk/src/button.scss +262 -262
  593. package/packages/theme-chalk/src/calendar.scss +79 -79
  594. package/packages/theme-chalk/src/card.scss +32 -32
  595. package/packages/theme-chalk/src/carousel-item.scss +50 -50
  596. package/packages/theme-chalk/src/carousel.scss +161 -161
  597. package/packages/theme-chalk/src/cascader-panel.scss +120 -120
  598. package/packages/theme-chalk/src/cascader.scss +182 -182
  599. package/packages/theme-chalk/src/checkbox.scss +359 -359
  600. package/packages/theme-chalk/src/col.scss +156 -156
  601. package/packages/theme-chalk/src/collapse.scss +63 -63
  602. package/packages/theme-chalk/src/color-picker.scss +384 -384
  603. package/packages/theme-chalk/src/common/popup.scss +42 -42
  604. package/packages/theme-chalk/src/common/transition.scss +99 -99
  605. package/packages/theme-chalk/src/common/var.scss +1028 -1028
  606. package/packages/theme-chalk/src/container.scss +14 -14
  607. package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -97
  608. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
  609. package/packages/theme-chalk/src/date-picker/date-table.scss +151 -151
  610. package/packages/theme-chalk/src/date-picker/month-table.scss +82 -82
  611. package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -117
  612. package/packages/theme-chalk/src/date-picker/picker.scss +197 -197
  613. package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -85
  614. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
  615. package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -110
  616. package/packages/theme-chalk/src/date-picker/year-table.scss +51 -51
  617. package/packages/theme-chalk/src/date-picker.scss +11 -11
  618. package/packages/theme-chalk/src/descriptions-item.scss +42 -42
  619. package/packages/theme-chalk/src/descriptions.scss +111 -111
  620. package/packages/theme-chalk/src/dialog.scss +123 -123
  621. package/packages/theme-chalk/src/display.scss +12 -12
  622. package/packages/theme-chalk/src/divider.scss +47 -47
  623. package/packages/theme-chalk/src/drawer.scss +219 -219
  624. package/packages/theme-chalk/src/dropdown.scss +182 -182
  625. package/packages/theme-chalk/src/empty.scss +45 -45
  626. package/packages/theme-chalk/src/footer.scss +8 -8
  627. package/packages/theme-chalk/src/form.scss +167 -167
  628. package/packages/theme-chalk/src/header.scss +8 -8
  629. package/packages/theme-chalk/src/icon.scss +1167 -1167
  630. package/packages/theme-chalk/src/image.scss +179 -179
  631. package/packages/theme-chalk/src/index.scss +90 -89
  632. package/packages/theme-chalk/src/input-number.scss +180 -180
  633. package/packages/theme-chalk/src/input.scss +360 -360
  634. package/packages/theme-chalk/src/link.scss +81 -81
  635. package/packages/theme-chalk/src/loading.scss +96 -96
  636. package/packages/theme-chalk/src/main.scss +12 -12
  637. package/packages/theme-chalk/src/menu.scss +289 -289
  638. package/packages/theme-chalk/src/message-box.scss +226 -226
  639. package/packages/theme-chalk/src/message.scss +120 -120
  640. package/packages/theme-chalk/src/mixins/_button.scss +81 -81
  641. package/packages/theme-chalk/src/mixins/config.scss +4 -4
  642. package/packages/theme-chalk/src/mixins/function.scss +44 -44
  643. package/packages/theme-chalk/src/mixins/mixins.scss +190 -190
  644. package/packages/theme-chalk/src/mixins/utils.scss +39 -39
  645. package/packages/theme-chalk/src/notification.scss +99 -99
  646. package/packages/theme-chalk/src/option-group.scss +42 -42
  647. package/packages/theme-chalk/src/option.scss +36 -36
  648. package/packages/theme-chalk/src/page-header.scss +41 -41
  649. package/packages/theme-chalk/src/pagination.scss +295 -295
  650. package/packages/theme-chalk/src/popconfirm.scss +16 -16
  651. package/packages/theme-chalk/src/popover.scss +40 -40
  652. package/packages/theme-chalk/src/popper.scss +101 -101
  653. package/packages/theme-chalk/src/progress.scss +141 -141
  654. package/packages/theme-chalk/src/radio-button.scss +113 -113
  655. package/packages/theme-chalk/src/radio-group.scss +9 -9
  656. package/packages/theme-chalk/src/radio.scss +199 -199
  657. package/packages/theme-chalk/src/rate.scss +49 -49
  658. package/packages/theme-chalk/src/reset.scss +79 -79
  659. package/packages/theme-chalk/src/result.scss +61 -61
  660. package/packages/theme-chalk/src/row.scss +43 -43
  661. package/packages/theme-chalk/src/scrollbar.scss +72 -72
  662. package/packages/theme-chalk/src/select-dropdown.scss +62 -62
  663. package/packages/theme-chalk/src/select.scss +152 -152
  664. package/packages/theme-chalk/src/skeleton-item.scss +84 -84
  665. package/packages/theme-chalk/src/skeleton.scss +40 -40
  666. package/packages/theme-chalk/src/slider.scss +250 -250
  667. package/packages/theme-chalk/src/spinner.scss +44 -44
  668. package/packages/theme-chalk/src/statistic.scss +38 -0
  669. package/packages/theme-chalk/src/step.scss +317 -317
  670. package/packages/theme-chalk/src/steps.scss +20 -20
  671. package/packages/theme-chalk/src/switch.scss +116 -116
  672. package/packages/theme-chalk/src/table-column.scss +97 -97
  673. package/packages/theme-chalk/src/table.scss +564 -564
  674. package/packages/theme-chalk/src/tabs.scss +602 -602
  675. package/packages/theme-chalk/src/tag.scss +163 -163
  676. package/packages/theme-chalk/src/time-picker.scss +8 -8
  677. package/packages/theme-chalk/src/time-select.scss +37 -37
  678. package/packages/theme-chalk/src/timeline-item.scss +86 -86
  679. package/packages/theme-chalk/src/timeline.scss +14 -14
  680. package/packages/theme-chalk/src/tooltip.scss +141 -141
  681. package/packages/theme-chalk/src/transfer.scss +227 -227
  682. package/packages/theme-chalk/src/tree.scss +123 -123
  683. package/packages/theme-chalk/src/upload.scss +603 -603
  684. package/packages/theme-cy/README.md +38 -38
  685. package/packages/theme-cy/lib/index.css +1 -1
  686. package/packages/theme-cy/lib/treeselect.css +1 -1
  687. package/packages/theme-cy/package.json +35 -35
  688. package/packages/theme-cy/src/index.scss +0 -4
  689. package/packages/theme-cy/src/treeselect.scss +87 -93
  690. package/packages/time-picker/index.js +8 -8
  691. package/packages/time-select/index.js +8 -8
  692. package/packages/timeline/index.js +8 -8
  693. package/packages/timeline/src/item.vue +73 -73
  694. package/packages/timeline/src/main.vue +33 -33
  695. package/packages/timeline-item/index.js +8 -8
  696. package/packages/tooltip/index.js +8 -8
  697. package/packages/tooltip/src/main.js +242 -242
  698. package/packages/transfer/index.js +8 -8
  699. package/packages/transfer/src/main.vue +231 -231
  700. package/packages/transfer/src/transfer-panel.vue +251 -251
  701. package/packages/tree/index.js +8 -8
  702. package/packages/tree/src/model/node.js +484 -484
  703. package/packages/tree/src/model/tree-store.js +340 -340
  704. package/packages/tree/src/model/util.js +27 -27
  705. package/packages/tree/src/tree-node.vue +279 -279
  706. package/packages/tree/src/tree.vue +496 -496
  707. package/packages/treeselect/index.js +8 -0
  708. package/packages/{treeSelect → treeselect}/src/main.vue +243 -243
  709. package/packages/upload/index.js +8 -8
  710. package/packages/upload/src/ajax.js +85 -85
  711. package/packages/upload/src/index.vue +338 -338
  712. package/packages/upload/src/upload-dragger.vue +70 -70
  713. package/packages/upload/src/upload-list.vue +105 -105
  714. package/packages/upload/src/upload.vue +211 -211
  715. package/src/directives/mousewheel.js +18 -18
  716. package/src/directives/repeat-click.js +26 -26
  717. package/src/index.js +8 -13
  718. package/src/locale/format.js +46 -45
  719. package/src/locale/index.js +48 -48
  720. package/src/locale/lang/af-ZA.js +123 -123
  721. package/src/locale/lang/ar.js +122 -122
  722. package/src/locale/lang/az.js +126 -126
  723. package/src/locale/lang/bg.js +123 -123
  724. package/src/locale/lang/bn.js +126 -126
  725. package/src/locale/lang/ca.js +122 -122
  726. package/src/locale/lang/cs-CZ.js +125 -125
  727. package/src/locale/lang/da.js +122 -122
  728. package/src/locale/lang/de.js +124 -124
  729. package/src/locale/lang/ee.js +123 -123
  730. package/src/locale/lang/el.js +123 -123
  731. package/src/locale/lang/en.js +123 -123
  732. package/src/locale/lang/eo.js +123 -123
  733. package/src/locale/lang/es.js +122 -122
  734. package/src/locale/lang/eu.js +123 -123
  735. package/src/locale/lang/fa.js +123 -123
  736. package/src/locale/lang/fi.js +123 -123
  737. package/src/locale/lang/fr.js +122 -122
  738. package/src/locale/lang/he.js +123 -123
  739. package/src/locale/lang/hr.js +123 -123
  740. package/src/locale/lang/hu.js +122 -122
  741. package/src/locale/lang/hy-AM.js +123 -123
  742. package/src/locale/lang/id.js +123 -123
  743. package/src/locale/lang/is.js +124 -124
  744. package/src/locale/lang/it.js +122 -122
  745. package/src/locale/lang/ja.js +123 -123
  746. package/src/locale/lang/kg.js +123 -123
  747. package/src/locale/lang/km.js +123 -123
  748. package/src/locale/lang/ko.js +123 -123
  749. package/src/locale/lang/ku.js +123 -123
  750. package/src/locale/lang/kz.js +123 -123
  751. package/src/locale/lang/lo-LA.js +126 -126
  752. package/src/locale/lang/lt.js +123 -123
  753. package/src/locale/lang/lv.js +123 -123
  754. package/src/locale/lang/mn.js +123 -123
  755. package/src/locale/lang/ms.js +122 -122
  756. package/src/locale/lang/nb-NO.js +122 -122
  757. package/src/locale/lang/nl.js +123 -123
  758. package/src/locale/lang/pl.js +123 -123
  759. package/src/locale/lang/pt-br.js +123 -123
  760. package/src/locale/lang/pt.js +123 -123
  761. package/src/locale/lang/ro.js +123 -123
  762. package/src/locale/lang/ru-RU.js +123 -123
  763. package/src/locale/lang/si.js +123 -123
  764. package/src/locale/lang/sk.js +125 -125
  765. package/src/locale/lang/sl.js +123 -123
  766. package/src/locale/lang/sr-Latn.js +123 -123
  767. package/src/locale/lang/sr.js +123 -123
  768. package/src/locale/lang/sv-SE.js +123 -123
  769. package/src/locale/lang/ta.js +122 -122
  770. package/src/locale/lang/th.js +123 -123
  771. package/src/locale/lang/tk.js +123 -123
  772. package/src/locale/lang/tr-TR.js +123 -123
  773. package/src/locale/lang/ua.js +123 -123
  774. package/src/locale/lang/ug-CN.js +123 -123
  775. package/src/locale/lang/uz-UZ.js +123 -123
  776. package/src/locale/lang/vi.js +123 -123
  777. package/src/locale/lang/zh-CN.js +123 -123
  778. package/src/locale/lang/zh-TW.js +123 -123
  779. package/src/mixins/emitter.js +33 -33
  780. package/src/mixins/focus.js +9 -9
  781. package/src/mixins/locale.js +9 -9
  782. package/src/mixins/migrating.js +54 -54
  783. package/src/transitions/collapse-transition.js +77 -77
  784. package/src/utils/after-leave.js +27 -27
  785. package/src/utils/aria-dialog.js +90 -90
  786. package/src/utils/aria-utils.js +122 -122
  787. package/src/utils/clickoutside.js +76 -76
  788. package/src/utils/date-util.js +282 -282
  789. package/src/utils/date.js +368 -2
  790. package/src/utils/dom.js +227 -227
  791. package/src/utils/lodash.js +18075 -9
  792. package/src/utils/menu/aria-menubar.js +14 -14
  793. package/src/utils/menu/aria-menuitem.js +49 -49
  794. package/src/utils/menu/aria-submenu.js +59 -59
  795. package/src/utils/merge.js +15 -15
  796. package/src/utils/popper.js +1276 -1276
  797. package/src/utils/popup/index.js +218 -218
  798. package/src/utils/popup/popup-manager.js +194 -194
  799. package/src/utils/resize-event.js +36 -36
  800. package/src/utils/scroll-into-view.js +27 -27
  801. package/src/utils/scrollbar-width.js +29 -29
  802. package/src/utils/shared.js +7 -7
  803. package/src/utils/types.js +40 -40
  804. package/src/utils/util.js +245 -245
  805. package/src/utils/vdom.js +5 -5
  806. package/src/utils/vue-popper.js +198 -198
  807. package/types/alert.d.ts +31 -31
  808. package/types/aside.d.ts +7 -7
  809. package/types/autocomplete.d.ts +78 -78
  810. package/types/avatar.d.ts +20 -20
  811. package/types/backtop.d.ts +16 -16
  812. package/types/badge.d.ts +16 -16
  813. package/types/breadcrumb-item.d.ts +10 -10
  814. package/types/breadcrumb.d.ts +10 -10
  815. package/types/button-group.d.ts +4 -4
  816. package/types/button.d.ts +37 -37
  817. package/types/calendar.d.ts +15 -15
  818. package/types/card.d.ts +26 -26
  819. package/types/carousel-item.d.ts +10 -10
  820. package/types/carousel.d.ts +57 -57
  821. package/types/cascader-panel.d.ts +72 -72
  822. package/types/cascader.d.ts +65 -65
  823. package/types/checkbox-button.d.ts +22 -22
  824. package/types/checkbox-group.d.ts +22 -22
  825. package/types/checkbox.d.ts +34 -34
  826. package/types/col.d.ts +46 -46
  827. package/types/collapse-item.d.ts +26 -26
  828. package/types/collapse.d.ts +10 -10
  829. package/types/color-picker.d.ts +21 -21
  830. package/types/component.d.ts +13 -13
  831. package/types/container.d.ts +7 -7
  832. package/types/date-picker.d.ts +124 -124
  833. package/types/descriptions-item.d.ts +37 -37
  834. package/types/descriptions.d.ts +52 -52
  835. package/types/dialog.d.ts +62 -62
  836. package/types/divider.d.ts +12 -12
  837. package/types/drawer.d.ts +63 -63
  838. package/types/dropdown-item.d.ts +16 -16
  839. package/types/dropdown-menu.d.ts +4 -4
  840. package/types/dropdown.d.ts +38 -38
  841. package/types/element-ui.d.ts +3 -16
  842. package/types/empty.d.ts +31 -31
  843. package/types/footer.d.ts +7 -7
  844. package/types/form-item.d.ts +37 -37
  845. package/types/form.d.ts +82 -82
  846. package/types/header.d.ts +7 -7
  847. package/types/icon.d.ts +7 -7
  848. package/types/image.d.ts +43 -43
  849. package/types/index.d.ts +4 -4
  850. package/types/infinite-scroll.d.ts +5 -5
  851. package/types/input-number.d.ts +47 -47
  852. package/types/input.d.ts +107 -107
  853. package/types/link.d.ts +25 -25
  854. package/types/loading.d.ts +62 -62
  855. package/types/main.d.ts +4 -4
  856. package/types/menu-item-group.d.ts +7 -7
  857. package/types/menu-item.d.ts +10 -10
  858. package/types/menu.d.ts +46 -46
  859. package/types/message-box.d.ts +176 -176
  860. package/types/message.d.ts +90 -90
  861. package/types/notification.d.ts +84 -84
  862. package/types/option-group.d.ts +10 -10
  863. package/types/option.d.ts +13 -13
  864. package/types/page-header.d.ts +10 -10
  865. package/types/pagination.d.ts +43 -43
  866. package/types/popconfirm.d.ts +29 -29
  867. package/types/popover.d.ts +71 -71
  868. package/types/progress.d.ts +37 -37
  869. package/types/radio-button.d.ts +16 -16
  870. package/types/radio-group.d.ts +18 -18
  871. package/types/radio.d.ts +19 -19
  872. package/types/rate.d.ts +64 -64
  873. package/types/result.d.ts +33 -33
  874. package/types/row.d.ts +25 -25
  875. package/types/select.d.ts +90 -90
  876. package/types/skeleton-item.d.ts +7 -7
  877. package/types/skeleton.d.ts +33 -33
  878. package/types/slider.d.ts +68 -68
  879. package/types/spinner.d.ts +16 -16
  880. package/types/statistic.d.ts +37 -0
  881. package/types/step.d.ts +34 -34
  882. package/types/steps.d.ts +28 -28
  883. package/types/submenu.d.ts +22 -22
  884. package/types/switch.d.ts +43 -43
  885. package/types/tab-pane.d.ts +19 -19
  886. package/types/table-column.d.ts +117 -117
  887. package/types/table.d.ts +177 -177
  888. package/types/tabs.d.ts +31 -31
  889. package/types/tag.d.ts +28 -28
  890. package/types/time-picker.d.ts +63 -63
  891. package/types/time-select.d.ts +56 -56
  892. package/types/timeline-item.d.ts +20 -20
  893. package/types/timeline.d.ts +6 -6
  894. package/types/tooltip.d.ts +52 -52
  895. package/types/transfer.d.ts +73 -73
  896. package/types/tree.d.ts +266 -266
  897. package/types/treeselect.d.ts +5 -0
  898. package/types/upload.d.ts +124 -124
  899. package/web-types.json +4195 -4195
  900. package/lib/fileUpload.js +0 -3885
  901. package/lib/tabDialog.js +0 -2644
  902. package/lib/treeSelect.js +0 -4421
  903. package/lib/utils/date_source.js +0 -335
  904. package/lib/utils/lodash_source.js +0 -9421
  905. package/packages/fileUpload/index.js +0 -8
  906. package/packages/fileUpload/src/main.vue +0 -430
  907. package/packages/subTitle/index.js +0 -8
  908. package/packages/subTitle/src/main.vue +0 -33
  909. package/packages/tabDialog/index.js +0 -23
  910. package/packages/tabDialog/src/dialog/drag.js +0 -63
  911. package/packages/tabDialog/src/dialog/dragHeight.js +0 -34
  912. package/packages/tabDialog/src/dialog/dragWidth.js +0 -30
  913. package/packages/tabDialog/src/main.vue +0 -277
  914. package/packages/theme-cy/lib/element.css +0 -1
  915. package/packages/theme-cy/lib/fileUpload.css +0 -1
  916. package/packages/theme-cy/lib/subTitle.css +0 -1
  917. package/packages/theme-cy/lib/tabDialog.css +0 -1
  918. package/packages/theme-cy/src/element.scss +0 -45
  919. package/packages/theme-cy/src/fileUpload.scss +0 -30
  920. package/packages/theme-cy/src/subTitle.scss +0 -26
  921. package/packages/theme-cy/src/tabDialog.scss +0 -43
  922. package/packages/treeSelect/index.js +0 -8
  923. package/src/utils/date_source.js +0 -352
  924. package/src/utils/lodash_source.js +0 -18090
  925. package/types/fileUpload.d.ts +0 -5
  926. package/types/subTitle.d.ts +0 -5
  927. package/types/tabDialog.d.ts +0 -5
  928. package/types/treeSelect.d.ts +0 -5
package/lib/submenu.js CHANGED
@@ -82,850 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 199);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 132);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
90
  /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("vue");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
-
100
- "use strict";
101
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
102
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
103
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
104
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
105
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
106
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
107
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
108
- /* unused harmony export setStyle */
109
- /* unused harmony export isScroll */
110
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
111
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
112
- /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
113
- /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__);
114
- /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53);
115
- /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1__);
116
- /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
117
- /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_2__);
118
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
119
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__);
120
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
121
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_4__);
122
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16);
123
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_5__);
124
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12);
125
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_6__);
126
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
127
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_7__);
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
- /* istanbul ignore next */
136
-
137
-
138
- var isServer = vue__WEBPACK_IMPORTED_MODULE_7___default.a.prototype.$isServer;
139
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
140
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
141
- var ieVersion = isServer ? 0 : Number(document.documentMode);
142
-
143
- /* istanbul ignore next */
144
- var trim = function trim(string) {
145
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
146
- };
147
- /* istanbul ignore next */
148
- var camelCase = function camelCase(name) {
149
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
150
- return offset ? letter.toUpperCase() : letter;
151
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
152
- };
153
-
154
- /* istanbul ignore next */
155
- var on = function () {
156
- if (!isServer && document.addEventListener) {
157
- return function (element, event, handler) {
158
- if (element && event && handler) {
159
- element.addEventListener(event, handler, false);
160
- }
161
- };
162
- } else {
163
- return function (element, event, handler) {
164
- if (element && event && handler) {
165
- element.attachEvent('on' + event, handler);
166
- }
167
- };
168
- }
169
- }();
170
-
171
- /* istanbul ignore next */
172
- var off = function () {
173
- if (!isServer && document.removeEventListener) {
174
- return function (element, event, handler) {
175
- if (element && event) {
176
- element.removeEventListener(event, handler, false);
177
- }
178
- };
179
- } else {
180
- return function (element, event, handler) {
181
- if (element && event) {
182
- element.detachEvent('on' + event, handler);
183
- }
184
- };
185
- }
186
- }();
187
-
188
- /* istanbul ignore next */
189
- var once = function once(el, event, fn) {
190
- var _listener = function listener() {
191
- if (fn) {
192
- fn.apply(this, arguments);
193
- }
194
- off(el, event, _listener);
195
- };
196
- on(el, event, _listener);
197
- };
198
-
199
- /* istanbul ignore next */
200
- function hasClass(el, cls) {
201
- if (!el || !cls) return false;
202
- if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
203
- if (el.classList) {
204
- return el.classList.contains(cls);
205
- } else {
206
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
207
- }
208
- }
209
- ;
210
-
211
- /* istanbul ignore next */
212
- function addClass(el, cls) {
213
- if (!el) return;
214
- var curClass = el.className;
215
- var classes = (cls || '').split(' ');
216
- for (var i = 0, j = classes.length; i < j; i++) {
217
- var clsName = classes[i];
218
- if (!clsName) continue;
219
- if (el.classList) {
220
- el.classList.add(clsName);
221
- } else if (!hasClass(el, clsName)) {
222
- curClass += ' ' + clsName;
223
- }
224
- }
225
- if (!el.classList) {
226
- el.setAttribute('class', curClass);
227
- }
228
- }
229
- ;
230
-
231
- /* istanbul ignore next */
232
- function removeClass(el, cls) {
233
- if (!el || !cls) return;
234
- var classes = cls.split(' ');
235
- var curClass = ' ' + el.className + ' ';
236
- for (var i = 0, j = classes.length; i < j; i++) {
237
- var clsName = classes[i];
238
- if (!clsName) continue;
239
- if (el.classList) {
240
- el.classList.remove(clsName);
241
- } else if (hasClass(el, clsName)) {
242
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
243
- }
244
- }
245
- if (!el.classList) {
246
- el.setAttribute('class', trim(curClass));
247
- }
248
- }
249
- ;
250
-
251
- /* istanbul ignore next */
252
- var getStyle = ieVersion < 9 ? function (element, styleName) {
253
- if (isServer) return;
254
- if (!element || !styleName) return null;
255
- styleName = camelCase(styleName);
256
- if (styleName === 'float') {
257
- styleName = 'styleFloat';
258
- }
259
- try {
260
- switch (styleName) {
261
- case 'opacity':
262
- try {
263
- return element.filters.item('alpha').opacity / 100;
264
- } catch (e) {
265
- return 1.0;
266
- }
267
- default:
268
- return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
269
- }
270
- } catch (e) {
271
- return element.style[styleName];
272
- }
273
- } : function (element, styleName) {
274
- if (isServer) return;
275
- if (!element || !styleName) return null;
276
- styleName = camelCase(styleName);
277
- if (styleName === 'float') {
278
- styleName = 'cssFloat';
279
- }
280
- try {
281
- var computed = document.defaultView.getComputedStyle(element, '');
282
- return element.style[styleName] || computed ? computed[styleName] : null;
283
- } catch (e) {
284
- return element.style[styleName];
285
- }
286
- };
287
-
288
- /* istanbul ignore next */
289
- function setStyle(element, styleName, value) {
290
- if (!element || !styleName) return;
291
- if (typeof styleName === 'object') {
292
- for (var prop in styleName) {
293
- if (styleName.hasOwnProperty(prop)) {
294
- setStyle(element, prop, styleName[prop]);
295
- }
296
- }
297
- } else {
298
- styleName = camelCase(styleName);
299
- if (styleName === 'opacity' && ieVersion < 9) {
300
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
301
- } else {
302
- element.style[styleName] = value;
303
- }
304
- }
305
- }
306
- ;
307
- var isScroll = function isScroll(el, vertical) {
308
- if (isServer) return;
309
- var determinedDirection = vertical !== null && vertical !== undefined;
310
- var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
311
- return overflow.match(/(scroll|auto|overlay)/);
312
- };
313
- var getScrollContainer = function getScrollContainer(el, vertical) {
314
- if (isServer) return;
315
- var parent = el;
316
- while (parent) {
317
- if ([window, document, document.documentElement].includes(parent)) {
318
- return window;
319
- }
320
- if (isScroll(parent, vertical)) {
321
- return parent;
322
- }
323
- parent = parent.parentNode;
324
- }
325
- return parent;
326
- };
327
- var isInContainer = function isInContainer(el, container) {
328
- if (isServer || !el || !container) return false;
329
- var elRect = el.getBoundingClientRect();
330
- var containerRect;
331
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
332
- containerRect = {
333
- top: 0,
334
- right: window.innerWidth,
335
- bottom: window.innerHeight,
336
- left: 0
337
- };
338
- } else {
339
- containerRect = container.getBoundingClientRect();
340
- }
341
- return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
342
- };
343
-
344
- /***/ }),
345
-
346
- /***/ 10:
347
- /***/ (function(module, exports) {
348
-
349
- module.exports = require("core-js/modules/web.dom-collections.for-each.js");
350
-
351
- /***/ }),
352
-
353
- /***/ 11:
354
- /***/ (function(module, exports) {
355
-
356
- module.exports = require("core-js/modules/es.regexp.to-string.js");
357
-
358
- /***/ }),
359
-
360
- /***/ 110:
361
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
362
-
363
- "use strict";
364
- /* harmony default export */ __webpack_exports__["a"] = ({
365
- inject: ['rootMenu'],
366
- computed: {
367
- indexPath: function indexPath() {
368
- var path = [this.index];
369
- var parent = this.$parent;
370
- while (parent.$options.componentName !== 'ElMenu') {
371
- if (parent.index) {
372
- path.unshift(parent.index);
373
- }
374
- parent = parent.$parent;
375
- }
376
- return path;
377
- },
378
- parentMenu: function parentMenu() {
379
- var parent = this.$parent;
380
- while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
381
- parent = parent.$parent;
382
- }
383
- return parent;
384
- },
385
- paddingStyle: function paddingStyle() {
386
- if (this.rootMenu.mode !== 'vertical') return {};
387
- var padding = 20;
388
- var parent = this.$parent;
389
- if (this.rootMenu.collapse) {
390
- padding = 20;
391
- } else {
392
- while (parent && parent.$options.componentName !== 'ElMenu') {
393
- if (parent.$options.componentName === 'ElSubmenu') {
394
- padding += 20;
395
- }
396
- parent = parent.$parent;
397
- }
398
- }
399
- return {
400
- paddingLeft: padding + 'px'
401
- };
402
- }
403
- }
404
- });
405
-
406
- /***/ }),
407
-
408
- /***/ 12:
409
- /***/ (function(module, exports) {
410
-
411
- module.exports = require("core-js/modules/es.string.replace.js");
412
-
413
- /***/ }),
414
-
415
- /***/ 13:
416
- /***/ (function(module, exports) {
417
-
418
- module.exports = require("core-js/modules/es.array.slice.js");
419
-
420
- /***/ }),
421
-
422
- /***/ 14:
423
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
424
-
425
- "use strict";
426
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
427
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__);
428
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
429
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_1__);
430
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
431
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__);
432
-
433
-
434
-
435
- function _broadcast(componentName, eventName, params) {
436
- this.$children.forEach(function (child) {
437
- var name = child.$options.componentName;
438
- if (name === componentName) {
439
- child.$emit.apply(child, [eventName].concat(params));
440
- } else {
441
- _broadcast.apply(child, [componentName, eventName].concat([params]));
442
- }
443
- });
444
- }
445
- /* harmony default export */ __webpack_exports__["a"] = ({
446
- methods: {
447
- dispatch: function dispatch(componentName, eventName, params) {
448
- var parent = this.$parent || this.$root;
449
- var name = parent.$options.componentName;
450
- while (parent && (!name || name !== componentName)) {
451
- parent = parent.$parent;
452
- if (parent) {
453
- name = parent.$options.componentName;
454
- }
455
- }
456
- if (parent) {
457
- parent.$emit.apply(parent, [eventName].concat(params));
458
- }
459
- },
460
- broadcast: function broadcast(componentName, eventName, params) {
461
- _broadcast.call(this, componentName, eventName, params);
462
- }
463
- }
464
- });
465
-
466
- /***/ }),
467
-
468
- /***/ 15:
469
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
470
-
471
- "use strict";
472
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
473
- for (var i = 1, j = arguments.length; i < j; i++) {
474
- var source = arguments[i] || {};
475
- for (var prop in source) {
476
- if (source.hasOwnProperty(prop)) {
477
- var value = source[prop];
478
- if (value !== undefined) {
479
- target[prop] = value;
480
- }
481
- }
482
- }
483
- }
484
- return target;
485
- });
486
- ;
487
-
488
- /***/ }),
489
-
490
- /***/ 16:
491
- /***/ (function(module, exports) {
492
-
493
- module.exports = require("core-js/modules/es.string.match.js");
494
-
495
- /***/ }),
496
-
497
- /***/ 17:
498
- /***/ (function(module, exports) {
499
-
500
- module.exports = require("core-js/modules/es.object.keys.js");
501
-
502
- /***/ }),
503
-
504
- /***/ 18:
505
- /***/ (function(module, exports) {
506
-
507
- module.exports = require("core-js/modules/es.array.filter.js");
508
-
509
- /***/ }),
510
-
511
- /***/ 199:
512
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
513
-
514
- "use strict";
515
- // ESM COMPAT FLAG
516
- __webpack_require__.r(__webpack_exports__);
517
-
518
- // EXTERNAL MODULE: external "core-js/modules/es.function.name.js"
519
- var es_function_name_js_ = __webpack_require__(5);
520
-
521
- // EXTERNAL MODULE: external "core-js/modules/es.number.constructor.js"
522
- var es_number_constructor_js_ = __webpack_require__(6);
523
-
524
- // EXTERNAL MODULE: external "core-js/modules/es.object.keys.js"
525
- var es_object_keys_js_ = __webpack_require__(17);
526
-
527
- // EXTERNAL MODULE: external "core-js/modules/es.object.to-string.js"
528
- var es_object_to_string_js_ = __webpack_require__(3);
529
-
530
- // EXTERNAL MODULE: external "core-js/modules/web.dom-collections.for-each.js"
531
- var web_dom_collections_for_each_js_ = __webpack_require__(10);
532
-
533
- // EXTERNAL MODULE: ./src/transitions/collapse-transition.js
534
- var collapse_transition = __webpack_require__(99);
535
-
536
- // EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
537
- var menu_mixin = __webpack_require__(110);
538
-
539
- // EXTERNAL MODULE: ./src/mixins/emitter.js
540
- var emitter = __webpack_require__(14);
541
-
542
- // EXTERNAL MODULE: ./src/utils/vue-popper.js
543
- var vue_popper = __webpack_require__(51);
544
-
545
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js
546
-
547
-
548
-
549
-
550
-
551
-
552
-
553
-
554
-
555
- var poperMixins = {
556
- props: {
557
- transformOrigin: {
558
- type: [Boolean, String],
559
- default: false
560
- },
561
- offset: vue_popper["a" /* default */].props.offset,
562
- boundariesPadding: vue_popper["a" /* default */].props.boundariesPadding,
563
- popperOptions: vue_popper["a" /* default */].props.popperOptions
564
- },
565
- data: vue_popper["a" /* default */].data,
566
- methods: vue_popper["a" /* default */].methods,
567
- beforeDestroy: vue_popper["a" /* default */].beforeDestroy,
568
- deactivated: vue_popper["a" /* default */].deactivated
569
- };
570
- /* harmony default export */ var submenuvue_type_script_lang_js = ({
571
- name: 'ElSubmenu',
572
- componentName: 'ElSubmenu',
573
- mixins: [menu_mixin["a" /* default */], emitter["a" /* default */], poperMixins],
574
- components: {
575
- ElCollapseTransition: collapse_transition["a" /* default */]
576
- },
577
- props: {
578
- index: {
579
- type: String,
580
- required: true
581
- },
582
- showTimeout: {
583
- type: Number,
584
- default: 300
585
- },
586
- hideTimeout: {
587
- type: Number,
588
- default: 300
589
- },
590
- popperClass: String,
591
- disabled: Boolean,
592
- popperAppendToBody: {
593
- type: Boolean,
594
- default: undefined
595
- }
596
- },
597
- data: function data() {
598
- return {
599
- popperJS: null,
600
- timeout: null,
601
- items: {},
602
- submenus: {},
603
- mouseInChild: false
604
- };
605
- },
606
- watch: {
607
- opened: function opened(val) {
608
- var _this = this;
609
- if (this.isMenuPopup) {
610
- this.$nextTick(function (_) {
611
- _this.updatePopper();
612
- });
613
- }
614
- }
615
- },
616
- computed: {
617
- // popper option
618
- appendToBody: function appendToBody() {
619
- return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
620
- },
621
- menuTransitionName: function menuTransitionName() {
622
- return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
623
- },
624
- opened: function opened() {
625
- return this.rootMenu.openedMenus.indexOf(this.index) > -1;
626
- },
627
- active: function active() {
628
- var isActive = false;
629
- var submenus = this.submenus;
630
- var items = this.items;
631
- Object.keys(items).forEach(function (index) {
632
- if (items[index].active) {
633
- isActive = true;
634
- }
635
- });
636
- Object.keys(submenus).forEach(function (index) {
637
- if (submenus[index].active) {
638
- isActive = true;
639
- }
640
- });
641
- return isActive;
642
- },
643
- hoverBackground: function hoverBackground() {
644
- return this.rootMenu.hoverBackground;
645
- },
646
- backgroundColor: function backgroundColor() {
647
- return this.rootMenu.backgroundColor || '';
648
- },
649
- activeTextColor: function activeTextColor() {
650
- return this.rootMenu.activeTextColor || '';
651
- },
652
- textColor: function textColor() {
653
- return this.rootMenu.textColor || '';
654
- },
655
- mode: function mode() {
656
- return this.rootMenu.mode;
657
- },
658
- isMenuPopup: function isMenuPopup() {
659
- return this.rootMenu.isMenuPopup;
660
- },
661
- titleStyle: function titleStyle() {
662
- if (this.mode !== 'horizontal') {
663
- return {
664
- color: this.textColor
665
- };
666
- }
667
- return {
668
- borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
669
- color: this.active ? this.activeTextColor : this.textColor
670
- };
671
- },
672
- isFirstLevel: function isFirstLevel() {
673
- var isFirstLevel = true;
674
- var parent = this.$parent;
675
- while (parent && parent !== this.rootMenu) {
676
- if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
677
- isFirstLevel = false;
678
- break;
679
- } else {
680
- parent = parent.$parent;
681
- }
682
- }
683
- return isFirstLevel;
684
- }
685
- },
686
- methods: {
687
- handleCollapseToggle: function handleCollapseToggle(value) {
688
- if (value) {
689
- this.initPopper();
690
- } else {
691
- this.doDestroy();
692
- }
693
- },
694
- addItem: function addItem(item) {
695
- this.$set(this.items, item.index, item);
696
- },
697
- removeItem: function removeItem(item) {
698
- delete this.items[item.index];
699
- },
700
- addSubmenu: function addSubmenu(item) {
701
- this.$set(this.submenus, item.index, item);
702
- },
703
- removeSubmenu: function removeSubmenu(item) {
704
- delete this.submenus[item.index];
705
- },
706
- handleClick: function handleClick() {
707
- var rootMenu = this.rootMenu,
708
- disabled = this.disabled;
709
- if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
710
- return;
711
- }
712
- this.dispatch('ElMenu', 'submenu-click', this);
713
- },
714
- handleMouseenter: function handleMouseenter(event, showTimeout) {
715
- var _this2 = this;
716
- if (showTimeout === void 0) {
717
- showTimeout = this.showTimeout;
718
- }
719
- if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
720
- return;
721
- }
722
- var rootMenu = this.rootMenu,
723
- disabled = this.disabled;
724
- if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
725
- return;
726
- }
727
- this.dispatch('ElSubmenu', 'mouse-enter-child');
728
- clearTimeout(this.timeout);
729
- this.timeout = setTimeout(function () {
730
- _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
731
- }, showTimeout);
732
- if (this.appendToBody) {
733
- this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
734
- }
735
- },
736
- handleMouseleave: function handleMouseleave(deepDispatch) {
737
- var _this3 = this;
738
- if (deepDispatch === void 0) {
739
- deepDispatch = false;
740
- }
741
- var rootMenu = this.rootMenu;
742
- if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
743
- return;
744
- }
745
- this.dispatch('ElSubmenu', 'mouse-leave-child');
746
- clearTimeout(this.timeout);
747
- this.timeout = setTimeout(function () {
748
- !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
749
- }, this.hideTimeout);
750
- if (this.appendToBody && deepDispatch) {
751
- if (this.$parent.$options.name === 'ElSubmenu') {
752
- this.$parent.handleMouseleave(true);
753
- }
754
- }
755
- },
756
- handleTitleMouseenter: function handleTitleMouseenter() {
757
- if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
758
- var title = this.$refs['submenu-title'];
759
- title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
760
- },
761
- handleTitleMouseleave: function handleTitleMouseleave() {
762
- if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
763
- var title = this.$refs['submenu-title'];
764
- title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
765
- },
766
- updatePlacement: function updatePlacement() {
767
- this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
768
- },
769
- initPopper: function initPopper() {
770
- this.referenceElm = this.$el;
771
- this.popperElm = this.$refs.menu;
772
- this.updatePlacement();
773
- }
774
- },
775
- created: function created() {
776
- var _this4 = this;
777
- this.$on('toggle-collapse', this.handleCollapseToggle);
778
- this.$on('mouse-enter-child', function () {
779
- _this4.mouseInChild = true;
780
- clearTimeout(_this4.timeout);
781
- });
782
- this.$on('mouse-leave-child', function () {
783
- _this4.mouseInChild = false;
784
- clearTimeout(_this4.timeout);
785
- });
786
- },
787
- mounted: function mounted() {
788
- this.parentMenu.addSubmenu(this);
789
- this.rootMenu.addSubmenu(this);
790
- this.initPopper();
791
- },
792
- beforeDestroy: function beforeDestroy() {
793
- this.parentMenu.removeSubmenu(this);
794
- this.rootMenu.removeSubmenu(this);
795
- },
796
- render: function render(h) {
797
- var _this5 = this;
798
- var active = this.active,
799
- opened = this.opened,
800
- paddingStyle = this.paddingStyle,
801
- titleStyle = this.titleStyle,
802
- backgroundColor = this.backgroundColor,
803
- rootMenu = this.rootMenu,
804
- currentPlacement = this.currentPlacement,
805
- menuTransitionName = this.menuTransitionName,
806
- mode = this.mode,
807
- disabled = this.disabled,
808
- popperClass = this.popperClass,
809
- $slots = this.$slots,
810
- isFirstLevel = this.isFirstLevel;
811
- var popupMenu = h("transition", {
812
- "attrs": {
813
- "name": menuTransitionName
814
- }
815
- }, [h("div", {
816
- "ref": "menu",
817
- "directives": [{
818
- name: "show",
819
- value: opened
820
- }],
821
- "class": ["el-menu--" + mode, popperClass],
822
- "on": {
823
- "mouseenter": function mouseenter($event) {
824
- return _this5.handleMouseenter($event, 100);
825
- },
826
- "mouseleave": function mouseleave() {
827
- return _this5.handleMouseleave(true);
828
- },
829
- "focus": function focus($event) {
830
- return _this5.handleMouseenter($event, 100);
831
- }
832
- }
833
- }, [h("ul", {
834
- "attrs": {
835
- "role": "menu"
836
- },
837
- "class": ['el-menu el-menu--popup', "el-menu--popup-" + currentPlacement],
838
- "style": {
839
- backgroundColor: rootMenu.backgroundColor || ''
840
- }
841
- }, [$slots.default])])]);
842
- var inlineMenu = h("el-collapse-transition", [h("ul", {
843
- "attrs": {
844
- "role": "menu"
845
- },
846
- "class": "el-menu el-menu--inline",
847
- "directives": [{
848
- name: "show",
849
- value: opened
850
- }],
851
- "style": {
852
- backgroundColor: rootMenu.backgroundColor || ''
853
- }
854
- }, [$slots.default])]);
855
- var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
856
- return h("li", {
857
- "class": {
858
- 'el-submenu': true,
859
- 'is-active': active,
860
- 'is-opened': opened,
861
- 'is-disabled': disabled
862
- },
863
- "attrs": {
864
- "role": "menuitem",
865
- "aria-haspopup": "true",
866
- "aria-expanded": opened
867
- },
868
- "on": {
869
- "mouseenter": this.handleMouseenter,
870
- "mouseleave": function mouseleave() {
871
- return _this5.handleMouseleave(false);
872
- },
873
- "focus": this.handleMouseenter
874
- }
875
- }, [h("div", {
876
- "class": "el-submenu__title",
877
- "ref": "submenu-title",
878
- "on": {
879
- "click": this.handleClick,
880
- "mouseenter": this.handleTitleMouseenter,
881
- "mouseleave": this.handleTitleMouseleave
882
- },
883
- "style": [paddingStyle, titleStyle, {
884
- backgroundColor: backgroundColor
885
- }]
886
- }, [$slots.title, h("i", {
887
- "class": ['el-submenu__icon-arrow', submenuTitleIcon]
888
- })]), this.isMenuPopup ? popupMenu : inlineMenu]);
889
- }
890
- });
891
- // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js
892
- /* harmony default export */ var src_submenuvue_type_script_lang_js = (submenuvue_type_script_lang_js);
893
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
894
- var componentNormalizer = __webpack_require__(2);
895
-
896
- // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
897
- var render, staticRenderFns
898
-
899
-
900
-
901
-
902
- /* normalize component */
903
-
904
- var component = Object(componentNormalizer["a" /* default */])(
905
- src_submenuvue_type_script_lang_js,
906
- render,
907
- staticRenderFns,
908
- false,
909
- null,
910
- null,
911
- null
912
-
913
- )
914
-
915
- /* harmony default export */ var submenu = (component.exports);
916
- // CONCATENATED MODULE: ./packages/submenu/index.js
917
-
918
-
919
-
920
- /* istanbul ignore next */
921
- submenu.install = function (Vue) {
922
- Vue.component(submenu.name, submenu);
923
- };
924
- /* harmony default export */ var packages_submenu = __webpack_exports__["default"] = (submenu);
925
-
926
- /***/ }),
927
-
928
- /***/ 2:
929
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
930
92
 
931
93
  "use strict";
@@ -1030,2109 +192,509 @@ function normalizeComponent(
1030
192
 
1031
193
  /***/ }),
1032
194
 
1033
- /***/ 20:
1034
- /***/ (function(module, exports) {
1035
-
1036
- module.exports = require("core-js/modules/es.array.map.js");
1037
-
1038
- /***/ }),
1039
-
1040
- /***/ 21:
1041
- /***/ (function(module, exports) {
1042
-
1043
- module.exports = require("core-js/modules/es.array.concat.js");
1044
-
1045
- /***/ }),
1046
-
1047
- /***/ 22:
1048
- /***/ (function(module, exports) {
1049
-
1050
- module.exports = require("core-js/modules/es.array.splice.js");
1051
-
1052
- /***/ }),
1053
-
1054
- /***/ 23:
1055
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1056
-
1057
- "use strict";
1058
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1059
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1060
-
1061
- var scrollBarWidth;
1062
- /* harmony default export */ __webpack_exports__["a"] = (function () {
1063
- if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
1064
- if (scrollBarWidth !== undefined) return scrollBarWidth;
1065
- var outer = document.createElement('div');
1066
- outer.className = 'el-scrollbar__wrap';
1067
- outer.style.visibility = 'hidden';
1068
- outer.style.width = '100px';
1069
- outer.style.position = 'absolute';
1070
- outer.style.top = '-9999px';
1071
- document.body.appendChild(outer);
1072
- var widthNoScroll = outer.offsetWidth;
1073
- outer.style.overflow = 'scroll';
1074
- var inner = document.createElement('div');
1075
- inner.style.width = '100%';
1076
- outer.appendChild(inner);
1077
- var widthWithScroll = inner.offsetWidth;
1078
- outer.parentNode.removeChild(outer);
1079
- scrollBarWidth = widthNoScroll - widthWithScroll;
1080
- return scrollBarWidth;
1081
- });
1082
- ;
1083
-
1084
- /***/ }),
1085
-
1086
- /***/ 24:
1087
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
195
+ /***/ 132:
196
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1088
197
 
1089
198
  "use strict";
199
+ // ESM COMPAT FLAG
200
+ __webpack_require__.r(__webpack_exports__);
1090
201
 
1091
- // EXPORTS
1092
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
1093
-
1094
- // EXTERNAL MODULE: external "core-js/modules/es.number.constructor.js"
1095
- var es_number_constructor_js_ = __webpack_require__(6);
1096
-
1097
- // EXTERNAL MODULE: external "vue"
1098
- var external_vue_ = __webpack_require__(0);
1099
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
1100
-
1101
- // EXTERNAL MODULE: ./src/utils/merge.js
1102
- var merge = __webpack_require__(15);
1103
-
1104
- // EXTERNAL MODULE: external "core-js/modules/es.array.splice.js"
1105
- var es_array_splice_js_ = __webpack_require__(22);
1106
-
1107
- // EXTERNAL MODULE: external "core-js/modules/es.object.to-string.js"
1108
- var es_object_to_string_js_ = __webpack_require__(3);
1109
-
1110
- // EXTERNAL MODULE: external "core-js/modules/es.regexp.exec.js"
1111
- var es_regexp_exec_js_ = __webpack_require__(7);
1112
-
1113
- // EXTERNAL MODULE: external "core-js/modules/es.string.split.js"
1114
- var es_string_split_js_ = __webpack_require__(59);
1115
-
1116
- // EXTERNAL MODULE: external "core-js/modules/es.string.trim.js"
1117
- var es_string_trim_js_ = __webpack_require__(56);
1118
-
1119
- // EXTERNAL MODULE: external "core-js/modules/web.dom-collections.for-each.js"
1120
- var web_dom_collections_for_each_js_ = __webpack_require__(10);
202
+ // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
203
+ var collapse_transition_ = __webpack_require__(28);
204
+ var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
1121
205
 
1122
- // EXTERNAL MODULE: ./src/utils/dom.js
1123
- var utils_dom = __webpack_require__(1);
206
+ // EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
207
+ var menu_mixin = __webpack_require__(37);
1124
208
 
1125
- // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
209
+ // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
210
+ var emitter_ = __webpack_require__(4);
211
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
1126
212
 
213
+ // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
214
+ var vue_popper_ = __webpack_require__(5);
215
+ var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
1127
216
 
217
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js
1128
218
 
1129
219
 
1130
220
 
1131
221
 
1132
222
 
1133
223
 
1134
- var hasModal = false;
1135
- var hasInitZIndex = false;
1136
- var popup_manager_zIndex;
1137
- var popup_manager_getModal = function getModal() {
1138
- if (external_vue_default.a.prototype.$isServer) return;
1139
- var modalDom = PopupManager.modalDom;
1140
- if (modalDom) {
1141
- hasModal = true;
1142
- } else {
1143
- hasModal = false;
1144
- modalDom = document.createElement('div');
1145
- PopupManager.modalDom = modalDom;
1146
- modalDom.addEventListener('touchmove', function (event) {
1147
- event.preventDefault();
1148
- event.stopPropagation();
1149
- });
1150
- modalDom.addEventListener('click', function () {
1151
- PopupManager.doOnModalClick && PopupManager.doOnModalClick();
1152
- });
1153
- }
1154
- return modalDom;
1155
- };
1156
- var instances = {};
1157
- var PopupManager = {
1158
- modalFade: true,
1159
- getInstance: function getInstance(id) {
1160
- return instances[id];
1161
- },
1162
- register: function register(id, instance) {
1163
- if (id && instance) {
1164
- instances[id] = instance;
1165
- }
1166
- },
1167
- deregister: function deregister(id) {
1168
- if (id) {
1169
- instances[id] = null;
1170
- delete instances[id];
1171
- }
1172
- },
1173
- nextZIndex: function nextZIndex() {
1174
- return PopupManager.zIndex++;
1175
- },
1176
- modalStack: [],
1177
- doOnModalClick: function doOnModalClick() {
1178
- var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
1179
- if (!topItem) return;
1180
- var instance = PopupManager.getInstance(topItem.id);
1181
- if (instance && instance.closeOnClickModal) {
1182
- instance.close();
1183
- }
1184
- },
1185
- openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
1186
- if (external_vue_default.a.prototype.$isServer) return;
1187
- if (!id || zIndex === undefined) return;
1188
- this.modalFade = modalFade;
1189
- var modalStack = this.modalStack;
1190
- for (var i = 0, j = modalStack.length; i < j; i++) {
1191
- var item = modalStack[i];
1192
- if (item.id === id) {
1193
- return;
1194
- }
1195
- }
1196
- var modalDom = popup_manager_getModal();
1197
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
1198
- if (this.modalFade && !hasModal) {
1199
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
1200
- }
1201
- if (modalClass) {
1202
- var classArr = modalClass.trim().split(/\s+/);
1203
- classArr.forEach(function (item) {
1204
- return Object(utils_dom["a" /* addClass */])(modalDom, item);
1205
- });
1206
- }
1207
- setTimeout(function () {
1208
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
1209
- }, 200);
1210
- if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
1211
- dom.parentNode.appendChild(modalDom);
1212
- } else {
1213
- document.body.appendChild(modalDom);
1214
- }
1215
- if (zIndex) {
1216
- modalDom.style.zIndex = zIndex;
1217
- }
1218
- modalDom.tabIndex = 0;
1219
- modalDom.style.display = '';
1220
- this.modalStack.push({
1221
- id: id,
1222
- zIndex: zIndex,
1223
- modalClass: modalClass
1224
- });
1225
- },
1226
- closeModal: function closeModal(id) {
1227
- var modalStack = this.modalStack;
1228
- var modalDom = popup_manager_getModal();
1229
- if (modalStack.length > 0) {
1230
- var topItem = modalStack[modalStack.length - 1];
1231
- if (topItem.id === id) {
1232
- if (topItem.modalClass) {
1233
- var classArr = topItem.modalClass.trim().split(/\s+/);
1234
- classArr.forEach(function (item) {
1235
- return Object(utils_dom["i" /* removeClass */])(modalDom, item);
1236
- });
1237
- }
1238
- modalStack.pop();
1239
- if (modalStack.length > 0) {
1240
- modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
1241
- }
1242
- } else {
1243
- for (var i = modalStack.length - 1; i >= 0; i--) {
1244
- if (modalStack[i].id === id) {
1245
- modalStack.splice(i, 1);
1246
- break;
1247
- }
1248
- }
1249
- }
1250
- }
1251
- if (modalStack.length === 0) {
1252
- if (this.modalFade) {
1253
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
1254
- }
1255
- setTimeout(function () {
1256
- if (modalStack.length === 0) {
1257
- if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
1258
- modalDom.style.display = 'none';
1259
- PopupManager.modalDom = undefined;
1260
- }
1261
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
1262
- }, 200);
1263
- }
1264
- }
1265
- };
1266
- Object.defineProperty(PopupManager, 'zIndex', {
1267
- configurable: true,
1268
- get: function get() {
1269
- if (!hasInitZIndex) {
1270
- popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$ELEMENT || {}).zIndex || 2000;
1271
- hasInitZIndex = true;
1272
- }
1273
- return popup_manager_zIndex;
1274
- },
1275
- set: function set(value) {
1276
- popup_manager_zIndex = value;
1277
- }
1278
- });
1279
- var popup_manager_getTopPopup = function getTopPopup() {
1280
- if (external_vue_default.a.prototype.$isServer) return;
1281
- if (PopupManager.modalStack.length > 0) {
1282
- var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
1283
- if (!topPopup) return;
1284
- var instance = PopupManager.getInstance(topPopup.id);
1285
- return instance;
1286
- }
224
+ var poperMixins = {
225
+ props: {
226
+ transformOrigin: {
227
+ type: [Boolean, String],
228
+ default: false
229
+ },
230
+ offset: vue_popper_default.a.props.offset,
231
+ boundariesPadding: vue_popper_default.a.props.boundariesPadding,
232
+ popperOptions: vue_popper_default.a.props.popperOptions
233
+ },
234
+ data: vue_popper_default.a.data,
235
+ methods: vue_popper_default.a.methods,
236
+ beforeDestroy: vue_popper_default.a.beforeDestroy,
237
+ deactivated: vue_popper_default.a.deactivated
1287
238
  };
1288
- if (!external_vue_default.a.prototype.$isServer) {
1289
- // handle `esc` key when the popup is shown
1290
- window.addEventListener('keydown', function (event) {
1291
- if (event.keyCode === 27) {
1292
- var topPopup = popup_manager_getTopPopup();
1293
- if (topPopup && topPopup.closeOnPressEscape) {
1294
- topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
1295
- }
1296
- }
1297
- });
1298
- }
1299
- /* harmony default export */ var popup_manager = (PopupManager);
1300
- // EXTERNAL MODULE: ./src/utils/scrollbar-width.js
1301
- var scrollbar_width = __webpack_require__(23);
1302
-
1303
- // CONCATENATED MODULE: ./src/utils/popup/index.js
1304
-
1305
-
1306
-
1307
-
1308
-
1309
-
1310
- var idSeed = 1;
1311
- var scrollBarWidth;
1312
- /* harmony default export */ var popup = __webpack_exports__["b"] = ({
1313
- props: {
1314
- visible: {
1315
- type: Boolean,
1316
- default: false
1317
- },
1318
- openDelay: {},
1319
- closeDelay: {},
1320
- zIndex: {},
1321
- modal: {
1322
- type: Boolean,
1323
- default: false
1324
- },
1325
- modalFade: {
1326
- type: Boolean,
1327
- default: true
1328
- },
1329
- modalClass: {},
1330
- modalAppendToBody: {
1331
- type: Boolean,
1332
- default: false
1333
- },
1334
- lockScroll: {
1335
- type: Boolean,
1336
- default: true
1337
- },
1338
- closeOnPressEscape: {
1339
- type: Boolean,
1340
- default: false
1341
- },
1342
- closeOnClickModal: {
1343
- type: Boolean,
1344
- default: false
1345
- }
1346
- },
1347
- beforeMount: function beforeMount() {
1348
- this._popupId = 'popup-' + idSeed++;
1349
- popup_manager.register(this._popupId, this);
1350
- },
1351
- beforeDestroy: function beforeDestroy() {
1352
- popup_manager.deregister(this._popupId);
1353
- popup_manager.closeModal(this._popupId);
1354
- this.restoreBodyStyle();
1355
- },
1356
- data: function data() {
1357
- return {
1358
- opened: false,
1359
- bodyPaddingRight: null,
1360
- computedBodyPaddingRight: 0,
1361
- withoutHiddenClass: true,
1362
- rendered: false
1363
- };
1364
- },
1365
- watch: {
1366
- visible: function visible(val) {
1367
- var _this = this;
1368
- if (val) {
1369
- if (this._opening) return;
1370
- if (!this.rendered) {
1371
- this.rendered = true;
1372
- external_vue_default.a.nextTick(function () {
1373
- _this.open();
1374
- });
1375
- } else {
1376
- this.open();
1377
- }
1378
- } else {
1379
- this.close();
1380
- }
1381
- }
1382
- },
1383
- methods: {
1384
- open: function open(options) {
1385
- var _this2 = this;
1386
- if (!this.rendered) {
1387
- this.rendered = true;
1388
- }
1389
- var props = Object(merge["a" /* default */])({}, this.$props || this, options);
1390
- if (this._closeTimer) {
1391
- clearTimeout(this._closeTimer);
1392
- this._closeTimer = null;
1393
- }
1394
- clearTimeout(this._openTimer);
1395
- var openDelay = Number(props.openDelay);
1396
- if (openDelay > 0) {
1397
- this._openTimer = setTimeout(function () {
1398
- _this2._openTimer = null;
1399
- _this2.doOpen(props);
1400
- }, openDelay);
1401
- } else {
1402
- this.doOpen(props);
1403
- }
1404
- },
1405
- doOpen: function doOpen(props) {
1406
- if (this.$isServer) return;
1407
- if (this.willOpen && !this.willOpen()) return;
1408
- if (this.opened) return;
1409
- this._opening = true;
1410
- var dom = this.$el;
1411
- var modal = props.modal;
1412
- var zIndex = props.zIndex;
1413
- if (zIndex) {
1414
- popup_manager.zIndex = zIndex;
1415
- }
1416
- if (modal) {
1417
- if (this._closing) {
1418
- popup_manager.closeModal(this._popupId);
1419
- this._closing = false;
1420
- }
1421
- popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
1422
- if (props.lockScroll) {
1423
- this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'el-popup-parent--hidden');
1424
- if (this.withoutHiddenClass) {
1425
- this.bodyPaddingRight = document.body.style.paddingRight;
1426
- this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
1427
- }
1428
- scrollBarWidth = Object(scrollbar_width["a" /* default */])();
1429
- var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
1430
- var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
1431
- if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
1432
- document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
1433
- }
1434
- Object(utils_dom["a" /* addClass */])(document.body, 'el-popup-parent--hidden');
1435
- }
1436
- }
1437
- if (getComputedStyle(dom).position === 'static') {
1438
- dom.style.position = 'absolute';
1439
- }
1440
- dom.style.zIndex = popup_manager.nextZIndex();
1441
- this.opened = true;
1442
- this.onOpen && this.onOpen();
1443
- this.doAfterOpen();
1444
- },
1445
- doAfterOpen: function doAfterOpen() {
1446
- this._opening = false;
1447
- },
1448
- close: function close() {
1449
- var _this3 = this;
1450
- if (this.willClose && !this.willClose()) return;
1451
- if (this._openTimer !== null) {
1452
- clearTimeout(this._openTimer);
1453
- this._openTimer = null;
1454
- }
1455
- clearTimeout(this._closeTimer);
1456
- var closeDelay = Number(this.closeDelay);
1457
- if (closeDelay > 0) {
1458
- this._closeTimer = setTimeout(function () {
1459
- _this3._closeTimer = null;
1460
- _this3.doClose();
1461
- }, closeDelay);
1462
- } else {
1463
- this.doClose();
1464
- }
1465
- },
1466
- doClose: function doClose() {
1467
- this._closing = true;
1468
- this.onClose && this.onClose();
1469
- if (this.lockScroll) {
1470
- setTimeout(this.restoreBodyStyle, 200);
1471
- }
1472
- this.opened = false;
1473
- this.doAfterClose();
1474
- },
1475
- doAfterClose: function doAfterClose() {
1476
- popup_manager.closeModal(this._popupId);
1477
- this._closing = false;
1478
- },
1479
- restoreBodyStyle: function restoreBodyStyle() {
1480
- if (this.modal && this.withoutHiddenClass) {
1481
- document.body.style.paddingRight = this.bodyPaddingRight;
1482
- Object(utils_dom["i" /* removeClass */])(document.body, 'el-popup-parent--hidden');
1483
- }
1484
- this.withoutHiddenClass = true;
1485
- }
1486
- }
1487
- });
1488
-
1489
-
1490
- /***/ }),
1491
-
1492
- /***/ 3:
1493
- /***/ (function(module, exports) {
1494
-
1495
- module.exports = require("core-js/modules/es.object.to-string.js");
1496
-
1497
- /***/ }),
1498
-
1499
- /***/ 5:
1500
- /***/ (function(module, exports) {
1501
-
1502
- module.exports = require("core-js/modules/es.function.name.js");
1503
-
1504
- /***/ }),
1505
239
 
1506
- /***/ 51:
1507
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1508
-
1509
- "use strict";
1510
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
1511
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__);
1512
- /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
1513
- /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__);
1514
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
1515
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__);
1516
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
1517
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_3__);
1518
- /* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
240
+ /* harmony default export */ var submenuvue_type_script_lang_js = ({
241
+ name: 'ElSubmenu',
242
+
243
+ componentName: 'ElSubmenu',
244
+
245
+ mixins: [menu_mixin["a" /* default */], emitter_default.a, poperMixins],
246
+
247
+ components: { ElCollapseTransition: collapse_transition_default.a },
248
+
249
+ props: {
250
+ index: {
251
+ type: String,
252
+ required: true
253
+ },
254
+ showTimeout: {
255
+ type: Number,
256
+ default: 300
257
+ },
258
+ hideTimeout: {
259
+ type: Number,
260
+ default: 300
261
+ },
262
+ popperClass: String,
263
+ disabled: Boolean,
264
+ popperAppendToBody: {
265
+ type: Boolean,
266
+ default: undefined
267
+ }
268
+ },
269
+
270
+ data: function data() {
271
+ return {
272
+ popperJS: null,
273
+ timeout: null,
274
+ items: {},
275
+ submenus: {},
276
+ mouseInChild: false
277
+ };
278
+ },
279
+
280
+ watch: {
281
+ opened: function opened(val) {
282
+ var _this = this;
283
+
284
+ if (this.isMenuPopup) {
285
+ this.$nextTick(function (_) {
286
+ _this.updatePopper();
287
+ });
288
+ }
289
+ }
290
+ },
291
+ computed: {
292
+ // popper option
293
+ appendToBody: function appendToBody() {
294
+ return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
295
+ },
296
+ menuTransitionName: function menuTransitionName() {
297
+ return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
298
+ },
299
+ opened: function opened() {
300
+ return this.rootMenu.openedMenus.indexOf(this.index) > -1;
301
+ },
302
+ active: function active() {
303
+ var isActive = false;
304
+ var submenus = this.submenus;
305
+ var items = this.items;
306
+
307
+ Object.keys(items).forEach(function (index) {
308
+ if (items[index].active) {
309
+ isActive = true;
310
+ }
311
+ });
312
+
313
+ Object.keys(submenus).forEach(function (index) {
314
+ if (submenus[index].active) {
315
+ isActive = true;
316
+ }
317
+ });
318
+
319
+ return isActive;
320
+ },
321
+ hoverBackground: function hoverBackground() {
322
+ return this.rootMenu.hoverBackground;
323
+ },
324
+ backgroundColor: function backgroundColor() {
325
+ return this.rootMenu.backgroundColor || '';
326
+ },
327
+ activeTextColor: function activeTextColor() {
328
+ return this.rootMenu.activeTextColor || '';
329
+ },
330
+ textColor: function textColor() {
331
+ return this.rootMenu.textColor || '';
332
+ },
333
+ mode: function mode() {
334
+ return this.rootMenu.mode;
335
+ },
336
+ isMenuPopup: function isMenuPopup() {
337
+ return this.rootMenu.isMenuPopup;
338
+ },
339
+ titleStyle: function titleStyle() {
340
+ if (this.mode !== 'horizontal') {
341
+ return {
342
+ color: this.textColor
343
+ };
344
+ }
345
+ return {
346
+ borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
347
+ color: this.active ? this.activeTextColor : this.textColor
348
+ };
349
+ },
350
+ isFirstLevel: function isFirstLevel() {
351
+ var isFirstLevel = true;
352
+ var parent = this.$parent;
353
+ while (parent && parent !== this.rootMenu) {
354
+ if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
355
+ isFirstLevel = false;
356
+ break;
357
+ } else {
358
+ parent = parent.$parent;
359
+ }
360
+ }
361
+ return isFirstLevel;
362
+ }
363
+ },
364
+ methods: {
365
+ handleCollapseToggle: function handleCollapseToggle(value) {
366
+ if (value) {
367
+ this.initPopper();
368
+ } else {
369
+ this.doDestroy();
370
+ }
371
+ },
372
+ addItem: function addItem(item) {
373
+ this.$set(this.items, item.index, item);
374
+ },
375
+ removeItem: function removeItem(item) {
376
+ delete this.items[item.index];
377
+ },
378
+ addSubmenu: function addSubmenu(item) {
379
+ this.$set(this.submenus, item.index, item);
380
+ },
381
+ removeSubmenu: function removeSubmenu(item) {
382
+ delete this.submenus[item.index];
383
+ },
384
+ handleClick: function handleClick() {
385
+ var rootMenu = this.rootMenu,
386
+ disabled = this.disabled;
387
+
388
+ if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
389
+ return;
390
+ }
391
+ this.dispatch('ElMenu', 'submenu-click', this);
392
+ },
393
+ handleMouseenter: function handleMouseenter(event) {
394
+ var _this2 = this;
1519
395
 
396
+ var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
1520
397
 
1521
398
 
399
+ if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
400
+ return;
401
+ }
402
+ var rootMenu = this.rootMenu,
403
+ disabled = this.disabled;
1522
404
 
405
+ if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
406
+ return;
407
+ }
408
+ this.dispatch('ElSubmenu', 'mouse-enter-child');
409
+ clearTimeout(this.timeout);
410
+ this.timeout = setTimeout(function () {
411
+ _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
412
+ }, showTimeout);
413
+
414
+ if (this.appendToBody) {
415
+ this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
416
+ }
417
+ },
418
+ handleMouseleave: function handleMouseleave() {
419
+ var _this3 = this;
1523
420
 
1524
- var PopperJS = vue__WEBPACK_IMPORTED_MODULE_3___default.a.prototype.$isServer ? function () {} : __webpack_require__(71);
1525
- var stop = function stop(e) {
1526
- return e.stopPropagation();
1527
- };
421
+ var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
422
+ var rootMenu = this.rootMenu;
1528
423
 
1529
- /**
1530
- * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
1531
- * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
1532
- * @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)
1533
- * @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).
1534
- * @param {Boolean} [visible=false] Visibility of the popup element.
1535
- * @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.
1536
- */
1537
- /* harmony default export */ __webpack_exports__["a"] = ({
1538
- props: {
1539
- transformOrigin: {
1540
- type: [Boolean, String],
1541
- default: true
1542
- },
1543
- placement: {
1544
- type: String,
1545
- default: 'bottom'
1546
- },
1547
- boundariesPadding: {
1548
- type: Number,
1549
- default: 5
1550
- },
1551
- reference: {},
1552
- popper: {},
1553
- offset: {
1554
- default: 0
1555
- },
1556
- value: Boolean,
1557
- visibleArrow: Boolean,
1558
- arrowOffset: {
1559
- type: Number,
1560
- default: 35
1561
- },
1562
- appendToBody: {
1563
- type: Boolean,
1564
- default: true
1565
- },
1566
- popperOptions: {
1567
- type: Object,
1568
- default: function _default() {
1569
- return {
1570
- gpuAcceleration: false
1571
- };
1572
- }
1573
- }
1574
- },
1575
- data: function data() {
1576
- return {
1577
- showPopper: false,
1578
- currentPlacement: ''
1579
- };
1580
- },
1581
- watch: {
1582
- value: {
1583
- immediate: true,
1584
- handler: function handler(val) {
1585
- this.showPopper = val;
1586
- this.$emit('input', val);
1587
- }
1588
- },
1589
- showPopper: function showPopper(val) {
1590
- if (this.disabled) return;
1591
- val ? this.updatePopper() : this.destroyPopper();
1592
- this.$emit('input', val);
1593
- }
1594
- },
1595
- methods: {
1596
- createPopper: function createPopper() {
1597
- var _this = this;
1598
- if (this.$isServer) return;
1599
- this.currentPlacement = this.currentPlacement || this.placement;
1600
- if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
1601
- return;
1602
- }
1603
- var options = this.popperOptions;
1604
- var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
1605
- var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
1606
- if (!reference && this.$slots.reference && this.$slots.reference[0]) {
1607
- reference = this.referenceElm = this.$slots.reference[0].elm;
1608
- }
1609
- if (!popper || !reference) return;
1610
- if (this.visibleArrow) this.appendArrow(popper);
1611
- if (this.appendToBody) document.body.appendChild(this.popperElm);
1612
- if (this.popperJS && this.popperJS.destroy) {
1613
- this.popperJS.destroy();
1614
- }
1615
- options.placement = this.currentPlacement;
1616
- options.offset = this.offset;
1617
- options.arrowOffset = this.arrowOffset;
1618
- this.popperJS = new PopperJS(reference, popper, options);
1619
- this.popperJS.onCreate(function (_) {
1620
- _this.$emit('created', _this);
1621
- _this.resetTransformOrigin();
1622
- _this.$nextTick(_this.updatePopper);
1623
- });
1624
- if (typeof options.onUpdate === 'function') {
1625
- this.popperJS.onUpdate(options.onUpdate);
1626
- }
1627
- this.popperJS._popper.style.zIndex = _popup__WEBPACK_IMPORTED_MODULE_4__[/* PopupManager */ "a"].nextZIndex();
1628
- this.popperElm.addEventListener('click', stop);
1629
- },
1630
- updatePopper: function updatePopper() {
1631
- var popperJS = this.popperJS;
1632
- if (popperJS) {
1633
- popperJS.update();
1634
- if (popperJS._popper) {
1635
- popperJS._popper.style.zIndex = _popup__WEBPACK_IMPORTED_MODULE_4__[/* PopupManager */ "a"].nextZIndex();
1636
- }
1637
- } else {
1638
- this.createPopper();
1639
- }
1640
- },
1641
- doDestroy: function doDestroy(forceDestroy) {
1642
- /* istanbul ignore if */
1643
- if (!this.popperJS || this.showPopper && !forceDestroy) return;
1644
- this.popperJS.destroy();
1645
- this.popperJS = null;
1646
- },
1647
- destroyPopper: function destroyPopper() {
1648
- if (this.popperJS) {
1649
- this.resetTransformOrigin();
1650
- }
1651
- },
1652
- resetTransformOrigin: function resetTransformOrigin() {
1653
- if (!this.transformOrigin) return;
1654
- var placementMap = {
1655
- top: 'bottom',
1656
- bottom: 'top',
1657
- left: 'right',
1658
- right: 'left'
1659
- };
1660
- var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
1661
- var origin = placementMap[placement];
1662
- this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? "center " + origin : origin + " center";
1663
- },
1664
- appendArrow: function appendArrow(element) {
1665
- var hash;
1666
- if (this.appended) {
1667
- return;
1668
- }
1669
- this.appended = true;
1670
- for (var item in element.attributes) {
1671
- if (/^_v-/.test(element.attributes[item].name)) {
1672
- hash = element.attributes[item].name;
1673
- break;
1674
- }
1675
- }
1676
- var arrow = document.createElement('div');
1677
- if (hash) {
1678
- arrow.setAttribute(hash, '');
1679
- }
1680
- arrow.setAttribute('x-arrow', '');
1681
- arrow.className = 'popper__arrow';
1682
- element.appendChild(arrow);
1683
- }
1684
- },
1685
- beforeDestroy: function beforeDestroy() {
1686
- this.doDestroy(true);
1687
- if (this.popperElm && this.popperElm.parentNode === document.body) {
1688
- this.popperElm.removeEventListener('click', stop);
1689
- document.body.removeChild(this.popperElm);
1690
- }
1691
- },
1692
- // call destroy in keep-alive mode
1693
- deactivated: function deactivated() {
1694
- this.$options.beforeDestroy[0].call(this);
1695
- }
424
+ if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
425
+ return;
426
+ }
427
+ this.dispatch('ElSubmenu', 'mouse-leave-child');
428
+ clearTimeout(this.timeout);
429
+ this.timeout = setTimeout(function () {
430
+ !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
431
+ }, this.hideTimeout);
432
+
433
+ if (this.appendToBody && deepDispatch) {
434
+ if (this.$parent.$options.name === 'ElSubmenu') {
435
+ this.$parent.handleMouseleave(true);
436
+ }
437
+ }
438
+ },
439
+ handleTitleMouseenter: function handleTitleMouseenter() {
440
+ if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
441
+ var title = this.$refs['submenu-title'];
442
+ title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
443
+ },
444
+ handleTitleMouseleave: function handleTitleMouseleave() {
445
+ if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
446
+ var title = this.$refs['submenu-title'];
447
+ title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
448
+ },
449
+ updatePlacement: function updatePlacement() {
450
+ this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
451
+ },
452
+ initPopper: function initPopper() {
453
+ this.referenceElm = this.$el;
454
+ this.popperElm = this.$refs.menu;
455
+ this.updatePlacement();
456
+ }
457
+ },
458
+ created: function created() {
459
+ var _this4 = this;
460
+
461
+ this.$on('toggle-collapse', this.handleCollapseToggle);
462
+ this.$on('mouse-enter-child', function () {
463
+ _this4.mouseInChild = true;
464
+ clearTimeout(_this4.timeout);
465
+ });
466
+ this.$on('mouse-leave-child', function () {
467
+ _this4.mouseInChild = false;
468
+ clearTimeout(_this4.timeout);
469
+ });
470
+ },
471
+ mounted: function mounted() {
472
+ this.parentMenu.addSubmenu(this);
473
+ this.rootMenu.addSubmenu(this);
474
+ this.initPopper();
475
+ },
476
+ beforeDestroy: function beforeDestroy() {
477
+ this.parentMenu.removeSubmenu(this);
478
+ this.rootMenu.removeSubmenu(this);
479
+ },
480
+ render: function render(h) {
481
+ var _this5 = this;
482
+
483
+ var active = this.active,
484
+ opened = this.opened,
485
+ paddingStyle = this.paddingStyle,
486
+ titleStyle = this.titleStyle,
487
+ backgroundColor = this.backgroundColor,
488
+ rootMenu = this.rootMenu,
489
+ currentPlacement = this.currentPlacement,
490
+ menuTransitionName = this.menuTransitionName,
491
+ mode = this.mode,
492
+ disabled = this.disabled,
493
+ popperClass = this.popperClass,
494
+ $slots = this.$slots,
495
+ isFirstLevel = this.isFirstLevel;
496
+
497
+
498
+ var popupMenu = h(
499
+ 'transition',
500
+ {
501
+ attrs: { name: menuTransitionName }
502
+ },
503
+ [h(
504
+ 'div',
505
+ {
506
+ ref: 'menu',
507
+ directives: [{
508
+ name: 'show',
509
+ value: opened
510
+ }],
511
+
512
+ 'class': ['el-menu--' + mode, popperClass],
513
+ on: {
514
+ 'mouseenter': function mouseenter($event) {
515
+ return _this5.handleMouseenter($event, 100);
516
+ },
517
+ 'mouseleave': function mouseleave() {
518
+ return _this5.handleMouseleave(true);
519
+ },
520
+ 'focus': function focus($event) {
521
+ return _this5.handleMouseenter($event, 100);
522
+ }
523
+ }
524
+ },
525
+ [h(
526
+ 'ul',
527
+ {
528
+ attrs: {
529
+ role: 'menu'
530
+ },
531
+ 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
532
+ style: { backgroundColor: rootMenu.backgroundColor || '' } },
533
+ [$slots.default]
534
+ )]
535
+ )]
536
+ );
537
+
538
+ var inlineMenu = h('el-collapse-transition', [h(
539
+ 'ul',
540
+ {
541
+ attrs: {
542
+ role: 'menu'
543
+ },
544
+ 'class': 'el-menu el-menu--inline',
545
+ directives: [{
546
+ name: 'show',
547
+ value: opened
548
+ }],
549
+
550
+ style: { backgroundColor: rootMenu.backgroundColor || '' } },
551
+ [$slots.default]
552
+ )]);
553
+
554
+ var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
555
+
556
+ return h(
557
+ 'li',
558
+ {
559
+ 'class': {
560
+ 'el-submenu': true,
561
+ 'is-active': active,
562
+ 'is-opened': opened,
563
+ 'is-disabled': disabled
564
+ },
565
+ attrs: { role: 'menuitem',
566
+ 'aria-haspopup': 'true',
567
+ 'aria-expanded': opened
568
+ },
569
+ on: {
570
+ 'mouseenter': this.handleMouseenter,
571
+ 'mouseleave': function mouseleave() {
572
+ return _this5.handleMouseleave(false);
573
+ },
574
+ 'focus': this.handleMouseenter
575
+ }
576
+ },
577
+ [h(
578
+ 'div',
579
+ {
580
+ 'class': 'el-submenu__title',
581
+ ref: 'submenu-title',
582
+ on: {
583
+ 'click': this.handleClick,
584
+ 'mouseenter': this.handleTitleMouseenter,
585
+ 'mouseleave': this.handleTitleMouseleave
586
+ },
587
+
588
+ style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
589
+ },
590
+ [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
591
+ ), this.isMenuPopup ? popupMenu : inlineMenu]
592
+ );
593
+ }
1696
594
  });
595
+ // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js
596
+ /* harmony default export */ var src_submenuvue_type_script_lang_js = (submenuvue_type_script_lang_js);
597
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
598
+ var componentNormalizer = __webpack_require__(0);
1697
599
 
1698
- /***/ }),
1699
-
1700
- /***/ 53:
1701
- /***/ (function(module, exports) {
1702
-
1703
- module.exports = require("core-js/modules/es.array.includes.js");
1704
-
1705
- /***/ }),
1706
-
1707
- /***/ 56:
1708
- /***/ (function(module, exports) {
1709
-
1710
- module.exports = require("core-js/modules/es.string.trim.js");
600
+ // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
601
+ var render, staticRenderFns
1711
602
 
1712
- /***/ }),
1713
603
 
1714
- /***/ 59:
1715
- /***/ (function(module, exports) {
1716
604
 
1717
- module.exports = require("core-js/modules/es.string.split.js");
1718
605
 
1719
- /***/ }),
606
+ /* normalize component */
1720
607
 
1721
- /***/ 6:
1722
- /***/ (function(module, exports) {
608
+ var component = Object(componentNormalizer["a" /* default */])(
609
+ src_submenuvue_type_script_lang_js,
610
+ render,
611
+ staticRenderFns,
612
+ false,
613
+ null,
614
+ null,
615
+ null
616
+
617
+ )
1723
618
 
1724
- module.exports = require("core-js/modules/es.number.constructor.js");
619
+ /* harmony default export */ var submenu = (component.exports);
620
+ // CONCATENATED MODULE: ./packages/submenu/index.js
1725
621
 
1726
- /***/ }),
1727
622
 
1728
- /***/ 60:
1729
- /***/ (function(module, exports) {
623
+ /* istanbul ignore next */
624
+ submenu.install = function (Vue) {
625
+ Vue.component(submenu.name, submenu);
626
+ };
1730
627
 
1731
- module.exports = require("core-js/modules/es.object.assign.js");
628
+ /* harmony default export */ var packages_submenu = __webpack_exports__["default"] = (submenu);
1732
629
 
1733
630
  /***/ }),
1734
631
 
1735
- /***/ 7:
632
+ /***/ 28:
1736
633
  /***/ (function(module, exports) {
1737
634
 
1738
- module.exports = require("core-js/modules/es.regexp.exec.js");
635
+ module.exports = require("element-ui/lib/transitions/collapse-transition");
1739
636
 
1740
637
  /***/ }),
1741
638
 
1742
- /***/ 71:
639
+ /***/ 37:
1743
640
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1744
641
 
1745
642
  "use strict";
1746
- __webpack_require__.r(__webpack_exports__);
1747
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1748
- /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_0__);
1749
- /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
1750
- /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_1__);
1751
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
1752
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_2__);
1753
- /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60);
1754
- /* harmony import */ var core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_assign_js__WEBPACK_IMPORTED_MODULE_3__);
1755
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73);
1756
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_4__);
1757
- /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
1758
- /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__);
1759
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
1760
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__);
1761
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
1762
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__);
1763
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11);
1764
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_8__);
1765
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12);
1766
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_9__);
1767
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(10);
1768
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_10__);
1769
-
1770
-
1771
-
1772
-
1773
-
1774
-
1775
-
1776
-
1777
-
1778
-
1779
-
1780
- /**
1781
- * @fileOverview Kickass library to create and place poppers near their reference elements.
1782
- * @version {{version}}
1783
- * @license
1784
- * Copyright (c) 2016 Federico Zivolo and contributors
1785
- *
1786
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1787
- * of this software and associated documentation files (the "Software"), to deal
1788
- * in the Software without restriction, including without limitation the rights
1789
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1790
- * copies of the Software, and to permit persons to whom the Software is
1791
- * furnished to do so, subject to the following conditions:
1792
- *
1793
- * The above copyright notice and this permission notice shall be included in all
1794
- * copies or substantial portions of the Software.
1795
- *
1796
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1797
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1798
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1799
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1800
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1802
- * SOFTWARE.
1803
- */
1804
-
1805
- //
1806
- // Cross module loader
1807
- // Supported: Node, AMD, Browser globals
1808
- //
1809
- ;
1810
- (function (root, factory) {
1811
- if (typeof define === 'function' && __webpack_require__(74)) {
1812
- // AMD. Register as an anonymous module.
1813
- define(factory);
1814
- } else if ( true && module.exports) {
1815
- // Node. Does not work with strict CommonJS, but
1816
- // only CommonJS-like environments that support module.exports,
1817
- // like Node.
1818
- module.exports = factory();
1819
- } else {
1820
- // Browser globals (root is window)
1821
- root.Popper = factory();
1822
- }
1823
- })(undefined, function () {
1824
- 'use strict';
1825
-
1826
- var root = window;
1827
-
1828
- // default options
1829
- var DEFAULTS = {
1830
- // placement of the popper
1831
- placement: 'bottom',
1832
- gpuAcceleration: true,
1833
- // shift popper from its origin by the given amount of pixels (can be negative)
1834
- offset: 0,
1835
- // the element which will act as boundary of the popper
1836
- boundariesElement: 'viewport',
1837
- // amount of pixel used to define a minimum distance between the boundaries and the popper
1838
- boundariesPadding: 5,
1839
- // popper will try to prevent overflow following this order,
1840
- // by default, then, it could overflow on the left and on top of the boundariesElement
1841
- preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
1842
- // the behavior used by flip to change the placement of the popper
1843
- flipBehavior: 'flip',
1844
- arrowElement: '[x-arrow]',
1845
- arrowOffset: 0,
1846
- // list of functions used to modify the offsets before they are applied to the popper
1847
- modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
1848
- modifiersIgnored: [],
1849
- forceAbsolute: false
1850
- };
1851
-
1852
- /**
1853
- * Create a new Popper.js instance
1854
- * @constructor Popper
1855
- * @param {HTMLElement} reference - The reference element used to position the popper
1856
- * @param {HTMLElement|Object} popper
1857
- * The HTML element used as popper, or a configuration used to generate the popper.
1858
- * @param {String} [popper.tagName='div'] The tag name of the generated popper.
1859
- * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
1860
- * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
1861
- * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
1862
- * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.
1863
- * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
1864
- * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
1865
- * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
1866
- * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
1867
- * @param {Object} options
1868
- * @param {String} [options.placement=bottom]
1869
- * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
1870
- * left(-start, -end)`
1871
- *
1872
- * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
1873
- * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
1874
- * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
1875
- * reference element.
1876
- * By default, it will look for a child node of the popper with the `x-arrow` attribute.
1877
- *
1878
- * @param {Boolean} [options.gpuAcceleration=true]
1879
- * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
1880
- * browser to use the GPU to accelerate the rendering.
1881
- * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
1882
- *
1883
- * @param {Number} [options.offset=0]
1884
- * Amount of pixels the popper will be shifted (can be negative).
1885
- *
1886
- * @param {String|Element} [options.boundariesElement='viewport']
1887
- * The element which will define the boundaries of the popper position, the popper will never be placed outside
1888
- * of the defined boundaries (except if `keepTogether` is enabled)
1889
- *
1890
- * @param {Number} [options.boundariesPadding=5]
1891
- * Additional padding for the boundaries
1892
- *
1893
- * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
1894
- * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
1895
- * this means that the last ones will never overflow
1896
- *
1897
- * @param {String|Array} [options.flipBehavior='flip']
1898
- * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
1899
- * overlap its reference element. Defining `flip` as value, the placement will be flipped on
1900
- * its axis (`right - left`, `top - bottom`).
1901
- * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
1902
- * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
1903
- * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
1904
- *
1905
- * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
1906
- * List of functions used to modify the data before they are applied to the popper, add your custom functions
1907
- * to this array to edit the offsets and placement.
1908
- * The function should reflect the @params and @returns of preventOverflow
1909
- *
1910
- * @param {Array} [options.modifiersIgnored=[]]
1911
- * Put here any built-in modifier name you want to exclude from the modifiers list
1912
- * The function should reflect the @params and @returns of preventOverflow
1913
- *
1914
- * @param {Boolean} [options.removeOnDestroy=false]
1915
- * Set to true if you want to automatically remove the popper when you call the `destroy` method.
1916
- */
1917
- function Popper(reference, popper, options) {
1918
- this._reference = reference.jquery ? reference[0] : reference;
1919
- this.state = {};
1920
-
1921
- // if the popper variable is a configuration object, parse it to generate an HTMLElement
1922
- // generate a default popper if is not defined
1923
- var isNotDefined = typeof popper === 'undefined' || popper === null;
1924
- var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
1925
- if (isNotDefined || isConfig) {
1926
- this._popper = this.parse(isConfig ? popper : {});
1927
- }
1928
- // otherwise, use the given HTMLElement as popper
1929
- else {
1930
- this._popper = popper.jquery ? popper[0] : popper;
1931
- }
1932
-
1933
- // with {} we create a new object with the options inside it
1934
- this._options = Object.assign({}, DEFAULTS, options);
1935
-
1936
- // refactoring modifiers' list
1937
- this._options.modifiers = this._options.modifiers.map(function (modifier) {
1938
- // remove ignored modifiers
1939
- if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
1940
-
1941
- // set the x-placement attribute before everything else because it could be used to add margins to the popper
1942
- // margins needs to be calculated to get the correct popper offsets
1943
- if (modifier === 'applyStyle') {
1944
- this._popper.setAttribute('x-placement', this._options.placement);
1945
- }
1946
-
1947
- // return predefined modifier identified by string or keep the custom one
1948
- return this.modifiers[modifier] || modifier;
1949
- }.bind(this));
1950
-
1951
- // make sure to apply the popper position before any computation
1952
- this.state.position = this._getPosition(this._popper, this._reference);
1953
- setStyle(this._popper, {
1954
- position: this.state.position,
1955
- top: 0
1956
- });
1957
-
1958
- // fire the first update to position the popper in the right place
1959
- this.update();
1960
-
1961
- // setup event listeners, they will take care of update the position in specific situations
1962
- this._setupEventListeners();
1963
- return this;
1964
- }
1965
-
1966
- //
1967
- // Methods
1968
- //
1969
- /**
1970
- * Destroy the popper
1971
- * @method
1972
- * @memberof Popper
1973
- */
1974
- Popper.prototype.destroy = function () {
1975
- this._popper.removeAttribute('x-placement');
1976
- this._popper.style.left = '';
1977
- this._popper.style.position = '';
1978
- this._popper.style.top = '';
1979
- this._popper.style[getSupportedPropertyName('transform')] = '';
1980
- this._removeEventListeners();
1981
-
1982
- // remove the popper if user explicity asked for the deletion on destroy
1983
- if (this._options.removeOnDestroy) {
1984
- this._popper.remove();
1985
- }
1986
- return this;
1987
- };
1988
-
1989
- /**
1990
- * Updates the position of the popper, computing the new offsets and applying the new style
1991
- * @method
1992
- * @memberof Popper
1993
- */
1994
- Popper.prototype.update = function () {
1995
- var data = {
1996
- instance: this,
1997
- styles: {}
1998
- };
1999
-
2000
- // store placement inside the data object, modifiers will be able to edit `placement` if needed
2001
- // and refer to _originalPlacement to know the original value
2002
- data.placement = this._options.placement;
2003
- data._originalPlacement = this._options.placement;
2004
-
2005
- // compute the popper and reference offsets and put them inside data.offsets
2006
- data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
2007
-
2008
- // get boundaries
2009
- data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
2010
- data = this.runModifiers(data, this._options.modifiers);
2011
- if (typeof this.state.updateCallback === 'function') {
2012
- this.state.updateCallback(data);
2013
- }
2014
- };
2015
-
2016
- /**
2017
- * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
2018
- * @method
2019
- * @memberof Popper
2020
- * @param {Function} callback
2021
- */
2022
- Popper.prototype.onCreate = function (callback) {
2023
- // the createCallbacks return as first argument the popper instance
2024
- callback(this);
2025
- return this;
2026
- };
2027
-
2028
- /**
2029
- * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
2030
- * used to style popper and its arrow.
2031
- * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
2032
- * @method
2033
- * @memberof Popper
2034
- * @param {Function} callback
2035
- */
2036
- Popper.prototype.onUpdate = function (callback) {
2037
- this.state.updateCallback = callback;
2038
- return this;
2039
- };
2040
-
2041
- /**
2042
- * Helper used to generate poppers from a configuration file
2043
- * @method
2044
- * @memberof Popper
2045
- * @param config {Object} configuration
2046
- * @returns {HTMLElement} popper
2047
- */
2048
- Popper.prototype.parse = function (config) {
2049
- var defaultConfig = {
2050
- tagName: 'div',
2051
- classNames: ['popper'],
2052
- attributes: [],
2053
- parent: root.document.body,
2054
- content: '',
2055
- contentType: 'text',
2056
- arrowTagName: 'div',
2057
- arrowClassNames: ['popper__arrow'],
2058
- arrowAttributes: ['x-arrow']
2059
- };
2060
- config = Object.assign({}, defaultConfig, config);
2061
- var d = root.document;
2062
- var popper = d.createElement(config.tagName);
2063
- addClassNames(popper, config.classNames);
2064
- addAttributes(popper, config.attributes);
2065
- if (config.contentType === 'node') {
2066
- popper.appendChild(config.content.jquery ? config.content[0] : config.content);
2067
- } else if (config.contentType === 'html') {
2068
- popper.innerHTML = config.content;
2069
- } else {
2070
- popper.textContent = config.content;
2071
- }
2072
- if (config.arrowTagName) {
2073
- var arrow = d.createElement(config.arrowTagName);
2074
- addClassNames(arrow, config.arrowClassNames);
2075
- addAttributes(arrow, config.arrowAttributes);
2076
- popper.appendChild(arrow);
2077
- }
2078
- var parent = config.parent.jquery ? config.parent[0] : config.parent;
2079
-
2080
- // if the given parent is a string, use it to match an element
2081
- // if more than one element is matched, the first one will be used as parent
2082
- // if no elements are matched, the script will throw an error
2083
- if (typeof parent === 'string') {
2084
- parent = d.querySelectorAll(config.parent);
2085
- if (parent.length > 1) {
2086
- console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
2087
- }
2088
- if (parent.length === 0) {
2089
- throw 'ERROR: the given `parent` doesn\'t exists!';
2090
- }
2091
- parent = parent[0];
2092
- }
2093
- // if the given parent is a DOM nodes list or an array of nodes with more than one element,
2094
- // the first one will be used as parent
2095
- if (parent.length > 1 && parent instanceof Element === false) {
2096
- console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
2097
- parent = parent[0];
2098
- }
2099
-
2100
- // append the generated popper to its parent
2101
- parent.appendChild(popper);
2102
- return popper;
2103
-
2104
- /**
2105
- * Adds class names to the given element
2106
- * @function
2107
- * @ignore
2108
- * @param {HTMLElement} target
2109
- * @param {Array} classes
2110
- */
2111
- function addClassNames(element, classNames) {
2112
- classNames.forEach(function (className) {
2113
- element.classList.add(className);
2114
- });
2115
- }
2116
-
2117
- /**
2118
- * Adds attributes to the given element
2119
- * @function
2120
- * @ignore
2121
- * @param {HTMLElement} target
2122
- * @param {Array} attributes
2123
- * @example
2124
- * addAttributes(element, [ 'data-info:foobar' ]);
2125
- */
2126
- function addAttributes(element, attributes) {
2127
- attributes.forEach(function (attribute) {
2128
- element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
2129
- });
2130
- }
2131
- };
2132
-
2133
- /**
2134
- * Helper used to get the position which will be applied to the popper
2135
- * @method
2136
- * @memberof Popper
2137
- * @param config {HTMLElement} popper element
2138
- * @param reference {HTMLElement} reference element
2139
- * @returns {String} position
2140
- */
2141
- Popper.prototype._getPosition = function (popper, reference) {
2142
- var container = getOffsetParent(reference);
2143
- if (this._options.forceAbsolute) {
2144
- return 'absolute';
2145
- }
2146
-
2147
- // Decide if the popper will be fixed
2148
- // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
2149
- var isParentFixed = isFixed(reference, container);
2150
- return isParentFixed ? 'fixed' : 'absolute';
2151
- };
2152
-
2153
- /**
2154
- * Get offsets to the popper
2155
- * @method
2156
- * @memberof Popper
2157
- * @access private
2158
- * @param {Element} popper - the popper element
2159
- * @param {Element} reference - the reference element (the popper will be relative to this)
2160
- * @returns {Object} An object containing the offsets which will be applied to the popper
2161
- */
2162
- Popper.prototype._getOffsets = function (popper, reference, placement) {
2163
- placement = placement.split('-')[0];
2164
- var popperOffsets = {};
2165
- popperOffsets.position = this.state.position;
2166
- var isParentFixed = popperOffsets.position === 'fixed';
2167
-
2168
- //
2169
- // Get reference element position
2170
- //
2171
- var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
2172
-
2173
- //
2174
- // Get popper sizes
2175
- //
2176
- var popperRect = getOuterSizes(popper);
2177
-
2178
- //
2179
- // Compute offsets of popper
2180
- //
2181
-
2182
- // depending by the popper placement we have to compute its offsets slightly differently
2183
- if (['right', 'left'].indexOf(placement) !== -1) {
2184
- popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
2185
- if (placement === 'left') {
2186
- popperOffsets.left = referenceOffsets.left - popperRect.width;
2187
- } else {
2188
- popperOffsets.left = referenceOffsets.right;
2189
- }
2190
- } else {
2191
- popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
2192
- if (placement === 'top') {
2193
- popperOffsets.top = referenceOffsets.top - popperRect.height;
2194
- } else {
2195
- popperOffsets.top = referenceOffsets.bottom;
2196
- }
2197
- }
2198
-
2199
- // Add width and height to our offsets object
2200
- popperOffsets.width = popperRect.width;
2201
- popperOffsets.height = popperRect.height;
2202
- return {
2203
- popper: popperOffsets,
2204
- reference: referenceOffsets
2205
- };
2206
- };
2207
-
2208
- /**
2209
- * Setup needed event listeners used to update the popper position
2210
- * @method
2211
- * @memberof Popper
2212
- * @access private
2213
- */
2214
- Popper.prototype._setupEventListeners = function () {
2215
- // NOTE: 1 DOM access here
2216
- this.state.updateBound = this.update.bind(this);
2217
- root.addEventListener('resize', this.state.updateBound);
2218
- // if the boundariesElement is window we don't need to listen for the scroll event
2219
- if (this._options.boundariesElement !== 'window') {
2220
- var target = getScrollParent(this._reference);
2221
- // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
2222
- if (target === root.document.body || target === root.document.documentElement) {
2223
- target = root;
2224
- }
2225
- target.addEventListener('scroll', this.state.updateBound);
2226
- this.state.scrollTarget = target;
2227
- }
2228
- };
2229
-
2230
- /**
2231
- * Remove event listeners used to update the popper position
2232
- * @method
2233
- * @memberof Popper
2234
- * @access private
2235
- */
2236
- Popper.prototype._removeEventListeners = function () {
2237
- // NOTE: 1 DOM access here
2238
- root.removeEventListener('resize', this.state.updateBound);
2239
- if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
2240
- this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
2241
- this.state.scrollTarget = null;
2242
- }
2243
- this.state.updateBound = null;
2244
- };
2245
-
2246
- /**
2247
- * Computed the boundaries limits and return them
2248
- * @method
2249
- * @memberof Popper
2250
- * @access private
2251
- * @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
2252
- * @param {Number} padding - Boundaries padding
2253
- * @param {Element} boundariesElement - Element used to define the boundaries
2254
- * @returns {Object} Coordinates of the boundaries
2255
- */
2256
- Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
2257
- // NOTE: 1 DOM access here
2258
- var boundaries = {};
2259
- var width, height;
2260
- if (boundariesElement === 'window') {
2261
- var body = root.document.body,
2262
- html = root.document.documentElement;
2263
- height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
2264
- width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
2265
- boundaries = {
2266
- top: 0,
2267
- right: width,
2268
- bottom: height,
2269
- left: 0
2270
- };
2271
- } else if (boundariesElement === 'viewport') {
2272
- var offsetParent = getOffsetParent(this._popper);
2273
- var scrollParent = getScrollParent(this._popper);
2274
- var offsetParentRect = getOffsetRect(offsetParent);
2275
-
2276
- // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
2277
- var getScrollTopValue = function getScrollTopValue(element) {
2278
- return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
2279
- };
2280
- var getScrollLeftValue = function getScrollLeftValue(element) {
2281
- return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
2282
- };
2283
-
2284
- // if the popper is fixed we don't have to substract scrolling from the boundaries
2285
- var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
2286
- var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
2287
- boundaries = {
2288
- top: 0 - (offsetParentRect.top - scrollTop),
2289
- right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
2290
- bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
2291
- left: 0 - (offsetParentRect.left - scrollLeft)
2292
- };
2293
- } else {
2294
- if (getOffsetParent(this._popper) === boundariesElement) {
2295
- boundaries = {
2296
- top: 0,
2297
- left: 0,
2298
- right: boundariesElement.clientWidth,
2299
- bottom: boundariesElement.clientHeight
2300
- };
2301
- } else {
2302
- boundaries = getOffsetRect(boundariesElement);
2303
- }
2304
- }
2305
- boundaries.left += padding;
2306
- boundaries.right -= padding;
2307
- boundaries.top = boundaries.top + padding;
2308
- boundaries.bottom = boundaries.bottom - padding;
2309
- return boundaries;
2310
- };
2311
-
2312
- /**
2313
- * Loop trough the list of modifiers and run them in order, each of them will then edit the data object
2314
- * @method
2315
- * @memberof Popper
2316
- * @access public
2317
- * @param {Object} data
2318
- * @param {Array} modifiers
2319
- * @param {Function} ends
2320
- */
2321
- Popper.prototype.runModifiers = function (data, modifiers, ends) {
2322
- var modifiersToRun = modifiers.slice();
2323
- if (ends !== undefined) {
2324
- modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
2325
- }
2326
- modifiersToRun.forEach(function (modifier) {
2327
- if (isFunction(modifier)) {
2328
- data = modifier.call(this, data);
2329
- }
2330
- }.bind(this));
2331
- return data;
2332
- };
2333
-
2334
- /**
2335
- * Helper used to know if the given modifier depends from another one.
2336
- * @method
2337
- * @memberof Popper
2338
- * @param {String} requesting - name of requesting modifier
2339
- * @param {String} requested - name of requested modifier
2340
- * @returns {Boolean}
2341
- */
2342
- Popper.prototype.isModifierRequired = function (requesting, requested) {
2343
- var index = getArrayKeyIndex(this._options.modifiers, requesting);
2344
- return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
2345
- return modifier === requested;
2346
- }).length;
2347
- };
2348
-
2349
- //
2350
- // Modifiers
2351
- //
2352
-
2353
- /**
2354
- * Modifiers list
2355
- * @namespace Popper.modifiers
2356
- * @memberof Popper
2357
- * @type {Object}
2358
- */
2359
- Popper.prototype.modifiers = {};
2360
-
2361
- /**
2362
- * Apply the computed styles to the popper element
2363
- * @method
2364
- * @memberof Popper.modifiers
2365
- * @argument {Object} data - The data object generated by `update` method
2366
- * @returns {Object} The same data object
2367
- */
2368
- Popper.prototype.modifiers.applyStyle = function (data) {
2369
- // apply the final offsets to the popper
2370
- // NOTE: 1 DOM access here
2371
- var styles = {
2372
- position: data.offsets.popper.position
2373
- };
2374
-
2375
- // round top and left to avoid blurry text
2376
- var left = Math.round(data.offsets.popper.left);
2377
- var top = Math.round(data.offsets.popper.top);
2378
-
2379
- // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
2380
- // we automatically use the supported prefixed version if needed
2381
- var prefixedProperty;
2382
- if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
2383
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2384
- styles.top = 0;
2385
- styles.left = 0;
2386
- }
2387
- // othwerise, we use the standard `left` and `top` properties
2388
- else {
2389
- styles.left = left;
2390
- styles.top = top;
2391
- }
2392
-
2393
- // any property present in `data.styles` will be applied to the popper,
2394
- // in this way we can make the 3rd party modifiers add custom styles to it
2395
- // Be aware, modifiers could override the properties defined in the previous
2396
- // lines of this modifier!
2397
- Object.assign(styles, data.styles);
2398
- setStyle(this._popper, styles);
2399
-
2400
- // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
2401
- // NOTE: 1 DOM access here
2402
- this._popper.setAttribute('x-placement', data.placement);
2403
-
2404
- // if the arrow modifier is required and the arrow style has been computed, apply the arrow style
2405
- if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
2406
- setStyle(data.arrowElement, data.offsets.arrow);
2407
- }
2408
- return data;
2409
- };
2410
-
2411
- /**
2412
- * Modifier used to shift the popper on the start or end of its reference element side
2413
- * @method
2414
- * @memberof Popper.modifiers
2415
- * @argument {Object} data - The data object generated by `update` method
2416
- * @returns {Object} The data object, properly modified
2417
- */
2418
- Popper.prototype.modifiers.shift = function (data) {
2419
- var placement = data.placement;
2420
- var basePlacement = placement.split('-')[0];
2421
- var shiftVariation = placement.split('-')[1];
2422
-
2423
- // if shift shiftVariation is specified, run the modifier
2424
- if (shiftVariation) {
2425
- var reference = data.offsets.reference;
2426
- var popper = getPopperClientRect(data.offsets.popper);
2427
- var shiftOffsets = {
2428
- y: {
2429
- start: {
2430
- top: reference.top
2431
- },
2432
- end: {
2433
- top: reference.top + reference.height - popper.height
2434
- }
2435
- },
2436
- x: {
2437
- start: {
2438
- left: reference.left
2439
- },
2440
- end: {
2441
- left: reference.left + reference.width - popper.width
2442
- }
2443
- }
2444
- };
2445
- var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
2446
- data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
2447
- }
2448
- return data;
2449
- };
2450
-
2451
- /**
2452
- * Modifier used to make sure the popper does not overflows from it's boundaries
2453
- * @method
2454
- * @memberof Popper.modifiers
2455
- * @argument {Object} data - The data object generated by `update` method
2456
- * @returns {Object} The data object, properly modified
2457
- */
2458
- Popper.prototype.modifiers.preventOverflow = function (data) {
2459
- var order = this._options.preventOverflowOrder;
2460
- var popper = getPopperClientRect(data.offsets.popper);
2461
- var check = {
2462
- left: function left() {
2463
- var left = popper.left;
2464
- if (popper.left < data.boundaries.left) {
2465
- left = Math.max(popper.left, data.boundaries.left);
2466
- }
2467
- return {
2468
- left: left
2469
- };
2470
- },
2471
- right: function right() {
2472
- var left = popper.left;
2473
- if (popper.right > data.boundaries.right) {
2474
- left = Math.min(popper.left, data.boundaries.right - popper.width);
2475
- }
2476
- return {
2477
- left: left
2478
- };
2479
- },
2480
- top: function top() {
2481
- var top = popper.top;
2482
- if (popper.top < data.boundaries.top) {
2483
- top = Math.max(popper.top, data.boundaries.top);
2484
- }
2485
- return {
2486
- top: top
2487
- };
2488
- },
2489
- bottom: function bottom() {
2490
- var top = popper.top;
2491
- if (popper.bottom > data.boundaries.bottom) {
2492
- top = Math.min(popper.top, data.boundaries.bottom - popper.height);
2493
- }
2494
- return {
2495
- top: top
2496
- };
2497
- }
2498
- };
2499
- order.forEach(function (direction) {
2500
- data.offsets.popper = Object.assign(popper, check[direction]());
2501
- });
2502
- return data;
2503
- };
2504
-
2505
- /**
2506
- * Modifier used to make sure the popper is always near its reference
2507
- * @method
2508
- * @memberof Popper.modifiers
2509
- * @argument {Object} data - The data object generated by _update method
2510
- * @returns {Object} The data object, properly modified
2511
- */
2512
- Popper.prototype.modifiers.keepTogether = function (data) {
2513
- var popper = getPopperClientRect(data.offsets.popper);
2514
- var reference = data.offsets.reference;
2515
- var f = Math.floor;
2516
- if (popper.right < f(reference.left)) {
2517
- data.offsets.popper.left = f(reference.left) - popper.width;
2518
- }
2519
- if (popper.left > f(reference.right)) {
2520
- data.offsets.popper.left = f(reference.right);
2521
- }
2522
- if (popper.bottom < f(reference.top)) {
2523
- data.offsets.popper.top = f(reference.top) - popper.height;
2524
- }
2525
- if (popper.top > f(reference.bottom)) {
2526
- data.offsets.popper.top = f(reference.bottom);
2527
- }
2528
- return data;
2529
- };
2530
-
2531
- /**
2532
- * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
2533
- * Requires the `preventOverflow` modifier before it in order to work.
2534
- * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
2535
- * @method
2536
- * @memberof Popper.modifiers
2537
- * @argument {Object} data - The data object generated by _update method
2538
- * @returns {Object} The data object, properly modified
2539
- */
2540
- Popper.prototype.modifiers.flip = function (data) {
2541
- // check if preventOverflow is in the list of modifiers before the flip modifier.
2542
- // otherwise flip would not work as expected.
2543
- if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
2544
- console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
2545
- return data;
2546
- }
2547
- if (data.flipped && data.placement === data._originalPlacement) {
2548
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
2549
- return data;
2550
- }
2551
- var placement = data.placement.split('-')[0];
2552
- var placementOpposite = getOppositePlacement(placement);
2553
- var variation = data.placement.split('-')[1] || '';
2554
- var flipOrder = [];
2555
- if (this._options.flipBehavior === 'flip') {
2556
- flipOrder = [placement, placementOpposite];
2557
- } else {
2558
- flipOrder = this._options.flipBehavior;
2559
- }
2560
- flipOrder.forEach(function (step, index) {
2561
- if (placement !== step || flipOrder.length === index + 1) {
2562
- return;
2563
- }
2564
- placement = data.placement.split('-')[0];
2565
- placementOpposite = getOppositePlacement(placement);
2566
- var popperOffsets = getPopperClientRect(data.offsets.popper);
2567
-
2568
- // this boolean is used to distinguish right and bottom from top and left
2569
- // they need different computations to get flipped
2570
- var a = ['right', 'bottom'].indexOf(placement) !== -1;
2571
-
2572
- // using Math.floor because the reference offsets may contain decimals we are not going to consider here
2573
- if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
2574
- // we'll use this boolean to detect any flip loop
2575
- data.flipped = true;
2576
- data.placement = flipOrder[index + 1];
2577
- if (variation) {
2578
- data.placement += '-' + variation;
2579
- }
2580
- data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
2581
- data = this.runModifiers(data, this._options.modifiers, this._flip);
2582
- }
2583
- }.bind(this));
2584
- return data;
2585
- };
2586
-
2587
- /**
2588
- * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
2589
- * The offsets will shift the popper on the side of its reference element.
2590
- * @method
2591
- * @memberof Popper.modifiers
2592
- * @argument {Object} data - The data object generated by _update method
2593
- * @returns {Object} The data object, properly modified
2594
- */
2595
- Popper.prototype.modifiers.offset = function (data) {
2596
- var offset = this._options.offset;
2597
- var popper = data.offsets.popper;
2598
- if (data.placement.indexOf('left') !== -1) {
2599
- popper.top -= offset;
2600
- } else if (data.placement.indexOf('right') !== -1) {
2601
- popper.top += offset;
2602
- } else if (data.placement.indexOf('top') !== -1) {
2603
- popper.left -= offset;
2604
- } else if (data.placement.indexOf('bottom') !== -1) {
2605
- popper.left += offset;
2606
- }
2607
- return data;
2608
- };
2609
-
2610
- /**
2611
- * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
2612
- * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
2613
- * @method
2614
- * @memberof Popper.modifiers
2615
- * @argument {Object} data - The data object generated by _update method
2616
- * @returns {Object} The data object, properly modified
2617
- */
2618
- Popper.prototype.modifiers.arrow = function (data) {
2619
- var arrow = this._options.arrowElement;
2620
- var arrowOffset = this._options.arrowOffset;
2621
-
2622
- // if the arrowElement is a string, suppose it's a CSS selector
2623
- if (typeof arrow === 'string') {
2624
- arrow = this._popper.querySelector(arrow);
2625
- }
2626
-
2627
- // if arrow element is not found, don't run the modifier
2628
- if (!arrow) {
2629
- return data;
2630
- }
2631
-
2632
- // the arrow element must be child of its popper
2633
- if (!this._popper.contains(arrow)) {
2634
- console.warn('WARNING: `arrowElement` must be child of its popper element!');
2635
- return data;
2636
- }
2637
-
2638
- // arrow depends on keepTogether in order to work
2639
- if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
2640
- console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
2641
- return data;
2642
- }
2643
- var arrowStyle = {};
2644
- var placement = data.placement.split('-')[0];
2645
- var popper = getPopperClientRect(data.offsets.popper);
2646
- var reference = data.offsets.reference;
2647
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
2648
- var len = isVertical ? 'height' : 'width';
2649
- var side = isVertical ? 'top' : 'left';
2650
- var translate = isVertical ? 'translateY' : 'translateX';
2651
- var altSide = isVertical ? 'left' : 'top';
2652
- var opSide = isVertical ? 'bottom' : 'right';
2653
- var arrowSize = getOuterSizes(arrow)[len];
2654
-
2655
- //
2656
- // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
2657
- //
2658
-
2659
- // top/left side
2660
- if (reference[opSide] - arrowSize < popper[side]) {
2661
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
2662
- }
2663
- // bottom/right side
2664
- if (reference[side] + arrowSize > popper[opSide]) {
2665
- data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
2666
- }
2667
-
2668
- // compute center of the popper
2669
- var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
2670
- var sideValue = center - popper[side];
2671
-
2672
- // prevent arrow from being placed not contiguously to its popper
2673
- sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
2674
- arrowStyle[side] = sideValue;
2675
- arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
2676
-
2677
- data.offsets.arrow = arrowStyle;
2678
- data.arrowElement = arrow;
2679
- return data;
2680
- };
2681
-
2682
- //
2683
- // Helpers
2684
- //
2685
-
2686
- /**
2687
- * Get the outer sizes of the given element (offset size + margins)
2688
- * @function
2689
- * @ignore
2690
- * @argument {Element} element
2691
- * @returns {Object} object containing width and height properties
2692
- */
2693
- function getOuterSizes(element) {
2694
- // NOTE: 1 DOM access here
2695
- var _display = element.style.display,
2696
- _visibility = element.style.visibility;
2697
- element.style.display = 'block';
2698
- element.style.visibility = 'hidden';
2699
- var calcWidthToForceRepaint = element.offsetWidth;
2700
-
2701
- // original method
2702
- var styles = root.getComputedStyle(element);
2703
- var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
2704
- var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
2705
- var result = {
2706
- width: element.offsetWidth + y,
2707
- height: element.offsetHeight + x
2708
- };
2709
-
2710
- // reset element styles
2711
- element.style.display = _display;
2712
- element.style.visibility = _visibility;
2713
- return result;
2714
- }
2715
-
2716
- /**
2717
- * Get the opposite placement of the given one/
2718
- * @function
2719
- * @ignore
2720
- * @argument {String} placement
2721
- * @returns {String} flipped placement
2722
- */
2723
- function getOppositePlacement(placement) {
2724
- var hash = {
2725
- left: 'right',
2726
- right: 'left',
2727
- bottom: 'top',
2728
- top: 'bottom'
2729
- };
2730
- return placement.replace(/left|right|bottom|top/g, function (matched) {
2731
- return hash[matched];
2732
- });
2733
- }
2734
-
2735
- /**
2736
- * Given the popper offsets, generate an output similar to getBoundingClientRect
2737
- * @function
2738
- * @ignore
2739
- * @argument {Object} popperOffsets
2740
- * @returns {Object} ClientRect like output
2741
- */
2742
- function getPopperClientRect(popperOffsets) {
2743
- var offsets = Object.assign({}, popperOffsets);
2744
- offsets.right = offsets.left + offsets.width;
2745
- offsets.bottom = offsets.top + offsets.height;
2746
- return offsets;
2747
- }
2748
-
2749
- /**
2750
- * Given an array and the key to find, returns its index
2751
- * @function
2752
- * @ignore
2753
- * @argument {Array} arr
2754
- * @argument keyToFind
2755
- * @returns index or null
2756
- */
2757
- function getArrayKeyIndex(arr, keyToFind) {
2758
- var i = 0,
2759
- key;
2760
- for (key in arr) {
2761
- if (arr[key] === keyToFind) {
2762
- return i;
2763
- }
2764
- i++;
2765
- }
2766
- return null;
2767
- }
2768
-
2769
- /**
2770
- * Get CSS computed property of the given element
2771
- * @function
2772
- * @ignore
2773
- * @argument {Eement} element
2774
- * @argument {String} property
2775
- */
2776
- function getStyleComputedProperty(element, property) {
2777
- // NOTE: 1 DOM access here
2778
- var css = root.getComputedStyle(element, null);
2779
- return css[property];
2780
- }
2781
-
2782
- /**
2783
- * Returns the offset parent of the given element
2784
- * @function
2785
- * @ignore
2786
- * @argument {Element} element
2787
- * @returns {Element} offset parent
2788
- */
2789
- function getOffsetParent(element) {
2790
- // NOTE: 1 DOM access here
2791
- var offsetParent = element.offsetParent;
2792
- return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
2793
- }
2794
-
2795
- /**
2796
- * Returns the scrolling parent of the given element
2797
- * @function
2798
- * @ignore
2799
- * @argument {Element} element
2800
- * @returns {Element} offset parent
2801
- */
2802
- function getScrollParent(element) {
2803
- var parent = element.parentNode;
2804
- if (!parent) {
2805
- return element;
2806
- }
2807
- if (parent === root.document) {
2808
- // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
2809
- // greater than 0 and return the proper element
2810
- if (root.document.body.scrollTop || root.document.body.scrollLeft) {
2811
- return root.document.body;
2812
- } else {
2813
- return root.document.documentElement;
2814
- }
2815
- }
2816
-
2817
- // Firefox want us to check `-x` and `-y` variations as well
2818
- if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
2819
- // If the detected scrollParent is body, we perform an additional check on its parentNode
2820
- // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
2821
- // fixes issue #65
2822
- return parent;
2823
- }
2824
- return getScrollParent(element.parentNode);
2825
- }
2826
-
2827
- /**
2828
- * Check if the given element is fixed or is inside a fixed parent
2829
- * @function
2830
- * @ignore
2831
- * @argument {Element} element
2832
- * @argument {Element} customContainer
2833
- * @returns {Boolean} answer to "isFixed?"
2834
- */
2835
- function isFixed(element) {
2836
- if (element === root.document.body) {
2837
- return false;
2838
- }
2839
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
2840
- return true;
2841
- }
2842
- return element.parentNode ? isFixed(element.parentNode) : element;
2843
- }
2844
-
2845
- /**
2846
- * Set the style to the given popper
2847
- * @function
2848
- * @ignore
2849
- * @argument {Element} element - Element to apply the style to
2850
- * @argument {Object} styles - Object with a list of properties and values which will be applied to the element
2851
- */
2852
- function setStyle(element, styles) {
2853
- function is_numeric(n) {
2854
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
2855
- }
2856
- Object.keys(styles).forEach(function (prop) {
2857
- var unit = '';
2858
- // add unit if the value is numeric and is one of the following
2859
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
2860
- unit = 'px';
2861
- }
2862
- element.style[prop] = styles[prop] + unit;
2863
- });
2864
- }
2865
-
2866
- /**
2867
- * Check if the given variable is a function
2868
- * @function
2869
- * @ignore
2870
- * @argument {*} functionToCheck - variable to check
2871
- * @returns {Boolean} answer to: is a function?
2872
- */
2873
- function isFunction(functionToCheck) {
2874
- var getType = {};
2875
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2876
- }
2877
-
2878
- /**
2879
- * Get the position of the given element, relative to its offset parent
2880
- * @function
2881
- * @ignore
2882
- * @param {Element} element
2883
- * @return {Object} position - Coordinates of the element and its `scrollTop`
2884
- */
2885
- function getOffsetRect(element) {
2886
- var elementRect = {
2887
- width: element.offsetWidth,
2888
- height: element.offsetHeight,
2889
- left: element.offsetLeft,
2890
- top: element.offsetTop
2891
- };
2892
- elementRect.right = elementRect.left + elementRect.width;
2893
- elementRect.bottom = elementRect.top + elementRect.height;
2894
-
2895
- // position
2896
- return elementRect;
2897
- }
2898
-
2899
- /**
2900
- * Get bounding client rect of given element
2901
- * @function
2902
- * @ignore
2903
- * @param {HTMLElement} element
2904
- * @return {Object} client rect
2905
- */
2906
- function getBoundingClientRect(element) {
2907
- var rect = element.getBoundingClientRect();
2908
-
2909
- // whether the IE version is lower than 11
2910
- var isIE = navigator.userAgent.indexOf("MSIE") != -1;
2911
-
2912
- // fix ie document bounding top always 0 bug
2913
- var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
2914
- return {
2915
- left: rect.left,
2916
- top: rectTop,
2917
- right: rect.right,
2918
- bottom: rect.bottom,
2919
- width: rect.right - rect.left,
2920
- height: rect.bottom - rectTop
2921
- };
2922
- }
2923
-
2924
- /**
2925
- * Given an element and one of its parents, return the offset
2926
- * @function
2927
- * @ignore
2928
- * @param {HTMLElement} element
2929
- * @param {HTMLElement} parent
2930
- * @return {Object} rect
2931
- */
2932
- function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
2933
- var elementRect = getBoundingClientRect(element);
2934
- var parentRect = getBoundingClientRect(parent);
2935
- if (fixed) {
2936
- var scrollParent = getScrollParent(parent);
2937
- parentRect.top += scrollParent.scrollTop;
2938
- parentRect.bottom += scrollParent.scrollTop;
2939
- parentRect.left += scrollParent.scrollLeft;
2940
- parentRect.right += scrollParent.scrollLeft;
2941
- }
2942
- var rect = {
2943
- top: elementRect.top - parentRect.top,
2944
- left: elementRect.left - parentRect.left,
2945
- bottom: elementRect.top - parentRect.top + elementRect.height,
2946
- right: elementRect.left - parentRect.left + elementRect.width,
2947
- width: elementRect.width,
2948
- height: elementRect.height
2949
- };
2950
- return rect;
2951
- }
2952
-
2953
- /**
2954
- * Get the prefixed supported property name
2955
- * @function
2956
- * @ignore
2957
- * @argument {String} property (camelCase)
2958
- * @returns {String} prefixed property (camelCase)
2959
- */
2960
- function getSupportedPropertyName(property) {
2961
- var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
2962
- for (var i = 0; i < prefixes.length; i++) {
2963
- var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
2964
- if (typeof root.document.body.style[toCheck] !== 'undefined') {
2965
- return toCheck;
2966
- }
2967
- }
2968
- return null;
2969
- }
2970
-
2971
- /**
2972
- * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
2973
- * objects to a target object. It will return the target object.
2974
- * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
2975
- * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
2976
- * @function
2977
- * @ignore
2978
- */
2979
- if (!Object.assign) {
2980
- Object.defineProperty(Object, 'assign', {
2981
- enumerable: false,
2982
- configurable: true,
2983
- writable: true,
2984
- value: function value(target) {
2985
- if (target === undefined || target === null) {
2986
- throw new TypeError('Cannot convert first argument to object');
2987
- }
2988
- var to = Object(target);
2989
- for (var i = 1; i < arguments.length; i++) {
2990
- var nextSource = arguments[i];
2991
- if (nextSource === undefined || nextSource === null) {
2992
- continue;
2993
- }
2994
- nextSource = Object(nextSource);
2995
- var keysArray = Object.keys(nextSource);
2996
- for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
2997
- var nextKey = keysArray[nextIndex];
2998
- var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
2999
- if (desc !== undefined && desc.enumerable) {
3000
- to[nextKey] = nextSource[nextKey];
3001
- }
3002
- }
3003
- }
3004
- return to;
3005
- }
3006
- });
3007
- }
3008
- return Popper;
3009
- });
3010
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(72)(module)))
3011
-
3012
- /***/ }),
3013
-
3014
- /***/ 72:
3015
- /***/ (function(module, exports) {
3016
-
3017
- module.exports = function(originalModule) {
3018
- if (!originalModule.webpackPolyfill) {
3019
- var module = Object.create(originalModule);
3020
- // module.parent = undefined by default
3021
- if (!module.children) module.children = [];
3022
- Object.defineProperty(module, "loaded", {
3023
- enumerable: true,
3024
- get: function() {
3025
- return module.l;
643
+ /* harmony default export */ __webpack_exports__["a"] = ({
644
+ inject: ['rootMenu'],
645
+ computed: {
646
+ indexPath: function indexPath() {
647
+ var path = [this.index];
648
+ var parent = this.$parent;
649
+ while (parent.$options.componentName !== 'ElMenu') {
650
+ if (parent.index) {
651
+ path.unshift(parent.index);
652
+ }
653
+ parent = parent.$parent;
3026
654
  }
3027
- });
3028
- Object.defineProperty(module, "id", {
3029
- enumerable: true,
3030
- get: function() {
3031
- return module.i;
655
+ return path;
656
+ },
657
+ parentMenu: function parentMenu() {
658
+ var parent = this.$parent;
659
+ while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
660
+ parent = parent.$parent;
3032
661
  }
3033
- });
3034
- Object.defineProperty(module, "exports", {
3035
- enumerable: true
3036
- });
3037
- module.webpackPolyfill = 1;
662
+ return parent;
663
+ },
664
+ paddingStyle: function paddingStyle() {
665
+ if (this.rootMenu.mode !== 'vertical') return {};
666
+
667
+ var padding = 20;
668
+ var parent = this.$parent;
669
+
670
+ if (this.rootMenu.collapse) {
671
+ padding = 20;
672
+ } else {
673
+ while (parent && parent.$options.componentName !== 'ElMenu') {
674
+ if (parent.$options.componentName === 'ElSubmenu') {
675
+ padding += 20;
676
+ }
677
+ parent = parent.$parent;
678
+ }
679
+ }
680
+ return { paddingLeft: padding + 'px' };
681
+ }
3038
682
  }
3039
- return module;
3040
- };
3041
-
683
+ });
3042
684
 
3043
685
  /***/ }),
3044
686
 
3045
- /***/ 73:
687
+ /***/ 4:
3046
688
  /***/ (function(module, exports) {
3047
689
 
3048
- module.exports = require("core-js/modules/es.object.get-own-property-descriptor.js");
690
+ module.exports = require("element-ui/lib/mixins/emitter");
3049
691
 
3050
692
  /***/ }),
3051
693
 
3052
- /***/ 74:
694
+ /***/ 5:
3053
695
  /***/ (function(module, exports) {
3054
696
 
3055
- /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
3056
- module.exports = __webpack_amd_options__;
3057
-
3058
- /* WEBPACK VAR INJECTION */}.call(this, {}))
3059
-
3060
- /***/ }),
3061
-
3062
- /***/ 99:
3063
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3064
-
3065
- "use strict";
3066
- /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
3067
-
3068
- var Transition = /*#__PURE__*/function () {
3069
- function Transition() {}
3070
- var _proto = Transition.prototype;
3071
- _proto.beforeEnter = function beforeEnter(el) {
3072
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
3073
- if (!el.dataset) el.dataset = {};
3074
- el.dataset.oldPaddingTop = el.style.paddingTop;
3075
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
3076
- el.style.height = '0';
3077
- el.style.paddingTop = 0;
3078
- el.style.paddingBottom = 0;
3079
- };
3080
- _proto.enter = function enter(el) {
3081
- el.dataset.oldOverflow = el.style.overflow;
3082
- if (el.scrollHeight !== 0) {
3083
- el.style.height = el.scrollHeight + 'px';
3084
- el.style.paddingTop = el.dataset.oldPaddingTop;
3085
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
3086
- } else {
3087
- el.style.height = '';
3088
- el.style.paddingTop = el.dataset.oldPaddingTop;
3089
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
3090
- }
3091
- el.style.overflow = 'hidden';
3092
- };
3093
- _proto.afterEnter = function afterEnter(el) {
3094
- // for safari: remove class then reset height is necessary
3095
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
3096
- el.style.height = '';
3097
- el.style.overflow = el.dataset.oldOverflow;
3098
- };
3099
- _proto.beforeLeave = function beforeLeave(el) {
3100
- if (!el.dataset) el.dataset = {};
3101
- el.dataset.oldPaddingTop = el.style.paddingTop;
3102
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
3103
- el.dataset.oldOverflow = el.style.overflow;
3104
- el.style.height = el.scrollHeight + 'px';
3105
- el.style.overflow = 'hidden';
3106
- };
3107
- _proto.leave = function leave(el) {
3108
- if (el.scrollHeight !== 0) {
3109
- // for safari: add class after set height, or it will jump to zero height suddenly, weired
3110
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ "a"])(el, 'collapse-transition');
3111
- el.style.height = 0;
3112
- el.style.paddingTop = 0;
3113
- el.style.paddingBottom = 0;
3114
- }
3115
- };
3116
- _proto.afterLeave = function afterLeave(el) {
3117
- Object(_utils_dom__WEBPACK_IMPORTED_MODULE_0__[/* removeClass */ "i"])(el, 'collapse-transition');
3118
- el.style.height = '';
3119
- el.style.overflow = el.dataset.oldOverflow;
3120
- el.style.paddingTop = el.dataset.oldPaddingTop;
3121
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
3122
- };
3123
- return Transition;
3124
- }();
3125
- /* harmony default export */ __webpack_exports__["a"] = ({
3126
- name: 'ElCollapseTransition',
3127
- functional: true,
3128
- render: function render(h, _ref) {
3129
- var children = _ref.children;
3130
- var data = {
3131
- on: new Transition()
3132
- };
3133
- return h('transition', data, children);
3134
- }
3135
- });
697
+ module.exports = require("element-ui/lib/utils/vue-popper");
3136
698
 
3137
699
  /***/ })
3138
700