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,283 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
@dragstart.prevent
|
|
4
|
+
:class="[
|
|
5
|
+
'el-input-number',
|
|
6
|
+
inputNumberSize ? 'el-input-number--' + inputNumberSize : '',
|
|
7
|
+
{ 'is-disabled': inputNumberDisabled },
|
|
8
|
+
{ 'is-without-controls': !controls },
|
|
9
|
+
{ 'is-controls-right': controlsAtRight }
|
|
10
|
+
]">
|
|
11
|
+
<span
|
|
12
|
+
class="el-input-number__decrease"
|
|
13
|
+
role="button"
|
|
14
|
+
v-if="controls"
|
|
15
|
+
v-repeat-click="decrease"
|
|
16
|
+
:class="{'is-disabled': minDisabled}"
|
|
17
|
+
@keydown.enter="decrease">
|
|
18
|
+
<i :class="`el-icon-${controlsAtRight ? 'arrow-down' : 'minus'}`"></i>
|
|
19
|
+
</span>
|
|
20
|
+
<span
|
|
21
|
+
class="el-input-number__increase"
|
|
22
|
+
role="button"
|
|
23
|
+
v-if="controls"
|
|
24
|
+
v-repeat-click="increase"
|
|
25
|
+
:class="{'is-disabled': maxDisabled}"
|
|
26
|
+
@keydown.enter="increase">
|
|
27
|
+
<i :class="`el-icon-${controlsAtRight ? 'arrow-up' : 'plus'}`"></i>
|
|
28
|
+
</span>
|
|
29
|
+
<el-input
|
|
30
|
+
ref="input"
|
|
31
|
+
:value="displayValue"
|
|
32
|
+
:placeholder="placeholder"
|
|
33
|
+
:disabled="inputNumberDisabled"
|
|
34
|
+
:size="inputNumberSize"
|
|
35
|
+
:max="max"
|
|
36
|
+
:min="min"
|
|
37
|
+
:name="name"
|
|
38
|
+
:label="label"
|
|
39
|
+
@keydown.up.native.prevent="increase"
|
|
40
|
+
@keydown.down.native.prevent="decrease"
|
|
41
|
+
@blur="handleBlur"
|
|
42
|
+
@focus="handleFocus"
|
|
43
|
+
@input="handleInput"
|
|
44
|
+
@change="handleInputChange">
|
|
45
|
+
</el-input>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import ElInput from 'element-ui/packages/input';
|
|
50
|
+
import Focus from 'element-ui/src/mixins/focus';
|
|
51
|
+
import RepeatClick from 'element-ui/src/directives/repeat-click';
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: 'ElInputNumber',
|
|
55
|
+
mixins: [Focus('input')],
|
|
56
|
+
inject: {
|
|
57
|
+
elForm: {
|
|
58
|
+
default: ''
|
|
59
|
+
},
|
|
60
|
+
elFormItem: {
|
|
61
|
+
default: ''
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
directives: {
|
|
65
|
+
repeatClick: RepeatClick
|
|
66
|
+
},
|
|
67
|
+
components: {
|
|
68
|
+
ElInput
|
|
69
|
+
},
|
|
70
|
+
props: {
|
|
71
|
+
step: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: 1
|
|
74
|
+
},
|
|
75
|
+
stepStrictly: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
79
|
+
max: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: Infinity
|
|
82
|
+
},
|
|
83
|
+
min: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: -Infinity
|
|
86
|
+
},
|
|
87
|
+
value: {},
|
|
88
|
+
disabled: Boolean,
|
|
89
|
+
size: String,
|
|
90
|
+
controls: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: true
|
|
93
|
+
},
|
|
94
|
+
controlsPosition: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: ''
|
|
97
|
+
},
|
|
98
|
+
name: String,
|
|
99
|
+
label: String,
|
|
100
|
+
placeholder: String,
|
|
101
|
+
precision: {
|
|
102
|
+
type: Number,
|
|
103
|
+
validator(val) {
|
|
104
|
+
return val >= 0 && val === parseInt(val, 10);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
data() {
|
|
109
|
+
return {
|
|
110
|
+
currentValue: 0,
|
|
111
|
+
userInput: null
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
watch: {
|
|
115
|
+
value: {
|
|
116
|
+
immediate: true,
|
|
117
|
+
handler(value) {
|
|
118
|
+
let newVal = value === undefined ? value : Number(value);
|
|
119
|
+
if (newVal !== undefined) {
|
|
120
|
+
if (isNaN(newVal)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (this.stepStrictly) {
|
|
125
|
+
const stepPrecision = this.getPrecision(this.step);
|
|
126
|
+
const precisionFactor = Math.pow(10, stepPrecision);
|
|
127
|
+
newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (this.precision !== undefined) {
|
|
131
|
+
newVal = this.toPrecision(newVal, this.precision);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (newVal >= this.max) newVal = this.max;
|
|
135
|
+
if (newVal <= this.min) newVal = this.min;
|
|
136
|
+
this.currentValue = newVal;
|
|
137
|
+
this.userInput = null;
|
|
138
|
+
this.$emit('input', newVal);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
computed: {
|
|
143
|
+
minDisabled() {
|
|
144
|
+
return this._decrease(this.value, this.step) < this.min;
|
|
145
|
+
},
|
|
146
|
+
maxDisabled() {
|
|
147
|
+
return this._increase(this.value, this.step) > this.max;
|
|
148
|
+
},
|
|
149
|
+
numPrecision() {
|
|
150
|
+
const { value, step, getPrecision, precision } = this;
|
|
151
|
+
const stepPrecision = getPrecision(step);
|
|
152
|
+
if (precision !== undefined) {
|
|
153
|
+
if (stepPrecision > precision) {
|
|
154
|
+
console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
|
|
155
|
+
}
|
|
156
|
+
return precision;
|
|
157
|
+
} else {
|
|
158
|
+
return Math.max(getPrecision(value), stepPrecision);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
controlsAtRight() {
|
|
162
|
+
return this.controls && this.controlsPosition === 'right';
|
|
163
|
+
},
|
|
164
|
+
_elFormItemSize() {
|
|
165
|
+
return (this.elFormItem || {}).elFormItemSize;
|
|
166
|
+
},
|
|
167
|
+
inputNumberSize() {
|
|
168
|
+
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
169
|
+
},
|
|
170
|
+
inputNumberDisabled() {
|
|
171
|
+
return this.disabled || !!(this.elForm || {}).disabled;
|
|
172
|
+
},
|
|
173
|
+
displayValue() {
|
|
174
|
+
if (this.userInput !== null) {
|
|
175
|
+
return this.userInput;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
let currentValue = this.currentValue;
|
|
179
|
+
|
|
180
|
+
if (typeof currentValue === 'number') {
|
|
181
|
+
if (this.stepStrictly) {
|
|
182
|
+
const stepPrecision = this.getPrecision(this.step);
|
|
183
|
+
const precisionFactor = Math.pow(10, stepPrecision);
|
|
184
|
+
currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (this.precision !== undefined) {
|
|
188
|
+
currentValue = currentValue.toFixed(this.precision);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return currentValue;
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
methods: {
|
|
196
|
+
toPrecision(num, precision) {
|
|
197
|
+
if (precision === undefined) precision = this.numPrecision;
|
|
198
|
+
return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
|
|
199
|
+
},
|
|
200
|
+
getPrecision(value) {
|
|
201
|
+
if (value === undefined) return 0;
|
|
202
|
+
const valueString = value.toString();
|
|
203
|
+
const dotPosition = valueString.indexOf('.');
|
|
204
|
+
let precision = 0;
|
|
205
|
+
if (dotPosition !== -1) {
|
|
206
|
+
precision = valueString.length - dotPosition - 1;
|
|
207
|
+
}
|
|
208
|
+
return precision;
|
|
209
|
+
},
|
|
210
|
+
_increase(val, step) {
|
|
211
|
+
if (typeof val !== 'number' && val !== undefined) return this.currentValue;
|
|
212
|
+
|
|
213
|
+
const precisionFactor = Math.pow(10, this.numPrecision);
|
|
214
|
+
// Solve the accuracy problem of JS decimal calculation by converting the value to integer.
|
|
215
|
+
return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
|
|
216
|
+
},
|
|
217
|
+
_decrease(val, step) {
|
|
218
|
+
if (typeof val !== 'number' && val !== undefined) return this.currentValue;
|
|
219
|
+
|
|
220
|
+
const precisionFactor = Math.pow(10, this.numPrecision);
|
|
221
|
+
|
|
222
|
+
return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
|
|
223
|
+
},
|
|
224
|
+
increase() {
|
|
225
|
+
if (this.inputNumberDisabled || this.maxDisabled) return;
|
|
226
|
+
const value = this.value || 0;
|
|
227
|
+
const newVal = this._increase(value, this.step);
|
|
228
|
+
this.setCurrentValue(newVal);
|
|
229
|
+
},
|
|
230
|
+
decrease() {
|
|
231
|
+
if (this.inputNumberDisabled || this.minDisabled) return;
|
|
232
|
+
const value = this.value || 0;
|
|
233
|
+
const newVal = this._decrease(value, this.step);
|
|
234
|
+
this.setCurrentValue(newVal);
|
|
235
|
+
},
|
|
236
|
+
handleBlur(event) {
|
|
237
|
+
this.$emit('blur', event);
|
|
238
|
+
},
|
|
239
|
+
handleFocus(event) {
|
|
240
|
+
this.$emit('focus', event);
|
|
241
|
+
},
|
|
242
|
+
setCurrentValue(newVal) {
|
|
243
|
+
const oldVal = this.currentValue;
|
|
244
|
+
if (typeof newVal === 'number' && this.precision !== undefined) {
|
|
245
|
+
newVal = this.toPrecision(newVal, this.precision);
|
|
246
|
+
}
|
|
247
|
+
if (newVal >= this.max) newVal = this.max;
|
|
248
|
+
if (newVal <= this.min) newVal = this.min;
|
|
249
|
+
if (oldVal === newVal) return;
|
|
250
|
+
this.userInput = null;
|
|
251
|
+
this.$emit('input', newVal);
|
|
252
|
+
this.$emit('change', newVal, oldVal);
|
|
253
|
+
this.currentValue = newVal;
|
|
254
|
+
},
|
|
255
|
+
handleInput(value) {
|
|
256
|
+
this.userInput = value;
|
|
257
|
+
},
|
|
258
|
+
handleInputChange(value) {
|
|
259
|
+
const newVal = value === '' ? undefined : Number(value);
|
|
260
|
+
if (!isNaN(newVal) || value === '') {
|
|
261
|
+
this.setCurrentValue(newVal);
|
|
262
|
+
}
|
|
263
|
+
this.userInput = null;
|
|
264
|
+
},
|
|
265
|
+
select() {
|
|
266
|
+
this.$refs.input.select();
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
mounted() {
|
|
270
|
+
let innerInput = this.$refs.input.$refs.input;
|
|
271
|
+
innerInput.setAttribute('role', 'spinbutton');
|
|
272
|
+
innerInput.setAttribute('aria-valuemax', this.max);
|
|
273
|
+
innerInput.setAttribute('aria-valuemin', this.min);
|
|
274
|
+
innerInput.setAttribute('aria-valuenow', this.currentValue);
|
|
275
|
+
innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
|
|
276
|
+
},
|
|
277
|
+
updated() {
|
|
278
|
+
if (!this.$refs || !this.$refs.input) return;
|
|
279
|
+
const innerInput = this.$refs.input.$refs.input;
|
|
280
|
+
innerInput.setAttribute('aria-valuenow', this.currentValue);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
:class="[
|
|
4
|
+
'el-link',
|
|
5
|
+
type ? `el-link--${type}` : '',
|
|
6
|
+
disabled && 'is-disabled',
|
|
7
|
+
underline && !disabled && 'is-underline'
|
|
8
|
+
]"
|
|
9
|
+
:href="disabled ? null : href"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
@click="handleClick"
|
|
12
|
+
>
|
|
13
|
+
|
|
14
|
+
<i :class="icon" v-if="icon"></i>
|
|
15
|
+
|
|
16
|
+
<span v-if="$slots.default" class="el-link--inner">
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</span>
|
|
19
|
+
|
|
20
|
+
<template v-if="$slots.icon"><slot v-if="$slots.icon" name="icon"></slot></template>
|
|
21
|
+
</a>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'ElLink',
|
|
28
|
+
|
|
29
|
+
props: {
|
|
30
|
+
type: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'default'
|
|
33
|
+
},
|
|
34
|
+
underline: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
disabled: Boolean,
|
|
39
|
+
href: String,
|
|
40
|
+
icon: String
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
methods: {
|
|
44
|
+
handleClick(event) {
|
|
45
|
+
if (!this.disabled) {
|
|
46
|
+
if (!this.href) {
|
|
47
|
+
this.$emit('click', event);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import Loading from './loading.vue';
|
|
3
|
+
import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom';
|
|
4
|
+
import { PopupManager } from 'element-ui/src/utils/popup';
|
|
5
|
+
import afterLeave from 'element-ui/src/utils/after-leave';
|
|
6
|
+
const Mask = Vue.extend(Loading);
|
|
7
|
+
|
|
8
|
+
const loadingDirective = {};
|
|
9
|
+
loadingDirective.install = Vue => {
|
|
10
|
+
if (Vue.prototype.$isServer) return;
|
|
11
|
+
const toggleLoading = (el, binding) => {
|
|
12
|
+
if (binding.value) {
|
|
13
|
+
Vue.nextTick(() => {
|
|
14
|
+
if (binding.modifiers.fullscreen) {
|
|
15
|
+
el.originalPosition = getStyle(document.body, 'position');
|
|
16
|
+
el.originalOverflow = getStyle(document.body, 'overflow');
|
|
17
|
+
el.maskStyle.zIndex = PopupManager.nextZIndex();
|
|
18
|
+
|
|
19
|
+
addClass(el.mask, 'is-fullscreen');
|
|
20
|
+
insertDom(document.body, el, binding);
|
|
21
|
+
} else {
|
|
22
|
+
removeClass(el.mask, 'is-fullscreen');
|
|
23
|
+
|
|
24
|
+
if (binding.modifiers.body) {
|
|
25
|
+
el.originalPosition = getStyle(document.body, 'position');
|
|
26
|
+
|
|
27
|
+
['top', 'left'].forEach(property => {
|
|
28
|
+
const scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
|
|
29
|
+
el.maskStyle[property] = el.getBoundingClientRect()[property] +
|
|
30
|
+
document.body[scroll] +
|
|
31
|
+
document.documentElement[scroll] -
|
|
32
|
+
parseInt(getStyle(document.body, `margin-${ property }`), 10) +
|
|
33
|
+
'px';
|
|
34
|
+
});
|
|
35
|
+
['height', 'width'].forEach(property => {
|
|
36
|
+
el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
insertDom(document.body, el, binding);
|
|
40
|
+
} else {
|
|
41
|
+
el.originalPosition = getStyle(el, 'position');
|
|
42
|
+
insertDom(el, el, binding);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
afterLeave(el.instance, _ => {
|
|
48
|
+
if (!el.instance.hiding) return;
|
|
49
|
+
el.domVisible = false;
|
|
50
|
+
const target = binding.modifiers.fullscreen || binding.modifiers.body
|
|
51
|
+
? document.body
|
|
52
|
+
: el;
|
|
53
|
+
removeClass(target, 'el-loading-parent--relative');
|
|
54
|
+
removeClass(target, 'el-loading-parent--hidden');
|
|
55
|
+
el.instance.hiding = false;
|
|
56
|
+
}, 300, true);
|
|
57
|
+
el.instance.visible = false;
|
|
58
|
+
el.instance.hiding = true;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const insertDom = (parent, el, binding) => {
|
|
62
|
+
if (!el.domVisible && getStyle(el, 'display') !== 'none' && getStyle(el, 'visibility') !== 'hidden') {
|
|
63
|
+
Object.keys(el.maskStyle).forEach(property => {
|
|
64
|
+
el.mask.style[property] = el.maskStyle[property];
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed' && el.originalPosition !== 'sticky') {
|
|
68
|
+
addClass(parent, 'el-loading-parent--relative');
|
|
69
|
+
}
|
|
70
|
+
if (binding.modifiers.fullscreen && binding.modifiers.lock) {
|
|
71
|
+
addClass(parent, 'el-loading-parent--hidden');
|
|
72
|
+
}
|
|
73
|
+
el.domVisible = true;
|
|
74
|
+
|
|
75
|
+
parent.appendChild(el.mask);
|
|
76
|
+
Vue.nextTick(() => {
|
|
77
|
+
if (el.instance.hiding) {
|
|
78
|
+
el.instance.$emit('after-leave');
|
|
79
|
+
} else {
|
|
80
|
+
el.instance.visible = true;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
el.domInserted = true;
|
|
84
|
+
} else if (el.domVisible && el.instance.hiding === true) {
|
|
85
|
+
el.instance.visible = true;
|
|
86
|
+
el.instance.hiding = false;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
Vue.directive('loading', {
|
|
91
|
+
bind: function(el, binding, vnode) {
|
|
92
|
+
const textExr = el.getAttribute('element-loading-text');
|
|
93
|
+
const spinnerExr = el.getAttribute('element-loading-spinner');
|
|
94
|
+
const backgroundExr = el.getAttribute('element-loading-background');
|
|
95
|
+
const customClassExr = el.getAttribute('element-loading-custom-class');
|
|
96
|
+
const vm = vnode.context;
|
|
97
|
+
const mask = new Mask({
|
|
98
|
+
el: document.createElement('div'),
|
|
99
|
+
data: {
|
|
100
|
+
text: vm && vm[textExr] || textExr,
|
|
101
|
+
spinner: vm && vm[spinnerExr] || spinnerExr,
|
|
102
|
+
background: vm && vm[backgroundExr] || backgroundExr,
|
|
103
|
+
customClass: vm && vm[customClassExr] || customClassExr,
|
|
104
|
+
fullscreen: !!binding.modifiers.fullscreen
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
el.instance = mask;
|
|
108
|
+
el.mask = mask.$el;
|
|
109
|
+
el.maskStyle = {};
|
|
110
|
+
|
|
111
|
+
binding.value && toggleLoading(el, binding);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
update: function(el, binding) {
|
|
115
|
+
el.instance.setText(el.getAttribute('element-loading-text'));
|
|
116
|
+
if (binding.oldValue !== binding.value) {
|
|
117
|
+
toggleLoading(el, binding);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
unbind: function(el, binding) {
|
|
122
|
+
if (el.domInserted) {
|
|
123
|
+
el.mask &&
|
|
124
|
+
el.mask.parentNode &&
|
|
125
|
+
el.mask.parentNode.removeChild(el.mask);
|
|
126
|
+
toggleLoading(el, { value: false, modifiers: binding.modifiers });
|
|
127
|
+
}
|
|
128
|
+
el.instance && el.instance.$destroy();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default loadingDirective;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import loadingVue from './loading.vue';
|
|
3
|
+
import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom';
|
|
4
|
+
import { PopupManager } from 'element-ui/src/utils/popup';
|
|
5
|
+
import afterLeave from 'element-ui/src/utils/after-leave';
|
|
6
|
+
import merge from 'element-ui/src/utils/merge';
|
|
7
|
+
|
|
8
|
+
const LoadingConstructor = Vue.extend(loadingVue);
|
|
9
|
+
|
|
10
|
+
const defaults = {
|
|
11
|
+
text: null,
|
|
12
|
+
fullscreen: true,
|
|
13
|
+
body: false,
|
|
14
|
+
lock: false,
|
|
15
|
+
customClass: ''
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
let fullscreenLoading;
|
|
19
|
+
|
|
20
|
+
LoadingConstructor.prototype.originalPosition = '';
|
|
21
|
+
LoadingConstructor.prototype.originalOverflow = '';
|
|
22
|
+
|
|
23
|
+
LoadingConstructor.prototype.close = function() {
|
|
24
|
+
if (this.fullscreen) {
|
|
25
|
+
fullscreenLoading = undefined;
|
|
26
|
+
}
|
|
27
|
+
afterLeave(this, _ => {
|
|
28
|
+
const target = this.fullscreen || this.body
|
|
29
|
+
? document.body
|
|
30
|
+
: this.target;
|
|
31
|
+
removeClass(target, 'el-loading-parent--relative');
|
|
32
|
+
removeClass(target, 'el-loading-parent--hidden');
|
|
33
|
+
if (this.$el && this.$el.parentNode) {
|
|
34
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
35
|
+
}
|
|
36
|
+
this.$destroy();
|
|
37
|
+
}, 300);
|
|
38
|
+
this.visible = false;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const addStyle = (options, parent, instance) => {
|
|
42
|
+
let maskStyle = {};
|
|
43
|
+
if (options.fullscreen) {
|
|
44
|
+
instance.originalPosition = getStyle(document.body, 'position');
|
|
45
|
+
instance.originalOverflow = getStyle(document.body, 'overflow');
|
|
46
|
+
maskStyle.zIndex = PopupManager.nextZIndex();
|
|
47
|
+
} else if (options.body) {
|
|
48
|
+
instance.originalPosition = getStyle(document.body, 'position');
|
|
49
|
+
['top', 'left'].forEach(property => {
|
|
50
|
+
let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
|
|
51
|
+
maskStyle[property] = options.target.getBoundingClientRect()[property] +
|
|
52
|
+
document.body[scroll] +
|
|
53
|
+
document.documentElement[scroll] +
|
|
54
|
+
'px';
|
|
55
|
+
});
|
|
56
|
+
['height', 'width'].forEach(property => {
|
|
57
|
+
maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
|
|
58
|
+
});
|
|
59
|
+
} else {
|
|
60
|
+
instance.originalPosition = getStyle(parent, 'position');
|
|
61
|
+
}
|
|
62
|
+
Object.keys(maskStyle).forEach(property => {
|
|
63
|
+
instance.$el.style[property] = maskStyle[property];
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const Loading = (options = {}) => {
|
|
68
|
+
if (Vue.prototype.$isServer) return;
|
|
69
|
+
options = merge({}, defaults, options);
|
|
70
|
+
if (typeof options.target === 'string') {
|
|
71
|
+
options.target = document.querySelector(options.target);
|
|
72
|
+
}
|
|
73
|
+
options.target = options.target || document.body;
|
|
74
|
+
if (options.target !== document.body) {
|
|
75
|
+
options.fullscreen = false;
|
|
76
|
+
} else {
|
|
77
|
+
options.body = true;
|
|
78
|
+
}
|
|
79
|
+
if (options.fullscreen && fullscreenLoading) {
|
|
80
|
+
return fullscreenLoading;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
let parent = options.body ? document.body : options.target;
|
|
84
|
+
let instance = new LoadingConstructor({
|
|
85
|
+
el: document.createElement('div'),
|
|
86
|
+
data: options
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
addStyle(options, parent, instance);
|
|
90
|
+
if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed' && instance.originalPosition !== 'sticky') {
|
|
91
|
+
addClass(parent, 'el-loading-parent--relative');
|
|
92
|
+
}
|
|
93
|
+
if (options.fullscreen && options.lock) {
|
|
94
|
+
addClass(parent, 'el-loading-parent--hidden');
|
|
95
|
+
}
|
|
96
|
+
parent.appendChild(instance.$el);
|
|
97
|
+
Vue.nextTick(() => {
|
|
98
|
+
instance.visible = true;
|
|
99
|
+
});
|
|
100
|
+
if (options.fullscreen) {
|
|
101
|
+
fullscreenLoading = instance;
|
|
102
|
+
}
|
|
103
|
+
return instance;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default Loading;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition name="el-loading-fade" @after-leave="handleAfterLeave">
|
|
3
|
+
<div
|
|
4
|
+
v-show="visible"
|
|
5
|
+
class="el-loading-mask"
|
|
6
|
+
:style="{ backgroundColor: background || '' }"
|
|
7
|
+
:class="[customClass, { 'is-fullscreen': fullscreen }]">
|
|
8
|
+
<div class="el-loading-spinner">
|
|
9
|
+
<svg v-if="!spinner" class="circular" viewBox="25 25 50 50">
|
|
10
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
11
|
+
</svg>
|
|
12
|
+
<i v-else :class="spinner"></i>
|
|
13
|
+
<p v-if="text" class="el-loading-text">{{ text }}</p>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</transition>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
text: null,
|
|
24
|
+
spinner: null,
|
|
25
|
+
background: null,
|
|
26
|
+
fullscreen: true,
|
|
27
|
+
visible: false,
|
|
28
|
+
customClass: ''
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
methods: {
|
|
33
|
+
handleAfterLeave() {
|
|
34
|
+
this.$emit('after-leave');
|
|
35
|
+
},
|
|
36
|
+
setText(text) {
|
|
37
|
+
this.text = text;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
</script>
|