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,900 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="el-select"
|
|
4
|
+
:class="[selectSize ? 'el-select--' + selectSize : '']"
|
|
5
|
+
@click.stop="toggleMenu"
|
|
6
|
+
v-clickoutside="handleClose">
|
|
7
|
+
<div
|
|
8
|
+
class="el-select__tags"
|
|
9
|
+
v-if="multiple"
|
|
10
|
+
ref="tags"
|
|
11
|
+
:style="{ 'max-width': inputWidth - 32 + 'px', width: '100%' }">
|
|
12
|
+
<span v-if="collapseTags && selected.length">
|
|
13
|
+
<el-tag
|
|
14
|
+
:closable="!selectDisabled"
|
|
15
|
+
:size="collapseTagSize"
|
|
16
|
+
:hit="selected[0].hitState"
|
|
17
|
+
type="info"
|
|
18
|
+
@close="deleteTag($event, selected[0])"
|
|
19
|
+
disable-transitions>
|
|
20
|
+
<span class="el-select__tags-text">{{ selected[0].currentLabel }}</span>
|
|
21
|
+
</el-tag>
|
|
22
|
+
<el-tag
|
|
23
|
+
v-if="selected.length > 1"
|
|
24
|
+
:closable="false"
|
|
25
|
+
:size="collapseTagSize"
|
|
26
|
+
type="info"
|
|
27
|
+
disable-transitions>
|
|
28
|
+
<span class="el-select__tags-text">+ {{ selected.length - 1 }}</span>
|
|
29
|
+
</el-tag>
|
|
30
|
+
</span>
|
|
31
|
+
<transition-group @after-leave="resetInputHeight" v-if="!collapseTags">
|
|
32
|
+
<el-tag
|
|
33
|
+
v-for="item in selected"
|
|
34
|
+
:key="getValueKey(item)"
|
|
35
|
+
:closable="!selectDisabled"
|
|
36
|
+
:size="collapseTagSize"
|
|
37
|
+
:hit="item.hitState"
|
|
38
|
+
type="info"
|
|
39
|
+
@close="deleteTag($event, item)"
|
|
40
|
+
disable-transitions>
|
|
41
|
+
<span class="el-select__tags-text">{{ item.currentLabel }}</span>
|
|
42
|
+
</el-tag>
|
|
43
|
+
</transition-group>
|
|
44
|
+
|
|
45
|
+
<input
|
|
46
|
+
type="text"
|
|
47
|
+
class="el-select__input"
|
|
48
|
+
:class="[selectSize ? `is-${ selectSize }` : '']"
|
|
49
|
+
:disabled="selectDisabled"
|
|
50
|
+
:autocomplete="autoComplete || autocomplete"
|
|
51
|
+
@focus="handleFocus"
|
|
52
|
+
@blur="softFocus = false"
|
|
53
|
+
@keyup="managePlaceholder"
|
|
54
|
+
@keydown="resetInputState"
|
|
55
|
+
@keydown.down.prevent="handleNavigate('next')"
|
|
56
|
+
@keydown.up.prevent="handleNavigate('prev')"
|
|
57
|
+
@keydown.enter.prevent="selectOption"
|
|
58
|
+
@keydown.esc.stop.prevent="visible = false"
|
|
59
|
+
@keydown.delete="deletePrevTag"
|
|
60
|
+
@keydown.tab="visible = false"
|
|
61
|
+
@compositionstart="handleComposition"
|
|
62
|
+
@compositionupdate="handleComposition"
|
|
63
|
+
@compositionend="handleComposition"
|
|
64
|
+
v-model="query"
|
|
65
|
+
@input="debouncedQueryChange"
|
|
66
|
+
v-if="filterable"
|
|
67
|
+
:style="{ 'flex-grow': '1', width: inputLength / (inputWidth - 32) + '%', 'max-width': inputWidth - 42 + 'px' }"
|
|
68
|
+
ref="input">
|
|
69
|
+
</div>
|
|
70
|
+
<el-input
|
|
71
|
+
ref="reference"
|
|
72
|
+
v-model="selectedLabel"
|
|
73
|
+
type="text"
|
|
74
|
+
:placeholder="currentPlaceholder"
|
|
75
|
+
:name="name"
|
|
76
|
+
:id="id"
|
|
77
|
+
:autocomplete="autoComplete || autocomplete"
|
|
78
|
+
:size="selectSize"
|
|
79
|
+
:disabled="selectDisabled"
|
|
80
|
+
:readonly="readonly"
|
|
81
|
+
:validate-event="false"
|
|
82
|
+
:class="{ 'is-focus': visible }"
|
|
83
|
+
:tabindex="(multiple && filterable) ? '-1' : null"
|
|
84
|
+
@focus="handleFocus"
|
|
85
|
+
@blur="handleBlur"
|
|
86
|
+
@input="debouncedOnInputChange"
|
|
87
|
+
@keydown.native.down.stop.prevent="handleNavigate('next')"
|
|
88
|
+
@keydown.native.up.stop.prevent="handleNavigate('prev')"
|
|
89
|
+
@keydown.native.enter.prevent="selectOption"
|
|
90
|
+
@keydown.native.esc.stop.prevent="visible = false"
|
|
91
|
+
@keydown.native.tab="visible = false"
|
|
92
|
+
@compositionstart="handleComposition"
|
|
93
|
+
@compositionupdate="handleComposition"
|
|
94
|
+
@compositionend="handleComposition"
|
|
95
|
+
@mouseenter.native="inputHovering = true"
|
|
96
|
+
@mouseleave.native="inputHovering = false">
|
|
97
|
+
<template slot="prefix" v-if="$slots.prefix">
|
|
98
|
+
<slot name="prefix"></slot>
|
|
99
|
+
</template>
|
|
100
|
+
<template slot="suffix">
|
|
101
|
+
<i v-show="!showClose" :class="['el-select__caret', 'el-input__icon', 'el-icon-' + iconClass]"></i>
|
|
102
|
+
<i v-if="showClose" class="el-select__caret el-input__icon el-icon-circle-close" @click="handleClearClick"></i>
|
|
103
|
+
</template>
|
|
104
|
+
</el-input>
|
|
105
|
+
<transition
|
|
106
|
+
name="el-zoom-in-top"
|
|
107
|
+
@before-enter="handleMenuEnter"
|
|
108
|
+
@after-leave="doDestroy">
|
|
109
|
+
<el-select-menu
|
|
110
|
+
ref="popper"
|
|
111
|
+
:append-to-body="popperAppendToBody"
|
|
112
|
+
v-show="visible && emptyText !== false">
|
|
113
|
+
<el-scrollbar
|
|
114
|
+
tag="ul"
|
|
115
|
+
wrap-class="el-select-dropdown__wrap"
|
|
116
|
+
view-class="el-select-dropdown__list"
|
|
117
|
+
ref="scrollbar"
|
|
118
|
+
:class="{ 'is-empty': !allowCreate && query && filteredOptionsCount === 0 }"
|
|
119
|
+
v-show="options.length > 0 && !loading">
|
|
120
|
+
<el-option
|
|
121
|
+
:value="query"
|
|
122
|
+
created
|
|
123
|
+
v-if="showNewOption">
|
|
124
|
+
</el-option>
|
|
125
|
+
<slot></slot>
|
|
126
|
+
</el-scrollbar>
|
|
127
|
+
<template v-if="emptyText && (!allowCreate || loading || (allowCreate && options.length === 0 ))">
|
|
128
|
+
<slot name="empty" v-if="$slots.empty"></slot>
|
|
129
|
+
<p class="el-select-dropdown__empty" v-else>
|
|
130
|
+
{{ emptyText }}
|
|
131
|
+
</p>
|
|
132
|
+
</template>
|
|
133
|
+
</el-select-menu>
|
|
134
|
+
</transition>
|
|
135
|
+
</div>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<script type="text/babel">
|
|
139
|
+
import Emitter from 'element-ui/src/mixins/emitter';
|
|
140
|
+
import Focus from 'element-ui/src/mixins/focus';
|
|
141
|
+
import Locale from 'element-ui/src/mixins/locale';
|
|
142
|
+
import ElInput from 'element-ui/packages/input';
|
|
143
|
+
import ElSelectMenu from './select-dropdown.vue';
|
|
144
|
+
import ElOption from './option.vue';
|
|
145
|
+
import ElTag from 'element-ui/packages/tag';
|
|
146
|
+
import ElScrollbar from 'element-ui/packages/scrollbar';
|
|
147
|
+
import debounce from 'throttle-debounce/debounce';
|
|
148
|
+
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
|
149
|
+
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
|
|
150
|
+
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
|
|
151
|
+
import { getValueByPath, valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
|
|
152
|
+
import NavigationMixin from './navigation-mixin';
|
|
153
|
+
import { isKorean } from 'element-ui/src/utils/shared';
|
|
154
|
+
|
|
155
|
+
export default {
|
|
156
|
+
mixins: [Emitter, Locale, Focus('reference'), NavigationMixin],
|
|
157
|
+
|
|
158
|
+
name: 'ElSelect',
|
|
159
|
+
|
|
160
|
+
componentName: 'ElSelect',
|
|
161
|
+
|
|
162
|
+
inject: {
|
|
163
|
+
elForm: {
|
|
164
|
+
default: ''
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
elFormItem: {
|
|
168
|
+
default: ''
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
provide() {
|
|
173
|
+
return {
|
|
174
|
+
'select': this
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
computed: {
|
|
179
|
+
_elFormItemSize() {
|
|
180
|
+
return (this.elFormItem || {}).elFormItemSize;
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
readonly() {
|
|
184
|
+
return !this.filterable || this.multiple || (!isIE() && !isEdge() && !this.visible);
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
showClose() {
|
|
188
|
+
let hasValue = this.multiple
|
|
189
|
+
? Array.isArray(this.value) && this.value.length > 0
|
|
190
|
+
: this.value !== undefined && this.value !== null && this.value !== '';
|
|
191
|
+
let criteria = this.clearable &&
|
|
192
|
+
!this.selectDisabled &&
|
|
193
|
+
this.inputHovering &&
|
|
194
|
+
hasValue;
|
|
195
|
+
return criteria;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
iconClass() {
|
|
199
|
+
return this.remote && this.filterable ? '' : (this.visible ? 'arrow-up is-reverse' : 'arrow-up');
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
debounce() {
|
|
203
|
+
return this.remote ? 300 : 0;
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
emptyText() {
|
|
207
|
+
if (this.loading) {
|
|
208
|
+
return this.loadingText || this.t('el.select.loading');
|
|
209
|
+
} else {
|
|
210
|
+
if (this.remote && this.query === '' && this.options.length === 0) return false;
|
|
211
|
+
if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
|
|
212
|
+
return this.noMatchText || this.t('el.select.noMatch');
|
|
213
|
+
}
|
|
214
|
+
if (this.options.length === 0) {
|
|
215
|
+
return this.noDataText || this.t('el.select.noData');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
showNewOption() {
|
|
222
|
+
let hasExistingOption = this.options.filter(option => !option.created)
|
|
223
|
+
.some(option => option.currentLabel === this.query);
|
|
224
|
+
return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
selectSize() {
|
|
228
|
+
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
selectDisabled() {
|
|
232
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
collapseTagSize() {
|
|
236
|
+
return ['small', 'mini'].indexOf(this.selectSize) > -1
|
|
237
|
+
? 'mini'
|
|
238
|
+
: 'small';
|
|
239
|
+
},
|
|
240
|
+
propPlaceholder() {
|
|
241
|
+
return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
components: {
|
|
246
|
+
ElInput,
|
|
247
|
+
ElSelectMenu,
|
|
248
|
+
ElOption,
|
|
249
|
+
ElTag,
|
|
250
|
+
ElScrollbar
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
directives: { Clickoutside },
|
|
254
|
+
|
|
255
|
+
props: {
|
|
256
|
+
name: String,
|
|
257
|
+
id: String,
|
|
258
|
+
value: {
|
|
259
|
+
required: true
|
|
260
|
+
},
|
|
261
|
+
autocomplete: {
|
|
262
|
+
type: String,
|
|
263
|
+
default: 'off'
|
|
264
|
+
},
|
|
265
|
+
/** @Deprecated in next major version */
|
|
266
|
+
autoComplete: {
|
|
267
|
+
type: String,
|
|
268
|
+
validator(val) {
|
|
269
|
+
process.env.NODE_ENV !== 'production' &&
|
|
270
|
+
console.warn('[Element Warn][Select]\'auto-complete\' property will be deprecated in next major version. please use \'autocomplete\' instead.');
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
automaticDropdown: Boolean,
|
|
275
|
+
size: String,
|
|
276
|
+
disabled: Boolean,
|
|
277
|
+
clearable: Boolean,
|
|
278
|
+
filterable: Boolean,
|
|
279
|
+
allowCreate: Boolean,
|
|
280
|
+
loading: Boolean,
|
|
281
|
+
popperClass: String,
|
|
282
|
+
remote: Boolean,
|
|
283
|
+
loadingText: String,
|
|
284
|
+
noMatchText: String,
|
|
285
|
+
noDataText: String,
|
|
286
|
+
remoteMethod: Function,
|
|
287
|
+
filterMethod: Function,
|
|
288
|
+
multiple: Boolean,
|
|
289
|
+
multipleLimit: {
|
|
290
|
+
type: Number,
|
|
291
|
+
default: 0
|
|
292
|
+
},
|
|
293
|
+
placeholder: {
|
|
294
|
+
type: String,
|
|
295
|
+
required: false
|
|
296
|
+
},
|
|
297
|
+
defaultFirstOption: Boolean,
|
|
298
|
+
reserveKeyword: Boolean,
|
|
299
|
+
valueKey: {
|
|
300
|
+
type: String,
|
|
301
|
+
default: 'value'
|
|
302
|
+
},
|
|
303
|
+
collapseTags: Boolean,
|
|
304
|
+
popperAppendToBody: {
|
|
305
|
+
type: Boolean,
|
|
306
|
+
default: true
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
data() {
|
|
311
|
+
return {
|
|
312
|
+
options: [],
|
|
313
|
+
cachedOptions: [],
|
|
314
|
+
createdLabel: null,
|
|
315
|
+
createdSelected: false,
|
|
316
|
+
selected: this.multiple ? [] : {},
|
|
317
|
+
inputLength: 20,
|
|
318
|
+
inputWidth: 0,
|
|
319
|
+
initialInputHeight: 0,
|
|
320
|
+
cachedPlaceHolder: '',
|
|
321
|
+
optionsCount: 0,
|
|
322
|
+
filteredOptionsCount: 0,
|
|
323
|
+
visible: false,
|
|
324
|
+
softFocus: false,
|
|
325
|
+
selectedLabel: '',
|
|
326
|
+
hoverIndex: -1,
|
|
327
|
+
query: '',
|
|
328
|
+
previousQuery: null,
|
|
329
|
+
inputHovering: false,
|
|
330
|
+
currentPlaceholder: '',
|
|
331
|
+
menuVisibleOnFocus: false,
|
|
332
|
+
isOnComposition: false,
|
|
333
|
+
isSilentBlur: false
|
|
334
|
+
};
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
watch: {
|
|
338
|
+
selectDisabled() {
|
|
339
|
+
this.$nextTick(() => {
|
|
340
|
+
this.resetInputHeight();
|
|
341
|
+
});
|
|
342
|
+
},
|
|
343
|
+
|
|
344
|
+
propPlaceholder(val) {
|
|
345
|
+
this.cachedPlaceHolder = this.currentPlaceholder = val;
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
value(val, oldVal) {
|
|
349
|
+
if (this.multiple) {
|
|
350
|
+
this.resetInputHeight();
|
|
351
|
+
if ((val && val.length > 0) || (this.$refs.input && this.query !== '')) {
|
|
352
|
+
this.currentPlaceholder = '';
|
|
353
|
+
} else {
|
|
354
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
355
|
+
}
|
|
356
|
+
if (this.filterable && !this.reserveKeyword) {
|
|
357
|
+
this.query = '';
|
|
358
|
+
this.handleQueryChange(this.query);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
this.setSelected();
|
|
362
|
+
if (this.filterable && !this.multiple) {
|
|
363
|
+
this.inputLength = 20;
|
|
364
|
+
}
|
|
365
|
+
if (!valueEquals(val, oldVal)) {
|
|
366
|
+
this.dispatch('ElFormItem', 'el.form.change', val);
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
visible(val) {
|
|
371
|
+
if (!val) {
|
|
372
|
+
this.broadcast('ElSelectDropdown', 'destroyPopper');
|
|
373
|
+
if (this.$refs.input) {
|
|
374
|
+
this.$refs.input.blur();
|
|
375
|
+
}
|
|
376
|
+
this.query = '';
|
|
377
|
+
this.previousQuery = null;
|
|
378
|
+
this.selectedLabel = '';
|
|
379
|
+
this.inputLength = 20;
|
|
380
|
+
this.menuVisibleOnFocus = false;
|
|
381
|
+
this.resetHoverIndex();
|
|
382
|
+
this.$nextTick(() => {
|
|
383
|
+
if (this.$refs.input &&
|
|
384
|
+
this.$refs.input.value === '' &&
|
|
385
|
+
this.selected.length === 0) {
|
|
386
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
if (!this.multiple) {
|
|
390
|
+
if (this.selected) {
|
|
391
|
+
if (this.filterable && this.allowCreate &&
|
|
392
|
+
this.createdSelected && this.createdLabel) {
|
|
393
|
+
this.selectedLabel = this.createdLabel;
|
|
394
|
+
} else {
|
|
395
|
+
this.selectedLabel = this.selected.currentLabel;
|
|
396
|
+
}
|
|
397
|
+
if (this.filterable) this.query = this.selectedLabel;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (this.filterable) {
|
|
401
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
this.broadcast('ElSelectDropdown', 'updatePopper');
|
|
406
|
+
if (this.filterable) {
|
|
407
|
+
this.query = this.remote ? '' : this.selectedLabel;
|
|
408
|
+
this.handleQueryChange(this.query);
|
|
409
|
+
if (this.multiple) {
|
|
410
|
+
this.$refs.input.focus();
|
|
411
|
+
} else {
|
|
412
|
+
if (!this.remote) {
|
|
413
|
+
this.broadcast('ElOption', 'queryChange', '');
|
|
414
|
+
this.broadcast('ElOptionGroup', 'queryChange');
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (this.selectedLabel) {
|
|
418
|
+
this.currentPlaceholder = this.selectedLabel;
|
|
419
|
+
this.selectedLabel = '';
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
this.$emit('visible-change', val);
|
|
425
|
+
},
|
|
426
|
+
|
|
427
|
+
options() {
|
|
428
|
+
if (this.$isServer) return;
|
|
429
|
+
this.$nextTick(() => {
|
|
430
|
+
this.broadcast('ElSelectDropdown', 'updatePopper');
|
|
431
|
+
});
|
|
432
|
+
if (this.multiple) {
|
|
433
|
+
this.resetInputHeight();
|
|
434
|
+
}
|
|
435
|
+
let inputs = this.$el.querySelectorAll('input');
|
|
436
|
+
if ([].indexOf.call(inputs, document.activeElement) === -1) {
|
|
437
|
+
this.setSelected();
|
|
438
|
+
}
|
|
439
|
+
if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
|
|
440
|
+
this.checkDefaultFirstOption();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
methods: {
|
|
446
|
+
handleNavigate(direction) {
|
|
447
|
+
if (this.isOnComposition) return;
|
|
448
|
+
|
|
449
|
+
this.navigateOptions(direction);
|
|
450
|
+
},
|
|
451
|
+
handleComposition(event) {
|
|
452
|
+
const text = event.target.value;
|
|
453
|
+
if (event.type === 'compositionend') {
|
|
454
|
+
this.isOnComposition = false;
|
|
455
|
+
this.$nextTick(_ => this.handleQueryChange(text));
|
|
456
|
+
} else {
|
|
457
|
+
const lastCharacter = text[text.length - 1] || '';
|
|
458
|
+
this.isOnComposition = !isKorean(lastCharacter);
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
handleQueryChange(val) {
|
|
462
|
+
if (this.previousQuery === val || this.isOnComposition) return;
|
|
463
|
+
if (
|
|
464
|
+
this.previousQuery === null &&
|
|
465
|
+
(typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')
|
|
466
|
+
) {
|
|
467
|
+
this.previousQuery = val;
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
this.previousQuery = val;
|
|
471
|
+
this.$nextTick(() => {
|
|
472
|
+
if (this.visible) this.broadcast('ElSelectDropdown', 'updatePopper');
|
|
473
|
+
});
|
|
474
|
+
this.hoverIndex = -1;
|
|
475
|
+
if (this.multiple && this.filterable) {
|
|
476
|
+
this.$nextTick(() => {
|
|
477
|
+
const length = this.$refs.input.value.length * 15 + 20;
|
|
478
|
+
this.inputLength = this.collapseTags ? Math.min(50, length) : length;
|
|
479
|
+
this.managePlaceholder();
|
|
480
|
+
this.resetInputHeight();
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
if (this.remote && typeof this.remoteMethod === 'function') {
|
|
484
|
+
this.hoverIndex = -1;
|
|
485
|
+
this.remoteMethod(val);
|
|
486
|
+
} else if (typeof this.filterMethod === 'function') {
|
|
487
|
+
this.filterMethod(val);
|
|
488
|
+
this.broadcast('ElOptionGroup', 'queryChange');
|
|
489
|
+
} else {
|
|
490
|
+
this.filteredOptionsCount = this.optionsCount;
|
|
491
|
+
this.broadcast('ElOption', 'queryChange', val);
|
|
492
|
+
this.broadcast('ElOptionGroup', 'queryChange');
|
|
493
|
+
}
|
|
494
|
+
if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
|
|
495
|
+
this.checkDefaultFirstOption();
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
|
|
499
|
+
scrollToOption(option) {
|
|
500
|
+
const target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
|
|
501
|
+
if (this.$refs.popper && target) {
|
|
502
|
+
const menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
|
|
503
|
+
scrollIntoView(menu, target);
|
|
504
|
+
}
|
|
505
|
+
this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
|
|
506
|
+
},
|
|
507
|
+
|
|
508
|
+
handleMenuEnter() {
|
|
509
|
+
this.$nextTick(() => this.scrollToOption(this.selected));
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
emitChange(val) {
|
|
513
|
+
if (!valueEquals(this.value, val)) {
|
|
514
|
+
this.$emit('change', val);
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
|
|
518
|
+
getOption(value) {
|
|
519
|
+
let option;
|
|
520
|
+
const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
|
|
521
|
+
const isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
|
|
522
|
+
const isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
|
|
523
|
+
|
|
524
|
+
for (let i = this.cachedOptions.length - 1; i >= 0; i--) {
|
|
525
|
+
const cachedOption = this.cachedOptions[i];
|
|
526
|
+
const isEqual = isObject
|
|
527
|
+
? getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey)
|
|
528
|
+
: cachedOption.value === value;
|
|
529
|
+
if (isEqual) {
|
|
530
|
+
option = cachedOption;
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (option) return option;
|
|
535
|
+
const label = (!isObject && !isNull && !isUndefined)
|
|
536
|
+
? String(value) : '';
|
|
537
|
+
let newOption = {
|
|
538
|
+
value: value,
|
|
539
|
+
currentLabel: label
|
|
540
|
+
};
|
|
541
|
+
if (this.multiple) {
|
|
542
|
+
newOption.hitState = false;
|
|
543
|
+
}
|
|
544
|
+
return newOption;
|
|
545
|
+
},
|
|
546
|
+
|
|
547
|
+
setSelected() {
|
|
548
|
+
if (!this.multiple) {
|
|
549
|
+
let option = this.getOption(this.value);
|
|
550
|
+
if (option.created) {
|
|
551
|
+
this.createdLabel = option.currentLabel;
|
|
552
|
+
this.createdSelected = true;
|
|
553
|
+
} else {
|
|
554
|
+
this.createdSelected = false;
|
|
555
|
+
}
|
|
556
|
+
this.selectedLabel = option.currentLabel;
|
|
557
|
+
this.selected = option;
|
|
558
|
+
if (this.filterable) this.query = this.selectedLabel;
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
let result = [];
|
|
562
|
+
if (Array.isArray(this.value)) {
|
|
563
|
+
this.value.forEach(value => {
|
|
564
|
+
result.push(this.getOption(value));
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
this.selected = result;
|
|
568
|
+
this.$nextTick(() => {
|
|
569
|
+
this.resetInputHeight();
|
|
570
|
+
});
|
|
571
|
+
},
|
|
572
|
+
|
|
573
|
+
handleFocus(event) {
|
|
574
|
+
if (!this.softFocus) {
|
|
575
|
+
if (this.automaticDropdown || this.filterable) {
|
|
576
|
+
if (this.filterable && !this.visible) {
|
|
577
|
+
this.menuVisibleOnFocus = true;
|
|
578
|
+
}
|
|
579
|
+
this.visible = true;
|
|
580
|
+
}
|
|
581
|
+
this.$emit('focus', event);
|
|
582
|
+
} else {
|
|
583
|
+
this.softFocus = false;
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
|
|
587
|
+
blur() {
|
|
588
|
+
this.visible = false;
|
|
589
|
+
this.$refs.reference.blur();
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
handleBlur(event) {
|
|
593
|
+
setTimeout(() => {
|
|
594
|
+
if (this.isSilentBlur) {
|
|
595
|
+
this.isSilentBlur = false;
|
|
596
|
+
} else {
|
|
597
|
+
this.$emit('blur', event);
|
|
598
|
+
}
|
|
599
|
+
}, 50);
|
|
600
|
+
this.softFocus = false;
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
handleClearClick(event) {
|
|
604
|
+
this.deleteSelected(event);
|
|
605
|
+
},
|
|
606
|
+
|
|
607
|
+
doDestroy() {
|
|
608
|
+
this.$refs.popper && this.$refs.popper.doDestroy();
|
|
609
|
+
},
|
|
610
|
+
|
|
611
|
+
handleClose() {
|
|
612
|
+
this.visible = false;
|
|
613
|
+
},
|
|
614
|
+
|
|
615
|
+
toggleLastOptionHitState(hit) {
|
|
616
|
+
if (!Array.isArray(this.selected)) return;
|
|
617
|
+
const option = this.selected[this.selected.length - 1];
|
|
618
|
+
if (!option) return;
|
|
619
|
+
|
|
620
|
+
if (hit === true || hit === false) {
|
|
621
|
+
option.hitState = hit;
|
|
622
|
+
return hit;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
option.hitState = !option.hitState;
|
|
626
|
+
return option.hitState;
|
|
627
|
+
},
|
|
628
|
+
|
|
629
|
+
deletePrevTag(e) {
|
|
630
|
+
if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
|
|
631
|
+
const value = this.value.slice();
|
|
632
|
+
value.pop();
|
|
633
|
+
this.$emit('input', value);
|
|
634
|
+
this.emitChange(value);
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
|
|
638
|
+
managePlaceholder() {
|
|
639
|
+
if (this.currentPlaceholder !== '') {
|
|
640
|
+
this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
|
|
644
|
+
resetInputState(e) {
|
|
645
|
+
if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
|
|
646
|
+
this.inputLength = this.$refs.input.value.length * 15 + 20;
|
|
647
|
+
this.resetInputHeight();
|
|
648
|
+
},
|
|
649
|
+
|
|
650
|
+
resetInputHeight() {
|
|
651
|
+
if (this.collapseTags && !this.filterable) return;
|
|
652
|
+
this.$nextTick(() => {
|
|
653
|
+
if (!this.$refs.reference) return;
|
|
654
|
+
let inputChildNodes = this.$refs.reference.$el.childNodes;
|
|
655
|
+
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
|
|
656
|
+
const tags = this.$refs.tags;
|
|
657
|
+
const tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
|
|
658
|
+
const sizeInMap = this.initialInputHeight || 40;
|
|
659
|
+
input.style.height = this.selected.length === 0
|
|
660
|
+
? sizeInMap + 'px'
|
|
661
|
+
: Math.max(
|
|
662
|
+
tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
|
|
663
|
+
sizeInMap
|
|
664
|
+
) + 'px';
|
|
665
|
+
if (this.visible && this.emptyText !== false) {
|
|
666
|
+
this.broadcast('ElSelectDropdown', 'updatePopper');
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
},
|
|
670
|
+
|
|
671
|
+
resetHoverIndex() {
|
|
672
|
+
setTimeout(() => {
|
|
673
|
+
if (!this.multiple) {
|
|
674
|
+
this.hoverIndex = this.options.indexOf(this.selected);
|
|
675
|
+
} else {
|
|
676
|
+
if (this.selected.length > 0) {
|
|
677
|
+
this.hoverIndex = Math.min.apply(null, this.selected.map(item => this.options.indexOf(item)));
|
|
678
|
+
} else {
|
|
679
|
+
this.hoverIndex = -1;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}, 300);
|
|
683
|
+
},
|
|
684
|
+
|
|
685
|
+
handleOptionSelect(option, byClick) {
|
|
686
|
+
if (this.multiple) {
|
|
687
|
+
const value = (this.value || []).slice();
|
|
688
|
+
const optionIndex = this.getValueIndex(value, option.value);
|
|
689
|
+
if (optionIndex > -1) {
|
|
690
|
+
value.splice(optionIndex, 1);
|
|
691
|
+
} else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
|
|
692
|
+
value.push(option.value);
|
|
693
|
+
}
|
|
694
|
+
this.$emit('input', value);
|
|
695
|
+
this.emitChange(value);
|
|
696
|
+
if (option.created) {
|
|
697
|
+
this.query = '';
|
|
698
|
+
this.handleQueryChange('');
|
|
699
|
+
this.inputLength = 20;
|
|
700
|
+
}
|
|
701
|
+
if (this.filterable) this.$refs.input.focus();
|
|
702
|
+
} else {
|
|
703
|
+
this.$emit('input', option.value);
|
|
704
|
+
this.emitChange(option.value);
|
|
705
|
+
this.visible = false;
|
|
706
|
+
}
|
|
707
|
+
this.isSilentBlur = byClick;
|
|
708
|
+
this.setSoftFocus();
|
|
709
|
+
if (this.visible) return;
|
|
710
|
+
this.$nextTick(() => {
|
|
711
|
+
this.scrollToOption(option);
|
|
712
|
+
});
|
|
713
|
+
},
|
|
714
|
+
|
|
715
|
+
setSoftFocus() {
|
|
716
|
+
this.softFocus = true;
|
|
717
|
+
const input = this.$refs.input || this.$refs.reference;
|
|
718
|
+
if (input) {
|
|
719
|
+
input.focus();
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
|
|
723
|
+
getValueIndex(arr = [], value) {
|
|
724
|
+
const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
|
|
725
|
+
if (!isObject) {
|
|
726
|
+
return arr.indexOf(value);
|
|
727
|
+
} else {
|
|
728
|
+
const valueKey = this.valueKey;
|
|
729
|
+
let index = -1;
|
|
730
|
+
arr.some((item, i) => {
|
|
731
|
+
if (getValueByPath(item, valueKey) === getValueByPath(value, valueKey)) {
|
|
732
|
+
index = i;
|
|
733
|
+
return true;
|
|
734
|
+
}
|
|
735
|
+
return false;
|
|
736
|
+
});
|
|
737
|
+
return index;
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
|
|
741
|
+
toggleMenu() {
|
|
742
|
+
if (!this.selectDisabled) {
|
|
743
|
+
if (this.menuVisibleOnFocus) {
|
|
744
|
+
this.menuVisibleOnFocus = false;
|
|
745
|
+
} else {
|
|
746
|
+
this.visible = !this.visible;
|
|
747
|
+
}
|
|
748
|
+
if (this.visible) {
|
|
749
|
+
(this.$refs.input || this.$refs.reference).focus();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
|
|
754
|
+
selectOption() {
|
|
755
|
+
if (!this.visible) {
|
|
756
|
+
this.toggleMenu();
|
|
757
|
+
} else {
|
|
758
|
+
if (this.options[this.hoverIndex]) {
|
|
759
|
+
this.handleOptionSelect(this.options[this.hoverIndex]);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
deleteSelected(event) {
|
|
765
|
+
event.stopPropagation();
|
|
766
|
+
const value = this.multiple ? [] : '';
|
|
767
|
+
this.$emit('input', value);
|
|
768
|
+
this.emitChange(value);
|
|
769
|
+
this.visible = false;
|
|
770
|
+
this.$emit('clear');
|
|
771
|
+
},
|
|
772
|
+
|
|
773
|
+
deleteTag(event, tag) {
|
|
774
|
+
let index = this.selected.indexOf(tag);
|
|
775
|
+
if (index > -1 && !this.selectDisabled) {
|
|
776
|
+
const value = this.value.slice();
|
|
777
|
+
value.splice(index, 1);
|
|
778
|
+
this.$emit('input', value);
|
|
779
|
+
this.emitChange(value);
|
|
780
|
+
this.$emit('remove-tag', tag.value);
|
|
781
|
+
}
|
|
782
|
+
event.stopPropagation();
|
|
783
|
+
},
|
|
784
|
+
|
|
785
|
+
onInputChange() {
|
|
786
|
+
if (this.filterable && this.query !== this.selectedLabel) {
|
|
787
|
+
this.query = this.selectedLabel;
|
|
788
|
+
this.handleQueryChange(this.query);
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
|
|
792
|
+
onOptionDestroy(index) {
|
|
793
|
+
if (index > -1) {
|
|
794
|
+
this.optionsCount--;
|
|
795
|
+
this.filteredOptionsCount--;
|
|
796
|
+
this.options.splice(index, 1);
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
|
|
800
|
+
resetInputWidth() {
|
|
801
|
+
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
|
|
802
|
+
},
|
|
803
|
+
|
|
804
|
+
handleResize() {
|
|
805
|
+
this.resetInputWidth();
|
|
806
|
+
if (this.multiple) this.resetInputHeight();
|
|
807
|
+
},
|
|
808
|
+
|
|
809
|
+
checkDefaultFirstOption() {
|
|
810
|
+
this.hoverIndex = -1;
|
|
811
|
+
// highlight the created option
|
|
812
|
+
let hasCreated = false;
|
|
813
|
+
for (let i = this.options.length - 1; i >= 0; i--) {
|
|
814
|
+
if (this.options[i].created) {
|
|
815
|
+
hasCreated = true;
|
|
816
|
+
this.hoverIndex = i;
|
|
817
|
+
break;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
if (hasCreated) return;
|
|
821
|
+
for (let i = 0; i !== this.options.length; ++i) {
|
|
822
|
+
const option = this.options[i];
|
|
823
|
+
if (this.query) {
|
|
824
|
+
// highlight first options that passes the filter
|
|
825
|
+
if (!option.disabled && !option.groupDisabled && option.visible) {
|
|
826
|
+
this.hoverIndex = i;
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
} else {
|
|
830
|
+
// highlight currently selected option
|
|
831
|
+
if (option.itemSelected) {
|
|
832
|
+
this.hoverIndex = i;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
|
|
839
|
+
getValueKey(item) {
|
|
840
|
+
if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
|
|
841
|
+
return item.value;
|
|
842
|
+
} else {
|
|
843
|
+
return getValueByPath(item.value, this.valueKey);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
|
|
848
|
+
created() {
|
|
849
|
+
this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
|
|
850
|
+
if (this.multiple && !Array.isArray(this.value)) {
|
|
851
|
+
this.$emit('input', []);
|
|
852
|
+
}
|
|
853
|
+
if (!this.multiple && Array.isArray(this.value)) {
|
|
854
|
+
this.$emit('input', '');
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
this.debouncedOnInputChange = debounce(this.debounce, () => {
|
|
858
|
+
this.onInputChange();
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
this.debouncedQueryChange = debounce(this.debounce, (e) => {
|
|
862
|
+
this.handleQueryChange(e.target.value);
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
this.$on('handleOptionClick', this.handleOptionSelect);
|
|
866
|
+
this.$on('setSelected', this.setSelected);
|
|
867
|
+
},
|
|
868
|
+
|
|
869
|
+
mounted() {
|
|
870
|
+
if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
|
|
871
|
+
this.currentPlaceholder = '';
|
|
872
|
+
}
|
|
873
|
+
addResizeListener(this.$el, this.handleResize);
|
|
874
|
+
|
|
875
|
+
const reference = this.$refs.reference;
|
|
876
|
+
if (reference && reference.$el) {
|
|
877
|
+
const sizeMap = {
|
|
878
|
+
medium: 36,
|
|
879
|
+
small: 32,
|
|
880
|
+
mini: 28
|
|
881
|
+
};
|
|
882
|
+
const input = reference.$el.querySelector('input');
|
|
883
|
+
this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
|
|
884
|
+
}
|
|
885
|
+
if (this.remote && this.multiple) {
|
|
886
|
+
this.resetInputHeight();
|
|
887
|
+
}
|
|
888
|
+
this.$nextTick(() => {
|
|
889
|
+
if (reference && reference.$el) {
|
|
890
|
+
this.inputWidth = reference.$el.getBoundingClientRect().width;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
this.setSelected();
|
|
894
|
+
},
|
|
895
|
+
|
|
896
|
+
beforeDestroy() {
|
|
897
|
+
if (this.$el && this.handleResize) removeResizeListener(this.$el, this.handleResize);
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
</script>
|