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
package/lib/utils/after-leave.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
exports.default = _default;
|
|
5
|
+
/**
|
|
6
|
+
* Bind after-leave event for vue instance. Make sure after-leave is called in any browsers.
|
|
7
|
+
*
|
|
8
|
+
* @param {Vue} instance Vue instance.
|
|
9
|
+
* @param {Function} callback callback of after-leave event
|
|
10
|
+
* @param {Number} speed the speed of transition, default value is 300ms
|
|
11
|
+
* @param {Boolean} once weather bind after-leave once. default value is false.
|
|
12
|
+
*/
|
|
13
|
+
function _default(instance, callback, speed, once) {
|
|
14
|
+
if (speed === void 0) {
|
|
15
|
+
speed = 300;
|
|
16
|
+
}
|
|
17
|
+
if (once === void 0) {
|
|
18
|
+
once = false;
|
|
19
|
+
}
|
|
9
20
|
if (!instance || !callback) throw new Error('instance & callback is required');
|
|
10
21
|
var called = false;
|
|
11
22
|
var afterLeaveCallback = function afterLeaveCallback() {
|
|
@@ -23,13 +34,5 @@ exports.default = function (instance, callback) {
|
|
|
23
34
|
setTimeout(function () {
|
|
24
35
|
afterLeaveCallback();
|
|
25
36
|
}, speed + 100);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
; /**
|
|
29
|
-
* Bind after-leave event for vue instance. Make sure after-leave is called in any browsers.
|
|
30
|
-
*
|
|
31
|
-
* @param {Vue} instance Vue instance.
|
|
32
|
-
* @param {Function} callback callback of after-leave event
|
|
33
|
-
* @param {Number} speed the speed of transition, default value is 300ms
|
|
34
|
-
* @param {Boolean} once weather bind after-leave once. default value is false.
|
|
35
|
-
*/
|
|
37
|
+
}
|
|
38
|
+
;
|
package/lib/utils/aria-dialog.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _ariaUtils = require('./aria-utils');
|
|
8
|
-
|
|
9
|
-
var _ariaUtils2 = _interopRequireDefault(_ariaUtils);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _ariaUtils = _interopRequireDefault(require("./aria-utils"));
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
7
|
/**
|
|
14
8
|
* @constructor
|
|
15
9
|
* @desc Dialog object providing modal focus management.
|
|
@@ -29,55 +23,45 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
23
|
*/
|
|
30
24
|
var aria = aria || {};
|
|
31
25
|
var tabEvent;
|
|
32
|
-
|
|
33
26
|
aria.Dialog = function (dialog, focusAfterClosed, focusFirst) {
|
|
34
27
|
var _this = this;
|
|
35
|
-
|
|
36
28
|
this.dialogNode = dialog;
|
|
37
29
|
if (this.dialogNode === null || this.dialogNode.getAttribute('role') !== 'dialog') {
|
|
38
30
|
throw new Error('Dialog() requires a DOM element with ARIA role of dialog.');
|
|
39
31
|
}
|
|
40
|
-
|
|
41
32
|
if (typeof focusAfterClosed === 'string') {
|
|
42
33
|
this.focusAfterClosed = document.getElementById(focusAfterClosed);
|
|
43
|
-
} else if (
|
|
34
|
+
} else if (typeof focusAfterClosed === 'object') {
|
|
44
35
|
this.focusAfterClosed = focusAfterClosed;
|
|
45
36
|
} else {
|
|
46
37
|
this.focusAfterClosed = null;
|
|
47
38
|
}
|
|
48
|
-
|
|
49
39
|
if (typeof focusFirst === 'string') {
|
|
50
40
|
this.focusFirst = document.getElementById(focusFirst);
|
|
51
|
-
} else if (
|
|
41
|
+
} else if (typeof focusFirst === 'object') {
|
|
52
42
|
this.focusFirst = focusFirst;
|
|
53
43
|
} else {
|
|
54
44
|
this.focusFirst = null;
|
|
55
45
|
}
|
|
56
|
-
|
|
57
46
|
if (this.focusFirst) {
|
|
58
47
|
this.focusFirst.focus();
|
|
59
48
|
} else {
|
|
60
|
-
|
|
49
|
+
_ariaUtils.default.focusFirstDescendant(this.dialogNode);
|
|
61
50
|
}
|
|
62
|
-
|
|
63
51
|
this.lastFocus = document.activeElement;
|
|
64
52
|
tabEvent = function tabEvent(e) {
|
|
65
53
|
_this.trapFocus(e);
|
|
66
54
|
};
|
|
67
55
|
this.addListeners();
|
|
68
56
|
};
|
|
69
|
-
|
|
70
57
|
aria.Dialog.prototype.addListeners = function () {
|
|
71
58
|
document.addEventListener('focus', tabEvent, true);
|
|
72
59
|
};
|
|
73
|
-
|
|
74
60
|
aria.Dialog.prototype.removeListeners = function () {
|
|
75
61
|
document.removeEventListener('focus', tabEvent, true);
|
|
76
62
|
};
|
|
77
|
-
|
|
78
63
|
aria.Dialog.prototype.closeDialog = function () {
|
|
79
64
|
var _this2 = this;
|
|
80
|
-
|
|
81
65
|
this.removeListeners();
|
|
82
66
|
if (this.focusAfterClosed) {
|
|
83
67
|
setTimeout(function () {
|
|
@@ -85,20 +69,18 @@ aria.Dialog.prototype.closeDialog = function () {
|
|
|
85
69
|
});
|
|
86
70
|
}
|
|
87
71
|
};
|
|
88
|
-
|
|
89
72
|
aria.Dialog.prototype.trapFocus = function (event) {
|
|
90
|
-
if (
|
|
73
|
+
if (_ariaUtils.default.IgnoreUtilFocusChanges) {
|
|
91
74
|
return;
|
|
92
75
|
}
|
|
93
76
|
if (this.dialogNode.contains(event.target)) {
|
|
94
77
|
this.lastFocus = event.target;
|
|
95
78
|
} else {
|
|
96
|
-
|
|
79
|
+
_ariaUtils.default.focusFirstDescendant(this.dialogNode);
|
|
97
80
|
if (this.lastFocus === document.activeElement) {
|
|
98
|
-
|
|
81
|
+
_ariaUtils.default.focusLastDescendant(this.dialogNode);
|
|
99
82
|
}
|
|
100
83
|
this.lastFocus = document.activeElement;
|
|
101
84
|
}
|
|
102
85
|
};
|
|
103
|
-
|
|
104
|
-
exports.default = aria.Dialog;
|
|
86
|
+
var _default = exports.default = aria.Dialog;
|
package/lib/utils/aria-utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
4
5
|
var aria = aria || {};
|
|
5
|
-
|
|
6
6
|
aria.Utils = aria.Utils || {};
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -59,16 +59,13 @@ aria.Utils.attemptFocus = function (element) {
|
|
|
59
59
|
aria.Utils.IgnoreUtilFocusChanges = false;
|
|
60
60
|
return document.activeElement === element;
|
|
61
61
|
};
|
|
62
|
-
|
|
63
62
|
aria.Utils.isFocusable = function (element) {
|
|
64
63
|
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
|
|
65
64
|
return true;
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
if (element.disabled) {
|
|
69
67
|
return false;
|
|
70
68
|
}
|
|
71
|
-
|
|
72
69
|
switch (element.nodeName) {
|
|
73
70
|
case 'A':
|
|
74
71
|
return !!element.href && element.rel !== 'ignore';
|
|
@@ -91,8 +88,7 @@ aria.Utils.isFocusable = function (element) {
|
|
|
91
88
|
* @param {*} opts
|
|
92
89
|
*/
|
|
93
90
|
aria.Utils.triggerEvent = function (elm, name) {
|
|
94
|
-
var eventName
|
|
95
|
-
|
|
91
|
+
var eventName;
|
|
96
92
|
if (/^mouse|click/.test(name)) {
|
|
97
93
|
eventName = 'MouseEvents';
|
|
98
94
|
} else if (/^key/.test(name)) {
|
|
@@ -101,17 +97,13 @@ aria.Utils.triggerEvent = function (elm, name) {
|
|
|
101
97
|
eventName = 'HTMLEvents';
|
|
102
98
|
}
|
|
103
99
|
var evt = document.createEvent(eventName);
|
|
104
|
-
|
|
105
|
-
for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
100
|
+
for (var _len = arguments.length, opts = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
106
101
|
opts[_key - 2] = arguments[_key];
|
|
107
102
|
}
|
|
108
|
-
|
|
109
103
|
evt.initEvent.apply(evt, [name].concat(opts));
|
|
110
104
|
elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
|
|
111
|
-
|
|
112
105
|
return elm;
|
|
113
106
|
};
|
|
114
|
-
|
|
115
107
|
aria.Utils.keys = {
|
|
116
108
|
tab: 9,
|
|
117
109
|
enter: 13,
|
|
@@ -119,7 +111,7 @@ aria.Utils.keys = {
|
|
|
119
111
|
left: 37,
|
|
120
112
|
up: 38,
|
|
121
113
|
right: 39,
|
|
122
|
-
down: 40
|
|
114
|
+
down: 40,
|
|
115
|
+
esc: 27
|
|
123
116
|
};
|
|
124
|
-
|
|
125
|
-
exports.default = aria.Utils;
|
|
117
|
+
var _default = exports.default = aria.Utils;
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
var _vue = require(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _dom = require('element-ui/lib/utils/dom');
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _vue = _interopRequireDefault(require("vue"));
|
|
6
|
+
var _dom = require("./dom");
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
8
|
var nodeList = [];
|
|
14
9
|
var ctx = '@@clickoutsideContext';
|
|
15
|
-
|
|
16
|
-
var startClick = void 0;
|
|
10
|
+
var startClick;
|
|
17
11
|
var seed = 0;
|
|
18
|
-
|
|
19
|
-
!_vue2.default.prototype.$isServer && (0, _dom.on)(document, 'mousedown', function (e) {
|
|
12
|
+
!_vue.default.prototype.$isServer && (0, _dom.on)(document, 'mousedown', function (e) {
|
|
20
13
|
return startClick = e;
|
|
21
14
|
});
|
|
22
|
-
|
|
23
|
-
!_vue2.default.prototype.$isServer && (0, _dom.on)(document, 'mouseup', function (e) {
|
|
15
|
+
!_vue.default.prototype.$isServer && (0, _dom.on)(document, 'mouseup', function (e) {
|
|
24
16
|
nodeList.forEach(function (node) {
|
|
25
17
|
return node[ctx].documentHandler(e, startClick);
|
|
26
18
|
});
|
|
27
19
|
});
|
|
28
|
-
|
|
29
20
|
function createDocumentHandler(el, binding, vnode) {
|
|
30
|
-
return function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
return function (mouseup, mousedown) {
|
|
22
|
+
if (mouseup === void 0) {
|
|
23
|
+
mouseup = {};
|
|
24
|
+
}
|
|
25
|
+
if (mousedown === void 0) {
|
|
26
|
+
mousedown = {};
|
|
27
|
+
}
|
|
34
28
|
if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target))) return;
|
|
35
|
-
|
|
36
29
|
if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) {
|
|
37
30
|
vnode.context[el[ctx].methodName]();
|
|
38
31
|
} else {
|
|
@@ -49,7 +42,7 @@ function createDocumentHandler(el, binding, vnode) {
|
|
|
49
42
|
* <div v-element-clickoutside="handleClose">
|
|
50
43
|
* ```
|
|
51
44
|
*/
|
|
52
|
-
exports.default = {
|
|
45
|
+
var _default = exports.default = {
|
|
53
46
|
bind: function bind(el, binding, vnode) {
|
|
54
47
|
nodeList.push(el);
|
|
55
48
|
var id = seed++;
|
|
@@ -67,7 +60,6 @@ exports.default = {
|
|
|
67
60
|
},
|
|
68
61
|
unbind: function unbind(el) {
|
|
69
62
|
var len = nodeList.length;
|
|
70
|
-
|
|
71
63
|
for (var i = 0; i < len; i++) {
|
|
72
64
|
if (nodeList[i][ctx].id === el[ctx].id) {
|
|
73
65
|
nodeList.splice(i, 1);
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.validateRangeInOneMonth = exports.toDate = exports.timeWithinRange = exports.range = exports.prevYear = exports.prevMonth = exports.prevDate = exports.parseDate = exports.nextYear = exports.nextMonth = exports.nextDate = exports.modifyWithTimeString = exports.modifyTime = exports.modifyDate = exports.limitTimeRange = exports.isDateObject = exports.isDate = exports.getWeekNumber = exports.getStartDateOfMonth = exports.getRangeMinutes = exports.getRangeHours = exports.getPrevMonthLastDays = exports.getMonthDays = exports.getI18nSettings = exports.getFirstDayOfMonth = exports.getDayCountOfYear = exports.getDayCountOfMonth = exports.formatDate = exports.extractTimeFormat = exports.extractDateFormat = exports.clearTime = exports.clearMilliseconds = exports.changeYearMonthAndClampDate = void 0;
|
|
5
|
+
var _date = _interopRequireDefault(require("./date"));
|
|
6
|
+
var _locale = require("../locale");
|
|
7
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
var weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
|
9
|
+
var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
10
|
+
var newArray = function newArray(start, end) {
|
|
11
|
+
var result = [];
|
|
12
|
+
for (var i = start; i <= end; i++) {
|
|
13
|
+
result.push(i);
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
var getI18nSettings = exports.getI18nSettings = function getI18nSettings() {
|
|
18
|
+
return {
|
|
19
|
+
dayNamesShort: weeks.map(function (week) {
|
|
20
|
+
return (0, _locale.t)("el.datepicker.weeks." + week);
|
|
21
|
+
}),
|
|
22
|
+
dayNames: weeks.map(function (week) {
|
|
23
|
+
return (0, _locale.t)("el.datepicker.weeks." + week);
|
|
24
|
+
}),
|
|
25
|
+
monthNamesShort: months.map(function (month) {
|
|
26
|
+
return (0, _locale.t)("el.datepicker.months." + month);
|
|
27
|
+
}),
|
|
28
|
+
monthNames: months.map(function (month, index) {
|
|
29
|
+
return (0, _locale.t)("el.datepicker.month" + (index + 1));
|
|
30
|
+
}),
|
|
31
|
+
amPm: ['am', 'pm']
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
var toDate = exports.toDate = function toDate(date) {
|
|
35
|
+
return isDate(date) ? new Date(date) : null;
|
|
36
|
+
};
|
|
37
|
+
var isDate = exports.isDate = function isDate(date) {
|
|
38
|
+
if (date === null || date === undefined) return false;
|
|
39
|
+
if (isNaN(new Date(date).getTime())) return false;
|
|
40
|
+
if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
|
|
41
|
+
return true;
|
|
42
|
+
};
|
|
43
|
+
var isDateObject = exports.isDateObject = function isDateObject(val) {
|
|
44
|
+
return val instanceof Date;
|
|
45
|
+
};
|
|
46
|
+
var formatDate = exports.formatDate = function formatDate(date, format) {
|
|
47
|
+
date = toDate(date);
|
|
48
|
+
if (!date) return '';
|
|
49
|
+
return _date.default.format(date, format || 'yyyy-MM-dd', getI18nSettings());
|
|
50
|
+
};
|
|
51
|
+
var parseDate = exports.parseDate = function parseDate(string, format) {
|
|
52
|
+
return _date.default.parse(string, format || 'yyyy-MM-dd', getI18nSettings());
|
|
53
|
+
};
|
|
54
|
+
var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {
|
|
55
|
+
if (isNaN(+month)) return 31;
|
|
56
|
+
return new Date(year, +month + 1, 0).getDate();
|
|
57
|
+
};
|
|
58
|
+
var getDayCountOfYear = exports.getDayCountOfYear = function getDayCountOfYear(year) {
|
|
59
|
+
var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
|
|
60
|
+
return isLeapYear ? 366 : 365;
|
|
61
|
+
};
|
|
62
|
+
var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {
|
|
63
|
+
var temp = new Date(date.getTime());
|
|
64
|
+
temp.setDate(1);
|
|
65
|
+
return temp.getDay();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
|
|
69
|
+
// {prev, next} Date should work for Daylight Saving Time
|
|
70
|
+
// Adding 24 * 60 * 60 * 1000 does not work in the above scenario
|
|
71
|
+
var prevDate = exports.prevDate = function prevDate(date, amount) {
|
|
72
|
+
if (amount === void 0) {
|
|
73
|
+
amount = 1;
|
|
74
|
+
}
|
|
75
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
|
|
76
|
+
};
|
|
77
|
+
var nextDate = exports.nextDate = function nextDate(date, amount) {
|
|
78
|
+
if (amount === void 0) {
|
|
79
|
+
amount = 1;
|
|
80
|
+
}
|
|
81
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
82
|
+
};
|
|
83
|
+
var getStartDateOfMonth = exports.getStartDateOfMonth = function getStartDateOfMonth(year, month) {
|
|
84
|
+
var result = new Date(year, month, 1);
|
|
85
|
+
var day = result.getDay();
|
|
86
|
+
if (day === 0) {
|
|
87
|
+
return prevDate(result, 7);
|
|
88
|
+
} else {
|
|
89
|
+
return prevDate(result, day);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var getWeekNumber = exports.getWeekNumber = function getWeekNumber(src) {
|
|
93
|
+
if (!isDate(src)) return null;
|
|
94
|
+
var date = new Date(src.getTime());
|
|
95
|
+
date.setHours(0, 0, 0, 0);
|
|
96
|
+
// Thursday in current week decides the year.
|
|
97
|
+
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
|
|
98
|
+
// January 4 is always in week 1.
|
|
99
|
+
var week1 = new Date(date.getFullYear(), 0, 4);
|
|
100
|
+
// Adjust to Thursday in week 1 and count number of weeks from date to week 1.
|
|
101
|
+
// Rounding should be fine for Daylight Saving Time. Its shift should never be more than 12 hours.
|
|
102
|
+
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);
|
|
103
|
+
};
|
|
104
|
+
var getRangeHours = exports.getRangeHours = function getRangeHours(ranges) {
|
|
105
|
+
var hours = [];
|
|
106
|
+
var disabledHours = [];
|
|
107
|
+
(ranges || []).forEach(function (range) {
|
|
108
|
+
var value = range.map(function (date) {
|
|
109
|
+
return date.getHours();
|
|
110
|
+
});
|
|
111
|
+
disabledHours = disabledHours.concat(newArray(value[0], value[1]));
|
|
112
|
+
});
|
|
113
|
+
if (disabledHours.length) {
|
|
114
|
+
for (var i = 0; i < 24; i++) {
|
|
115
|
+
hours[i] = disabledHours.indexOf(i) === -1;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
for (var _i = 0; _i < 24; _i++) {
|
|
119
|
+
hours[_i] = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return hours;
|
|
123
|
+
};
|
|
124
|
+
var getPrevMonthLastDays = exports.getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
|
|
125
|
+
if (amount <= 0) return [];
|
|
126
|
+
var temp = new Date(date.getTime());
|
|
127
|
+
temp.setDate(0);
|
|
128
|
+
var lastDay = temp.getDate();
|
|
129
|
+
return range(amount).map(function (_, index) {
|
|
130
|
+
return lastDay - (amount - index - 1);
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
var getMonthDays = exports.getMonthDays = function getMonthDays(date) {
|
|
134
|
+
var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
135
|
+
var days = temp.getDate();
|
|
136
|
+
return range(days).map(function (_, index) {
|
|
137
|
+
return index + 1;
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
function setRangeData(arr, start, end, value) {
|
|
141
|
+
for (var i = start; i < end; i++) {
|
|
142
|
+
arr[i] = value;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
var getRangeMinutes = exports.getRangeMinutes = function getRangeMinutes(ranges, hour) {
|
|
146
|
+
var minutes = new Array(60);
|
|
147
|
+
if (ranges.length > 0) {
|
|
148
|
+
ranges.forEach(function (range) {
|
|
149
|
+
var start = range[0];
|
|
150
|
+
var end = range[1];
|
|
151
|
+
var startHour = start.getHours();
|
|
152
|
+
var startMinute = start.getMinutes();
|
|
153
|
+
var endHour = end.getHours();
|
|
154
|
+
var endMinute = end.getMinutes();
|
|
155
|
+
if (startHour === hour && endHour !== hour) {
|
|
156
|
+
setRangeData(minutes, startMinute, 60, true);
|
|
157
|
+
} else if (startHour === hour && endHour === hour) {
|
|
158
|
+
setRangeData(minutes, startMinute, endMinute + 1, true);
|
|
159
|
+
} else if (startHour !== hour && endHour === hour) {
|
|
160
|
+
setRangeData(minutes, 0, endMinute + 1, true);
|
|
161
|
+
} else if (startHour < hour && endHour > hour) {
|
|
162
|
+
setRangeData(minutes, 0, 60, true);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
} else {
|
|
166
|
+
setRangeData(minutes, 0, 60, true);
|
|
167
|
+
}
|
|
168
|
+
return minutes;
|
|
169
|
+
};
|
|
170
|
+
var range = exports.range = function range(n) {
|
|
171
|
+
// see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
|
|
172
|
+
return Array.apply(null, {
|
|
173
|
+
length: n
|
|
174
|
+
}).map(function (_, n) {
|
|
175
|
+
return n;
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
var modifyDate = exports.modifyDate = function modifyDate(date, y, m, d) {
|
|
179
|
+
return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
180
|
+
};
|
|
181
|
+
var modifyTime = exports.modifyTime = function modifyTime(date, h, m, s) {
|
|
182
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
|
|
183
|
+
};
|
|
184
|
+
var modifyWithTimeString = exports.modifyWithTimeString = function modifyWithTimeString(date, time) {
|
|
185
|
+
if (date == null || !time) {
|
|
186
|
+
return date;
|
|
187
|
+
}
|
|
188
|
+
time = parseDate(time, 'HH:mm:ss');
|
|
189
|
+
return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
|
|
190
|
+
};
|
|
191
|
+
var clearTime = exports.clearTime = function clearTime(date) {
|
|
192
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
193
|
+
};
|
|
194
|
+
var clearMilliseconds = exports.clearMilliseconds = function clearMilliseconds(date) {
|
|
195
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
|
|
196
|
+
};
|
|
197
|
+
var limitTimeRange = exports.limitTimeRange = function limitTimeRange(date, ranges, format) {
|
|
198
|
+
if (format === void 0) {
|
|
199
|
+
format = 'HH:mm:ss';
|
|
200
|
+
}
|
|
201
|
+
// TODO: refactory a more elegant solution
|
|
202
|
+
if (ranges.length === 0) return date;
|
|
203
|
+
var normalizeDate = function normalizeDate(date) {
|
|
204
|
+
return _date.default.parse(_date.default.format(date, format), format);
|
|
205
|
+
};
|
|
206
|
+
var ndate = normalizeDate(date);
|
|
207
|
+
var nranges = ranges.map(function (range) {
|
|
208
|
+
return range.map(normalizeDate);
|
|
209
|
+
});
|
|
210
|
+
if (nranges.some(function (nrange) {
|
|
211
|
+
return ndate >= nrange[0] && ndate <= nrange[1];
|
|
212
|
+
})) return date;
|
|
213
|
+
var minDate = nranges[0][0];
|
|
214
|
+
var maxDate = nranges[0][0];
|
|
215
|
+
nranges.forEach(function (nrange) {
|
|
216
|
+
minDate = new Date(Math.min(nrange[0], minDate));
|
|
217
|
+
maxDate = new Date(Math.max(nrange[1], minDate));
|
|
218
|
+
});
|
|
219
|
+
var ret = ndate < minDate ? minDate : maxDate;
|
|
220
|
+
// preserve Year/Month/Date
|
|
221
|
+
return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
|
|
222
|
+
};
|
|
223
|
+
var timeWithinRange = exports.timeWithinRange = function timeWithinRange(date, selectableRange, format) {
|
|
224
|
+
var limitedDate = limitTimeRange(date, selectableRange, format);
|
|
225
|
+
return limitedDate.getTime() === date.getTime();
|
|
226
|
+
};
|
|
227
|
+
var changeYearMonthAndClampDate = exports.changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
|
|
228
|
+
// clamp date to the number of days in `year`, `month`
|
|
229
|
+
// eg: (2010-1-31, 2010, 2) => 2010-2-28
|
|
230
|
+
var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
|
|
231
|
+
return modifyDate(date, year, month, monthDate);
|
|
232
|
+
};
|
|
233
|
+
var prevMonth = exports.prevMonth = function prevMonth(date) {
|
|
234
|
+
var year = date.getFullYear();
|
|
235
|
+
var month = date.getMonth();
|
|
236
|
+
return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
|
|
237
|
+
};
|
|
238
|
+
var nextMonth = exports.nextMonth = function nextMonth(date) {
|
|
239
|
+
var year = date.getFullYear();
|
|
240
|
+
var month = date.getMonth();
|
|
241
|
+
return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
|
|
242
|
+
};
|
|
243
|
+
var prevYear = exports.prevYear = function prevYear(date, amount) {
|
|
244
|
+
if (amount === void 0) {
|
|
245
|
+
amount = 1;
|
|
246
|
+
}
|
|
247
|
+
var year = date.getFullYear();
|
|
248
|
+
var month = date.getMonth();
|
|
249
|
+
return changeYearMonthAndClampDate(date, year - amount, month);
|
|
250
|
+
};
|
|
251
|
+
var nextYear = exports.nextYear = function nextYear(date, amount) {
|
|
252
|
+
if (amount === void 0) {
|
|
253
|
+
amount = 1;
|
|
254
|
+
}
|
|
255
|
+
var year = date.getFullYear();
|
|
256
|
+
var month = date.getMonth();
|
|
257
|
+
return changeYearMonthAndClampDate(date, year + amount, month);
|
|
258
|
+
};
|
|
259
|
+
var extractDateFormat = exports.extractDateFormat = function extractDateFormat(format) {
|
|
260
|
+
return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
|
|
261
|
+
};
|
|
262
|
+
var extractTimeFormat = exports.extractTimeFormat = function extractTimeFormat(format) {
|
|
263
|
+
return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
|
|
264
|
+
};
|
|
265
|
+
var validateRangeInOneMonth = exports.validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
|
|
266
|
+
return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
|
|
267
|
+
};
|