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,480 @@
|
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var q = (r) => {
|
|
3
|
+
throw TypeError(r);
|
|
4
|
+
};
|
|
5
|
+
var B = (r, n, e) => n in r ? F(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
|
6
|
+
var T = (r, n, e) => B(r, typeof n != "symbol" ? n + "" : n, e), $ = (r, n, e) => n.has(r) || q("Cannot " + e);
|
|
7
|
+
var t = (r, n, e) => ($(r, n, "read from private field"), e ? e.call(r) : n.get(r)), l = (r, n, e) => n.has(r) ? q("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, e), u = (r, n, e, i) => ($(r, n, "write to private field"), i ? i.call(r, e) : n.set(r, e), e), C = (r, n, e) => ($(r, n, "access private method"), e);
|
|
8
|
+
import { B as H } from "./Base.js";
|
|
9
|
+
import { s as J } from "../css/ea-pagination.style.js";
|
|
10
|
+
import { E as R } from "../utils/Utils.js";
|
|
11
|
+
import { E as O } from "../utils/Variables.js";
|
|
12
|
+
const D = (r, n, e) => R.EaElement.h(
|
|
13
|
+
"span",
|
|
14
|
+
`ea-pagination__page ${r === n ? "is-active" : ""}`.trim(),
|
|
15
|
+
{
|
|
16
|
+
part: "page",
|
|
17
|
+
tabindex: 0,
|
|
18
|
+
"data-page": r,
|
|
19
|
+
"aria-label": `page ${r}`,
|
|
20
|
+
"aria-current": r === n
|
|
21
|
+
},
|
|
22
|
+
e || r
|
|
23
|
+
), U = (r, n) => R.EaElement.h(
|
|
24
|
+
"span",
|
|
25
|
+
"ea-pagination__page ea-pagination__more",
|
|
26
|
+
{
|
|
27
|
+
part: "more",
|
|
28
|
+
"aria-label": n === "next" ? "Next 5 pages" : "Previous 5 pages",
|
|
29
|
+
tabindex: 0,
|
|
30
|
+
"data-action": n
|
|
31
|
+
},
|
|
32
|
+
r
|
|
33
|
+
);
|
|
34
|
+
class G extends Event {
|
|
35
|
+
constructor(n) {
|
|
36
|
+
super("ea-current-change", {
|
|
37
|
+
bubbles: !0,
|
|
38
|
+
cancelable: !0,
|
|
39
|
+
composed: !0
|
|
40
|
+
}), this.detail = n;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class Z extends Event {
|
|
44
|
+
constructor(n) {
|
|
45
|
+
super("ea-prev-click", {
|
|
46
|
+
bubbles: !0,
|
|
47
|
+
cancelable: !0,
|
|
48
|
+
composed: !0
|
|
49
|
+
}), this.detail = n;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
class K extends Event {
|
|
53
|
+
constructor(n) {
|
|
54
|
+
super("ea-next-click", {
|
|
55
|
+
bubbles: !0,
|
|
56
|
+
cancelable: !0,
|
|
57
|
+
composed: !0
|
|
58
|
+
}), this.detail = n;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
class Q extends Event {
|
|
62
|
+
constructor(n) {
|
|
63
|
+
super("ea-size-change", {
|
|
64
|
+
bubbles: !0,
|
|
65
|
+
cancelable: !0,
|
|
66
|
+
composed: !0
|
|
67
|
+
}), this.detail = n;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
var z, c, b, m, p, y, d, g, h, S, P, A, k, I, M, j, L, N, v, E;
|
|
71
|
+
class W extends H {
|
|
72
|
+
constructor() {
|
|
73
|
+
super();
|
|
74
|
+
l(this, v);
|
|
75
|
+
/** @type {HTMLElement} */
|
|
76
|
+
l(this, z);
|
|
77
|
+
/** @type {HTMLElement} */
|
|
78
|
+
l(this, c);
|
|
79
|
+
/** @type {HTMLElement} */
|
|
80
|
+
l(this, b);
|
|
81
|
+
/** @type {HTMLElement} */
|
|
82
|
+
l(this, m);
|
|
83
|
+
/** @type {HTMLElement} */
|
|
84
|
+
l(this, p);
|
|
85
|
+
/** @type {HTMLElement} */
|
|
86
|
+
l(this, y);
|
|
87
|
+
/** @type {HTMLElement} */
|
|
88
|
+
l(this, d);
|
|
89
|
+
l(this, g, {
|
|
90
|
+
isFirstRender: !0,
|
|
91
|
+
isEaInputImported: !1,
|
|
92
|
+
isEaSelectImported: !1
|
|
93
|
+
});
|
|
94
|
+
l(this, h, {
|
|
95
|
+
/** @type {AbortController | null} */
|
|
96
|
+
paginationAbortController: null,
|
|
97
|
+
/** @type {AbortController | null} */
|
|
98
|
+
prevAbortController: null,
|
|
99
|
+
/** @type {AbortController | null} */
|
|
100
|
+
nextAbortController: null,
|
|
101
|
+
/** @type {AbortController | null} */
|
|
102
|
+
jumperAbortController: null,
|
|
103
|
+
/** @type {AbortController | null} */
|
|
104
|
+
sizesAbortController: null
|
|
105
|
+
});
|
|
106
|
+
T(this, "state", this.properties({
|
|
107
|
+
"default-page-size": {
|
|
108
|
+
type: Number,
|
|
109
|
+
default: 10,
|
|
110
|
+
/** @param {number} newVal */
|
|
111
|
+
observer: () => {
|
|
112
|
+
t(this, g).isFirstRender || C(this, v, E).call(this);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"page-size": {
|
|
116
|
+
type: Number,
|
|
117
|
+
default: () => this["default-page-size"],
|
|
118
|
+
/** @param {number} newVal */
|
|
119
|
+
observer: (e) => {
|
|
120
|
+
t(this, g).isFirstRender || (C(this, v, E).call(this), this.dispatchEvent(
|
|
121
|
+
new Q({
|
|
122
|
+
pageSize: e
|
|
123
|
+
})
|
|
124
|
+
));
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"pager-count": {
|
|
128
|
+
type: Number,
|
|
129
|
+
default: 7,
|
|
130
|
+
/** @param {number} newVal */
|
|
131
|
+
observer: () => {
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
total: {
|
|
135
|
+
type: Number,
|
|
136
|
+
default: 0,
|
|
137
|
+
/** @param {number} newVal */
|
|
138
|
+
observer: () => {
|
|
139
|
+
t(this, c) && this.layout.includes("pager") && C(this, v, E).call(this), this["hide-on-single-page"] && this.updateContainerClasslist();
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"current-page": {
|
|
143
|
+
type: Number,
|
|
144
|
+
default: 1,
|
|
145
|
+
/** @param {number} newVal */
|
|
146
|
+
observer: (e) => {
|
|
147
|
+
var i;
|
|
148
|
+
t(this, g).isFirstRender || (t(this, S).call(this, e), t(this, p) && ((i = this.layout) != null && i.includes("jumper")) && (t(this, p).value = e), this.emit("change", {
|
|
149
|
+
detail: {
|
|
150
|
+
currentPage: e,
|
|
151
|
+
pageSize: this["page-size"]
|
|
152
|
+
}
|
|
153
|
+
}), this.dispatchEvent(
|
|
154
|
+
new G({ value: e })
|
|
155
|
+
), this.updateContainerClasslist());
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
background: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: !1,
|
|
161
|
+
observer: () => {
|
|
162
|
+
this.updateContainerClasslist();
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
size: {
|
|
166
|
+
type: O,
|
|
167
|
+
default: "",
|
|
168
|
+
observer: (e) => {
|
|
169
|
+
t(this, d) && t(this, d).setAttribute("size", e), t(this, p) && t(this, p).setAttribute("size", e), this.updateContainerClasslist();
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"hide-on-single-page": {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: !1,
|
|
175
|
+
observer: () => {
|
|
176
|
+
t(this, c) && this.layout.includes("pager") && this.updateContainerClasslist();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
disabled: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: !1,
|
|
182
|
+
observer: (e) => {
|
|
183
|
+
this.updateContainerClasslist(), this.layout.includes("jumper") && t(this, p) && (t(this, p).disabled = e);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
187
|
+
T(this, "propState", this.properties({
|
|
188
|
+
pageSizes: {
|
|
189
|
+
type: Array,
|
|
190
|
+
default: [10, 20, 30, 40, 50, 100],
|
|
191
|
+
/** @param {Array<number>} newVal */
|
|
192
|
+
observer: (e) => {
|
|
193
|
+
t(this, g).isFirstRender || C(this, v, E).call(this);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
layout: {
|
|
197
|
+
props: !0,
|
|
198
|
+
type: Array,
|
|
199
|
+
default: ["prev", "pager", "next", "jumper", "->", "total"],
|
|
200
|
+
/** @param {Array<'prev' | 'pager' | 'next' | '->' | 'jumper' | 'total' | 'sizes'>} newVal */
|
|
201
|
+
observer: (e) => {
|
|
202
|
+
t(this, g).isFirstRender || C(this, v, E).call(this);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
/**
|
|
207
|
+
* 更新页码样式
|
|
208
|
+
* @param {Number} [currentPage]
|
|
209
|
+
*/
|
|
210
|
+
l(this, S, (e = this["current-page"]) => {
|
|
211
|
+
var a;
|
|
212
|
+
if (!t(this, c) || !((a = this.layout) != null && a.includes("pager"))) return;
|
|
213
|
+
t(this, c).innerHTML = t(this, A).call(this, e);
|
|
214
|
+
const i = t(this, c).querySelectorAll(".ea-pagination__page"), s = t(this, c).querySelector(
|
|
215
|
+
`.ea-pagination__page[data-page="${e}"]`
|
|
216
|
+
);
|
|
217
|
+
i.forEach((o) => {
|
|
218
|
+
o.classList.toggle("is-active", o === s), o.setAttribute("aria-current", o === s);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
/**
|
|
222
|
+
* 获取分页器范围
|
|
223
|
+
* @param {number} newVal 当前页码
|
|
224
|
+
* @return {Array<number | string>} 分页器范围
|
|
225
|
+
*/
|
|
226
|
+
l(this, P, (e) => {
|
|
227
|
+
const i = Math.ceil(this.total / this["page-size"]), s = Math.floor(this["pager-count"] / 2), o = ((_, w) => {
|
|
228
|
+
const x = [];
|
|
229
|
+
for (let f = _; f <= w; f++)
|
|
230
|
+
x.push(f);
|
|
231
|
+
return x;
|
|
232
|
+
})(
|
|
233
|
+
Math.max(
|
|
234
|
+
2,
|
|
235
|
+
e + s > i ? (
|
|
236
|
+
/**
|
|
237
|
+
* 当 `endRange` 超出范围时,起始值 = 当前页 - (范围区间 + 1) - 后半多余区间
|
|
238
|
+
* 后半多余区间 = | 总页码数 - 当前页码 - 范围区间 |
|
|
239
|
+
*/
|
|
240
|
+
e - s + 1 - Math.abs(i - e - s)
|
|
241
|
+
) : (
|
|
242
|
+
// 因为单独处理开头,所以 `range` 起始要多一位
|
|
243
|
+
e - s + 1
|
|
244
|
+
)
|
|
245
|
+
),
|
|
246
|
+
Math.min(
|
|
247
|
+
i - 1,
|
|
248
|
+
e - s < 2 ? (
|
|
249
|
+
/**
|
|
250
|
+
* 当 `startRange` 超出范围时,终止值 = 当前页 + (范围区间 - 1) - 前半多余区间
|
|
251
|
+
* 前半多余区间 = | 当前页码 - 范围区间 - 1 |
|
|
252
|
+
*/
|
|
253
|
+
e + s - 1 + Math.abs(e - s - 1)
|
|
254
|
+
) : (
|
|
255
|
+
// 因为单独处理结尾,所以 `range` 结束要少一位
|
|
256
|
+
e + s - 1
|
|
257
|
+
)
|
|
258
|
+
)
|
|
259
|
+
);
|
|
260
|
+
return o[0] > 2 || s === 0 ? o.unshift(1, "...") : o.unshift(1), s === 0 && e > 1 && e < i && o.push(e), o[o.length - 1] < i - 1 || s === 0 && e === i - 1 ? o.push("...", i) : i > 1 && o.push(i), o;
|
|
261
|
+
});
|
|
262
|
+
/**
|
|
263
|
+
* 获取页码模板
|
|
264
|
+
* @param {Number} currentPage 当前页码
|
|
265
|
+
* @returns {String}
|
|
266
|
+
*/
|
|
267
|
+
l(this, A, (e = 1) => {
|
|
268
|
+
let i = "";
|
|
269
|
+
const s = t(this, P).call(this, e);
|
|
270
|
+
return s.forEach((a, o) => {
|
|
271
|
+
typeof a == "number" ? i += D(a, this["current-page"], a) : i += U(
|
|
272
|
+
"...",
|
|
273
|
+
s[o - 1] === s[0] ? "prev" : "next"
|
|
274
|
+
);
|
|
275
|
+
}), i;
|
|
276
|
+
});
|
|
277
|
+
/**
|
|
278
|
+
* 渲染页码部分
|
|
279
|
+
* @description 这里的事件监听采用的是,通过 `this.#pagination` 点击事件中,获取到的最近的 `页码元素` 来进行事件触发
|
|
280
|
+
*/
|
|
281
|
+
l(this, k, () => {
|
|
282
|
+
if (!t(this, c)) return;
|
|
283
|
+
if (!this.layout.includes("pager")) {
|
|
284
|
+
t(this, c).innerHTML = "";
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
const e = (i) => {
|
|
288
|
+
var _;
|
|
289
|
+
const s = i.target.closest(
|
|
290
|
+
".ea-pagination__page:not(.ea-pagination__more)"
|
|
291
|
+
), a = i.target.closest(".ea-pagination__more"), o = Number((_ = s == null ? void 0 : s.dataset) == null ? void 0 : _.page);
|
|
292
|
+
if (s && this["current-page"] !== o)
|
|
293
|
+
this["current-page"] = s.dataset.page;
|
|
294
|
+
else if (a) {
|
|
295
|
+
const w = a.dataset.action, x = Math.ceil(this.total / this["page-size"]);
|
|
296
|
+
let f = this["current-page"] + (w === "next" ? 5 : -5);
|
|
297
|
+
f < 1 ? f = 1 : f > x && (f = x), this["current-page"] = f;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
t(this, c).innerHTML = t(this, A).call(this, 1), t(this, c).addEventListener("click", e, {
|
|
301
|
+
signal: t(this, h).paginationAbortController.signal
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
/**
|
|
305
|
+
* 渲染 prev 按钮
|
|
306
|
+
*/
|
|
307
|
+
l(this, I, () => {
|
|
308
|
+
if (!t(this, b) || !this.layout.includes("prev")) return;
|
|
309
|
+
const e = (a = this["current-page"]) => {
|
|
310
|
+
t(this, b).classList.toggle(
|
|
311
|
+
"is-disabled",
|
|
312
|
+
a <= 1 || this.total <= 0
|
|
313
|
+
), t(this, b).setAttribute(
|
|
314
|
+
"aria-disabled",
|
|
315
|
+
a <= 1 || this.total <= 0
|
|
316
|
+
), t(this, b).setAttribute(
|
|
317
|
+
"tabindex",
|
|
318
|
+
a <= 1 || this.total <= 0 ? -1 : 0
|
|
319
|
+
);
|
|
320
|
+
}, i = (a) => {
|
|
321
|
+
const { currentPage: o } = a.detail;
|
|
322
|
+
e(o);
|
|
323
|
+
}, s = () => {
|
|
324
|
+
this["current-page"] <= 1 || this.total <= 0 || (this["current-page"]--, this.dispatchEvent(
|
|
325
|
+
new Z({ value: this["current-page"] })
|
|
326
|
+
));
|
|
327
|
+
};
|
|
328
|
+
e(), this.addEventListener("change", i, {
|
|
329
|
+
signal: t(this, h).prevAbortController.signal
|
|
330
|
+
}), t(this, b).addEventListener("click", s, {
|
|
331
|
+
signal: t(this, h).prevAbortController.signal
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* 渲染 next 按钮
|
|
336
|
+
*/
|
|
337
|
+
l(this, M, () => {
|
|
338
|
+
if (!this.layout.includes("next") || !t(this, m)) return;
|
|
339
|
+
const e = (o = this["current-page"]) => o >= Math.ceil(this.total / this["page-size"]), i = (o = e()) => {
|
|
340
|
+
t(this, m).classList.toggle("is-disabled", o), t(this, m).setAttribute("aria-disabled", o), t(this, m).setAttribute("tabindex", o ? -1 : 0);
|
|
341
|
+
}, s = (o) => {
|
|
342
|
+
const { currentPage: _ } = o.detail;
|
|
343
|
+
i(e(_));
|
|
344
|
+
}, a = () => {
|
|
345
|
+
e() || (this["current-page"]++, this.dispatchEvent(
|
|
346
|
+
new K({ value: this["current-page"] })
|
|
347
|
+
));
|
|
348
|
+
};
|
|
349
|
+
i(), this.addEventListener("change", s, {
|
|
350
|
+
signal: t(this, h).nextAbortController.signal
|
|
351
|
+
}), t(this, m).addEventListener("click", a, {
|
|
352
|
+
signal: t(this, h).nextAbortController.signal
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
/**
|
|
356
|
+
* 渲染 total
|
|
357
|
+
*/
|
|
358
|
+
l(this, j, () => {
|
|
359
|
+
!this.layout.includes("total") || !t(this, y) || (t(this, y).textContent = `Total ${this.total}`);
|
|
360
|
+
});
|
|
361
|
+
/**
|
|
362
|
+
* 渲染 jumper
|
|
363
|
+
*/
|
|
364
|
+
l(this, L, async () => {
|
|
365
|
+
if (!this.layout.includes("jumper") || !t(this, p)) return;
|
|
366
|
+
const e = () => {
|
|
367
|
+
const a = t(this, p).value, o = Math.ceil(this.total / this["page-size"]);
|
|
368
|
+
R.Number.isNumber(a) && a !== "" && a <= o ? this["current-page"] = a : t(this, p).value = this["current-page"];
|
|
369
|
+
}, i = (a) => {
|
|
370
|
+
a.key === "Enter" && e();
|
|
371
|
+
}, s = (a) => {
|
|
372
|
+
t(this, p).value = a.detail.currentPage;
|
|
373
|
+
};
|
|
374
|
+
t(this, p).setAttribute("value", this["current-page"]), t(this, p).addEventListener("blur", e, {
|
|
375
|
+
signal: t(this, h).jumperAbortController.signal
|
|
376
|
+
}), t(this, p).addEventListener("keydown", i, {
|
|
377
|
+
signal: t(this, h).jumperAbortController.signal
|
|
378
|
+
}), this.addEventListener("change", s, {
|
|
379
|
+
signal: t(this, h).jumperAbortController.signal
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
/**
|
|
383
|
+
* 渲染页数组
|
|
384
|
+
*/
|
|
385
|
+
l(this, N, async () => {
|
|
386
|
+
var s;
|
|
387
|
+
if (!this.layout.includes("sizes") || !t(this, d)) return;
|
|
388
|
+
const e = (a) => R.EaElement.h(
|
|
389
|
+
"ea-option",
|
|
390
|
+
null,
|
|
391
|
+
{
|
|
392
|
+
value: a,
|
|
393
|
+
selected: a === this["page-size"]
|
|
394
|
+
},
|
|
395
|
+
`${a}/page`
|
|
396
|
+
), i = (a) => {
|
|
397
|
+
a.stopImmediatePropagation(), !t(this, g).isFirstRender && (this["page-size"] = a.target.value, this["current-page"] = Math.min(
|
|
398
|
+
this["current-page"],
|
|
399
|
+
Math.ceil(this.total / this["page-size"])
|
|
400
|
+
));
|
|
401
|
+
};
|
|
402
|
+
(s = this.pageSizes) != null && s.includes(this["page-size"]) || (this["page-size"] = this.pageSizes[0]), t(this, d).innerHTML = this.pageSizes.map(e).join(""), t(this, d).value = this["page-size"], t(this, d).addEventListener("change", i, {
|
|
403
|
+
signal: t(this, h).sizesAbortController.signal
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
this.stylesheet = J;
|
|
407
|
+
}
|
|
408
|
+
static get observedAttributes() {
|
|
409
|
+
return [
|
|
410
|
+
...super.observedAttributes,
|
|
411
|
+
"default-page-size",
|
|
412
|
+
"page-size",
|
|
413
|
+
"pager-count",
|
|
414
|
+
"total",
|
|
415
|
+
"background",
|
|
416
|
+
"current-page",
|
|
417
|
+
"hide-on-single-page",
|
|
418
|
+
"size",
|
|
419
|
+
"disabled"
|
|
420
|
+
];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* 获取 classlist 列表
|
|
424
|
+
* @return {string} 属性值
|
|
425
|
+
*/
|
|
426
|
+
updateContainerClasslist() {
|
|
427
|
+
const e = this.computedClasslist(
|
|
428
|
+
"ea-pagination",
|
|
429
|
+
{
|
|
430
|
+
"--background": this.background,
|
|
431
|
+
[`--size-${this.size}`]: this.size
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
hide: this["hide-on-single-page"] && Math.ceil(this.total / this["page-size"]) <= 1,
|
|
435
|
+
disabled: this.disabled
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
return t(this, g).isFirstRender || (t(this, z).className = e), e;
|
|
439
|
+
}
|
|
440
|
+
$render() {
|
|
441
|
+
const e = this.layout.filter(
|
|
442
|
+
(s) => ["prev", "pager", "next", "jumper", "total", "sizes", "->"].includes(s)
|
|
443
|
+
), i = {
|
|
444
|
+
prev: `<ea-icon class="ea-pagination__icon prev-icon" icon='icon-angle-left' part='icon prev-icon' tabindex="0"></ea-icon>`,
|
|
445
|
+
pager: "<section class='ea-pagination__pager' part='pager'></section>",
|
|
446
|
+
next: `<ea-icon class="ea-pagination__icon next-icon" icon='icon-angle-right' part='icon next-icon' tabindex="0"></ea-icon>`,
|
|
447
|
+
total: "<span class='ea-pagination__total' part='total'></span>",
|
|
448
|
+
jumper: `<span class="ea-pagination__wrapper" part='jumper-wrap'>Go to <ea-input class='ea-pagination__jumper' part='jumper'></ea-input> </span>`,
|
|
449
|
+
sizes: "<ea-select class='ea-pagination__sizes' part='sizes'></ea-select>",
|
|
450
|
+
"->": "<span class='ea-pagination__separator' part='separator'></span>"
|
|
451
|
+
};
|
|
452
|
+
this.shadowRoot.innerHTML = `
|
|
453
|
+
<div class='ea-pagination' part='container'>
|
|
454
|
+
${e.map((s) => i[s]).join("")}
|
|
455
|
+
</div>
|
|
456
|
+
`, u(this, z, this.shadowRoot.querySelector(".ea-pagination")), u(this, c, this.shadowRoot.querySelector(".ea-pagination__pager")), u(this, b, this.shadowRoot.querySelector(
|
|
457
|
+
".ea-pagination__icon.prev-icon"
|
|
458
|
+
)), u(this, m, this.shadowRoot.querySelector(
|
|
459
|
+
".ea-pagination__icon.next-icon"
|
|
460
|
+
)), u(this, p, this.shadowRoot.querySelector(".ea-pagination__jumper")), u(this, y, this.shadowRoot.querySelector(".ea-pagination__total")), u(this, d, this.shadowRoot.querySelector(".ea-pagination__sizes")), this.updateContainerClasslist();
|
|
461
|
+
}
|
|
462
|
+
async connectedCallback() {
|
|
463
|
+
super.connectedCallback(), await C(this, v, E).call(this), t(this, g).isFirstRender = !1;
|
|
464
|
+
}
|
|
465
|
+
$beforeUnmounted() {
|
|
466
|
+
var e;
|
|
467
|
+
for (const i in t(this, h))
|
|
468
|
+
(e = t(this, h)[i]) == null || e.abort(), t(this, h)[i] = null;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
z = new WeakMap(), c = new WeakMap(), b = new WeakMap(), m = new WeakMap(), p = new WeakMap(), y = new WeakMap(), d = new WeakMap(), g = new WeakMap(), h = new WeakMap(), S = new WeakMap(), P = new WeakMap(), A = new WeakMap(), k = new WeakMap(), I = new WeakMap(), M = new WeakMap(), j = new WeakMap(), L = new WeakMap(), N = new WeakMap(), v = new WeakSet(), E = async function() {
|
|
472
|
+
var e, i, s;
|
|
473
|
+
for (const a in t(this, h))
|
|
474
|
+
(e = t(this, h)[a]) == null || e.abort(), t(this, h)[a] = null, t(this, h)[a] = new AbortController();
|
|
475
|
+
(i = this.layout) != null && i.includes("jumper") && !t(this, g).isEaInputImported && (await import("./ea-input.js"), await customElements.whenDefined("ea-input"), t(this, g).isEaInputImported = !0), (s = this.layout) != null && s.includes("sizes") && !t(this, g).isEaSelectImported && (await import("./ea-select.js"), await customElements.whenDefined("ea-select"), t(this, g).isEaSelectImported = !0), u(this, z, null), u(this, c, null), u(this, b, null), u(this, m, null), u(this, p, null), u(this, y, null), u(this, d, null), this.$render(), t(this, N).call(this), t(this, k).call(this), t(this, I).call(this), t(this, M).call(this), t(this, j).call(this), t(this, L).call(this);
|
|
476
|
+
};
|
|
477
|
+
window.customElements.get("ea-pagination") || window.customElements.define("ea-pagination", W);
|
|
478
|
+
export {
|
|
479
|
+
W as EaPagination
|
|
480
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var $ = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var R = (e, o, t) => o in e ? I(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
6
|
+
var B = (e, o, t) => R(e, typeof o != "symbol" ? o + "" : o, t), E = (e, o, t) => o.has(e) || $("Cannot " + t);
|
|
7
|
+
var n = (e, o, t) => (E(e, o, "read from private field"), t ? t.call(e) : o.get(e)), i = (e, o, t) => o.has(e) ? $("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, t), c = (e, o, t, r) => (E(e, o, "write to private field"), r ? r.call(e, t) : o.set(e, t), t), L = (e, o, t) => (E(e, o, "access private method"), t);
|
|
8
|
+
import { EaPopper as z } from "./ea-popper.js";
|
|
9
|
+
import { s as H } from "../css/ea-popconfirm.style.js";
|
|
10
|
+
var b, l, h, w, q, y, a, p, x, g, m, f, u, v, S, k, C, d, _;
|
|
11
|
+
class M extends z {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
i(this, S);
|
|
15
|
+
/** @type {HTMLElement} */
|
|
16
|
+
i(this, b);
|
|
17
|
+
/** @type {HTMLElement} */
|
|
18
|
+
i(this, l);
|
|
19
|
+
/** @type {HTMLElement} */
|
|
20
|
+
i(this, h);
|
|
21
|
+
/** @type {HTMLElement} */
|
|
22
|
+
i(this, w);
|
|
23
|
+
/** @type {HTMLElement} */
|
|
24
|
+
i(this, q);
|
|
25
|
+
/** @type {HTMLElement} */
|
|
26
|
+
i(this, y);
|
|
27
|
+
/** @type {HTMLElement} */
|
|
28
|
+
i(this, a);
|
|
29
|
+
/** @type {HTMLElement} */
|
|
30
|
+
i(this, p);
|
|
31
|
+
/** @type {HTMLElement} */
|
|
32
|
+
i(this, x);
|
|
33
|
+
/** @type {HTMLElement} */
|
|
34
|
+
i(this, g);
|
|
35
|
+
/** @type {HTMLElement} */
|
|
36
|
+
i(this, m);
|
|
37
|
+
/** @type {HTMLElement} */
|
|
38
|
+
i(this, f);
|
|
39
|
+
/** @type {AbortController} */
|
|
40
|
+
i(this, u);
|
|
41
|
+
B(this, "state", this.properties({
|
|
42
|
+
title: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "",
|
|
45
|
+
observer: (t) => {
|
|
46
|
+
n(this, f).innerText = t;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
visible: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1,
|
|
52
|
+
observer: (t) => {
|
|
53
|
+
this.status = t;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
icon: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "icon-help",
|
|
59
|
+
observer: (t) => {
|
|
60
|
+
n(this, m).icon = t;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"icon-color": {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "rgb(255, 153, 0)",
|
|
66
|
+
observer: (t) => {
|
|
67
|
+
if (!CSS.supports("color", t))
|
|
68
|
+
return console.warn(
|
|
69
|
+
`[EaPopconfirm] The color value ${t} is not supported.`
|
|
70
|
+
);
|
|
71
|
+
this.style.setProperty("--ea-popconfirm-title-icon-color", t);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"hide-icon": {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !1,
|
|
77
|
+
observer: (t) => {
|
|
78
|
+
this.style.setProperty(
|
|
79
|
+
"--ea-popconfirm-title-icon-display",
|
|
80
|
+
t ? "none" : "block"
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"confirm-button-text": {
|
|
85
|
+
type: String,
|
|
86
|
+
default: "确定",
|
|
87
|
+
observer: (t) => {
|
|
88
|
+
n(this, p).textContent = t;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"cancel-button-text": {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "取消",
|
|
94
|
+
observer: (t) => {
|
|
95
|
+
n(this, a).textContent = t;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"confirm-button-type": {
|
|
99
|
+
type: ["normal", "primary", "success", "warning", "danger"],
|
|
100
|
+
default: "primary",
|
|
101
|
+
observer: (t) => {
|
|
102
|
+
n(this, p).type = t;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"cancel-button-type": {
|
|
106
|
+
type: ["normal", "primary", "success", "warning", "danger"],
|
|
107
|
+
default: "normal",
|
|
108
|
+
observer: (t) => {
|
|
109
|
+
n(this, a).type = t;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @returns {{
|
|
116
|
+
* titleContainer: HTMLElement,
|
|
117
|
+
* titleIcon: HTMLElement,
|
|
118
|
+
* titleContent: HTMLElement,
|
|
119
|
+
* }}
|
|
120
|
+
*/
|
|
121
|
+
i(this, v, () => {
|
|
122
|
+
const t = document.createElement("section");
|
|
123
|
+
return t.classList.add("ea-popconfirm__title"), t.part = "title", t.innerHTML = `
|
|
124
|
+
${this.icon ? `<ea-icon icon="${this.icon}" part="icon"></ea-icon>` : ""}
|
|
125
|
+
<span class="ea-popconfirm__title-content" part="title-content">${this.title}</span>
|
|
126
|
+
`, n(this, l).appendChild(t), {
|
|
127
|
+
titleContainer: t,
|
|
128
|
+
titleIcon: t == null ? void 0 : t.querySelector("ea-icon"),
|
|
129
|
+
titleContent: t.querySelector(".ea-popconfirm__title-content")
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
i(this, C, () => {
|
|
133
|
+
const t = new AbortController();
|
|
134
|
+
c(this, u, t), n(this, l).querySelector("slot").remove(), this.assignedStyle(H);
|
|
135
|
+
});
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* @param {HTMLElement} el
|
|
139
|
+
* @param {'cancel' | 'confirm'} closeEventName
|
|
140
|
+
*/
|
|
141
|
+
i(this, d, (t, r) => {
|
|
142
|
+
t && t.addEventListener(
|
|
143
|
+
"click",
|
|
144
|
+
() => {
|
|
145
|
+
this.dispatchEvent(new CustomEvent(r)), this.hide();
|
|
146
|
+
},
|
|
147
|
+
{ signal: n(this, u).signal }
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
i(this, _, () => {
|
|
151
|
+
n(this, h).querySelector(
|
|
152
|
+
'slot[name="reference"]'
|
|
153
|
+
).addEventListener(
|
|
154
|
+
"click",
|
|
155
|
+
() => {
|
|
156
|
+
const r = new AbortController();
|
|
157
|
+
this.toggle(), window.addEventListener(
|
|
158
|
+
"click",
|
|
159
|
+
(s) => {
|
|
160
|
+
this.contains(s.target) || (r.abort(), this.hide());
|
|
161
|
+
},
|
|
162
|
+
{ signal: r.signal }
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
{ signal: n(this, u).signal }
|
|
166
|
+
), n(this, d).call(this, n(this, a), "cancel"), n(this, d).call(this, n(this, p), "confirm");
|
|
167
|
+
});
|
|
168
|
+
c(this, b, this.shadowRoot.querySelector(".ea-popper")), c(this, l, this.shadowRoot.querySelector(
|
|
169
|
+
".ea-popper__original"
|
|
170
|
+
)), c(this, h, this.shadowRoot.querySelector(
|
|
171
|
+
".ea-popper__reference"
|
|
172
|
+
));
|
|
173
|
+
const { titleContainer: t, titleIcon: r, titleContent: s } = n(this, v).call(this), { footer: T, cancelButton: P, confirmButton: A } = L(this, S, k).call(this);
|
|
174
|
+
c(this, y, T), c(this, a, P), c(this, p, A), c(this, g, t), c(this, m, r), c(this, f, s);
|
|
175
|
+
}
|
|
176
|
+
static get observedAttributes() {
|
|
177
|
+
return [
|
|
178
|
+
...super.observedAttributes,
|
|
179
|
+
"title",
|
|
180
|
+
"visible",
|
|
181
|
+
"icon",
|
|
182
|
+
"icon-color",
|
|
183
|
+
"hide-icon",
|
|
184
|
+
"confirm-button-text",
|
|
185
|
+
"cancel-button-text",
|
|
186
|
+
"confirm-button-type",
|
|
187
|
+
"cancel-button-type"
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
connectedCallback() {
|
|
191
|
+
super.connectedCallback(), n(this, C).call(this), n(this, _).call(this);
|
|
192
|
+
}
|
|
193
|
+
$beforeUnmounted() {
|
|
194
|
+
var t;
|
|
195
|
+
super.$beforeUnmounted(), (t = n(this, u)) == null || t.abort();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
b = new WeakMap(), l = new WeakMap(), h = new WeakMap(), w = new WeakMap(), q = new WeakMap(), y = new WeakMap(), a = new WeakMap(), p = new WeakMap(), x = new WeakMap(), g = new WeakMap(), m = new WeakMap(), f = new WeakMap(), u = new WeakMap(), v = new WeakMap(), S = new WeakSet(), /**
|
|
199
|
+
* 渲染footer
|
|
200
|
+
* @return {{
|
|
201
|
+
* footer: HTMLElement,
|
|
202
|
+
* cancelButton: HTMLElement,
|
|
203
|
+
* confirmButton: HTMLElement,
|
|
204
|
+
* }}
|
|
205
|
+
*/
|
|
206
|
+
k = function() {
|
|
207
|
+
const t = '<slot name="actions"></slot>', r = `
|
|
208
|
+
<ea-button type="${this["cancel-button-type"]}" class="ea-popconfirm__cancel" size="small" part="cancel-button" text>${this["cancel-button-text"]}</ea-button>
|
|
209
|
+
<ea-button type="${this["confirm-button-type"]}" class="ea-popconfirm__confirm" part="confirm-button" size="small">${this["confirm-button-text"]}</ea-button>
|
|
210
|
+
`, s = document.createElement("footer");
|
|
211
|
+
return s.classList.add("ea-popconfirm__footer"), s.part = "footer", s.innerHTML = this.querySelector('[slot="actions"]') ? t : r, n(this, l).appendChild(s), {
|
|
212
|
+
footer: s,
|
|
213
|
+
cancelButton: s.querySelector(".ea-popconfirm__cancel") || this.querySelector("[data-cancel]"),
|
|
214
|
+
confirmButton: s.querySelector(".ea-popconfirm__confirm") || this.querySelector("[data-confirm]")
|
|
215
|
+
};
|
|
216
|
+
}, C = new WeakMap(), d = new WeakMap(), _ = new WeakMap();
|
|
217
|
+
window.customElements.get("ea-popconfirm") || window.customElements.define("ea-popconfirm", M);
|
|
218
|
+
export {
|
|
219
|
+
M as EaPopconfirm
|
|
220
|
+
};
|