cbvirtua 1.0.37 → 1.0.39
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/package.json +1 -1
- package/src/packages/alert/index.js +8 -0
- package/src/packages/alert/src/main.vue +94 -0
- package/src/packages/aside/index.js +8 -0
- package/src/packages/aside/src/main.vue +20 -0
- package/src/packages/autocomplete/index.js +8 -0
- package/src/packages/autocomplete/src/autocomplete-suggestions.vue +76 -0
- package/src/packages/autocomplete/src/autocomplete.vue +285 -0
- package/src/packages/avatar/index.js +8 -0
- package/src/packages/avatar/src/main.vue +107 -0
- package/src/packages/backtop/index.js +8 -0
- package/src/packages/backtop/src/main.vue +110 -0
- package/src/packages/badge/index.js +8 -0
- package/src/packages/badge/src/main.vue +53 -0
- package/src/packages/breadcrumb/index.js +8 -0
- package/src/packages/breadcrumb/src/breadcrumb-item.vue +41 -0
- package/src/packages/breadcrumb/src/breadcrumb.vue +34 -0
- package/src/packages/breadcrumb-item/index.js +8 -0
- package/src/packages/button/index.js +8 -0
- package/src/packages/button/src/button-group.vue +10 -0
- package/src/packages/button/src/button.vue +78 -0
- package/src/packages/button-group/index.js +8 -0
- package/src/packages/calendar/index.js +8 -0
- package/src/packages/calendar/src/date-table.vue +200 -0
- package/src/packages/calendar/src/main.vue +280 -0
- package/src/packages/card/index.js +8 -0
- package/src/packages/card/src/main.vue +23 -0
- package/src/packages/carousel/index.js +8 -0
- package/src/packages/carousel/src/item.vue +138 -0
- package/src/packages/carousel/src/main.vue +315 -0
- package/src/packages/carousel-item/index.js +8 -0
- package/src/packages/cascader/index.js +8 -0
- package/src/packages/cascader/src/cascader.vue +663 -0
- package/src/packages/cascader-panel/index.js +8 -0
- package/src/packages/cascader-panel/src/cascader-menu.vue +138 -0
- package/src/packages/cascader-panel/src/cascader-node.vue +246 -0
- package/src/packages/cascader-panel/src/cascader-panel.vue +391 -0
- package/src/packages/cascader-panel/src/node.js +166 -0
- package/src/packages/cascader-panel/src/store.js +58 -0
- package/src/packages/checkbox/index.js +8 -0
- package/src/packages/checkbox/src/checkbox-button.vue +199 -0
- package/src/packages/checkbox/src/checkbox-group.vue +48 -0
- package/src/packages/checkbox/src/checkbox.vue +222 -0
- package/src/packages/checkbox-button/index.js +8 -0
- package/src/packages/checkbox-group/index.js +8 -0
- package/src/packages/col/index.js +9 -0
- package/src/packages/col/src/col.js +71 -0
- package/src/packages/collapse/index.js +9 -0
- package/src/packages/collapse/src/collapse-item.vue +114 -0
- package/src/packages/collapse/src/collapse.vue +73 -0
- package/src/packages/collapse-item/index.js +8 -0
- package/src/packages/color-picker/index.js +8 -0
- package/src/packages/color-picker/src/color.js +317 -0
- package/src/packages/color-picker/src/components/alpha-slider.vue +132 -0
- package/src/packages/color-picker/src/components/hue-slider.vue +123 -0
- package/src/packages/color-picker/src/components/picker-dropdown.vue +121 -0
- package/src/packages/color-picker/src/components/predefine.vue +61 -0
- package/src/packages/color-picker/src/components/sv-panel.vue +100 -0
- package/src/packages/color-picker/src/draggable.js +36 -0
- package/src/packages/color-picker/src/main.vue +188 -0
- package/src/packages/container/index.js +8 -0
- package/src/packages/container/src/main.vue +33 -0
- package/src/packages/date-picker/index.js +8 -0
- package/src/packages/date-picker/src/basic/date-table.vue +441 -0
- package/src/packages/date-picker/src/basic/month-table.vue +269 -0
- package/src/packages/date-picker/src/basic/time-spinner.vue +304 -0
- package/src/packages/date-picker/src/basic/year-table.vue +111 -0
- package/src/packages/date-picker/src/panel/date-range.vue +680 -0
- package/src/packages/date-picker/src/panel/date.vue +609 -0
- package/src/packages/date-picker/src/panel/month-range.vue +289 -0
- package/src/packages/date-picker/src/panel/time-range.vue +248 -0
- package/src/packages/date-picker/src/panel/time-select.vue +178 -0
- package/src/packages/date-picker/src/panel/time.vue +186 -0
- package/src/packages/date-picker/src/picker/date-picker.js +43 -0
- package/src/packages/date-picker/src/picker/time-picker.js +39 -0
- package/src/packages/date-picker/src/picker/time-select.js +21 -0
- package/src/packages/date-picker/src/picker.vue +956 -0
- package/src/packages/descriptions/index.js +8 -0
- package/src/packages/descriptions/src/descriptions-item.js +30 -0
- package/src/packages/descriptions/src/descriptions-row.js +116 -0
- package/src/packages/descriptions/src/index.js +180 -0
- package/src/packages/descriptions-item/index.js +8 -0
- package/src/packages/dialog/index.js +8 -0
- package/src/packages/dialog/src/component.vue +212 -0
- package/src/packages/divider/index.js +8 -0
- package/src/packages/divider/src/main.vue +37 -0
- package/src/packages/drawer/index.js +8 -0
- package/src/packages/drawer/src/main.vue +205 -0
- package/src/packages/dropdown/index.js +8 -0
- package/src/packages/dropdown/src/dropdown-item.vue +37 -0
- package/src/packages/dropdown/src/dropdown-menu.vue +63 -0
- package/src/packages/dropdown/src/dropdown.vue +293 -0
- package/src/packages/dropdown-item/index.js +8 -0
- package/src/packages/dropdown-menu/index.js +8 -0
- package/src/packages/empty/index.js +7 -0
- package/src/packages/empty/src/img-empty.vue +132 -0
- package/src/packages/empty/src/index.vue +50 -0
- package/src/packages/footer/index.js +8 -0
- package/src/packages/footer/src/main.vue +20 -0
- package/src/packages/form/index.js +8 -0
- package/src/packages/form/src/form-item.vue +324 -0
- package/src/packages/form/src/form.vue +182 -0
- package/src/packages/form/src/label-wrap.vue +78 -0
- package/src/packages/form-item/index.js +8 -0
- package/src/packages/header/index.js +8 -0
- package/src/packages/header/src/main.vue +20 -0
- package/src/packages/icon/index.js +8 -0
- package/src/packages/icon/src/icon.vue +13 -0
- package/src/packages/image/index.js +8 -0
- package/src/packages/image/src/image-viewer.vue +330 -0
- package/src/packages/image/src/main.vue +249 -0
- package/src/packages/infinite-scroll/index.js +8 -0
- package/src/packages/infinite-scroll/src/main.js +150 -0
- package/src/packages/input/index.js +8 -0
- package/src/packages/input/src/calcTextareaHeight.js +104 -0
- package/src/packages/input/src/input.vue +440 -0
- package/src/packages/input-number/index.js +8 -0
- package/src/packages/input-number/src/input-number.vue +283 -0
- package/src/packages/link/index.js +8 -0
- package/src/packages/link/src/main.vue +53 -0
- package/src/packages/loading/index.js +11 -0
- package/src/packages/loading/src/directive.js +133 -0
- package/src/packages/loading/src/index.js +106 -0
- package/src/packages/loading/src/loading.vue +41 -0
- package/src/packages/main/index.js +8 -0
- package/src/packages/main/src/main.vue +12 -0
- package/src/packages/menu/index.js +8 -0
- package/src/packages/menu/src/menu-item-group.vue +45 -0
- package/src/packages/menu/src/menu-item.vue +112 -0
- package/src/packages/menu/src/menu-mixin.js +44 -0
- package/src/packages/menu/src/menu.vue +325 -0
- package/src/packages/menu/src/submenu.vue +349 -0
- package/src/packages/menu-item/index.js +8 -0
- package/src/packages/menu-item-group/index.js +8 -0
- package/src/packages/message/index.js +2 -0
- package/src/packages/message/src/main.js +91 -0
- package/src/packages/message/src/main.vue +117 -0
- package/src/packages/message-box/index.js +2 -0
- package/src/packages/message-box/src/main.js +216 -0
- package/src/packages/message-box/src/main.vue +332 -0
- package/src/packages/notification/index.js +2 -0
- package/src/packages/notification/src/main.js +94 -0
- package/src/packages/notification/src/main.vue +152 -0
- package/src/packages/option/index.js +8 -0
- package/src/packages/option-group/index.js +8 -0
- package/src/packages/page-header/index.js +8 -0
- package/src/packages/page-header/src/main.vue +30 -0
- package/src/packages/pagination/index.js +8 -0
- package/src/packages/pagination/src/pager.vue +163 -0
- package/src/packages/pagination/src/pagination.js +386 -0
- package/src/packages/popconfirm/index.js +8 -0
- package/src/packages/popconfirm/src/main.vue +104 -0
- package/src/packages/popover/index.js +14 -0
- package/src/packages/popover/src/directive.js +20 -0
- package/src/packages/popover/src/main.vue +237 -0
- package/src/packages/progress/index.js +8 -0
- package/src/packages/progress/src/progress.vue +235 -0
- package/src/packages/radio/index.js +8 -0
- package/src/packages/radio/src/radio-button.vue +115 -0
- package/src/packages/radio/src/radio-group.vue +113 -0
- package/src/packages/radio/src/radio.vue +134 -0
- package/src/packages/radio-button/index.js +8 -0
- package/src/packages/radio-group/index.js +8 -0
- package/src/packages/rate/index.js +8 -0
- package/src/packages/rate/src/main.vue +348 -0
- package/src/packages/result/index.js +8 -0
- package/src/packages/result/src/icon-error.vue +13 -0
- package/src/packages/result/src/icon-info.vue +13 -0
- package/src/packages/result/src/icon-success.vue +13 -0
- package/src/packages/result/src/icon-warning.vue +13 -0
- package/src/packages/result/src/index.vue +65 -0
- package/src/packages/row/index.js +9 -0
- package/src/packages/row/src/row.js +44 -0
- package/src/packages/scrollbar/index.js +8 -0
- package/src/packages/scrollbar/src/bar.js +92 -0
- package/src/packages/scrollbar/src/main.js +130 -0
- package/src/packages/scrollbar/src/util.js +34 -0
- package/src/packages/select/index.js +8 -0
- package/src/packages/select/src/navigation-mixin.js +54 -0
- package/src/packages/select/src/option-group.vue +60 -0
- package/src/packages/select/src/option.vue +168 -0
- package/src/packages/select/src/select-dropdown.vue +74 -0
- package/src/packages/select/src/select.vue +900 -0
- package/src/packages/skeleton/index.js +8 -0
- package/src/packages/skeleton/src/img-placeholder.vue +16 -0
- package/src/packages/skeleton/src/index.vue +76 -0
- package/src/packages/skeleton/src/item.vue +22 -0
- package/src/packages/skeleton-item/index.js +8 -0
- package/src/packages/slider/index.js +8 -0
- package/src/packages/slider/src/button.vue +238 -0
- package/src/packages/slider/src/main.vue +427 -0
- package/src/packages/slider/src/marker.js +18 -0
- package/src/packages/spinner/index.js +8 -0
- package/src/packages/spinner/src/spinner.vue +27 -0
- package/src/packages/statistic/index.js +8 -0
- package/src/packages/statistic/src/main.vue +204 -0
- package/src/packages/step/index.js +8 -0
- package/src/packages/steps/README.md +69 -0
- package/src/packages/steps/index.js +8 -0
- package/src/packages/steps/src/step.vue +184 -0
- package/src/packages/steps/src/steps.vue +68 -0
- package/src/packages/submenu/index.js +8 -0
- package/src/packages/switch/index.js +9 -0
- package/src/packages/switch/src/component.vue +174 -0
- package/src/packages/tab-pane/index.js +8 -0
- package/src/packages/table/index.js +8 -0
- package/src/packages/table/src/config.js +124 -0
- package/src/packages/table/src/dropdown.js +28 -0
- package/src/packages/table/src/filter-panel.vue +194 -0
- package/src/packages/table/src/layout-observer.js +68 -0
- package/src/packages/table/src/store/current.js +76 -0
- package/src/packages/table/src/store/expand.js +65 -0
- package/src/packages/table/src/store/helper.js +41 -0
- package/src/packages/table/src/store/index.js +147 -0
- package/src/packages/table/src/store/tree.js +209 -0
- package/src/packages/table/src/store/watcher.js +381 -0
- package/src/packages/table/src/table-body.js +469 -0
- package/src/packages/table/src/table-column.js +319 -0
- package/src/packages/table/src/table-footer.js +153 -0
- package/src/packages/table/src/table-header.js +511 -0
- package/src/packages/table/src/table-layout.js +249 -0
- package/src/packages/table/src/table-row.js +101 -0
- package/src/packages/table/src/table.vue +712 -0
- package/src/packages/table/src/util.js +273 -0
- package/src/packages/table-column/index.js +8 -0
- package/src/packages/tabs/index.js +8 -0
- package/src/packages/tabs/src/tab-bar.vue +57 -0
- package/src/packages/tabs/src/tab-nav.vue +294 -0
- package/src/packages/tabs/src/tab-pane.vue +56 -0
- package/src/packages/tabs/src/tabs.vue +191 -0
- package/src/packages/tag/index.js +8 -0
- package/src/packages/tag/src/tag.vue +58 -0
- package/src/packages/theme-chalk/README.md +33 -0
- package/src/packages/theme-chalk/gulpfile.js +25 -0
- package/src/packages/theme-chalk/package.json +35 -0
- package/src/packages/theme-chalk/src/alert.scss +147 -0
- package/src/packages/theme-chalk/src/aside.scss +7 -0
- package/src/packages/theme-chalk/src/autocomplete.scss +80 -0
- package/src/packages/theme-chalk/src/avatar.scss +51 -0
- package/src/packages/theme-chalk/src/backtop.scss +22 -0
- package/src/packages/theme-chalk/src/badge.scss +57 -0
- package/src/packages/theme-chalk/src/base.scss +2 -0
- package/src/packages/theme-chalk/src/breadcrumb-item.scss +0 -0
- package/src/packages/theme-chalk/src/breadcrumb.scss +55 -0
- package/src/packages/theme-chalk/src/button-group.scss +0 -0
- package/src/packages/theme-chalk/src/button.scss +262 -0
- package/src/packages/theme-chalk/src/calendar.scss +79 -0
- package/src/packages/theme-chalk/src/card.scss +32 -0
- package/src/packages/theme-chalk/src/carousel-item.scss +50 -0
- package/src/packages/theme-chalk/src/carousel.scss +161 -0
- package/src/packages/theme-chalk/src/cascader-panel.scss +120 -0
- package/src/packages/theme-chalk/src/cascader.scss +182 -0
- package/src/packages/theme-chalk/src/checkbox-button.scss +0 -0
- package/src/packages/theme-chalk/src/checkbox-group.scss +0 -0
- package/src/packages/theme-chalk/src/checkbox.scss +359 -0
- package/src/packages/theme-chalk/src/col.scss +156 -0
- package/src/packages/theme-chalk/src/collapse-item.scss +0 -0
- package/src/packages/theme-chalk/src/collapse.scss +63 -0
- package/src/packages/theme-chalk/src/color-picker.scss +384 -0
- package/src/packages/theme-chalk/src/common/popup.scss +42 -0
- package/src/packages/theme-chalk/src/common/transition.scss +99 -0
- package/src/packages/theme-chalk/src/common/var.scss +1028 -0
- package/src/packages/theme-chalk/src/container.scss +14 -0
- package/src/packages/theme-chalk/src/date-picker/date-picker.scss +97 -0
- package/src/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -0
- package/src/packages/theme-chalk/src/date-picker/date-table.scss +151 -0
- package/src/packages/theme-chalk/src/date-picker/month-table.scss +82 -0
- package/src/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -0
- package/src/packages/theme-chalk/src/date-picker/picker.scss +197 -0
- package/src/packages/theme-chalk/src/date-picker/time-picker.scss +85 -0
- package/src/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -0
- package/src/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -0
- package/src/packages/theme-chalk/src/date-picker/year-table.scss +51 -0
- package/src/packages/theme-chalk/src/date-picker.scss +12 -0
- package/src/packages/theme-chalk/src/descriptions-item.scss +42 -0
- package/src/packages/theme-chalk/src/descriptions.scss +111 -0
- package/src/packages/theme-chalk/src/dialog.scss +123 -0
- package/src/packages/theme-chalk/src/display.scss +12 -0
- package/src/packages/theme-chalk/src/divider.scss +47 -0
- package/src/packages/theme-chalk/src/drawer.scss +219 -0
- package/src/packages/theme-chalk/src/dropdown-item.scss +0 -0
- package/src/packages/theme-chalk/src/dropdown-menu.scss +0 -0
- package/src/packages/theme-chalk/src/dropdown.scss +182 -0
- package/src/packages/theme-chalk/src/empty.scss +45 -0
- package/src/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
- package/src/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
- package/src/packages/theme-chalk/src/footer.scss +8 -0
- package/src/packages/theme-chalk/src/form-item.scss +0 -0
- package/src/packages/theme-chalk/src/form.scss +167 -0
- package/src/packages/theme-chalk/src/header.scss +8 -0
- package/src/packages/theme-chalk/src/icon.scss +1167 -0
- package/src/packages/theme-chalk/src/image.scss +179 -0
- package/src/packages/theme-chalk/src/index.scss +87 -0
- package/src/packages/theme-chalk/src/infinite-scroll.scss +0 -0
- package/src/packages/theme-chalk/src/infiniteScroll.scss +0 -0
- package/src/packages/theme-chalk/src/input-number.scss +180 -0
- package/src/packages/theme-chalk/src/input.scss +360 -0
- package/src/packages/theme-chalk/src/link.scss +81 -0
- package/src/packages/theme-chalk/src/loading.scss +96 -0
- package/src/packages/theme-chalk/src/main.scss +12 -0
- package/src/packages/theme-chalk/src/menu-item-group.scss +0 -0
- package/src/packages/theme-chalk/src/menu-item.scss +0 -0
- package/src/packages/theme-chalk/src/menu.scss +289 -0
- package/src/packages/theme-chalk/src/message-box.scss +226 -0
- package/src/packages/theme-chalk/src/message.scss +120 -0
- package/src/packages/theme-chalk/src/mixins/_button.scss +81 -0
- package/src/packages/theme-chalk/src/mixins/config.scss +4 -0
- package/src/packages/theme-chalk/src/mixins/function.scss +44 -0
- package/src/packages/theme-chalk/src/mixins/mixins.scss +190 -0
- package/src/packages/theme-chalk/src/mixins/utils.scss +39 -0
- package/src/packages/theme-chalk/src/notification.scss +99 -0
- package/src/packages/theme-chalk/src/option-group.scss +42 -0
- package/src/packages/theme-chalk/src/option.scss +36 -0
- package/src/packages/theme-chalk/src/page-header.scss +41 -0
- package/src/packages/theme-chalk/src/pagination.scss +295 -0
- package/src/packages/theme-chalk/src/popconfirm.scss +16 -0
- package/src/packages/theme-chalk/src/popover.scss +40 -0
- package/src/packages/theme-chalk/src/popper.scss +101 -0
- package/src/packages/theme-chalk/src/progress.scss +141 -0
- package/src/packages/theme-chalk/src/radio-button.scss +113 -0
- package/src/packages/theme-chalk/src/radio-group.scss +9 -0
- package/src/packages/theme-chalk/src/radio.scss +199 -0
- package/src/packages/theme-chalk/src/rate.scss +49 -0
- package/src/packages/theme-chalk/src/reset.scss +79 -0
- package/src/packages/theme-chalk/src/result.scss +61 -0
- package/src/packages/theme-chalk/src/row.scss +43 -0
- package/src/packages/theme-chalk/src/scrollbar.scss +72 -0
- package/src/packages/theme-chalk/src/select-dropdown.scss +62 -0
- package/src/packages/theme-chalk/src/select.scss +152 -0
- package/src/packages/theme-chalk/src/skeleton-item.scss +84 -0
- package/src/packages/theme-chalk/src/skeleton.scss +40 -0
- package/src/packages/theme-chalk/src/slider.scss +250 -0
- package/src/packages/theme-chalk/src/spinner.scss +44 -0
- package/src/packages/theme-chalk/src/statistic.scss +38 -0
- package/src/packages/theme-chalk/src/step.scss +317 -0
- package/src/packages/theme-chalk/src/steps.scss +20 -0
- package/src/packages/theme-chalk/src/submenu.scss +0 -0
- package/src/packages/theme-chalk/src/switch.scss +116 -0
- package/src/packages/theme-chalk/src/tab-pane.scss +0 -0
- package/src/packages/theme-chalk/src/table-column.scss +97 -0
- package/src/packages/theme-chalk/src/table.scss +564 -0
- package/src/packages/theme-chalk/src/tabs.scss +602 -0
- package/src/packages/theme-chalk/src/tag.scss +163 -0
- package/src/packages/theme-chalk/src/time-picker.scss +8 -0
- package/src/packages/theme-chalk/src/time-select.scss +37 -0
- package/src/packages/theme-chalk/src/timeline-item.scss +86 -0
- package/src/packages/theme-chalk/src/timeline.scss +14 -0
- package/src/packages/theme-chalk/src/tooltip.scss +141 -0
- package/src/packages/theme-chalk/src/transfer.scss +227 -0
- package/src/packages/theme-chalk/src/tree.scss +123 -0
- package/src/packages/theme-chalk/src/upload.scss +603 -0
- package/src/packages/time-picker/index.js +8 -0
- package/src/packages/time-select/index.js +8 -0
- package/src/packages/timeline/index.js +8 -0
- package/src/packages/timeline/src/item.vue +73 -0
- package/src/packages/timeline/src/main.vue +33 -0
- package/src/packages/timeline-item/index.js +8 -0
- package/src/packages/tooltip/index.js +8 -0
- package/src/packages/tooltip/src/main.js +242 -0
- package/src/packages/transfer/index.js +8 -0
- package/src/packages/transfer/src/main.vue +231 -0
- package/src/packages/transfer/src/transfer-panel.vue +251 -0
- package/src/packages/tree/index.js +8 -0
- package/src/packages/tree/src/model/node.js +484 -0
- package/src/packages/tree/src/model/tree-store.js +340 -0
- package/src/packages/tree/src/model/util.js +27 -0
- package/src/packages/tree/src/tree-node.vue +279 -0
- package/src/packages/tree/src/tree.vue +496 -0
- package/src/packages/upload/index.js +8 -0
- package/src/packages/upload/src/ajax.js +85 -0
- package/src/packages/upload/src/index.vue +338 -0
- package/src/packages/upload/src/upload-dragger.vue +70 -0
- package/src/packages/upload/src/upload-list.vue +105 -0
- package/src/packages/upload/src/upload.vue +211 -0
- package/src/src/directives/mousewheel.js +18 -0
- package/src/src/directives/repeat-click.js +26 -0
- package/src/src/index.js +309 -0
- package/src/src/locale/format.js +46 -0
- package/src/src/locale/index.js +48 -0
- package/src/src/locale/lang/af-ZA.js +123 -0
- package/src/src/locale/lang/ar.js +122 -0
- package/src/src/locale/lang/az.js +126 -0
- package/src/src/locale/lang/bg.js +123 -0
- package/src/src/locale/lang/bn.js +126 -0
- package/src/src/locale/lang/ca.js +122 -0
- package/src/src/locale/lang/cs-CZ.js +125 -0
- package/src/src/locale/lang/da.js +122 -0
- package/src/src/locale/lang/de.js +124 -0
- package/src/src/locale/lang/ee.js +123 -0
- package/src/src/locale/lang/el.js +123 -0
- package/src/src/locale/lang/en.js +123 -0
- package/src/src/locale/lang/eo.js +123 -0
- package/src/src/locale/lang/es.js +122 -0
- package/src/src/locale/lang/eu.js +123 -0
- package/src/src/locale/lang/fa.js +123 -0
- package/src/src/locale/lang/fi.js +123 -0
- package/src/src/locale/lang/fr.js +122 -0
- package/src/src/locale/lang/he.js +123 -0
- package/src/src/locale/lang/hr.js +123 -0
- package/src/src/locale/lang/hu.js +122 -0
- package/src/src/locale/lang/hy-AM.js +123 -0
- package/src/src/locale/lang/id.js +123 -0
- package/src/src/locale/lang/is.js +124 -0
- package/src/src/locale/lang/it.js +122 -0
- package/src/src/locale/lang/ja.js +123 -0
- package/src/src/locale/lang/kg.js +123 -0
- package/src/src/locale/lang/km.js +123 -0
- package/src/src/locale/lang/ko.js +123 -0
- package/src/src/locale/lang/ku.js +123 -0
- package/src/src/locale/lang/kz.js +123 -0
- package/src/src/locale/lang/lo-LA.js +126 -0
- package/src/src/locale/lang/lt.js +123 -0
- package/src/src/locale/lang/lv.js +123 -0
- package/src/src/locale/lang/mn.js +123 -0
- package/src/src/locale/lang/ms.js +122 -0
- package/src/src/locale/lang/nb-NO.js +122 -0
- package/src/src/locale/lang/nl.js +123 -0
- package/src/src/locale/lang/pl.js +123 -0
- package/src/src/locale/lang/pt-br.js +123 -0
- package/src/src/locale/lang/pt.js +123 -0
- package/src/src/locale/lang/ro.js +123 -0
- package/src/src/locale/lang/ru-RU.js +123 -0
- package/src/src/locale/lang/si.js +123 -0
- package/src/src/locale/lang/sk.js +125 -0
- package/src/src/locale/lang/sl.js +123 -0
- package/src/src/locale/lang/sr-Latn.js +123 -0
- package/src/src/locale/lang/sr.js +123 -0
- package/src/src/locale/lang/sv-SE.js +123 -0
- package/src/src/locale/lang/sw.js +123 -0
- package/src/src/locale/lang/ta.js +122 -0
- package/src/src/locale/lang/th.js +123 -0
- package/src/src/locale/lang/tk.js +123 -0
- package/src/src/locale/lang/tr-TR.js +123 -0
- package/src/src/locale/lang/ua.js +123 -0
- package/src/src/locale/lang/ug-CN.js +123 -0
- package/src/src/locale/lang/uz-UZ.js +123 -0
- package/src/src/locale/lang/vi.js +123 -0
- package/src/src/locale/lang/zh-CN.js +123 -0
- package/src/src/locale/lang/zh-TW.js +123 -0
- package/src/src/mixins/emitter.js +33 -0
- package/src/src/mixins/focus.js +9 -0
- package/src/src/mixins/locale.js +9 -0
- package/src/src/mixins/migrating.js +54 -0
- package/src/src/transitions/collapse-transition.js +77 -0
- package/src/src/utils/after-leave.js +27 -0
- package/src/src/utils/aria-dialog.js +90 -0
- package/src/src/utils/aria-utils.js +122 -0
- package/src/src/utils/clickoutside.js +76 -0
- package/src/src/utils/date-util.js +282 -0
- package/src/src/utils/date.js +368 -0
- package/src/src/utils/dom.js +227 -0
- package/src/src/utils/lodash.js +18075 -0
- package/src/src/utils/menu/aria-menubar.js +14 -0
- package/src/src/utils/menu/aria-menuitem.js +49 -0
- package/src/src/utils/menu/aria-submenu.js +59 -0
- package/src/src/utils/merge.js +15 -0
- package/src/src/utils/popper.js +1276 -0
- package/src/src/utils/popup/index.js +218 -0
- package/src/src/utils/popup/popup-manager.js +194 -0
- package/src/src/utils/resize-event.js +36 -0
- package/src/src/utils/scroll-into-view.js +27 -0
- package/src/src/utils/scrollbar-width.js +29 -0
- package/src/src/utils/shared.js +7 -0
- package/src/src/utils/types.js +40 -0
- package/src/src/utils/util.js +245 -0
- package/src/src/utils/vdom.js +5 -0
- package/src/src/utils/vue-popper.js +198 -0
- package/src//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243.txt" +131 -0
- package/.postcssrc.js +0 -18
- package/asy.js +0 -32
- package/catch.js +0 -176
- package/queue.js +0 -125
- package/ske.txt +0 -76
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { arrayFindIndex } from 'element-ui/src/utils/util';
|
|
2
|
+
import { getCell, getColumnByCell, getRowIdentity, objectEquals } from './util';
|
|
3
|
+
import { getStyle, hasClass, removeClass, addClass } from 'element-ui/src/utils/dom';
|
|
4
|
+
import ElCheckbox from 'element-ui/packages/checkbox';
|
|
5
|
+
import ElTooltip from 'element-ui/packages/tooltip';
|
|
6
|
+
import debounce from 'throttle-debounce/debounce';
|
|
7
|
+
import LayoutObserver from './layout-observer';
|
|
8
|
+
import { mapStates } from './store/helper';
|
|
9
|
+
import TableRow from './table-row.js';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'ElTableBody',
|
|
13
|
+
|
|
14
|
+
mixins: [LayoutObserver],
|
|
15
|
+
|
|
16
|
+
components: {
|
|
17
|
+
ElCheckbox,
|
|
18
|
+
ElTooltip,
|
|
19
|
+
TableRow
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
props: {
|
|
23
|
+
store: {
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
stripe: Boolean,
|
|
27
|
+
context: {},
|
|
28
|
+
rowClassName: [String, Function],
|
|
29
|
+
rowStyle: [Object, Function],
|
|
30
|
+
fixed: String,
|
|
31
|
+
highlight: Boolean
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
render(h) {
|
|
35
|
+
const data = this.data || [];
|
|
36
|
+
return (
|
|
37
|
+
<table
|
|
38
|
+
class="el-table__body"
|
|
39
|
+
cellspacing="0"
|
|
40
|
+
cellpadding="0"
|
|
41
|
+
border="0">
|
|
42
|
+
<colgroup>
|
|
43
|
+
{
|
|
44
|
+
this.columns.map(column => <col name={column.id} key={column.id} />)
|
|
45
|
+
}
|
|
46
|
+
</colgroup>
|
|
47
|
+
<tbody>
|
|
48
|
+
{
|
|
49
|
+
data.reduce((acc, row) => {
|
|
50
|
+
return acc.concat(this.wrappedRowRender(row, acc.length));
|
|
51
|
+
}, [])
|
|
52
|
+
}
|
|
53
|
+
<el-tooltip effect={this.table.tooltipEffect} placement="top" ref="tooltip" content={this.tooltipContent}></el-tooltip>
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
computed: {
|
|
60
|
+
table() {
|
|
61
|
+
return this.$parent;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
...mapStates({
|
|
65
|
+
data: 'data',
|
|
66
|
+
columns: 'columns',
|
|
67
|
+
treeIndent: 'indent',
|
|
68
|
+
leftFixedLeafCount: 'fixedLeafColumnsLength',
|
|
69
|
+
rightFixedLeafCount: 'rightFixedLeafColumnsLength',
|
|
70
|
+
columnsCount: states => states.columns.length,
|
|
71
|
+
leftFixedCount: states => states.fixedColumns.length,
|
|
72
|
+
rightFixedCount: states => states.rightFixedColumns.length,
|
|
73
|
+
hasExpandColumn: states => states.columns.some(({ type }) => type === 'expand')
|
|
74
|
+
}),
|
|
75
|
+
|
|
76
|
+
columnsHidden() {
|
|
77
|
+
return this.columns.map((column, index) => this.isColumnHidden(index));
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
firstDefaultColumnIndex() {
|
|
81
|
+
return arrayFindIndex(this.columns, ({ type }) => type === 'default');
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
watch: {
|
|
86
|
+
// don't trigger getter of currentRow in getCellClass. see https://jsfiddle.net/oe2b4hqt/
|
|
87
|
+
// update DOM manually. see https://github.com/ElemeFE/element/pull/13954/files#diff-9b450c00d0a9dec0ffad5a3176972e40
|
|
88
|
+
'store.states.hoverRow'(newVal, oldVal) {
|
|
89
|
+
if (!this.store.states.isComplex || this.$isServer) return;
|
|
90
|
+
let raf = window.requestAnimationFrame;
|
|
91
|
+
if (!raf) {
|
|
92
|
+
raf = (fn) => setTimeout(fn, 16);
|
|
93
|
+
}
|
|
94
|
+
raf(() => {
|
|
95
|
+
const rows = this.$el.querySelectorAll('.el-table__row');
|
|
96
|
+
const oldRow = rows[oldVal];
|
|
97
|
+
const newRow = rows[newVal];
|
|
98
|
+
if (oldRow) {
|
|
99
|
+
removeClass(oldRow, 'hover-row');
|
|
100
|
+
}
|
|
101
|
+
if (newRow) {
|
|
102
|
+
addClass(newRow, 'hover-row');
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
data() {
|
|
109
|
+
return {
|
|
110
|
+
tooltipContent: ''
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
created() {
|
|
115
|
+
this.activateTooltip = debounce(50, tooltip => tooltip.handleShowPopper());
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
methods: {
|
|
119
|
+
getKeyOfRow(row, index) {
|
|
120
|
+
const rowKey = this.table.rowKey;
|
|
121
|
+
if (rowKey) {
|
|
122
|
+
return getRowIdentity(row, rowKey);
|
|
123
|
+
}
|
|
124
|
+
return index;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
isColumnHidden(index) {
|
|
128
|
+
if (this.fixed === true || this.fixed === 'left') {
|
|
129
|
+
return index >= this.leftFixedLeafCount;
|
|
130
|
+
} else if (this.fixed === 'right') {
|
|
131
|
+
return index < this.columnsCount - this.rightFixedLeafCount;
|
|
132
|
+
} else {
|
|
133
|
+
return (index < this.leftFixedLeafCount) || (index >= this.columnsCount - this.rightFixedLeafCount);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
getSpan(row, column, rowIndex, columnIndex) {
|
|
138
|
+
let rowspan = 1;
|
|
139
|
+
let colspan = 1;
|
|
140
|
+
const fn = this.table.spanMethod;
|
|
141
|
+
if (typeof fn === 'function') {
|
|
142
|
+
const result = fn({
|
|
143
|
+
row,
|
|
144
|
+
column,
|
|
145
|
+
rowIndex,
|
|
146
|
+
columnIndex
|
|
147
|
+
});
|
|
148
|
+
if (Array.isArray(result)) {
|
|
149
|
+
rowspan = result[0];
|
|
150
|
+
colspan = result[1];
|
|
151
|
+
} else if (typeof result === 'object') {
|
|
152
|
+
rowspan = result.rowspan;
|
|
153
|
+
colspan = result.colspan;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { rowspan, colspan };
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
getRowStyle(row, rowIndex) {
|
|
160
|
+
const rowStyle = this.table.rowStyle;
|
|
161
|
+
if (typeof rowStyle === 'function') {
|
|
162
|
+
return rowStyle.call(null, {
|
|
163
|
+
row,
|
|
164
|
+
rowIndex
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return rowStyle || null;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
getRowClass(row, rowIndex) {
|
|
171
|
+
let selection = this.store.states.selection;
|
|
172
|
+
const classes = ['el-table__row'];
|
|
173
|
+
if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
|
|
174
|
+
classes.push('current-row');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (this.table.highlightSelectionRow) {
|
|
178
|
+
for (let i = 0; i < selection.length; i++) {
|
|
179
|
+
if (objectEquals(row, selection[i])) {
|
|
180
|
+
classes.push('selection-row');
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (this.stripe && rowIndex % 2 === 1) {
|
|
186
|
+
classes.push('el-table__row--striped');
|
|
187
|
+
}
|
|
188
|
+
const rowClassName = this.table.rowClassName;
|
|
189
|
+
if (typeof rowClassName === 'string') {
|
|
190
|
+
classes.push(rowClassName);
|
|
191
|
+
} else if (typeof rowClassName === 'function') {
|
|
192
|
+
classes.push(rowClassName.call(null, {
|
|
193
|
+
row,
|
|
194
|
+
rowIndex
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (this.store.states.expandRows.indexOf(row) > -1) {
|
|
199
|
+
classes.push('expanded');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return classes;
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
getCellStyle(rowIndex, columnIndex, row, column) {
|
|
206
|
+
const cellStyle = this.table.cellStyle;
|
|
207
|
+
if (typeof cellStyle === 'function') {
|
|
208
|
+
return cellStyle.call(null, {
|
|
209
|
+
rowIndex,
|
|
210
|
+
columnIndex,
|
|
211
|
+
row,
|
|
212
|
+
column
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return cellStyle;
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
getCellClass(rowIndex, columnIndex, row, column) {
|
|
219
|
+
const classes = [column.id, column.align, column.className];
|
|
220
|
+
|
|
221
|
+
if (this.isColumnHidden(columnIndex)) {
|
|
222
|
+
classes.push('is-hidden');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const cellClassName = this.table.cellClassName;
|
|
226
|
+
if (typeof cellClassName === 'string') {
|
|
227
|
+
classes.push(cellClassName);
|
|
228
|
+
} else if (typeof cellClassName === 'function') {
|
|
229
|
+
classes.push(cellClassName.call(null, {
|
|
230
|
+
rowIndex,
|
|
231
|
+
columnIndex,
|
|
232
|
+
row,
|
|
233
|
+
column
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
classes.push('el-table__cell');
|
|
238
|
+
|
|
239
|
+
return classes.join(' ');
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
getColspanRealWidth(columns, colspan, index) {
|
|
243
|
+
if (colspan < 1) {
|
|
244
|
+
return columns[index].realWidth;
|
|
245
|
+
}
|
|
246
|
+
const widthArr = columns.map(({ realWidth }) => realWidth).slice(index, index + colspan);
|
|
247
|
+
return widthArr.reduce((acc, width) => acc + width, -1);
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
handleCellMouseEnter(event, row) {
|
|
251
|
+
const table = this.table;
|
|
252
|
+
const cell = getCell(event);
|
|
253
|
+
|
|
254
|
+
if (cell) {
|
|
255
|
+
const column = getColumnByCell(table, cell);
|
|
256
|
+
const hoverState = table.hoverState = { cell, column, row };
|
|
257
|
+
table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// 判断是否text-overflow, 如果是就显示tooltip
|
|
261
|
+
const cellChild = event.target.querySelector('.cell');
|
|
262
|
+
if (!(hasClass(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
// use range width instead of scrollWidth to determine whether the text is overflowing
|
|
266
|
+
// to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
|
|
267
|
+
const range = document.createRange();
|
|
268
|
+
range.setStart(cellChild, 0);
|
|
269
|
+
range.setEnd(cellChild, cellChild.childNodes.length);
|
|
270
|
+
const rangeWidth = range.getBoundingClientRect().width;
|
|
271
|
+
const padding = (parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +
|
|
272
|
+
(parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0);
|
|
273
|
+
if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
|
|
274
|
+
const tooltip = this.$refs.tooltip;
|
|
275
|
+
// TODO 会引起整个 Table 的重新渲染,需要优化
|
|
276
|
+
this.tooltipContent = cell.innerText || cell.textContent;
|
|
277
|
+
tooltip.referenceElm = cell;
|
|
278
|
+
tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
|
|
279
|
+
tooltip.doDestroy();
|
|
280
|
+
tooltip.setExpectedState(true);
|
|
281
|
+
this.activateTooltip(tooltip);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
handleCellMouseLeave(event) {
|
|
286
|
+
const tooltip = this.$refs.tooltip;
|
|
287
|
+
if (tooltip) {
|
|
288
|
+
tooltip.setExpectedState(false);
|
|
289
|
+
tooltip.handleClosePopper();
|
|
290
|
+
}
|
|
291
|
+
const cell = getCell(event);
|
|
292
|
+
if (!cell) return;
|
|
293
|
+
|
|
294
|
+
const oldHoverState = this.table.hoverState || {};
|
|
295
|
+
this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
handleMouseEnter: debounce(30, function(index) {
|
|
299
|
+
this.store.commit('setHoverRow', index);
|
|
300
|
+
}),
|
|
301
|
+
|
|
302
|
+
handleMouseLeave: debounce(30, function() {
|
|
303
|
+
this.store.commit('setHoverRow', null);
|
|
304
|
+
}),
|
|
305
|
+
|
|
306
|
+
handleContextMenu(event, row) {
|
|
307
|
+
this.handleEvent(event, row, 'contextmenu');
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
handleDoubleClick(event, row) {
|
|
311
|
+
this.handleEvent(event, row, 'dblclick');
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
handleClick(event, row) {
|
|
315
|
+
this.store.commit('setCurrentRow', row);
|
|
316
|
+
this.handleEvent(event, row, 'click');
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
handleEvent(event, row, name) {
|
|
320
|
+
const table = this.table;
|
|
321
|
+
const cell = getCell(event);
|
|
322
|
+
let column;
|
|
323
|
+
if (cell) {
|
|
324
|
+
column = getColumnByCell(table, cell);
|
|
325
|
+
if (column) {
|
|
326
|
+
table.$emit(`cell-${name}`, row, column, cell, event);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
table.$emit(`row-${name}`, row, column, event);
|
|
330
|
+
},
|
|
331
|
+
|
|
332
|
+
rowRender(row, $index, treeRowData) {
|
|
333
|
+
const { treeIndent, columns, firstDefaultColumnIndex } = this;
|
|
334
|
+
const rowClasses = this.getRowClass(row, $index);
|
|
335
|
+
let display = true;
|
|
336
|
+
if (treeRowData) {
|
|
337
|
+
rowClasses.push('el-table__row--level-' + treeRowData.level);
|
|
338
|
+
display = treeRowData.display;
|
|
339
|
+
}
|
|
340
|
+
// 指令 v-show 会覆盖 row-style 中 display
|
|
341
|
+
// 使用 :style 代替 v-show https://github.com/ElemeFE/element/issues/16995
|
|
342
|
+
let displayStyle = display ? null : {
|
|
343
|
+
display: 'none'
|
|
344
|
+
};
|
|
345
|
+
return (
|
|
346
|
+
<TableRow
|
|
347
|
+
style={[displayStyle, this.getRowStyle(row, $index)]}
|
|
348
|
+
class={rowClasses}
|
|
349
|
+
key={this.getKeyOfRow(row, $index)}
|
|
350
|
+
nativeOn-dblclick={($event) => this.handleDoubleClick($event, row)}
|
|
351
|
+
nativeOn-click={($event) => this.handleClick($event, row)}
|
|
352
|
+
nativeOn-contextmenu={($event) => this.handleContextMenu($event, row)}
|
|
353
|
+
nativeOn-mouseenter={_ => this.handleMouseEnter($index)}
|
|
354
|
+
nativeOn-mouseleave={this.handleMouseLeave}
|
|
355
|
+
columns={columns}
|
|
356
|
+
row={row}
|
|
357
|
+
index={$index}
|
|
358
|
+
store={this.store}
|
|
359
|
+
context={this.context || this.table.$vnode.context}
|
|
360
|
+
firstDefaultColumnIndex={firstDefaultColumnIndex}
|
|
361
|
+
treeRowData={treeRowData}
|
|
362
|
+
treeIndent={treeIndent}
|
|
363
|
+
columnsHidden={this.columnsHidden}
|
|
364
|
+
getSpan={this.getSpan}
|
|
365
|
+
getColspanRealWidth={this.getColspanRealWidth}
|
|
366
|
+
getCellStyle={this.getCellStyle}
|
|
367
|
+
getCellClass={this.getCellClass}
|
|
368
|
+
handleCellMouseEnter={this.handleCellMouseEnter}
|
|
369
|
+
handleCellMouseLeave={this.handleCellMouseLeave}
|
|
370
|
+
isSelected={this.store.isSelected(row)}
|
|
371
|
+
isExpanded={this.store.states.expandRows.indexOf(row) > -1}
|
|
372
|
+
fixed={this.fixed}
|
|
373
|
+
>
|
|
374
|
+
</TableRow>
|
|
375
|
+
);
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
wrappedRowRender(row, $index) {
|
|
379
|
+
const store = this.store;
|
|
380
|
+
const { isRowExpanded, assertRowKey } = store;
|
|
381
|
+
const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } = store.states;
|
|
382
|
+
if (this.hasExpandColumn && isRowExpanded(row)) {
|
|
383
|
+
const renderExpanded = this.table.renderExpanded;
|
|
384
|
+
const tr = this.rowRender(row, $index);
|
|
385
|
+
if (!renderExpanded) {
|
|
386
|
+
console.error('[Element Error]renderExpanded is required.');
|
|
387
|
+
return tr;
|
|
388
|
+
}
|
|
389
|
+
// 使用二维数组,避免修改 $index
|
|
390
|
+
return [[
|
|
391
|
+
tr,
|
|
392
|
+
<tr key={'expanded-row__' + tr.key}>
|
|
393
|
+
<td colspan={ this.columnsCount } class="el-table__cell el-table__expanded-cell">
|
|
394
|
+
{ renderExpanded(this.$createElement, { row, $index, store: this.store }) }
|
|
395
|
+
</td>
|
|
396
|
+
</tr>]];
|
|
397
|
+
} else if (Object.keys(treeData).length) {
|
|
398
|
+
assertRowKey();
|
|
399
|
+
// TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算
|
|
400
|
+
// 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作
|
|
401
|
+
const key = getRowIdentity(row, rowKey);
|
|
402
|
+
let cur = treeData[key];
|
|
403
|
+
let treeRowData = null;
|
|
404
|
+
if (cur) {
|
|
405
|
+
treeRowData = {
|
|
406
|
+
expanded: cur.expanded,
|
|
407
|
+
level: cur.level,
|
|
408
|
+
display: true
|
|
409
|
+
};
|
|
410
|
+
if (typeof cur.lazy === 'boolean') {
|
|
411
|
+
if (typeof cur.loaded === 'boolean' && cur.loaded) {
|
|
412
|
+
treeRowData.noLazyChildren = !(cur.children && cur.children.length);
|
|
413
|
+
}
|
|
414
|
+
treeRowData.loading = cur.loading;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const tmp = [this.rowRender(row, $index, treeRowData)];
|
|
418
|
+
// 渲染嵌套数据
|
|
419
|
+
if (cur) {
|
|
420
|
+
// currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index
|
|
421
|
+
let i = 0;
|
|
422
|
+
const traverse = (children, parent) => {
|
|
423
|
+
if (!(children && children.length && parent)) return;
|
|
424
|
+
children.forEach(node => {
|
|
425
|
+
// 父节点的 display 状态影响子节点的显示状态
|
|
426
|
+
const innerTreeRowData = {
|
|
427
|
+
display: parent.display && parent.expanded,
|
|
428
|
+
level: parent.level + 1
|
|
429
|
+
};
|
|
430
|
+
const childKey = getRowIdentity(node, rowKey);
|
|
431
|
+
if (childKey === undefined || childKey === null) {
|
|
432
|
+
throw new Error('for nested data item, row-key is required.');
|
|
433
|
+
}
|
|
434
|
+
cur = { ...treeData[childKey] };
|
|
435
|
+
// 对于当前节点,分成有无子节点两种情况。
|
|
436
|
+
// 如果包含子节点的,设置 expanded 属性。
|
|
437
|
+
// 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。
|
|
438
|
+
if (cur) {
|
|
439
|
+
innerTreeRowData.expanded = cur.expanded;
|
|
440
|
+
// 懒加载的某些节点,level 未知
|
|
441
|
+
cur.level = cur.level || innerTreeRowData.level;
|
|
442
|
+
cur.display = !!(cur.expanded && innerTreeRowData.display);
|
|
443
|
+
if (typeof cur.lazy === 'boolean') {
|
|
444
|
+
if (typeof cur.loaded === 'boolean' && cur.loaded) {
|
|
445
|
+
innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
|
|
446
|
+
}
|
|
447
|
+
innerTreeRowData.loading = cur.loading;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
i++;
|
|
451
|
+
tmp.push(this.rowRender(node, $index + i, innerTreeRowData));
|
|
452
|
+
if (cur) {
|
|
453
|
+
const nodes = lazyTreeNodeMap[childKey] || node[childrenColumnName];
|
|
454
|
+
traverse(nodes, cur);
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
// 对于 root 节点,display 一定为 true
|
|
459
|
+
cur.display = true;
|
|
460
|
+
const nodes = lazyTreeNodeMap[key] || row[childrenColumnName];
|
|
461
|
+
traverse(nodes, cur);
|
|
462
|
+
}
|
|
463
|
+
return tmp;
|
|
464
|
+
} else {
|
|
465
|
+
return this.rowRender(row, $index);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
};
|