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,427 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="el-slider"
|
|
4
|
+
:class="{ 'is-vertical': vertical, 'el-slider--with-input': showInput }"
|
|
5
|
+
role="slider"
|
|
6
|
+
:aria-valuemin="min"
|
|
7
|
+
:aria-valuemax="max"
|
|
8
|
+
:aria-orientation="vertical ? 'vertical': 'horizontal'"
|
|
9
|
+
:aria-disabled="sliderDisabled"
|
|
10
|
+
>
|
|
11
|
+
<el-input-number
|
|
12
|
+
v-model="firstValue"
|
|
13
|
+
v-if="showInput && !range"
|
|
14
|
+
class="el-slider__input"
|
|
15
|
+
ref="input"
|
|
16
|
+
@change="emitChange"
|
|
17
|
+
:step="step"
|
|
18
|
+
:disabled="sliderDisabled"
|
|
19
|
+
:controls="showInputControls"
|
|
20
|
+
:min="min"
|
|
21
|
+
:max="max"
|
|
22
|
+
:debounce="debounce"
|
|
23
|
+
:size="inputSize">
|
|
24
|
+
</el-input-number>
|
|
25
|
+
<div
|
|
26
|
+
class="el-slider__runway"
|
|
27
|
+
:class="{ 'show-input': showInput, 'disabled': sliderDisabled }"
|
|
28
|
+
:style="runwayStyle"
|
|
29
|
+
@click="onSliderClick"
|
|
30
|
+
ref="slider">
|
|
31
|
+
<div
|
|
32
|
+
class="el-slider__bar"
|
|
33
|
+
:style="barStyle">
|
|
34
|
+
</div>
|
|
35
|
+
<slider-button
|
|
36
|
+
:vertical="vertical"
|
|
37
|
+
v-model="firstValue"
|
|
38
|
+
:tooltip-class="tooltipClass"
|
|
39
|
+
ref="button1">
|
|
40
|
+
</slider-button>
|
|
41
|
+
<slider-button
|
|
42
|
+
:vertical="vertical"
|
|
43
|
+
v-model="secondValue"
|
|
44
|
+
:tooltip-class="tooltipClass"
|
|
45
|
+
ref="button2"
|
|
46
|
+
v-if="range">
|
|
47
|
+
</slider-button>
|
|
48
|
+
<div
|
|
49
|
+
class="el-slider__stop"
|
|
50
|
+
v-for="(item, key) in stops"
|
|
51
|
+
:key="key"
|
|
52
|
+
:style="getStopStyle(item)"
|
|
53
|
+
v-if="showStops">
|
|
54
|
+
</div>
|
|
55
|
+
<template v-if="markList.length > 0">
|
|
56
|
+
<div>
|
|
57
|
+
<div
|
|
58
|
+
v-for="(item, key) in markList"
|
|
59
|
+
:style="getStopStyle(item.position)"
|
|
60
|
+
class="el-slider__stop el-slider__marks-stop"
|
|
61
|
+
:key="key">
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="el-slider__marks">
|
|
65
|
+
<slider-marker
|
|
66
|
+
:mark="item.mark" v-for="(item, key) in markList"
|
|
67
|
+
:key="key"
|
|
68
|
+
:style="getStopStyle(item.position)">
|
|
69
|
+
</slider-marker>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script type="text/babel">
|
|
77
|
+
import ElInputNumber from 'element-ui/packages/input-number';
|
|
78
|
+
import SliderButton from './button.vue';
|
|
79
|
+
import SliderMarker from './marker';
|
|
80
|
+
import Emitter from 'element-ui/src/mixins/emitter';
|
|
81
|
+
|
|
82
|
+
export default {
|
|
83
|
+
name: 'ElSlider',
|
|
84
|
+
|
|
85
|
+
mixins: [Emitter],
|
|
86
|
+
|
|
87
|
+
inject: {
|
|
88
|
+
elForm: {
|
|
89
|
+
default: ''
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
props: {
|
|
94
|
+
min: {
|
|
95
|
+
type: Number,
|
|
96
|
+
default: 0
|
|
97
|
+
},
|
|
98
|
+
max: {
|
|
99
|
+
type: Number,
|
|
100
|
+
default: 100
|
|
101
|
+
},
|
|
102
|
+
step: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 1
|
|
105
|
+
},
|
|
106
|
+
value: {
|
|
107
|
+
type: [Number, Array],
|
|
108
|
+
default: 0
|
|
109
|
+
},
|
|
110
|
+
showInput: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
showInputControls: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: true
|
|
117
|
+
},
|
|
118
|
+
inputSize: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: 'small'
|
|
121
|
+
},
|
|
122
|
+
showStops: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
showTooltip: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: true
|
|
129
|
+
},
|
|
130
|
+
formatTooltip: Function,
|
|
131
|
+
disabled: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: false
|
|
134
|
+
},
|
|
135
|
+
range: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: false
|
|
138
|
+
},
|
|
139
|
+
vertical: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: false
|
|
142
|
+
},
|
|
143
|
+
height: {
|
|
144
|
+
type: String
|
|
145
|
+
},
|
|
146
|
+
debounce: {
|
|
147
|
+
type: Number,
|
|
148
|
+
default: 300
|
|
149
|
+
},
|
|
150
|
+
label: {
|
|
151
|
+
type: String
|
|
152
|
+
},
|
|
153
|
+
tooltipClass: String,
|
|
154
|
+
marks: Object
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
components: {
|
|
158
|
+
ElInputNumber,
|
|
159
|
+
SliderButton,
|
|
160
|
+
SliderMarker
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
data() {
|
|
164
|
+
return {
|
|
165
|
+
firstValue: null,
|
|
166
|
+
secondValue: null,
|
|
167
|
+
oldValue: null,
|
|
168
|
+
dragging: false,
|
|
169
|
+
sliderSize: 1
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
watch: {
|
|
174
|
+
value(val, oldVal) {
|
|
175
|
+
if (this.dragging ||
|
|
176
|
+
Array.isArray(val) &&
|
|
177
|
+
Array.isArray(oldVal) &&
|
|
178
|
+
val.every((item, index) => item === oldVal[index])) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
this.setValues();
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
dragging(val) {
|
|
185
|
+
if (!val) {
|
|
186
|
+
this.setValues();
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
firstValue(val) {
|
|
191
|
+
if (this.range) {
|
|
192
|
+
this.$emit('input', [this.minValue, this.maxValue]);
|
|
193
|
+
} else {
|
|
194
|
+
this.$emit('input', val);
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
secondValue() {
|
|
199
|
+
if (this.range) {
|
|
200
|
+
this.$emit('input', [this.minValue, this.maxValue]);
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
min() {
|
|
205
|
+
this.setValues();
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
max() {
|
|
209
|
+
this.setValues();
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
methods: {
|
|
214
|
+
valueChanged() {
|
|
215
|
+
if (this.range) {
|
|
216
|
+
return ![this.minValue, this.maxValue]
|
|
217
|
+
.every((item, index) => item === this.oldValue[index]);
|
|
218
|
+
} else {
|
|
219
|
+
return this.value !== this.oldValue;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
setValues() {
|
|
223
|
+
if (this.min > this.max) {
|
|
224
|
+
console.error('[Element Error][Slider]min should not be greater than max.');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const val = this.value;
|
|
228
|
+
if (this.range && Array.isArray(val)) {
|
|
229
|
+
if (val[1] < this.min) {
|
|
230
|
+
this.$emit('input', [this.min, this.min]);
|
|
231
|
+
} else if (val[0] > this.max) {
|
|
232
|
+
this.$emit('input', [this.max, this.max]);
|
|
233
|
+
} else if (val[0] < this.min) {
|
|
234
|
+
this.$emit('input', [this.min, val[1]]);
|
|
235
|
+
} else if (val[1] > this.max) {
|
|
236
|
+
this.$emit('input', [val[0], this.max]);
|
|
237
|
+
} else {
|
|
238
|
+
this.firstValue = val[0];
|
|
239
|
+
this.secondValue = val[1];
|
|
240
|
+
if (this.valueChanged()) {
|
|
241
|
+
this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
|
|
242
|
+
this.oldValue = val.slice();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
} else if (!this.range && typeof val === 'number' && !isNaN(val)) {
|
|
246
|
+
if (val < this.min) {
|
|
247
|
+
this.$emit('input', this.min);
|
|
248
|
+
} else if (val > this.max) {
|
|
249
|
+
this.$emit('input', this.max);
|
|
250
|
+
} else {
|
|
251
|
+
this.firstValue = val;
|
|
252
|
+
if (this.valueChanged()) {
|
|
253
|
+
this.dispatch('ElFormItem', 'el.form.change', val);
|
|
254
|
+
this.oldValue = val;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
setPosition(percent) {
|
|
261
|
+
const targetValue = this.min + percent * (this.max - this.min) / 100;
|
|
262
|
+
if (!this.range) {
|
|
263
|
+
this.$refs.button1.setPosition(percent);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
let button;
|
|
267
|
+
if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
|
|
268
|
+
button = this.firstValue < this.secondValue ? 'button1' : 'button2';
|
|
269
|
+
} else {
|
|
270
|
+
button = this.firstValue > this.secondValue ? 'button1' : 'button2';
|
|
271
|
+
}
|
|
272
|
+
this.$refs[button].setPosition(percent);
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
onSliderClick(event) {
|
|
276
|
+
if (this.sliderDisabled || this.dragging) return;
|
|
277
|
+
this.resetSize();
|
|
278
|
+
if (this.vertical) {
|
|
279
|
+
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
|
280
|
+
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
|
281
|
+
} else {
|
|
282
|
+
const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
|
283
|
+
this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
|
|
284
|
+
}
|
|
285
|
+
this.emitChange();
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
resetSize() {
|
|
289
|
+
if (this.$refs.slider) {
|
|
290
|
+
this.sliderSize = this.$refs.slider[`client${ this.vertical ? 'Height' : 'Width' }`];
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
emitChange() {
|
|
295
|
+
this.$nextTick(() => {
|
|
296
|
+
this.$emit('change', this.range ? [this.minValue, this.maxValue] : this.value);
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
getStopStyle(position) {
|
|
301
|
+
return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
computed: {
|
|
306
|
+
stops() {
|
|
307
|
+
if (!this.showStops || this.min > this.max) return [];
|
|
308
|
+
if (this.step === 0) {
|
|
309
|
+
process.env.NODE_ENV !== 'production' &&
|
|
310
|
+
console.warn('[Element Warn][Slider]step should not be 0.');
|
|
311
|
+
return [];
|
|
312
|
+
}
|
|
313
|
+
const stopCount = (this.max - this.min) / this.step;
|
|
314
|
+
const stepWidth = 100 * this.step / (this.max - this.min);
|
|
315
|
+
const result = [];
|
|
316
|
+
for (let i = 1; i < stopCount; i++) {
|
|
317
|
+
result.push(i * stepWidth);
|
|
318
|
+
}
|
|
319
|
+
if (this.range) {
|
|
320
|
+
return result.filter(step => {
|
|
321
|
+
return step < 100 * (this.minValue - this.min) / (this.max - this.min) ||
|
|
322
|
+
step > 100 * (this.maxValue - this.min) / (this.max - this.min);
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
return result.filter(step => step > 100 * (this.firstValue - this.min) / (this.max - this.min));
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
markList() {
|
|
330
|
+
if (!this.marks) {
|
|
331
|
+
return [];
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const marksKeys = Object.keys(this.marks);
|
|
335
|
+
return marksKeys.map(parseFloat)
|
|
336
|
+
.sort((a, b) => a - b)
|
|
337
|
+
.filter(point => point <= this.max && point >= this.min)
|
|
338
|
+
.map(point => ({
|
|
339
|
+
point,
|
|
340
|
+
position: (point - this.min) * 100 / (this.max - this.min),
|
|
341
|
+
mark: this.marks[point]
|
|
342
|
+
}));
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
minValue() {
|
|
346
|
+
return Math.min(this.firstValue, this.secondValue);
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
maxValue() {
|
|
350
|
+
return Math.max(this.firstValue, this.secondValue);
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
barSize() {
|
|
354
|
+
return this.range
|
|
355
|
+
? `${ 100 * (this.maxValue - this.minValue) / (this.max - this.min) }%`
|
|
356
|
+
: `${ 100 * (this.firstValue - this.min) / (this.max - this.min) }%`;
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
barStart() {
|
|
360
|
+
return this.range
|
|
361
|
+
? `${ 100 * (this.minValue - this.min) / (this.max - this.min) }%`
|
|
362
|
+
: '0%';
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
precision() {
|
|
366
|
+
let precisions = [this.min, this.max, this.step].map(item => {
|
|
367
|
+
let decimal = ('' + item).split('.')[1];
|
|
368
|
+
return decimal ? decimal.length : 0;
|
|
369
|
+
});
|
|
370
|
+
return Math.max.apply(null, precisions);
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
runwayStyle() {
|
|
374
|
+
return this.vertical ? { height: this.height } : {};
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
barStyle() {
|
|
378
|
+
return this.vertical
|
|
379
|
+
? {
|
|
380
|
+
height: this.barSize,
|
|
381
|
+
bottom: this.barStart
|
|
382
|
+
} : {
|
|
383
|
+
width: this.barSize,
|
|
384
|
+
left: this.barStart
|
|
385
|
+
};
|
|
386
|
+
},
|
|
387
|
+
|
|
388
|
+
sliderDisabled() {
|
|
389
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
mounted() {
|
|
394
|
+
let valuetext;
|
|
395
|
+
if (this.range) {
|
|
396
|
+
if (Array.isArray(this.value)) {
|
|
397
|
+
this.firstValue = Math.max(this.min, this.value[0]);
|
|
398
|
+
this.secondValue = Math.min(this.max, this.value[1]);
|
|
399
|
+
} else {
|
|
400
|
+
this.firstValue = this.min;
|
|
401
|
+
this.secondValue = this.max;
|
|
402
|
+
}
|
|
403
|
+
this.oldValue = [this.firstValue, this.secondValue];
|
|
404
|
+
valuetext = `${this.firstValue}-${this.secondValue}`;
|
|
405
|
+
} else {
|
|
406
|
+
if (typeof this.value !== 'number' || isNaN(this.value)) {
|
|
407
|
+
this.firstValue = this.min;
|
|
408
|
+
} else {
|
|
409
|
+
this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
|
|
410
|
+
}
|
|
411
|
+
this.oldValue = this.firstValue;
|
|
412
|
+
valuetext = this.firstValue;
|
|
413
|
+
}
|
|
414
|
+
this.$el.setAttribute('aria-valuetext', valuetext);
|
|
415
|
+
|
|
416
|
+
// label screen reader
|
|
417
|
+
this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
|
|
418
|
+
|
|
419
|
+
this.resetSize();
|
|
420
|
+
window.addEventListener('resize', this.resetSize);
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
beforeDestroy() {
|
|
424
|
+
window.removeEventListener('resize', this.resetSize);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: 'ElMarker',
|
|
3
|
+
|
|
4
|
+
props: {
|
|
5
|
+
mark: {
|
|
6
|
+
type: [String, Object]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
render() {
|
|
10
|
+
let label = typeof this.mark === 'string' ? this.mark : this.mark.label;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div class="el-slider__marks-text" style={ this.mark.style || {} }>
|
|
14
|
+
{ label }
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="el-spinner">
|
|
3
|
+
<svg class="el-spinner-inner" viewBox="0 0 50 50" :style="{ width: radius/2 + 'px', height: radius/2 + 'px' }">
|
|
4
|
+
<circle class="path" cx="25" cy="25" r="20" fill="none" :stroke="strokeColor" :stroke-width="strokeWidth"></circle>
|
|
5
|
+
</svg>
|
|
6
|
+
</span>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ElSpinner',
|
|
11
|
+
props: {
|
|
12
|
+
type: String,
|
|
13
|
+
radius: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 100
|
|
16
|
+
},
|
|
17
|
+
strokeWidth: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 5
|
|
20
|
+
},
|
|
21
|
+
strokeColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '#efefef'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="el-statistic">
|
|
3
|
+
<div class="head" v-if="title||$slots.title">
|
|
4
|
+
<slot name="title">
|
|
5
|
+
<span class="title">
|
|
6
|
+
{{ title }}
|
|
7
|
+
</span>
|
|
8
|
+
</slot>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="con">
|
|
11
|
+
<span class="prefix" v-if="prefix||$slots.prefix">
|
|
12
|
+
<slot name="prefix" >
|
|
13
|
+
{{ prefix }}
|
|
14
|
+
</slot>
|
|
15
|
+
</span>
|
|
16
|
+
<span class="number" :style="valueStyle">
|
|
17
|
+
<slot name="formatter"> {{ disposeValue }}</slot>
|
|
18
|
+
</span>
|
|
19
|
+
<span class="suffix" v-if="suffix||$slots.suffix">
|
|
20
|
+
<slot name="suffix">
|
|
21
|
+
{{ suffix }}
|
|
22
|
+
</slot>
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { isNumber, chain, multiply, padStart, reduce} from 'element-ui/src/utils/lodash';
|
|
30
|
+
export default {
|
|
31
|
+
name: 'ElStatistic',
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
disposeValue: '',
|
|
35
|
+
timeTask: null,
|
|
36
|
+
REFRESH_INTERVAL: 1000 / 30
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
decimalSeparator: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '.'
|
|
43
|
+
},
|
|
44
|
+
groupSeparator: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
precision: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: null
|
|
51
|
+
},
|
|
52
|
+
value: {
|
|
53
|
+
type: [String, Number, Date],
|
|
54
|
+
default: ''
|
|
55
|
+
},
|
|
56
|
+
prefix: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ''
|
|
59
|
+
},
|
|
60
|
+
suffix: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: ''
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
type: [String, Number],
|
|
66
|
+
default: ''
|
|
67
|
+
},
|
|
68
|
+
timeIndices: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
valueStyle: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: function() {
|
|
75
|
+
return {};
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
format: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'HH:mm:ss:SSS'
|
|
81
|
+
},
|
|
82
|
+
rate: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 1000
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
created() {
|
|
88
|
+
this.branch();
|
|
89
|
+
},
|
|
90
|
+
watch: {
|
|
91
|
+
value: function() {
|
|
92
|
+
this.branch();
|
|
93
|
+
},
|
|
94
|
+
groupSeparator() {
|
|
95
|
+
this.dispose();
|
|
96
|
+
},
|
|
97
|
+
mulriple() {
|
|
98
|
+
this.dispose();
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
methods: {
|
|
102
|
+
branch() {
|
|
103
|
+
let { timeIndices, countDown, dispose} = this;
|
|
104
|
+
if (timeIndices) {
|
|
105
|
+
countDown(this.value.valueOf() || this.value);
|
|
106
|
+
} else {
|
|
107
|
+
dispose();
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
magnification(num, mulriple = 1000, groupSeparator = ',') {
|
|
111
|
+
// magnification factor
|
|
112
|
+
const level = String(mulriple).length ;
|
|
113
|
+
return num.replace(new RegExp(`(\\d)(?=(\\d{${level - 1}})+$)`, 'g'), `$1${groupSeparator}`);
|
|
114
|
+
},
|
|
115
|
+
dispose() {
|
|
116
|
+
let { value, rate, groupSeparator } = this;
|
|
117
|
+
if (!isNumber(value)) return false;
|
|
118
|
+
if (this.precision) {
|
|
119
|
+
value = value.toFixed(this.precision);
|
|
120
|
+
}
|
|
121
|
+
let [integer, decimal] = String(value).split('.');
|
|
122
|
+
// 1000 multiplying power
|
|
123
|
+
if (groupSeparator) {
|
|
124
|
+
integer = this.magnification(integer, rate, groupSeparator);
|
|
125
|
+
}
|
|
126
|
+
let result = `${integer}${decimal ? this.decimalSeparator + decimal : ''}`;
|
|
127
|
+
this.disposeValue = result;
|
|
128
|
+
return result;
|
|
129
|
+
},
|
|
130
|
+
diffDate(minuend, subtrahend) {
|
|
131
|
+
return Math.max(minuend - subtrahend, 0);
|
|
132
|
+
},
|
|
133
|
+
suspend(isStop) {
|
|
134
|
+
if (isStop) {
|
|
135
|
+
if (this.timeTask) {
|
|
136
|
+
clearInterval(this.timeTask);
|
|
137
|
+
this.timeTask = null;
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
this.branch();
|
|
141
|
+
}
|
|
142
|
+
return this.disposeValue;
|
|
143
|
+
},
|
|
144
|
+
formatTimeStr: function(time) {
|
|
145
|
+
let {format} = this;
|
|
146
|
+
const escapeRegex = /\[[^\]]*]/g;
|
|
147
|
+
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
148
|
+
const timeUnits = [
|
|
149
|
+
['Y', 1000 * 60 * 60 * 24 * 365], // years
|
|
150
|
+
['M', 1000 * 60 * 60 * 24 * 30], // months
|
|
151
|
+
['D', 1000 * 60 * 60 * 24], // days
|
|
152
|
+
['H', 1000 * 60 * 60], // hours
|
|
153
|
+
['m', 1000 * 60], // minutes
|
|
154
|
+
['s', 1000], // seconds
|
|
155
|
+
['S', 1] // million seconds
|
|
156
|
+
];
|
|
157
|
+
let formatText = reduce(
|
|
158
|
+
timeUnits,
|
|
159
|
+
(con, item) => {
|
|
160
|
+
const name = item[0];
|
|
161
|
+
return con.replace(new RegExp(`${name}+`, 'g'), (match) => {
|
|
162
|
+
let sum = chain(time).divide(item[1]).floor(0).value();
|
|
163
|
+
time -= multiply(sum, item[1]);
|
|
164
|
+
return padStart(String(sum), String(match).length, 0);
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
format
|
|
168
|
+
);
|
|
169
|
+
let index = 0;
|
|
170
|
+
return formatText.replace(escapeRegex, () => {
|
|
171
|
+
const match = keepList[index];
|
|
172
|
+
index += 1;
|
|
173
|
+
return match;
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
stopTime(time) {
|
|
177
|
+
let result = true; // stop
|
|
178
|
+
if (time) {
|
|
179
|
+
this.$emit('change', time);
|
|
180
|
+
result = false;
|
|
181
|
+
} else {
|
|
182
|
+
result = true;
|
|
183
|
+
this.suspend(true);
|
|
184
|
+
this.$emit('finish', true);
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
},
|
|
188
|
+
countDown(timeVlaue) {
|
|
189
|
+
let {REFRESH_INTERVAL, timeTask, diffDate, formatTimeStr, stopTime, suspend } = this;
|
|
190
|
+
if (timeTask) return;
|
|
191
|
+
let than = this;
|
|
192
|
+
this.timeTask = setInterval(()=> {
|
|
193
|
+
let diffTiem = diffDate(timeVlaue, Date.now());
|
|
194
|
+
than.disposeValue = formatTimeStr(diffTiem);
|
|
195
|
+
stopTime(diffTiem);
|
|
196
|
+
}, REFRESH_INTERVAL);
|
|
197
|
+
this.$once('hook:beforeDestroy', () => {
|
|
198
|
+
suspend(true);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
</script>
|