easy-component-ui 2.0.4 → 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,54 @@
|
|
|
1
|
-
import Base from
|
|
1
|
+
import Base from '../Base.js';
|
|
2
|
+
import '../ea-icon/index.js'
|
|
3
|
+
|
|
4
|
+
const stylesheet = `
|
|
5
|
+
.ea-aside_wrap {
|
|
6
|
+
height: 100%;
|
|
7
|
+
overflow: auto;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
.ea-aside_wrap ::slotted(ea-main) {
|
|
12
|
+
overflow: auto;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export class EaAside extends Base {
|
|
17
|
+
#wrap;
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
|
|
21
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
22
|
+
shadowRoot.innerHTML = `
|
|
23
|
+
<aside class="ea-aside_wrap" part="container">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</aside>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
this.#wrap = shadowRoot.querySelector('.ea-aside_wrap');
|
|
29
|
+
|
|
30
|
+
this.build(shadowRoot, stylesheet);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ------- width 侧边栏宽度 -------
|
|
34
|
+
// #region
|
|
35
|
+
get width() {
|
|
36
|
+
return this.getAttrNumber('width') || 200;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
set width(value) {
|
|
40
|
+
this.setAttribute('width', value);
|
|
41
|
+
|
|
42
|
+
this.#wrap.style.width = `${value}px`;
|
|
43
|
+
}
|
|
44
|
+
// #endregion
|
|
45
|
+
// ------- end -------
|
|
46
|
+
|
|
47
|
+
connectedCallback() {
|
|
48
|
+
this.width = this.width;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!customElements.get('ea-aside')) {
|
|
53
|
+
customElements.define('ea-aside', EaAside);
|
|
54
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@import "../ea-icon/css/fontello.css";
|
|
2
|
+
@import "../ea-icon/css/animation.css";
|
|
3
|
+
@font-face {
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
font-size: 16px;
|
|
6
|
+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
7
|
+
src: url("../ea-icon/font/fontello.eot") format("embedded-opentype"), url("../ea-icon/font/fontello.ttf") format("truetype"), url("../ea-icon/font/fontello.woff") format("woff"), url("../ea-icon/font/fontello.woff2") format("woff2"), url("../ea-icon/font/fontello.svg") format("svg");
|
|
8
|
+
}
|
|
9
|
+
.ea-avatar_wrap .ea-avatar {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
color: #ffffff;
|
|
14
|
+
}
|
|
15
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--fill img {
|
|
16
|
+
object-fit: fill;
|
|
17
|
+
}
|
|
18
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--contain img {
|
|
19
|
+
object-fit: contain;
|
|
20
|
+
}
|
|
21
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--cover img {
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
}
|
|
24
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--none img {
|
|
25
|
+
object-fit: none;
|
|
26
|
+
}
|
|
27
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--scale-down img {
|
|
28
|
+
object-fit: scale-down;
|
|
29
|
+
}
|
|
30
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--normal {
|
|
31
|
+
width: 50px;
|
|
32
|
+
height: 50px;
|
|
33
|
+
line-height: 50px;
|
|
34
|
+
}
|
|
35
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--large {
|
|
36
|
+
width: 40px;
|
|
37
|
+
height: 40px;
|
|
38
|
+
line-height: 40px;
|
|
39
|
+
}
|
|
40
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--medium {
|
|
41
|
+
width: 36px;
|
|
42
|
+
height: 36px;
|
|
43
|
+
line-height: 36px;
|
|
44
|
+
}
|
|
45
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--small {
|
|
46
|
+
width: 28px;
|
|
47
|
+
height: 28px;
|
|
48
|
+
line-height: 28px;
|
|
49
|
+
}
|
|
50
|
+
.ea-avatar_wrap .ea-avatar .ea-avatar--text {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 50%;
|
|
53
|
+
left: 50%;
|
|
54
|
+
transform: translate(-50%, -50%);
|
|
55
|
+
}
|
|
56
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--circle {
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
}
|
|
59
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--square {
|
|
60
|
+
border-radius: 5px;
|
|
61
|
+
}
|
|
62
|
+
.ea-avatar_wrap .ea-avatar .ea-avatar--img {
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
object-fit: cover;
|
|
66
|
+
}
|
|
@@ -1 +1,156 @@
|
|
|
1
|
-
import Base from
|
|
1
|
+
import Base from '../Base.js';
|
|
2
|
+
|
|
3
|
+
import "../ea-icon/index.js"
|
|
4
|
+
|
|
5
|
+
import { errorAvatar } from './src/assets/errorAvatar.js';
|
|
6
|
+
import { iconAvatar, textAvatar } from './src/assets/iconAndTextAvatar.js';
|
|
7
|
+
|
|
8
|
+
import { stylesheet } from "./src/style/stylesheet.js"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export class EaAvatar extends Base {
|
|
12
|
+
#avatar;
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
|
|
17
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
18
|
+
|
|
19
|
+
shadowRoot.innerHTML = `
|
|
20
|
+
<div class="ea-avatar_wrap" part='container'>
|
|
21
|
+
<span class="ea-avatar" part="avatar">
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
this.#avatar = shadowRoot.querySelector('.ea-avatar');
|
|
28
|
+
|
|
29
|
+
this.build(shadowRoot, stylesheet);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ------- size 图片大小 -------
|
|
33
|
+
// #region
|
|
34
|
+
get size() {
|
|
35
|
+
const sizeNumber = this.getAttrNumber('size');
|
|
36
|
+
const sizeString = this.getAttribute('size');
|
|
37
|
+
|
|
38
|
+
if (sizeNumber === 0 || !sizeNumber) {
|
|
39
|
+
return ['large', 'medium', 'small'].includes(sizeString) ? sizeString : 'normal';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return this.getAttrNumber('size');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
set size(value) {
|
|
46
|
+
this.setAttribute('size', value);
|
|
47
|
+
|
|
48
|
+
if (typeof value === "number") {
|
|
49
|
+
this.#avatar.style.width = `${value}px`;
|
|
50
|
+
this.#avatar.style.height = `${value}px`;
|
|
51
|
+
this.#avatar.style.lineHeight = `${value}px`;
|
|
52
|
+
} else if (typeof value === "string") {
|
|
53
|
+
this.#avatar.classList.add(`ea-avatar--${value}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// #endregion
|
|
57
|
+
// ------- end -------
|
|
58
|
+
|
|
59
|
+
// ------- shape 图片形状 -------
|
|
60
|
+
// #region
|
|
61
|
+
get shape() {
|
|
62
|
+
const shape = this.getAttribute('shape');
|
|
63
|
+
|
|
64
|
+
return ['circle', 'square'].includes(shape) ? shape : 'circle';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set shape(value) {
|
|
68
|
+
this.setAttribute('shape', value);
|
|
69
|
+
this.#avatar.classList.add(`ea-avatar--${this.shape}`);
|
|
70
|
+
}
|
|
71
|
+
// #endregion
|
|
72
|
+
// ------- end -------
|
|
73
|
+
|
|
74
|
+
// ------- src 图片链接 -------
|
|
75
|
+
// #region
|
|
76
|
+
get src() {
|
|
77
|
+
return this.getAttribute('src');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
set src(value) {
|
|
81
|
+
if (!value) return;
|
|
82
|
+
|
|
83
|
+
this.setAttribute('src', value);
|
|
84
|
+
|
|
85
|
+
const image = new Image();
|
|
86
|
+
image.src = value;
|
|
87
|
+
|
|
88
|
+
image.onload = () => {
|
|
89
|
+
this.#avatar.innerHTML = `<img class="ea-avatar--img" src="${value}" alt="头像">`;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
image.onerror = (e) => {
|
|
93
|
+
this.#avatar.innerHTML = errorAvatar;
|
|
94
|
+
|
|
95
|
+
this.dispatchEvent(new CustomEvent('error', {
|
|
96
|
+
detail: {
|
|
97
|
+
error: e,
|
|
98
|
+
},
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// #endregion
|
|
103
|
+
// ------- end -------
|
|
104
|
+
|
|
105
|
+
// ------- icon 图标 -------
|
|
106
|
+
// #region
|
|
107
|
+
get icon() {
|
|
108
|
+
return this.getAttribute('icon') || '';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
set icon(value) {
|
|
112
|
+
this.setAttribute('icon', value);
|
|
113
|
+
|
|
114
|
+
this.#avatar.innerHTML = iconAvatar(value);
|
|
115
|
+
}
|
|
116
|
+
// #endregion
|
|
117
|
+
// ------- end -------
|
|
118
|
+
|
|
119
|
+
// ------- fit 图片容器适应 -------
|
|
120
|
+
// #region
|
|
121
|
+
get fit() {
|
|
122
|
+
return this.getAttribute('fit') || 'cover';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
set fit(value) {
|
|
126
|
+
this.setAttribute('fit', value);
|
|
127
|
+
|
|
128
|
+
this.#avatar.classList.add(`ea-avatar-fill--${value}`);
|
|
129
|
+
}
|
|
130
|
+
// #endregion
|
|
131
|
+
// ------- end -------
|
|
132
|
+
|
|
133
|
+
connectedCallback() {
|
|
134
|
+
this.size = this.size;
|
|
135
|
+
|
|
136
|
+
this.shape = this.shape;
|
|
137
|
+
|
|
138
|
+
this.src = this.src;
|
|
139
|
+
|
|
140
|
+
if (this.src) {
|
|
141
|
+
this.fit = this.fit;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (!this.src && this.icon) {
|
|
145
|
+
this.icon = this.icon;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (this.innerHTML !== "" && !this.icon && !this.src) {
|
|
149
|
+
this.#avatar.innerHTML = textAvatar(this.innerHTML);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (!customElements.get('ea-avatar')) {
|
|
155
|
+
customElements.define('ea-avatar', EaAvatar);
|
|
156
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@import "../ea-ui-base-style.scss";
|
|
2
|
+
@import "../ea-icon/index.scss";
|
|
3
|
+
|
|
4
|
+
@mixin ea-avatar-size($size-name, $size) {
|
|
5
|
+
&.ea-avatar--#{$size-name} {
|
|
6
|
+
width: $size;
|
|
7
|
+
height: $size;
|
|
8
|
+
line-height: $size;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$fit-type: fill contain cover none scale-down;
|
|
13
|
+
@mixin ea-object-fit($type) {
|
|
14
|
+
&.ea-avatar-fill--#{$type} {
|
|
15
|
+
img {
|
|
16
|
+
object-fit: $type;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ea-avatar_wrap {
|
|
22
|
+
.ea-avatar {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
color: #ffffff;
|
|
27
|
+
|
|
28
|
+
@each $type in $fit-type {
|
|
29
|
+
@include ea-object-fit($type);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include ea-avatar-size("normal", 50px);
|
|
33
|
+
@include ea-avatar-size("large", 40px);
|
|
34
|
+
@include ea-avatar-size("medium", 36px);
|
|
35
|
+
@include ea-avatar-size("small", 28px);
|
|
36
|
+
|
|
37
|
+
.ea-avatar--text {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
left: 50%;
|
|
41
|
+
transform: translate(-50%, -50%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ea-avatar--circle {
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.ea-avatar--square {
|
|
49
|
+
border-radius: 5px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ea-avatar--img {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
|
|
56
|
+
object-fit: cover;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export const defaultAvatar
|
|
1
|
+
export const defaultAvatar = `
|
|
2
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<defs>
|
|
4
|
+
<clipPath id="a">
|
|
5
|
+
<path d="M0 40h90v45H0z" />
|
|
6
|
+
</clipPath>
|
|
7
|
+
</defs>
|
|
8
|
+
<path fill="#c0c4cc" d="M0 0h100v100H0z" />
|
|
9
|
+
<circle cx="50" cy="35" r="20" fill="#fff" />
|
|
10
|
+
<circle cx="50" cy="97" r="40" fill="#fff" clip-path="url(#a)" />
|
|
11
|
+
</svg>
|
|
12
|
+
`;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export const errorAvatar
|
|
1
|
+
export const errorAvatar = `
|
|
2
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path fill="#c0c4cc" d="M0 0h100v100H0z" />
|
|
4
|
+
<path fill="#fff" d="M15 20h70v60H15z" />
|
|
5
|
+
<circle r="8" cx="32" cy="35" fill="#c0c4cc" />
|
|
6
|
+
<path d="M60 42.5L39 75h42z" fill="#c0c4cc" />
|
|
7
|
+
<path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />
|
|
8
|
+
</svg>
|
|
9
|
+
`;
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
const background
|
|
1
|
+
const background = `
|
|
2
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path fill="#c0c4cc" d="M0 0h100v100H0z" />
|
|
4
|
+
</svg>
|
|
5
|
+
`;
|
|
6
|
+
export const iconAvatar = (icon) => {
|
|
7
|
+
return `
|
|
8
|
+
${background}
|
|
9
|
+
<ea-icon class="fa ea-avatar--text" icon="${icon}"></ea-icon>
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const textAvatar = (text) => {
|
|
14
|
+
return `
|
|
15
|
+
${background}
|
|
16
|
+
<span class="ea-avatar--text">${text}</span>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
export const stylesheet = `
|
|
3
|
+
.ea-avatar_wrap .ea-avatar {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
color: #ffffff;
|
|
8
|
+
}
|
|
9
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--fill img {
|
|
10
|
+
object-fit: fill;
|
|
11
|
+
}
|
|
12
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--contain img {
|
|
13
|
+
object-fit: contain;
|
|
14
|
+
}
|
|
15
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--cover img {
|
|
16
|
+
object-fit: cover;
|
|
17
|
+
}
|
|
18
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--none img {
|
|
19
|
+
object-fit: none;
|
|
20
|
+
}
|
|
21
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar-fill--scale-down img {
|
|
22
|
+
object-fit: scale-down;
|
|
23
|
+
}
|
|
24
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--normal {
|
|
25
|
+
width: 50px;
|
|
26
|
+
height: 50px;
|
|
27
|
+
line-height: 50px;
|
|
28
|
+
}
|
|
29
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--large {
|
|
30
|
+
width: 40px;
|
|
31
|
+
height: 40px;
|
|
32
|
+
line-height: 40px;
|
|
33
|
+
}
|
|
34
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--medium {
|
|
35
|
+
width: 36px;
|
|
36
|
+
height: 36px;
|
|
37
|
+
line-height: 36px;
|
|
38
|
+
}
|
|
39
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--small {
|
|
40
|
+
width: 28px;
|
|
41
|
+
height: 28px;
|
|
42
|
+
line-height: 28px;
|
|
43
|
+
}
|
|
44
|
+
.ea-avatar_wrap .ea-avatar .ea-avatar--text {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 50%;
|
|
47
|
+
left: 50%;
|
|
48
|
+
transform: translate(-50%, -50%);
|
|
49
|
+
}
|
|
50
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--circle {
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
}
|
|
53
|
+
.ea-avatar_wrap .ea-avatar.ea-avatar--square {
|
|
54
|
+
border-radius: 5px;
|
|
55
|
+
}
|
|
56
|
+
.ea-avatar_wrap .ea-avatar .ea-avatar--img {
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
object-fit: cover;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import "../ea-icon/css/fontello.css";
|
|
2
|
+
@import "../ea-icon/css/animation.css";
|
|
3
|
+
@font-face {
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
font-size: 16px;
|
|
6
|
+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
7
|
+
src: url("../ea-icon/font/fontello.eot") format("embedded-opentype"), url("../ea-icon/font/fontello.ttf") format("truetype"), url("../ea-icon/font/fontello.woff") format("woff"), url("../ea-icon/font/fontello.woff2") format("woff2"), url("../ea-icon/font/fontello.svg") format("svg");
|
|
8
|
+
}
|
|
9
|
+
.ea-backtop_wrap {
|
|
10
|
+
position: fixed;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: 40px;
|
|
15
|
+
height: 40px;
|
|
16
|
+
right: 40px;
|
|
17
|
+
bottom: 40px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
color: #409eff;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
|
|
24
|
+
opacity: 1;
|
|
25
|
+
z-index: 5;
|
|
26
|
+
transition: opacity 0.3s ease-in-out;
|
|
27
|
+
}
|
|
@@ -1 +1,167 @@
|
|
|
1
|
-
import{timeout}from
|
|
1
|
+
import { timeout } from '../../utils/timeout.js';
|
|
2
|
+
import Base from '../Base.js';
|
|
3
|
+
import "../ea-icon/index.js"
|
|
4
|
+
|
|
5
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
6
|
+
|
|
7
|
+
export class EaBacktop extends Base {
|
|
8
|
+
#wrap;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
|
|
13
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
14
|
+
shadowRoot.innerHTML = `
|
|
15
|
+
<div class="ea-backtop_wrap" part='container' style='display: none'>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
this.#wrap = shadowRoot.querySelector('.ea-backtop_wrap');
|
|
21
|
+
|
|
22
|
+
this.build(shadowRoot, stylesheet);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ------- target 触发滚动的对象 -------
|
|
26
|
+
// #region
|
|
27
|
+
get target() {
|
|
28
|
+
return this.getAttribute('target') || '';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set target(value) {
|
|
32
|
+
this.setAttribute('target', value);
|
|
33
|
+
}
|
|
34
|
+
// #endregion
|
|
35
|
+
// ------- end -------
|
|
36
|
+
|
|
37
|
+
// ------- right 滚动按钮距离右边的距离 -------
|
|
38
|
+
// #region
|
|
39
|
+
get right() {
|
|
40
|
+
return this.getAttribute('right') || '40px';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set right(value) {
|
|
44
|
+
this.setAttribute('right', value);
|
|
45
|
+
|
|
46
|
+
this.#wrap.style.right = value;
|
|
47
|
+
}
|
|
48
|
+
// #endregion
|
|
49
|
+
// ------- end -------
|
|
50
|
+
|
|
51
|
+
// ------- bottom 滚动按钮距离下边的距离 -------
|
|
52
|
+
// #region
|
|
53
|
+
get bottom() {
|
|
54
|
+
return this.getAttribute('bottom') || '40px';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set bottom(value) {
|
|
58
|
+
this.setAttribute('bottom', value);
|
|
59
|
+
|
|
60
|
+
this.#wrap.style.bottom = value;
|
|
61
|
+
}
|
|
62
|
+
// #endregion
|
|
63
|
+
// ------- end -------
|
|
64
|
+
|
|
65
|
+
// ------- icon 图标类名 -------
|
|
66
|
+
// #region
|
|
67
|
+
get icon() {
|
|
68
|
+
return this.getAttribute('icon') || "icon-angle-up";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set icon(value) {
|
|
72
|
+
this.setAttribute('icon', value);
|
|
73
|
+
|
|
74
|
+
this.#wrap.innerHTML = `
|
|
75
|
+
<ea-icon icon="${value}" part='icon'></ea-icon>
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
// #endregion
|
|
79
|
+
// ------- end -------
|
|
80
|
+
|
|
81
|
+
// ------- visibility-height 滚动按钮显示和隐藏的触发条件 -------
|
|
82
|
+
// #region
|
|
83
|
+
get visibilityHeight() {
|
|
84
|
+
return this.getAttribute('visibility-height') || 200;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set visibilityHeight(value) {
|
|
88
|
+
this.setAttribute('visibility-height', value);
|
|
89
|
+
}
|
|
90
|
+
// #endregion
|
|
91
|
+
// ------- end -------
|
|
92
|
+
|
|
93
|
+
#handleScrollEvent(targetName) {
|
|
94
|
+
let dom = null;
|
|
95
|
+
let scrollDom = null;
|
|
96
|
+
|
|
97
|
+
if (targetName === "null" || targetName === '' || targetName === null || targetName === undefined || targetName === 'undefined') {
|
|
98
|
+
dom = document;
|
|
99
|
+
scrollDom = document.documentElement;
|
|
100
|
+
} else {
|
|
101
|
+
dom = document.querySelector(targetName);
|
|
102
|
+
scrollDom = document.querySelector(targetName);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return { dom, scrollDom };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#handleBackTopBtnShow(scrollDom) {
|
|
109
|
+
if (scrollDom.scrollTop > this.visibilityHeight) {
|
|
110
|
+
this.#wrap.style.display = 'flex';
|
|
111
|
+
this.#wrap.ontransitionend = null;
|
|
112
|
+
|
|
113
|
+
timeout(() => {
|
|
114
|
+
this.#wrap.style.opacity = 1;
|
|
115
|
+
}, 10);
|
|
116
|
+
} else {
|
|
117
|
+
this.#wrap.style.opacity = 0;
|
|
118
|
+
|
|
119
|
+
this.#wrap.ontransitionend = () => {
|
|
120
|
+
this.#wrap.style.display = 'none';
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#initScrollBtn() {
|
|
126
|
+
const { dom, scrollDom } = this.#handleScrollEvent(this.target);
|
|
127
|
+
|
|
128
|
+
this.#handleBackTopBtnShow(scrollDom);
|
|
129
|
+
|
|
130
|
+
dom.addEventListener('scroll', () => {
|
|
131
|
+
this.#handleBackTopBtnShow(scrollDom);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
this.#wrap.addEventListener('click', function () {
|
|
135
|
+
let step = 10;
|
|
136
|
+
|
|
137
|
+
let timer = setInterval(() => {
|
|
138
|
+
step += 5;
|
|
139
|
+
scrollDom.scrollTop -= step;
|
|
140
|
+
|
|
141
|
+
if (scrollDom.scrollTop <= 0) {
|
|
142
|
+
scrollDom.scrollTop = 0;
|
|
143
|
+
clearInterval(timer);
|
|
144
|
+
timer = null;
|
|
145
|
+
|
|
146
|
+
this.dispatchEvent(new CustomEvent('reachedTop', {}));
|
|
147
|
+
}
|
|
148
|
+
}, 12);
|
|
149
|
+
|
|
150
|
+
this.dispatchEvent(new CustomEvent('backtop', {}));
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
connectedCallback() {
|
|
155
|
+
this.target = this.target;
|
|
156
|
+
this.right = this.right;
|
|
157
|
+
this.bottom = this.bottom;
|
|
158
|
+
this.visibilityHeight = this.visibilityHeight;
|
|
159
|
+
this.icon = this.icon;
|
|
160
|
+
|
|
161
|
+
this.#initScrollBtn();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (!customElements.get('ea-backtop')) {
|
|
166
|
+
customElements.define('ea-backtop', EaBacktop);
|
|
167
|
+
}
|