cy-element-ui 1.0.3 → 1.0.5
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/README.md +163 -59
- package/lib/alert.js +211 -203
- package/lib/aside.js +29 -29
- package/lib/autocomplete.js +4615 -483
- package/lib/avatar.js +152 -126
- package/lib/backtop.js +117 -125
- package/lib/badge.js +128 -134
- package/lib/breadcrumb-item.js +146 -122
- package/lib/breadcrumb.js +97 -96
- package/lib/button-group.js +68 -65
- package/lib/button.js +67 -87
- package/lib/calendar.js +2475 -603
- package/lib/card.js +101 -100
- package/lib/carousel-item.js +854 -210
- package/lib/carousel.js +575 -408
- package/lib/cascader-panel.js +3546 -1153
- package/lib/cascader.js +7376 -970
- package/lib/checkbox-button.js +337 -290
- package/lib/checkbox-group.js +176 -105
- package/lib/checkbox.js +240 -220
- package/lib/col.js +113 -68
- package/lib/collapse-item.js +1228 -225
- package/lib/collapse.js +163 -123
- package/lib/color-picker.js +5223 -1251
- package/lib/container.js +98 -88
- package/lib/date-picker.js +8396 -3945
- package/lib/descriptions-item.js +53 -32
- package/lib/descriptions.js +697 -334
- package/lib/dialog.js +1725 -247
- package/lib/directives/mousewheel.js +14 -20
- package/lib/directives/repeat-click.js +27 -30
- package/lib/divider.js +38 -45
- package/lib/drawer.js +1032 -238
- package/lib/dropdown-item.js +159 -111
- package/lib/dropdown-menu.js +2445 -117
- package/lib/dropdown.js +1675 -366
- package/lib/element-ui.common.js +49110 -39985
- package/lib/empty.js +1084 -203
- package/lib/fileUpload.js +3900 -0
- package/lib/footer.js +29 -29
- package/lib/form-item.js +1236 -467
- package/lib/form.js +326 -258
- package/lib/header.js +80 -80
- package/lib/icon.js +71 -68
- package/lib/image.js +2389 -743
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +814 -150
- package/lib/input-number.js +2181 -444
- package/lib/input.js +1197 -517
- package/lib/link.js +117 -135
- package/lib/loading.js +1130 -363
- package/lib/locale/format.js +38 -49
- package/lib/locale/index.js +38 -52
- package/lib/locale/lang/af-ZA.js +130 -123
- package/lib/locale/lang/ar.js +123 -122
- package/lib/locale/lang/az.js +122 -121
- package/lib/locale/lang/bg.js +133 -123
- package/lib/locale/lang/bn.js +121 -121
- package/lib/locale/lang/ca.js +123 -122
- package/lib/locale/lang/cs-CZ.js +127 -125
- package/lib/locale/lang/da.js +124 -122
- package/lib/locale/lang/de.js +126 -124
- package/lib/locale/lang/ee.js +125 -123
- package/lib/locale/lang/el.js +125 -123
- package/lib/locale/lang/en.js +127 -123
- package/lib/locale/lang/eo.js +125 -123
- package/lib/locale/lang/es.js +123 -122
- package/lib/locale/lang/eu.js +128 -123
- package/lib/locale/lang/fa.js +125 -123
- package/lib/locale/lang/fi.js +125 -123
- package/lib/locale/lang/fr.js +125 -122
- package/lib/locale/lang/he.js +130 -123
- package/lib/locale/lang/hr.js +128 -123
- package/lib/locale/lang/hu.js +124 -122
- package/lib/locale/lang/hy-AM.js +125 -123
- package/lib/locale/lang/id.js +124 -123
- package/lib/locale/lang/is.js +124 -123
- package/lib/locale/lang/it.js +123 -122
- package/lib/locale/lang/ja.js +125 -123
- package/lib/locale/lang/kg.js +125 -123
- package/lib/locale/lang/km.js +124 -123
- package/lib/locale/lang/ko.js +125 -123
- package/lib/locale/lang/ku.js +125 -123
- package/lib/locale/lang/kz.js +125 -123
- package/lib/locale/lang/lo-LA.js +121 -121
- package/lib/locale/lang/lt.js +125 -123
- package/lib/locale/lang/lv.js +125 -123
- package/lib/locale/lang/mn.js +125 -123
- package/lib/locale/lang/ms.js +123 -122
- package/lib/locale/lang/nb-NO.js +123 -122
- package/lib/locale/lang/nl.js +125 -123
- package/lib/locale/lang/pl.js +125 -123
- package/lib/locale/lang/pt-br.js +124 -123
- package/lib/locale/lang/pt.js +133 -123
- package/lib/locale/lang/ro.js +125 -123
- package/lib/locale/lang/ru-RU.js +124 -123
- package/lib/locale/lang/si.js +127 -123
- package/lib/locale/lang/sk.js +126 -125
- package/lib/locale/lang/sl.js +125 -123
- package/lib/locale/lang/sr-Latn.js +124 -123
- package/lib/locale/lang/sr.js +128 -123
- package/lib/locale/lang/sv-SE.js +128 -123
- package/lib/locale/lang/sw.js +127 -123
- package/lib/locale/lang/ta.js +130 -122
- package/lib/locale/lang/th.js +127 -123
- package/lib/locale/lang/tk.js +129 -123
- package/lib/locale/lang/tr-TR.js +125 -123
- package/lib/locale/lang/ua.js +124 -123
- package/lib/locale/lang/ug-CN.js +124 -123
- package/lib/locale/lang/uz-UZ.js +124 -123
- package/lib/locale/lang/vi.js +124 -123
- package/lib/locale/lang/zh-CN.js +124 -123
- package/lib/locale/lang/zh-TW.js +128 -123
- package/lib/main.js +23 -21
- package/lib/menu-item-group.js +105 -111
- package/lib/menu-item.js +3558 -253
- package/lib/menu.js +1680 -528
- package/lib/message-box.js +3427 -684
- package/lib/message.js +1677 -229
- package/lib/mixins/emitter.js +28 -30
- package/lib/mixins/focus.js +10 -11
- package/lib/mixins/locale.js +12 -14
- package/lib/mixins/migrating.js +38 -45
- package/lib/notification.js +1707 -269
- package/lib/option-group.js +190 -139
- package/lib/option.js +949 -196
- package/lib/page-header.js +964 -42
- package/lib/pagination.js +6947 -641
- package/lib/popconfirm.js +3951 -223
- package/lib/popover.js +3247 -369
- package/lib/progress.js +254 -244
- package/lib/radio-button.js +259 -226
- package/lib/radio-group.js +249 -186
- package/lib/radio.js +263 -253
- package/lib/rate.js +1399 -420
- package/lib/result.js +183 -227
- package/lib/row.js +58 -41
- package/lib/scrollbar.js +1331 -278
- package/lib/select.js +5816 -1428
- package/lib/skeleton-item.js +133 -145
- package/lib/skeleton.js +82 -91
- package/lib/slider.js +5157 -702
- package/lib/spinner.js +113 -101
- package/lib/statistic.js +10205 -254
- package/lib/step.js +274 -311
- package/lib/steps.js +854 -117
- package/lib/subTitle.js +292 -0
- package/lib/submenu.js +2867 -429
- package/lib/switch.js +1051 -291
- package/lib/tab-pane.js +125 -135
- package/lib/tabDialog.js +2658 -0
- package/lib/table-column.js +1975 -751
- package/lib/table.js +8019 -3979
- package/lib/tabs.js +1455 -605
- package/lib/tag.js +73 -68
- package/lib/theme-chalk/src/index.scss +3 -0
- package/lib/time-picker.js +6821 -1944
- package/lib/time-select.js +6297 -1186
- package/lib/timeline-item.js +43 -84
- package/lib/timeline.js +43 -39
- package/lib/tooltip.js +3185 -287
- package/lib/transfer.js +2943 -625
- package/lib/transitions/collapse-transition.js +69 -87
- package/lib/tree.js +3312 -1791
- package/lib/treeSelect.js +4436 -0
- package/lib/umd/locale/af-ZA.js +145 -138
- package/lib/umd/locale/ar.js +138 -137
- package/lib/umd/locale/az.js +139 -137
- package/lib/umd/locale/bg.js +148 -138
- package/lib/umd/locale/bn.js +138 -137
- package/lib/umd/locale/ca.js +138 -137
- package/lib/umd/locale/cs-CZ.js +142 -140
- package/lib/umd/locale/da.js +139 -137
- package/lib/umd/locale/de.js +141 -139
- package/lib/umd/locale/ee.js +140 -138
- package/lib/umd/locale/el.js +140 -138
- package/lib/umd/locale/en.js +142 -138
- package/lib/umd/locale/eo.js +140 -138
- package/lib/umd/locale/es.js +138 -137
- package/lib/umd/locale/eu.js +143 -138
- package/lib/umd/locale/fa.js +140 -138
- package/lib/umd/locale/fi.js +140 -138
- package/lib/umd/locale/fr.js +140 -137
- package/lib/umd/locale/he.js +145 -138
- package/lib/umd/locale/hr.js +143 -138
- package/lib/umd/locale/hu.js +139 -137
- package/lib/umd/locale/hy-AM.js +140 -138
- package/lib/umd/locale/id.js +139 -138
- package/lib/umd/locale/is.js +139 -138
- package/lib/umd/locale/it.js +138 -137
- package/lib/umd/locale/ja.js +140 -138
- package/lib/umd/locale/kg.js +140 -138
- package/lib/umd/locale/km.js +139 -138
- package/lib/umd/locale/ko.js +140 -138
- package/lib/umd/locale/ku.js +140 -138
- package/lib/umd/locale/kz.js +140 -138
- package/lib/umd/locale/lo-LA.js +138 -137
- package/lib/umd/locale/lt.js +140 -138
- package/lib/umd/locale/lv.js +140 -138
- package/lib/umd/locale/mn.js +140 -138
- package/lib/umd/locale/ms.js +138 -137
- package/lib/umd/locale/nb-NO.js +138 -137
- package/lib/umd/locale/nl.js +140 -138
- package/lib/umd/locale/pl.js +140 -138
- package/lib/umd/locale/pt-br.js +139 -138
- package/lib/umd/locale/pt.js +148 -138
- package/lib/umd/locale/ro.js +140 -138
- package/lib/umd/locale/ru-RU.js +139 -138
- package/lib/umd/locale/si.js +142 -138
- package/lib/umd/locale/sk.js +141 -140
- package/lib/umd/locale/sl.js +140 -138
- package/lib/umd/locale/sr-Latn.js +139 -138
- package/lib/umd/locale/sr.js +143 -138
- package/lib/umd/locale/sv-SE.js +143 -138
- package/lib/umd/locale/sw.js +142 -138
- package/lib/umd/locale/ta.js +145 -137
- package/lib/umd/locale/th.js +142 -138
- package/lib/umd/locale/tk.js +144 -138
- package/lib/umd/locale/tr-TR.js +140 -138
- package/lib/umd/locale/ua.js +139 -138
- package/lib/umd/locale/ug-CN.js +139 -138
- package/lib/umd/locale/uz-UZ.js +139 -138
- package/lib/umd/locale/vi.js +139 -138
- package/lib/umd/locale/zh-CN.js +139 -138
- package/lib/umd/locale/zh-TW.js +143 -138
- package/lib/upload.js +2377 -987
- package/lib/utils/after-leave.js +36 -33
- package/lib/utils/aria-dialog.js +55 -73
- package/lib/utils/aria-utils.js +67 -76
- package/lib/utils/clickoutside.js +52 -60
- package/lib/utils/date-util.js +198 -241
- package/lib/utils/date.js +6 -368
- package/lib/utils/date_source.js +349 -0
- package/lib/utils/dom.js +167 -183
- package/lib/utils/lodash.js +13 -9421
- package/lib/utils/lodash_source.js +9421 -0
- package/lib/utils/menu/aria-menubar.js +13 -18
- package/lib/utils/menu/aria-menuitem.js +43 -54
- package/lib/utils/menu/aria-submenu.js +50 -59
- package/lib/utils/merge.js +15 -17
- package/lib/utils/popper.js +1141 -1170
- package/lib/utils/popup/index.js +186 -230
- package/lib/utils/popup/popup-manager.js +159 -191
- package/lib/utils/resize-event.js +29 -44
- package/lib/utils/scroll-into-view.js +25 -33
- package/lib/utils/scrollbar-width.js +25 -36
- package/lib/utils/shared.js +3 -3
- package/lib/utils/types.js +19 -32
- package/lib/utils/util.js +187 -221
- package/lib/utils/vdom.js +5 -9
- package/lib/utils/vue-popper.js +166 -188
- package/package.json +20 -19
- package/packages/alert/src/main.vue +63 -63
- package/packages/aside/src/main.vue +9 -9
- package/packages/autocomplete/src/autocomplete-suggestions.vue +46 -46
- package/packages/autocomplete/src/autocomplete.vue +198 -198
- package/packages/avatar/src/main.vue +5 -5
- package/packages/backtop/src/main.vue +3 -3
- package/packages/badge/src/main.vue +1 -1
- package/packages/breadcrumb/src/breadcrumb-item.vue +26 -26
- package/packages/breadcrumb/src/breadcrumb.vue +22 -22
- package/packages/button/src/button-group.vue +3 -3
- package/packages/button/src/button.vue +44 -44
- package/packages/calendar/src/date-table.vue +3 -3
- package/packages/calendar/src/main.vue +7 -7
- package/packages/card/src/main.vue +9 -9
- package/packages/carousel/src/item.vue +98 -98
- package/packages/carousel/src/main.vue +2 -2
- package/packages/cascader/src/cascader.vue +4 -4
- package/packages/cascader-panel/src/cascader-menu.vue +4 -4
- package/packages/cascader-panel/src/cascader-node.vue +232 -232
- package/packages/cascader-panel/src/cascader-panel.vue +3 -3
- package/packages/cascader-panel/src/node.js +2 -3
- package/packages/cascader-panel/src/store.js +0 -1
- package/packages/checkbox/src/checkbox-button.vue +139 -139
- package/packages/checkbox/src/checkbox-group.vue +33 -33
- package/packages/checkbox/src/checkbox.vue +140 -140
- package/packages/col/src/col.js +5 -5
- package/packages/collapse/src/collapse-item.vue +55 -55
- package/packages/collapse/src/collapse.vue +54 -54
- package/packages/color-picker/src/color.js +4 -4
- package/packages/color-picker/src/components/alpha-slider.vue +100 -100
- package/packages/color-picker/src/components/hue-slider.vue +91 -91
- package/packages/color-picker/src/components/picker-dropdown.vue +64 -64
- package/packages/color-picker/src/components/predefine.vue +43 -43
- package/packages/color-picker/src/components/sv-panel.vue +70 -70
- package/packages/color-picker/src/main.vue +141 -141
- package/packages/container/src/main.vue +20 -20
- package/packages/date-picker/src/basic/date-table.vue +360 -360
- package/packages/date-picker/src/basic/month-table.vue +222 -223
- package/packages/date-picker/src/basic/time-spinner.vue +174 -174
- package/packages/date-picker/src/basic/year-table.vue +91 -91
- package/packages/date-picker/src/panel/date-range.vue +415 -415
- package/packages/date-picker/src/panel/date.vue +423 -423
- package/packages/date-picker/src/panel/month-range.vue +177 -177
- package/packages/date-picker/src/panel/time-range.vue +173 -173
- package/packages/date-picker/src/panel/time-select.vue +131 -131
- package/packages/date-picker/src/panel/time.vue +131 -131
- package/packages/date-picker/src/picker.vue +7 -7
- package/packages/descriptions/src/descriptions-row.js +3 -3
- package/packages/descriptions/src/index.js +1 -1
- package/packages/dialog/src/component.vue +155 -155
- package/packages/divider/src/main.vue +1 -1
- package/packages/drawer/src/main.vue +2 -2
- package/packages/dropdown/src/dropdown-item.vue +15 -15
- package/packages/dropdown/src/dropdown-menu.vue +47 -47
- package/packages/dropdown/src/dropdown.vue +260 -260
- package/packages/empty/src/index.vue +1 -1
- package/packages/fileUpload/index.js +8 -0
- package/packages/fileUpload/src/main.vue +430 -0
- package/packages/footer/src/main.vue +9 -9
- package/packages/form/src/form-item.vue +245 -245
- package/packages/form/src/form.vue +154 -154
- package/packages/header/src/main.vue +9 -9
- package/packages/icon/src/icon.vue +6 -6
- package/packages/image/src/image-viewer.vue +9 -9
- package/packages/image/src/main.vue +206 -206
- package/packages/infinite-scroll/src/main.js +1 -2
- package/packages/input/src/calcTextareaHeight.js +2 -2
- package/packages/input/src/input.vue +311 -311
- package/packages/input-number/src/input-number.vue +205 -205
- package/packages/loading/src/loading.vue +19 -19
- package/packages/main/src/main.vue +4 -4
- package/packages/menu/src/menu-item-group.vue +27 -27
- package/packages/menu/src/menu-item.vue +69 -69
- package/packages/menu/src/menu.vue +284 -284
- package/packages/menu/src/submenu.vue +308 -309
- package/packages/message/src/main.js +1 -1
- package/packages/message/src/main.vue +72 -72
- package/packages/message-box/src/main.vue +216 -216
- package/packages/notification/src/main.js +1 -1
- package/packages/notification/src/main.vue +93 -93
- package/packages/pagination/src/pager.vue +99 -99
- package/packages/popconfirm/src/main.vue +28 -28
- package/packages/popover/src/main.vue +6 -6
- package/packages/progress/src/progress.vue +174 -174
- package/packages/radio/src/radio-button.vue +64 -64
- package/packages/radio/src/radio-group.vue +88 -88
- package/packages/radio/src/radio.vue +74 -74
- package/packages/rate/src/main.vue +270 -270
- package/packages/row/src/row.js +3 -3
- package/packages/scrollbar/src/main.js +2 -2
- package/packages/scrollbar/src/util.js +1 -1
- package/packages/select/src/option-group.vue +46 -46
- package/packages/select/src/option.vue +122 -122
- package/packages/select/src/select-dropdown.vue +49 -49
- package/packages/select/src/select.vue +676 -676
- package/packages/skeleton/src/item.vue +12 -12
- package/packages/slider/src/button.vue +191 -191
- package/packages/slider/src/main.vue +314 -314
- package/packages/spinner/src/spinner.vue +16 -16
- package/packages/statistic/src/main.vue +5 -6
- package/packages/steps/src/step.vue +2 -2
- package/packages/steps/src/steps.vue +4 -4
- package/packages/subTitle/index.js +8 -0
- package/packages/subTitle/src/main.vue +33 -0
- package/packages/switch/src/component.vue +123 -123
- package/packages/tabDialog/index.js +23 -0
- package/packages/tabDialog/src/dialog/drag.js +63 -0
- package/packages/tabDialog/src/dialog/dragHeight.js +34 -0
- package/packages/tabDialog/src/dialog/dragWidth.js +30 -0
- package/packages/tabDialog/src/main.vue +277 -0
- package/packages/table/src/filter-panel.vue +128 -128
- package/packages/table/src/store/index.js +1 -1
- package/packages/table/src/table-body.js +2 -2
- package/packages/table/src/table-column.js +1 -1
- package/packages/table/src/table-header.js +1 -1
- package/packages/table/src/table-layout.js +1 -1
- package/packages/table/src/table.vue +416 -416
- package/packages/tabs/src/tab-bar.vue +43 -43
- package/packages/tabs/src/tab-nav.vue +250 -250
- package/packages/tabs/src/tab-pane.vue +34 -34
- package/packages/tabs/src/tabs.vue +165 -165
- package/packages/tag/src/tag.vue +52 -52
- package/packages/theme-chalk/src/index.scss +3 -0
- package/packages/theme-cy/lib/element.css +1 -0
- package/packages/theme-cy/lib/fileUpload.css +1 -0
- package/packages/theme-cy/lib/index.css +1 -1
- package/packages/theme-cy/lib/subTitle.css +1 -0
- package/packages/theme-cy/lib/tabDialog.css +1 -0
- package/packages/theme-cy/lib/treeselect.css +1 -1
- package/packages/theme-cy/src/element.scss +45 -0
- package/packages/theme-cy/src/fileUpload.scss +30 -0
- package/packages/theme-cy/src/index.scss +4 -0
- package/packages/theme-cy/src/subTitle.scss +26 -0
- package/packages/theme-cy/src/tabDialog.scss +43 -0
- package/packages/theme-cy/src/treeselect.scss +20 -14
- package/packages/timeline/src/item.vue +24 -24
- package/packages/timeline/src/main.vue +27 -27
- package/packages/tooltip/src/main.js +1 -1
- package/packages/transfer/src/main.vue +169 -169
- package/packages/transfer/src/transfer-panel.vue +164 -164
- package/packages/tree/src/tree-node.vue +169 -169
- package/packages/tree/src/tree.vue +408 -408
- package/packages/treeSelect/index.js +8 -0
- package/packages/{treeselect → treeSelect}/src/main.vue +19 -19
- package/packages/upload/src/ajax.js +3 -3
- package/packages/upload/src/upload-dragger.vue +50 -50
- package/packages/upload/src/upload-list.vue +33 -33
- package/packages/upload/src/upload.vue +1 -1
- package/src/index.js +13 -5
- package/src/locale/format.js +0 -1
- package/src/mixins/migrating.js +2 -2
- package/src/utils/date.js +2 -368
- package/src/utils/date_source.js +368 -0
- package/src/utils/lodash.js +9 -18075
- package/src/utils/lodash_source.js +18075 -0
- package/src/utils/types.js +1 -1
- package/types/element-ui.d.ts +16 -3
- package/types/fileUpload.d.ts +5 -0
- package/types/subTitle.d.ts +5 -0
- package/types/tabDialog.d.ts +5 -0
- package/types/treeSelect.d.ts +5 -0
- package/lib/treeselect.js +0 -682
- package/packages/treeselect/index.js +0 -8
- package/types/treeselect.d.ts +0 -5
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:row-style="rowStyle"
|
|
43
43
|
:highlight="highlightCurrentRow"
|
|
44
44
|
:style="{
|
|
45
|
-
|
|
45
|
+
width: bodyWidth
|
|
46
46
|
}">
|
|
47
47
|
</table-body>
|
|
48
48
|
<div
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
class="el-table__fixed"
|
|
85
85
|
ref="fixedWrapper"
|
|
86
86
|
:style="[{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
width: layout.fixedWidth ? layout.fixedWidth + 'px' : ''
|
|
88
|
+
},
|
|
89
|
+
fixedHeight]">
|
|
90
90
|
<div
|
|
91
91
|
v-if="showHeader"
|
|
92
92
|
class="el-table__fixed-header-wrapper"
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
class="el-table__fixed-body-wrapper"
|
|
105
105
|
ref="fixedBodyWrapper"
|
|
106
106
|
:style="[{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
top: layout.headerHeight + 'px'
|
|
108
|
+
},
|
|
109
|
+
fixedBodyHeight]">
|
|
110
110
|
<table-body
|
|
111
111
|
fixed="left"
|
|
112
112
|
:store="store"
|
|
@@ -145,10 +145,10 @@
|
|
|
145
145
|
class="el-table__fixed-right"
|
|
146
146
|
ref="rightFixedWrapper"
|
|
147
147
|
:style="[{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '',
|
|
149
|
+
right: layout.scrollY ? (border ? layout.gutterWidth : (layout.gutterWidth || 0)) + 'px' : ''
|
|
150
|
+
},
|
|
151
|
+
fixedHeight]">
|
|
152
152
|
<div v-if="showHeader"
|
|
153
153
|
class="el-table__fixed-header-wrapper"
|
|
154
154
|
ref="rightFixedHeaderWrapper">
|
|
@@ -165,9 +165,9 @@
|
|
|
165
165
|
class="el-table__fixed-body-wrapper"
|
|
166
166
|
ref="rightFixedBodyWrapper"
|
|
167
167
|
:style="[{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
top: layout.headerHeight + 'px'
|
|
169
|
+
},
|
|
170
|
+
fixedBodyHeight]">
|
|
171
171
|
<table-body
|
|
172
172
|
fixed="right"
|
|
173
173
|
:store="store"
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
width: bodyWidth
|
|
180
180
|
}">
|
|
181
181
|
</table-body>
|
|
182
|
-
|
|
182
|
+
<div
|
|
183
183
|
v-if="$slots.append"
|
|
184
184
|
class="el-table__append-gutter"
|
|
185
185
|
:style="{ height: layout.appendHeight + 'px' }"></div>
|
|
@@ -213,500 +213,500 @@
|
|
|
213
213
|
</template>
|
|
214
214
|
|
|
215
215
|
<script type="text/babel">
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
size: String,
|
|
249
|
-
|
|
250
|
-
width: [String, Number],
|
|
251
|
-
|
|
252
|
-
height: [String, Number],
|
|
253
|
-
|
|
254
|
-
maxHeight: [String, Number],
|
|
216
|
+
import ElCheckbox from 'element-ui/packages/checkbox';
|
|
217
|
+
import { debounce, throttle } from 'throttle-debounce';
|
|
218
|
+
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
|
|
219
|
+
import Mousewheel from 'element-ui/src/directives/mousewheel';
|
|
220
|
+
import Locale from 'element-ui/src/mixins/locale';
|
|
221
|
+
import Migrating from 'element-ui/src/mixins/migrating';
|
|
222
|
+
import { createStore, mapStates } from './store/helper';
|
|
223
|
+
import TableLayout from './table-layout';
|
|
224
|
+
import TableBody from './table-body';
|
|
225
|
+
import TableHeader from './table-header';
|
|
226
|
+
import TableFooter from './table-footer';
|
|
227
|
+
import { parseHeight } from './util';
|
|
228
|
+
|
|
229
|
+
let tableIdSeed = 1;
|
|
230
|
+
|
|
231
|
+
export default {
|
|
232
|
+
name: 'ElTable',
|
|
233
|
+
|
|
234
|
+
mixins: [Locale, Migrating],
|
|
235
|
+
|
|
236
|
+
directives: {
|
|
237
|
+
Mousewheel
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
props: {
|
|
241
|
+
data: {
|
|
242
|
+
type: Array,
|
|
243
|
+
default: function() {
|
|
244
|
+
return [];
|
|
245
|
+
}
|
|
246
|
+
},
|
|
255
247
|
|
|
256
|
-
|
|
257
|
-
type: Boolean,
|
|
258
|
-
default: true
|
|
259
|
-
},
|
|
248
|
+
size: String,
|
|
260
249
|
|
|
261
|
-
|
|
250
|
+
width: [String, Number],
|
|
262
251
|
|
|
263
|
-
|
|
252
|
+
height: [String, Number],
|
|
264
253
|
|
|
265
|
-
|
|
254
|
+
maxHeight: [String, Number],
|
|
266
255
|
|
|
267
|
-
|
|
256
|
+
fit: {
|
|
257
|
+
type: Boolean,
|
|
258
|
+
default: true
|
|
259
|
+
},
|
|
268
260
|
|
|
269
|
-
|
|
270
|
-
type: Boolean,
|
|
271
|
-
default: true
|
|
272
|
-
},
|
|
261
|
+
stripe: Boolean,
|
|
273
262
|
|
|
274
|
-
|
|
263
|
+
border: Boolean,
|
|
275
264
|
|
|
276
|
-
|
|
265
|
+
rowKey: [String, Function],
|
|
277
266
|
|
|
278
|
-
|
|
267
|
+
context: {},
|
|
279
268
|
|
|
280
|
-
|
|
269
|
+
showHeader: {
|
|
270
|
+
type: Boolean,
|
|
271
|
+
default: true
|
|
272
|
+
},
|
|
281
273
|
|
|
282
|
-
|
|
274
|
+
showSummary: Boolean,
|
|
283
275
|
|
|
284
|
-
|
|
276
|
+
sumText: String,
|
|
285
277
|
|
|
286
|
-
|
|
278
|
+
summaryMethod: Function,
|
|
287
279
|
|
|
288
|
-
|
|
280
|
+
rowClassName: [String, Function],
|
|
289
281
|
|
|
290
|
-
|
|
282
|
+
rowStyle: [Object, Function],
|
|
291
283
|
|
|
292
|
-
|
|
284
|
+
cellClassName: [String, Function],
|
|
293
285
|
|
|
294
|
-
|
|
286
|
+
cellStyle: [Object, Function],
|
|
295
287
|
|
|
296
|
-
|
|
288
|
+
headerRowClassName: [String, Function],
|
|
297
289
|
|
|
298
|
-
|
|
299
|
-
type: Boolean,
|
|
300
|
-
default: false
|
|
301
|
-
},
|
|
290
|
+
headerRowStyle: [Object, Function],
|
|
302
291
|
|
|
303
|
-
|
|
292
|
+
headerCellClassName: [String, Function],
|
|
304
293
|
|
|
305
|
-
|
|
294
|
+
headerCellStyle: [Object, Function],
|
|
306
295
|
|
|
307
|
-
|
|
296
|
+
highlightCurrentRow: Boolean,
|
|
308
297
|
|
|
309
|
-
|
|
298
|
+
highlightSelectionRow: {
|
|
299
|
+
type: Boolean,
|
|
300
|
+
default: false
|
|
301
|
+
},
|
|
310
302
|
|
|
311
|
-
|
|
303
|
+
currentRowKey: [String, Number],
|
|
312
304
|
|
|
313
|
-
|
|
305
|
+
emptyText: String,
|
|
314
306
|
|
|
315
|
-
|
|
307
|
+
expandRowKeys: Array,
|
|
316
308
|
|
|
317
|
-
|
|
318
|
-
type: Boolean,
|
|
319
|
-
default: true
|
|
320
|
-
},
|
|
309
|
+
defaultExpandAll: Boolean,
|
|
321
310
|
|
|
322
|
-
|
|
323
|
-
type: Number,
|
|
324
|
-
default: 16
|
|
325
|
-
},
|
|
311
|
+
defaultSort: Object,
|
|
326
312
|
|
|
327
|
-
|
|
328
|
-
type: Object,
|
|
329
|
-
default() {
|
|
330
|
-
return {
|
|
331
|
-
hasChildren: 'hasChildren',
|
|
332
|
-
children: 'children'
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
},
|
|
313
|
+
tooltipEffect: String,
|
|
336
314
|
|
|
337
|
-
|
|
315
|
+
spanMethod: Function,
|
|
338
316
|
|
|
339
|
-
|
|
317
|
+
selectOnIndeterminate: {
|
|
318
|
+
type: Boolean,
|
|
319
|
+
default: true
|
|
340
320
|
},
|
|
341
321
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
TableBody,
|
|
346
|
-
ElCheckbox
|
|
322
|
+
indent: {
|
|
323
|
+
type: Number,
|
|
324
|
+
default: 16
|
|
347
325
|
},
|
|
348
326
|
|
|
349
|
-
|
|
350
|
-
|
|
327
|
+
treeProps: {
|
|
328
|
+
type: Object,
|
|
329
|
+
default() {
|
|
351
330
|
return {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
331
|
+
hasChildren: 'hasChildren',
|
|
332
|
+
children: 'children'
|
|
355
333
|
};
|
|
356
|
-
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
357
336
|
|
|
358
|
-
|
|
359
|
-
this.store.commit('setCurrentRow', row);
|
|
360
|
-
},
|
|
337
|
+
lazy: Boolean,
|
|
361
338
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
this.store.updateAllSelected();
|
|
365
|
-
},
|
|
339
|
+
load: Function
|
|
340
|
+
},
|
|
366
341
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
342
|
+
components: {
|
|
343
|
+
TableHeader,
|
|
344
|
+
TableFooter,
|
|
345
|
+
TableBody,
|
|
346
|
+
ElCheckbox
|
|
347
|
+
},
|
|
370
348
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
349
|
+
methods: {
|
|
350
|
+
getMigratingConfig() {
|
|
351
|
+
return {
|
|
352
|
+
events: {
|
|
353
|
+
expand: 'expand is renamed to expand-change'
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
},
|
|
374
357
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
358
|
+
setCurrentRow(row) {
|
|
359
|
+
this.store.commit('setCurrentRow', row);
|
|
360
|
+
},
|
|
378
361
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
362
|
+
toggleRowSelection(row, selected) {
|
|
363
|
+
this.store.toggleRowSelection(row, selected, false);
|
|
364
|
+
this.store.updateAllSelected();
|
|
365
|
+
},
|
|
382
366
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
},
|
|
367
|
+
toggleRowExpansion(row, expanded) {
|
|
368
|
+
this.store.toggleRowExpansionAdapter(row, expanded);
|
|
369
|
+
},
|
|
387
370
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
this.layout.notifyObservers('scrollable');
|
|
392
|
-
this.layout.updateColumnsWidth();
|
|
393
|
-
}
|
|
394
|
-
},
|
|
371
|
+
clearSelection() {
|
|
372
|
+
this.store.clearSelection();
|
|
373
|
+
},
|
|
395
374
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const currentScrollTop = bodyWrapper.scrollTop;
|
|
400
|
-
if (data.pixelY < 0 && currentScrollTop !== 0) {
|
|
401
|
-
event.preventDefault();
|
|
402
|
-
}
|
|
403
|
-
if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
|
|
404
|
-
event.preventDefault();
|
|
405
|
-
}
|
|
406
|
-
bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
|
|
407
|
-
} else {
|
|
408
|
-
bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
|
|
409
|
-
}
|
|
410
|
-
},
|
|
375
|
+
clearFilter(columnKeys) {
|
|
376
|
+
this.store.clearFilter(columnKeys);
|
|
377
|
+
},
|
|
411
378
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
this.bodyWrapper.scrollLeft += data.pixelX / 5;
|
|
416
|
-
}
|
|
417
|
-
},
|
|
379
|
+
clearSort() {
|
|
380
|
+
this.store.clearSort();
|
|
381
|
+
},
|
|
418
382
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
|
|
424
|
-
if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
|
|
425
|
-
if (fixedBodyWrapper) fixedBodyWrapper.scrollTop = scrollTop;
|
|
426
|
-
if (rightFixedBodyWrapper) rightFixedBodyWrapper.scrollTop = scrollTop;
|
|
427
|
-
const maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
|
|
428
|
-
if (scrollLeft >= maxScrollLeftPosition) {
|
|
429
|
-
this.scrollPosition = 'right';
|
|
430
|
-
} else if (scrollLeft === 0) {
|
|
431
|
-
this.scrollPosition = 'left';
|
|
432
|
-
} else {
|
|
433
|
-
this.scrollPosition = 'middle';
|
|
434
|
-
}
|
|
435
|
-
},
|
|
383
|
+
handleMouseLeave() {
|
|
384
|
+
this.store.commit('setHoverRow', null);
|
|
385
|
+
if (this.hoverState) this.hoverState = null;
|
|
386
|
+
},
|
|
436
387
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
388
|
+
updateScrollY() {
|
|
389
|
+
const changed = this.layout.updateScrollY();
|
|
390
|
+
if (changed) {
|
|
391
|
+
this.layout.notifyObservers('scrollable');
|
|
392
|
+
this.layout.updateColumnsWidth();
|
|
393
|
+
}
|
|
394
|
+
},
|
|
440
395
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
396
|
+
handleFixedMousewheel(event, data) {
|
|
397
|
+
const bodyWrapper = this.bodyWrapper;
|
|
398
|
+
if (Math.abs(data.spinY) > 0) {
|
|
399
|
+
const currentScrollTop = bodyWrapper.scrollTop;
|
|
400
|
+
if (data.pixelY < 0 && currentScrollTop !== 0) {
|
|
401
|
+
event.preventDefault();
|
|
447
402
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
bindEvents() {
|
|
451
|
-
this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true });
|
|
452
|
-
if (this.fit) {
|
|
453
|
-
addResizeListener(this.$el, this.resizeListener);
|
|
403
|
+
if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
|
|
404
|
+
event.preventDefault();
|
|
454
405
|
}
|
|
455
|
-
|
|
406
|
+
bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
|
|
407
|
+
} else {
|
|
408
|
+
bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
|
|
409
|
+
}
|
|
410
|
+
},
|
|
456
411
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
412
|
+
handleHeaderFooterMousewheel(event, data) {
|
|
413
|
+
const { pixelX, pixelY } = data;
|
|
414
|
+
if (Math.abs(pixelX) >= Math.abs(pixelY)) {
|
|
415
|
+
this.bodyWrapper.scrollLeft += data.pixelX / 5;
|
|
416
|
+
}
|
|
417
|
+
},
|
|
463
418
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
419
|
+
// TODO 使用 CSS transform
|
|
420
|
+
syncPostion() {
|
|
421
|
+
const { scrollLeft, scrollTop, offsetWidth, scrollWidth } = this.bodyWrapper;
|
|
422
|
+
const { headerWrapper, footerWrapper, fixedBodyWrapper, rightFixedBodyWrapper } = this.$refs;
|
|
423
|
+
if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
|
|
424
|
+
if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
|
|
425
|
+
if (fixedBodyWrapper) fixedBodyWrapper.scrollTop = scrollTop;
|
|
426
|
+
if (rightFixedBodyWrapper) rightFixedBodyWrapper.scrollTop = scrollTop;
|
|
427
|
+
const maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
|
|
428
|
+
if (scrollLeft >= maxScrollLeftPosition) {
|
|
429
|
+
this.scrollPosition = 'right';
|
|
430
|
+
} else if (scrollLeft === 0) {
|
|
431
|
+
this.scrollPosition = 'left';
|
|
432
|
+
} else {
|
|
433
|
+
this.scrollPosition = 'middle';
|
|
434
|
+
}
|
|
435
|
+
},
|
|
469
436
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
437
|
+
throttleSyncPostion: throttle(16, function() {
|
|
438
|
+
this.syncPostion();
|
|
439
|
+
}),
|
|
474
440
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
441
|
+
onScroll(evt) {
|
|
442
|
+
let raf = window.requestAnimationFrame;
|
|
443
|
+
if (!raf) {
|
|
444
|
+
this.throttleSyncPostion();
|
|
445
|
+
} else {
|
|
446
|
+
raf(this.syncPostion);
|
|
447
|
+
}
|
|
448
|
+
},
|
|
479
449
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
450
|
+
bindEvents() {
|
|
451
|
+
this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true });
|
|
452
|
+
if (this.fit) {
|
|
453
|
+
addResizeListener(this.$el, this.resizeListener);
|
|
454
|
+
}
|
|
455
|
+
},
|
|
486
456
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
457
|
+
unbindEvents() {
|
|
458
|
+
this.bodyWrapper.removeEventListener('scroll', this.onScroll, { passive: true });
|
|
459
|
+
if (this.fit) {
|
|
460
|
+
removeResizeListener(this.$el, this.resizeListener);
|
|
461
|
+
}
|
|
462
|
+
},
|
|
493
463
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
464
|
+
resizeListener() {
|
|
465
|
+
if (!this.$ready) return;
|
|
466
|
+
let shouldUpdateLayout = false;
|
|
467
|
+
const el = this.$el;
|
|
468
|
+
const { width: oldWidth, height: oldHeight } = this.resizeState;
|
|
469
|
+
|
|
470
|
+
const width = el.offsetWidth;
|
|
471
|
+
if (oldWidth !== width) {
|
|
472
|
+
shouldUpdateLayout = true;
|
|
473
|
+
}
|
|
497
474
|
|
|
498
|
-
|
|
499
|
-
|
|
475
|
+
const height = el.offsetHeight;
|
|
476
|
+
if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
|
|
477
|
+
shouldUpdateLayout = true;
|
|
500
478
|
}
|
|
501
479
|
|
|
480
|
+
if (shouldUpdateLayout) {
|
|
481
|
+
this.resizeState.width = width;
|
|
482
|
+
this.resizeState.height = height;
|
|
483
|
+
this.doLayout();
|
|
484
|
+
}
|
|
502
485
|
},
|
|
503
486
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
487
|
+
doLayout() {
|
|
488
|
+
if (this.shouldUpdateHeight) {
|
|
489
|
+
this.layout.updateElsHeight();
|
|
490
|
+
}
|
|
491
|
+
this.layout.updateColumnsWidth();
|
|
492
|
+
},
|
|
508
493
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
494
|
+
sort(prop, order) {
|
|
495
|
+
this.store.commit('sort', { prop, order });
|
|
496
|
+
},
|
|
512
497
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
this.fixedColumns.length > 0 ||
|
|
517
|
-
this.rightFixedColumns.length > 0;
|
|
518
|
-
},
|
|
498
|
+
toggleAllSelection() {
|
|
499
|
+
this.store.commit('toggleAllSelection');
|
|
500
|
+
}
|
|
519
501
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
computed: {
|
|
505
|
+
tableSize() {
|
|
506
|
+
return this.size || (this.$ELEMENT || {}).size;
|
|
507
|
+
},
|
|
508
|
+
|
|
509
|
+
bodyWrapper() {
|
|
510
|
+
return this.$refs.bodyWrapper;
|
|
511
|
+
},
|
|
512
|
+
|
|
513
|
+
shouldUpdateHeight() {
|
|
514
|
+
return this.height ||
|
|
515
|
+
this.maxHeight ||
|
|
516
|
+
this.fixedColumns.length > 0 ||
|
|
517
|
+
this.rightFixedColumns.length > 0;
|
|
518
|
+
},
|
|
524
519
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
520
|
+
bodyWidth() {
|
|
521
|
+
const { bodyWidth, scrollY, gutterWidth } = this.layout;
|
|
522
|
+
return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
|
|
523
|
+
},
|
|
524
|
+
|
|
525
|
+
bodyHeight() {
|
|
526
|
+
const { headerHeight = 0, bodyHeight, footerHeight = 0 } = this.layout;
|
|
527
|
+
if (this.height) {
|
|
528
|
+
return {
|
|
529
|
+
height: bodyHeight ? bodyHeight + 'px' : ''
|
|
530
|
+
};
|
|
531
|
+
} else if (this.maxHeight) {
|
|
532
|
+
const maxHeight = parseHeight(this.maxHeight);
|
|
533
|
+
if (typeof maxHeight === 'number') {
|
|
528
534
|
return {
|
|
529
|
-
height:
|
|
535
|
+
'max-height': (maxHeight - footerHeight - (this.showHeader ? headerHeight : 0)) + 'px'
|
|
530
536
|
};
|
|
531
|
-
} else if (this.maxHeight) {
|
|
532
|
-
const maxHeight = parseHeight(this.maxHeight);
|
|
533
|
-
if (typeof maxHeight === 'number') {
|
|
534
|
-
return {
|
|
535
|
-
'max-height': (maxHeight - footerHeight - (this.showHeader ? headerHeight : 0)) + 'px'
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
537
|
}
|
|
539
|
-
|
|
540
|
-
}
|
|
538
|
+
}
|
|
539
|
+
return {};
|
|
540
|
+
},
|
|
541
541
|
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
fixedBodyHeight() {
|
|
543
|
+
if (this.height) {
|
|
544
|
+
return {
|
|
545
|
+
height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
|
|
546
|
+
};
|
|
547
|
+
} else if (this.maxHeight) {
|
|
548
|
+
let maxHeight = parseHeight(this.maxHeight);
|
|
549
|
+
if (typeof maxHeight === 'number') {
|
|
550
|
+
maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
|
|
551
|
+
if (this.showHeader) {
|
|
552
|
+
maxHeight -= this.layout.headerHeight;
|
|
553
|
+
}
|
|
554
|
+
maxHeight -= this.layout.footerHeight;
|
|
544
555
|
return {
|
|
545
|
-
height:
|
|
556
|
+
'max-height': maxHeight + 'px'
|
|
546
557
|
};
|
|
547
|
-
} else if (this.maxHeight) {
|
|
548
|
-
let maxHeight = parseHeight(this.maxHeight);
|
|
549
|
-
if (typeof maxHeight === 'number') {
|
|
550
|
-
maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
|
|
551
|
-
if (this.showHeader) {
|
|
552
|
-
maxHeight -= this.layout.headerHeight;
|
|
553
|
-
}
|
|
554
|
-
maxHeight -= this.layout.footerHeight;
|
|
555
|
-
return {
|
|
556
|
-
'max-height': maxHeight + 'px'
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
558
|
}
|
|
560
|
-
|
|
561
|
-
}
|
|
559
|
+
}
|
|
560
|
+
return {};
|
|
561
|
+
},
|
|
562
562
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
return {
|
|
567
|
-
bottom: 0
|
|
568
|
-
};
|
|
569
|
-
}
|
|
563
|
+
fixedHeight() {
|
|
564
|
+
if (this.maxHeight) {
|
|
565
|
+
if (this.showSummary) {
|
|
570
566
|
return {
|
|
571
|
-
bottom:
|
|
567
|
+
bottom: 0
|
|
572
568
|
};
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
569
|
+
}
|
|
570
|
+
return {
|
|
571
|
+
bottom: (this.layout.scrollX && this.data.length) ? this.layout.gutterWidth + 'px' : ''
|
|
572
|
+
};
|
|
573
|
+
} else {
|
|
574
|
+
if (this.showSummary) {
|
|
579
575
|
return {
|
|
580
|
-
height: this.layout.
|
|
576
|
+
height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
|
|
581
577
|
};
|
|
582
578
|
}
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
emptyBlockStyle() {
|
|
586
|
-
if (this.data && this.data.length) return null;
|
|
587
|
-
let height = '100%';
|
|
588
|
-
if (this.layout.appendHeight) {
|
|
589
|
-
height = `calc(100% - ${this.layout.appendHeight}px)`;
|
|
590
|
-
}
|
|
591
579
|
return {
|
|
592
|
-
|
|
593
|
-
height
|
|
580
|
+
height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
|
|
594
581
|
};
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
...mapStates({
|
|
598
|
-
selection: 'selection',
|
|
599
|
-
columns: 'columns',
|
|
600
|
-
tableData: 'data',
|
|
601
|
-
fixedColumns: 'fixedColumns',
|
|
602
|
-
rightFixedColumns: 'rightFixedColumns'
|
|
603
|
-
})
|
|
582
|
+
}
|
|
604
583
|
},
|
|
605
584
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
this.layout.setMaxHeight(value);
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
|
|
621
|
-
currentRowKey: {
|
|
622
|
-
immediate: true,
|
|
623
|
-
handler(value) {
|
|
624
|
-
if (!this.rowKey) return;
|
|
625
|
-
this.store.setCurrentRowKey(value);
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
|
|
629
|
-
data: {
|
|
630
|
-
immediate: true,
|
|
631
|
-
handler(value) {
|
|
632
|
-
this.store.commit('setData', value);
|
|
633
|
-
}
|
|
634
|
-
},
|
|
585
|
+
emptyBlockStyle() {
|
|
586
|
+
if (this.data && this.data.length) return null;
|
|
587
|
+
let height = '100%';
|
|
588
|
+
if (this.layout.appendHeight) {
|
|
589
|
+
height = `calc(100% - ${ this.layout.appendHeight }px)`;
|
|
590
|
+
}
|
|
591
|
+
return {
|
|
592
|
+
width: this.bodyWidth,
|
|
593
|
+
height
|
|
594
|
+
};
|
|
595
|
+
},
|
|
635
596
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
597
|
+
...mapStates({
|
|
598
|
+
selection: 'selection',
|
|
599
|
+
columns: 'columns',
|
|
600
|
+
tableData: 'data',
|
|
601
|
+
fixedColumns: 'fixedColumns',
|
|
602
|
+
rightFixedColumns: 'rightFixedColumns'
|
|
603
|
+
})
|
|
604
|
+
},
|
|
605
|
+
|
|
606
|
+
watch: {
|
|
607
|
+
height: {
|
|
608
|
+
immediate: true,
|
|
609
|
+
handler(value) {
|
|
610
|
+
this.layout.setHeight(value);
|
|
643
611
|
}
|
|
644
612
|
},
|
|
645
613
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
614
|
+
maxHeight: {
|
|
615
|
+
immediate: true,
|
|
616
|
+
handler(value) {
|
|
617
|
+
this.layout.setMaxHeight(value);
|
|
618
|
+
}
|
|
649
619
|
},
|
|
650
620
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
621
|
+
currentRowKey: {
|
|
622
|
+
immediate: true,
|
|
623
|
+
handler(value) {
|
|
624
|
+
if (!this.rowKey) return;
|
|
625
|
+
this.store.setCurrentRowKey(value);
|
|
626
|
+
}
|
|
627
|
+
},
|
|
655
628
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
629
|
+
data: {
|
|
630
|
+
immediate: true,
|
|
631
|
+
handler(value) {
|
|
632
|
+
this.store.commit('setData', value);
|
|
633
|
+
}
|
|
634
|
+
},
|
|
660
635
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
values: column.filteredValue,
|
|
667
|
-
silent: true
|
|
668
|
-
});
|
|
636
|
+
expandRowKeys: {
|
|
637
|
+
immediate: true,
|
|
638
|
+
handler(newVal) {
|
|
639
|
+
if (newVal) {
|
|
640
|
+
this.store.setExpandRowKeysAdapter(newVal);
|
|
669
641
|
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
this.$ready = true;
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
destroyed() {
|
|
676
|
-
this.unbindEvents();
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
data() {
|
|
680
|
-
const { hasChildren = 'hasChildren', children = 'children' } = this.treeProps;
|
|
681
|
-
this.store = createStore(this, {
|
|
682
|
-
rowKey: this.rowKey,
|
|
683
|
-
defaultExpandAll: this.defaultExpandAll,
|
|
684
|
-
selectOnIndeterminate: this.selectOnIndeterminate,
|
|
685
|
-
// TreeTable 的相关配置
|
|
686
|
-
indent: this.indent,
|
|
687
|
-
lazy: this.lazy,
|
|
688
|
-
lazyColumnIdentifier: hasChildren,
|
|
689
|
-
childrenColumnName: children
|
|
690
|
-
});
|
|
691
|
-
const layout = new TableLayout({
|
|
692
|
-
store: this.store,
|
|
693
|
-
table: this,
|
|
694
|
-
fit: this.fit,
|
|
695
|
-
showHeader: this.showHeader
|
|
696
|
-
});
|
|
697
|
-
return {
|
|
698
|
-
layout,
|
|
699
|
-
isHidden: false,
|
|
700
|
-
renderExpanded: null,
|
|
701
|
-
resizeProxyVisible: false,
|
|
702
|
-
resizeState: {
|
|
703
|
-
width: null,
|
|
704
|
-
height: null
|
|
705
|
-
},
|
|
706
|
-
// 是否拥有多级表头
|
|
707
|
-
isGroup: false,
|
|
708
|
-
scrollPosition: 'left'
|
|
709
|
-
};
|
|
642
|
+
}
|
|
710
643
|
}
|
|
711
|
-
}
|
|
644
|
+
},
|
|
645
|
+
|
|
646
|
+
created() {
|
|
647
|
+
this.tableId = 'el-table_' + tableIdSeed++;
|
|
648
|
+
this.debouncedUpdateLayout = debounce(50, () => this.doLayout());
|
|
649
|
+
},
|
|
650
|
+
|
|
651
|
+
mounted() {
|
|
652
|
+
this.bindEvents();
|
|
653
|
+
this.store.updateColumns();
|
|
654
|
+
this.doLayout();
|
|
655
|
+
|
|
656
|
+
this.resizeState = {
|
|
657
|
+
width: this.$el.offsetWidth,
|
|
658
|
+
height: this.$el.offsetHeight
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
// init filters
|
|
662
|
+
this.store.states.columns.forEach(column => {
|
|
663
|
+
if (column.filteredValue && column.filteredValue.length) {
|
|
664
|
+
this.store.commit('filterChange', {
|
|
665
|
+
column,
|
|
666
|
+
values: column.filteredValue,
|
|
667
|
+
silent: true
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
this.$ready = true;
|
|
673
|
+
},
|
|
674
|
+
|
|
675
|
+
destroyed() {
|
|
676
|
+
this.unbindEvents();
|
|
677
|
+
},
|
|
678
|
+
|
|
679
|
+
data() {
|
|
680
|
+
const { hasChildren = 'hasChildren', children = 'children' } = this.treeProps;
|
|
681
|
+
this.store = createStore(this, {
|
|
682
|
+
rowKey: this.rowKey,
|
|
683
|
+
defaultExpandAll: this.defaultExpandAll,
|
|
684
|
+
selectOnIndeterminate: this.selectOnIndeterminate,
|
|
685
|
+
// TreeTable 的相关配置
|
|
686
|
+
indent: this.indent,
|
|
687
|
+
lazy: this.lazy,
|
|
688
|
+
lazyColumnIdentifier: hasChildren,
|
|
689
|
+
childrenColumnName: children
|
|
690
|
+
});
|
|
691
|
+
const layout = new TableLayout({
|
|
692
|
+
store: this.store,
|
|
693
|
+
table: this,
|
|
694
|
+
fit: this.fit,
|
|
695
|
+
showHeader: this.showHeader
|
|
696
|
+
});
|
|
697
|
+
return {
|
|
698
|
+
layout,
|
|
699
|
+
isHidden: false,
|
|
700
|
+
renderExpanded: null,
|
|
701
|
+
resizeProxyVisible: false,
|
|
702
|
+
resizeState: {
|
|
703
|
+
width: null,
|
|
704
|
+
height: null
|
|
705
|
+
},
|
|
706
|
+
// 是否拥有多级表头
|
|
707
|
+
isGroup: false,
|
|
708
|
+
scrollPosition: 'left'
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
712
|
</script>
|