easy-component-ui 2.0.5 → 2.1.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 -0
- package/README.md +90 -0
- package/build/components/Base.js +1 -0
- package/build/components/ea-alert/index.js +1 -0
- package/build/components/ea-alert/src/style/stylesheet.js +1 -0
- package/build/components/ea-aside/index.js +1 -0
- package/build/components/ea-avatar/index.js +1 -0
- package/build/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/errorAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
- package/build/components/ea-avatar/src/style/stylesheet.js +1 -0
- package/build/components/ea-backtop/index.js +1 -0
- package/build/components/ea-backtop/src/style/stylesheet.js +1 -0
- package/build/components/ea-badge/index.js +1 -0
- package/build/components/ea-badge/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb/index.js +1 -0
- package/build/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb-item/index.js +1 -0
- package/build/components/ea-breadcrumb-item/src/style/style.js +1 -0
- package/build/components/ea-button/index.js +1 -0
- package/build/components/ea-button/src/components/ButtonComm.js +1 -0
- package/build/components/ea-button/src/components/HrefComm.js +1 -0
- package/build/components/ea-button/src/style/stylesheet.js +1 -0
- package/build/components/ea-button-group/index.js +1 -0
- package/build/components/ea-button-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/index.js +1 -0
- package/build/components/ea-calendar/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/src/utils/createChangerElement.js +1 -0
- package/build/components/ea-calendar/src/utils/createThead.js +1 -0
- package/build/components/ea-calendar/src/utils/getDate.js +1 -0
- package/build/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
- package/build/components/ea-card/index.js +1 -0
- package/build/components/ea-card/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/index.js +1 -0
- package/build/components/ea-carousel/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
- package/build/components/ea-carousel-item/index.js +1 -0
- package/build/components/ea-carousel-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox/index.js +1 -0
- package/build/components/ea-checkbox/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox-group/index.js +1 -0
- package/build/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-collapse/index.js +1 -0
- package/build/components/ea-collapse-item/index.js +1 -0
- package/build/components/ea-collapse-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-container/index.js +1 -0
- package/build/components/ea-date-picker/index.js +1 -0
- package/build/components/ea-date-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions/index.js +1 -0
- package/build/components/ea-descriptions/src/components/contentTemplate.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
- package/build/components/ea-descriptions/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions-item/index.js +1 -0
- package/build/components/ea-descriptions-item/src/stylesheet.js +1 -0
- package/build/components/ea-drawer/index.js +1 -0
- package/build/components/ea-drawer/src/style/stylesheet.js +1 -0
- package/build/components/ea-empty/index.js +1 -0
- package/build/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
- package/build/components/ea-empty/src/style/stylesheet.js +1 -0
- package/build/components/ea-footer/index.js +1 -0
- package/build/components/ea-form/index.js +1 -0
- package/build/components/ea-form-item/index.js +1 -0
- package/build/components/ea-form-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-header/index.js +1 -0
- package/build/components/ea-icon/config.json +1030 -0
- package/{components/ea-icon/css/fontello-codes.css → build/components/ea-icon/css/fontello.css} +312 -123
- package/build/components/ea-icon/font/fontello.eot +0 -0
- package/build/components/ea-icon/font/fontello.svg +350 -0
- 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 +1 -0
- package/build/components/ea-icon/index.js +1 -0
- package/build/components/ea-image/index.js +1 -0
- package/build/components/ea-image/src/assets/errorImage.js +1 -0
- package/build/components/ea-image/src/style/stylesheet.js +1 -0
- package/build/components/ea-image/src/utils/createPreviewTools.js +1 -0
- package/build/components/ea-infinite-scroll/index.js +1 -0
- package/build/components/ea-infinite-scroll-item/index.js +1 -0
- package/build/components/ea-input/index.js +1 -0
- package/build/components/ea-input/src/components/createFixIcon.js +1 -0
- package/build/components/ea-input/src/components/createSuggestionBoard.js +1 -0
- package/build/components/ea-input/src/components/createWordLimitElement.js +1 -0
- package/build/components/ea-input/src/style/stylesheet.js +1 -0
- package/build/components/ea-input/src/utils/dispatchEvent.js +1 -0
- package/build/components/ea-input/src/utils/handleSearchResult.js +1 -0
- package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
- package/build/components/ea-input-number/index.js +1 -0
- package/build/components/ea-input-number/src/style/stylesheet.js +1 -0
- package/build/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
- package/build/components/ea-link/index.js +1 -0
- package/build/components/ea-link/src/style/stylesheet.js +1 -0
- package/build/components/ea-loading/index.js +1 -0
- package/build/components/ea-loading/src/style/stylesheet.js +1 -0
- package/build/components/ea-main/index.js +1 -0
- package/build/components/ea-menu/index.js +1 -0
- package/build/components/ea-menu/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
- package/build/components/ea-menu-item/index.js +1 -0
- package/build/components/ea-menu-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu-item-group/index.js +1 -0
- package/build/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/index.js +1 -0
- package/build/components/ea-message/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/src/utils/MessageClass.js +1 -0
- package/build/components/ea-message-box/index.js +1 -0
- package/build/components/ea-message-box/src/style/stylesheet.js +1 -0
- package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
- package/build/components/ea-option/index.js +1 -0
- package/build/components/ea-option/src/style/stylesheet.js +1 -0
- package/build/components/ea-option-gropu/index.js +1 -0
- package/build/components/ea-page-header/index.js +1 -0
- package/build/components/ea-page-header/src/style/stylesheet.js +1 -0
- package/build/components/ea-pagination/index.js +1 -0
- package/build/components/ea-pagination/src/components/getMoreItem.js +1 -0
- package/build/components/ea-pagination/src/components/getPageItem.js +1 -0
- package/build/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
- package/build/components/ea-pagination/src/style/stylesheet.js +1 -0
- package/build/components/ea-pane/index.js +1 -0
- package/build/components/ea-pane/src/stylesheet.js +1 -0
- package/build/components/ea-progress/index.js +1 -0
- package/build/components/ea-progress/src/components/SVGComm.js +1 -0
- package/build/components/ea-progress/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio/index.js +1 -0
- package/build/components/ea-radio/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio-group/index.js +1 -0
- package/build/components/ea-rate/index.js +1 -0
- package/build/components/ea-rate/src/components/rateComm.js +1 -0
- package/build/components/ea-rate/src/style/stylesheet.js +1 -0
- package/build/components/ea-result/index.js +1 -0
- package/build/components/ea-result/src/style/stylesheet.js +1 -0
- package/build/components/ea-select/index.js +1 -0
- package/build/components/ea-select/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/index.js +1 -0
- package/build/components/ea-skeleton/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
- package/build/components/ea-skeleton-item/index.js +1 -0
- package/build/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
- package/build/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-step/index.js +1 -0
- package/build/components/ea-step/src/style/stylesheet.js +1 -0
- package/build/components/ea-steps/index.js +1 -0
- package/build/components/ea-steps/src/style/stylesheet.js +1 -0
- package/build/components/ea-submenu/index.js +1 -0
- package/build/components/ea-submenu/src/style/stylesheet.js +1 -0
- package/build/components/ea-switch/index.js +1 -0
- package/build/components/ea-switch/src/style/stylesheet.js +1 -0
- package/build/components/ea-tab/index.js +1 -0
- package/build/components/ea-tab/src/style/stylesheet.js +1 -0
- package/build/components/ea-table/index.js +1 -0
- package/build/components/ea-table/src/style/stylesheet.js +1 -0
- package/build/components/ea-table-column/index.js +1 -0
- package/build/components/ea-tabs/index.js +1 -0
- package/build/components/ea-tabs/src/style/stylesheet.js +1 -0
- package/build/components/ea-tag/index.js +1 -0
- package/build/components/ea-tag/src/style/stylesheet.js +1 -0
- package/build/components/ea-textarea/index.js +1 -0
- package/build/components/ea-textarea/src/style/stylesheet.js +1 -0
- package/build/components/ea-time-picker/index.js +1 -0
- package/build/components/ea-time-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-timeline/index.js +1 -0
- package/build/components/ea-timeline/style/stylesheet.js +1 -0
- package/build/components/ea-timeline-item/index.js +1 -0
- package/build/components/ea-timeline-item/src/style/stylesheet.js +1 -0
- package/build/components/globalConfig.js +1 -0
- package/build/components/index.js +1 -0
- package/build/utils/Validator.js +1 -0
- package/build/utils/createElement.js +1 -0
- package/build/utils/handleDefaultAttrIsTrue.js +1 -0
- package/build/utils/handleTemplate.js +1 -0
- package/build/utils/setStyle.js +1 -0
- package/build/utils/timeout.js +1 -0
- package/components/Base.js +75 -1
- package/components/ea-alert/index.css +91 -0
- package/components/ea-alert/index.js +210 -1
- package/components/ea-alert/index.scss +108 -0
- package/components/ea-alert/src/style/stylesheet.js +85 -1
- package/components/ea-aside/index.css +9 -0
- package/components/ea-aside/index.js +54 -1
- package/components/ea-aside/index.scss +12 -0
- package/components/ea-avatar/index.css +66 -0
- package/components/ea-avatar/index.js +156 -1
- package/components/ea-avatar/index.scss +59 -0
- package/components/ea-avatar/src/assets/defaultAvatar.js +12 -1
- package/components/ea-avatar/src/assets/errorAvatar.js +9 -1
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +18 -1
- package/components/ea-avatar/src/style/stylesheet.js +61 -1
- package/components/ea-backtop/index.css +27 -0
- package/components/ea-backtop/index.js +167 -1
- package/components/ea-backtop/index.scss +29 -0
- package/components/ea-backtop/src/style/stylesheet.js +21 -1
- package/components/ea-badge/index.css +49 -0
- package/components/ea-badge/index.js +103 -1
- package/components/ea-badge/index.scss +56 -0
- package/components/ea-badge/src/style/stylesheet.js +43 -1
- package/components/ea-breadcrumb/index.css +6 -0
- package/components/ea-breadcrumb/index.js +90 -1
- package/components/ea-breadcrumb/index.scss +7 -0
- package/components/ea-breadcrumb/src/style/stylesheet.js +8 -1
- package/components/ea-breadcrumb-item/index.css +10 -0
- package/components/ea-breadcrumb-item/index.js +23 -1
- package/components/ea-breadcrumb-item/index.scss +12 -0
- package/components/ea-breadcrumb-item/src/style/style.js +12 -1
- package/components/ea-button/index.css +206 -0
- package/components/ea-button/index.js +198 -1
- package/components/ea-button/index.scss +143 -0
- package/components/ea-button/src/components/ButtonComm.js +5 -1
- package/components/ea-button/src/components/HrefComm.js +5 -1
- package/components/ea-button/src/style/stylesheet.js +208 -1
- package/components/ea-button-group/index.css +16 -0
- package/components/ea-button-group/index.js +44 -1
- package/components/ea-button-group/index.scss +20 -0
- package/components/ea-button-group/src/style/stylesheet.js +18 -1
- package/components/ea-calendar/index.css +72 -0
- package/components/ea-calendar/index.js +298 -1
- package/components/ea-calendar/index.scss +106 -0
- package/components/ea-calendar/src/style/stylesheet.js +74 -1
- package/components/ea-calendar/src/utils/createChangerElement.js +10 -1
- package/components/ea-calendar/src/utils/createThead.js +18 -1
- package/components/ea-calendar/src/utils/getDate.js +11 -1
- package/components/ea-calendar/src/utils/getUserWeekStart.js +11 -1
- package/components/ea-card/index.css +25 -0
- package/components/ea-card/index.js +51 -1
- package/components/ea-card/index.scss +24 -0
- package/components/ea-card/src/style/stylesheet.js +19 -1
- package/components/ea-carousel/index.css +103 -0
- package/components/ea-carousel/index.js +222 -1
- package/components/ea-carousel/index.scss +140 -0
- package/components/ea-carousel/src/style/stylesheet.js +105 -1
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +9 -1
- package/components/ea-carousel-item/index.css +20 -0
- package/components/ea-carousel-item/index.js +23 -1
- package/components/ea-carousel-item/index.scss +26 -0
- package/components/ea-carousel-item/src/style/stylesheet.js +22 -1
- package/components/ea-checkbox/index.css +108 -0
- package/components/ea-checkbox/index.js +160 -1
- package/components/ea-checkbox/index.scss +141 -0
- package/components/ea-checkbox/src/style/stylesheet.js +110 -1
- package/components/ea-checkbox-group/index.css +6 -0
- package/components/ea-checkbox-group/index.js +120 -1
- package/components/ea-checkbox-group/index.scss +7 -0
- package/components/ea-checkbox-group/src/style/stylesheet.js +8 -1
- package/components/ea-collapse/index.css +0 -0
- package/components/ea-collapse/index.js +109 -1
- package/components/ea-collapse/index.scss +4 -0
- package/components/ea-collapse-item/index.css +31 -0
- package/components/ea-collapse-item/index.js +111 -1
- package/components/ea-collapse-item/index.scss +46 -0
- package/components/ea-collapse-item/src/style/stylesheet.js +33 -1
- package/components/ea-container/index.css +14 -0
- package/components/ea-container/index.js +85 -1
- package/components/ea-container/index.scss +18 -0
- package/components/ea-date-picker/index.css +17 -0
- package/components/ea-date-picker/index.js +191 -1
- package/components/ea-date-picker/index.scss +29 -0
- package/components/ea-date-picker/src/style/stylesheet.js +19 -1
- package/components/ea-descriptions/index.css +33 -0
- package/components/ea-descriptions/index.js +171 -1
- package/components/ea-descriptions/index.scss +45 -0
- package/components/ea-descriptions/src/components/contentTemplate.js +11 -1
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +6 -1
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +8 -1
- package/components/ea-descriptions/src/style/stylesheet.js +35 -1
- package/components/ea-descriptions-item/index.css +21 -0
- package/components/ea-descriptions-item/index.js +71 -1
- package/components/ea-descriptions-item/index.scss +29 -0
- package/components/ea-descriptions-item/src/stylesheet.js +23 -1
- package/components/ea-drawer/index.css +138 -0
- package/components/ea-drawer/index.js +251 -1
- package/components/ea-drawer/index.scss +208 -0
- package/components/ea-drawer/src/style/stylesheet.js +141 -1
- package/components/ea-empty/index.css +30 -0
- package/components/ea-empty/index.js +93 -1
- package/components/ea-empty/index.scss +30 -0
- package/components/ea-empty/src/assets/emptyStatusSVG.js +6 -1
- package/components/ea-empty/src/style/stylesheet.js +24 -1
- package/components/ea-footer/index.css +7 -0
- package/components/ea-footer/index.js +57 -1
- package/components/ea-footer/index.scss +10 -0
- package/components/ea-form/index.css +0 -0
- package/components/ea-form/index.js +121 -1
- package/components/ea-form/index.scss +0 -0
- package/components/ea-form-item/index.css +62 -0
- package/components/ea-form-item/index.js +152 -1
- package/components/ea-form-item/index.scss +83 -0
- package/components/ea-form-item/src/style/stylesheet.js +64 -1
- package/components/ea-header/index.css +7 -0
- package/components/ea-header/index.js +55 -1
- package/components/ea-header/index.scss +10 -0
- package/components/ea-icon/css/fontello.css +312 -226
- package/components/ea-icon/index.css +1 -2
- package/components/ea-icon/index.js +84 -1
- package/components/ea-image/index.css +84 -0
- package/components/ea-image/index.js +182 -1
- package/components/ea-image/index.scss +111 -0
- package/components/ea-image/src/assets/errorImage.js +9 -1
- package/components/ea-image/src/assets/errorImage.svg +7 -0
- package/components/ea-image/src/style/stylesheet.js +86 -1
- package/components/ea-image/src/utils/createPreviewTools.js +140 -1
- package/components/ea-infinite-scroll/index.css +0 -0
- package/components/ea-infinite-scroll/index.js +119 -1
- 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 +18 -1
- package/components/ea-infinite-scroll-item/index.scss +0 -0
- package/components/ea-input/index.css +139 -0
- package/components/ea-input/index.js +398 -1
- package/components/ea-input/index.scss +178 -0
- package/components/ea-input/src/components/createFixIcon.js +108 -1
- package/components/ea-input/src/components/createSuggestionBoard.js +43 -1
- package/components/ea-input/src/components/createWordLimitElement.js +18 -1
- package/components/ea-input/src/style/stylesheet.js +141 -1
- package/components/ea-input/src/utils/dispatchEvent.js +9 -1
- package/components/ea-input/src/utils/handleSearchResult.js +9 -1
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +31 -1
- package/components/ea-input-number/index.css +120 -0
- package/components/ea-input-number/index.js +308 -1
- package/components/ea-input-number/index.scss +132 -0
- package/components/ea-input-number/src/style/stylesheet.js +122 -1
- package/components/ea-input-number/src/utils/handleCustomEvent.js +5 -1
- package/components/ea-link/index.css +48 -0
- package/components/ea-link/index.js +122 -1
- package/components/ea-link/index.scss +36 -0
- package/components/ea-link/src/style/stylesheet.js +50 -1
- package/components/ea-loading/index.css +38 -0
- package/components/ea-loading/index.js +166 -1
- package/components/ea-loading/index.scss +55 -0
- package/components/ea-loading/src/style/stylesheet.js +40 -1
- package/components/ea-main/index.css +8 -0
- package/components/ea-main/index.js +32 -1
- package/components/ea-main/index.scss +11 -0
- package/components/ea-menu/index.css +19 -0
- package/components/ea-menu/index.js +131 -1
- package/components/ea-menu/index.scss +22 -0
- package/components/ea-menu/src/style/stylesheet.js +21 -1
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +32 -1
- package/components/ea-menu-item/index.css +48 -0
- package/components/ea-menu-item/index.js +130 -1
- package/components/ea-menu-item/index.scss +62 -0
- package/components/ea-menu-item/src/style/stylesheet.js +50 -1
- package/components/ea-menu-item-group/index.css +42 -0
- package/components/ea-menu-item-group/index.js +130 -1
- package/components/ea-menu-item-group/index.scss +60 -0
- package/components/ea-menu-item-group/src/style/stylesheet.js +44 -1
- package/components/ea-message/index.css +47 -0
- package/components/ea-message/index.js +171 -1
- package/components/ea-message/index.scss +70 -0
- package/components/ea-message/src/style/stylesheet.js +48 -1
- package/components/ea-message/src/utils/MessageClass.js +67 -1
- package/components/ea-message-box/index.css +85 -0
- package/components/ea-message-box/index.js +211 -1
- package/components/ea-message-box/index.scss +113 -0
- package/components/ea-message-box/src/style/stylesheet.js +87 -1
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +60 -1
- package/components/ea-option/index.css +24 -0
- package/components/ea-option/index.js +74 -1
- package/components/ea-option/index.scss +31 -0
- package/components/ea-option/src/style/stylesheet.js +26 -1
- package/components/ea-option-gropu/index.css +6 -0
- package/components/ea-option-gropu/index.js +57 -1
- package/components/ea-option-gropu/index.scss +8 -0
- package/components/ea-page-header/index.css +33 -0
- package/components/ea-page-header/index.js +91 -1
- package/components/ea-page-header/index.scss +44 -0
- package/components/ea-page-header/src/style/stylesheet.js +35 -1
- package/components/ea-pagination/index.css +69 -0
- package/components/ea-pagination/index.js +305 -1
- package/components/ea-pagination/index.scss +89 -0
- package/components/ea-pagination/src/components/getMoreItem.js +20 -1
- package/components/ea-pagination/src/components/getPageItem.js +11 -1
- package/components/ea-pagination/src/components/getShowTotalItem.js +7 -1
- package/components/ea-pagination/src/style/stylesheet.js +71 -1
- package/components/ea-pane/index.css +6 -0
- package/components/ea-pane/index.js +52 -1
- package/components/ea-pane/index.scss +7 -0
- package/components/ea-pane/src/stylesheet.js +8 -1
- package/components/ea-progress/index.css +61 -0
- package/components/ea-progress/index.js +249 -1
- package/components/ea-progress/index.scss +74 -0
- package/components/ea-progress/src/components/SVGComm.js +18 -1
- package/components/ea-progress/src/style/stylesheet.js +55 -1
- package/components/ea-radio/index.css +82 -0
- package/components/ea-radio/index.js +137 -1
- package/components/ea-radio/index.scss +119 -0
- package/components/ea-radio/src/style/stylesheet.js +84 -1
- package/components/ea-radio-group/index.css +3 -0
- package/components/ea-radio-group/index.js +96 -1
- package/components/ea-radio-group/index.scss +3 -0
- package/components/ea-rate/index.css +44 -0
- package/components/ea-rate/index.js +243 -1
- package/components/ea-rate/index.scss +55 -0
- package/components/ea-rate/src/components/rateComm.js +20 -1
- package/components/ea-rate/src/style/stylesheet.js +45 -1
- package/components/ea-result/index.css +37 -0
- package/components/ea-result/index.js +109 -1
- package/components/ea-result/index.scss +46 -0
- package/components/ea-result/src/style/stylesheet.js +39 -1
- package/components/ea-select/index.css +47 -0
- package/components/ea-select/index.js +312 -1
- package/components/ea-select/index.scss +70 -0
- package/components/ea-select/src/style/stylesheet.js +49 -1
- package/components/ea-skeleton/index.css +12 -0
- package/components/ea-skeleton/index.js +148 -1
- package/components/ea-skeleton/index.scss +16 -0
- package/components/ea-skeleton/src/style/stylesheet.js +14 -1
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +7 -1
- package/components/ea-skeleton-item/index.css +69 -0
- package/components/ea-skeleton-item/index.js +82 -1
- package/components/ea-skeleton-item/index.scss +107 -0
- package/components/ea-skeleton-item/src/assets/imageSVG.js +8 -1
- package/components/ea-skeleton-item/src/style/stylesheet.js +71 -1
- package/components/ea-step/index.css +84 -0
- package/components/ea-step/index.js +230 -1
- package/components/ea-step/index.scss +110 -0
- package/components/ea-step/src/style/stylesheet.js +86 -1
- package/components/ea-steps/index.css +19 -0
- package/components/ea-steps/index.js +104 -1
- package/components/ea-steps/index.scss +23 -0
- package/components/ea-steps/src/style/stylesheet.js +21 -1
- package/components/ea-submenu/index.css +65 -0
- package/components/ea-submenu/index.js +141 -1
- package/components/ea-submenu/index.scss +88 -0
- package/components/ea-submenu/src/style/stylesheet.js +67 -1
- package/components/ea-switch/index.css +90 -0
- package/components/ea-switch/index.js +189 -1
- package/components/ea-switch/index.scss +117 -0
- package/components/ea-switch/src/style/stylesheet.js +92 -1
- package/components/ea-tab/index.css +68 -0
- package/components/ea-tab/index.js +138 -1
- package/components/ea-tab/index.scss +96 -0
- package/components/ea-tab/src/style/stylesheet.js +70 -1
- package/components/ea-table/index.css +98 -0
- package/components/ea-table/index.js +555 -1
- package/components/ea-table/index.scss +90 -0
- package/components/ea-table/src/style/stylesheet.js +100 -1
- package/components/ea-table-column/index.css +0 -0
- package/components/ea-table-column/index.js +164 -1
- package/components/ea-table-column/index.scss +0 -0
- package/components/ea-tabs/index.css +45 -0
- package/components/ea-tabs/index.js +245 -1
- package/components/ea-tabs/index.scss +64 -0
- package/components/ea-tabs/src/style/stylesheet.js +47 -1
- package/components/ea-tag/index.css +90 -0
- package/components/ea-tag/index.js +107 -1
- package/components/ea-tag/index.scss +71 -0
- package/components/ea-tag/src/style/stylesheet.js +92 -1
- package/components/ea-textarea/index.css +37 -0
- package/components/ea-textarea/index.js +277 -1
- package/components/ea-textarea/index.scss +48 -0
- package/components/ea-textarea/src/style/stylesheet.js +39 -1
- package/components/ea-time-picker/index.css +82 -0
- package/components/ea-time-picker/index.js +379 -1
- package/components/ea-time-picker/index.scss +110 -0
- package/components/ea-time-picker/src/style/stylesheet.js +84 -1
- package/components/ea-timeline/index.css +0 -0
- package/components/ea-timeline/index.js +74 -1
- package/components/ea-timeline/index.scss +1 -0
- package/components/ea-timeline/style/stylesheet.js +3 -1
- package/components/ea-timeline-item/index.css +79 -0
- package/components/ea-timeline-item/index.js +146 -1
- package/components/ea-timeline-item/index.scss +92 -0
- package/components/ea-timeline-item/src/style/stylesheet.js +81 -1
- package/components/ea-ui-base-style.css +0 -0
- package/components/ea-ui-base-style.scss +153 -0
- package/components/globalConfig.js +10 -0
- package/components/index.js +67 -0
- package/package.json +1 -1
- package/public/logo.png +0 -0
- package/utils/Validator.js +16 -1
- package/utils/createElement.js +30 -1
- package/utils/handleDefaultAttrIsTrue.js +11 -1
- package/utils/handleTemplate.js +19 -1
- package/utils/setStyle.js +8 -1
- package/utils/timeout.js +16 -1
- package/components/ea-icon/css/animation.css +0 -85
- package/components/ea-icon/css/fontello-embedded.css +0 -181
- package/components/ea-icon/css/fontello-ie7-codes.css +0 -123
- package/components/ea-icon/css/fontello-ie7.css +0 -134
|
@@ -1 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import Base from '../Base.js';
|
|
3
|
+
import '../ea-icon/index.js'
|
|
4
|
+
|
|
5
|
+
const stylesheet = `
|
|
6
|
+
.ea-option-group_wrap .ea-option-group_title {
|
|
7
|
+
padding-left: 20px;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
color: #909399;
|
|
10
|
+
line-height: 30px;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export class EaOptionGroup extends Base {
|
|
15
|
+
#container;
|
|
16
|
+
|
|
17
|
+
#titleWrap;
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
|
|
21
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
22
|
+
|
|
23
|
+
shadowRoot.innerHTML = `
|
|
24
|
+
<div class='ea-option-group_wrap' part='container'>
|
|
25
|
+
<div class='ea-option-group_title' part='title-wrap'></div>
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
this.#container = shadowRoot.querySelector('.ea-option-group_wrap');
|
|
31
|
+
this.#titleWrap = shadowRoot.querySelector('.ea-option-group_title');
|
|
32
|
+
|
|
33
|
+
this.build(shadowRoot, stylesheet);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ------- label 标题 -------
|
|
37
|
+
// #region
|
|
38
|
+
get label() {
|
|
39
|
+
return this.getAttribute('label') || '';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set label(val) {
|
|
43
|
+
this.setAttribute('label', val);
|
|
44
|
+
|
|
45
|
+
this.#titleWrap.innerHTML = val;
|
|
46
|
+
}
|
|
47
|
+
// #endregion
|
|
48
|
+
// ------- end -------
|
|
49
|
+
|
|
50
|
+
connectedCallback() {
|
|
51
|
+
this.label = this.label;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!customElements.get('ea-option-group')) {
|
|
56
|
+
customElements.define('ea-option-group', EaOptionGroup);
|
|
57
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.ea-page-header_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
line-height: 24px;
|
|
5
|
+
}
|
|
6
|
+
.ea-page-header_wrap .ea-page-header_title-wrap,
|
|
7
|
+
.ea-page-header_wrap .ea-page-header_divider,
|
|
8
|
+
.ea-page-header_wrap .ea-page-header_content-wrap {
|
|
9
|
+
line-height: 24px;
|
|
10
|
+
}
|
|
11
|
+
.ea-page-header_wrap .ea-page-header_title-wrap {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
line-height: 1;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
.ea-page-header_wrap .ea-page-header_divider {
|
|
20
|
+
margin: 0 1rem;
|
|
21
|
+
margin-bottom: 1px;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
height: 14px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
color: #dcdfe6;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
}
|
|
29
|
+
.ea-page-header_wrap .ea-page-header_content-wrap {
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
color: #303133;
|
|
32
|
+
line-height: 1;
|
|
33
|
+
}
|
|
@@ -1 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import Base from '../Base.js';
|
|
3
|
+
import '../ea-icon/index.js'
|
|
4
|
+
import { createSlotElement, createElement } from '../../utils/createElement.js';
|
|
5
|
+
|
|
6
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
7
|
+
|
|
8
|
+
export class EaPageHeader extends Base {
|
|
9
|
+
#wrap;
|
|
10
|
+
|
|
11
|
+
#titleWrap;
|
|
12
|
+
#contentWrap
|
|
13
|
+
|
|
14
|
+
#titleSlot;
|
|
15
|
+
#contentSlot;
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
|
|
19
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
20
|
+
shadowRoot.innerHTML = `
|
|
21
|
+
<div class='ea-page-header_wrap' part='container'>
|
|
22
|
+
<div class='ea-page-header_title-wrap' part='title-wrap'>
|
|
23
|
+
<ea-icon class='ea-page-header_back-icon' part='back-icon' icon="icon-angle-left"></ea-icon>
|
|
24
|
+
<slot name="title"></slot>
|
|
25
|
+
</div>
|
|
26
|
+
<div class='ea-page-header_divider' part='divider'>|</div>
|
|
27
|
+
<div class='ea-page-header_content-wrap' part='content-wrap'>
|
|
28
|
+
<slot name="content"></slot>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
this.#wrap = shadowRoot.querySelector('.ea-page-header_wrap');
|
|
34
|
+
this.#titleWrap = shadowRoot.querySelector('.ea-page-header_title-wrap');
|
|
35
|
+
this.#titleSlot = shadowRoot.querySelector('slot[name="title"]');
|
|
36
|
+
this.#contentWrap = shadowRoot.querySelector('.ea-page-header_content-wrap');
|
|
37
|
+
this.#contentSlot = shadowRoot.querySelector('slot[name="content"]');
|
|
38
|
+
|
|
39
|
+
this.build(shadowRoot, stylesheet);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ------- title 返回区域的内容 -------
|
|
43
|
+
// #region
|
|
44
|
+
get title() {
|
|
45
|
+
return this.getAttribute('title') || '';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
set title(value) {
|
|
49
|
+
if (value) {
|
|
50
|
+
this.setAttribute('title', value);
|
|
51
|
+
this.#titleSlot.innerText = value;
|
|
52
|
+
} else {
|
|
53
|
+
this.setAttribute('title', '返回');
|
|
54
|
+
this.#titleSlot.innerText = '返回';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// #endregion
|
|
58
|
+
// ------- end -------
|
|
59
|
+
|
|
60
|
+
// ------- content 页面标题 -------
|
|
61
|
+
// #region
|
|
62
|
+
get content() {
|
|
63
|
+
return this.getAttribute('content') || '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set content(value) {
|
|
67
|
+
if (value) {
|
|
68
|
+
this.setAttribute('content', value);
|
|
69
|
+
this.#contentSlot.innerText = value;
|
|
70
|
+
} else {
|
|
71
|
+
this.setAttribute('content', '');
|
|
72
|
+
this.#contentSlot.innerText = '';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// #endregion
|
|
76
|
+
// ------- end -------
|
|
77
|
+
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
this.title = this.title;
|
|
80
|
+
|
|
81
|
+
this.content = this.content;
|
|
82
|
+
|
|
83
|
+
this.#titleWrap.addEventListener('click', () => {
|
|
84
|
+
this.dispatchEvent(new CustomEvent('back'));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!customElements.get('ea-page-header')) {
|
|
90
|
+
customElements.define('ea-page-header', EaPageHeader);
|
|
91
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.ea-page-header_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
line-height: 24px;
|
|
6
|
+
|
|
7
|
+
.ea-page-header_title-wrap,
|
|
8
|
+
.ea-page-header_divider,
|
|
9
|
+
.ea-page-header_content-wrap {
|
|
10
|
+
line-height: 24px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ea-page-header_title-wrap {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
|
|
20
|
+
line-height: 1;
|
|
21
|
+
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ea-page-header_divider {
|
|
26
|
+
margin: 0 1rem;
|
|
27
|
+
margin-bottom: 1px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
color: #dcdfe6;
|
|
33
|
+
|
|
34
|
+
line-height: 1;
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ea-page-header_content-wrap {
|
|
39
|
+
font-size: 18px;
|
|
40
|
+
color: #303133;
|
|
41
|
+
|
|
42
|
+
line-height: 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
export const stylesheet=
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
.ea-page-header_wrap {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
line-height: 24px;
|
|
6
|
+
}
|
|
7
|
+
.ea-page-header_wrap .ea-page-header_title-wrap,
|
|
8
|
+
.ea-page-header_wrap .ea-page-header_divider,
|
|
9
|
+
.ea-page-header_wrap .ea-page-header_content-wrap {
|
|
10
|
+
line-height: 24px;
|
|
11
|
+
}
|
|
12
|
+
.ea-page-header_wrap .ea-page-header_title-wrap {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
line-height: 1;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.ea-page-header_wrap .ea-page-header_divider {
|
|
21
|
+
margin: 0 1rem;
|
|
22
|
+
margin-bottom: 1px;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
height: 14px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
color: #dcdfe6;
|
|
27
|
+
line-height: 1;
|
|
28
|
+
vertical-align: middle;
|
|
29
|
+
}
|
|
30
|
+
.ea-page-header_wrap .ea-page-header_content-wrap {
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
color: #303133;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.ea-pagination_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
font-size: 0.9rem;
|
|
5
|
+
}
|
|
6
|
+
.ea-pagination_wrap .ea-pagination_item_wrap {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_item,
|
|
11
|
+
.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
margin: 0 5px;
|
|
15
|
+
padding: 0 4px;
|
|
16
|
+
min-width: 30px;
|
|
17
|
+
height: 28px;
|
|
18
|
+
line-height: 28px;
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_item.ea-pagination_item--active {
|
|
23
|
+
color: #409eff;
|
|
24
|
+
}
|
|
25
|
+
.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more {
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
}
|
|
29
|
+
.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more.ea-pagination_more--active {
|
|
30
|
+
color: #409eff;
|
|
31
|
+
}
|
|
32
|
+
.ea-pagination_wrap .ea-pagination_arrow {
|
|
33
|
+
user-select: none;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
padding: 0 10px;
|
|
36
|
+
line-height: 28px;
|
|
37
|
+
}
|
|
38
|
+
.ea-pagination_wrap .ea-pagination_arrow.disabled {
|
|
39
|
+
cursor: default;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
color: #c0c4cc;
|
|
42
|
+
}
|
|
43
|
+
.ea-pagination_wrap .ea-pagination_arrow:first-child {
|
|
44
|
+
margin-right: 0.25rem;
|
|
45
|
+
}
|
|
46
|
+
.ea-pagination_wrap .ea-pagination_arrow:last-child {
|
|
47
|
+
margin-left: 0.25rem;
|
|
48
|
+
}
|
|
49
|
+
.ea-pagination_wrap .ea-pagination_item.background,
|
|
50
|
+
.ea-pagination_wrap .ea-pagination_more.background,
|
|
51
|
+
.ea-pagination_wrap .ea-pagination_arrow.background {
|
|
52
|
+
background-color: #f4f4f5;
|
|
53
|
+
border-radius: 3px;
|
|
54
|
+
}
|
|
55
|
+
.ea-pagination_wrap .ea-pagination_item.background:hover,
|
|
56
|
+
.ea-pagination_wrap .ea-pagination_more.background:hover,
|
|
57
|
+
.ea-pagination_wrap .ea-pagination_arrow.background:hover {
|
|
58
|
+
color: #409eff;
|
|
59
|
+
}
|
|
60
|
+
.ea-pagination_wrap .ea-pagination_item.background.active,
|
|
61
|
+
.ea-pagination_wrap .ea-pagination_more.background.active,
|
|
62
|
+
.ea-pagination_wrap .ea-pagination_arrow.background.active {
|
|
63
|
+
background-color: #409eff;
|
|
64
|
+
color: #f4f4f5;
|
|
65
|
+
}
|
|
66
|
+
.ea-pagination_wrap .ea-pagination_show_total {
|
|
67
|
+
margin-right: 0.5rem;
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
}
|
|
@@ -1 +1,305 @@
|
|
|
1
|
-
import Base from
|
|
1
|
+
import Base from '../Base.js';
|
|
2
|
+
|
|
3
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
4
|
+
|
|
5
|
+
import { getMoreItem } from './src/components/getMoreItem.js';
|
|
6
|
+
import { getPageItem } from './src/components/getPageItem.js';
|
|
7
|
+
import { getShowTotalItem } from './src/components/getShowTotalItem.js';
|
|
8
|
+
|
|
9
|
+
export class EaPagination extends Base {
|
|
10
|
+
#container;
|
|
11
|
+
|
|
12
|
+
// 页码元素的容器
|
|
13
|
+
#paginationWrap;
|
|
14
|
+
|
|
15
|
+
// 箭头
|
|
16
|
+
#prevArrow;
|
|
17
|
+
#nextArrow;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
|
|
22
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
23
|
+
|
|
24
|
+
shadowRoot.innerHTML = `
|
|
25
|
+
<div class="ea-pagination_wrap" part="container">
|
|
26
|
+
<span class="ea-pagination_arrow prev ${this.background ? 'background' : ''}" part="arrow"><</span>
|
|
27
|
+
<div class="ea-pagination_item_wrap" part="item-wrap"></div>
|
|
28
|
+
<span class="ea-pagination_arrow next ${this.background ? 'background' : ''}" part="arrow">></span>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
this.#container = shadowRoot.querySelector('.ea-pagination_wrap');
|
|
33
|
+
this.#prevArrow = shadowRoot.querySelector('.prev');
|
|
34
|
+
this.#paginationWrap = shadowRoot.querySelector('.ea-pagination_item_wrap');
|
|
35
|
+
this.#nextArrow = shadowRoot.querySelector('.next');
|
|
36
|
+
|
|
37
|
+
this.build(shadowRoot, stylesheet);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ------- layout 布局(前一页, 页码, 后一页) -------
|
|
41
|
+
// #region
|
|
42
|
+
get layout() {
|
|
43
|
+
const arr = this.getAttribute('layout').split(',').map(item => item.trim());
|
|
44
|
+
|
|
45
|
+
return arr || ['prev', 'pager', 'next'];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
set layout(value) {
|
|
49
|
+
this.setAttribute('layout', value);
|
|
50
|
+
}
|
|
51
|
+
// #endregion
|
|
52
|
+
// ------- end -------
|
|
53
|
+
|
|
54
|
+
// ------- sizes 分页中每页多少记录 -------
|
|
55
|
+
// #region
|
|
56
|
+
get sizes() {
|
|
57
|
+
return this.getAttrNumber('sizes') || 10;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
set sizes(value) {
|
|
61
|
+
this.setAttribute('sizes', value);
|
|
62
|
+
}
|
|
63
|
+
// #endregion
|
|
64
|
+
// ------- end -------
|
|
65
|
+
|
|
66
|
+
// ------- current-page 当前页码 -------
|
|
67
|
+
// #region
|
|
68
|
+
get currentPage() {
|
|
69
|
+
return this.getAttrNumber('current-page') || 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set currentPage(value) {
|
|
73
|
+
this.setAttribute('current-page', value);
|
|
74
|
+
}
|
|
75
|
+
// #endregion
|
|
76
|
+
// ------- end -------
|
|
77
|
+
|
|
78
|
+
// ------- page-count 总显示的页码数量 -------
|
|
79
|
+
// #region
|
|
80
|
+
get pageCount() {
|
|
81
|
+
return this.getAttrNumber('page-count') || 6;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set pageCount(value) {
|
|
85
|
+
this.setAttribute('page-count', value);
|
|
86
|
+
}
|
|
87
|
+
// #endregion
|
|
88
|
+
// ------- end -------
|
|
89
|
+
|
|
90
|
+
// ------- total 总记录数 -------
|
|
91
|
+
// #region
|
|
92
|
+
get total() {
|
|
93
|
+
return this.getAttrNumber('total');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
set total(value) {
|
|
97
|
+
this.setAttribute('total', value);
|
|
98
|
+
}
|
|
99
|
+
// #endregion
|
|
100
|
+
// ------- end -------
|
|
101
|
+
|
|
102
|
+
// ------- paginationCount 分页总数 -------
|
|
103
|
+
// #region
|
|
104
|
+
get paginationCount() {
|
|
105
|
+
return Math.ceil(this.total / this.sizes);
|
|
106
|
+
}
|
|
107
|
+
// #endregion
|
|
108
|
+
// ------- end -------
|
|
109
|
+
|
|
110
|
+
// ------- background 背景颜色 -------
|
|
111
|
+
// #region
|
|
112
|
+
get background() {
|
|
113
|
+
return this.getAttrBoolean('background');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
set background(value) {
|
|
117
|
+
if (!value) return;
|
|
118
|
+
|
|
119
|
+
this.setAttribute('background', value);
|
|
120
|
+
}
|
|
121
|
+
// #endregion
|
|
122
|
+
// ------- end -------
|
|
123
|
+
|
|
124
|
+
#handleDispatchEvent(event, options) {
|
|
125
|
+
this.dispatchEvent(new CustomEvent(event, options));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 初始化箭头元素
|
|
129
|
+
#initArrowItem() {
|
|
130
|
+
this.#handleArrowStatus();
|
|
131
|
+
|
|
132
|
+
if (this.layout.includes('prev')) {
|
|
133
|
+
this.#prevArrow.addEventListener('click', () => {
|
|
134
|
+
if (this.currentPage <= 1) return;
|
|
135
|
+
|
|
136
|
+
this.currentPage--;
|
|
137
|
+
this.#handlePaginationChange();
|
|
138
|
+
|
|
139
|
+
this.#handleDispatchEvent("change", { detail: { currentPage: this.currentPage } });
|
|
140
|
+
})
|
|
141
|
+
} else {
|
|
142
|
+
this.#prevArrow.style.display = 'none';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (this.layout.includes('next')) {
|
|
146
|
+
this.#nextArrow.addEventListener('click', () => {
|
|
147
|
+
if (this.currentPage >= this.paginationCount) return;
|
|
148
|
+
|
|
149
|
+
this.currentPage++;
|
|
150
|
+
this.#handlePaginationChange();
|
|
151
|
+
|
|
152
|
+
this.#handleDispatchEvent("change", { detail: { currentPage: this.currentPage } });
|
|
153
|
+
})
|
|
154
|
+
} else {
|
|
155
|
+
this.#nextArrow.style.display = 'none';
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// 处理箭头状态
|
|
160
|
+
#handleArrowStatus() {
|
|
161
|
+
if (!this.layout.includes('prev') && !this.layout.includes('next')) return;
|
|
162
|
+
|
|
163
|
+
if (this.currentPage === 1 && this.layout.includes('prev')) this.#prevArrow.classList.add('disabled');
|
|
164
|
+
else if (this.currentPage >= this.paginationCount && this.layout.includes('next')) this.#nextArrow.classList.add('disabled');
|
|
165
|
+
else {
|
|
166
|
+
this.#prevArrow.classList.remove('disabled');
|
|
167
|
+
this.#nextArrow.classList.remove('disabled');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// 处理分页点击事件
|
|
172
|
+
#handlePaginationClick(pageItem, index) {
|
|
173
|
+
pageItem.addEventListener('click', (e) => {
|
|
174
|
+
this.currentPage = index;
|
|
175
|
+
this.#handlePaginationChange();
|
|
176
|
+
|
|
177
|
+
this.#handleDispatchEvent('change', {
|
|
178
|
+
detail: {
|
|
179
|
+
currentPage: this.currentPage
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// 处理更多按钮点击事件
|
|
186
|
+
#handleMoreItemClick(moreItem, arrow) {
|
|
187
|
+
moreItem.addEventListener('click', (e) => {
|
|
188
|
+
|
|
189
|
+
// 跳转到指定页码
|
|
190
|
+
this.currentPage += arrow === "prev" ? -5 : 5;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* 边界处理:
|
|
194
|
+
* 页码数量小于1, 跳转到第一页
|
|
195
|
+
* 页码数量大于总页数, 跳转到最后一页
|
|
196
|
+
*/
|
|
197
|
+
if (this.currentPage < 1) this.currentPage = 1;
|
|
198
|
+
else if (this.currentPage > this.paginationCount) this.currentPage = this.paginationCount;
|
|
199
|
+
|
|
200
|
+
this.#handlePaginationChange();
|
|
201
|
+
|
|
202
|
+
this.#handleDispatchEvent('change', {
|
|
203
|
+
detail: {
|
|
204
|
+
currentPage: this.currentPage
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// 处理分页的页码
|
|
211
|
+
#handlePaginationItemChange() {
|
|
212
|
+
if (!this.layout.includes('pager')) return;
|
|
213
|
+
|
|
214
|
+
this.#paginationWrap.innerHTML = '';
|
|
215
|
+
|
|
216
|
+
const interval = Math.floor(this.pageCount / 2);
|
|
217
|
+
let start = this.currentPage - interval;
|
|
218
|
+
let end = this.currentPage + interval;
|
|
219
|
+
|
|
220
|
+
// 边界处理
|
|
221
|
+
if (start <= 1) {
|
|
222
|
+
start = 1;
|
|
223
|
+
end = this.pageCount < this.paginationCount ? this.pageCount : this.paginationCount;
|
|
224
|
+
} else if (end >= this.paginationCount) {
|
|
225
|
+
start = this.paginationCount - this.pageCount + 1;
|
|
226
|
+
end = this.paginationCount;
|
|
227
|
+
} else {
|
|
228
|
+
end--;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// 添加页码
|
|
232
|
+
for (let i = start; i <= end; i++) {
|
|
233
|
+
const pageItem = getPageItem(i, this.background);
|
|
234
|
+
this.#paginationWrap.appendChild(pageItem);
|
|
235
|
+
|
|
236
|
+
// 设置当前页码选中后的样式
|
|
237
|
+
if (i === this.currentPage) {
|
|
238
|
+
pageItem.classList.add('ea-pagination_item--active');
|
|
239
|
+
if (this.background) pageItem.classList.add('active');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 添加点击事件
|
|
243
|
+
this.#handlePaginationClick(pageItem, i);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// 添加 更多(左) + 第一页
|
|
247
|
+
if (this.total > this.pageCount && this.currentPage >= this.pageCount && this.paginationCount !== this.pageCount) {
|
|
248
|
+
const more = getMoreItem('prev', this.background);
|
|
249
|
+
this.#handleMoreItemClick(more, 'prev');
|
|
250
|
+
|
|
251
|
+
const firstPage = getPageItem(1, this.background);
|
|
252
|
+
this.#handlePaginationClick(firstPage, 1);
|
|
253
|
+
|
|
254
|
+
this.#paginationWrap.insertBefore(more, this.#paginationWrap.firstChild);
|
|
255
|
+
this.#paginationWrap.insertBefore(firstPage, this.#paginationWrap.firstChild);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// 添加 更多(右) + 最后一页
|
|
259
|
+
if (this.total > this.pageCount && this.currentPage < this.paginationCount - interval && this.paginationCount !== this.pageCount) {
|
|
260
|
+
const more = getMoreItem('next', this.background);
|
|
261
|
+
this.#handleMoreItemClick(more, 'next');
|
|
262
|
+
|
|
263
|
+
const lastPage = getPageItem(this.paginationCount, this.background);
|
|
264
|
+
this.#handlePaginationClick(lastPage, this.paginationCount);
|
|
265
|
+
|
|
266
|
+
this.#paginationWrap.appendChild(more);
|
|
267
|
+
this.#paginationWrap.appendChild(lastPage);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 处理分页变化
|
|
272
|
+
#handlePaginationChange() {
|
|
273
|
+
this.#handleArrowStatus();
|
|
274
|
+
this.#handlePaginationItemChange();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// 处理显示总数
|
|
278
|
+
#initTotalShow() {
|
|
279
|
+
if (!this.layout.includes('total')) return;
|
|
280
|
+
|
|
281
|
+
const totalItem = getShowTotalItem();
|
|
282
|
+
totalItem.innerHTML = `共 ${this.total} 条`;
|
|
283
|
+
|
|
284
|
+
this.#container.insertBefore(totalItem, this.#container.firstChild);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
connectedCallback() {
|
|
288
|
+
// 设置sizes
|
|
289
|
+
this.sizes = this.sizes;
|
|
290
|
+
|
|
291
|
+
// 设置current-page
|
|
292
|
+
this.currentPage = this.currentPage;
|
|
293
|
+
|
|
294
|
+
// 设置total
|
|
295
|
+
this.total = this.total;
|
|
296
|
+
|
|
297
|
+
this.#initArrowItem();
|
|
298
|
+
this.#handlePaginationItemChange();
|
|
299
|
+
this.#initTotalShow();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (!customElements.get('ea-pagination')) {
|
|
304
|
+
customElements.define('ea-pagination', EaPagination);
|
|
305
|
+
}
|