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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
.ea-step_wrap {
|
|
2
|
+
color: #c0c4cc;
|
|
3
|
+
|
|
4
|
+
transition: color 0.3s;
|
|
5
|
+
|
|
6
|
+
.ea-step_head-wrap {
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
.ea-step_head-icon {
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
|
|
16
|
+
width: 24px;
|
|
17
|
+
height: 24px;
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
|
|
22
|
+
z-index: 1;
|
|
23
|
+
|
|
24
|
+
&.is-text {
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
border: 2px solid;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ea-step_bar {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 50%;
|
|
33
|
+
transform: translateY(-50%);
|
|
34
|
+
margin-left: 2px;
|
|
35
|
+
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 2px;
|
|
38
|
+
|
|
39
|
+
background-color: #c0c4cc;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.is-last {
|
|
43
|
+
flex-basis: auto;
|
|
44
|
+
|
|
45
|
+
.ea-step_bar {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ea-step_main-wrap {
|
|
52
|
+
white-space: normal;
|
|
53
|
+
text-align: left;
|
|
54
|
+
|
|
55
|
+
.ea-step_title-wrap {
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
line-height: 38px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ea-step_description-wrap {
|
|
61
|
+
margin-top: -5px;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
line-height: 20px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.is-process {
|
|
68
|
+
color: #303133;
|
|
69
|
+
border-color: #303133;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.is-finish {
|
|
73
|
+
color: #67c23a;
|
|
74
|
+
border-color: #67c23a;
|
|
75
|
+
|
|
76
|
+
.ea-step_head-wrap {
|
|
77
|
+
.ea-step_bar {
|
|
78
|
+
background-color: #67c23a;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.is-simple {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
|
|
87
|
+
.ea-step_head-wrap {
|
|
88
|
+
position: relative;
|
|
89
|
+
|
|
90
|
+
.ea-step_bar {
|
|
91
|
+
position: relative;
|
|
92
|
+
width: auto;
|
|
93
|
+
height: auto;
|
|
94
|
+
transform: translateY(0%);
|
|
95
|
+
margin-left: 2px;
|
|
96
|
+
|
|
97
|
+
flex: 1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ea-step_main-wrap {
|
|
102
|
+
margin-left: 16px;
|
|
103
|
+
line-height: 24px;
|
|
104
|
+
height: 24px;
|
|
105
|
+
.ea-step_title-wrap {
|
|
106
|
+
line-height: 24px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1 +1,86 @@
|
|
|
1
|
-
export const stylesheet=
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
.ea-step_wrap {
|
|
3
|
+
color: #c0c4cc;
|
|
4
|
+
transition: color 0.3s;
|
|
5
|
+
}
|
|
6
|
+
.ea-step_wrap .ea-step_head-wrap {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
.ea-step_wrap .ea-step_head-wrap .ea-step_head-icon {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
width: 24px;
|
|
15
|
+
height: 24px;
|
|
16
|
+
background-color: #fff;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
}
|
|
20
|
+
.ea-step_wrap .ea-step_head-wrap .ea-step_head-icon.is-text {
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
border: 2px solid;
|
|
23
|
+
}
|
|
24
|
+
.ea-step_wrap .ea-step_head-wrap .ea-step_bar {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 50%;
|
|
27
|
+
transform: translateY(-50%);
|
|
28
|
+
margin-left: 2px;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 2px;
|
|
31
|
+
background-color: #c0c4cc;
|
|
32
|
+
}
|
|
33
|
+
.ea-step_wrap .ea-step_head-wrap.is-last {
|
|
34
|
+
flex-basis: auto;
|
|
35
|
+
}
|
|
36
|
+
.ea-step_wrap .ea-step_head-wrap.is-last .ea-step_bar {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
.ea-step_wrap .ea-step_main-wrap {
|
|
40
|
+
white-space: normal;
|
|
41
|
+
text-align: left;
|
|
42
|
+
}
|
|
43
|
+
.ea-step_wrap .ea-step_main-wrap .ea-step_title-wrap {
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
line-height: 38px;
|
|
46
|
+
}
|
|
47
|
+
.ea-step_wrap .ea-step_main-wrap .ea-step_description-wrap {
|
|
48
|
+
margin-top: -5px;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
line-height: 20px;
|
|
51
|
+
}
|
|
52
|
+
.ea-step_wrap.is-process {
|
|
53
|
+
color: #303133;
|
|
54
|
+
border-color: #303133;
|
|
55
|
+
}
|
|
56
|
+
.ea-step_wrap.is-finish {
|
|
57
|
+
color: #67c23a;
|
|
58
|
+
border-color: #67c23a;
|
|
59
|
+
}
|
|
60
|
+
.ea-step_wrap.is-finish .ea-step_head-wrap .ea-step_bar {
|
|
61
|
+
background-color: #67c23a;
|
|
62
|
+
}
|
|
63
|
+
.ea-step_wrap.is-simple {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
.ea-step_wrap.is-simple .ea-step_head-wrap {
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
.ea-step_wrap.is-simple .ea-step_head-wrap .ea-step_bar {
|
|
71
|
+
position: relative;
|
|
72
|
+
width: auto;
|
|
73
|
+
height: auto;
|
|
74
|
+
transform: translateY(0%);
|
|
75
|
+
margin-left: 2px;
|
|
76
|
+
flex: 1;
|
|
77
|
+
}
|
|
78
|
+
.ea-step_wrap.is-simple .ea-step_main-wrap {
|
|
79
|
+
margin-left: 16px;
|
|
80
|
+
line-height: 24px;
|
|
81
|
+
height: 24px;
|
|
82
|
+
}
|
|
83
|
+
.ea-step_wrap.is-simple .ea-step_main-wrap .ea-step_title-wrap {
|
|
84
|
+
line-height: 24px;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.ea-steps_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
}
|
|
6
|
+
.ea-steps_wrap ::slotted(ea-step) {
|
|
7
|
+
flex-basis: 50%;
|
|
8
|
+
}
|
|
9
|
+
.ea-steps_wrap.is-simple {
|
|
10
|
+
justify-content: unset;
|
|
11
|
+
}
|
|
12
|
+
.ea-steps_wrap ::slotted(ea-step:last-child) {
|
|
13
|
+
flex-basis: auto;
|
|
14
|
+
flex-grow: 0;
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
}
|
|
17
|
+
.ea-steps_wrap ::slotted(ea-step[simple]) {
|
|
18
|
+
flex: 1;
|
|
19
|
+
}
|
|
@@ -1 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import Base from '../Base.js';
|
|
3
|
+
import '../ea-icon/index.js'
|
|
4
|
+
|
|
5
|
+
import "../ea-step/index.js"
|
|
6
|
+
|
|
7
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
8
|
+
|
|
9
|
+
export class EaSteps extends Base {
|
|
10
|
+
#wrap;
|
|
11
|
+
#stepChildren;
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
|
|
16
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
17
|
+
shadowRoot.innerHTML = `
|
|
18
|
+
<div class="ea-steps_wrap" part="container">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
this.#wrap = shadowRoot.querySelector('.ea-steps_wrap');
|
|
24
|
+
|
|
25
|
+
this.build(shadowRoot, stylesheet);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// ------- active 当前的步骤 -------
|
|
30
|
+
// #region
|
|
31
|
+
get active() {
|
|
32
|
+
return this.getAttrNumber('active') || 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
set active(value) {
|
|
36
|
+
this.setAttribute('active', value);
|
|
37
|
+
|
|
38
|
+
this.#stepChildren.forEach((item, index) => {
|
|
39
|
+
if (index < value) {
|
|
40
|
+
item.status = 'finish';
|
|
41
|
+
} else if (index > value) {
|
|
42
|
+
item.status = 'wait';
|
|
43
|
+
} else {
|
|
44
|
+
item.status = 'process';
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// #endregion
|
|
49
|
+
// ------- end -------
|
|
50
|
+
|
|
51
|
+
// ------- space 步骤之间的间距 -------
|
|
52
|
+
// #region
|
|
53
|
+
get space() {
|
|
54
|
+
return this.getAttribute('space') || '50%';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set space(value) {
|
|
58
|
+
this.setAttribute('space', value);
|
|
59
|
+
|
|
60
|
+
this.#stepChildren.forEach((item, index) => {
|
|
61
|
+
if (index < this.#stepChildren.length - 1) item.space = value;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// #endregion
|
|
65
|
+
// ------- end -------
|
|
66
|
+
|
|
67
|
+
// ------- simple 简洁模式 -------
|
|
68
|
+
// #region
|
|
69
|
+
get simple() {
|
|
70
|
+
return this.getAttrBoolean('simple') || false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set simple(value) {
|
|
74
|
+
this.toggleAttr('simple', value);
|
|
75
|
+
|
|
76
|
+
this.#stepChildren.forEach((item, index) => {
|
|
77
|
+
item.simple = value;
|
|
78
|
+
this.#wrap.classList.toggle('is-simple', value);
|
|
79
|
+
|
|
80
|
+
if (index < this.#stepChildren.length - 1) item.space = value ? 'auto' : this.space;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// #endregion
|
|
84
|
+
// ------- end -------
|
|
85
|
+
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
const stepChildrens = this.querySelectorAll('ea-step');
|
|
88
|
+
this.#stepChildren = stepChildrens;
|
|
89
|
+
|
|
90
|
+
this.#stepChildren.forEach((item, index) => {
|
|
91
|
+
item.setAttribute('index', index);
|
|
92
|
+
item.index = index;
|
|
93
|
+
});
|
|
94
|
+
this.#stepChildren[this.#stepChildren.length - 1].isLast = true;
|
|
95
|
+
|
|
96
|
+
this.simple = this.simple;
|
|
97
|
+
|
|
98
|
+
this.active = this.active;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!customElements.get('ea-steps')) {
|
|
103
|
+
customElements.define('ea-steps', EaSteps);
|
|
104
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.ea-steps_wrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
|
|
6
|
+
::slotted(ea-step) {
|
|
7
|
+
flex-basis: 50%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&.is-simple {
|
|
11
|
+
justify-content: unset;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::slotted(ea-step:last-child) {
|
|
15
|
+
flex-basis: auto;
|
|
16
|
+
flex-grow: 0;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
::slotted(ea-step[simple]) {
|
|
21
|
+
flex: 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
export const stylesheet=
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
.ea-steps_wrap {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
.ea-steps_wrap ::slotted(ea-step) {
|
|
8
|
+
flex-basis: 50%;
|
|
9
|
+
}
|
|
10
|
+
.ea-steps_wrap.is-simple {
|
|
11
|
+
justify-content: unset;
|
|
12
|
+
}
|
|
13
|
+
.ea-steps_wrap ::slotted(ea-step:last-child) {
|
|
14
|
+
flex-basis: auto;
|
|
15
|
+
flex-grow: 0;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
}
|
|
18
|
+
.ea-steps_wrap ::slotted(ea-step[simple]) {
|
|
19
|
+
flex: 1;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.ea-submenu_wrap {
|
|
2
|
+
--normal-bgc: #fff;
|
|
3
|
+
--normal-text-color: #303133;
|
|
4
|
+
--actived-text-color: #409eff;
|
|
5
|
+
--actived-bgc: #fff;
|
|
6
|
+
position: relative;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
padding: 0 20px;
|
|
9
|
+
border-bottom: 2px solid;
|
|
10
|
+
border-color: transparent;
|
|
11
|
+
height: 60px;
|
|
12
|
+
line-height: 60px;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: var(--normal-text-color);
|
|
15
|
+
background-color: var(--normal-bgc);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: border-color 0.3s, background-color 0.3s, color 0.3s;
|
|
19
|
+
}
|
|
20
|
+
.ea-submenu_wrap .ea-submenu_title_wrap {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
}
|
|
24
|
+
.ea-submenu_wrap .ea-submenu_title_wrap .ea-submenu_dropdown_icon {
|
|
25
|
+
rotate: -90deg;
|
|
26
|
+
transition: rotate 0.3s;
|
|
27
|
+
}
|
|
28
|
+
.ea-submenu_wrap .ea-submenu_items_wrap {
|
|
29
|
+
display: none;
|
|
30
|
+
position: absolute;
|
|
31
|
+
left: 0;
|
|
32
|
+
margin-top: 3px;
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
min-width: 200px;
|
|
36
|
+
z-index: 100;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transform-origin: left top;
|
|
39
|
+
transform: scale(0);
|
|
40
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
41
|
+
}
|
|
42
|
+
.ea-submenu_wrap:hover .ea-submenu_items_wrap {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
transform: scale(1);
|
|
45
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
|
46
|
+
}
|
|
47
|
+
.ea-submenu_wrap:hover .ea-submenu_title_wrap .ea-submenu_dropdown_icon {
|
|
48
|
+
rotate: 0deg;
|
|
49
|
+
}
|
|
50
|
+
.ea-submenu_wrap.is-actived {
|
|
51
|
+
color: var(--actived-text-color);
|
|
52
|
+
border-color: var(--actived-text-color);
|
|
53
|
+
}
|
|
54
|
+
.ea-submenu_wrap.is-sub-actived {
|
|
55
|
+
color: var(--actived-text-color);
|
|
56
|
+
}
|
|
57
|
+
.ea-submenu_wrap.is-disabled {
|
|
58
|
+
color: #c0c4cc;
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
}
|
|
62
|
+
.ea-submenu_wrap ::slotted(a) {
|
|
63
|
+
color: var(--normal-text-color);
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
}
|
|
@@ -1 +1,141 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { timeout } from '../../utils/timeout.js';
|
|
3
|
+
import Base from '../Base.js';
|
|
4
|
+
import '../ea-icon/index.js'
|
|
5
|
+
|
|
6
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
7
|
+
|
|
8
|
+
export class EaSubmenu extends Base {
|
|
9
|
+
#wrap;
|
|
10
|
+
#titleWrap;
|
|
11
|
+
#subItemsWrap;
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
|
|
15
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
16
|
+
shadowRoot.innerHTML = `
|
|
17
|
+
<div class="ea-submenu_wrap" part="container">
|
|
18
|
+
<div class="ea-submenu_title_wrap" part="title-wrap">
|
|
19
|
+
<slot name="title"></slot>
|
|
20
|
+
<ea-icon class="ea-submenu_dropdown_icon" icon="icon-angle-down" part="dropdown-icon"></ea-icon>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="ea-submenu_items_wrap" part="dropdown-wrap">
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
this.#wrap = shadowRoot.querySelector('.ea-submenu_wrap');
|
|
29
|
+
this.#titleWrap = shadowRoot.querySelector('.ea-submenu_title_wrap');
|
|
30
|
+
this.#subItemsWrap = shadowRoot.querySelector('.ea-submenu_items_wrap');
|
|
31
|
+
|
|
32
|
+
this.build(shadowRoot, stylesheet);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ------- actived 菜单激活状态 -------
|
|
36
|
+
// #region
|
|
37
|
+
get actived() {
|
|
38
|
+
return this.getAttrBoolean('actived');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
set actived(value) {
|
|
42
|
+
this.setAttribute('actived', value);
|
|
43
|
+
|
|
44
|
+
this.#wrap.classList.toggle('is-actived', value);
|
|
45
|
+
}
|
|
46
|
+
// #endregion
|
|
47
|
+
// ------- end -------
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// ------- background-color 背景颜色 -------
|
|
51
|
+
// #region
|
|
52
|
+
get backgroundColor() {
|
|
53
|
+
return this.getAttribute('background-color') || '#fff';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
set backgroundColor(value) {
|
|
57
|
+
this.setAttribute('background-color', value);
|
|
58
|
+
|
|
59
|
+
this.#wrap.style.setProperty('--normal-bgc', value);
|
|
60
|
+
}
|
|
61
|
+
// #endregion
|
|
62
|
+
// ------- end -------
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// ------- text-color 文字颜色 -------
|
|
66
|
+
// #region
|
|
67
|
+
get textColor() {
|
|
68
|
+
return this.getAttribute('text-color') || '#303133';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set textColor(value) {
|
|
72
|
+
this.setAttribute('text-color', value);
|
|
73
|
+
|
|
74
|
+
this.#wrap.style.setProperty('--normal-text-color', value);
|
|
75
|
+
}
|
|
76
|
+
// #endregion
|
|
77
|
+
// ------- end -------
|
|
78
|
+
|
|
79
|
+
// ------- active-text-color 激活文字颜色 -------
|
|
80
|
+
// #region
|
|
81
|
+
get activeTextColor() {
|
|
82
|
+
return this.getAttribute('active-text-color') || '#409eff';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
set activeTextColor(value) {
|
|
86
|
+
this.setAttribute('active-text-color', value);
|
|
87
|
+
|
|
88
|
+
this.#wrap.style.setProperty('--actived-text-color', value);
|
|
89
|
+
}
|
|
90
|
+
// #endregion
|
|
91
|
+
// ------- end -------
|
|
92
|
+
|
|
93
|
+
// ------- disabled 禁用 -------
|
|
94
|
+
// #region
|
|
95
|
+
get disabled() {
|
|
96
|
+
return this.getAttrBoolean('disabled');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
set disabled(value) {
|
|
100
|
+
this.setAttribute('disabled', value);
|
|
101
|
+
|
|
102
|
+
this.#wrap.classList.toggle('is-disabled', value);
|
|
103
|
+
}
|
|
104
|
+
// #endregion
|
|
105
|
+
// ------- end -------
|
|
106
|
+
|
|
107
|
+
// ------- mode 菜单模式 -------
|
|
108
|
+
// #region
|
|
109
|
+
get mode() {
|
|
110
|
+
return this.getAttribute('mode') || 'horizontal';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
set mode(value) {
|
|
114
|
+
this.setAttribute('mode', value);
|
|
115
|
+
|
|
116
|
+
this.#wrap.classList.toggle('is-vertical', value === 'vertical');
|
|
117
|
+
}
|
|
118
|
+
// #endregion
|
|
119
|
+
// ------- end -------
|
|
120
|
+
|
|
121
|
+
connectedCallback() {
|
|
122
|
+
this.disabled = this.disabled;
|
|
123
|
+
|
|
124
|
+
const items = this.querySelectorAll('ea-menu-item');
|
|
125
|
+
items.forEach((item, index) => {
|
|
126
|
+
item.isSubItem = true;
|
|
127
|
+
|
|
128
|
+
item.addEventListener('item-selected', (e) => {
|
|
129
|
+
this.actived = true;
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
timeout(() => {
|
|
134
|
+
this.#subItemsWrap.style.display = "block";
|
|
135
|
+
}, 20);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!customElements.get('ea-submenu')) {
|
|
140
|
+
customElements.define('ea-submenu', EaSubmenu);
|
|
141
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.ea-submenu_wrap {
|
|
2
|
+
--normal-bgc: #fff;
|
|
3
|
+
--normal-text-color: #303133;
|
|
4
|
+
|
|
5
|
+
--actived-text-color: #409eff;
|
|
6
|
+
--actived-bgc: #fff;
|
|
7
|
+
|
|
8
|
+
position: relative;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
padding: 0 20px;
|
|
11
|
+
border-bottom: 2px solid;
|
|
12
|
+
border-color: transparent;
|
|
13
|
+
|
|
14
|
+
height: 60px;
|
|
15
|
+
line-height: 60px;
|
|
16
|
+
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
color: var(--normal-text-color);
|
|
19
|
+
background-color: var(--normal-bgc);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
|
|
24
|
+
transition: border-color 0.3s, background-color 0.3s, color 0.3s;
|
|
25
|
+
|
|
26
|
+
.ea-submenu_title_wrap {
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
|
|
30
|
+
.ea-submenu_dropdown_icon {
|
|
31
|
+
rotate: -90deg;
|
|
32
|
+
transition: rotate 0.3s;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ea-submenu_items_wrap {
|
|
37
|
+
display: none;
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: 0;
|
|
40
|
+
|
|
41
|
+
margin-top: 3px;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
|
|
45
|
+
min-width: 200px;
|
|
46
|
+
z-index: 100;
|
|
47
|
+
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transform-origin: left top;
|
|
50
|
+
transform: scale(0);
|
|
51
|
+
|
|
52
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
.ea-submenu_items_wrap {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
transform: scale(1);
|
|
59
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ea-submenu_title_wrap {
|
|
63
|
+
.ea-submenu_dropdown_icon {
|
|
64
|
+
rotate: 0deg;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.is-actived {
|
|
70
|
+
color: var(--actived-text-color);
|
|
71
|
+
border-color: var(--actived-text-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.is-sub-actived {
|
|
75
|
+
color: var(--actived-text-color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.is-disabled {
|
|
79
|
+
color: #c0c4cc;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
cursor: not-allowed;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
::slotted(a) {
|
|
85
|
+
color: var(--normal-text-color);
|
|
86
|
+
text-decoration: none;
|
|
87
|
+
}
|
|
88
|
+
}
|