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.
- package/CHANGELOG.md +280 -280
- package/LICENSE +21 -21
- package/README.md +162 -171
- package/lib/alert.js +203 -211
- package/lib/aside.js +80 -80
- package/lib/autocomplete.js +465 -4583
- package/lib/avatar.js +126 -152
- package/lib/backtop.js +198 -190
- package/lib/badge.js +134 -128
- package/lib/breadcrumb-item.js +122 -146
- package/lib/breadcrumb.js +96 -97
- package/lib/button-group.js +65 -68
- package/lib/button.js +87 -67
- package/lib/calendar.js +605 -2416
- package/lib/card.js +100 -101
- package/lib/carousel-item.js +210 -854
- package/lib/carousel.js +411 -578
- package/lib/cascader-panel.js +1153 -3542
- package/lib/cascader.js +893 -7284
- package/lib/checkbox-button.js +290 -337
- package/lib/checkbox-group.js +105 -176
- package/lib/checkbox.js +220 -240
- package/lib/col.js +68 -113
- package/lib/collapse-item.js +162 -1250
- package/lib/collapse.js +123 -163
- package/lib/color-picker.js +1242 -5200
- package/lib/container.js +88 -98
- package/lib/date-picker.js +4023 -8450
- package/lib/descriptions-item.js +32 -53
- package/lib/descriptions.js +334 -697
- package/lib/dialog.js +247 -1721
- package/lib/directives/mousewheel.js +20 -14
- package/lib/directives/repeat-click.js +30 -27
- package/lib/divider.js +116 -109
- package/lib/drawer.js +316 -1110
- package/lib/dropdown-item.js +111 -159
- package/lib/dropdown-menu.js +117 -2445
- package/lib/dropdown.js +392 -1795
- package/lib/element-ui.common.js +41037 -46119
- package/lib/empty.js +203 -1070
- package/lib/footer.js +80 -80
- package/lib/form-item.js +467 -1222
- package/lib/form.js +258 -326
- package/lib/header.js +80 -80
- package/lib/icon.js +68 -71
- package/lib/image.js +743 -2375
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +150 -814
- package/lib/input-number.js +444 -2177
- package/lib/input.js +517 -1197
- package/lib/link.js +135 -117
- package/lib/loading.js +372 -1139
- package/lib/locale/format.js +53 -42
- package/lib/locale/index.js +52 -38
- package/lib/locale/lang/af-ZA.js +123 -130
- package/lib/locale/lang/ar.js +122 -123
- package/lib/locale/lang/az.js +121 -122
- package/lib/locale/lang/bg.js +123 -133
- package/lib/locale/lang/bn.js +121 -121
- package/lib/locale/lang/ca.js +122 -123
- package/lib/locale/lang/cs-CZ.js +125 -127
- package/lib/locale/lang/da.js +122 -124
- package/lib/locale/lang/de.js +124 -126
- package/lib/locale/lang/ee.js +123 -125
- package/lib/locale/lang/el.js +123 -125
- package/lib/locale/lang/en.js +123 -127
- package/lib/locale/lang/eo.js +123 -125
- package/lib/locale/lang/es.js +122 -123
- package/lib/locale/lang/eu.js +123 -128
- package/lib/locale/lang/fa.js +123 -125
- package/lib/locale/lang/fi.js +123 -125
- package/lib/locale/lang/fr.js +122 -125
- package/lib/locale/lang/he.js +123 -130
- package/lib/locale/lang/hr.js +123 -128
- package/lib/locale/lang/hu.js +122 -124
- package/lib/locale/lang/hy-AM.js +123 -125
- package/lib/locale/lang/id.js +123 -124
- package/lib/locale/lang/is.js +123 -124
- package/lib/locale/lang/it.js +122 -123
- package/lib/locale/lang/ja.js +123 -125
- package/lib/locale/lang/kg.js +123 -125
- package/lib/locale/lang/km.js +123 -124
- package/lib/locale/lang/ko.js +123 -125
- package/lib/locale/lang/ku.js +123 -125
- package/lib/locale/lang/kz.js +123 -125
- package/lib/locale/lang/lo-LA.js +121 -121
- package/lib/locale/lang/lt.js +123 -125
- package/lib/locale/lang/lv.js +123 -125
- package/lib/locale/lang/mn.js +123 -125
- package/lib/locale/lang/ms.js +122 -123
- package/lib/locale/lang/nb-NO.js +122 -123
- package/lib/locale/lang/nl.js +123 -125
- package/lib/locale/lang/pl.js +123 -125
- package/lib/locale/lang/pt-br.js +123 -124
- package/lib/locale/lang/pt.js +123 -133
- package/lib/locale/lang/ro.js +123 -125
- package/lib/locale/lang/ru-RU.js +123 -124
- package/lib/locale/lang/si.js +123 -127
- package/lib/locale/lang/sk.js +125 -126
- package/lib/locale/lang/sl.js +123 -125
- package/lib/locale/lang/sr-Latn.js +123 -124
- package/lib/locale/lang/sr.js +123 -128
- package/lib/locale/lang/sv-SE.js +123 -128
- package/lib/locale/lang/sw.js +123 -127
- package/lib/locale/lang/ta.js +122 -130
- package/lib/locale/lang/th.js +123 -127
- package/lib/locale/lang/tk.js +123 -129
- package/lib/locale/lang/tr-TR.js +123 -125
- package/lib/locale/lang/ua.js +123 -124
- package/lib/locale/lang/ug-CN.js +123 -124
- package/lib/locale/lang/uz-UZ.js +123 -124
- package/lib/locale/lang/vi.js +123 -124
- package/lib/locale/lang/zh-CN.js +123 -124
- package/lib/locale/lang/zh-TW.js +123 -128
- package/lib/main.js +67 -69
- package/lib/menu-item-group.js +111 -105
- package/lib/menu-item.js +259 -3549
- package/lib/menu.js +559 -1697
- package/lib/message-box.js +693 -3422
- package/lib/message.js +229 -1663
- package/lib/mixins/emitter.js +30 -28
- package/lib/mixins/focus.js +11 -10
- package/lib/mixins/locale.js +14 -12
- package/lib/mixins/migrating.js +65 -58
- package/lib/notification.js +269 -1693
- package/lib/option-group.js +139 -190
- package/lib/option.js +192 -941
- package/lib/page-header.js +92 -1014
- package/lib/pagination.js +677 -6969
- package/lib/popconfirm.js +223 -3936
- package/lib/popover.js +368 -3242
- package/lib/progress.js +244 -254
- package/lib/radio-button.js +226 -259
- package/lib/radio-group.js +186 -249
- package/lib/radio.js +253 -263
- package/lib/rate.js +416 -1395
- package/lib/result.js +233 -189
- package/lib/row.js +41 -58
- package/lib/scrollbar.js +278 -1331
- package/lib/select.js +1347 -5731
- package/lib/skeleton-item.js +145 -133
- package/lib/skeleton.js +172 -163
- package/lib/slider.js +702 -5143
- package/lib/spinner.js +101 -113
- package/lib/{subTitle.js → statistic.js} +335 -94
- package/lib/step.js +311 -274
- package/lib/steps.js +117 -854
- package/lib/submenu.js +448 -2886
- package/lib/switch.js +204 -1036
- package/lib/tab-pane.js +135 -125
- package/lib/table-column.js +751 -1975
- package/lib/table.js +3930 -7956
- package/lib/tabs.js +605 -1441
- package/lib/tag.js +68 -73
- package/lib/theme-chalk/README.md +33 -33
- package/lib/theme-chalk/package.json +35 -35
- package/lib/theme-chalk/src/alert.scss +147 -147
- package/lib/theme-chalk/src/aside.scss +7 -7
- package/lib/theme-chalk/src/autocomplete.scss +80 -80
- package/lib/theme-chalk/src/avatar.scss +51 -51
- package/lib/theme-chalk/src/backtop.scss +22 -22
- package/lib/theme-chalk/src/badge.scss +57 -57
- package/lib/theme-chalk/src/base.scss +2 -2
- package/lib/theme-chalk/src/breadcrumb.scss +55 -55
- package/lib/theme-chalk/src/button.scss +262 -262
- package/lib/theme-chalk/src/calendar.scss +79 -79
- package/lib/theme-chalk/src/card.scss +32 -32
- package/lib/theme-chalk/src/carousel-item.scss +50 -50
- package/lib/theme-chalk/src/carousel.scss +161 -161
- package/lib/theme-chalk/src/cascader-panel.scss +120 -120
- package/lib/theme-chalk/src/cascader.scss +182 -182
- package/lib/theme-chalk/src/checkbox.scss +359 -359
- package/lib/theme-chalk/src/col.scss +156 -156
- package/lib/theme-chalk/src/collapse.scss +63 -63
- package/lib/theme-chalk/src/color-picker.scss +384 -384
- package/lib/theme-chalk/src/common/popup.scss +42 -42
- package/lib/theme-chalk/src/common/transition.scss +99 -99
- package/lib/theme-chalk/src/common/var.scss +1028 -1028
- package/lib/theme-chalk/src/container.scss +14 -14
- package/lib/theme-chalk/src/date-picker/date-picker.scss +97 -97
- package/lib/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
- package/lib/theme-chalk/src/date-picker/date-table.scss +151 -151
- package/lib/theme-chalk/src/date-picker/month-table.scss +82 -82
- package/lib/theme-chalk/src/date-picker/picker-panel.scss +117 -117
- package/lib/theme-chalk/src/date-picker/picker.scss +197 -197
- package/lib/theme-chalk/src/date-picker/time-picker.scss +85 -85
- package/lib/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
- package/lib/theme-chalk/src/date-picker/time-spinner.scss +110 -110
- package/lib/theme-chalk/src/date-picker/year-table.scss +51 -51
- package/lib/theme-chalk/src/date-picker.scss +11 -11
- package/lib/theme-chalk/src/descriptions-item.scss +42 -42
- package/lib/theme-chalk/src/descriptions.scss +111 -111
- package/lib/theme-chalk/src/dialog.scss +123 -123
- package/lib/theme-chalk/src/display.scss +12 -12
- package/lib/theme-chalk/src/divider.scss +47 -47
- package/lib/theme-chalk/src/drawer.scss +219 -219
- package/lib/theme-chalk/src/dropdown.scss +182 -182
- package/lib/theme-chalk/src/empty.scss +45 -45
- package/lib/theme-chalk/src/footer.scss +8 -8
- package/lib/theme-chalk/src/form.scss +167 -167
- package/lib/theme-chalk/src/header.scss +8 -8
- package/lib/theme-chalk/src/icon.scss +1167 -1167
- package/lib/theme-chalk/src/image.scss +179 -179
- package/lib/theme-chalk/src/index.scss +90 -89
- package/lib/theme-chalk/src/input-number.scss +180 -180
- package/lib/theme-chalk/src/input.scss +360 -360
- package/lib/theme-chalk/src/link.scss +81 -81
- package/lib/theme-chalk/src/loading.scss +96 -96
- package/lib/theme-chalk/src/main.scss +12 -12
- package/lib/theme-chalk/src/menu.scss +289 -289
- package/lib/theme-chalk/src/message-box.scss +226 -226
- package/lib/theme-chalk/src/message.scss +120 -120
- package/lib/theme-chalk/src/mixins/_button.scss +81 -81
- package/lib/theme-chalk/src/mixins/config.scss +4 -4
- package/lib/theme-chalk/src/mixins/function.scss +44 -44
- package/lib/theme-chalk/src/mixins/mixins.scss +190 -190
- package/lib/theme-chalk/src/mixins/utils.scss +39 -39
- package/lib/theme-chalk/src/notification.scss +99 -99
- package/lib/theme-chalk/src/option-group.scss +42 -42
- package/lib/theme-chalk/src/option.scss +36 -36
- package/lib/theme-chalk/src/page-header.scss +41 -41
- package/lib/theme-chalk/src/pagination.scss +295 -295
- package/lib/theme-chalk/src/popconfirm.scss +16 -16
- package/lib/theme-chalk/src/popover.scss +40 -40
- package/lib/theme-chalk/src/popper.scss +101 -101
- package/lib/theme-chalk/src/progress.scss +141 -141
- package/lib/theme-chalk/src/radio-button.scss +113 -113
- package/lib/theme-chalk/src/radio-group.scss +9 -9
- package/lib/theme-chalk/src/radio.scss +199 -199
- package/lib/theme-chalk/src/rate.scss +49 -49
- package/lib/theme-chalk/src/reset.scss +79 -79
- package/lib/theme-chalk/src/result.scss +61 -61
- package/lib/theme-chalk/src/row.scss +43 -43
- package/lib/theme-chalk/src/scrollbar.scss +72 -72
- package/lib/theme-chalk/src/select-dropdown.scss +62 -62
- package/lib/theme-chalk/src/select.scss +152 -152
- package/lib/theme-chalk/src/skeleton-item.scss +84 -84
- package/lib/theme-chalk/src/skeleton.scss +40 -40
- package/lib/theme-chalk/src/slider.scss +250 -250
- package/lib/theme-chalk/src/spinner.scss +44 -44
- package/lib/theme-chalk/src/statistic.scss +38 -0
- package/lib/theme-chalk/src/step.scss +317 -317
- package/lib/theme-chalk/src/steps.scss +20 -20
- package/lib/theme-chalk/src/switch.scss +116 -116
- package/lib/theme-chalk/src/table-column.scss +97 -97
- package/lib/theme-chalk/src/table.scss +564 -564
- package/lib/theme-chalk/src/tabs.scss +602 -602
- package/lib/theme-chalk/src/tag.scss +163 -163
- package/lib/theme-chalk/src/time-picker.scss +8 -8
- package/lib/theme-chalk/src/time-select.scss +37 -37
- package/lib/theme-chalk/src/timeline-item.scss +86 -86
- package/lib/theme-chalk/src/timeline.scss +14 -14
- package/lib/theme-chalk/src/tooltip.scss +141 -141
- package/lib/theme-chalk/src/transfer.scss +227 -227
- package/lib/theme-chalk/src/tree.scss +123 -123
- package/lib/theme-chalk/src/upload.scss +603 -603
- package/lib/time-picker.js +1837 -6690
- package/lib/time-select.js +1240 -6327
- package/lib/timeline-item.js +174 -133
- package/lib/timeline.js +39 -43
- package/lib/tooltip.js +287 -3184
- package/lib/transfer.js +625 -2929
- package/lib/transitions/collapse-transition.js +87 -69
- package/lib/tree.js +1741 -3248
- package/lib/treeselect.js +682 -0
- package/lib/umd/locale/af-ZA.js +138 -145
- package/lib/umd/locale/ar.js +137 -138
- package/lib/umd/locale/az.js +137 -139
- package/lib/umd/locale/bg.js +138 -148
- package/lib/umd/locale/bn.js +137 -138
- package/lib/umd/locale/ca.js +137 -138
- package/lib/umd/locale/cs-CZ.js +140 -142
- package/lib/umd/locale/da.js +137 -139
- package/lib/umd/locale/de.js +139 -141
- package/lib/umd/locale/ee.js +138 -140
- package/lib/umd/locale/el.js +138 -140
- package/lib/umd/locale/en.js +138 -142
- package/lib/umd/locale/eo.js +138 -140
- package/lib/umd/locale/es.js +137 -138
- package/lib/umd/locale/eu.js +138 -143
- package/lib/umd/locale/fa.js +138 -140
- package/lib/umd/locale/fi.js +138 -140
- package/lib/umd/locale/fr.js +137 -140
- package/lib/umd/locale/he.js +138 -145
- package/lib/umd/locale/hr.js +138 -143
- package/lib/umd/locale/hu.js +137 -139
- package/lib/umd/locale/hy-AM.js +138 -140
- package/lib/umd/locale/id.js +138 -139
- package/lib/umd/locale/is.js +138 -139
- package/lib/umd/locale/it.js +137 -138
- package/lib/umd/locale/ja.js +138 -140
- package/lib/umd/locale/kg.js +138 -140
- package/lib/umd/locale/km.js +138 -139
- package/lib/umd/locale/ko.js +138 -140
- package/lib/umd/locale/ku.js +138 -140
- package/lib/umd/locale/kz.js +138 -140
- package/lib/umd/locale/lo-LA.js +137 -138
- package/lib/umd/locale/lt.js +138 -140
- package/lib/umd/locale/lv.js +138 -140
- package/lib/umd/locale/mn.js +138 -140
- package/lib/umd/locale/ms.js +137 -138
- package/lib/umd/locale/nb-NO.js +137 -138
- package/lib/umd/locale/nl.js +138 -140
- package/lib/umd/locale/pl.js +138 -140
- package/lib/umd/locale/pt-br.js +138 -139
- package/lib/umd/locale/pt.js +138 -148
- package/lib/umd/locale/ro.js +138 -140
- package/lib/umd/locale/ru-RU.js +138 -139
- package/lib/umd/locale/si.js +138 -142
- package/lib/umd/locale/sk.js +140 -141
- package/lib/umd/locale/sl.js +138 -140
- package/lib/umd/locale/sr-Latn.js +138 -139
- package/lib/umd/locale/sr.js +138 -143
- package/lib/umd/locale/sv-SE.js +138 -143
- package/lib/umd/locale/sw.js +138 -142
- package/lib/umd/locale/ta.js +137 -145
- package/lib/umd/locale/th.js +138 -142
- package/lib/umd/locale/tk.js +138 -144
- package/lib/umd/locale/tr-TR.js +138 -140
- package/lib/umd/locale/ua.js +138 -139
- package/lib/umd/locale/ug-CN.js +138 -139
- package/lib/umd/locale/uz-UZ.js +138 -139
- package/lib/umd/locale/vi.js +138 -139
- package/lib/umd/locale/zh-CN.js +138 -139
- package/lib/umd/locale/zh-TW.js +138 -143
- package/lib/upload.js +989 -2375
- package/lib/utils/after-leave.js +33 -36
- package/lib/utils/aria-dialog.js +89 -71
- package/lib/utils/aria-utils.js +101 -92
- package/lib/utils/clickoutside.js +67 -59
- package/lib/utils/date-util.js +241 -198
- package/lib/utils/date.js +369 -14
- package/lib/utils/dom.js +183 -167
- package/lib/utils/lodash.js +9421 -13
- package/lib/utils/menu/aria-menubar.js +18 -13
- package/lib/utils/menu/aria-menuitem.js +54 -43
- package/lib/utils/menu/aria-submenu.js +59 -50
- package/lib/utils/merge.js +17 -15
- package/lib/utils/popper.js +1196 -1167
- package/lib/utils/popup/index.js +230 -186
- package/lib/utils/popup/popup-manager.js +191 -159
- package/lib/utils/resize-event.js +44 -29
- package/lib/utils/scroll-into-view.js +33 -25
- package/lib/utils/scrollbar-width.js +36 -25
- package/lib/utils/shared.js +3 -3
- package/lib/utils/types.js +35 -22
- package/lib/utils/util.js +221 -187
- package/lib/utils/vdom.js +9 -5
- package/lib/utils/vue-popper.js +195 -173
- package/package.json +156 -160
- package/packages/alert/index.js +8 -8
- package/packages/alert/src/main.vue +94 -94
- package/packages/aside/index.js +8 -8
- package/packages/aside/src/main.vue +20 -20
- package/packages/autocomplete/index.js +8 -8
- package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -76
- package/packages/autocomplete/src/autocomplete.vue +285 -285
- package/packages/avatar/index.js +8 -8
- package/packages/avatar/src/main.vue +107 -107
- package/packages/backtop/index.js +8 -8
- package/packages/backtop/src/main.vue +110 -110
- package/packages/badge/index.js +8 -8
- package/packages/badge/src/main.vue +53 -53
- package/packages/breadcrumb/index.js +8 -8
- package/packages/breadcrumb/src/breadcrumb-item.vue +41 -41
- package/packages/breadcrumb/src/breadcrumb.vue +34 -34
- package/packages/breadcrumb-item/index.js +8 -8
- package/packages/button/index.js +8 -8
- package/packages/button/src/button-group.vue +10 -10
- package/packages/button/src/button.vue +78 -78
- package/packages/button-group/index.js +8 -8
- package/packages/calendar/index.js +8 -8
- package/packages/calendar/src/date-table.vue +200 -200
- package/packages/calendar/src/main.vue +280 -280
- package/packages/card/index.js +8 -8
- package/packages/card/src/main.vue +23 -23
- package/packages/carousel/index.js +8 -8
- package/packages/carousel/src/item.vue +138 -138
- package/packages/carousel/src/main.vue +315 -315
- package/packages/carousel-item/index.js +8 -8
- package/packages/cascader/index.js +8 -8
- package/packages/cascader/src/cascader.vue +663 -663
- package/packages/cascader-panel/index.js +8 -8
- package/packages/cascader-panel/src/cascader-menu.vue +138 -138
- package/packages/cascader-panel/src/cascader-node.vue +246 -246
- package/packages/cascader-panel/src/cascader-panel.vue +391 -391
- package/packages/cascader-panel/src/node.js +166 -165
- package/packages/cascader-panel/src/store.js +58 -57
- package/packages/checkbox/index.js +8 -8
- package/packages/checkbox/src/checkbox-button.vue +199 -199
- package/packages/checkbox/src/checkbox-group.vue +48 -48
- package/packages/checkbox/src/checkbox.vue +222 -222
- package/packages/checkbox-button/index.js +8 -8
- package/packages/checkbox-group/index.js +8 -8
- package/packages/col/index.js +9 -9
- package/packages/col/src/col.js +71 -71
- package/packages/collapse/index.js +9 -9
- package/packages/collapse/src/collapse-item.vue +114 -114
- package/packages/collapse/src/collapse.vue +73 -73
- package/packages/collapse-item/index.js +8 -8
- package/packages/color-picker/index.js +8 -8
- package/packages/color-picker/src/color.js +317 -317
- package/packages/color-picker/src/components/alpha-slider.vue +132 -132
- package/packages/color-picker/src/components/hue-slider.vue +123 -123
- package/packages/color-picker/src/components/picker-dropdown.vue +121 -121
- package/packages/color-picker/src/components/predefine.vue +61 -61
- package/packages/color-picker/src/components/sv-panel.vue +100 -100
- package/packages/color-picker/src/draggable.js +36 -36
- package/packages/color-picker/src/main.vue +188 -188
- package/packages/container/index.js +8 -8
- package/packages/container/src/main.vue +33 -33
- package/packages/date-picker/index.js +8 -8
- package/packages/date-picker/src/basic/date-table.vue +441 -441
- package/packages/date-picker/src/basic/month-table.vue +269 -268
- package/packages/date-picker/src/basic/time-spinner.vue +304 -304
- package/packages/date-picker/src/basic/year-table.vue +111 -111
- package/packages/date-picker/src/panel/date-range.vue +680 -680
- package/packages/date-picker/src/panel/date.vue +609 -609
- package/packages/date-picker/src/panel/month-range.vue +289 -289
- package/packages/date-picker/src/panel/time-range.vue +248 -248
- package/packages/date-picker/src/panel/time-select.vue +178 -178
- package/packages/date-picker/src/panel/time.vue +186 -186
- package/packages/date-picker/src/picker/date-picker.js +43 -43
- package/packages/date-picker/src/picker/time-picker.js +39 -39
- package/packages/date-picker/src/picker/time-select.js +21 -21
- package/packages/date-picker/src/picker.vue +956 -956
- package/packages/descriptions/index.js +8 -8
- package/packages/descriptions/src/descriptions-item.js +30 -30
- package/packages/descriptions/src/descriptions-row.js +116 -116
- package/packages/descriptions/src/index.js +180 -180
- package/packages/descriptions-item/index.js +8 -8
- package/packages/dialog/index.js +8 -8
- package/packages/dialog/src/component.vue +212 -212
- package/packages/divider/index.js +8 -8
- package/packages/divider/src/main.vue +37 -37
- package/packages/drawer/index.js +8 -8
- package/packages/drawer/src/main.vue +205 -205
- package/packages/dropdown/index.js +8 -8
- package/packages/dropdown/src/dropdown-item.vue +37 -37
- package/packages/dropdown/src/dropdown-menu.vue +63 -63
- package/packages/dropdown/src/dropdown.vue +293 -293
- package/packages/dropdown-item/index.js +8 -8
- package/packages/dropdown-menu/index.js +8 -8
- package/packages/empty/index.js +7 -7
- package/packages/empty/src/img-empty.vue +132 -132
- package/packages/empty/src/index.vue +50 -50
- package/packages/footer/index.js +8 -8
- package/packages/footer/src/main.vue +20 -20
- package/packages/form/index.js +8 -8
- package/packages/form/src/form-item.vue +324 -324
- package/packages/form/src/form.vue +182 -182
- package/packages/form/src/label-wrap.vue +78 -78
- package/packages/form-item/index.js +8 -8
- package/packages/header/index.js +8 -8
- package/packages/header/src/main.vue +20 -20
- package/packages/icon/index.js +8 -8
- package/packages/icon/src/icon.vue +13 -13
- package/packages/image/index.js +8 -8
- package/packages/image/src/image-viewer.vue +330 -330
- package/packages/image/src/main.vue +249 -249
- package/packages/infinite-scroll/index.js +8 -8
- package/packages/infinite-scroll/src/main.js +150 -149
- package/packages/input/index.js +8 -8
- package/packages/input/src/calcTextareaHeight.js +104 -104
- package/packages/input/src/input.vue +440 -440
- package/packages/input-number/index.js +8 -8
- package/packages/input-number/src/input-number.vue +283 -283
- package/packages/link/index.js +8 -8
- package/packages/link/src/main.vue +53 -53
- package/packages/loading/index.js +11 -11
- package/packages/loading/src/directive.js +133 -133
- package/packages/loading/src/index.js +106 -106
- package/packages/loading/src/loading.vue +41 -41
- package/packages/main/index.js +8 -8
- package/packages/main/src/main.vue +12 -12
- package/packages/menu/index.js +8 -8
- package/packages/menu/src/menu-item-group.vue +45 -45
- package/packages/menu/src/menu-item.vue +112 -112
- package/packages/menu/src/menu-mixin.js +44 -44
- package/packages/menu/src/menu.vue +325 -325
- package/packages/menu/src/submenu.vue +349 -348
- package/packages/menu-item/index.js +8 -8
- package/packages/menu-item-group/index.js +8 -8
- package/packages/message/index.js +2 -2
- package/packages/message/src/main.js +91 -91
- package/packages/message/src/main.vue +117 -117
- package/packages/message-box/index.js +2 -2
- package/packages/message-box/src/main.js +216 -216
- package/packages/message-box/src/main.vue +332 -332
- package/packages/notification/index.js +2 -2
- package/packages/notification/src/main.js +94 -94
- package/packages/notification/src/main.vue +152 -152
- package/packages/option/index.js +8 -8
- package/packages/option-group/index.js +8 -8
- package/packages/page-header/index.js +8 -8
- package/packages/page-header/src/main.vue +30 -30
- package/packages/pagination/index.js +8 -8
- package/packages/pagination/src/pager.vue +163 -163
- package/packages/pagination/src/pagination.js +386 -386
- package/packages/popconfirm/index.js +8 -8
- package/packages/popconfirm/src/main.vue +104 -104
- package/packages/popover/index.js +14 -14
- package/packages/popover/src/directive.js +20 -20
- package/packages/popover/src/main.vue +237 -237
- package/packages/progress/index.js +8 -8
- package/packages/progress/src/progress.vue +235 -235
- package/packages/radio/index.js +8 -8
- package/packages/radio/src/radio-button.vue +115 -115
- package/packages/radio/src/radio-group.vue +113 -113
- package/packages/radio/src/radio.vue +134 -134
- package/packages/radio-button/index.js +8 -8
- package/packages/radio-group/index.js +8 -8
- package/packages/rate/index.js +8 -8
- package/packages/rate/src/main.vue +348 -348
- package/packages/result/index.js +8 -8
- package/packages/result/src/icon-error.vue +13 -13
- package/packages/result/src/icon-info.vue +13 -13
- package/packages/result/src/icon-success.vue +13 -13
- package/packages/result/src/icon-warning.vue +13 -13
- package/packages/result/src/index.vue +65 -65
- package/packages/row/index.js +9 -9
- package/packages/row/src/row.js +44 -44
- package/packages/scrollbar/index.js +8 -8
- package/packages/scrollbar/src/bar.js +92 -92
- package/packages/scrollbar/src/main.js +130 -130
- package/packages/scrollbar/src/util.js +34 -34
- package/packages/select/index.js +8 -8
- package/packages/select/src/navigation-mixin.js +54 -54
- package/packages/select/src/option-group.vue +60 -60
- package/packages/select/src/option.vue +168 -168
- package/packages/select/src/select-dropdown.vue +74 -74
- package/packages/select/src/select.vue +900 -900
- package/packages/skeleton/index.js +8 -8
- package/packages/skeleton/src/img-placeholder.vue +16 -16
- package/packages/skeleton/src/index.vue +76 -76
- package/packages/skeleton/src/item.vue +22 -22
- package/packages/skeleton-item/index.js +8 -8
- package/packages/slider/index.js +8 -8
- package/packages/slider/src/button.vue +238 -238
- package/packages/slider/src/main.vue +427 -427
- package/packages/slider/src/marker.js +18 -18
- package/packages/spinner/index.js +8 -8
- package/packages/spinner/src/spinner.vue +27 -27
- package/packages/statistic/index.js +8 -0
- package/packages/statistic/src/main.vue +204 -0
- package/packages/step/index.js +8 -8
- package/packages/steps/README.md +69 -69
- package/packages/steps/index.js +8 -8
- package/packages/steps/src/step.vue +184 -184
- package/packages/steps/src/steps.vue +68 -68
- package/packages/submenu/index.js +8 -8
- package/packages/switch/index.js +9 -9
- package/packages/switch/src/component.vue +174 -174
- package/packages/tab-pane/index.js +8 -8
- package/packages/table/index.js +8 -8
- package/packages/table/src/config.js +124 -124
- package/packages/table/src/dropdown.js +28 -28
- package/packages/table/src/filter-panel.vue +194 -194
- package/packages/table/src/layout-observer.js +68 -68
- package/packages/table/src/store/current.js +76 -76
- package/packages/table/src/store/expand.js +65 -65
- package/packages/table/src/store/helper.js +41 -41
- package/packages/table/src/store/index.js +147 -147
- package/packages/table/src/store/tree.js +209 -209
- package/packages/table/src/store/watcher.js +381 -381
- package/packages/table/src/table-body.js +469 -469
- package/packages/table/src/table-column.js +319 -319
- package/packages/table/src/table-footer.js +153 -153
- package/packages/table/src/table-header.js +511 -511
- package/packages/table/src/table-layout.js +249 -249
- package/packages/table/src/table-row.js +101 -101
- package/packages/table/src/table.vue +712 -712
- package/packages/table/src/util.js +273 -273
- package/packages/table-column/index.js +8 -8
- package/packages/tabs/index.js +8 -8
- package/packages/tabs/src/tab-bar.vue +57 -57
- package/packages/tabs/src/tab-nav.vue +294 -294
- package/packages/tabs/src/tab-pane.vue +56 -56
- package/packages/tabs/src/tabs.vue +191 -191
- package/packages/tag/index.js +8 -8
- package/packages/tag/src/tag.vue +58 -58
- package/packages/theme-chalk/README.md +33 -33
- package/packages/theme-chalk/package.json +35 -35
- package/packages/theme-chalk/src/alert.scss +147 -147
- package/packages/theme-chalk/src/aside.scss +7 -7
- package/packages/theme-chalk/src/autocomplete.scss +80 -80
- package/packages/theme-chalk/src/avatar.scss +51 -51
- package/packages/theme-chalk/src/backtop.scss +22 -22
- package/packages/theme-chalk/src/badge.scss +57 -57
- package/packages/theme-chalk/src/base.scss +2 -2
- package/packages/theme-chalk/src/breadcrumb.scss +55 -55
- package/packages/theme-chalk/src/button.scss +262 -262
- package/packages/theme-chalk/src/calendar.scss +79 -79
- package/packages/theme-chalk/src/card.scss +32 -32
- package/packages/theme-chalk/src/carousel-item.scss +50 -50
- package/packages/theme-chalk/src/carousel.scss +161 -161
- package/packages/theme-chalk/src/cascader-panel.scss +120 -120
- package/packages/theme-chalk/src/cascader.scss +182 -182
- package/packages/theme-chalk/src/checkbox.scss +359 -359
- package/packages/theme-chalk/src/col.scss +156 -156
- package/packages/theme-chalk/src/collapse.scss +63 -63
- package/packages/theme-chalk/src/color-picker.scss +384 -384
- package/packages/theme-chalk/src/common/popup.scss +42 -42
- package/packages/theme-chalk/src/common/transition.scss +99 -99
- package/packages/theme-chalk/src/common/var.scss +1028 -1028
- package/packages/theme-chalk/src/container.scss +14 -14
- package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -97
- package/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
- package/packages/theme-chalk/src/date-picker/date-table.scss +151 -151
- package/packages/theme-chalk/src/date-picker/month-table.scss +82 -82
- package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -117
- package/packages/theme-chalk/src/date-picker/picker.scss +197 -197
- package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -85
- package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
- package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -110
- package/packages/theme-chalk/src/date-picker/year-table.scss +51 -51
- package/packages/theme-chalk/src/date-picker.scss +11 -11
- package/packages/theme-chalk/src/descriptions-item.scss +42 -42
- package/packages/theme-chalk/src/descriptions.scss +111 -111
- package/packages/theme-chalk/src/dialog.scss +123 -123
- package/packages/theme-chalk/src/display.scss +12 -12
- package/packages/theme-chalk/src/divider.scss +47 -47
- package/packages/theme-chalk/src/drawer.scss +219 -219
- package/packages/theme-chalk/src/dropdown.scss +182 -182
- package/packages/theme-chalk/src/empty.scss +45 -45
- package/packages/theme-chalk/src/footer.scss +8 -8
- package/packages/theme-chalk/src/form.scss +167 -167
- package/packages/theme-chalk/src/header.scss +8 -8
- package/packages/theme-chalk/src/icon.scss +1167 -1167
- package/packages/theme-chalk/src/image.scss +179 -179
- package/packages/theme-chalk/src/index.scss +90 -89
- package/packages/theme-chalk/src/input-number.scss +180 -180
- package/packages/theme-chalk/src/input.scss +360 -360
- package/packages/theme-chalk/src/link.scss +81 -81
- package/packages/theme-chalk/src/loading.scss +96 -96
- package/packages/theme-chalk/src/main.scss +12 -12
- package/packages/theme-chalk/src/menu.scss +289 -289
- package/packages/theme-chalk/src/message-box.scss +226 -226
- package/packages/theme-chalk/src/message.scss +120 -120
- package/packages/theme-chalk/src/mixins/_button.scss +81 -81
- package/packages/theme-chalk/src/mixins/config.scss +4 -4
- package/packages/theme-chalk/src/mixins/function.scss +44 -44
- package/packages/theme-chalk/src/mixins/mixins.scss +190 -190
- package/packages/theme-chalk/src/mixins/utils.scss +39 -39
- package/packages/theme-chalk/src/notification.scss +99 -99
- package/packages/theme-chalk/src/option-group.scss +42 -42
- package/packages/theme-chalk/src/option.scss +36 -36
- package/packages/theme-chalk/src/page-header.scss +41 -41
- package/packages/theme-chalk/src/pagination.scss +295 -295
- package/packages/theme-chalk/src/popconfirm.scss +16 -16
- package/packages/theme-chalk/src/popover.scss +40 -40
- package/packages/theme-chalk/src/popper.scss +101 -101
- package/packages/theme-chalk/src/progress.scss +141 -141
- package/packages/theme-chalk/src/radio-button.scss +113 -113
- package/packages/theme-chalk/src/radio-group.scss +9 -9
- package/packages/theme-chalk/src/radio.scss +199 -199
- package/packages/theme-chalk/src/rate.scss +49 -49
- package/packages/theme-chalk/src/reset.scss +79 -79
- package/packages/theme-chalk/src/result.scss +61 -61
- package/packages/theme-chalk/src/row.scss +43 -43
- package/packages/theme-chalk/src/scrollbar.scss +72 -72
- package/packages/theme-chalk/src/select-dropdown.scss +62 -62
- package/packages/theme-chalk/src/select.scss +152 -152
- package/packages/theme-chalk/src/skeleton-item.scss +84 -84
- package/packages/theme-chalk/src/skeleton.scss +40 -40
- package/packages/theme-chalk/src/slider.scss +250 -250
- package/packages/theme-chalk/src/spinner.scss +44 -44
- package/packages/theme-chalk/src/statistic.scss +38 -0
- package/packages/theme-chalk/src/step.scss +317 -317
- package/packages/theme-chalk/src/steps.scss +20 -20
- package/packages/theme-chalk/src/switch.scss +116 -116
- package/packages/theme-chalk/src/table-column.scss +97 -97
- package/packages/theme-chalk/src/table.scss +564 -564
- package/packages/theme-chalk/src/tabs.scss +602 -602
- package/packages/theme-chalk/src/tag.scss +163 -163
- package/packages/theme-chalk/src/time-picker.scss +8 -8
- package/packages/theme-chalk/src/time-select.scss +37 -37
- package/packages/theme-chalk/src/timeline-item.scss +86 -86
- package/packages/theme-chalk/src/timeline.scss +14 -14
- package/packages/theme-chalk/src/tooltip.scss +141 -141
- package/packages/theme-chalk/src/transfer.scss +227 -227
- package/packages/theme-chalk/src/tree.scss +123 -123
- package/packages/theme-chalk/src/upload.scss +603 -603
- package/packages/theme-cy/README.md +38 -38
- package/packages/theme-cy/lib/index.css +1 -1
- package/packages/theme-cy/lib/treeselect.css +1 -1
- package/packages/theme-cy/package.json +35 -35
- package/packages/theme-cy/src/index.scss +0 -4
- package/packages/theme-cy/src/treeselect.scss +87 -93
- package/packages/time-picker/index.js +8 -8
- package/packages/time-select/index.js +8 -8
- package/packages/timeline/index.js +8 -8
- package/packages/timeline/src/item.vue +73 -73
- package/packages/timeline/src/main.vue +33 -33
- package/packages/timeline-item/index.js +8 -8
- package/packages/tooltip/index.js +8 -8
- package/packages/tooltip/src/main.js +242 -242
- package/packages/transfer/index.js +8 -8
- package/packages/transfer/src/main.vue +231 -231
- package/packages/transfer/src/transfer-panel.vue +251 -251
- package/packages/tree/index.js +8 -8
- package/packages/tree/src/model/node.js +484 -484
- package/packages/tree/src/model/tree-store.js +340 -340
- package/packages/tree/src/model/util.js +27 -27
- package/packages/tree/src/tree-node.vue +279 -279
- package/packages/tree/src/tree.vue +496 -496
- package/packages/treeselect/index.js +8 -0
- package/packages/{treeSelect → treeselect}/src/main.vue +243 -243
- package/packages/upload/index.js +8 -8
- package/packages/upload/src/ajax.js +85 -85
- package/packages/upload/src/index.vue +338 -338
- package/packages/upload/src/upload-dragger.vue +70 -70
- package/packages/upload/src/upload-list.vue +105 -105
- package/packages/upload/src/upload.vue +211 -211
- package/src/directives/mousewheel.js +18 -18
- package/src/directives/repeat-click.js +26 -26
- package/src/index.js +8 -13
- package/src/locale/format.js +46 -45
- package/src/locale/index.js +48 -48
- package/src/locale/lang/af-ZA.js +123 -123
- package/src/locale/lang/ar.js +122 -122
- package/src/locale/lang/az.js +126 -126
- package/src/locale/lang/bg.js +123 -123
- package/src/locale/lang/bn.js +126 -126
- package/src/locale/lang/ca.js +122 -122
- package/src/locale/lang/cs-CZ.js +125 -125
- package/src/locale/lang/da.js +122 -122
- package/src/locale/lang/de.js +124 -124
- package/src/locale/lang/ee.js +123 -123
- package/src/locale/lang/el.js +123 -123
- package/src/locale/lang/en.js +123 -123
- package/src/locale/lang/eo.js +123 -123
- package/src/locale/lang/es.js +122 -122
- package/src/locale/lang/eu.js +123 -123
- package/src/locale/lang/fa.js +123 -123
- package/src/locale/lang/fi.js +123 -123
- package/src/locale/lang/fr.js +122 -122
- package/src/locale/lang/he.js +123 -123
- package/src/locale/lang/hr.js +123 -123
- package/src/locale/lang/hu.js +122 -122
- package/src/locale/lang/hy-AM.js +123 -123
- package/src/locale/lang/id.js +123 -123
- package/src/locale/lang/is.js +124 -124
- package/src/locale/lang/it.js +122 -122
- package/src/locale/lang/ja.js +123 -123
- package/src/locale/lang/kg.js +123 -123
- package/src/locale/lang/km.js +123 -123
- package/src/locale/lang/ko.js +123 -123
- package/src/locale/lang/ku.js +123 -123
- package/src/locale/lang/kz.js +123 -123
- package/src/locale/lang/lo-LA.js +126 -126
- package/src/locale/lang/lt.js +123 -123
- package/src/locale/lang/lv.js +123 -123
- package/src/locale/lang/mn.js +123 -123
- package/src/locale/lang/ms.js +122 -122
- package/src/locale/lang/nb-NO.js +122 -122
- package/src/locale/lang/nl.js +123 -123
- package/src/locale/lang/pl.js +123 -123
- package/src/locale/lang/pt-br.js +123 -123
- package/src/locale/lang/pt.js +123 -123
- package/src/locale/lang/ro.js +123 -123
- package/src/locale/lang/ru-RU.js +123 -123
- package/src/locale/lang/si.js +123 -123
- package/src/locale/lang/sk.js +125 -125
- package/src/locale/lang/sl.js +123 -123
- package/src/locale/lang/sr-Latn.js +123 -123
- package/src/locale/lang/sr.js +123 -123
- package/src/locale/lang/sv-SE.js +123 -123
- package/src/locale/lang/ta.js +122 -122
- package/src/locale/lang/th.js +123 -123
- package/src/locale/lang/tk.js +123 -123
- package/src/locale/lang/tr-TR.js +123 -123
- package/src/locale/lang/ua.js +123 -123
- package/src/locale/lang/ug-CN.js +123 -123
- package/src/locale/lang/uz-UZ.js +123 -123
- package/src/locale/lang/vi.js +123 -123
- package/src/locale/lang/zh-CN.js +123 -123
- package/src/locale/lang/zh-TW.js +123 -123
- package/src/mixins/emitter.js +33 -33
- package/src/mixins/focus.js +9 -9
- package/src/mixins/locale.js +9 -9
- package/src/mixins/migrating.js +54 -54
- package/src/transitions/collapse-transition.js +77 -77
- package/src/utils/after-leave.js +27 -27
- package/src/utils/aria-dialog.js +90 -90
- package/src/utils/aria-utils.js +122 -122
- package/src/utils/clickoutside.js +76 -76
- package/src/utils/date-util.js +282 -282
- package/src/utils/date.js +368 -2
- package/src/utils/dom.js +227 -227
- package/src/utils/lodash.js +18075 -9
- package/src/utils/menu/aria-menubar.js +14 -14
- package/src/utils/menu/aria-menuitem.js +49 -49
- package/src/utils/menu/aria-submenu.js +59 -59
- package/src/utils/merge.js +15 -15
- package/src/utils/popper.js +1276 -1276
- package/src/utils/popup/index.js +218 -218
- package/src/utils/popup/popup-manager.js +194 -194
- package/src/utils/resize-event.js +36 -36
- package/src/utils/scroll-into-view.js +27 -27
- package/src/utils/scrollbar-width.js +29 -29
- package/src/utils/shared.js +7 -7
- package/src/utils/types.js +40 -40
- package/src/utils/util.js +245 -245
- package/src/utils/vdom.js +5 -5
- package/src/utils/vue-popper.js +198 -198
- package/types/alert.d.ts +31 -31
- package/types/aside.d.ts +7 -7
- package/types/autocomplete.d.ts +78 -78
- package/types/avatar.d.ts +20 -20
- package/types/backtop.d.ts +16 -16
- package/types/badge.d.ts +16 -16
- package/types/breadcrumb-item.d.ts +10 -10
- package/types/breadcrumb.d.ts +10 -10
- package/types/button-group.d.ts +4 -4
- package/types/button.d.ts +37 -37
- package/types/calendar.d.ts +15 -15
- package/types/card.d.ts +26 -26
- package/types/carousel-item.d.ts +10 -10
- package/types/carousel.d.ts +57 -57
- package/types/cascader-panel.d.ts +72 -72
- package/types/cascader.d.ts +65 -65
- package/types/checkbox-button.d.ts +22 -22
- package/types/checkbox-group.d.ts +22 -22
- package/types/checkbox.d.ts +34 -34
- package/types/col.d.ts +46 -46
- package/types/collapse-item.d.ts +26 -26
- package/types/collapse.d.ts +10 -10
- package/types/color-picker.d.ts +21 -21
- package/types/component.d.ts +13 -13
- package/types/container.d.ts +7 -7
- package/types/date-picker.d.ts +124 -124
- package/types/descriptions-item.d.ts +37 -37
- package/types/descriptions.d.ts +52 -52
- package/types/dialog.d.ts +62 -62
- package/types/divider.d.ts +12 -12
- package/types/drawer.d.ts +63 -63
- package/types/dropdown-item.d.ts +16 -16
- package/types/dropdown-menu.d.ts +4 -4
- package/types/dropdown.d.ts +38 -38
- package/types/element-ui.d.ts +3 -16
- package/types/empty.d.ts +31 -31
- package/types/footer.d.ts +7 -7
- package/types/form-item.d.ts +37 -37
- package/types/form.d.ts +82 -82
- package/types/header.d.ts +7 -7
- package/types/icon.d.ts +7 -7
- package/types/image.d.ts +43 -43
- package/types/index.d.ts +4 -4
- package/types/infinite-scroll.d.ts +5 -5
- package/types/input-number.d.ts +47 -47
- package/types/input.d.ts +107 -107
- package/types/link.d.ts +25 -25
- package/types/loading.d.ts +62 -62
- package/types/main.d.ts +4 -4
- package/types/menu-item-group.d.ts +7 -7
- package/types/menu-item.d.ts +10 -10
- package/types/menu.d.ts +46 -46
- package/types/message-box.d.ts +176 -176
- package/types/message.d.ts +90 -90
- package/types/notification.d.ts +84 -84
- package/types/option-group.d.ts +10 -10
- package/types/option.d.ts +13 -13
- package/types/page-header.d.ts +10 -10
- package/types/pagination.d.ts +43 -43
- package/types/popconfirm.d.ts +29 -29
- package/types/popover.d.ts +71 -71
- package/types/progress.d.ts +37 -37
- package/types/radio-button.d.ts +16 -16
- package/types/radio-group.d.ts +18 -18
- package/types/radio.d.ts +19 -19
- package/types/rate.d.ts +64 -64
- package/types/result.d.ts +33 -33
- package/types/row.d.ts +25 -25
- package/types/select.d.ts +90 -90
- package/types/skeleton-item.d.ts +7 -7
- package/types/skeleton.d.ts +33 -33
- package/types/slider.d.ts +68 -68
- package/types/spinner.d.ts +16 -16
- package/types/statistic.d.ts +37 -0
- package/types/step.d.ts +34 -34
- package/types/steps.d.ts +28 -28
- package/types/submenu.d.ts +22 -22
- package/types/switch.d.ts +43 -43
- package/types/tab-pane.d.ts +19 -19
- package/types/table-column.d.ts +117 -117
- package/types/table.d.ts +177 -177
- package/types/tabs.d.ts +31 -31
- package/types/tag.d.ts +28 -28
- package/types/time-picker.d.ts +63 -63
- package/types/time-select.d.ts +56 -56
- package/types/timeline-item.d.ts +20 -20
- package/types/timeline.d.ts +6 -6
- package/types/tooltip.d.ts +52 -52
- package/types/transfer.d.ts +73 -73
- package/types/tree.d.ts +266 -266
- package/types/treeselect.d.ts +5 -0
- package/types/upload.d.ts +124 -124
- package/web-types.json +4195 -4195
- package/lib/fileUpload.js +0 -3885
- package/lib/tabDialog.js +0 -2644
- package/lib/treeSelect.js +0 -4421
- package/lib/utils/date_source.js +0 -335
- package/lib/utils/lodash_source.js +0 -9421
- package/packages/fileUpload/index.js +0 -8
- package/packages/fileUpload/src/main.vue +0 -430
- package/packages/subTitle/index.js +0 -8
- package/packages/subTitle/src/main.vue +0 -33
- package/packages/tabDialog/index.js +0 -23
- package/packages/tabDialog/src/dialog/drag.js +0 -63
- package/packages/tabDialog/src/dialog/dragHeight.js +0 -34
- package/packages/tabDialog/src/dialog/dragWidth.js +0 -30
- package/packages/tabDialog/src/main.vue +0 -277
- package/packages/theme-cy/lib/element.css +0 -1
- package/packages/theme-cy/lib/fileUpload.css +0 -1
- package/packages/theme-cy/lib/subTitle.css +0 -1
- package/packages/theme-cy/lib/tabDialog.css +0 -1
- package/packages/theme-cy/src/element.scss +0 -45
- package/packages/theme-cy/src/fileUpload.scss +0 -30
- package/packages/theme-cy/src/subTitle.scss +0 -26
- package/packages/theme-cy/src/tabDialog.scss +0 -43
- package/packages/treeSelect/index.js +0 -8
- package/src/utils/date_source.js +0 -352
- package/src/utils/lodash_source.js +0 -18090
- package/types/fileUpload.d.ts +0 -5
- package/types/subTitle.d.ts +0 -5
- package/types/tabDialog.d.ts +0 -5
- 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 =
|
|
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
|
-
/***/
|
|
1034
|
-
/***/ (function(module,
|
|
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
|
-
//
|
|
1092
|
-
|
|
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/
|
|
1123
|
-
var
|
|
206
|
+
// EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
|
|
207
|
+
var menu_mixin = __webpack_require__(37);
|
|
1124
208
|
|
|
1125
|
-
//
|
|
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
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
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
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
/*
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
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
|
|
1525
|
-
var
|
|
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
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
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
|
-
|
|
1722
|
-
|
|
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
|
-
|
|
619
|
+
/* harmony default export */ var submenu = (component.exports);
|
|
620
|
+
// CONCATENATED MODULE: ./packages/submenu/index.js
|
|
1725
621
|
|
|
1726
|
-
/***/ }),
|
|
1727
622
|
|
|
1728
|
-
|
|
1729
|
-
|
|
623
|
+
/* istanbul ignore next */
|
|
624
|
+
submenu.install = function (Vue) {
|
|
625
|
+
Vue.component(submenu.name, submenu);
|
|
626
|
+
};
|
|
1730
627
|
|
|
1731
|
-
|
|
628
|
+
/* harmony default export */ var packages_submenu = __webpack_exports__["default"] = (submenu);
|
|
1732
629
|
|
|
1733
630
|
/***/ }),
|
|
1734
631
|
|
|
1735
|
-
/***/
|
|
632
|
+
/***/ 28:
|
|
1736
633
|
/***/ (function(module, exports) {
|
|
1737
634
|
|
|
1738
|
-
module.exports = require("
|
|
635
|
+
module.exports = require("element-ui/lib/transitions/collapse-transition");
|
|
1739
636
|
|
|
1740
637
|
/***/ }),
|
|
1741
638
|
|
|
1742
|
-
/***/
|
|
639
|
+
/***/ 37:
|
|
1743
640
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1744
641
|
|
|
1745
642
|
"use strict";
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
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
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
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
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
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
|
-
|
|
3040
|
-
};
|
|
3041
|
-
|
|
683
|
+
});
|
|
3042
684
|
|
|
3043
685
|
/***/ }),
|
|
3044
686
|
|
|
3045
|
-
/***/
|
|
687
|
+
/***/ 4:
|
|
3046
688
|
/***/ (function(module, exports) {
|
|
3047
689
|
|
|
3048
|
-
module.exports = require("
|
|
690
|
+
module.exports = require("element-ui/lib/mixins/emitter");
|
|
3049
691
|
|
|
3050
692
|
/***/ }),
|
|
3051
693
|
|
|
3052
|
-
/***/
|
|
694
|
+
/***/ 5:
|
|
3053
695
|
/***/ (function(module, exports) {
|
|
3054
696
|
|
|
3055
|
-
|
|
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
|
|