easy-component-ui 2.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/build/components/Base.js +1 -0
- package/build/components/ea-alert/index.js +1 -0
- package/build/components/ea-alert/src/style/stylesheet.js +1 -0
- package/build/components/ea-aside/index.js +1 -0
- package/build/components/ea-avatar/index.js +1 -0
- package/build/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/errorAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
- package/build/components/ea-avatar/src/style/stylesheet.js +1 -0
- package/build/components/ea-backtop/index.js +1 -0
- package/build/components/ea-backtop/src/style/stylesheet.js +1 -0
- package/build/components/ea-badge/index.js +1 -0
- package/build/components/ea-badge/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb/index.js +1 -0
- package/build/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb-item/index.js +1 -0
- package/build/components/ea-breadcrumb-item/src/style/style.js +1 -0
- package/build/components/ea-button/index.js +1 -0
- package/build/components/ea-button/src/components/ButtonComm.js +1 -0
- package/build/components/ea-button/src/components/HrefComm.js +1 -0
- package/build/components/ea-button/src/style/stylesheet.js +1 -0
- package/build/components/ea-button-group/index.js +1 -0
- package/build/components/ea-button-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/index.js +1 -0
- package/build/components/ea-calendar/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/src/utils/createChangerElement.js +1 -0
- package/build/components/ea-calendar/src/utils/createThead.js +1 -0
- package/build/components/ea-calendar/src/utils/getDate.js +1 -0
- package/build/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
- package/build/components/ea-card/index.js +1 -0
- package/build/components/ea-card/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/index.js +1 -0
- package/build/components/ea-carousel/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
- package/build/components/ea-carousel-item/index.js +1 -0
- package/build/components/ea-carousel-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox/index.js +1 -0
- package/build/components/ea-checkbox/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox-group/index.js +1 -0
- package/build/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-collapse/index.js +1 -0
- package/build/components/ea-collapse-item/index.js +1 -0
- package/build/components/ea-collapse-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-container/index.js +1 -0
- package/build/components/ea-date-picker/index.js +1 -0
- package/build/components/ea-date-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions/index.js +1 -0
- package/build/components/ea-descriptions/src/components/contentTemplate.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
- package/build/components/ea-descriptions/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions-item/index.js +1 -0
- package/build/components/ea-descriptions-item/src/stylesheet.js +1 -0
- package/build/components/ea-drawer/index.js +1 -0
- package/build/components/ea-drawer/src/style/stylesheet.js +1 -0
- package/build/components/ea-empty/index.js +1 -0
- package/build/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
- package/build/components/ea-empty/src/style/stylesheet.js +1 -0
- package/build/components/ea-footer/index.js +1 -0
- package/build/components/ea-form/index.js +1 -0
- package/build/components/ea-form-item/index.js +1 -0
- package/build/components/ea-form-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-header/index.js +1 -0
- package/build/components/ea-icon/config.json +1030 -0
- package/{components/ea-icon/css/fontello-codes.css → build/components/ea-icon/css/fontello.css} +312 -123
- package/build/components/ea-icon/font/fontello.eot +0 -0
- package/build/components/ea-icon/font/fontello.svg +350 -0
- package/build/components/ea-icon/font/fontello.ttf +0 -0
- package/build/components/ea-icon/font/fontello.woff +0 -0
- package/build/components/ea-icon/font/fontello.woff2 +0 -0
- package/build/components/ea-icon/index.css +1 -0
- package/build/components/ea-icon/index.js +1 -0
- package/build/components/ea-image/index.js +1 -0
- package/build/components/ea-image/src/assets/errorImage.js +1 -0
- package/build/components/ea-image/src/style/stylesheet.js +1 -0
- package/build/components/ea-image/src/utils/createPreviewTools.js +1 -0
- package/build/components/ea-infinite-scroll/index.js +1 -0
- package/build/components/ea-infinite-scroll-item/index.js +1 -0
- package/build/components/ea-input/index.js +1 -0
- package/build/components/ea-input/src/components/createFixIcon.js +1 -0
- package/build/components/ea-input/src/components/createSuggestionBoard.js +1 -0
- package/build/components/ea-input/src/components/createWordLimitElement.js +1 -0
- package/build/components/ea-input/src/style/stylesheet.js +1 -0
- package/build/components/ea-input/src/utils/dispatchEvent.js +1 -0
- package/build/components/ea-input/src/utils/handleSearchResult.js +1 -0
- package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
- package/build/components/ea-input-number/index.js +1 -0
- package/build/components/ea-input-number/src/style/stylesheet.js +1 -0
- package/build/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
- package/build/components/ea-link/index.js +1 -0
- package/build/components/ea-link/src/style/stylesheet.js +1 -0
- package/build/components/ea-loading/index.js +1 -0
- package/build/components/ea-loading/src/style/stylesheet.js +1 -0
- package/build/components/ea-main/index.js +1 -0
- package/build/components/ea-menu/index.js +1 -0
- package/build/components/ea-menu/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
- package/build/components/ea-menu-item/index.js +1 -0
- package/build/components/ea-menu-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu-item-group/index.js +1 -0
- package/build/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/index.js +1 -0
- package/build/components/ea-message/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/src/utils/MessageClass.js +1 -0
- package/build/components/ea-message-box/index.js +1 -0
- package/build/components/ea-message-box/src/style/stylesheet.js +1 -0
- package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
- package/build/components/ea-option/index.js +1 -0
- package/build/components/ea-option/src/style/stylesheet.js +1 -0
- package/build/components/ea-option-gropu/index.js +1 -0
- package/build/components/ea-page-header/index.js +1 -0
- package/build/components/ea-page-header/src/style/stylesheet.js +1 -0
- package/build/components/ea-pagination/index.js +1 -0
- package/build/components/ea-pagination/src/components/getMoreItem.js +1 -0
- package/build/components/ea-pagination/src/components/getPageItem.js +1 -0
- package/build/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
- package/build/components/ea-pagination/src/style/stylesheet.js +1 -0
- package/build/components/ea-pane/index.js +1 -0
- package/build/components/ea-pane/src/stylesheet.js +1 -0
- package/build/components/ea-progress/index.js +1 -0
- package/build/components/ea-progress/src/components/SVGComm.js +1 -0
- package/build/components/ea-progress/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio/index.js +1 -0
- package/build/components/ea-radio/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio-group/index.js +1 -0
- package/build/components/ea-rate/index.js +1 -0
- package/build/components/ea-rate/src/components/rateComm.js +1 -0
- package/build/components/ea-rate/src/style/stylesheet.js +1 -0
- package/build/components/ea-result/index.js +1 -0
- package/build/components/ea-result/src/style/stylesheet.js +1 -0
- package/build/components/ea-select/index.js +1 -0
- package/build/components/ea-select/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/index.js +1 -0
- package/build/components/ea-skeleton/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
- package/build/components/ea-skeleton-item/index.js +1 -0
- package/build/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
- package/build/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-step/index.js +1 -0
- package/build/components/ea-step/src/style/stylesheet.js +1 -0
- package/build/components/ea-steps/index.js +1 -0
- package/build/components/ea-steps/src/style/stylesheet.js +1 -0
- package/build/components/ea-submenu/index.js +1 -0
- package/build/components/ea-submenu/src/style/stylesheet.js +1 -0
- package/build/components/ea-switch/index.js +1 -0
- package/build/components/ea-switch/src/style/stylesheet.js +1 -0
- package/build/components/ea-tab/index.js +1 -0
- package/build/components/ea-tab/src/style/stylesheet.js +1 -0
- package/build/components/ea-table/index.js +1 -0
- package/build/components/ea-table/src/style/stylesheet.js +1 -0
- package/build/components/ea-table-column/index.js +1 -0
- package/build/components/ea-tabs/index.js +1 -0
- package/build/components/ea-tabs/src/style/stylesheet.js +1 -0
- package/build/components/ea-tag/index.js +1 -0
- package/build/components/ea-tag/src/style/stylesheet.js +1 -0
- package/build/components/ea-textarea/index.js +1 -0
- package/build/components/ea-textarea/src/style/stylesheet.js +1 -0
- package/build/components/ea-time-picker/index.js +1 -0
- package/build/components/ea-time-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-timeline/index.js +1 -0
- package/build/components/ea-timeline/style/stylesheet.js +1 -0
- package/build/components/ea-timeline-item/index.js +1 -0
- package/build/components/ea-timeline-item/src/style/stylesheet.js +1 -0
- package/build/components/globalConfig.js +1 -0
- package/build/components/index.js +1 -0
- package/build/utils/Validator.js +1 -0
- package/build/utils/createElement.js +1 -0
- package/build/utils/handleDefaultAttrIsTrue.js +1 -0
- package/build/utils/handleTemplate.js +1 -0
- package/build/utils/setStyle.js +1 -0
- package/build/utils/timeout.js +1 -0
- package/components/Base.js +75 -1
- package/components/ea-alert/index.css +91 -0
- package/components/ea-alert/index.js +210 -1
- package/components/ea-alert/index.scss +108 -0
- package/components/ea-alert/src/style/stylesheet.js +85 -1
- package/components/ea-aside/index.css +9 -0
- package/components/ea-aside/index.js +54 -1
- package/components/ea-aside/index.scss +12 -0
- package/components/ea-avatar/index.css +66 -0
- package/components/ea-avatar/index.js +156 -1
- package/components/ea-avatar/index.scss +59 -0
- package/components/ea-avatar/src/assets/defaultAvatar.js +12 -1
- package/components/ea-avatar/src/assets/errorAvatar.js +9 -1
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +18 -1
- package/components/ea-avatar/src/style/stylesheet.js +61 -1
- package/components/ea-backtop/index.css +27 -0
- package/components/ea-backtop/index.js +167 -1
- package/components/ea-backtop/index.scss +29 -0
- package/components/ea-backtop/src/style/stylesheet.js +21 -1
- package/components/ea-badge/index.css +49 -0
- package/components/ea-badge/index.js +103 -1
- package/components/ea-badge/index.scss +56 -0
- package/components/ea-badge/src/style/stylesheet.js +43 -1
- package/components/ea-breadcrumb/index.css +6 -0
- package/components/ea-breadcrumb/index.js +90 -1
- package/components/ea-breadcrumb/index.scss +7 -0
- package/components/ea-breadcrumb/src/style/stylesheet.js +8 -1
- package/components/ea-breadcrumb-item/index.css +10 -0
- package/components/ea-breadcrumb-item/index.js +23 -1
- package/components/ea-breadcrumb-item/index.scss +12 -0
- package/components/ea-breadcrumb-item/src/style/style.js +12 -1
- package/components/ea-button/index.css +206 -0
- package/components/ea-button/index.js +198 -1
- package/components/ea-button/index.scss +143 -0
- package/components/ea-button/src/components/ButtonComm.js +5 -1
- package/components/ea-button/src/components/HrefComm.js +5 -1
- package/components/ea-button/src/style/stylesheet.js +208 -1
- package/components/ea-button-group/index.css +16 -0
- package/components/ea-button-group/index.js +44 -1
- package/components/ea-button-group/index.scss +20 -0
- package/components/ea-button-group/src/style/stylesheet.js +18 -1
- package/components/ea-calendar/index.css +72 -0
- package/components/ea-calendar/index.js +298 -1
- package/components/ea-calendar/index.scss +106 -0
- package/components/ea-calendar/src/style/stylesheet.js +74 -1
- package/components/ea-calendar/src/utils/createChangerElement.js +10 -1
- package/components/ea-calendar/src/utils/createThead.js +18 -1
- package/components/ea-calendar/src/utils/getDate.js +11 -1
- package/components/ea-calendar/src/utils/getUserWeekStart.js +11 -1
- package/components/ea-card/index.css +25 -0
- package/components/ea-card/index.js +51 -1
- package/components/ea-card/index.scss +24 -0
- package/components/ea-card/src/style/stylesheet.js +19 -1
- package/components/ea-carousel/index.css +103 -0
- package/components/ea-carousel/index.js +222 -1
- package/components/ea-carousel/index.scss +140 -0
- package/components/ea-carousel/src/style/stylesheet.js +105 -1
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +9 -1
- package/components/ea-carousel-item/index.css +20 -0
- package/components/ea-carousel-item/index.js +23 -1
- package/components/ea-carousel-item/index.scss +26 -0
- package/components/ea-carousel-item/src/style/stylesheet.js +22 -1
- package/components/ea-checkbox/index.css +108 -0
- package/components/ea-checkbox/index.js +160 -1
- package/components/ea-checkbox/index.scss +141 -0
- package/components/ea-checkbox/src/style/stylesheet.js +110 -1
- package/components/ea-checkbox-group/index.css +6 -0
- package/components/ea-checkbox-group/index.js +120 -1
- package/components/ea-checkbox-group/index.scss +7 -0
- package/components/ea-checkbox-group/src/style/stylesheet.js +8 -1
- package/components/ea-collapse/index.css +0 -0
- package/components/ea-collapse/index.js +109 -1
- package/components/ea-collapse/index.scss +4 -0
- package/components/ea-collapse-item/index.css +31 -0
- package/components/ea-collapse-item/index.js +111 -1
- package/components/ea-collapse-item/index.scss +46 -0
- package/components/ea-collapse-item/src/style/stylesheet.js +33 -1
- package/components/ea-container/index.css +14 -0
- package/components/ea-container/index.js +85 -1
- package/components/ea-container/index.scss +18 -0
- package/components/ea-date-picker/index.css +17 -0
- package/components/ea-date-picker/index.js +191 -1
- package/components/ea-date-picker/index.scss +29 -0
- package/components/ea-date-picker/src/style/stylesheet.js +19 -1
- package/components/ea-descriptions/index.css +33 -0
- package/components/ea-descriptions/index.js +171 -1
- package/components/ea-descriptions/index.scss +45 -0
- package/components/ea-descriptions/src/components/contentTemplate.js +11 -1
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +6 -1
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +8 -1
- package/components/ea-descriptions/src/style/stylesheet.js +35 -1
- package/components/ea-descriptions-item/index.css +21 -0
- package/components/ea-descriptions-item/index.js +71 -1
- package/components/ea-descriptions-item/index.scss +29 -0
- package/components/ea-descriptions-item/src/stylesheet.js +23 -1
- package/components/ea-drawer/index.css +138 -0
- package/components/ea-drawer/index.js +251 -1
- package/components/ea-drawer/index.scss +208 -0
- package/components/ea-drawer/src/style/stylesheet.js +141 -1
- package/components/ea-empty/index.css +30 -0
- package/components/ea-empty/index.js +93 -1
- package/components/ea-empty/index.scss +30 -0
- package/components/ea-empty/src/assets/emptyStatusSVG.js +6 -1
- package/components/ea-empty/src/style/stylesheet.js +24 -1
- package/components/ea-footer/index.css +7 -0
- package/components/ea-footer/index.js +57 -1
- package/components/ea-footer/index.scss +10 -0
- package/components/ea-form/index.css +0 -0
- package/components/ea-form/index.js +121 -1
- package/components/ea-form/index.scss +0 -0
- package/components/ea-form-item/index.css +62 -0
- package/components/ea-form-item/index.js +152 -1
- package/components/ea-form-item/index.scss +83 -0
- package/components/ea-form-item/src/style/stylesheet.js +64 -1
- package/components/ea-header/index.css +7 -0
- package/components/ea-header/index.js +55 -1
- package/components/ea-header/index.scss +10 -0
- package/components/ea-icon/css/fontello.css +312 -226
- package/components/ea-icon/index.css +1 -2
- package/components/ea-icon/index.js +84 -1
- package/components/ea-image/index.css +84 -0
- package/components/ea-image/index.js +182 -1
- package/components/ea-image/index.scss +111 -0
- package/components/ea-image/src/assets/errorImage.js +9 -1
- package/components/ea-image/src/assets/errorImage.svg +7 -0
- package/components/ea-image/src/style/stylesheet.js +86 -1
- package/components/ea-image/src/utils/createPreviewTools.js +140 -1
- package/components/ea-infinite-scroll/index.css +0 -0
- package/components/ea-infinite-scroll/index.js +119 -1
- package/components/ea-infinite-scroll/index.scss +0 -0
- package/components/ea-infinite-scroll-item/index.css +0 -0
- package/components/ea-infinite-scroll-item/index.js +18 -1
- package/components/ea-infinite-scroll-item/index.scss +0 -0
- package/components/ea-input/index.css +139 -0
- package/components/ea-input/index.js +398 -1
- package/components/ea-input/index.scss +178 -0
- package/components/ea-input/src/components/createFixIcon.js +108 -1
- package/components/ea-input/src/components/createSuggestionBoard.js +43 -1
- package/components/ea-input/src/components/createWordLimitElement.js +18 -1
- package/components/ea-input/src/style/stylesheet.js +141 -1
- package/components/ea-input/src/utils/dispatchEvent.js +9 -1
- package/components/ea-input/src/utils/handleSearchResult.js +9 -1
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +31 -1
- package/components/ea-input-number/index.css +120 -0
- package/components/ea-input-number/index.js +308 -1
- package/components/ea-input-number/index.scss +132 -0
- package/components/ea-input-number/src/style/stylesheet.js +122 -1
- package/components/ea-input-number/src/utils/handleCustomEvent.js +5 -1
- package/components/ea-link/index.css +48 -0
- package/components/ea-link/index.js +122 -1
- package/components/ea-link/index.scss +36 -0
- package/components/ea-link/src/style/stylesheet.js +50 -1
- package/components/ea-loading/index.css +38 -0
- package/components/ea-loading/index.js +166 -1
- package/components/ea-loading/index.scss +55 -0
- package/components/ea-loading/src/style/stylesheet.js +40 -1
- package/components/ea-main/index.css +8 -0
- package/components/ea-main/index.js +32 -1
- package/components/ea-main/index.scss +11 -0
- package/components/ea-menu/index.css +19 -0
- package/components/ea-menu/index.js +131 -1
- package/components/ea-menu/index.scss +22 -0
- package/components/ea-menu/src/style/stylesheet.js +21 -1
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +32 -1
- package/components/ea-menu-item/index.css +48 -0
- package/components/ea-menu-item/index.js +130 -1
- package/components/ea-menu-item/index.scss +62 -0
- package/components/ea-menu-item/src/style/stylesheet.js +50 -1
- package/components/ea-menu-item-group/index.css +42 -0
- package/components/ea-menu-item-group/index.js +130 -1
- package/components/ea-menu-item-group/index.scss +60 -0
- package/components/ea-menu-item-group/src/style/stylesheet.js +44 -1
- package/components/ea-message/index.css +47 -0
- package/components/ea-message/index.js +171 -1
- package/components/ea-message/index.scss +70 -0
- package/components/ea-message/src/style/stylesheet.js +48 -1
- package/components/ea-message/src/utils/MessageClass.js +67 -1
- package/components/ea-message-box/index.css +85 -0
- package/components/ea-message-box/index.js +211 -1
- package/components/ea-message-box/index.scss +113 -0
- package/components/ea-message-box/src/style/stylesheet.js +87 -1
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +60 -1
- package/components/ea-option/index.css +24 -0
- package/components/ea-option/index.js +74 -1
- package/components/ea-option/index.scss +31 -0
- package/components/ea-option/src/style/stylesheet.js +26 -1
- package/components/ea-option-gropu/index.css +6 -0
- package/components/ea-option-gropu/index.js +57 -1
- package/components/ea-option-gropu/index.scss +8 -0
- package/components/ea-page-header/index.css +33 -0
- package/components/ea-page-header/index.js +91 -1
- package/components/ea-page-header/index.scss +44 -0
- package/components/ea-page-header/src/style/stylesheet.js +35 -1
- package/components/ea-pagination/index.css +69 -0
- package/components/ea-pagination/index.js +305 -1
- package/components/ea-pagination/index.scss +89 -0
- package/components/ea-pagination/src/components/getMoreItem.js +20 -1
- package/components/ea-pagination/src/components/getPageItem.js +11 -1
- package/components/ea-pagination/src/components/getShowTotalItem.js +7 -1
- package/components/ea-pagination/src/style/stylesheet.js +71 -1
- package/components/ea-pane/index.css +6 -0
- package/components/ea-pane/index.js +52 -1
- package/components/ea-pane/index.scss +7 -0
- package/components/ea-pane/src/stylesheet.js +8 -1
- package/components/ea-progress/index.css +61 -0
- package/components/ea-progress/index.js +249 -1
- package/components/ea-progress/index.scss +74 -0
- package/components/ea-progress/src/components/SVGComm.js +18 -1
- package/components/ea-progress/src/style/stylesheet.js +55 -1
- package/components/ea-radio/index.css +82 -0
- package/components/ea-radio/index.js +137 -1
- package/components/ea-radio/index.scss +119 -0
- package/components/ea-radio/src/style/stylesheet.js +84 -1
- package/components/ea-radio-group/index.css +3 -0
- package/components/ea-radio-group/index.js +96 -1
- package/components/ea-radio-group/index.scss +3 -0
- package/components/ea-rate/index.css +44 -0
- package/components/ea-rate/index.js +243 -1
- package/components/ea-rate/index.scss +55 -0
- package/components/ea-rate/src/components/rateComm.js +20 -1
- package/components/ea-rate/src/style/stylesheet.js +45 -1
- package/components/ea-result/index.css +37 -0
- package/components/ea-result/index.js +109 -1
- package/components/ea-result/index.scss +46 -0
- package/components/ea-result/src/style/stylesheet.js +39 -1
- package/components/ea-select/index.css +47 -0
- package/components/ea-select/index.js +312 -1
- package/components/ea-select/index.scss +70 -0
- package/components/ea-select/src/style/stylesheet.js +49 -1
- package/components/ea-skeleton/index.css +12 -0
- package/components/ea-skeleton/index.js +148 -1
- package/components/ea-skeleton/index.scss +16 -0
- package/components/ea-skeleton/src/style/stylesheet.js +14 -1
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +7 -1
- package/components/ea-skeleton-item/index.css +69 -0
- package/components/ea-skeleton-item/index.js +82 -1
- package/components/ea-skeleton-item/index.scss +107 -0
- package/components/ea-skeleton-item/src/assets/imageSVG.js +8 -1
- package/components/ea-skeleton-item/src/style/stylesheet.js +71 -1
- package/components/ea-step/index.css +84 -0
- package/components/ea-step/index.js +230 -1
- package/components/ea-step/index.scss +110 -0
- package/components/ea-step/src/style/stylesheet.js +86 -1
- package/components/ea-steps/index.css +19 -0
- package/components/ea-steps/index.js +104 -1
- package/components/ea-steps/index.scss +23 -0
- package/components/ea-steps/src/style/stylesheet.js +21 -1
- package/components/ea-submenu/index.css +65 -0
- package/components/ea-submenu/index.js +141 -1
- package/components/ea-submenu/index.scss +88 -0
- package/components/ea-submenu/src/style/stylesheet.js +67 -1
- package/components/ea-switch/index.css +90 -0
- package/components/ea-switch/index.js +189 -1
- package/components/ea-switch/index.scss +117 -0
- package/components/ea-switch/src/style/stylesheet.js +92 -1
- package/components/ea-tab/index.css +68 -0
- package/components/ea-tab/index.js +138 -1
- package/components/ea-tab/index.scss +96 -0
- package/components/ea-tab/src/style/stylesheet.js +70 -1
- package/components/ea-table/index.css +98 -0
- package/components/ea-table/index.js +555 -1
- package/components/ea-table/index.scss +90 -0
- package/components/ea-table/src/style/stylesheet.js +100 -1
- package/components/ea-table-column/index.css +0 -0
- package/components/ea-table-column/index.js +164 -1
- package/components/ea-table-column/index.scss +0 -0
- package/components/ea-tabs/index.css +45 -0
- package/components/ea-tabs/index.js +245 -1
- package/components/ea-tabs/index.scss +64 -0
- package/components/ea-tabs/src/style/stylesheet.js +47 -1
- package/components/ea-tag/index.css +90 -0
- package/components/ea-tag/index.js +107 -1
- package/components/ea-tag/index.scss +71 -0
- package/components/ea-tag/src/style/stylesheet.js +92 -1
- package/components/ea-textarea/index.css +37 -0
- package/components/ea-textarea/index.js +277 -1
- package/components/ea-textarea/index.scss +48 -0
- package/components/ea-textarea/src/style/stylesheet.js +39 -1
- package/components/ea-time-picker/index.css +82 -0
- package/components/ea-time-picker/index.js +379 -1
- package/components/ea-time-picker/index.scss +110 -0
- package/components/ea-time-picker/src/style/stylesheet.js +84 -1
- package/components/ea-timeline/index.css +0 -0
- package/components/ea-timeline/index.js +74 -1
- package/components/ea-timeline/index.scss +1 -0
- package/components/ea-timeline/style/stylesheet.js +3 -1
- package/components/ea-timeline-item/index.css +79 -0
- package/components/ea-timeline-item/index.js +146 -1
- package/components/ea-timeline-item/index.scss +92 -0
- package/components/ea-timeline-item/src/style/stylesheet.js +81 -1
- package/components/ea-ui-base-style.css +0 -0
- package/components/ea-ui-base-style.scss +153 -0
- package/components/globalConfig.js +10 -0
- package/components/index.js +67 -0
- package/package.json +1 -1
- package/public/logo.png +0 -0
- package/utils/Validator.js +16 -1
- package/utils/createElement.js +30 -1
- package/utils/handleDefaultAttrIsTrue.js +11 -1
- package/utils/handleTemplate.js +19 -1
- package/utils/setStyle.js +8 -1
- package/utils/timeout.js +16 -1
- package/components/ea-icon/css/animation.css +0 -85
- package/components/ea-icon/css/fontello-embedded.css +0 -181
- package/components/ea-icon/css/fontello-ie7-codes.css +0 -123
- package/components/ea-icon/css/fontello-ie7.css +0 -134
|
@@ -1 +1,18 @@
|
|
|
1
|
-
export const SVGComm
|
|
1
|
+
export const SVGComm = {
|
|
2
|
+
dashboard: `
|
|
3
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<circle class="track--dashboard" cx="50" cy="50" r="40" fill="none" stroke-dasharray="252px" stroke="aliceblue"
|
|
5
|
+
stroke-width="4px" stroke-dashoffset="100" stroke-linecap="round" />
|
|
6
|
+
<circle class="path--dashboard" cx="50" cy="50" r="40" fill="none" stroke-dasharray="252px" stroke="rgb(32, 160, 255)" stroke-width="4px"
|
|
7
|
+
stroke-dashoffset="252" stroke-linecap="round" />
|
|
8
|
+
</svg>
|
|
9
|
+
<span class="ea-progress_text--dashboard"></span>
|
|
10
|
+
`,
|
|
11
|
+
circle: `
|
|
12
|
+
<svg viewBox="0 0 100 100">
|
|
13
|
+
<circle class="track--circle" cx="50" cy="50" r="48" fill="none" stroke="aliceblue" stroke-width="4" stroke-dasharray="302px" stroke-dashoffset="0" />
|
|
14
|
+
<circle class="path--circle" cx="50" cy="50" r="48" fill="none" stroke="rgb(32, 160, 255)" stroke-width="4" stroke-dasharray="302px" stroke-dashoffset="0" stroke-linecap="round" />
|
|
15
|
+
</svg>
|
|
16
|
+
<span class="ea-progress_text--circle"></span>
|
|
17
|
+
`,
|
|
18
|
+
}
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
export const stylesheet=
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
.ea-progress_wrap {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
height: 1rem;
|
|
9
|
+
}
|
|
10
|
+
.ea-progress_wrap .ea-progress_track,
|
|
11
|
+
.ea-progress_wrap .ea-progress_path {
|
|
12
|
+
height: 0.5rem;
|
|
13
|
+
line-height: 1;
|
|
14
|
+
background-color: rgb(235, 238, 245);
|
|
15
|
+
border-radius: 999px;
|
|
16
|
+
}
|
|
17
|
+
.ea-progress_wrap .ea-progress_track {
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
.ea-progress_wrap .ea-progress_track .ea-progress_path {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
padding-right: 0.5rem;
|
|
23
|
+
color: aliceblue;
|
|
24
|
+
font-size: 0.8rem;
|
|
25
|
+
text-align: right;
|
|
26
|
+
width: 0%;
|
|
27
|
+
background-color: #409eff;
|
|
28
|
+
transition: width 0.2s;
|
|
29
|
+
}
|
|
30
|
+
.ea-progress_wrap .ea-progress_text {
|
|
31
|
+
margin-left: 0.5rem;
|
|
32
|
+
font-size: 0.8rem;
|
|
33
|
+
width: 3rem;
|
|
34
|
+
}
|
|
35
|
+
.ea-progress_wrap .ea-progress_text--circle,
|
|
36
|
+
.ea-progress_wrap .ea-progress_text--dashboard {
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 50%;
|
|
39
|
+
top: 50%;
|
|
40
|
+
transform: translate(-50%, -50%);
|
|
41
|
+
}
|
|
42
|
+
.ea-progress_wrap svg circle {
|
|
43
|
+
stroke-width: 4px;
|
|
44
|
+
transform-origin: center center;
|
|
45
|
+
transition: stroke-dashoffset 0.2s;
|
|
46
|
+
}
|
|
47
|
+
.ea-progress_wrap svg .track--circle,
|
|
48
|
+
.ea-progress_wrap svg .path--circle {
|
|
49
|
+
transform: rotate(-90deg);
|
|
50
|
+
}
|
|
51
|
+
.ea-progress_wrap svg .track--dashboard,
|
|
52
|
+
.ea-progress_wrap svg .path--dashboard {
|
|
53
|
+
transform: rotate(161deg);
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--margin-right: 0.75rem;
|
|
3
|
+
--text-color: #606266;
|
|
4
|
+
--radio-show-type: inline-block;
|
|
5
|
+
--button-size: 1rem;
|
|
6
|
+
--button-margin: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ea-radio_wrap {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
margin-right: 1rem;
|
|
13
|
+
}
|
|
14
|
+
.ea-radio_wrap .ea-radio-input_wrap {
|
|
15
|
+
width: var(--button-size);
|
|
16
|
+
height: var(--button-size);
|
|
17
|
+
line-height: 1;
|
|
18
|
+
margin-right: var(--button-margin);
|
|
19
|
+
}
|
|
20
|
+
.ea-radio_wrap .ea-radio-input_wrap input {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: var(--radio-show-type);
|
|
26
|
+
width: 1rem;
|
|
27
|
+
height: 1rem;
|
|
28
|
+
line-height: 1;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
border: 1px solid #606266;
|
|
32
|
+
}
|
|
33
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
34
|
+
position: absolute;
|
|
35
|
+
left: 50%;
|
|
36
|
+
top: 50%;
|
|
37
|
+
transform: translate(-50%, -50%);
|
|
38
|
+
content: "";
|
|
39
|
+
width: 0.35rem;
|
|
40
|
+
height: 0.35rem;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
transition: all 0.3s ease;
|
|
45
|
+
}
|
|
46
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner:hover {
|
|
47
|
+
border-color: #409eff;
|
|
48
|
+
}
|
|
49
|
+
.ea-radio_wrap .ea-radio-label_desc {
|
|
50
|
+
color: var(--text-color);
|
|
51
|
+
}
|
|
52
|
+
.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner {
|
|
53
|
+
border-color: #409eff;
|
|
54
|
+
background-color: #409eff;
|
|
55
|
+
}
|
|
56
|
+
.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
57
|
+
background-color: white;
|
|
58
|
+
}
|
|
59
|
+
.ea-radio_wrap.checked .ea-radio-label_desc {
|
|
60
|
+
color: #409eff;
|
|
61
|
+
}
|
|
62
|
+
.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner {
|
|
63
|
+
border-color: #eeeeee;
|
|
64
|
+
background-color: #eeeeee;
|
|
65
|
+
}
|
|
66
|
+
.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
.ea-radio_wrap.disabled .ea-radio-label_desc {
|
|
70
|
+
color: #c0c4cc;
|
|
71
|
+
}
|
|
72
|
+
.ea-radio_wrap.disabled[checked=true] .ea-radio-input_inner::before {
|
|
73
|
+
background-color: #c0c4cc;
|
|
74
|
+
}
|
|
75
|
+
.ea-radio_wrap.border {
|
|
76
|
+
border: 1px solid #ccc;
|
|
77
|
+
padding: 0.25rem 0.5rem;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
}
|
|
80
|
+
.ea-radio_wrap.border[checked=true] {
|
|
81
|
+
border: 1px solid #409eff;
|
|
82
|
+
}
|
|
@@ -1 +1,137 @@
|
|
|
1
|
-
import Base from
|
|
1
|
+
import Base from '../Base.js'
|
|
2
|
+
|
|
3
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
4
|
+
|
|
5
|
+
export class EaRadio extends Base {
|
|
6
|
+
#radio;
|
|
7
|
+
#label;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
|
|
12
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
13
|
+
|
|
14
|
+
shadowRoot.innerHTML = `
|
|
15
|
+
<label class="ea-radio_wrap" part="container">
|
|
16
|
+
<span class="ea-radio-input_wrap" part="input-wrap">
|
|
17
|
+
<span class="ea-radio-input_inner" part="input"></span>
|
|
18
|
+
<input class="ea-radio-input_input" type="radio" />
|
|
19
|
+
</span>
|
|
20
|
+
<span class="ea-radio-label_desc" part="label-wrap">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</span>
|
|
23
|
+
</label>
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
this.#label = shadowRoot.querySelector('.ea-radio_wrap');
|
|
27
|
+
this.#radio = shadowRoot.querySelector('.ea-radio-input_input');
|
|
28
|
+
|
|
29
|
+
this.build(shadowRoot, stylesheet);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ------- 选中 -------
|
|
33
|
+
// #region
|
|
34
|
+
get checked() {
|
|
35
|
+
return this.getAttrBoolean('checked');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
set checked(val) {
|
|
39
|
+
this.setAttribute('checked', val);
|
|
40
|
+
this.#label.setAttribute('checked', val);
|
|
41
|
+
this.#radio.checked = val;
|
|
42
|
+
|
|
43
|
+
this.#label.classList.toggle('checked', val);
|
|
44
|
+
}
|
|
45
|
+
// #endregion
|
|
46
|
+
// ------- end -------
|
|
47
|
+
|
|
48
|
+
// ------- label_for 单选框的唯一键 -------
|
|
49
|
+
// #region
|
|
50
|
+
get name() {
|
|
51
|
+
return this.getAttribute('name');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set name(val) {
|
|
55
|
+
this.setAttribute("name", val);
|
|
56
|
+
this.#radio.setAttribute('name', val);
|
|
57
|
+
}
|
|
58
|
+
// #endregion
|
|
59
|
+
// ------- end -------
|
|
60
|
+
|
|
61
|
+
// ------- value 单选框的值 -------
|
|
62
|
+
// #region
|
|
63
|
+
get value() {
|
|
64
|
+
return this.getAttribute('value');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set value(val) {
|
|
68
|
+
this.setAttribute('value', val);
|
|
69
|
+
this.#label.setAttribute('for', val);
|
|
70
|
+
this.#radio.setAttribute('id', val);
|
|
71
|
+
this.#radio.setAttribute('value', val);
|
|
72
|
+
}
|
|
73
|
+
// #endregion
|
|
74
|
+
// ------- end -------
|
|
75
|
+
|
|
76
|
+
// ------- disabled 禁用状态 -------
|
|
77
|
+
// #region
|
|
78
|
+
get disabled() {
|
|
79
|
+
return this.getAttrBoolean('disabled');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
set disabled(val) {
|
|
83
|
+
this.#radio.disabled = val;
|
|
84
|
+
this.#label.setAttribute('disabled', val);
|
|
85
|
+
this.#label.classList.toggle('disabled', val);
|
|
86
|
+
}
|
|
87
|
+
// #endregion
|
|
88
|
+
// ------- end -------
|
|
89
|
+
|
|
90
|
+
// ------- border 是否带有边框 -------
|
|
91
|
+
// #region
|
|
92
|
+
get border() {
|
|
93
|
+
return this.getAttrBoolean('border');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
set border(val) {
|
|
97
|
+
this.#label.classList.toggle('border', val);
|
|
98
|
+
}
|
|
99
|
+
// #endregion
|
|
100
|
+
// ------- end -------
|
|
101
|
+
|
|
102
|
+
connectedCallback() {
|
|
103
|
+
// radio 的 checked 属性
|
|
104
|
+
this.checked = this.checked;
|
|
105
|
+
|
|
106
|
+
// label 的 for 属性
|
|
107
|
+
this.name = this.name;
|
|
108
|
+
|
|
109
|
+
// radio 的 value 属性
|
|
110
|
+
this.value = this.value;
|
|
111
|
+
|
|
112
|
+
// radio 的 disabled 属性
|
|
113
|
+
this.disabled = this.disabled;
|
|
114
|
+
|
|
115
|
+
// border 属性
|
|
116
|
+
this.border = this.border;
|
|
117
|
+
|
|
118
|
+
// 监听 change 事件, 修改 checked 属性
|
|
119
|
+
this.#radio.addEventListener('change', (e) => {
|
|
120
|
+
document.querySelectorAll(`ea-radio[name="${this.name}"]`).forEach(btn => {
|
|
121
|
+
const btnInput = btn.shadowRoot.querySelector('input');
|
|
122
|
+
btn.checked = btnInput === this.#radio;
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
126
|
+
detail: {
|
|
127
|
+
value: this.value,
|
|
128
|
+
checked: this.checked
|
|
129
|
+
}
|
|
130
|
+
}))
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (!window.customElements.get("ea-radio")) {
|
|
136
|
+
window.customElements.define("ea-radio", EaRadio);
|
|
137
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@import "../ea-ui-base-style.scss";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
--margin-right: 0.75rem;
|
|
5
|
+
|
|
6
|
+
--text-color: #606266;
|
|
7
|
+
|
|
8
|
+
--radio-show-type: inline-block;
|
|
9
|
+
|
|
10
|
+
--button-size: 1rem;
|
|
11
|
+
|
|
12
|
+
--button-margin: 0.5rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ea-radio_wrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
margin-right: 1rem;
|
|
19
|
+
|
|
20
|
+
.ea-radio-input_wrap {
|
|
21
|
+
width: var(--button-size);
|
|
22
|
+
height: var(--button-size);
|
|
23
|
+
line-height: 1;
|
|
24
|
+
margin-right: var(--button-margin);
|
|
25
|
+
|
|
26
|
+
input {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ea-radio-input_inner {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: var(--radio-show-type);
|
|
33
|
+
|
|
34
|
+
width: 1rem;
|
|
35
|
+
height: 1rem;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
border-radius: 50%;
|
|
40
|
+
border: 1px solid $color-default-text;
|
|
41
|
+
|
|
42
|
+
&::before {
|
|
43
|
+
position: absolute;
|
|
44
|
+
left: 50%;
|
|
45
|
+
top: 50%;
|
|
46
|
+
transform: translate(-50%, -50%);
|
|
47
|
+
|
|
48
|
+
content: "";
|
|
49
|
+
width: 0.35rem;
|
|
50
|
+
height: 0.35rem;
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background-color: transparent;
|
|
53
|
+
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
transition: all 0.3s ease;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
border-color: $color-primary-bgc;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ea-radio-label_desc {
|
|
65
|
+
color: var(--text-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.checked {
|
|
69
|
+
.ea-radio-input_wrap {
|
|
70
|
+
.ea-radio-input_inner {
|
|
71
|
+
border-color: $color-primary-bgc;
|
|
72
|
+
background-color: $color-primary-bgc;
|
|
73
|
+
|
|
74
|
+
&::before {
|
|
75
|
+
background-color: white;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ea-radio-label_desc {
|
|
81
|
+
color: $color-primary-bgc;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.disabled {
|
|
86
|
+
.ea-radio-input_wrap {
|
|
87
|
+
.ea-radio-input_inner {
|
|
88
|
+
border-color: $color-disabled-btn-bgc;
|
|
89
|
+
background-color: $color-disabled-btn-bgc;
|
|
90
|
+
|
|
91
|
+
&::before {
|
|
92
|
+
background-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ea-radio-label_desc {
|
|
98
|
+
color: $color-disabled-text;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.disabled[checked="true"] {
|
|
103
|
+
.ea-radio-input_inner {
|
|
104
|
+
&::before {
|
|
105
|
+
background-color: $color-disabled-text;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.border {
|
|
111
|
+
border: 1px solid #ccc;
|
|
112
|
+
padding: 0.25rem 0.5rem;
|
|
113
|
+
border-radius: 8px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.border[checked="true"] {
|
|
117
|
+
border: 1px solid $color-primary-bgc;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -1 +1,84 @@
|
|
|
1
|
-
export const stylesheet
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
:host {
|
|
3
|
+
--margin-right: 0.75rem;
|
|
4
|
+
--text-color: #606266;
|
|
5
|
+
--radio-show-type: inline-block;
|
|
6
|
+
--button-size: 1rem;
|
|
7
|
+
--button-margin: 0.5rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ea-radio_wrap {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-right: 1rem;
|
|
14
|
+
}
|
|
15
|
+
.ea-radio_wrap .ea-radio-input_wrap {
|
|
16
|
+
width: var(--button-size);
|
|
17
|
+
height: var(--button-size);
|
|
18
|
+
line-height: 1;
|
|
19
|
+
margin-right: var(--button-margin);
|
|
20
|
+
}
|
|
21
|
+
.ea-radio_wrap .ea-radio-input_wrap input {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: var(--radio-show-type);
|
|
27
|
+
width: 1rem;
|
|
28
|
+
height: 1rem;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
border: 1px solid #606266;
|
|
33
|
+
}
|
|
34
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: 50%;
|
|
37
|
+
top: 50%;
|
|
38
|
+
transform: translate(-50%, -50%);
|
|
39
|
+
content: "";
|
|
40
|
+
width: 0.35rem;
|
|
41
|
+
height: 0.35rem;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
background-color: transparent;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
transition: all 0.3s ease;
|
|
46
|
+
}
|
|
47
|
+
.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner:hover {
|
|
48
|
+
border-color: #409eff;
|
|
49
|
+
}
|
|
50
|
+
.ea-radio_wrap .ea-radio-label_desc {
|
|
51
|
+
color: var(--text-color);
|
|
52
|
+
}
|
|
53
|
+
.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner {
|
|
54
|
+
border-color: #409eff;
|
|
55
|
+
background-color: #409eff;
|
|
56
|
+
}
|
|
57
|
+
.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
58
|
+
background-color: white;
|
|
59
|
+
}
|
|
60
|
+
.ea-radio_wrap.checked .ea-radio-label_desc {
|
|
61
|
+
color: #409eff;
|
|
62
|
+
}
|
|
63
|
+
.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner {
|
|
64
|
+
border-color: #eeeeee;
|
|
65
|
+
background-color: #eeeeee;
|
|
66
|
+
}
|
|
67
|
+
.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner::before {
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
}
|
|
70
|
+
.ea-radio_wrap.disabled .ea-radio-label_desc {
|
|
71
|
+
color: #c0c4cc;
|
|
72
|
+
}
|
|
73
|
+
.ea-radio_wrap.disabled[checked=true] .ea-radio-input_inner::before {
|
|
74
|
+
background-color: #c0c4cc;
|
|
75
|
+
}
|
|
76
|
+
.ea-radio_wrap.border {
|
|
77
|
+
border: 1px solid #ccc;
|
|
78
|
+
padding: 0.25rem 0.5rem;
|
|
79
|
+
border-radius: 8px;
|
|
80
|
+
}
|
|
81
|
+
.ea-radio_wrap.border[checked=true] {
|
|
82
|
+
border: 1px solid #409eff;
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
@@ -1 +1,96 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { timeout } from "../../utils/timeout.js";
|
|
3
|
+
import Base from "../Base.js";
|
|
4
|
+
|
|
5
|
+
const stylesheet = `
|
|
6
|
+
.ea-radio-group_wrap {
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export class EaRadioGroup extends Base {
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
|
|
16
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
17
|
+
shadowRoot.innerHTML = `
|
|
18
|
+
<div class="ea-radio-group_wrap" part="container">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
this.build(shadowRoot, stylesheet);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ------- name 唯一键值 -------
|
|
26
|
+
// #region
|
|
27
|
+
get name() {
|
|
28
|
+
return this.getAttribute('name');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set name(val) {
|
|
32
|
+
this.setAttribute("name", val);
|
|
33
|
+
this.querySelectorAll('ea-radio').forEach(radio => {
|
|
34
|
+
radio.setAttribute('name', val);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// #endregion
|
|
38
|
+
// ------- end -------
|
|
39
|
+
|
|
40
|
+
// ------- value 值 -------
|
|
41
|
+
// #region
|
|
42
|
+
get value() {
|
|
43
|
+
return this.getAttribute('value') || '';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
set value(val) {
|
|
47
|
+
if (!val) return;
|
|
48
|
+
|
|
49
|
+
this.setAttribute("value", val);
|
|
50
|
+
}
|
|
51
|
+
// #endregion
|
|
52
|
+
// ------- end -------
|
|
53
|
+
|
|
54
|
+
#initValue(radios) {
|
|
55
|
+
radios.forEach(radio => {
|
|
56
|
+
if (radio.checked) this.value = radio.value;
|
|
57
|
+
|
|
58
|
+
radio.addEventListener('change', e => {
|
|
59
|
+
this.value = radio.value;
|
|
60
|
+
|
|
61
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
62
|
+
bubbles: true,
|
|
63
|
+
composed: true,
|
|
64
|
+
detail: {
|
|
65
|
+
target: radio,
|
|
66
|
+
value: this.value
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#initRadioChecked(radios) {
|
|
74
|
+
const valueRadio = Array.from(radios).find(radio => radio.value === this.value);
|
|
75
|
+
if (valueRadio) valueRadio.checked = true;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
this.setAttribute("data-ea-component", true);
|
|
80
|
+
|
|
81
|
+
// name 唯一键值
|
|
82
|
+
this.name = this.name;
|
|
83
|
+
|
|
84
|
+
this.value = this.value;
|
|
85
|
+
|
|
86
|
+
timeout(() => {
|
|
87
|
+
const radios = this.querySelectorAll('ea-radio');
|
|
88
|
+
this.#initValue(radios);
|
|
89
|
+
this.#initRadioChecked(radios);
|
|
90
|
+
}, 20);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!window.customElements.get("ea-radio-group")) {
|
|
95
|
+
window.customElements.define("ea-radio-group", EaRadioGroup);
|
|
96
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--i-color: rgb(247, 186, 42);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ea-rate_wrap {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.ea-rate_wrap .ea-rate_item {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
.ea-rate_wrap .ea-rate_item ea-icon::part(container) {
|
|
14
|
+
color: var(--i-color);
|
|
15
|
+
transition: color 0.3s, font-size 0.1s;
|
|
16
|
+
}
|
|
17
|
+
.ea-rate_wrap .ea-rate_item.active ea-icon::part(container) {
|
|
18
|
+
font-size: 1.1rem;
|
|
19
|
+
}
|
|
20
|
+
.ea-rate_wrap .ea-rate_item.disabled {
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
}
|
|
24
|
+
.ea-rate_wrap .ea-rate_text {
|
|
25
|
+
margin-left: 0.25rem;
|
|
26
|
+
min-width: 2rem;
|
|
27
|
+
font-size: 0.8rem;
|
|
28
|
+
line-height: 0.8;
|
|
29
|
+
vertical-align: middle;
|
|
30
|
+
}
|
|
31
|
+
.ea-rate_wrap .ea-rate_score {
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: 0;
|
|
34
|
+
top: 0;
|
|
35
|
+
}
|
|
36
|
+
.ea-rate_wrap .ea-rate_score .ea-rate_score_item {
|
|
37
|
+
width: 24px;
|
|
38
|
+
height: 24px;
|
|
39
|
+
}
|
|
40
|
+
.ea-rate_wrap .ea-rate_score .ea-rate_score_item > i {
|
|
41
|
+
color: #c0c4cc;
|
|
42
|
+
font-size: 1rem;
|
|
43
|
+
line-height: 1;
|
|
44
|
+
}
|