mazey-element-ui 2.0.1 → 2.15.16
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/LICENSE +2 -2
- package/README.md +71 -68
- package/lib/alert.js +271 -262
- package/lib/aside.js +134 -200
- package/lib/autocomplete.js +500 -443
- package/lib/avatar.js +284 -0
- package/lib/backtop.js +336 -0
- package/lib/badge.js +188 -221
- package/lib/breadcrumb-item.js +176 -226
- package/lib/breadcrumb.js +150 -213
- package/lib/button-group.js +121 -190
- package/lib/button.js +213 -268
- package/lib/calendar.js +801 -0
- package/lib/card.js +156 -203
- package/lib/carousel-item.js +242 -264
- package/lib/carousel.js +386 -284
- package/lib/cascader-panel.js +1323 -0
- package/lib/cascader.js +1000 -1116
- package/lib/checkbox-button.js +388 -327
- package/lib/checkbox-group.js +168 -233
- package/lib/checkbox.js +422 -350
- package/lib/col.js +58 -112
- package/lib/collapse-item.js +335 -327
- package/lib/collapse.js +177 -246
- package/lib/color-picker.js +1128 -1231
- package/lib/container.js +144 -211
- package/lib/date-picker.js +4316 -2745
- package/lib/descriptions-item.js +88 -0
- package/lib/descriptions.js +342 -0
- package/lib/dialog.js +359 -337
- package/lib/directives/mousewheel.js +6 -12
- package/lib/directives/repeat-click.js +10 -10
- package/lib/divider.js +251 -0
- package/lib/drawer.js +523 -0
- package/lib/dropdown-item.js +175 -228
- package/lib/dropdown-menu.js +203 -253
- package/lib/dropdown.js +286 -384
- package/lib/element-ui.common.js +34136 -25458
- package/lib/empty.js +657 -0
- package/lib/footer.js +134 -200
- package/lib/form-item.js +401 -304
- package/lib/form.js +278 -297
- package/lib/header.js +134 -200
- package/lib/icon.js +123 -193
- package/lib/image.js +1005 -0
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +219 -0
- package/lib/input-number.js +442 -386
- package/lib/input.js +682 -512
- package/lib/link.js +267 -0
- package/lib/loading.js +278 -377
- package/lib/locale/format.js +14 -25
- package/lib/locale/index.js +19 -33
- package/lib/locale/lang/af-ZA.js +29 -8
- package/lib/locale/lang/ar.js +29 -14
- package/lib/locale/lang/az.js +127 -0
- package/lib/locale/lang/bg.js +35 -11
- package/lib/locale/lang/bn.js +126 -0
- package/lib/locale/lang/ca.js +24 -9
- package/lib/locale/lang/cs-CZ.js +19 -3
- package/lib/locale/lang/da.js +19 -3
- package/lib/locale/lang/de.js +19 -3
- package/lib/locale/lang/ee.js +24 -8
- package/lib/locale/lang/el.js +20 -4
- package/lib/locale/lang/en.js +25 -7
- package/lib/locale/lang/eo.js +128 -0
- package/lib/locale/lang/es.js +22 -7
- package/lib/locale/lang/eu.js +131 -0
- package/lib/locale/lang/fa.js +24 -8
- package/lib/locale/lang/fi.js +40 -24
- package/lib/locale/lang/fr.js +21 -4
- package/lib/locale/lang/he.js +29 -8
- package/lib/locale/lang/hr.js +131 -0
- package/lib/locale/lang/hu.js +20 -4
- package/lib/locale/lang/hy-AM.js +128 -0
- package/lib/locale/lang/id.js +23 -8
- package/lib/locale/lang/is.js +127 -0
- package/lib/locale/lang/it.js +21 -6
- package/lib/locale/lang/ja.js +19 -3
- package/lib/locale/lang/kg.js +128 -0
- package/lib/locale/lang/km.js +21 -6
- package/lib/locale/lang/ko.js +19 -3
- package/lib/locale/lang/ku.js +19 -3
- package/lib/locale/lang/kz.js +19 -3
- package/lib/locale/lang/lt.js +19 -3
- package/lib/locale/lang/lv.js +26 -10
- package/lib/locale/lang/mn.js +19 -3
- package/lib/locale/lang/ms.js +126 -0
- package/lib/locale/lang/nb-NO.js +28 -13
- package/lib/locale/lang/nl.js +19 -3
- package/lib/locale/lang/pl.js +19 -3
- package/lib/locale/lang/pt-br.js +18 -3
- package/lib/locale/lang/pt.js +35 -11
- package/lib/locale/lang/ro.js +19 -3
- package/lib/locale/lang/ru-RU.js +20 -5
- package/lib/locale/lang/si.js +130 -0
- package/lib/locale/lang/sk.js +23 -8
- package/lib/locale/lang/sl.js +26 -10
- package/lib/locale/lang/sr-Latn.js +127 -0
- package/lib/locale/lang/sr.js +131 -0
- package/lib/locale/lang/sv-SE.js +34 -15
- package/lib/locale/lang/sw.js +130 -0
- package/lib/locale/lang/ta.js +31 -9
- package/lib/locale/lang/th.js +30 -12
- package/lib/locale/lang/tk.js +27 -7
- package/lib/locale/lang/tr-TR.js +20 -4
- package/lib/locale/lang/ua.js +20 -5
- package/lib/locale/lang/ug-CN.js +22 -7
- package/lib/locale/lang/uz-UZ.js +127 -0
- package/lib/locale/lang/vi.js +23 -8
- package/lib/locale/lang/zh-CN.js +18 -3
- package/lib/locale/lang/zh-TW.js +25 -6
- package/lib/main.js +123 -192
- package/lib/menu-item-group.js +164 -225
- package/lib/menu-item.js +300 -333
- package/lib/menu.js +401 -576
- package/lib/message-box.js +730 -614
- package/lib/message.js +289 -327
- package/lib/mixins/emitter.js +2 -4
- package/lib/mixins/focus.js +3 -4
- package/lib/mixins/locale.js +5 -7
- package/lib/mixins/migrating.js +19 -21
- package/lib/notification.js +366 -394
- package/lib/option-group.js +198 -250
- package/lib/option.js +247 -291
- package/lib/page-header.js +248 -0
- package/lib/pagination.js +485 -635
- package/lib/popconfirm.js +381 -0
- package/lib/popover.js +361 -396
- package/lib/progress.js +387 -261
- package/lib/radio-button.js +319 -309
- package/lib/radio-group.js +224 -282
- package/lib/radio.js +347 -328
- package/lib/rate.js +286 -305
- package/lib/result.js +513 -0
- package/lib/row.js +59 -110
- package/lib/scrollbar.js +234 -344
- package/lib/select.js +1041 -806
- package/lib/skeleton-item.js +278 -0
- package/lib/skeleton.js +308 -0
- package/lib/slider.js +608 -467
- package/lib/spinner.js +160 -207
- package/lib/statistic.js +462 -0
- package/lib/step.js +270 -262
- package/lib/steps.js +198 -261
- package/lib/submenu.js +318 -420
- package/lib/switch.js +311 -281
- package/lib/tab-pane.js +185 -245
- package/lib/table-column.js +667 -414
- package/lib/table.js +3388 -2770
- package/lib/tabs.js +577 -648
- package/lib/tag.js +160 -227
- package/lib/theme-chalk/alert.css +1 -1
- package/lib/theme-chalk/aside.css +1 -1
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/avatar.css +1 -0
- package/lib/theme-chalk/backtop.css +1 -0
- package/lib/theme-chalk/badge.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/breadcrumb.css +1 -1
- package/lib/theme-chalk/button.css +1 -1
- package/lib/theme-chalk/calendar.css +1 -0
- package/lib/theme-chalk/card.css +1 -1
- package/lib/theme-chalk/carousel-item.css +1 -1
- package/lib/theme-chalk/carousel.css +1 -1
- package/lib/theme-chalk/cascader-panel.css +1 -0
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/checkbox.css +1 -1
- package/lib/theme-chalk/col.css +1 -1
- package/lib/theme-chalk/collapse.css +1 -1
- package/lib/theme-chalk/color-picker.css +1 -1
- package/lib/theme-chalk/container.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/descriptions-item.css +1 -0
- package/lib/theme-chalk/descriptions.css +1 -0
- package/lib/theme-chalk/dialog.css +1 -1
- package/lib/theme-chalk/display.css +1 -1
- package/lib/theme-chalk/divider.css +1 -0
- package/lib/theme-chalk/drawer.css +1 -0
- package/lib/theme-chalk/dropdown.css +1 -1
- package/lib/theme-chalk/empty.css +1 -0
- package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
- package/lib/theme-chalk/fonts/element-icons.woff +0 -0
- package/lib/theme-chalk/footer.css +1 -1
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/header.css +1 -1
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/image.css +1 -0
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/link.css +1 -0
- package/lib/theme-chalk/loading.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/menu.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/message.css +1 -1
- package/lib/theme-chalk/notification.css +1 -1
- package/lib/theme-chalk/option-group.css +1 -1
- package/lib/theme-chalk/option.css +1 -1
- package/lib/theme-chalk/page-header.css +1 -0
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/popconfirm.css +1 -0
- package/lib/theme-chalk/popover.css +1 -1
- package/lib/theme-chalk/popper.css +1 -1
- package/lib/theme-chalk/progress.css +1 -1
- package/lib/theme-chalk/radio-button.css +1 -1
- package/lib/theme-chalk/radio.css +1 -1
- package/lib/theme-chalk/rate.css +1 -1
- package/lib/theme-chalk/reset.css +1 -1
- package/lib/theme-chalk/result.css +1 -0
- package/lib/theme-chalk/row.css +1 -1
- package/lib/theme-chalk/scrollbar.css +1 -1
- package/lib/theme-chalk/select-dropdown.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/skeleton-item.css +1 -0
- package/lib/theme-chalk/skeleton.css +1 -0
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/spinner.css +1 -1
- package/lib/theme-chalk/statistic.css +1 -0
- package/lib/theme-chalk/step.css +1 -1
- package/lib/theme-chalk/steps.css +1 -1
- package/lib/theme-chalk/switch.css +1 -1
- package/lib/theme-chalk/table-column.css +1 -1
- package/lib/theme-chalk/table.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/tag.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/time-select.css +1 -1
- package/lib/theme-chalk/timeline-item.css +1 -0
- package/lib/theme-chalk/timeline.css +1 -0
- package/lib/theme-chalk/tooltip.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/theme-chalk/tree.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/time-picker.js +1548 -1348
- package/lib/time-select.js +633 -853
- package/lib/timeline-item.js +301 -0
- package/lib/timeline.js +207 -0
- package/lib/tooltip.js +166 -240
- package/lib/transfer.js +731 -639
- package/lib/transitions/collapse-transition.js +13 -31
- package/lib/tree.js +1769 -1883
- package/lib/umd/locale/af-ZA.js +35 -14
- package/lib/umd/locale/ar.js +35 -20
- package/lib/umd/locale/az.js +143 -0
- package/lib/umd/locale/bg.js +41 -17
- package/lib/umd/locale/bn.js +142 -0
- package/lib/umd/locale/ca.js +30 -15
- package/lib/umd/locale/cs-CZ.js +25 -9
- package/lib/umd/locale/da.js +25 -9
- package/lib/umd/locale/de.js +25 -9
- package/lib/umd/locale/ee.js +30 -14
- package/lib/umd/locale/el.js +26 -10
- package/lib/umd/locale/en.js +31 -13
- package/lib/umd/locale/eo.js +144 -0
- package/lib/umd/locale/es.js +28 -13
- package/lib/umd/locale/eu.js +147 -0
- package/lib/umd/locale/fa.js +30 -14
- package/lib/umd/locale/fi.js +46 -30
- package/lib/umd/locale/fr.js +27 -10
- package/lib/umd/locale/he.js +35 -14
- package/lib/umd/locale/hr.js +147 -0
- package/lib/umd/locale/hu.js +26 -10
- package/lib/umd/locale/hy-AM.js +144 -0
- package/lib/umd/locale/id.js +29 -14
- package/lib/umd/locale/is.js +143 -0
- package/lib/umd/locale/it.js +27 -12
- package/lib/umd/locale/ja.js +25 -9
- package/lib/umd/locale/kg.js +144 -0
- package/lib/umd/locale/km.js +27 -12
- package/lib/umd/locale/ko.js +25 -9
- package/lib/umd/locale/ku.js +25 -9
- package/lib/umd/locale/kz.js +25 -9
- package/lib/umd/locale/lt.js +25 -9
- package/lib/umd/locale/lv.js +32 -16
- package/lib/umd/locale/mn.js +25 -9
- package/lib/umd/locale/ms.js +142 -0
- package/lib/umd/locale/nb-NO.js +34 -19
- package/lib/umd/locale/nl.js +25 -9
- package/lib/umd/locale/pl.js +25 -9
- package/lib/umd/locale/pt-br.js +24 -9
- package/lib/umd/locale/pt.js +41 -17
- package/lib/umd/locale/ro.js +25 -9
- package/lib/umd/locale/ru-RU.js +26 -11
- package/lib/umd/locale/si.js +146 -0
- package/lib/umd/locale/sk.js +29 -14
- package/lib/umd/locale/sl.js +32 -16
- package/lib/umd/locale/sr-Latn.js +143 -0
- package/lib/umd/locale/sr.js +147 -0
- package/lib/umd/locale/sv-SE.js +40 -21
- package/lib/umd/locale/sw.js +146 -0
- package/lib/umd/locale/ta.js +37 -15
- package/lib/umd/locale/th.js +36 -18
- package/lib/umd/locale/tk.js +33 -13
- package/lib/umd/locale/tr-TR.js +26 -10
- package/lib/umd/locale/ua.js +26 -11
- package/lib/umd/locale/ug-CN.js +28 -13
- package/lib/umd/locale/uz-UZ.js +143 -0
- package/lib/umd/locale/vi.js +29 -14
- package/lib/umd/locale/zh-CN.js +24 -9
- package/lib/umd/locale/zh-TW.js +31 -12
- package/lib/upload.js +1093 -1338
- package/lib/utils/after-leave.js +19 -16
- package/lib/utils/aria-dialog.js +11 -29
- package/lib/utils/aria-utils.js +7 -15
- package/lib/utils/clickoutside.js +16 -24
- package/lib/utils/date-util.js +267 -0
- package/lib/utils/date.js +56 -52
- package/lib/utils/dom.js +57 -27
- package/lib/utils/lodash.js +9421 -0
- package/lib/utils/menu/aria-menubar.js +6 -11
- package/lib/utils/menu/aria-menuitem.js +11 -22
- package/lib/utils/menu/aria-submenu.js +7 -16
- package/lib/utils/merge.js +9 -16
- package/lib/utils/popper.js +1141 -1170
- package/lib/utils/popup/index.js +24 -76
- package/lib/utils/popup/popup-manager.js +17 -49
- package/lib/utils/resize-event.js +11 -24
- package/lib/utils/scroll-into-view.js +4 -12
- package/lib/utils/scrollbar-width.js +8 -19
- package/lib/utils/types.js +38 -0
- package/lib/utils/util.js +165 -18
- package/lib/utils/vdom.js +5 -16
- package/lib/utils/vue-popper.js +10 -31
- package/package.json +131 -139
- package/packages/alert/src/main.vue +15 -8
- package/packages/autocomplete/src/autocomplete-suggestions.vue +4 -4
- package/packages/autocomplete/src/autocomplete.vue +45 -14
- package/packages/avatar/index.js +8 -0
- package/packages/avatar/src/main.vue +107 -0
- package/packages/backtop/index.js +8 -0
- package/packages/backtop/src/main.vue +110 -0
- package/packages/badge/src/main.vue +15 -3
- package/packages/button/src/button.vue +2 -1
- package/packages/calendar/index.js +8 -0
- package/packages/calendar/src/date-table.vue +200 -0
- package/packages/calendar/src/main.vue +280 -0
- package/packages/carousel/src/item.vue +36 -12
- package/packages/carousel/src/main.vue +83 -22
- package/packages/cascader/index.js +1 -1
- package/packages/cascader/src/cascader.vue +663 -0
- package/packages/cascader-panel/index.js +8 -0
- package/packages/cascader-panel/src/cascader-menu.vue +138 -0
- package/packages/cascader-panel/src/cascader-node.vue +246 -0
- package/packages/cascader-panel/src/cascader-panel.vue +391 -0
- package/packages/cascader-panel/src/node.js +166 -0
- package/packages/cascader-panel/src/store.js +58 -0
- package/packages/checkbox/src/checkbox-button.vue +11 -3
- package/packages/checkbox/src/checkbox-group.vue +1 -1
- package/packages/checkbox/src/checkbox.vue +15 -8
- package/packages/collapse/src/collapse-item.vue +12 -11
- package/packages/color-picker/src/color.js +1 -0
- package/packages/color-picker/src/components/picker-dropdown.vue +10 -6
- package/packages/color-picker/src/components/sv-panel.vue +1 -3
- package/packages/color-picker/src/main.vue +13 -4
- package/packages/date-picker/src/basic/date-table.vue +104 -168
- package/packages/date-picker/src/basic/month-table.vue +223 -58
- package/packages/date-picker/src/basic/time-spinner.vue +31 -15
- package/packages/date-picker/src/basic/year-table.vue +16 -5
- package/packages/date-picker/src/panel/date-range.vue +105 -48
- package/packages/date-picker/src/panel/date.vue +82 -39
- package/packages/date-picker/src/panel/month-range.vue +289 -0
- package/packages/date-picker/src/panel/time-range.vue +2 -2
- package/packages/date-picker/src/panel/time-select.vue +3 -2
- package/packages/date-picker/src/panel/time.vue +2 -2
- package/packages/date-picker/src/picker/date-picker.js +3 -0
- package/packages/date-picker/src/picker.vue +87 -43
- package/packages/descriptions/index.js +8 -0
- package/packages/descriptions/src/descriptions-item.js +30 -0
- package/packages/descriptions/src/descriptions-row.js +116 -0
- package/packages/descriptions/src/index.js +180 -0
- package/packages/descriptions-item/index.js +8 -0
- package/packages/dialog/src/component.vue +35 -12
- package/packages/divider/index.js +8 -0
- package/packages/divider/src/main.vue +37 -0
- package/packages/drawer/index.js +8 -0
- package/packages/drawer/src/main.vue +205 -0
- package/packages/dropdown/src/dropdown-item.vue +4 -2
- package/packages/dropdown/src/dropdown-menu.vue +6 -3
- package/packages/dropdown/src/dropdown.vue +55 -35
- package/packages/empty/index.js +7 -0
- package/packages/empty/src/img-empty.vue +132 -0
- package/packages/empty/src/index.vue +50 -0
- package/packages/form/src/form-item.vue +76 -44
- package/packages/form/src/form.vue +59 -11
- package/packages/form/src/label-wrap.vue +78 -0
- package/packages/image/index.js +8 -0
- package/packages/image/src/image-viewer.vue +330 -0
- package/packages/image/src/main.vue +249 -0
- package/packages/infinite-scroll/index.js +8 -0
- package/packages/infinite-scroll/src/main.js +150 -0
- package/packages/input/src/input.vue +186 -75
- package/packages/input-number/src/input-number.vue +52 -25
- package/packages/link/index.js +8 -0
- package/packages/link/src/main.vue +53 -0
- package/packages/loading/src/directive.js +9 -4
- package/packages/loading/src/index.js +5 -5
- package/packages/menu/src/menu-item.vue +4 -4
- package/packages/menu/src/menu.vue +24 -10
- package/packages/menu/src/submenu.vue +26 -12
- package/packages/message/src/main.js +35 -16
- package/packages/message/src/main.vue +12 -15
- package/packages/message-box/src/main.js +6 -4
- package/packages/message-box/src/main.vue +32 -24
- package/packages/notification/src/main.js +9 -8
- package/packages/page-header/index.js +8 -0
- package/packages/page-header/src/main.vue +30 -0
- package/packages/pagination/src/pagination.js +36 -77
- package/packages/popconfirm/index.js +8 -0
- package/packages/popconfirm/src/main.vue +104 -0
- package/packages/popover/src/directive.js +5 -1
- package/packages/popover/src/main.vue +49 -31
- package/packages/progress/src/progress.vue +118 -21
- package/packages/radio/index.js +1 -1
- package/packages/radio/src/radio-button.vue +7 -3
- package/packages/radio/src/radio-group.vue +9 -3
- package/packages/radio/src/radio.vue +6 -3
- package/packages/rate/src/main.vue +36 -37
- package/packages/result/index.js +8 -0
- package/packages/result/src/icon-error.vue +13 -0
- package/packages/result/src/icon-info.vue +13 -0
- package/packages/result/src/icon-success.vue +13 -0
- package/packages/result/src/icon-warning.vue +13 -0
- package/packages/result/src/index.vue +65 -0
- package/packages/row/src/row.js +2 -5
- package/packages/scrollbar/src/bar.js +5 -1
- package/packages/scrollbar/src/main.js +3 -3
- package/packages/select/src/option-group.vue +1 -1
- package/packages/select/src/option.vue +22 -9
- package/packages/select/src/select-dropdown.vue +1 -1
- package/packages/select/src/select.vue +126 -105
- package/packages/skeleton/index.js +8 -0
- package/packages/skeleton/src/img-placeholder.vue +16 -0
- package/packages/skeleton/src/index.vue +76 -0
- package/packages/skeleton/src/item.vue +22 -0
- package/packages/skeleton-item/index.js +8 -0
- package/packages/slider/src/button.vue +6 -9
- package/packages/slider/src/main.vue +60 -32
- package/packages/slider/src/marker.js +18 -0
- package/packages/spinner/src/spinner.vue +1 -1
- package/packages/statistic/index.js +8 -0
- package/packages/statistic/src/main.vue +204 -0
- package/packages/steps/src/step.vue +5 -1
- package/packages/steps/src/steps.vue +1 -1
- package/packages/switch/src/component.vue +18 -7
- package/packages/table/src/config.js +124 -0
- package/packages/table/src/filter-panel.vue +9 -18
- package/packages/table/src/layout-observer.js +2 -2
- package/packages/table/src/store/current.js +76 -0
- package/packages/table/src/store/expand.js +65 -0
- package/packages/table/src/store/helper.js +41 -0
- package/packages/table/src/store/index.js +147 -0
- package/packages/table/src/store/tree.js +209 -0
- package/packages/table/src/store/watcher.js +381 -0
- package/packages/table/src/table-body.js +221 -166
- package/packages/table/src/table-column.js +203 -308
- package/packages/table/src/table-footer.js +75 -65
- package/packages/table/src/table-header.js +68 -77
- package/packages/table/src/table-layout.js +43 -25
- package/packages/table/src/table-row.js +101 -0
- package/packages/table/src/table.vue +155 -99
- package/packages/table/src/util.js +164 -1
- package/packages/tabs/src/tab-bar.vue +7 -7
- package/packages/tabs/src/tab-nav.vue +35 -14
- package/packages/tabs/src/tab-pane.vue +10 -18
- package/packages/tabs/src/tabs.vue +45 -22
- package/packages/tag/src/tag.vue +35 -18
- package/packages/theme-chalk/gulpfile.js +33 -0
- package/packages/theme-chalk/package.json +36 -0
- package/packages/theme-chalk/src/alert.scss +57 -15
- package/packages/theme-chalk/src/autocomplete.scss +3 -4
- package/packages/theme-chalk/src/avatar.scss +51 -0
- package/packages/theme-chalk/src/backtop.scss +22 -0
- package/packages/theme-chalk/src/badge.scss +17 -1
- package/packages/theme-chalk/src/button.scss +40 -20
- package/packages/theme-chalk/src/calendar.scss +79 -0
- package/packages/theme-chalk/src/carousel.scss +33 -6
- package/packages/theme-chalk/src/cascader-panel.scss +120 -0
- package/packages/theme-chalk/src/cascader.scss +118 -112
- package/packages/theme-chalk/src/checkbox.scss +18 -17
- package/packages/theme-chalk/src/collapse.scss +16 -9
- package/packages/theme-chalk/src/common/popup.scss +3 -2
- package/packages/theme-chalk/src/common/var.scss +500 -184
- package/packages/theme-chalk/src/date-picker/date-picker.scss +1 -1
- package/packages/theme-chalk/src/date-picker/date-range-picker.scss +4 -7
- package/packages/theme-chalk/src/date-picker/date-table.scss +11 -11
- package/packages/theme-chalk/src/date-picker/month-table.scss +48 -6
- package/packages/theme-chalk/src/date-picker/picker-panel.scss +3 -3
- package/packages/theme-chalk/src/date-picker/picker.scss +7 -0
- package/packages/theme-chalk/src/date-picker/time-picker.scss +1 -0
- package/packages/theme-chalk/src/date-picker/year-table.scss +9 -2
- package/packages/theme-chalk/src/descriptions-item.scss +42 -0
- package/packages/theme-chalk/src/descriptions.scss +111 -0
- package/packages/theme-chalk/src/dialog.scss +5 -4
- package/packages/theme-chalk/src/divider.scss +47 -0
- package/packages/theme-chalk/src/drawer.scss +219 -0
- package/packages/theme-chalk/src/dropdown.scss +14 -1
- package/packages/theme-chalk/src/empty.scss +45 -0
- package/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
- package/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
- package/packages/theme-chalk/src/form.scss +18 -23
- package/packages/theme-chalk/src/icon.scss +1052 -71
- package/packages/theme-chalk/src/image.scss +179 -0
- package/packages/theme-chalk/src/index.scss +20 -0
- package/packages/theme-chalk/src/input.scss +56 -5
- package/packages/theme-chalk/src/link.scss +81 -0
- package/packages/theme-chalk/src/main.scss +2 -0
- package/packages/theme-chalk/src/menu.scss +11 -8
- package/packages/theme-chalk/src/message-box.scss +14 -11
- package/packages/theme-chalk/src/message.scss +10 -10
- package/packages/theme-chalk/src/notification.scss +8 -7
- package/packages/theme-chalk/src/option.scss +1 -5
- package/packages/theme-chalk/src/page-header.scss +41 -0
- package/packages/theme-chalk/src/pagination.scss +9 -10
- package/packages/theme-chalk/src/popconfirm.scss +16 -0
- package/packages/theme-chalk/src/popover.scss +3 -2
- package/packages/theme-chalk/src/popper.scss +4 -4
- package/packages/theme-chalk/src/progress.scss +13 -1
- package/packages/theme-chalk/src/radio-button.scss +8 -8
- package/packages/theme-chalk/src/radio.scss +7 -6
- package/packages/theme-chalk/src/result.scss +61 -0
- package/packages/theme-chalk/src/row.scss +4 -0
- package/packages/theme-chalk/src/scrollbar.scss +1 -0
- package/packages/theme-chalk/src/select-dropdown.scss +5 -2
- package/packages/theme-chalk/src/select.scss +14 -6
- package/packages/theme-chalk/src/skeleton-item.scss +84 -0
- package/packages/theme-chalk/src/skeleton.scss +40 -0
- package/packages/theme-chalk/src/slider.scss +22 -0
- package/packages/theme-chalk/src/statistic.scss +38 -0
- package/packages/theme-chalk/src/switch.scss +0 -3
- package/packages/theme-chalk/src/table.scss +67 -60
- package/packages/theme-chalk/src/tabs.scss +58 -32
- package/packages/theme-chalk/src/tag.scss +85 -68
- package/packages/theme-chalk/src/timeline-item.scss +86 -0
- package/packages/theme-chalk/src/timeline.scss +14 -0
- package/packages/theme-chalk/src/tooltip.scss +1 -0
- package/packages/theme-chalk/src/transfer.scss +2 -2
- package/packages/theme-chalk/src/tree.scss +8 -5
- package/packages/theme-chalk/src/upload.scss +1 -0
- package/packages/timeline/index.js +8 -0
- package/packages/timeline/src/item.vue +73 -0
- package/packages/timeline/src/main.vue +33 -0
- package/packages/timeline-item/index.js +8 -0
- package/packages/tooltip/src/main.js +52 -26
- package/packages/transfer/src/main.vue +15 -7
- package/packages/transfer/src/transfer-panel.vue +4 -4
- package/packages/tree/src/model/node.js +27 -21
- package/packages/tree/src/model/tree-store.js +22 -16
- package/packages/tree/src/tree-node.vue +16 -10
- package/packages/tree/src/tree.vue +41 -27
- package/packages/upload/src/index.vue +42 -13
- package/packages/upload/src/upload-list.vue +46 -41
- package/src/directives/repeat-click.js +6 -4
- package/src/index.js +66 -8
- package/src/locale/format.js +1 -1
- package/src/locale/index.js +1 -1
- package/src/locale/lang/af-ZA.js +15 -1
- package/src/locale/lang/ar.js +26 -12
- package/src/locale/lang/az.js +126 -0
- package/src/locale/lang/bg.js +15 -1
- package/src/locale/lang/bn.js +126 -0
- package/src/locale/lang/ca.js +21 -7
- package/src/locale/lang/cs-CZ.js +15 -1
- package/src/locale/lang/da.js +15 -1
- package/src/locale/lang/de.js +15 -1
- package/src/locale/lang/ee.js +20 -6
- package/src/locale/lang/el.js +16 -2
- package/src/locale/lang/en.js +16 -2
- package/src/locale/lang/eo.js +123 -0
- package/src/locale/lang/es.js +19 -5
- package/src/locale/lang/eu.js +123 -0
- package/src/locale/lang/fa.js +20 -6
- package/src/locale/lang/fi.js +36 -22
- package/src/locale/lang/fr.js +15 -1
- package/src/locale/lang/he.js +15 -1
- package/src/locale/lang/hr.js +123 -0
- package/src/locale/lang/hu.js +16 -2
- package/src/locale/lang/hy-AM.js +123 -0
- package/src/locale/lang/id.js +20 -6
- package/src/locale/lang/is.js +124 -0
- package/src/locale/lang/it.js +18 -4
- package/src/locale/lang/ja.js +15 -1
- package/src/locale/lang/kg.js +123 -0
- package/src/locale/lang/km.js +18 -4
- package/src/locale/lang/ko.js +15 -1
- package/src/locale/lang/ku.js +15 -1
- package/src/locale/lang/kz.js +15 -1
- package/src/locale/lang/lt.js +15 -1
- package/src/locale/lang/lv.js +22 -8
- package/src/locale/lang/mn.js +15 -1
- package/src/locale/lang/ms.js +122 -0
- package/src/locale/lang/nb-NO.js +25 -11
- package/src/locale/lang/nl.js +15 -1
- package/src/locale/lang/pl.js +15 -1
- package/src/locale/lang/pt-br.js +15 -1
- package/src/locale/lang/pt.js +15 -1
- package/src/locale/lang/ro.js +15 -1
- package/src/locale/lang/ru-RU.js +17 -3
- package/src/locale/lang/si.js +123 -0
- package/src/locale/lang/sk.js +20 -6
- package/src/locale/lang/sl.js +21 -7
- package/src/locale/lang/sr-Latn.js +123 -0
- package/src/locale/lang/sr.js +123 -0
- package/src/locale/lang/sv-SE.js +23 -9
- package/src/locale/lang/sw.js +123 -0
- package/src/locale/lang/ta.js +15 -1
- package/src/locale/lang/th.js +22 -8
- package/src/locale/lang/tk.js +15 -1
- package/src/locale/lang/tr-TR.js +16 -2
- package/src/locale/lang/ua.js +17 -3
- package/src/locale/lang/ug-CN.js +19 -5
- package/src/locale/lang/uz-UZ.js +123 -0
- package/src/locale/lang/vi.js +20 -6
- package/src/locale/lang/zh-CN.js +15 -1
- package/src/locale/lang/zh-TW.js +15 -1
- package/src/mixins/locale.js +1 -1
- package/src/mixins/migrating.js +6 -3
- package/src/transitions/collapse-transition.js +1 -1
- package/src/utils/aria-utils.js +2 -1
- package/src/utils/clickoutside.js +1 -1
- package/{packages/date-picker/src/util/index.js → src/utils/date-util.js} +69 -27
- package/src/utils/date.js +54 -30
- package/src/utils/dom.js +55 -2
- package/src/utils/lodash.js +18075 -0
- package/src/utils/merge.js +3 -13
- package/src/utils/popup/index.js +3 -11
- package/src/utils/popup/popup-manager.js +3 -3
- package/src/utils/resize-event.js +2 -1
- package/src/utils/types.js +38 -0
- package/src/utils/util.js +161 -0
- package/src/utils/vdom.js +1 -5
- package/src/utils/vue-popper.js +2 -1
- package/types/alert.d.ts +4 -0
- package/types/autocomplete.d.ts +6 -3
- package/types/avatar.d.ts +20 -0
- package/types/backtop.d.ts +16 -0
- package/types/calendar.d.ts +15 -0
- package/types/carousel.d.ts +4 -0
- package/types/cascader-panel.d.ts +72 -0
- package/types/cascader.d.ts +29 -21
- package/types/collapse-item.d.ts +3 -0
- package/types/descriptions-item.d.ts +37 -0
- package/types/descriptions.d.ts +52 -0
- package/types/dialog.d.ts +3 -0
- package/types/divider.d.ts +12 -0
- package/types/drawer.d.ts +63 -0
- package/types/dropdown-item.d.ts +3 -0
- package/types/dropdown.d.ts +12 -0
- package/types/element-ui.d.ts +91 -3
- package/types/empty.d.ts +31 -0
- package/types/form.d.ts +6 -6
- package/types/icon.d.ts +7 -0
- package/types/image.d.ts +43 -0
- package/types/infinite-scroll.d.ts +6 -0
- package/types/input-number.d.ts +4 -1
- package/types/input.d.ts +16 -1
- package/types/link.d.ts +25 -0
- package/types/loading.d.ts +3 -1
- package/types/message-box.d.ts +14 -4
- package/types/message.d.ts +17 -2
- package/types/page-header.d.ts +10 -0
- package/types/pagination.d.ts +3 -0
- package/types/popconfirm.d.ts +29 -0
- package/types/popover.d.ts +7 -1
- package/types/progress.d.ts +7 -1
- package/types/rate.d.ts +16 -4
- package/types/result.d.ts +33 -0
- package/types/select.d.ts +9 -0
- package/types/skeleton-item.d.ts +7 -0
- package/types/skeleton.d.ts +33 -0
- package/types/slider.d.ts +6 -0
- package/types/spinner.d.ts +16 -0
- package/types/statistic.d.ts +37 -0
- package/types/submenu.d.ts +1 -1
- package/types/switch.d.ts +3 -0
- package/types/table-column.d.ts +1 -1
- package/types/table.d.ts +58 -3
- package/types/tabs.d.ts +4 -1
- package/types/tag.d.ts +5 -1
- package/types/timeline-item.d.ts +20 -0
- package/types/timeline.d.ts +6 -0
- package/types/tooltip.d.ts +3 -0
- package/types/tree.d.ts +120 -97
- package/types/upload.d.ts +7 -4
- package/web-types.json +4195 -0
- package/CHANGELOG.en-US.md +0 -576
- package/CHANGELOG.es.md +0 -581
- package/CHANGELOG.zh-CN.md +0 -576
- package/lib/utils/sync.js +0 -59
- package/packages/carousel/_index.js +0 -10
- package/packages/carousel/cooking.conf.js +0 -6
- package/packages/carousel/package.json +0 -17
- package/packages/cascader/cooking.conf.js +0 -18
- package/packages/cascader/package.json +0 -15
- package/packages/cascader/src/main.vue +0 -438
- package/packages/cascader/src/menu.vue +0 -369
- package/packages/color-picker/cooking.conf.js +0 -6
- package/packages/color-picker/package.json +0 -15
- package/packages/date-picker/README.md +0 -64
- package/packages/date-picker/_index.js +0 -12
- package/packages/date-picker/cooking.conf.js +0 -6
- package/packages/date-picker/package.json +0 -15
- package/packages/loading/README.md +0 -66
- package/packages/loading/cooking.conf.js +0 -6
- package/packages/loading/package.json +0 -15
- package/packages/pagination/README.md +0 -59
- package/packages/pagination/cooking.conf.js +0 -6
- package/packages/pagination/package.json +0 -15
- package/packages/table/README.md +0 -106
- package/packages/table/_index.js +0 -10
- package/packages/table/cooking.conf.js +0 -6
- package/packages/table/package.json +0 -17
- package/packages/table/src/table-store.js +0 -619
- package/packages/theme-chalk/lib/alert.css +0 -1
- package/packages/theme-chalk/lib/aside.css +0 -1
- package/packages/theme-chalk/lib/autocomplete.css +0 -1
- package/packages/theme-chalk/lib/badge.css +0 -1
- package/packages/theme-chalk/lib/base.css +0 -1
- package/packages/theme-chalk/lib/breadcrumb.css +0 -1
- package/packages/theme-chalk/lib/button.css +0 -1
- package/packages/theme-chalk/lib/card.css +0 -1
- package/packages/theme-chalk/lib/carousel-item.css +0 -1
- package/packages/theme-chalk/lib/carousel.css +0 -1
- package/packages/theme-chalk/lib/cascader.css +0 -1
- package/packages/theme-chalk/lib/checkbox.css +0 -1
- package/packages/theme-chalk/lib/col.css +0 -1
- package/packages/theme-chalk/lib/collapse-item.css +0 -0
- package/packages/theme-chalk/lib/collapse.css +0 -1
- package/packages/theme-chalk/lib/color-picker.css +0 -1
- package/packages/theme-chalk/lib/container.css +0 -1
- package/packages/theme-chalk/lib/date-picker.css +0 -1
- package/packages/theme-chalk/lib/dialog.css +0 -1
- package/packages/theme-chalk/lib/display.css +0 -1
- package/packages/theme-chalk/lib/dropdown-item.css +0 -0
- package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
- package/packages/theme-chalk/lib/dropdown.css +0 -1
- package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
- package/packages/theme-chalk/lib/footer.css +0 -1
- package/packages/theme-chalk/lib/form-item.css +0 -0
- package/packages/theme-chalk/lib/form.css +0 -1
- package/packages/theme-chalk/lib/header.css +0 -1
- package/packages/theme-chalk/lib/icon.css +0 -1
- package/packages/theme-chalk/lib/index.css +0 -1
- package/packages/theme-chalk/lib/input-number.css +0 -1
- package/packages/theme-chalk/lib/input.css +0 -1
- package/packages/theme-chalk/lib/loading.css +0 -1
- package/packages/theme-chalk/lib/main.css +0 -1
- package/packages/theme-chalk/lib/menu-item-group.css +0 -0
- package/packages/theme-chalk/lib/menu-item.css +0 -0
- package/packages/theme-chalk/lib/menu.css +0 -1
- package/packages/theme-chalk/lib/message-box.css +0 -1
- package/packages/theme-chalk/lib/message.css +0 -1
- package/packages/theme-chalk/lib/notification.css +0 -1
- package/packages/theme-chalk/lib/option-group.css +0 -1
- package/packages/theme-chalk/lib/option.css +0 -1
- package/packages/theme-chalk/lib/pagination.css +0 -1
- package/packages/theme-chalk/lib/popover.css +0 -1
- package/packages/theme-chalk/lib/popper.css +0 -1
- package/packages/theme-chalk/lib/progress.css +0 -1
- package/packages/theme-chalk/lib/radio-button.css +0 -1
- package/packages/theme-chalk/lib/radio-group.css +0 -1
- package/packages/theme-chalk/lib/radio.css +0 -1
- package/packages/theme-chalk/lib/rate.css +0 -1
- package/packages/theme-chalk/lib/reset.css +0 -1
- package/packages/theme-chalk/lib/row.css +0 -1
- package/packages/theme-chalk/lib/scrollbar.css +0 -1
- package/packages/theme-chalk/lib/select-dropdown.css +0 -1
- package/packages/theme-chalk/lib/select.css +0 -1
- package/packages/theme-chalk/lib/slider.css +0 -1
- package/packages/theme-chalk/lib/spinner.css +0 -1
- package/packages/theme-chalk/lib/step.css +0 -1
- package/packages/theme-chalk/lib/steps.css +0 -1
- package/packages/theme-chalk/lib/submenu.css +0 -0
- package/packages/theme-chalk/lib/switch.css +0 -1
- package/packages/theme-chalk/lib/tab-pane.css +0 -0
- package/packages/theme-chalk/lib/table-column.css +0 -1
- package/packages/theme-chalk/lib/table.css +0 -1
- package/packages/theme-chalk/lib/tabs.css +0 -1
- package/packages/theme-chalk/lib/tag.css +0 -1
- package/packages/theme-chalk/lib/time-picker.css +0 -1
- package/packages/theme-chalk/lib/time-select.css +0 -1
- package/packages/theme-chalk/lib/tooltip.css +0 -1
- package/packages/theme-chalk/lib/transfer.css +0 -1
- package/packages/theme-chalk/lib/tree.css +0 -1
- package/packages/theme-chalk/lib/upload.css +0 -1
- package/packages/upload/README.md +0 -67
- package/packages/upload/cooking.conf.js +0 -6
- package/packages/upload/package.json +0 -16
- package/packages/upload/src/iframe-upload.vue +0 -167
- package/src/utils/sync.js +0 -54
- /package/{packages/theme-chalk/lib/breadcrumb-item.css → lib/theme-chalk/infinite-scroll.css} +0 -0
- /package/{packages/theme-chalk/lib/button-group.css → lib/theme-chalk/infiniteScroll.css} +0 -0
- /package/packages/theme-chalk/{lib/checkbox-button.css → src/infinite-scroll.scss} +0 -0
- /package/packages/theme-chalk/{lib/checkbox-group.css → src/infiniteScroll.scss} +0 -0
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
<button
|
|
14
14
|
type="button"
|
|
15
15
|
class="el-picker-panel__shortcut"
|
|
16
|
-
v-for="shortcut in shortcuts"
|
|
16
|
+
v-for="(shortcut, key) in shortcuts"
|
|
17
|
+
:key="key"
|
|
17
18
|
@click="handleShortcutClick(shortcut)">{{shortcut.text}}</button>
|
|
18
19
|
</div>
|
|
19
20
|
<div class="el-picker-panel__body">
|
|
@@ -27,18 +28,19 @@
|
|
|
27
28
|
:placeholder="t('el.datepicker.startDate')"
|
|
28
29
|
class="el-date-range-picker__editor"
|
|
29
30
|
:value="minVisibleDate"
|
|
30
|
-
@input
|
|
31
|
-
@change
|
|
31
|
+
@input="val => handleDateInput(val, 'min')"
|
|
32
|
+
@change="val => handleDateChange(val, 'min')" />
|
|
32
33
|
</span>
|
|
33
|
-
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="
|
|
34
|
+
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="handleMinTimeClose">
|
|
34
35
|
<el-input
|
|
35
36
|
size="small"
|
|
37
|
+
class="el-date-range-picker__editor"
|
|
36
38
|
:disabled="rangeState.selecting"
|
|
37
39
|
:placeholder="t('el.datepicker.startTime')"
|
|
38
|
-
class="el-date-range-picker__editor"
|
|
39
40
|
:value="minVisibleTime"
|
|
40
41
|
@focus="minTimePickerVisible = true"
|
|
41
|
-
@
|
|
42
|
+
@input="val => handleTimeInput(val, 'min')"
|
|
43
|
+
@change="val => handleTimeChange(val, 'min')" />
|
|
42
44
|
<time-picker
|
|
43
45
|
ref="minTimePicker"
|
|
44
46
|
@pick="handleMinTimePick"
|
|
@@ -53,25 +55,25 @@
|
|
|
53
55
|
<span class="el-date-range-picker__time-picker-wrap">
|
|
54
56
|
<el-input
|
|
55
57
|
size="small"
|
|
58
|
+
class="el-date-range-picker__editor"
|
|
56
59
|
:disabled="rangeState.selecting"
|
|
57
60
|
:placeholder="t('el.datepicker.endDate')"
|
|
58
|
-
class="el-date-range-picker__editor"
|
|
59
61
|
:value="maxVisibleDate"
|
|
60
62
|
:readonly="!minDate"
|
|
61
|
-
@input
|
|
62
|
-
@change
|
|
63
|
+
@input="val => handleDateInput(val, 'max')"
|
|
64
|
+
@change="val => handleDateChange(val, 'max')" />
|
|
63
65
|
</span>
|
|
64
|
-
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="
|
|
66
|
+
<span class="el-date-range-picker__time-picker-wrap" v-clickoutside="handleMaxTimeClose">
|
|
65
67
|
<el-input
|
|
66
68
|
size="small"
|
|
69
|
+
class="el-date-range-picker__editor"
|
|
67
70
|
:disabled="rangeState.selecting"
|
|
68
|
-
ref="maxInput"
|
|
69
71
|
:placeholder="t('el.datepicker.endTime')"
|
|
70
|
-
class="el-date-range-picker__editor"
|
|
71
72
|
:value="maxVisibleTime"
|
|
72
|
-
@focus="minDate && (maxTimePickerVisible = true)"
|
|
73
73
|
:readonly="!minDate"
|
|
74
|
-
@
|
|
74
|
+
@focus="minDate && (maxTimePickerVisible = true)"
|
|
75
|
+
@input="val => handleTimeInput(val, 'max')"
|
|
76
|
+
@change="val => handleTimeChange(val, 'max')" />
|
|
75
77
|
<time-picker
|
|
76
78
|
ref="maxTimePicker"
|
|
77
79
|
@pick="handleMaxTimePick"
|
|
@@ -116,6 +118,7 @@
|
|
|
116
118
|
:max-date="maxDate"
|
|
117
119
|
:range-state="rangeState"
|
|
118
120
|
:disabled-date="disabledDate"
|
|
121
|
+
:cell-class-name="cellClassName"
|
|
119
122
|
@changerange="handleChangeRange"
|
|
120
123
|
:first-day-of-week="firstDayOfWeek"
|
|
121
124
|
@pick="handleRangePick">
|
|
@@ -155,6 +158,7 @@
|
|
|
155
158
|
:max-date="maxDate"
|
|
156
159
|
:range-state="rangeState"
|
|
157
160
|
:disabled-date="disabledDate"
|
|
161
|
+
:cell-class-name="cellClassName"
|
|
158
162
|
@changerange="handleChangeRange"
|
|
159
163
|
:first-day-of-week="firstDayOfWeek"
|
|
160
164
|
@pick="handleRangePick">
|
|
@@ -175,7 +179,7 @@
|
|
|
175
179
|
size="mini"
|
|
176
180
|
class="el-picker-panel__link-btn"
|
|
177
181
|
:disabled="btnDisabled"
|
|
178
|
-
@click="handleConfirm()">
|
|
182
|
+
@click="handleConfirm(false)">
|
|
179
183
|
{{ t('el.datepicker.confirm') }}
|
|
180
184
|
</el-button>
|
|
181
185
|
</div>
|
|
@@ -190,32 +194,29 @@
|
|
|
190
194
|
isDate,
|
|
191
195
|
modifyDate,
|
|
192
196
|
modifyTime,
|
|
193
|
-
|
|
197
|
+
modifyWithTimeString,
|
|
194
198
|
prevYear,
|
|
195
199
|
nextYear,
|
|
196
200
|
prevMonth,
|
|
197
201
|
nextMonth,
|
|
202
|
+
nextDate,
|
|
198
203
|
extractDateFormat,
|
|
199
204
|
extractTimeFormat
|
|
200
|
-
} from '
|
|
201
|
-
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
|
202
|
-
import Locale from 'element-ui/src/mixins/locale';
|
|
205
|
+
} from 'mazey-element-ui/src/utils/date-util';
|
|
206
|
+
import Clickoutside from 'mazey-element-ui/src/utils/clickoutside';
|
|
207
|
+
import Locale from 'mazey-element-ui/src/mixins/locale';
|
|
203
208
|
import TimePicker from './time';
|
|
204
209
|
import DateTable from '../basic/date-table';
|
|
205
|
-
import ElInput from 'element-ui/packages/input';
|
|
206
|
-
import ElButton from 'element-ui/packages/button';
|
|
207
|
-
|
|
208
|
-
const advanceDate = (date, amount) => {
|
|
209
|
-
return new Date(new Date(date).getTime() + amount);
|
|
210
|
-
};
|
|
210
|
+
import ElInput from 'mazey-element-ui/packages/input';
|
|
211
|
+
import ElButton from 'mazey-element-ui/packages/button';
|
|
211
212
|
|
|
212
213
|
const calcDefaultValue = (defaultValue) => {
|
|
213
214
|
if (Array.isArray(defaultValue)) {
|
|
214
215
|
return [new Date(defaultValue[0]), new Date(defaultValue[1])];
|
|
215
216
|
} else if (defaultValue) {
|
|
216
|
-
return [new Date(defaultValue),
|
|
217
|
+
return [new Date(defaultValue), nextDate(new Date(defaultValue), 1)];
|
|
217
218
|
} else {
|
|
218
|
-
return [new Date(),
|
|
219
|
+
return [new Date(), nextDate(new Date(), 1)];
|
|
219
220
|
}
|
|
220
221
|
};
|
|
221
222
|
|
|
@@ -226,7 +227,7 @@
|
|
|
226
227
|
|
|
227
228
|
computed: {
|
|
228
229
|
btnDisabled() {
|
|
229
|
-
return !(this.minDate && this.maxDate && !this.selecting);
|
|
230
|
+
return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
|
|
230
231
|
},
|
|
231
232
|
|
|
232
233
|
leftLabel() {
|
|
@@ -262,19 +263,27 @@
|
|
|
262
263
|
},
|
|
263
264
|
|
|
264
265
|
minVisibleDate() {
|
|
265
|
-
|
|
266
|
+
if (this.dateUserInput.min !== null) return this.dateUserInput.min;
|
|
267
|
+
if (this.minDate) return formatDate(this.minDate, this.dateFormat);
|
|
268
|
+
return '';
|
|
266
269
|
},
|
|
267
270
|
|
|
268
271
|
maxVisibleDate() {
|
|
269
|
-
|
|
272
|
+
if (this.dateUserInput.max !== null) return this.dateUserInput.max;
|
|
273
|
+
if (this.maxDate || this.minDate) return formatDate(this.maxDate || this.minDate, this.dateFormat);
|
|
274
|
+
return '';
|
|
270
275
|
},
|
|
271
276
|
|
|
272
277
|
minVisibleTime() {
|
|
273
|
-
|
|
278
|
+
if (this.timeUserInput.min !== null) return this.timeUserInput.min;
|
|
279
|
+
if (this.minDate) return formatDate(this.minDate, this.timeFormat);
|
|
280
|
+
return '';
|
|
274
281
|
},
|
|
275
282
|
|
|
276
283
|
maxVisibleTime() {
|
|
277
|
-
|
|
284
|
+
if (this.timeUserInput.max !== null) return this.timeUserInput.max;
|
|
285
|
+
if (this.maxDate || this.minDate) return formatDate(this.maxDate || this.minDate, this.timeFormat);
|
|
286
|
+
return '';
|
|
278
287
|
},
|
|
279
288
|
|
|
280
289
|
timeFormat() {
|
|
@@ -324,17 +333,28 @@
|
|
|
324
333
|
shortcuts: '',
|
|
325
334
|
visible: '',
|
|
326
335
|
disabledDate: '',
|
|
336
|
+
cellClassName: '',
|
|
327
337
|
firstDayOfWeek: 7,
|
|
328
338
|
minTimePickerVisible: false,
|
|
329
339
|
maxTimePickerVisible: false,
|
|
330
340
|
format: '',
|
|
331
341
|
arrowControl: false,
|
|
332
|
-
unlinkPanels: false
|
|
342
|
+
unlinkPanels: false,
|
|
343
|
+
dateUserInput: {
|
|
344
|
+
min: null,
|
|
345
|
+
max: null
|
|
346
|
+
},
|
|
347
|
+
timeUserInput: {
|
|
348
|
+
min: null,
|
|
349
|
+
max: null
|
|
350
|
+
}
|
|
333
351
|
};
|
|
334
352
|
},
|
|
335
353
|
|
|
336
354
|
watch: {
|
|
337
355
|
minDate(val) {
|
|
356
|
+
this.dateUserInput.min = null;
|
|
357
|
+
this.timeUserInput.min = null;
|
|
338
358
|
this.$nextTick(() => {
|
|
339
359
|
if (this.$refs.maxTimePicker && this.maxDate && this.maxDate < this.minDate) {
|
|
340
360
|
const format = 'HH:mm:ss';
|
|
@@ -353,6 +373,8 @@
|
|
|
353
373
|
},
|
|
354
374
|
|
|
355
375
|
maxDate(val) {
|
|
376
|
+
this.dateUserInput.max = null;
|
|
377
|
+
this.timeUserInput.max = null;
|
|
356
378
|
if (val && this.$refs.maxTimePicker) {
|
|
357
379
|
this.$refs.maxTimePicker.date = val;
|
|
358
380
|
this.$refs.maxTimePicker.value = val;
|
|
@@ -386,8 +408,6 @@
|
|
|
386
408
|
} else if (Array.isArray(newVal)) {
|
|
387
409
|
this.minDate = isDate(newVal[0]) ? new Date(newVal[0]) : null;
|
|
388
410
|
this.maxDate = isDate(newVal[1]) ? new Date(newVal[1]) : null;
|
|
389
|
-
// NOTE: currently, maxDate = minDate + 1 month
|
|
390
|
-
// should allow them to be set individually in the future
|
|
391
411
|
if (this.minDate) {
|
|
392
412
|
this.leftDate = this.minDate;
|
|
393
413
|
if (this.unlinkPanels && this.maxDate) {
|
|
@@ -434,8 +454,8 @@
|
|
|
434
454
|
this.rangeState = val.rangeState;
|
|
435
455
|
},
|
|
436
456
|
|
|
437
|
-
handleDateInput(
|
|
438
|
-
|
|
457
|
+
handleDateInput(value, type) {
|
|
458
|
+
this.dateUserInput[type] = value;
|
|
439
459
|
if (value.length !== this.dateFormat.length) return;
|
|
440
460
|
const parsedValue = parseDate(value, this.dateFormat);
|
|
441
461
|
|
|
@@ -445,19 +465,22 @@
|
|
|
445
465
|
return;
|
|
446
466
|
}
|
|
447
467
|
if (type === 'min') {
|
|
448
|
-
this.minDate = new Date(parsedValue);
|
|
468
|
+
this.minDate = modifyDate(this.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
449
469
|
this.leftDate = new Date(parsedValue);
|
|
450
|
-
|
|
470
|
+
if (!this.unlinkPanels) {
|
|
471
|
+
this.rightDate = nextMonth(this.leftDate);
|
|
472
|
+
}
|
|
451
473
|
} else {
|
|
452
|
-
this.maxDate = new Date(parsedValue);
|
|
453
|
-
this.leftDate = prevMonth(parsedValue);
|
|
474
|
+
this.maxDate = modifyDate(this.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
454
475
|
this.rightDate = new Date(parsedValue);
|
|
476
|
+
if (!this.unlinkPanels) {
|
|
477
|
+
this.leftDate = prevMonth(parsedValue);
|
|
478
|
+
}
|
|
455
479
|
}
|
|
456
480
|
}
|
|
457
481
|
},
|
|
458
482
|
|
|
459
|
-
handleDateChange(
|
|
460
|
-
const value = event.target.value;
|
|
483
|
+
handleDateChange(value, type) {
|
|
461
484
|
const parsedValue = parseDate(value, this.dateFormat);
|
|
462
485
|
if (parsedValue) {
|
|
463
486
|
if (type === 'min') {
|
|
@@ -474,8 +497,23 @@
|
|
|
474
497
|
}
|
|
475
498
|
},
|
|
476
499
|
|
|
477
|
-
|
|
478
|
-
|
|
500
|
+
handleTimeInput(value, type) {
|
|
501
|
+
this.timeUserInput[type] = value;
|
|
502
|
+
if (value.length !== this.timeFormat.length) return;
|
|
503
|
+
const parsedValue = parseDate(value, this.timeFormat);
|
|
504
|
+
|
|
505
|
+
if (parsedValue) {
|
|
506
|
+
if (type === 'min') {
|
|
507
|
+
this.minDate = modifyTime(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
508
|
+
this.$nextTick(_ => this.$refs.minTimePicker.adjustSpinners());
|
|
509
|
+
} else {
|
|
510
|
+
this.maxDate = modifyTime(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
511
|
+
this.$nextTick(_ => this.$refs.maxTimePicker.adjustSpinners());
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
|
|
516
|
+
handleTimeChange(value, type) {
|
|
479
517
|
const parsedValue = parseDate(value, this.timeFormat);
|
|
480
518
|
if (parsedValue) {
|
|
481
519
|
if (type === 'min') {
|
|
@@ -498,8 +536,8 @@
|
|
|
498
536
|
|
|
499
537
|
handleRangePick(val, close = true) {
|
|
500
538
|
const defaultTime = this.defaultTime || [];
|
|
501
|
-
const minDate =
|
|
502
|
-
const maxDate =
|
|
539
|
+
const minDate = modifyWithTimeString(val.minDate, defaultTime[0]);
|
|
540
|
+
const maxDate = modifyWithTimeString(val.maxDate, defaultTime[1]);
|
|
503
541
|
|
|
504
542
|
if (this.maxDate === maxDate && this.minDate === minDate) {
|
|
505
543
|
return;
|
|
@@ -538,6 +576,10 @@
|
|
|
538
576
|
}
|
|
539
577
|
},
|
|
540
578
|
|
|
579
|
+
handleMinTimeClose() {
|
|
580
|
+
this.minTimePickerVisible = false;
|
|
581
|
+
},
|
|
582
|
+
|
|
541
583
|
handleMaxTimePick(value, visible, first) {
|
|
542
584
|
if (this.maxDate && value) {
|
|
543
585
|
this.maxDate = modifyTime(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
|
|
@@ -552,6 +594,10 @@
|
|
|
552
594
|
}
|
|
553
595
|
},
|
|
554
596
|
|
|
597
|
+
handleMaxTimeClose() {
|
|
598
|
+
this.maxTimePickerVisible = false;
|
|
599
|
+
},
|
|
600
|
+
|
|
555
601
|
// leftPrev*, rightNext* need to take care of `unlinkPanels`
|
|
556
602
|
leftPrevYear() {
|
|
557
603
|
this.leftDate = prevYear(this.leftDate);
|
|
@@ -603,7 +649,9 @@
|
|
|
603
649
|
},
|
|
604
650
|
|
|
605
651
|
handleConfirm(visible = false) {
|
|
606
|
-
this
|
|
652
|
+
if (this.isValidValue([this.minDate, this.maxDate])) {
|
|
653
|
+
this.$emit('pick', [this.minDate, this.maxDate], visible);
|
|
654
|
+
}
|
|
607
655
|
},
|
|
608
656
|
|
|
609
657
|
isValidValue(value) {
|
|
@@ -615,6 +663,15 @@
|
|
|
615
663
|
? !this.disabledDate(value[0]) && !this.disabledDate(value[1])
|
|
616
664
|
: true
|
|
617
665
|
);
|
|
666
|
+
},
|
|
667
|
+
|
|
668
|
+
resetView() {
|
|
669
|
+
// NOTE: this is a hack to reset {min, max}Date on picker open.
|
|
670
|
+
// TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
|
|
671
|
+
// an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
|
|
672
|
+
if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
|
|
673
|
+
this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
|
674
|
+
this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
|
618
675
|
}
|
|
619
676
|
},
|
|
620
677
|
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
<button
|
|
14
14
|
type="button"
|
|
15
15
|
class="el-picker-panel__shortcut"
|
|
16
|
-
v-for="shortcut in shortcuts"
|
|
16
|
+
v-for="(shortcut, key) in shortcuts"
|
|
17
|
+
:key="key"
|
|
17
18
|
@click="handleShortcutClick(shortcut)">{{ shortcut.text }}</button>
|
|
18
19
|
</div>
|
|
19
20
|
<div class="el-picker-panel__body">
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
@input="val => userInputDate = val"
|
|
27
28
|
@change="handleVisibleDateChange" />
|
|
28
29
|
</span>
|
|
29
|
-
<span class="el-date-picker__editor-wrap" v-clickoutside="
|
|
30
|
+
<span class="el-date-picker__editor-wrap" v-clickoutside="handleTimePickClose">
|
|
30
31
|
<el-input
|
|
31
32
|
ref="input"
|
|
32
33
|
@focus="timePickerVisible = true"
|
|
@@ -90,19 +91,19 @@
|
|
|
90
91
|
<date-table
|
|
91
92
|
v-show="currentView === 'date'"
|
|
92
93
|
@pick="handleDatePick"
|
|
93
|
-
@select="handleDateSelect"
|
|
94
94
|
:selection-mode="selectionMode"
|
|
95
95
|
:first-day-of-week="firstDayOfWeek"
|
|
96
|
-
:value="
|
|
96
|
+
:value="value"
|
|
97
97
|
:default-value="defaultValue ? new Date(defaultValue) : null"
|
|
98
98
|
:date="date"
|
|
99
|
-
:
|
|
100
|
-
:
|
|
99
|
+
:cell-class-name="cellClassName"
|
|
100
|
+
:disabled-date="disabledDate">
|
|
101
101
|
</date-table>
|
|
102
102
|
<year-table
|
|
103
103
|
v-show="currentView === 'year'"
|
|
104
104
|
@pick="handleYearPick"
|
|
105
|
-
:
|
|
105
|
+
:selection-mode="selectionMode"
|
|
106
|
+
:value="value"
|
|
106
107
|
:default-value="defaultValue ? new Date(defaultValue) : null"
|
|
107
108
|
:date="date"
|
|
108
109
|
:disabled-date="disabledDate">
|
|
@@ -110,7 +111,8 @@
|
|
|
110
111
|
<month-table
|
|
111
112
|
v-show="currentView === 'month'"
|
|
112
113
|
@pick="handleMonthPick"
|
|
113
|
-
:
|
|
114
|
+
:selection-mode="selectionMode"
|
|
115
|
+
:value="value"
|
|
114
116
|
:default-value="defaultValue ? new Date(defaultValue) : null"
|
|
115
117
|
:date="date"
|
|
116
118
|
:disabled-date="disabledDate">
|
|
@@ -121,13 +123,13 @@
|
|
|
121
123
|
|
|
122
124
|
<div
|
|
123
125
|
class="el-picker-panel__footer"
|
|
124
|
-
v-show="footerVisible && currentView === 'date'">
|
|
126
|
+
v-show="footerVisible && (currentView === 'date' || currentView === 'month' || currentView === 'year')">
|
|
125
127
|
<el-button
|
|
126
128
|
size="mini"
|
|
127
129
|
type="text"
|
|
128
130
|
class="el-picker-panel__link-btn"
|
|
129
131
|
@click="changeToNow"
|
|
130
|
-
v-show="selectionMode !== 'dates'">
|
|
132
|
+
v-show="selectionMode !== 'dates' && selectionMode !== 'months' && selectionMode !== 'years'">
|
|
131
133
|
{{ t('el.datepicker.now') }}
|
|
132
134
|
</el-button>
|
|
133
135
|
<el-button
|
|
@@ -150,7 +152,7 @@
|
|
|
150
152
|
isDate,
|
|
151
153
|
modifyDate,
|
|
152
154
|
modifyTime,
|
|
153
|
-
|
|
155
|
+
modifyWithTimeString,
|
|
154
156
|
clearMilliseconds,
|
|
155
157
|
clearTime,
|
|
156
158
|
prevYear,
|
|
@@ -159,12 +161,13 @@
|
|
|
159
161
|
nextMonth,
|
|
160
162
|
changeYearMonthAndClampDate,
|
|
161
163
|
extractDateFormat,
|
|
162
|
-
extractTimeFormat
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
import
|
|
166
|
-
import
|
|
167
|
-
import
|
|
164
|
+
extractTimeFormat,
|
|
165
|
+
timeWithinRange
|
|
166
|
+
} from 'mazey-element-ui/src/utils/date-util';
|
|
167
|
+
import Clickoutside from 'mazey-element-ui/src/utils/clickoutside';
|
|
168
|
+
import Locale from 'mazey-element-ui/src/mixins/locale';
|
|
169
|
+
import ElInput from 'mazey-element-ui/packages/input';
|
|
170
|
+
import ElButton from 'mazey-element-ui/packages/button';
|
|
168
171
|
import TimePicker from './time';
|
|
169
172
|
import YearTable from '../basic/year-table';
|
|
170
173
|
import MonthTable from '../basic/month-table';
|
|
@@ -189,10 +192,12 @@
|
|
|
189
192
|
|
|
190
193
|
value(val) {
|
|
191
194
|
if (this.selectionMode === 'dates' && this.value) return;
|
|
195
|
+
if (this.selectionMode === 'months' && this.value) return;
|
|
196
|
+
if (this.selectionMode === 'years' && this.value) return;
|
|
192
197
|
if (isDate(val)) {
|
|
193
198
|
this.date = new Date(val);
|
|
194
199
|
} else {
|
|
195
|
-
this.date = this.
|
|
200
|
+
this.date = this.getDefaultValue();
|
|
196
201
|
}
|
|
197
202
|
},
|
|
198
203
|
|
|
@@ -214,6 +219,10 @@
|
|
|
214
219
|
}
|
|
215
220
|
} else if (newVal === 'dates') {
|
|
216
221
|
this.currentView = 'date';
|
|
222
|
+
} else if (newVal === 'years') {
|
|
223
|
+
this.currentView = 'year';
|
|
224
|
+
} else if (newVal === 'months') {
|
|
225
|
+
this.currentView = 'month';
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
228
|
},
|
|
@@ -223,17 +232,20 @@
|
|
|
223
232
|
const format = timeFormat => {this.$refs.timepicker.format = timeFormat;};
|
|
224
233
|
const value = value => {this.$refs.timepicker.value = value;};
|
|
225
234
|
const date = date => {this.$refs.timepicker.date = date;};
|
|
235
|
+
const selectableRange = selectableRange => {this.$refs.timepicker.selectableRange = selectableRange;};
|
|
226
236
|
|
|
227
237
|
this.$watch('value', value);
|
|
228
238
|
this.$watch('date', date);
|
|
239
|
+
this.$watch('selectableRange', selectableRange);
|
|
229
240
|
|
|
230
241
|
format(this.timeFormat);
|
|
231
242
|
value(this.value);
|
|
232
243
|
date(this.date);
|
|
244
|
+
selectableRange(this.selectableRange);
|
|
233
245
|
},
|
|
234
246
|
|
|
235
247
|
handleClear() {
|
|
236
|
-
this.date = this.
|
|
248
|
+
this.date = this.getDefaultValue();
|
|
237
249
|
this.$emit('pick', null);
|
|
238
250
|
},
|
|
239
251
|
|
|
@@ -303,7 +315,9 @@
|
|
|
303
315
|
|
|
304
316
|
handleTimePick(value, visible, first) {
|
|
305
317
|
if (isDate(value)) {
|
|
306
|
-
const newDate = this.value
|
|
318
|
+
const newDate = this.value
|
|
319
|
+
? modifyTime(this.value, value.getHours(), value.getMinutes(), value.getSeconds())
|
|
320
|
+
: modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
307
321
|
this.date = newDate;
|
|
308
322
|
this.emit(this.date, true);
|
|
309
323
|
} else {
|
|
@@ -314,10 +328,16 @@
|
|
|
314
328
|
}
|
|
315
329
|
},
|
|
316
330
|
|
|
331
|
+
handleTimePickClose() {
|
|
332
|
+
this.timePickerVisible = false;
|
|
333
|
+
},
|
|
334
|
+
|
|
317
335
|
handleMonthPick(month) {
|
|
318
336
|
if (this.selectionMode === 'month') {
|
|
319
337
|
this.date = modifyDate(this.date, this.year, month, 1);
|
|
320
338
|
this.emit(this.date);
|
|
339
|
+
} else if (this.selectionMode === 'months') {
|
|
340
|
+
this.emit(month, true);
|
|
321
341
|
} else {
|
|
322
342
|
this.date = changeYearMonthAndClampDate(this.date, this.year, month);
|
|
323
343
|
// TODO: should emit intermediate value ??
|
|
@@ -326,18 +346,21 @@
|
|
|
326
346
|
}
|
|
327
347
|
},
|
|
328
348
|
|
|
329
|
-
handleDateSelect(value) {
|
|
330
|
-
if (this.selectionMode === 'dates') {
|
|
331
|
-
this.selectedDate = value;
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
|
|
335
349
|
handleDatePick(value) {
|
|
336
350
|
if (this.selectionMode === 'day') {
|
|
337
|
-
|
|
351
|
+
let newDate = this.value
|
|
352
|
+
? modifyDate(this.value, value.getFullYear(), value.getMonth(), value.getDate())
|
|
353
|
+
: modifyWithTimeString(value, this.defaultTime);
|
|
354
|
+
// change default time while out of selectableRange
|
|
355
|
+
if (!this.checkDateWithinRange(newDate)) {
|
|
356
|
+
newDate = modifyDate(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
|
|
357
|
+
}
|
|
358
|
+
this.date = newDate;
|
|
338
359
|
this.emit(this.date, this.showTime);
|
|
339
360
|
} else if (this.selectionMode === 'week') {
|
|
340
361
|
this.emit(value.date);
|
|
362
|
+
} else if (this.selectionMode === 'dates') {
|
|
363
|
+
this.emit(value, true); // set false to keep panel open
|
|
341
364
|
}
|
|
342
365
|
},
|
|
343
366
|
|
|
@@ -345,6 +368,8 @@
|
|
|
345
368
|
if (this.selectionMode === 'year') {
|
|
346
369
|
this.date = modifyDate(this.date, year, 0, 1);
|
|
347
370
|
this.emit(this.date);
|
|
371
|
+
} else if (this.selectionMode === 'years') {
|
|
372
|
+
this.emit(year, true);
|
|
348
373
|
} else {
|
|
349
374
|
this.date = changeYearMonthAndClampDate(this.date, year, this.month);
|
|
350
375
|
// TODO: should emit intermediate value ??
|
|
@@ -356,25 +381,30 @@
|
|
|
356
381
|
changeToNow() {
|
|
357
382
|
// NOTE: not a permanent solution
|
|
358
383
|
// consider disable "now" button in the future
|
|
359
|
-
if (!this.disabledDate || !this.disabledDate(new Date())) {
|
|
384
|
+
if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
|
|
360
385
|
this.date = new Date();
|
|
361
386
|
this.emit(this.date);
|
|
362
387
|
}
|
|
363
388
|
},
|
|
364
389
|
|
|
365
390
|
confirm() {
|
|
366
|
-
if (this.selectionMode === 'dates') {
|
|
367
|
-
this.emit(this.
|
|
391
|
+
if (this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years') {
|
|
392
|
+
this.emit(this.value);
|
|
368
393
|
} else {
|
|
369
|
-
|
|
370
|
-
|
|
394
|
+
// value were emitted in handle{Date,Time}Pick, nothing to update here
|
|
395
|
+
// deal with the scenario where: user opens the picker, then confirm without doing anything
|
|
396
|
+
const value = this.value
|
|
397
|
+
? this.value
|
|
398
|
+
: modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
399
|
+
this.date = new Date(value); // refresh date
|
|
400
|
+
this.emit(value);
|
|
371
401
|
}
|
|
372
402
|
},
|
|
373
403
|
|
|
374
404
|
resetView() {
|
|
375
|
-
if (this.selectionMode === 'month') {
|
|
405
|
+
if (this.selectionMode === 'month' || this.selectionMode === 'months') {
|
|
376
406
|
this.currentView = 'month';
|
|
377
|
-
} else if (this.selectionMode === 'year') {
|
|
407
|
+
} else if (this.selectionMode === 'year' || this.selectionMode === 'years') {
|
|
378
408
|
this.currentView = 'year';
|
|
379
409
|
} else {
|
|
380
410
|
this.currentView = 'date';
|
|
@@ -438,7 +468,7 @@
|
|
|
438
468
|
|
|
439
469
|
handleVisibleTimeChange(value) {
|
|
440
470
|
const time = parseDate(value, this.timeFormat);
|
|
441
|
-
if (time) {
|
|
471
|
+
if (time && this.checkDateWithinRange(time)) {
|
|
442
472
|
this.date = modifyDate(time, this.year, this.month, this.monthDate);
|
|
443
473
|
this.userInputTime = null;
|
|
444
474
|
this.$refs.timepicker.value = this.date;
|
|
@@ -465,7 +495,19 @@
|
|
|
465
495
|
typeof this.disabledDate === 'function'
|
|
466
496
|
? !this.disabledDate(value)
|
|
467
497
|
: true
|
|
468
|
-
);
|
|
498
|
+
) && this.checkDateWithinRange(value);
|
|
499
|
+
},
|
|
500
|
+
|
|
501
|
+
getDefaultValue() {
|
|
502
|
+
// if default-value is set, return it
|
|
503
|
+
// otherwise, return now (the moment this method gets called)
|
|
504
|
+
return this.defaultValue ? new Date(this.defaultValue) : new Date();
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
checkDateWithinRange(date) {
|
|
508
|
+
return this.selectableRange.length > 0
|
|
509
|
+
? timeWithinRange(date, this.selectableRange, this.format || 'HH:mm:ss')
|
|
510
|
+
: true;
|
|
469
511
|
}
|
|
470
512
|
},
|
|
471
513
|
|
|
@@ -478,7 +520,7 @@
|
|
|
478
520
|
popperClass: '',
|
|
479
521
|
date: new Date(),
|
|
480
522
|
value: '',
|
|
481
|
-
defaultValue: null,
|
|
523
|
+
defaultValue: null, // use getDefaultValue() for time computation
|
|
482
524
|
defaultTime: null,
|
|
483
525
|
showTime: false,
|
|
484
526
|
selectionMode: 'day',
|
|
@@ -486,7 +528,8 @@
|
|
|
486
528
|
visible: false,
|
|
487
529
|
currentView: 'date',
|
|
488
530
|
disabledDate: '',
|
|
489
|
-
|
|
531
|
+
cellClassName: '',
|
|
532
|
+
selectableRange: [],
|
|
490
533
|
firstDayOfWeek: 7,
|
|
491
534
|
showWeekNumber: false,
|
|
492
535
|
timePickerVisible: false,
|
|
@@ -515,7 +558,7 @@
|
|
|
515
558
|
},
|
|
516
559
|
|
|
517
560
|
footerVisible() {
|
|
518
|
-
return this.showTime || this.selectionMode === 'dates';
|
|
561
|
+
return this.showTime || this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years';
|
|
519
562
|
},
|
|
520
563
|
|
|
521
564
|
visibleTime() {
|