easy-component-ui 2.1.0 → 3.0.0
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 +21 -21
- package/README.md +162 -90
- package/dist/assets/icon.css +1 -0
- package/dist/components/Base.js +872 -0
- package/dist/components/ea-alert.js +196 -0
- package/dist/components/ea-avatar.js +159 -0
- package/dist/components/ea-backtop.js +136 -0
- package/dist/components/ea-badge.js +144 -0
- package/dist/components/ea-breadcrumb.js +148 -0
- package/dist/components/ea-button.js +261 -0
- package/dist/components/ea-calendar.js +10 -0
- package/dist/components/ea-calendar2.js +673 -0
- package/dist/components/ea-card.js +85 -0
- package/dist/components/ea-carousel.js +374 -0
- package/dist/components/ea-checkbox.js +446 -0
- package/dist/components/ea-collapse.js +293 -0
- package/dist/components/ea-color-picker.js +888 -0
- package/dist/components/ea-container.js +177 -0
- package/dist/components/ea-countdown.js +121 -0
- package/dist/components/ea-date-picker.js +649 -0
- package/dist/components/ea-descriptions.js +411 -0
- package/dist/components/ea-dialog.js +249 -0
- package/dist/components/ea-drawer.js +194 -0
- package/dist/components/ea-dropdown.js +228 -0
- package/dist/components/ea-empty.js +85 -0
- package/dist/components/ea-icon.js +68 -0
- package/dist/components/ea-image-preview.js +488 -0
- package/dist/components/ea-image.js +302 -0
- package/dist/components/ea-infinite-scroll.js +109 -0
- package/dist/components/ea-input-number.js +367 -0
- package/dist/components/ea-input.js +588 -0
- package/dist/components/ea-layout.js +125 -0
- package/dist/components/ea-link.js +95 -0
- package/dist/components/ea-loading.js +151 -0
- package/dist/components/ea-menu.js +417 -0
- package/dist/components/ea-message-box.js +624 -0
- package/dist/components/ea-message.js +251 -0
- package/dist/components/ea-notification.js +331 -0
- package/dist/components/ea-overlay.js +161 -0
- package/dist/components/ea-page-header.js +108 -0
- package/dist/components/ea-pagination.js +480 -0
- package/dist/components/ea-popconfirm.js +220 -0
- package/dist/components/ea-popover.js +123 -0
- package/dist/components/ea-popper.js +203 -0
- package/dist/components/ea-progress.js +269 -0
- package/dist/components/ea-radio.js +364 -0
- package/dist/components/ea-rate.js +241 -0
- package/dist/components/ea-result.js +100 -0
- package/dist/components/ea-scrollbar.js +235 -0
- package/dist/components/ea-segmented.js +215 -0
- package/dist/components/ea-select.js +598 -0
- package/dist/components/ea-skeleton.js +246 -0
- package/dist/components/ea-slider.js +421 -0
- package/dist/components/ea-space.js +109 -0
- package/dist/components/ea-splitter.js +217 -0
- package/dist/components/ea-statistic.js +6 -0
- package/dist/components/ea-statistic2.js +83 -0
- package/dist/components/ea-steps.js +312 -0
- package/dist/components/ea-switch.js +271 -0
- package/dist/components/ea-table.js +1007 -0
- package/dist/components/ea-tabs.js +501 -0
- package/dist/components/ea-tag.js +234 -0
- package/dist/components/ea-text.js +103 -0
- package/dist/components/ea-time-picker.js +514 -0
- package/dist/components/ea-timeline.js +186 -0
- package/dist/components/ea-tooltip.js +121 -0
- package/dist/components/ea-tour.js +544 -0
- package/dist/components/ea-transfer.js +949 -0
- package/dist/components/ea-tree.js +1088 -0
- package/dist/components/index.js +61 -0
- package/dist/core/FormBase.js +238 -0
- package/dist/css/ea-alert.style.js +4 -0
- package/dist/css/ea-aside.style.js +4 -0
- package/dist/css/ea-avatar.style.js +4 -0
- package/dist/css/ea-backtop.style.js +4 -0
- package/dist/css/ea-badge.style.js +4 -0
- package/dist/css/ea-breadcrumb-item.style.js +4 -0
- package/dist/css/ea-breadcrumb.style.js +4 -0
- package/dist/css/ea-button-group.style.js +4 -0
- package/dist/css/ea-button.style.js +4 -0
- package/dist/css/ea-calendar.style.js +4 -0
- package/dist/css/ea-card.style.js +4 -0
- package/dist/css/ea-carousel-item.style.js +4 -0
- package/dist/css/ea-carousel.style.js +4 -0
- package/dist/css/ea-check-tag.style.js +4 -0
- package/dist/css/ea-checkbox-group.style.js +4 -0
- package/dist/css/ea-checkbox.style.js +4 -0
- package/dist/css/ea-col.style.js +4 -0
- package/dist/css/ea-collapse-item.style.js +4 -0
- package/dist/css/ea-collapse.style.js +4 -0
- package/dist/css/ea-color-picker-panel.style.js +4 -0
- package/dist/css/ea-color-picker.style.js +4 -0
- package/dist/css/ea-container.style.js +4 -0
- package/dist/css/ea-date-picker.style.js +4 -0
- package/dist/css/ea-descriptions-item.style.js +4 -0
- package/dist/css/ea-descriptions.style.js +4 -0
- package/dist/css/ea-dialog.style.js +4 -0
- package/dist/css/ea-drawer.style.js +4 -0
- package/dist/css/ea-dropdown-item.style.js +4 -0
- package/dist/css/ea-dropdown-menu.style.js +4 -0
- package/dist/css/ea-dropdown.style.js +4 -0
- package/dist/css/ea-empty.style.js +4 -0
- package/dist/css/ea-footer.style.js +4 -0
- package/dist/css/ea-header.style.js +4 -0
- package/dist/css/ea-icon.style.js +4 -0
- package/dist/css/ea-image-preview.style.js +4 -0
- package/dist/css/ea-image.style.js +4 -0
- package/dist/css/ea-infinite-scroll.style.js +4 -0
- package/dist/css/ea-input-number.style.js +4 -0
- package/dist/css/ea-input.style.js +4 -0
- package/dist/css/ea-link.style.js +4 -0
- package/dist/css/ea-main.style.js +4 -0
- package/dist/css/ea-menu-item-group.style.js +4 -0
- package/dist/css/ea-menu-item.style.js +4 -0
- package/dist/css/ea-menu.style.js +4 -0
- package/dist/css/ea-message-box.style.js +4 -0
- package/dist/css/ea-message.style.js +4 -0
- package/dist/css/ea-notification.style.js +4 -0
- package/dist/css/ea-option-gropu.style.js +4 -0
- package/dist/css/ea-option.style.js +4 -0
- package/dist/css/ea-overlay.style.js +4 -0
- package/dist/css/ea-page-header.style.js +4 -0
- package/dist/css/ea-pagination.style.js +4 -0
- package/dist/css/ea-popconfirm.style.js +4 -0
- package/dist/css/ea-popover.style.js +4 -0
- package/dist/css/ea-popper.style.js +4 -0
- package/dist/css/ea-progress.style.js +4 -0
- package/dist/css/ea-radio-group.style.js +4 -0
- package/dist/css/ea-radio.style.js +4 -0
- package/dist/css/ea-rate.style.js +4 -0
- package/dist/css/ea-result.style.js +4 -0
- package/dist/css/ea-row.style.js +4 -0
- package/dist/css/ea-scrollbar.style.js +4 -0
- package/dist/css/ea-segmented.style.js +4 -0
- package/dist/css/ea-select.style.js +4 -0
- package/dist/css/ea-skeleton-item.style.js +4 -0
- package/dist/css/ea-skeleton.style.js +4 -0
- package/dist/css/ea-slider.style.js +4 -0
- package/dist/css/ea-space.style.js +4 -0
- package/dist/css/ea-splitter-bar.style.js +4 -0
- package/dist/css/ea-splitter-panel.style.js +4 -0
- package/dist/css/ea-splitter.style.js +4 -0
- package/dist/css/ea-statistic.style.js +4 -0
- package/dist/css/ea-step.style.js +4 -0
- package/dist/css/ea-steps.style.js +4 -0
- package/dist/css/ea-sub-menu.style.js +4 -0
- package/dist/css/ea-switch.style.js +4 -0
- package/dist/css/ea-tab-panel.style.js +4 -0
- package/dist/css/ea-tab.style.js +4 -0
- package/dist/css/ea-table.style.js +4 -0
- package/dist/css/ea-tabs.style.js +4 -0
- package/dist/css/ea-tag.style.js +4 -0
- package/dist/css/ea-text.style.js +4 -0
- package/dist/css/ea-time-picker.style.js +4 -0
- package/dist/css/ea-timeline-item.style.js +4 -0
- package/dist/css/ea-timeline.style.js +4 -0
- package/dist/css/ea-tooltip.style.js +4 -0
- package/dist/css/ea-tour-step.style.js +4 -0
- package/dist/css/ea-tour.style.js +4 -0
- package/dist/css/ea-transfer.style.js +5 -0
- package/dist/css/ea-tree.style.js +6 -0
- package/dist/css/ea-ui-component.style.js +4 -0
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +439 -0
- package/dist/utils/I18nManager.js +218 -0
- package/dist/utils/Utils.js +65 -0
- package/dist/utils/Variables.js +19 -0
- package/dist/utils/timeout.js +9 -0
- package/package.json +294 -11
- package/build/components/Base.js +0 -1
- package/build/components/ea-alert/index.js +0 -1
- package/build/components/ea-alert/src/style/stylesheet.js +0 -1
- package/build/components/ea-aside/index.js +0 -1
- package/build/components/ea-avatar/index.js +0 -1
- package/build/components/ea-avatar/src/assets/defaultAvatar.js +0 -1
- package/build/components/ea-avatar/src/assets/errorAvatar.js +0 -1
- package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -1
- package/build/components/ea-avatar/src/style/stylesheet.js +0 -1
- package/build/components/ea-backtop/index.js +0 -1
- package/build/components/ea-backtop/src/style/stylesheet.js +0 -1
- package/build/components/ea-badge/index.js +0 -1
- package/build/components/ea-badge/src/style/stylesheet.js +0 -1
- package/build/components/ea-breadcrumb/index.js +0 -1
- package/build/components/ea-breadcrumb/src/style/stylesheet.js +0 -1
- package/build/components/ea-breadcrumb-item/index.js +0 -1
- package/build/components/ea-breadcrumb-item/src/style/style.js +0 -1
- package/build/components/ea-button/index.js +0 -1
- package/build/components/ea-button/src/components/ButtonComm.js +0 -1
- package/build/components/ea-button/src/components/HrefComm.js +0 -1
- package/build/components/ea-button/src/style/stylesheet.js +0 -1
- package/build/components/ea-button-group/index.js +0 -1
- package/build/components/ea-button-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-calendar/index.js +0 -1
- package/build/components/ea-calendar/src/style/stylesheet.js +0 -1
- package/build/components/ea-calendar/src/utils/createChangerElement.js +0 -1
- package/build/components/ea-calendar/src/utils/createThead.js +0 -1
- package/build/components/ea-calendar/src/utils/getDate.js +0 -1
- package/build/components/ea-calendar/src/utils/getUserWeekStart.js +0 -1
- package/build/components/ea-card/index.js +0 -1
- package/build/components/ea-card/src/style/stylesheet.js +0 -1
- package/build/components/ea-carousel/index.js +0 -1
- package/build/components/ea-carousel/src/style/stylesheet.js +0 -1
- package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -1
- package/build/components/ea-carousel-item/index.js +0 -1
- package/build/components/ea-carousel-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-checkbox/index.js +0 -1
- package/build/components/ea-checkbox/src/style/stylesheet.js +0 -1
- package/build/components/ea-checkbox-group/index.js +0 -1
- package/build/components/ea-checkbox-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-collapse/index.js +0 -1
- package/build/components/ea-collapse-item/index.js +0 -1
- package/build/components/ea-collapse-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-container/index.js +0 -1
- package/build/components/ea-date-picker/index.js +0 -1
- package/build/components/ea-date-picker/src/style/stylesheet.js +0 -1
- package/build/components/ea-descriptions/index.js +0 -1
- package/build/components/ea-descriptions/src/components/contentTemplate.js +0 -1
- package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -1
- package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -1
- package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -1
- package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -1
- package/build/components/ea-descriptions/src/style/stylesheet.js +0 -1
- package/build/components/ea-descriptions-item/index.js +0 -1
- package/build/components/ea-descriptions-item/src/stylesheet.js +0 -1
- package/build/components/ea-drawer/index.js +0 -1
- package/build/components/ea-drawer/src/style/stylesheet.js +0 -1
- package/build/components/ea-empty/index.js +0 -1
- package/build/components/ea-empty/src/assets/emptyStatusSVG.js +0 -1
- package/build/components/ea-empty/src/style/stylesheet.js +0 -1
- package/build/components/ea-footer/index.js +0 -1
- package/build/components/ea-form/index.js +0 -1
- package/build/components/ea-form-item/index.js +0 -1
- package/build/components/ea-form-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-header/index.js +0 -1
- package/build/components/ea-icon/config.json +0 -1030
- package/build/components/ea-icon/css/fontello.css +0 -312
- package/build/components/ea-icon/font/fontello.eot +0 -0
- package/build/components/ea-icon/font/fontello.svg +0 -350
- package/build/components/ea-icon/font/fontello.ttf +0 -0
- package/build/components/ea-icon/font/fontello.woff +0 -0
- package/build/components/ea-icon/font/fontello.woff2 +0 -0
- package/build/components/ea-icon/index.css +0 -1
- package/build/components/ea-icon/index.js +0 -1
- package/build/components/ea-image/index.js +0 -1
- package/build/components/ea-image/src/assets/errorImage.js +0 -1
- package/build/components/ea-image/src/style/stylesheet.js +0 -1
- package/build/components/ea-image/src/utils/createPreviewTools.js +0 -1
- package/build/components/ea-infinite-scroll/index.js +0 -1
- package/build/components/ea-infinite-scroll-item/index.js +0 -1
- package/build/components/ea-input/index.js +0 -1
- package/build/components/ea-input/src/components/createFixIcon.js +0 -1
- package/build/components/ea-input/src/components/createSuggestionBoard.js +0 -1
- package/build/components/ea-input/src/components/createWordLimitElement.js +0 -1
- package/build/components/ea-input/src/style/stylesheet.js +0 -1
- package/build/components/ea-input/src/utils/dispatchEvent.js +0 -1
- package/build/components/ea-input/src/utils/handleSearchResult.js +0 -1
- package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -1
- package/build/components/ea-input-number/index.js +0 -1
- package/build/components/ea-input-number/src/style/stylesheet.js +0 -1
- package/build/components/ea-input-number/src/utils/handleCustomEvent.js +0 -1
- package/build/components/ea-link/index.js +0 -1
- package/build/components/ea-link/src/style/stylesheet.js +0 -1
- package/build/components/ea-loading/index.js +0 -1
- package/build/components/ea-loading/src/style/stylesheet.js +0 -1
- package/build/components/ea-main/index.js +0 -1
- package/build/components/ea-menu/index.js +0 -1
- package/build/components/ea-menu/src/style/stylesheet.js +0 -1
- package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -1
- package/build/components/ea-menu-item/index.js +0 -1
- package/build/components/ea-menu-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-menu-item-group/index.js +0 -1
- package/build/components/ea-menu-item-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-message/index.js +0 -1
- package/build/components/ea-message/src/style/stylesheet.js +0 -1
- package/build/components/ea-message/src/utils/MessageClass.js +0 -1
- package/build/components/ea-message-box/index.js +0 -1
- package/build/components/ea-message-box/src/style/stylesheet.js +0 -1
- package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -1
- package/build/components/ea-option/index.js +0 -1
- package/build/components/ea-option/src/style/stylesheet.js +0 -1
- package/build/components/ea-option-gropu/index.js +0 -1
- package/build/components/ea-page-header/index.js +0 -1
- package/build/components/ea-page-header/src/style/stylesheet.js +0 -1
- package/build/components/ea-pagination/index.js +0 -1
- package/build/components/ea-pagination/src/components/getMoreItem.js +0 -1
- package/build/components/ea-pagination/src/components/getPageItem.js +0 -1
- package/build/components/ea-pagination/src/components/getShowTotalItem.js +0 -1
- package/build/components/ea-pagination/src/style/stylesheet.js +0 -1
- package/build/components/ea-pane/index.js +0 -1
- package/build/components/ea-pane/src/stylesheet.js +0 -1
- package/build/components/ea-progress/index.js +0 -1
- package/build/components/ea-progress/src/components/SVGComm.js +0 -1
- package/build/components/ea-progress/src/style/stylesheet.js +0 -1
- package/build/components/ea-radio/index.js +0 -1
- package/build/components/ea-radio/src/style/stylesheet.js +0 -1
- package/build/components/ea-radio-group/index.js +0 -1
- package/build/components/ea-rate/index.js +0 -1
- package/build/components/ea-rate/src/components/rateComm.js +0 -1
- package/build/components/ea-rate/src/style/stylesheet.js +0 -1
- package/build/components/ea-result/index.js +0 -1
- package/build/components/ea-result/src/style/stylesheet.js +0 -1
- package/build/components/ea-select/index.js +0 -1
- package/build/components/ea-select/src/style/stylesheet.js +0 -1
- package/build/components/ea-skeleton/index.js +0 -1
- package/build/components/ea-skeleton/src/style/stylesheet.js +0 -1
- package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -1
- package/build/components/ea-skeleton-item/index.js +0 -1
- package/build/components/ea-skeleton-item/src/assets/imageSVG.js +0 -1
- package/build/components/ea-skeleton-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-step/index.js +0 -1
- package/build/components/ea-step/src/style/stylesheet.js +0 -1
- package/build/components/ea-steps/index.js +0 -1
- package/build/components/ea-steps/src/style/stylesheet.js +0 -1
- package/build/components/ea-submenu/index.js +0 -1
- package/build/components/ea-submenu/src/style/stylesheet.js +0 -1
- package/build/components/ea-switch/index.js +0 -1
- package/build/components/ea-switch/src/style/stylesheet.js +0 -1
- package/build/components/ea-tab/index.js +0 -1
- package/build/components/ea-tab/src/style/stylesheet.js +0 -1
- package/build/components/ea-table/index.js +0 -1
- package/build/components/ea-table/src/style/stylesheet.js +0 -1
- package/build/components/ea-table-column/index.js +0 -1
- package/build/components/ea-tabs/index.js +0 -1
- package/build/components/ea-tabs/src/style/stylesheet.js +0 -1
- package/build/components/ea-tag/index.js +0 -1
- package/build/components/ea-tag/src/style/stylesheet.js +0 -1
- package/build/components/ea-textarea/index.js +0 -1
- package/build/components/ea-textarea/src/style/stylesheet.js +0 -1
- package/build/components/ea-time-picker/index.js +0 -1
- package/build/components/ea-time-picker/src/style/stylesheet.js +0 -1
- package/build/components/ea-timeline/index.js +0 -1
- package/build/components/ea-timeline/style/stylesheet.js +0 -1
- package/build/components/ea-timeline-item/index.js +0 -1
- package/build/components/ea-timeline-item/src/style/stylesheet.js +0 -1
- package/build/components/globalConfig.js +0 -1
- package/build/components/index.js +0 -1
- package/build/utils/Validator.js +0 -1
- package/build/utils/createElement.js +0 -1
- package/build/utils/handleDefaultAttrIsTrue.js +0 -1
- package/build/utils/handleTemplate.js +0 -1
- package/build/utils/setStyle.js +0 -1
- package/build/utils/timeout.js +0 -1
- package/components/Base.js +0 -75
- package/components/ea-alert/index.css +0 -91
- package/components/ea-alert/index.js +0 -210
- package/components/ea-alert/index.scss +0 -108
- package/components/ea-alert/src/style/stylesheet.js +0 -85
- package/components/ea-aside/index.css +0 -9
- package/components/ea-aside/index.js +0 -54
- package/components/ea-aside/index.scss +0 -12
- package/components/ea-avatar/index.css +0 -66
- package/components/ea-avatar/index.js +0 -156
- package/components/ea-avatar/index.scss +0 -59
- package/components/ea-avatar/src/assets/defaultAvatar.js +0 -12
- package/components/ea-avatar/src/assets/errorAvatar.js +0 -9
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -18
- package/components/ea-avatar/src/style/stylesheet.js +0 -61
- package/components/ea-backtop/index.css +0 -27
- package/components/ea-backtop/index.js +0 -167
- package/components/ea-backtop/index.scss +0 -29
- package/components/ea-backtop/src/style/stylesheet.js +0 -21
- package/components/ea-badge/index.css +0 -49
- package/components/ea-badge/index.js +0 -103
- package/components/ea-badge/index.scss +0 -56
- package/components/ea-badge/src/style/stylesheet.js +0 -43
- package/components/ea-breadcrumb/index.css +0 -6
- package/components/ea-breadcrumb/index.js +0 -90
- package/components/ea-breadcrumb/index.scss +0 -7
- package/components/ea-breadcrumb/src/style/stylesheet.js +0 -8
- package/components/ea-breadcrumb-item/index.css +0 -10
- package/components/ea-breadcrumb-item/index.js +0 -23
- package/components/ea-breadcrumb-item/index.scss +0 -12
- package/components/ea-breadcrumb-item/src/style/style.js +0 -12
- package/components/ea-button/index.css +0 -206
- package/components/ea-button/index.js +0 -198
- package/components/ea-button/index.scss +0 -143
- package/components/ea-button/src/components/ButtonComm.js +0 -5
- package/components/ea-button/src/components/HrefComm.js +0 -5
- package/components/ea-button/src/style/stylesheet.js +0 -208
- package/components/ea-button-group/index.css +0 -16
- package/components/ea-button-group/index.js +0 -44
- package/components/ea-button-group/index.scss +0 -20
- package/components/ea-button-group/src/style/stylesheet.js +0 -18
- package/components/ea-calendar/index.css +0 -72
- package/components/ea-calendar/index.js +0 -298
- package/components/ea-calendar/index.scss +0 -106
- package/components/ea-calendar/src/style/stylesheet.js +0 -74
- package/components/ea-calendar/src/utils/createChangerElement.js +0 -10
- package/components/ea-calendar/src/utils/createThead.js +0 -18
- package/components/ea-calendar/src/utils/getDate.js +0 -11
- package/components/ea-calendar/src/utils/getUserWeekStart.js +0 -11
- package/components/ea-card/index.css +0 -25
- package/components/ea-card/index.js +0 -51
- package/components/ea-card/index.scss +0 -24
- package/components/ea-card/src/style/stylesheet.js +0 -19
- package/components/ea-carousel/index.css +0 -103
- package/components/ea-carousel/index.js +0 -222
- package/components/ea-carousel/index.scss +0 -140
- package/components/ea-carousel/src/style/stylesheet.js +0 -105
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -9
- package/components/ea-carousel-item/index.css +0 -20
- package/components/ea-carousel-item/index.js +0 -23
- package/components/ea-carousel-item/index.scss +0 -26
- package/components/ea-carousel-item/src/style/stylesheet.js +0 -22
- package/components/ea-checkbox/index.css +0 -108
- package/components/ea-checkbox/index.js +0 -160
- package/components/ea-checkbox/index.scss +0 -141
- package/components/ea-checkbox/src/style/stylesheet.js +0 -110
- package/components/ea-checkbox-group/index.css +0 -6
- package/components/ea-checkbox-group/index.js +0 -120
- package/components/ea-checkbox-group/index.scss +0 -7
- package/components/ea-checkbox-group/src/style/stylesheet.js +0 -8
- package/components/ea-collapse/index.css +0 -0
- package/components/ea-collapse/index.js +0 -109
- package/components/ea-collapse/index.scss +0 -4
- package/components/ea-collapse-item/index.css +0 -31
- package/components/ea-collapse-item/index.js +0 -111
- package/components/ea-collapse-item/index.scss +0 -46
- package/components/ea-collapse-item/src/style/stylesheet.js +0 -33
- package/components/ea-container/index.css +0 -14
- package/components/ea-container/index.js +0 -85
- package/components/ea-container/index.scss +0 -18
- package/components/ea-date-picker/index.css +0 -17
- package/components/ea-date-picker/index.js +0 -191
- package/components/ea-date-picker/index.scss +0 -29
- package/components/ea-date-picker/src/style/stylesheet.js +0 -19
- package/components/ea-descriptions/index.css +0 -33
- package/components/ea-descriptions/index.js +0 -171
- package/components/ea-descriptions/index.scss +0 -45
- package/components/ea-descriptions/src/components/contentTemplate.js +0 -11
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -6
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -7
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -7
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -8
- package/components/ea-descriptions/src/style/stylesheet.js +0 -35
- package/components/ea-descriptions-item/index.css +0 -21
- package/components/ea-descriptions-item/index.js +0 -71
- package/components/ea-descriptions-item/index.scss +0 -29
- package/components/ea-descriptions-item/src/stylesheet.js +0 -23
- package/components/ea-drawer/index.css +0 -138
- package/components/ea-drawer/index.js +0 -251
- package/components/ea-drawer/index.scss +0 -208
- package/components/ea-drawer/src/style/stylesheet.js +0 -141
- package/components/ea-empty/index.css +0 -30
- package/components/ea-empty/index.js +0 -93
- package/components/ea-empty/index.scss +0 -30
- package/components/ea-empty/src/assets/emptyStatusSVG.js +0 -6
- package/components/ea-empty/src/style/stylesheet.js +0 -24
- package/components/ea-footer/index.css +0 -7
- package/components/ea-footer/index.js +0 -57
- package/components/ea-footer/index.scss +0 -10
- package/components/ea-form/index.css +0 -0
- package/components/ea-form/index.js +0 -121
- package/components/ea-form/index.scss +0 -0
- package/components/ea-form-item/index.css +0 -62
- package/components/ea-form-item/index.js +0 -152
- package/components/ea-form-item/index.scss +0 -83
- package/components/ea-form-item/src/style/stylesheet.js +0 -64
- package/components/ea-header/index.css +0 -7
- package/components/ea-header/index.js +0 -55
- package/components/ea-header/index.scss +0 -10
- package/components/ea-icon/config.json +0 -1030
- package/components/ea-icon/css/fontello.css +0 -312
- package/components/ea-icon/font/fontello.eot +0 -0
- package/components/ea-icon/font/fontello.svg +0 -350
- package/components/ea-icon/font/fontello.ttf +0 -0
- package/components/ea-icon/font/fontello.woff +0 -0
- package/components/ea-icon/font/fontello.woff2 +0 -0
- package/components/ea-icon/index.css +0 -1
- package/components/ea-icon/index.js +0 -84
- package/components/ea-image/index.css +0 -84
- package/components/ea-image/index.js +0 -182
- package/components/ea-image/index.scss +0 -111
- package/components/ea-image/src/assets/errorImage.js +0 -9
- package/components/ea-image/src/assets/errorImage.svg +0 -7
- package/components/ea-image/src/style/stylesheet.js +0 -86
- package/components/ea-image/src/utils/createPreviewTools.js +0 -140
- package/components/ea-infinite-scroll/index.css +0 -0
- package/components/ea-infinite-scroll/index.js +0 -119
- package/components/ea-infinite-scroll/index.scss +0 -0
- package/components/ea-infinite-scroll-item/index.css +0 -0
- package/components/ea-infinite-scroll-item/index.js +0 -18
- package/components/ea-infinite-scroll-item/index.scss +0 -0
- package/components/ea-input/index.css +0 -139
- package/components/ea-input/index.js +0 -398
- package/components/ea-input/index.scss +0 -178
- package/components/ea-input/src/components/createFixIcon.js +0 -108
- package/components/ea-input/src/components/createSuggestionBoard.js +0 -43
- package/components/ea-input/src/components/createWordLimitElement.js +0 -18
- package/components/ea-input/src/style/stylesheet.js +0 -141
- package/components/ea-input/src/utils/dispatchEvent.js +0 -9
- package/components/ea-input/src/utils/handleSearchResult.js +0 -9
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -31
- package/components/ea-input-number/index.css +0 -120
- package/components/ea-input-number/index.js +0 -308
- package/components/ea-input-number/index.scss +0 -132
- package/components/ea-input-number/src/style/stylesheet.js +0 -122
- package/components/ea-input-number/src/utils/handleCustomEvent.js +0 -5
- package/components/ea-link/index.css +0 -48
- package/components/ea-link/index.js +0 -122
- package/components/ea-link/index.scss +0 -36
- package/components/ea-link/src/style/stylesheet.js +0 -50
- package/components/ea-loading/index.css +0 -38
- package/components/ea-loading/index.js +0 -166
- package/components/ea-loading/index.scss +0 -55
- package/components/ea-loading/src/style/stylesheet.js +0 -40
- package/components/ea-main/index.css +0 -8
- package/components/ea-main/index.js +0 -32
- package/components/ea-main/index.scss +0 -11
- package/components/ea-menu/index.css +0 -19
- package/components/ea-menu/index.js +0 -131
- package/components/ea-menu/index.scss +0 -22
- package/components/ea-menu/src/style/stylesheet.js +0 -21
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -32
- package/components/ea-menu-item/index.css +0 -48
- package/components/ea-menu-item/index.js +0 -130
- package/components/ea-menu-item/index.scss +0 -62
- package/components/ea-menu-item/src/style/stylesheet.js +0 -50
- package/components/ea-menu-item-group/index.css +0 -42
- package/components/ea-menu-item-group/index.js +0 -130
- package/components/ea-menu-item-group/index.scss +0 -60
- package/components/ea-menu-item-group/src/style/stylesheet.js +0 -44
- package/components/ea-message/index.css +0 -47
- package/components/ea-message/index.js +0 -171
- package/components/ea-message/index.scss +0 -70
- package/components/ea-message/src/style/stylesheet.js +0 -48
- package/components/ea-message/src/utils/MessageClass.js +0 -67
- package/components/ea-message-box/index.css +0 -85
- package/components/ea-message-box/index.js +0 -211
- package/components/ea-message-box/index.scss +0 -113
- package/components/ea-message-box/src/style/stylesheet.js +0 -87
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -60
- package/components/ea-option/index.css +0 -24
- package/components/ea-option/index.js +0 -74
- package/components/ea-option/index.scss +0 -31
- package/components/ea-option/src/style/stylesheet.js +0 -26
- package/components/ea-option-gropu/index.css +0 -6
- package/components/ea-option-gropu/index.js +0 -57
- package/components/ea-option-gropu/index.scss +0 -8
- package/components/ea-page-header/index.css +0 -33
- package/components/ea-page-header/index.js +0 -91
- package/components/ea-page-header/index.scss +0 -44
- package/components/ea-page-header/src/style/stylesheet.js +0 -35
- package/components/ea-pagination/index.css +0 -69
- package/components/ea-pagination/index.js +0 -305
- package/components/ea-pagination/index.scss +0 -89
- package/components/ea-pagination/src/components/getMoreItem.js +0 -20
- package/components/ea-pagination/src/components/getPageItem.js +0 -11
- package/components/ea-pagination/src/components/getShowTotalItem.js +0 -7
- package/components/ea-pagination/src/style/stylesheet.js +0 -71
- package/components/ea-pane/index.css +0 -6
- package/components/ea-pane/index.js +0 -52
- package/components/ea-pane/index.scss +0 -7
- package/components/ea-pane/src/stylesheet.js +0 -8
- package/components/ea-progress/index.css +0 -61
- package/components/ea-progress/index.js +0 -249
- package/components/ea-progress/index.scss +0 -74
- package/components/ea-progress/src/components/SVGComm.js +0 -18
- package/components/ea-progress/src/style/stylesheet.js +0 -55
- package/components/ea-radio/index.css +0 -82
- package/components/ea-radio/index.js +0 -137
- package/components/ea-radio/index.scss +0 -119
- package/components/ea-radio/src/style/stylesheet.js +0 -84
- package/components/ea-radio-group/index.css +0 -3
- package/components/ea-radio-group/index.js +0 -96
- package/components/ea-radio-group/index.scss +0 -3
- package/components/ea-rate/index.css +0 -44
- package/components/ea-rate/index.js +0 -243
- package/components/ea-rate/index.scss +0 -55
- package/components/ea-rate/src/components/rateComm.js +0 -20
- package/components/ea-rate/src/style/stylesheet.js +0 -45
- package/components/ea-result/index.css +0 -37
- package/components/ea-result/index.js +0 -109
- package/components/ea-result/index.scss +0 -46
- package/components/ea-result/src/style/stylesheet.js +0 -39
- package/components/ea-select/index.css +0 -47
- package/components/ea-select/index.js +0 -312
- package/components/ea-select/index.scss +0 -70
- package/components/ea-select/src/style/stylesheet.js +0 -49
- package/components/ea-skeleton/index.css +0 -12
- package/components/ea-skeleton/index.js +0 -148
- package/components/ea-skeleton/index.scss +0 -16
- package/components/ea-skeleton/src/style/stylesheet.js +0 -14
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -7
- package/components/ea-skeleton-item/index.css +0 -69
- package/components/ea-skeleton-item/index.js +0 -82
- package/components/ea-skeleton-item/index.scss +0 -107
- package/components/ea-skeleton-item/src/assets/imageSVG.js +0 -8
- package/components/ea-skeleton-item/src/style/stylesheet.js +0 -71
- package/components/ea-step/index.css +0 -84
- package/components/ea-step/index.js +0 -230
- package/components/ea-step/index.scss +0 -110
- package/components/ea-step/src/style/stylesheet.js +0 -86
- package/components/ea-steps/index.css +0 -19
- package/components/ea-steps/index.js +0 -104
- package/components/ea-steps/index.scss +0 -23
- package/components/ea-steps/src/style/stylesheet.js +0 -21
- package/components/ea-submenu/index.css +0 -65
- package/components/ea-submenu/index.js +0 -141
- package/components/ea-submenu/index.scss +0 -88
- package/components/ea-submenu/src/style/stylesheet.js +0 -67
- package/components/ea-switch/index.css +0 -90
- package/components/ea-switch/index.js +0 -189
- package/components/ea-switch/index.scss +0 -117
- package/components/ea-switch/src/style/stylesheet.js +0 -92
- package/components/ea-tab/index.css +0 -68
- package/components/ea-tab/index.js +0 -138
- package/components/ea-tab/index.scss +0 -96
- package/components/ea-tab/src/style/stylesheet.js +0 -70
- package/components/ea-table/index.css +0 -98
- package/components/ea-table/index.js +0 -555
- package/components/ea-table/index.scss +0 -90
- package/components/ea-table/src/style/stylesheet.js +0 -100
- package/components/ea-table-column/index.css +0 -0
- package/components/ea-table-column/index.js +0 -164
- package/components/ea-table-column/index.scss +0 -0
- package/components/ea-tabs/index.css +0 -45
- package/components/ea-tabs/index.js +0 -245
- package/components/ea-tabs/index.scss +0 -64
- package/components/ea-tabs/src/style/stylesheet.js +0 -47
- package/components/ea-tag/index.css +0 -90
- package/components/ea-tag/index.js +0 -107
- package/components/ea-tag/index.scss +0 -71
- package/components/ea-tag/src/style/stylesheet.js +0 -92
- package/components/ea-textarea/index.css +0 -37
- package/components/ea-textarea/index.js +0 -277
- package/components/ea-textarea/index.scss +0 -48
- package/components/ea-textarea/src/style/stylesheet.js +0 -39
- package/components/ea-time-picker/index.css +0 -82
- package/components/ea-time-picker/index.js +0 -379
- package/components/ea-time-picker/index.scss +0 -110
- package/components/ea-time-picker/src/style/stylesheet.js +0 -84
- package/components/ea-timeline/index.css +0 -0
- package/components/ea-timeline/index.js +0 -74
- package/components/ea-timeline/index.scss +0 -1
- package/components/ea-timeline/style/stylesheet.js +0 -3
- package/components/ea-timeline-item/index.css +0 -79
- package/components/ea-timeline-item/index.js +0 -146
- package/components/ea-timeline-item/index.scss +0 -92
- package/components/ea-timeline-item/src/style/stylesheet.js +0 -81
- package/components/ea-ui-base-style.css +0 -0
- package/components/ea-ui-base-style.scss +0 -153
- package/components/globalConfig.js +0 -10
- package/components/index.js +0 -67
- package/public/logo.png +0 -0
- package/utils/Validator.js +0 -16
- package/utils/createElement.js +0 -30
- package/utils/handleDefaultAttrIsTrue.js +0 -11
- package/utils/handleTemplate.js +0 -19
- package/utils/setStyle.js +0 -8
- package/utils/timeout.js +0 -16
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var _t = (f) => {
|
|
3
|
+
throw TypeError(f);
|
|
4
|
+
};
|
|
5
|
+
var At = (f, y, t) => y in f ? Ot(f, y, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[y] = t;
|
|
6
|
+
var St = (f, y, t) => At(f, typeof y != "symbol" ? y + "" : y, t), Mt = (f, y, t) => y.has(f) || _t("Cannot " + t);
|
|
7
|
+
var o = (f, y, t) => (Mt(f, y, "read from private field"), t ? t.call(f) : y.get(f)), C = (f, y, t) => y.has(f) ? _t("Cannot add the same private member more than once") : y instanceof WeakSet ? y.add(f) : y.set(f, t), z = (f, y, t, e) => (Mt(f, y, "write to private field"), e ? e.call(f, t) : y.set(f, t), t), Dt = (f, y, t) => (Mt(f, y, "access private method"), t);
|
|
8
|
+
import { B as Tt } from "./Base.js";
|
|
9
|
+
import { s as Rt } from "../css/ea-calendar.style.js";
|
|
10
|
+
import "./ea-button.js";
|
|
11
|
+
import "./ea-select.js";
|
|
12
|
+
import { i as _ } from "../utils/I18nManager.js";
|
|
13
|
+
import { E as Ct } from "../utils/Utils.js";
|
|
14
|
+
const Ht = (f) => {
|
|
15
|
+
const y = `ea-${f}`;
|
|
16
|
+
return {
|
|
17
|
+
b: () => y,
|
|
18
|
+
cb: () => `.${y}`,
|
|
19
|
+
e: (t) => `${y}__${t}`,
|
|
20
|
+
ce: (t) => `.${y}__${t}`,
|
|
21
|
+
m: (...t) => t.map((e) => `${y}--${e}`).join(" "),
|
|
22
|
+
cm: (...t) => t.map((e) => `.${y}--${e}`).join(" "),
|
|
23
|
+
s: (...t) => t.map((e) => `is-${e}`).join(" "),
|
|
24
|
+
cs: (...t) => t.map((e) => `.is-${e}`).join(" ")
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var Lt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
28
|
+
function jt(f) {
|
|
29
|
+
return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
|
|
30
|
+
}
|
|
31
|
+
var vt = { exports: {} }, Yt;
|
|
32
|
+
function xt() {
|
|
33
|
+
return Yt || (Yt = 1, function(f, y) {
|
|
34
|
+
(function(t, e) {
|
|
35
|
+
f.exports = e();
|
|
36
|
+
})(Lt, function() {
|
|
37
|
+
var t = 1e3, e = 6e4, h = 36e5, p = "millisecond", d = "second", D = "minute", b = "hour", $ = "day", Y = "week", g = "month", F = "quarter", k = "year", m = "date", I = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, U = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, P = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(i) {
|
|
38
|
+
var a = ["th", "st", "nd", "rd"], n = i % 100;
|
|
39
|
+
return "[" + i + (a[(n - 20) % 10] || a[n] || a[0]) + "]";
|
|
40
|
+
} }, H = function(i, a, n) {
|
|
41
|
+
var s = String(i);
|
|
42
|
+
return !s || s.length >= a ? i : "" + Array(a + 1 - s.length).join(n) + i;
|
|
43
|
+
}, bt = { s: H, z: function(i) {
|
|
44
|
+
var a = -i.utcOffset(), n = Math.abs(a), s = Math.floor(n / 60), r = n % 60;
|
|
45
|
+
return (a <= 0 ? "+" : "-") + H(s, 2, "0") + ":" + H(r, 2, "0");
|
|
46
|
+
}, m: function i(a, n) {
|
|
47
|
+
if (a.date() < n.date()) return -i(n, a);
|
|
48
|
+
var s = 12 * (n.year() - a.year()) + (n.month() - a.month()), r = a.clone().add(s, g), l = n - r < 0, c = a.clone().add(s + (l ? -1 : 1), g);
|
|
49
|
+
return +(-(s + (n - r) / (l ? r - c : c - r)) || 0);
|
|
50
|
+
}, a: function(i) {
|
|
51
|
+
return i < 0 ? Math.ceil(i) || 0 : Math.floor(i);
|
|
52
|
+
}, p: function(i) {
|
|
53
|
+
return { M: g, y: k, w: Y, d: $, D: m, h: b, m: D, s: d, ms: p, Q: F }[i] || String(i || "").toLowerCase().replace(/s$/, "");
|
|
54
|
+
}, u: function(i) {
|
|
55
|
+
return i === void 0;
|
|
56
|
+
} }, v = "en", T = {};
|
|
57
|
+
T[v] = P;
|
|
58
|
+
var K = "$isDayjsObject", X = function(i) {
|
|
59
|
+
return i instanceof q || !(!i || !i[K]);
|
|
60
|
+
}, W = function i(a, n, s) {
|
|
61
|
+
var r;
|
|
62
|
+
if (!a) return v;
|
|
63
|
+
if (typeof a == "string") {
|
|
64
|
+
var l = a.toLowerCase();
|
|
65
|
+
T[l] && (r = l), n && (T[l] = n, r = l);
|
|
66
|
+
var c = a.split("-");
|
|
67
|
+
if (!r && c.length > 1) return i(c[0]);
|
|
68
|
+
} else {
|
|
69
|
+
var M = a.name;
|
|
70
|
+
T[M] = a, r = M;
|
|
71
|
+
}
|
|
72
|
+
return !s && r && (v = r), r || !s && v;
|
|
73
|
+
}, w = function(i, a) {
|
|
74
|
+
if (X(i)) return i.clone();
|
|
75
|
+
var n = typeof a == "object" ? a : {};
|
|
76
|
+
return n.date = i, n.args = arguments, new q(n);
|
|
77
|
+
}, u = bt;
|
|
78
|
+
u.l = W, u.i = X, u.w = function(i, a) {
|
|
79
|
+
return w(i, { locale: a.$L, utc: a.$u, x: a.$x, $offset: a.$offset });
|
|
80
|
+
};
|
|
81
|
+
var q = function() {
|
|
82
|
+
function i(n) {
|
|
83
|
+
this.$L = W(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[K] = !0;
|
|
84
|
+
}
|
|
85
|
+
var a = i.prototype;
|
|
86
|
+
return a.parse = function(n) {
|
|
87
|
+
this.$d = function(s) {
|
|
88
|
+
var r = s.date, l = s.utc;
|
|
89
|
+
if (r === null) return /* @__PURE__ */ new Date(NaN);
|
|
90
|
+
if (u.u(r)) return /* @__PURE__ */ new Date();
|
|
91
|
+
if (r instanceof Date) return new Date(r);
|
|
92
|
+
if (typeof r == "string" && !/Z$/i.test(r)) {
|
|
93
|
+
var c = r.match(B);
|
|
94
|
+
if (c) {
|
|
95
|
+
var M = c[2] - 1 || 0, S = (c[7] || "0").substring(0, 3);
|
|
96
|
+
return l ? new Date(Date.UTC(c[1], M, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, S)) : new Date(c[1], M, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, S);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return new Date(r);
|
|
100
|
+
}(n), this.init();
|
|
101
|
+
}, a.init = function() {
|
|
102
|
+
var n = this.$d;
|
|
103
|
+
this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
|
|
104
|
+
}, a.$utils = function() {
|
|
105
|
+
return u;
|
|
106
|
+
}, a.isValid = function() {
|
|
107
|
+
return this.$d.toString() !== I;
|
|
108
|
+
}, a.isSame = function(n, s) {
|
|
109
|
+
var r = w(n);
|
|
110
|
+
return this.startOf(s) <= r && r <= this.endOf(s);
|
|
111
|
+
}, a.isAfter = function(n, s) {
|
|
112
|
+
return w(n) < this.startOf(s);
|
|
113
|
+
}, a.isBefore = function(n, s) {
|
|
114
|
+
return this.endOf(s) < w(n);
|
|
115
|
+
}, a.$g = function(n, s, r) {
|
|
116
|
+
return u.u(n) ? this[s] : this.set(r, n);
|
|
117
|
+
}, a.unix = function() {
|
|
118
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
119
|
+
}, a.valueOf = function() {
|
|
120
|
+
return this.$d.getTime();
|
|
121
|
+
}, a.startOf = function(n, s) {
|
|
122
|
+
var r = this, l = !!u.u(s) || s, c = u.p(n), M = function(V, A) {
|
|
123
|
+
var J = u.w(r.$u ? Date.UTC(r.$y, A, V) : new Date(r.$y, A, V), r);
|
|
124
|
+
return l ? J : J.endOf($);
|
|
125
|
+
}, S = function(V, A) {
|
|
126
|
+
return u.w(r.toDate()[V].apply(r.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(A)), r);
|
|
127
|
+
}, x = this.$W, E = this.$M, j = this.$D, tt = "set" + (this.$u ? "UTC" : "");
|
|
128
|
+
switch (c) {
|
|
129
|
+
case k:
|
|
130
|
+
return l ? M(1, 0) : M(31, 11);
|
|
131
|
+
case g:
|
|
132
|
+
return l ? M(1, E) : M(0, E + 1);
|
|
133
|
+
case Y:
|
|
134
|
+
var Z = this.$locale().weekStart || 0, nt = (x < Z ? x + 7 : x) - Z;
|
|
135
|
+
return M(l ? j - nt : j + (6 - nt), E);
|
|
136
|
+
case $:
|
|
137
|
+
case m:
|
|
138
|
+
return S(tt + "Hours", 0);
|
|
139
|
+
case b:
|
|
140
|
+
return S(tt + "Minutes", 1);
|
|
141
|
+
case D:
|
|
142
|
+
return S(tt + "Seconds", 2);
|
|
143
|
+
case d:
|
|
144
|
+
return S(tt + "Milliseconds", 3);
|
|
145
|
+
default:
|
|
146
|
+
return this.clone();
|
|
147
|
+
}
|
|
148
|
+
}, a.endOf = function(n) {
|
|
149
|
+
return this.startOf(n, !1);
|
|
150
|
+
}, a.$set = function(n, s) {
|
|
151
|
+
var r, l = u.p(n), c = "set" + (this.$u ? "UTC" : ""), M = (r = {}, r[$] = c + "Date", r[m] = c + "Date", r[g] = c + "Month", r[k] = c + "FullYear", r[b] = c + "Hours", r[D] = c + "Minutes", r[d] = c + "Seconds", r[p] = c + "Milliseconds", r)[l], S = l === $ ? this.$D + (s - this.$W) : s;
|
|
152
|
+
if (l === g || l === k) {
|
|
153
|
+
var x = this.clone().set(m, 1);
|
|
154
|
+
x.$d[M](S), x.init(), this.$d = x.set(m, Math.min(this.$D, x.daysInMonth())).$d;
|
|
155
|
+
} else M && this.$d[M](S);
|
|
156
|
+
return this.init(), this;
|
|
157
|
+
}, a.set = function(n, s) {
|
|
158
|
+
return this.clone().$set(n, s);
|
|
159
|
+
}, a.get = function(n) {
|
|
160
|
+
return this[u.p(n)]();
|
|
161
|
+
}, a.add = function(n, s) {
|
|
162
|
+
var r, l = this;
|
|
163
|
+
n = Number(n);
|
|
164
|
+
var c = u.p(s), M = function(E) {
|
|
165
|
+
var j = w(l);
|
|
166
|
+
return u.w(j.date(j.date() + Math.round(E * n)), l);
|
|
167
|
+
};
|
|
168
|
+
if (c === g) return this.set(g, this.$M + n);
|
|
169
|
+
if (c === k) return this.set(k, this.$y + n);
|
|
170
|
+
if (c === $) return M(1);
|
|
171
|
+
if (c === Y) return M(7);
|
|
172
|
+
var S = (r = {}, r[D] = e, r[b] = h, r[d] = t, r)[c] || 1, x = this.$d.getTime() + n * S;
|
|
173
|
+
return u.w(x, this);
|
|
174
|
+
}, a.subtract = function(n, s) {
|
|
175
|
+
return this.add(-1 * n, s);
|
|
176
|
+
}, a.format = function(n) {
|
|
177
|
+
var s = this, r = this.$locale();
|
|
178
|
+
if (!this.isValid()) return r.invalidDate || I;
|
|
179
|
+
var l = n || "YYYY-MM-DDTHH:mm:ssZ", c = u.z(this), M = this.$H, S = this.$m, x = this.$M, E = r.weekdays, j = r.months, tt = r.meridiem, Z = function(A, J, rt, ut) {
|
|
180
|
+
return A && (A[J] || A(s, l)) || rt[J].slice(0, ut);
|
|
181
|
+
}, nt = function(A) {
|
|
182
|
+
return u.s(M % 12 || 12, A, "0");
|
|
183
|
+
}, V = tt || function(A, J, rt) {
|
|
184
|
+
var ut = A < 12 ? "AM" : "PM";
|
|
185
|
+
return rt ? ut.toLowerCase() : ut;
|
|
186
|
+
};
|
|
187
|
+
return l.replace(U, function(A, J) {
|
|
188
|
+
return J || function(rt) {
|
|
189
|
+
switch (rt) {
|
|
190
|
+
case "YY":
|
|
191
|
+
return String(s.$y).slice(-2);
|
|
192
|
+
case "YYYY":
|
|
193
|
+
return u.s(s.$y, 4, "0");
|
|
194
|
+
case "M":
|
|
195
|
+
return x + 1;
|
|
196
|
+
case "MM":
|
|
197
|
+
return u.s(x + 1, 2, "0");
|
|
198
|
+
case "MMM":
|
|
199
|
+
return Z(r.monthsShort, x, j, 3);
|
|
200
|
+
case "MMMM":
|
|
201
|
+
return Z(j, x);
|
|
202
|
+
case "D":
|
|
203
|
+
return s.$D;
|
|
204
|
+
case "DD":
|
|
205
|
+
return u.s(s.$D, 2, "0");
|
|
206
|
+
case "d":
|
|
207
|
+
return String(s.$W);
|
|
208
|
+
case "dd":
|
|
209
|
+
return Z(r.weekdaysMin, s.$W, E, 2);
|
|
210
|
+
case "ddd":
|
|
211
|
+
return Z(r.weekdaysShort, s.$W, E, 3);
|
|
212
|
+
case "dddd":
|
|
213
|
+
return E[s.$W];
|
|
214
|
+
case "H":
|
|
215
|
+
return String(M);
|
|
216
|
+
case "HH":
|
|
217
|
+
return u.s(M, 2, "0");
|
|
218
|
+
case "h":
|
|
219
|
+
return nt(1);
|
|
220
|
+
case "hh":
|
|
221
|
+
return nt(2);
|
|
222
|
+
case "a":
|
|
223
|
+
return V(M, S, !0);
|
|
224
|
+
case "A":
|
|
225
|
+
return V(M, S, !1);
|
|
226
|
+
case "m":
|
|
227
|
+
return String(S);
|
|
228
|
+
case "mm":
|
|
229
|
+
return u.s(S, 2, "0");
|
|
230
|
+
case "s":
|
|
231
|
+
return String(s.$s);
|
|
232
|
+
case "ss":
|
|
233
|
+
return u.s(s.$s, 2, "0");
|
|
234
|
+
case "SSS":
|
|
235
|
+
return u.s(s.$ms, 3, "0");
|
|
236
|
+
case "Z":
|
|
237
|
+
return c;
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}(A) || c.replace(":", "");
|
|
241
|
+
});
|
|
242
|
+
}, a.utcOffset = function() {
|
|
243
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
244
|
+
}, a.diff = function(n, s, r) {
|
|
245
|
+
var l, c = this, M = u.p(s), S = w(n), x = (S.utcOffset() - this.utcOffset()) * e, E = this - S, j = function() {
|
|
246
|
+
return u.m(c, S);
|
|
247
|
+
};
|
|
248
|
+
switch (M) {
|
|
249
|
+
case k:
|
|
250
|
+
l = j() / 12;
|
|
251
|
+
break;
|
|
252
|
+
case g:
|
|
253
|
+
l = j();
|
|
254
|
+
break;
|
|
255
|
+
case F:
|
|
256
|
+
l = j() / 3;
|
|
257
|
+
break;
|
|
258
|
+
case Y:
|
|
259
|
+
l = (E - x) / 6048e5;
|
|
260
|
+
break;
|
|
261
|
+
case $:
|
|
262
|
+
l = (E - x) / 864e5;
|
|
263
|
+
break;
|
|
264
|
+
case b:
|
|
265
|
+
l = E / h;
|
|
266
|
+
break;
|
|
267
|
+
case D:
|
|
268
|
+
l = E / e;
|
|
269
|
+
break;
|
|
270
|
+
case d:
|
|
271
|
+
l = E / t;
|
|
272
|
+
break;
|
|
273
|
+
default:
|
|
274
|
+
l = E;
|
|
275
|
+
}
|
|
276
|
+
return r ? l : u.a(l);
|
|
277
|
+
}, a.daysInMonth = function() {
|
|
278
|
+
return this.endOf(g).$D;
|
|
279
|
+
}, a.$locale = function() {
|
|
280
|
+
return T[this.$L];
|
|
281
|
+
}, a.locale = function(n, s) {
|
|
282
|
+
if (!n) return this.$L;
|
|
283
|
+
var r = this.clone(), l = W(n, s, !0);
|
|
284
|
+
return l && (r.$L = l), r;
|
|
285
|
+
}, a.clone = function() {
|
|
286
|
+
return u.w(this.$d, this);
|
|
287
|
+
}, a.toDate = function() {
|
|
288
|
+
return new Date(this.valueOf());
|
|
289
|
+
}, a.toJSON = function() {
|
|
290
|
+
return this.isValid() ? this.toISOString() : null;
|
|
291
|
+
}, a.toISOString = function() {
|
|
292
|
+
return this.$d.toISOString();
|
|
293
|
+
}, a.toString = function() {
|
|
294
|
+
return this.$d.toUTCString();
|
|
295
|
+
}, i;
|
|
296
|
+
}(), wt = q.prototype;
|
|
297
|
+
return w.prototype = wt, [["$ms", p], ["$s", d], ["$m", D], ["$H", b], ["$W", $], ["$M", g], ["$y", k], ["$D", m]].forEach(function(i) {
|
|
298
|
+
wt[i[1]] = function(a) {
|
|
299
|
+
return this.$g(a, i[0], i[1]);
|
|
300
|
+
};
|
|
301
|
+
}), w.extend = function(i, a) {
|
|
302
|
+
return i.$i || (i(a, q, w), i.$i = !0), w;
|
|
303
|
+
}, w.locale = W, w.isDayjs = X, w.unix = function(i) {
|
|
304
|
+
return w(1e3 * i);
|
|
305
|
+
}, w.en = T[v], w.Ls = T, w.p = {}, w;
|
|
306
|
+
});
|
|
307
|
+
}(vt)), vt.exports;
|
|
308
|
+
}
|
|
309
|
+
var qt = xt();
|
|
310
|
+
const O = /* @__PURE__ */ jt(qt);
|
|
311
|
+
var It = { exports: {} };
|
|
312
|
+
(function(f, y) {
|
|
313
|
+
(function(t, e) {
|
|
314
|
+
f.exports = e(xt());
|
|
315
|
+
})(Lt, function(t) {
|
|
316
|
+
function e(d) {
|
|
317
|
+
return d && typeof d == "object" && "default" in d ? d : { default: d };
|
|
318
|
+
}
|
|
319
|
+
var h = e(t), p = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(d, D) {
|
|
320
|
+
return D === "W" ? d + "周" : d + "日";
|
|
321
|
+
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(d, D) {
|
|
322
|
+
var b = 100 * d + D;
|
|
323
|
+
return b < 600 ? "凌晨" : b < 900 ? "早上" : b < 1100 ? "上午" : b < 1300 ? "中午" : b < 1800 ? "下午" : "晚上";
|
|
324
|
+
} };
|
|
325
|
+
return h.default.locale(p, null, !0), p;
|
|
326
|
+
});
|
|
327
|
+
})(It);
|
|
328
|
+
var at, ht, G, st, dt, ot, N, Q, R, L, ft, it, mt, yt, pt, et, kt, $t, lt, gt, Et, ct;
|
|
329
|
+
class Bt extends Tt {
|
|
330
|
+
constructor() {
|
|
331
|
+
super();
|
|
332
|
+
C(this, et);
|
|
333
|
+
/** @type {HTMLElement} */
|
|
334
|
+
C(this, at);
|
|
335
|
+
/** @type {HTMLElement} */
|
|
336
|
+
C(this, ht);
|
|
337
|
+
/** @type {HTMLElement} */
|
|
338
|
+
C(this, G);
|
|
339
|
+
/** @type {HTMLElement} */
|
|
340
|
+
C(this, st);
|
|
341
|
+
/** @type {HTMLTableElement} */
|
|
342
|
+
C(this, dt);
|
|
343
|
+
/** @type {HTMLTableSectionElement} */
|
|
344
|
+
C(this, ot);
|
|
345
|
+
/** @type {HTMLTableSectionElement} */
|
|
346
|
+
C(this, N);
|
|
347
|
+
/** @type {AbortController} */
|
|
348
|
+
C(this, Q, new AbortController());
|
|
349
|
+
C(this, R, {
|
|
350
|
+
/** @type {AbortController | null} */
|
|
351
|
+
dateChangeAbortController: null
|
|
352
|
+
});
|
|
353
|
+
C(this, L, {
|
|
354
|
+
isEaSelectImported: !1,
|
|
355
|
+
isEaButtonImported: !1,
|
|
356
|
+
displayDate: O()
|
|
357
|
+
});
|
|
358
|
+
St(this, "state", this.properties({
|
|
359
|
+
"controller-type": {
|
|
360
|
+
type: ["button", "select"],
|
|
361
|
+
default: "button",
|
|
362
|
+
observer: (t) => {
|
|
363
|
+
o(this, it).call(this, t);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}));
|
|
367
|
+
/**
|
|
368
|
+
* 今天按钮点击时的事件
|
|
369
|
+
*/
|
|
370
|
+
C(this, ft, () => {
|
|
371
|
+
_.locale = this.locale, O.locale(this.locale.toLowerCase());
|
|
372
|
+
const t = O();
|
|
373
|
+
o(this, L).displayDate = t, o(this, G).textContent = `${t.get("year")} ${_.t("calendar.months")[t.get("month")]}`, this.value = t;
|
|
374
|
+
});
|
|
375
|
+
/**
|
|
376
|
+
* controller-type 的渲染器
|
|
377
|
+
* @param {'button' | 'select'} [controllerType] 控制器类型
|
|
378
|
+
* @return {string} 属性值
|
|
379
|
+
*/
|
|
380
|
+
C(this, it, async (t = this["controller-type"]) => {
|
|
381
|
+
var D;
|
|
382
|
+
_.locale = this.locale, O.locale(this.locale.toLowerCase());
|
|
383
|
+
const e = this.ns, h = o(this, L).displayDate.get("year"), p = {
|
|
384
|
+
button: () => this.html(`
|
|
385
|
+
<ea-button-group class='${e.e("controller-group")}' part='controller-group' size="small">
|
|
386
|
+
<ea-button class='${e.e("controller")} ${e.e("controller-prev")}' part='controller prev'>
|
|
387
|
+
${_.t("calendar.prevMonth")}
|
|
388
|
+
</ea-button>
|
|
389
|
+
<ea-button class='${e.e("controller")} ${e.e("controller-today")}' part='controller current'>
|
|
390
|
+
${_.t("calendar.today")}
|
|
391
|
+
</ea-button>
|
|
392
|
+
<ea-button class='${e.e("controller")} ${e.e("controller-next")}' part='controller next'>
|
|
393
|
+
${_.t("calendar.nextMonth")}
|
|
394
|
+
</ea-button>
|
|
395
|
+
</ea-button-group>
|
|
396
|
+
`),
|
|
397
|
+
select: () => {
|
|
398
|
+
const b = Array.from(
|
|
399
|
+
{ length: 20 },
|
|
400
|
+
(Y, g) => `<ea-option value="${h - 10 + g}">${h - 10 + g}</ea-option>`
|
|
401
|
+
).join(""), $ = Array.from(
|
|
402
|
+
{ length: 12 },
|
|
403
|
+
(Y, g) => `<ea-option value="${g + 1}">${g + 1}</ea-option>`
|
|
404
|
+
).join("");
|
|
405
|
+
return this.html(`
|
|
406
|
+
<section class='${e.e("controller-group")}' part='controller-group'>
|
|
407
|
+
<ea-select class='${e.e("controller")} ${e.e("controller-year")}' part='controller year' placeholder='${_.t("calendar.selectYear")}' size="small">
|
|
408
|
+
${b}
|
|
409
|
+
</ea-select>
|
|
410
|
+
<ea-select class='${e.e("controller")} ${e.e("controller-month")}' part='controller month' placeholder='${_.t("calendar.selectMonth")}' size="small">
|
|
411
|
+
${$}
|
|
412
|
+
</ea-select>
|
|
413
|
+
<ea-button class='${e.e("controller")} ${e.e("controller-today")}' part='controller current' size="small">
|
|
414
|
+
${_.t("calendar.today")}
|
|
415
|
+
</ea-button>
|
|
416
|
+
</section>
|
|
417
|
+
`);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
(D = o(this, R).dateChangeAbortController) == null || D.abort(), o(this, R).dateChangeAbortController = new AbortController(), o(this, st).innerHTML = p[t](), t === "select" ? o(this, yt).call(this) : o(this, mt).call(this);
|
|
421
|
+
const d = this.shadowRoot.querySelector(e.ce("controller-today"));
|
|
422
|
+
d && d.addEventListener("click", o(this, ft), {
|
|
423
|
+
signal: o(this, R).dateChangeAbortController.signal
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
/**
|
|
427
|
+
* 初始化控制器为 button 的事件
|
|
428
|
+
*/
|
|
429
|
+
C(this, mt, async () => {
|
|
430
|
+
o(this, L).isEaButtonImported || (await customElements.whenDefined("ea-button"), o(this, L).isEaButtonImported = !0);
|
|
431
|
+
const t = this.ns, e = this.shadowRoot.querySelector(t.ce("controller-prev")), h = this.shadowRoot.querySelector(t.ce("controller-next")), p = () => {
|
|
432
|
+
this.value = o(this, L).displayDate.subtract(1, "month").set("date", 1);
|
|
433
|
+
}, d = () => {
|
|
434
|
+
this.value = o(this, L).displayDate.add(1, "month").set("date", 1);
|
|
435
|
+
};
|
|
436
|
+
e && e.addEventListener("click", p, {
|
|
437
|
+
signal: o(this, R).dateChangeAbortController.signal
|
|
438
|
+
}), h && h.addEventListener("click", d, {
|
|
439
|
+
signal: o(this, R).dateChangeAbortController.signal
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
/**
|
|
443
|
+
* 初始化控制器为 select 的事件
|
|
444
|
+
*/
|
|
445
|
+
C(this, yt, async () => {
|
|
446
|
+
o(this, L).isEaSelectImported || (await customElements.whenDefined("ea-select"), o(this, L).isEaSelectImported = !0);
|
|
447
|
+
const t = this.ns, e = o(this, L).displayDate.get("year"), h = o(this, L).displayDate.get("month") + 1, p = this.shadowRoot.querySelector(t.ce("controller-year")), d = this.shadowRoot.querySelector(t.ce("controller-month")), D = ($) => {
|
|
448
|
+
$.stopImmediatePropagation();
|
|
449
|
+
const Y = parseInt($.target.value), g = o(this, L).displayDate.get("month") + 1;
|
|
450
|
+
this.value = O(`${Y}-${g}-01`);
|
|
451
|
+
}, b = ($) => {
|
|
452
|
+
$.stopImmediatePropagation();
|
|
453
|
+
const Y = o(this, L).displayDate.get("year"), g = parseInt($.target.value).toString().padStart(2, "0");
|
|
454
|
+
this.value = O(`${Y}-${g}-01`);
|
|
455
|
+
};
|
|
456
|
+
p && (p.value = e), d && (d.value = h), await Ct.sleep(0), p.addEventListener("change", D, {
|
|
457
|
+
signal: o(this, R).dateChangeAbortController.signal
|
|
458
|
+
}), d.addEventListener("change", b, {
|
|
459
|
+
signal: o(this, R).dateChangeAbortController.signal
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
/**
|
|
463
|
+
* 处理周渲染
|
|
464
|
+
* @param {Array} weekList
|
|
465
|
+
* @return {String}
|
|
466
|
+
*/
|
|
467
|
+
C(this, pt, (t) => t.map((e) => `<th class='${this.ns.e("th")}' part='th'>${e}</th>`).join(""));
|
|
468
|
+
/**
|
|
469
|
+
* 处理tbody点击事件
|
|
470
|
+
* @param {MouseEvent} e
|
|
471
|
+
*/
|
|
472
|
+
C(this, $t, (t) => {
|
|
473
|
+
let e = t.target.closest(this.ns.ce("day"));
|
|
474
|
+
if (!e || e === o(this, N)) return;
|
|
475
|
+
const h = parseInt(e.dataset.year), p = parseInt(e.dataset.month), d = parseInt(e.dataset.date), D = O(`${h}-${p}-${d}`);
|
|
476
|
+
this.value = D, this.emit("select", {
|
|
477
|
+
detail: {
|
|
478
|
+
year: h,
|
|
479
|
+
month: p,
|
|
480
|
+
date: d,
|
|
481
|
+
day: D.day(),
|
|
482
|
+
fullDate: `${h}-${p}-${d}`
|
|
483
|
+
},
|
|
484
|
+
bubbles: !0,
|
|
485
|
+
composed: !0
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
/**
|
|
489
|
+
* 获取日期数组
|
|
490
|
+
* @param {dayjs.Dayjs} [refDate] 参考日期,默认为当前日期
|
|
491
|
+
* @return {DayOption}
|
|
492
|
+
*/
|
|
493
|
+
C(this, lt, (t = O()) => {
|
|
494
|
+
const e = t, p = e.subtract(1, "month").daysInMonth(), d = e.startOf("month").day(), D = e.endOf("month").day(), b = e.daysInMonth(), $ = e.startOf("week").get("day"), Y = Array.from(
|
|
495
|
+
{ length: d - $ },
|
|
496
|
+
(k, m) => p - m
|
|
497
|
+
).reverse(), g = Array.from(
|
|
498
|
+
{ length: b },
|
|
499
|
+
(k, m) => m + 1
|
|
500
|
+
), F = Array.from(
|
|
501
|
+
{ length: 6 - D + $ },
|
|
502
|
+
(k, m) => m + 1
|
|
503
|
+
);
|
|
504
|
+
return { lastMonRemainingDays: Y, currentMonDays: g, nextMonRemainingDays: F };
|
|
505
|
+
});
|
|
506
|
+
/**
|
|
507
|
+
* 查找指定日期的单元格
|
|
508
|
+
* @param {Number} year
|
|
509
|
+
* @param {Number} month
|
|
510
|
+
* @param {Number} date
|
|
511
|
+
*/
|
|
512
|
+
C(this, gt, (t, e, h) => o(this, N).querySelector(
|
|
513
|
+
`td[data-year="${t}"][data-month="${e}"][data-date="${h}"]`
|
|
514
|
+
));
|
|
515
|
+
/**
|
|
516
|
+
* 处理天渲染
|
|
517
|
+
* @returns {String}
|
|
518
|
+
*/
|
|
519
|
+
C(this, ct, () => {
|
|
520
|
+
const t = this.ns, e = o(this, L).displayDate, h = e.get("year"), p = e.get("month") + 1, { lastMonRemainingDays: d, currentMonDays: D, nextMonRemainingDays: b } = o(this, lt).call(this, e), $ = (m, I, B = { isSelected: !1, isToday: !1, isCurrent: !1 }) => {
|
|
521
|
+
let U, P;
|
|
522
|
+
if (m === "last-mon") {
|
|
523
|
+
const H = e.subtract(1, "month");
|
|
524
|
+
U = H.get("year"), P = H.get("month") + 1;
|
|
525
|
+
} else if (m === "current-mon")
|
|
526
|
+
U = h, P = p;
|
|
527
|
+
else {
|
|
528
|
+
const H = e.add(1, "month");
|
|
529
|
+
U = H.get("year"), P = H.get("month") + 1;
|
|
530
|
+
}
|
|
531
|
+
return Ct.EaElement.h(
|
|
532
|
+
"td",
|
|
533
|
+
null,
|
|
534
|
+
{
|
|
535
|
+
class: [
|
|
536
|
+
t.e("day"),
|
|
537
|
+
t.s(m),
|
|
538
|
+
B.isSelected ? t.s("selected") : "",
|
|
539
|
+
B.isToday ? t.s("today") : "",
|
|
540
|
+
B.isCurrent ? t.s("current") : ""
|
|
541
|
+
],
|
|
542
|
+
part: ["day", m],
|
|
543
|
+
"data-year": U,
|
|
544
|
+
"data-month": P,
|
|
545
|
+
"data-date": I
|
|
546
|
+
},
|
|
547
|
+
I
|
|
548
|
+
);
|
|
549
|
+
}, Y = d.map(
|
|
550
|
+
(m) => $("last-mon", m)
|
|
551
|
+
), g = D.map(
|
|
552
|
+
(m) => $("current-mon", m, {
|
|
553
|
+
isToday: m === e.get("date"),
|
|
554
|
+
isCurrent: m === e.get("date")
|
|
555
|
+
})
|
|
556
|
+
), F = b.map(
|
|
557
|
+
(m) => $("next-mon", m)
|
|
558
|
+
);
|
|
559
|
+
return Y.concat(g).concat(F).reduce((m, I, B) => (B % 7 === 0 && m.push([]), m[m.length - 1].push(I), m), []).map((m) => `<tr class="${t.e("row")}">${m.join("")}</tr>`).join("");
|
|
560
|
+
});
|
|
561
|
+
this.stylesheet = Rt, this.$render();
|
|
562
|
+
}
|
|
563
|
+
static get observedAttributes() {
|
|
564
|
+
return [...super.observedAttributes, "value", "controller-type"];
|
|
565
|
+
}
|
|
566
|
+
// ------- value -------
|
|
567
|
+
// #region
|
|
568
|
+
get value() {
|
|
569
|
+
return o(this, L).displayDate;
|
|
570
|
+
}
|
|
571
|
+
set value(t) {
|
|
572
|
+
this.setAttribute("value", O(t));
|
|
573
|
+
}
|
|
574
|
+
// #endregion
|
|
575
|
+
// ------- end -------
|
|
576
|
+
attributeChangedCallback(t, e, h) {
|
|
577
|
+
super.attributeChangedCallback(t, e, h), h !== e && t === "value" && (o(this, L).displayDate = O(h), Dt(this, et, kt).call(this, o(this, L).displayDate));
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* 获取 classlist 列表
|
|
581
|
+
* @return {string} 属性值
|
|
582
|
+
*/
|
|
583
|
+
updateContainerClasslist() {
|
|
584
|
+
const t = this.computedClasslist("ea-calendar", {
|
|
585
|
+
// ['--' + this.type]: this.type,
|
|
586
|
+
});
|
|
587
|
+
return o(this, at).className = t, t;
|
|
588
|
+
}
|
|
589
|
+
$render() {
|
|
590
|
+
const t = Ht("calendar"), e = /* @__PURE__ */ new Date(), h = e.getFullYear(), p = e.getMonth();
|
|
591
|
+
_.locale = this.locale, O.locale(this.locale), this.ns = t, this.shadowRoot.innerHTML = this.html(`
|
|
592
|
+
<div class='${t.b()}' part='container'>
|
|
593
|
+
<header class='${t.e("header")}' part='header'>
|
|
594
|
+
<slot name="header">
|
|
595
|
+
<span class='${t.e("title")}' part='title'>
|
|
596
|
+
${h} ${_.t("calendar.months")[p]}
|
|
597
|
+
</span>
|
|
598
|
+
<section class='${t.e("controller-wrapper")}' part='controller-wrapper'>
|
|
599
|
+
</section>
|
|
600
|
+
</slot>
|
|
601
|
+
</header>
|
|
602
|
+
<table class='${t.e("body")}' part='body'>
|
|
603
|
+
<thead class='${t.e("thead")}' part='thead'>
|
|
604
|
+
<tr class='${t.e("week")}' part='thead-tr tr'>
|
|
605
|
+
${o(this, pt).call(this, _.t("calendar.weekDays"))}
|
|
606
|
+
</tr>
|
|
607
|
+
</thead>
|
|
608
|
+
<tbody class='${t.e("tbody")}' part='tbody'>${o(this, ct).call(this)}</tbody>
|
|
609
|
+
</table>
|
|
610
|
+
</div>
|
|
611
|
+
`), z(this, at, this.shadowRoot.querySelector(t.cb())), z(this, ht, this.shadowRoot.querySelector(t.ce("header"))), z(this, G, this.shadowRoot.querySelector(t.ce("title"))), z(this, st, this.shadowRoot.querySelector(
|
|
612
|
+
t.ce("controller-wrapper")
|
|
613
|
+
)), z(this, dt, this.shadowRoot.querySelector(t.ce("body"))), z(this, ot, this.shadowRoot.querySelector(t.ce("thead"))), z(this, N, this.shadowRoot.querySelector(t.ce("tbody")));
|
|
614
|
+
}
|
|
615
|
+
$updateLocalization(t) {
|
|
616
|
+
_.locale = t, O.locale(this.locale.toLowerCase());
|
|
617
|
+
const e = this.ns, h = this.shadowRoot.querySelector(e.ce("controller-prev")), p = this.shadowRoot.querySelector(e.ce("controller-today")), d = this.shadowRoot.querySelector(e.ce("controller-next")), D = this.shadowRoot.querySelector(e.ce("controller-year")), b = this.shadowRoot.querySelector(e.ce("controller-month")), $ = O(), Y = $.get("year"), g = $.get("month"), F = $.get("date"), { lastMonRemainingDays: k, currentMonDays: m, nextMonRemainingDays: I } = o(this, lt).call(this, $), B = k.concat(m).concat(I), U = _.t("calendar.weekDays"), P = o(this, ot).querySelectorAll(".ea-calendar__th"), H = [...o(this, N).querySelectorAll(".ea-calendar__day")];
|
|
618
|
+
if (h && (h.textContent = _.t("calendar.prevMonth")), p && (p.textContent = _.t("calendar.today")), d && (d.textContent = _.t("calendar.nextMonth")), D && (D.placeholder = _.t("calendar.selectYear")), b && (b.placeholder = _.t("calendar.selectMonth")), o(this, G).textContent = `${Y} ${_.t("calendar.months")[g]}`, P.forEach((v, T) => {
|
|
619
|
+
v.textContent = U[T];
|
|
620
|
+
}), H.forEach((v, T) => {
|
|
621
|
+
const K = B[T], X = Dt(this, et, Et).call(this, Y, g, K);
|
|
622
|
+
let W, w, u;
|
|
623
|
+
if (T < k.length) {
|
|
624
|
+
const q = $.subtract(1, "month");
|
|
625
|
+
W = q.get("year"), w = q.get("month") + 1, u = "last";
|
|
626
|
+
} else if (T < k.length + m.length)
|
|
627
|
+
W = Y, w = g + 1, u = "current";
|
|
628
|
+
else {
|
|
629
|
+
const q = $.add(1, "month");
|
|
630
|
+
W = q.get("year"), w = q.get("month") + 1, u = "next";
|
|
631
|
+
}
|
|
632
|
+
v.dataset.year = W, v.dataset.month = w, v.dataset.date = K, v.textContent = K, v.classList.toggle("is-today", X), v.classList.toggle("is-current", X), v.classList.toggle("is-last-mon", u === "last"), v.classList.toggle("is-current-mon", u === "current"), v.classList.toggle("is-next-mon", u === "next"), v.part.toggle("last-mon", u === "last"), v.part.toggle("current-mon", u === "current"), v.part.toggle("next-mon", u === "next");
|
|
633
|
+
}), !H.some((v) => v.classList.contains("is-current"))) {
|
|
634
|
+
const v = o(this, gt).call(this, Y, g + 1, F);
|
|
635
|
+
v && v.classList.add("is-current");
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
connectedCallback() {
|
|
639
|
+
var t;
|
|
640
|
+
super.connectedCallback(), (t = o(this, Q)) == null || t.abort(), z(this, Q, new AbortController()), o(this, it).call(this), o(this, N).addEventListener("click", o(this, $t), {
|
|
641
|
+
signal: o(this, Q).signal
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
$beforeUnmounted() {
|
|
645
|
+
var t, e;
|
|
646
|
+
(t = o(this, Q)) == null || t.abort();
|
|
647
|
+
for (const h in o(this, R))
|
|
648
|
+
(e = o(this, R)[h]) == null || e.abort(), o(this, R)[h] = null;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
at = new WeakMap(), ht = new WeakMap(), G = new WeakMap(), st = new WeakMap(), dt = new WeakMap(), ot = new WeakMap(), N = new WeakMap(), Q = new WeakMap(), R = new WeakMap(), L = new WeakMap(), ft = new WeakMap(), it = new WeakMap(), mt = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), et = new WeakSet(), /**
|
|
652
|
+
* 渲染日历天数
|
|
653
|
+
* @param {dayjs.Dayjs} date
|
|
654
|
+
*/
|
|
655
|
+
kt = function(t) {
|
|
656
|
+
_.locale = this.locale, O.locale(this.locale.toLowerCase());
|
|
657
|
+
const e = t.get("year"), h = t.get("month");
|
|
658
|
+
o(this, G).textContent = `${e} ${_.t("calendar.months")[h]}`, o(this, N).innerHTML = o(this, ct).call(this);
|
|
659
|
+
}, $t = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), /**
|
|
660
|
+
* 判断是否是今天
|
|
661
|
+
*/
|
|
662
|
+
Et = function(t, e, h) {
|
|
663
|
+
const p = O();
|
|
664
|
+
return t === p.get("year") && e === p.get("month") && h === p.get("date");
|
|
665
|
+
}, ct = new WeakMap();
|
|
666
|
+
window.customElements.get("ea-calendar") || window.customElements.define("ea-calendar", Bt);
|
|
667
|
+
export {
|
|
668
|
+
Bt as E,
|
|
669
|
+
Lt as c,
|
|
670
|
+
O as d,
|
|
671
|
+
jt as g,
|
|
672
|
+
Ht as n
|
|
673
|
+
};
|