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,398 @@
|
|
|
1
|
-
import Base from"../Base.js";
|
|
1
|
+
import Base from "../Base.js";
|
|
2
|
+
import "../ea-icon/index.js"
|
|
3
|
+
|
|
4
|
+
import { stylesheet } from "./src/style/stylesheet.js";
|
|
5
|
+
|
|
6
|
+
import { createClearableFixIcon, createFixIcon, createShowPasswordIcon } from "./src/components/createFixIcon.js";
|
|
7
|
+
import { createWordLimitElement } from "./src/components/createWordLimitElement.js";
|
|
8
|
+
import { createSuggestionBoard } from "./src/components/createSuggestionBoard.js"
|
|
9
|
+
|
|
10
|
+
import { timeout, withTransitionTimeOut } from "../../utils/timeout.js";
|
|
11
|
+
import { dispatchEvent } from "./src/utils/dispatchEvent.js"
|
|
12
|
+
import { handleSearchResult } from "./src/utils/handleSearchResult.js";
|
|
13
|
+
import { initTriggerAfterInputEvent, initTriggerOnFocusEvent } from "./src/utils/handleSuggestionBoardTrigger.js";
|
|
14
|
+
|
|
15
|
+
export class EaInput extends Base {
|
|
16
|
+
#wrap;
|
|
17
|
+
#input;
|
|
18
|
+
|
|
19
|
+
#suggestion = [];
|
|
20
|
+
#suggestionBoard;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
|
|
25
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
26
|
+
shadowRoot.innerHTML = `
|
|
27
|
+
<div class='ea-input_container' part='container'>
|
|
28
|
+
<div class="ea-input_wrap" part="input-wrap">
|
|
29
|
+
<div class="ea-input_prepend-slot" part="prepend-wrap">
|
|
30
|
+
<slot name="prepend"></slot>
|
|
31
|
+
</div>
|
|
32
|
+
<input class="ea-input_inner" type="text" part="input" autocomplete="off" />
|
|
33
|
+
<div class="ea-input_append-slot" part="append-wrap">
|
|
34
|
+
<slot name="append"></slot>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
this.#wrap = shadowRoot.querySelector('.ea-input_wrap');
|
|
41
|
+
this.#input = shadowRoot.querySelector('.ea-input_inner');
|
|
42
|
+
|
|
43
|
+
this.build(shadowRoot, stylesheet);
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ------- name 元素原生name属性 -------
|
|
48
|
+
// #region
|
|
49
|
+
get name() {
|
|
50
|
+
return this.getAttribute("name") || '';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
set name(val) {
|
|
54
|
+
this.setAttribute("name", val);
|
|
55
|
+
}
|
|
56
|
+
// #endregion
|
|
57
|
+
// ------- end -------
|
|
58
|
+
|
|
59
|
+
// ------- type input原生属性 -------
|
|
60
|
+
// #region
|
|
61
|
+
get type() {
|
|
62
|
+
return this.getAttribute("type") || "text";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
set type(val) {
|
|
66
|
+
this.setAttribute("type", val);
|
|
67
|
+
}
|
|
68
|
+
// #endregion
|
|
69
|
+
// ------- end -------
|
|
70
|
+
|
|
71
|
+
// ------- value 输入框的值 -------
|
|
72
|
+
// #region
|
|
73
|
+
get value() {
|
|
74
|
+
return this.getAttribute("value") || '';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set value(val) {
|
|
78
|
+
this.setAttribute("value", val);
|
|
79
|
+
this.#input.value = val;
|
|
80
|
+
}
|
|
81
|
+
// #endregion
|
|
82
|
+
// ------- end -------
|
|
83
|
+
|
|
84
|
+
// ------- placeholder 提示 -------
|
|
85
|
+
// #region
|
|
86
|
+
get placeholder() {
|
|
87
|
+
return this.getAttribute("placeholder") || '';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set placeholder(val) {
|
|
91
|
+
this.setAttribute("placeholder", val);
|
|
92
|
+
this.#input.placeholder = val;
|
|
93
|
+
}
|
|
94
|
+
// #endregion
|
|
95
|
+
// ------- end -------
|
|
96
|
+
|
|
97
|
+
// ------- disabled 输入框禁用 -------
|
|
98
|
+
// #region
|
|
99
|
+
get disabled() {
|
|
100
|
+
return this.getAttrBoolean("disabled");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
set disabled(val) {
|
|
104
|
+
this.setAttribute("disabled", val);
|
|
105
|
+
this.#input.disabled = val;
|
|
106
|
+
this.#input.classList.toggle("disabled", val);
|
|
107
|
+
}
|
|
108
|
+
// #endregion
|
|
109
|
+
// ------- end -------
|
|
110
|
+
|
|
111
|
+
// ------- clearable 可清除 -------
|
|
112
|
+
// #region
|
|
113
|
+
get clearable() {
|
|
114
|
+
return this.getAttrBoolean("clearable");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
set clearable(val) {
|
|
118
|
+
if (!val) return;
|
|
119
|
+
|
|
120
|
+
this.setAttribute("clearable", val);
|
|
121
|
+
|
|
122
|
+
const clearIcon = createClearableFixIcon.call(this, this.#wrap, this.#input, 'icon-cancel-circled2');
|
|
123
|
+
}
|
|
124
|
+
// #endregion
|
|
125
|
+
// ------- end -------
|
|
126
|
+
|
|
127
|
+
// ------- show-password 密码 -------
|
|
128
|
+
// #region
|
|
129
|
+
get showPassword() {
|
|
130
|
+
return this.getAttrBoolean("show-password");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
set showPassword(val) {
|
|
134
|
+
if (!val) return;
|
|
135
|
+
|
|
136
|
+
this.setAttribute("show-password", val);
|
|
137
|
+
this.#input.type = "password";
|
|
138
|
+
|
|
139
|
+
createShowPasswordIcon(this.#wrap, this.#input, 'icon-eye');
|
|
140
|
+
}
|
|
141
|
+
// #endregion
|
|
142
|
+
// ------- end -------
|
|
143
|
+
|
|
144
|
+
// ------- prefix/surfix 指定图标显示位置 -------
|
|
145
|
+
// #region
|
|
146
|
+
get prefixIcon() {
|
|
147
|
+
return this.getAttribute("prefix-icon") || '';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
set prefixIcon(val) {
|
|
151
|
+
if (!val) return;
|
|
152
|
+
|
|
153
|
+
this.setAttribute("prefix", val);
|
|
154
|
+
|
|
155
|
+
createFixIcon(this.#wrap, val, 'prefix');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
get surfixIcon() {
|
|
159
|
+
return this.getAttribute("suffix-icon") || '';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
set surfixIcon(val) {
|
|
163
|
+
if (!val) return;
|
|
164
|
+
|
|
165
|
+
this.setAttribute("suffix", val);
|
|
166
|
+
|
|
167
|
+
createFixIcon(this.#wrap, val, 'surfix');
|
|
168
|
+
}
|
|
169
|
+
// #endregion
|
|
170
|
+
// ------- end -------
|
|
171
|
+
|
|
172
|
+
// ------- suggestion 建议 -------
|
|
173
|
+
// #region
|
|
174
|
+
|
|
175
|
+
// 建议列表
|
|
176
|
+
get suggestion() {
|
|
177
|
+
return this.#suggestion;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
set suggestion(val) {
|
|
181
|
+
if (!val || !(val instanceof Array)) return;
|
|
182
|
+
|
|
183
|
+
this.#suggestion = val;
|
|
184
|
+
|
|
185
|
+
const suggestionBoard = createSuggestionBoard.call(this, this.#wrap, val);
|
|
186
|
+
|
|
187
|
+
// 匹配输入建议
|
|
188
|
+
this.#input.addEventListener('input', (e) => {
|
|
189
|
+
handleSearchResult(suggestionBoard, e.target.value);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
if (this.triggerAfterInput) {
|
|
193
|
+
initTriggerAfterInputEvent(this.#input, suggestionBoard);
|
|
194
|
+
} else {
|
|
195
|
+
initTriggerOnFocusEvent(suggestionBoard, this.#input);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
handleSearchResult(suggestionBoard, this.#input.value);
|
|
199
|
+
|
|
200
|
+
this.#wrap.appendChild(suggestionBoard);
|
|
201
|
+
this.#suggestionBoard = suggestionBoard;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// 输入框激活时列出输入建议
|
|
205
|
+
get triggerOnFocus() {
|
|
206
|
+
return this.getAttrBoolean("trigger-on-focus");
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
set triggerOnFocus(val) {
|
|
210
|
+
if (!val) return;
|
|
211
|
+
|
|
212
|
+
this.setAttribute("trigger-on-focus", val);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// 输入框输入后匹配输入建议
|
|
216
|
+
get triggerAfterInput() {
|
|
217
|
+
return this.getAttrBoolean("trigger-after-input");
|
|
218
|
+
}
|
|
219
|
+
set triggerAfterInput(val) {
|
|
220
|
+
if (!val) return;
|
|
221
|
+
|
|
222
|
+
this.setAttribute("trigger-after-input", val);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// 数据为远程加载时, 显示加载中
|
|
226
|
+
get remote() {
|
|
227
|
+
return this.getAttrBoolean("remote");
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
set remote(val) {
|
|
231
|
+
this.setAttribute("remote", val);
|
|
232
|
+
|
|
233
|
+
const suggestionBoard = createSuggestionBoard.call(this, this.#wrap, this.#suggestion);
|
|
234
|
+
suggestionBoard.classList.toggle('loading', val);
|
|
235
|
+
|
|
236
|
+
this.#input.addEventListener('focus', () => {
|
|
237
|
+
suggestionBoard.classList.add('is-open');
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
this.#suggestionBoard = suggestionBoard;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// #endregion
|
|
244
|
+
// ------- end -------
|
|
245
|
+
|
|
246
|
+
// ------- max-length 最大长度 -------
|
|
247
|
+
// #region
|
|
248
|
+
get maxLength() {
|
|
249
|
+
return this.getAttribute("max-length");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
set maxLength(val) {
|
|
253
|
+
if (!val || this.#input.type !== "text") return;
|
|
254
|
+
|
|
255
|
+
this.setAttribute("max-length", val);
|
|
256
|
+
this.#input.maxLength = val;
|
|
257
|
+
|
|
258
|
+
if (this.showWordLimit) this.showWordLimit = true;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// #endregion
|
|
262
|
+
// ------- end -------
|
|
263
|
+
|
|
264
|
+
// ------- min-length 最小长度 -------
|
|
265
|
+
// #region
|
|
266
|
+
get minLength() {
|
|
267
|
+
return this.getAttribute("min-length");
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
set minLength(val) {
|
|
271
|
+
if (!val || this.#input.type !== "text") return;
|
|
272
|
+
|
|
273
|
+
this.setAttribute("min-length", val);
|
|
274
|
+
this.#input.minLength = val;
|
|
275
|
+
|
|
276
|
+
this.#input.addEventListener('input', (e) => {
|
|
277
|
+
this.#input.ariaInvalid = e.target.value.length < val;
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// #endregion
|
|
281
|
+
// ------- end -------
|
|
282
|
+
|
|
283
|
+
// ------- show-word-limit 显示字数限制 -------
|
|
284
|
+
// #region
|
|
285
|
+
get showWordLimit() {
|
|
286
|
+
return this.getAttrBoolean("show-word-limit");
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
set showWordLimit(val) {
|
|
290
|
+
if (!val || this.#input.type !== "text") return;
|
|
291
|
+
|
|
292
|
+
this.setAttribute("show-word-limit", val);
|
|
293
|
+
|
|
294
|
+
// 加入显示的dom
|
|
295
|
+
const wordLimit = createWordLimitElement.call(this, this.#input);
|
|
296
|
+
this.#wrap.classList.toggle('word-limit', val);
|
|
297
|
+
this.#wrap.appendChild(wordLimit);
|
|
298
|
+
|
|
299
|
+
this.#input.addEventListener('focus', (e) => {
|
|
300
|
+
this.#wrap.classList.add("focus");
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
this.#input.addEventListener('blur', (e) => {
|
|
304
|
+
this.#wrap.classList.remove("focus");
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
// #endregion
|
|
308
|
+
// ------- end -------
|
|
309
|
+
|
|
310
|
+
// ------- readonly 只读 -------
|
|
311
|
+
// #region
|
|
312
|
+
get readonly() {
|
|
313
|
+
return this.getAttrBoolean("readonly");
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
set readonly(val) {
|
|
317
|
+
if (!val) return;
|
|
318
|
+
|
|
319
|
+
this.setAttribute("readonly", val);
|
|
320
|
+
this.#input.readOnly = val;
|
|
321
|
+
}
|
|
322
|
+
// #endregion
|
|
323
|
+
// ------- end -------
|
|
324
|
+
|
|
325
|
+
focus() {
|
|
326
|
+
this.#input.focus();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
blur() {
|
|
330
|
+
this.#input.blur();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
connectedCallback() {
|
|
334
|
+
this.setAttribute("data-ea-component", true);
|
|
335
|
+
|
|
336
|
+
this.name = this.name;
|
|
337
|
+
|
|
338
|
+
// 按钮类型
|
|
339
|
+
this.type = this.type;
|
|
340
|
+
|
|
341
|
+
// 输入框提示
|
|
342
|
+
this.placeholder = this.placeholder;
|
|
343
|
+
|
|
344
|
+
// 输入框的值
|
|
345
|
+
this.value = this.value;
|
|
346
|
+
|
|
347
|
+
// 禁用
|
|
348
|
+
this.disabled = this.disabled;
|
|
349
|
+
|
|
350
|
+
// 可清除
|
|
351
|
+
this.clearable = this.clearable;
|
|
352
|
+
|
|
353
|
+
// 密码
|
|
354
|
+
if (!this.clearable) this.showPassword = this.showPassword;
|
|
355
|
+
|
|
356
|
+
// 输入框图标
|
|
357
|
+
this.prefixIcon = this.prefixIcon;
|
|
358
|
+
if (!this.clearable && !this.showPassword) this.surfixIcon = this.surfixIcon;
|
|
359
|
+
|
|
360
|
+
this.triggerOnFocus = this.triggerOnFocus;
|
|
361
|
+
this.triggerAfterInput = this.triggerAfterInput;
|
|
362
|
+
|
|
363
|
+
// 输入建议
|
|
364
|
+
if (this.remote) this.remote = this.remote;
|
|
365
|
+
|
|
366
|
+
// 输入长度限制
|
|
367
|
+
this.maxLength = this.maxLength;
|
|
368
|
+
this.minLength = this.minLength;
|
|
369
|
+
|
|
370
|
+
this.readonly = this.readonly;
|
|
371
|
+
|
|
372
|
+
// 输入时
|
|
373
|
+
this.#input.addEventListener("input", (e) => {
|
|
374
|
+
this.value = e.target.value;
|
|
375
|
+
dispatchEvent.call(this, e, "change");
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// 聚焦时
|
|
379
|
+
this.#input.addEventListener("focus", (e) => {
|
|
380
|
+
dispatchEvent.call(this, e, "focus");
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// 失焦时
|
|
384
|
+
this.#input.addEventListener("blur", (e) => {
|
|
385
|
+
dispatchEvent.call(this, e, "blur");
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
withTransitionTimeOut(this.#wrap);
|
|
389
|
+
|
|
390
|
+
timeout(() => {
|
|
391
|
+
this.dispatchEvent(new CustomEvent("ready", { bubbles: true }));
|
|
392
|
+
}, 0);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
if (!window.customElements.get("ea-input")) {
|
|
397
|
+
window.customElements.define("ea-input", EaInput);
|
|
398
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
@import "../ea-ui-base-style.scss";
|
|
2
|
+
|
|
3
|
+
.ea-input_container {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: stretch;
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
.ea-input_wrap {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
.ea-input_inner {
|
|
15
|
+
flex: 1;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
box-shadow: none;
|
|
18
|
+
|
|
19
|
+
border: 1px solid $color-border;
|
|
20
|
+
outline: 0;
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
|
|
23
|
+
padding: 0.5rem;
|
|
24
|
+
width: 100%;
|
|
25
|
+
|
|
26
|
+
line-height: 0.8;
|
|
27
|
+
font-size: 0.8rem;
|
|
28
|
+
scrollbar-width: none;
|
|
29
|
+
|
|
30
|
+
&:focus {
|
|
31
|
+
border-color: $color-primary-border;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&::placeholder {
|
|
35
|
+
color: $color-disabled-text;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&[aria-invalid="true"] {
|
|
39
|
+
border-color: $color-danger-border;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[disabled] {
|
|
43
|
+
background-color: $color-disabled-btn-bgc;
|
|
44
|
+
color: $color-disabled-text;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fix-icon {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 50%;
|
|
51
|
+
|
|
52
|
+
font-size: 0.8rem;
|
|
53
|
+
line-height: 0.8rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.prefix {
|
|
57
|
+
.ea-input_inner {
|
|
58
|
+
padding-left: 1.75rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.prefix-icon {
|
|
62
|
+
left: 1rem;
|
|
63
|
+
transform: translate(-50%, -50%);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.surfix {
|
|
68
|
+
.ea-input_inner {
|
|
69
|
+
padding-right: 1.75rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.surfix-icon {
|
|
73
|
+
right: 1rem;
|
|
74
|
+
transform: translate(50%, -50%);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ea-input_prepend-slot,
|
|
79
|
+
.ea-input_append-slot {
|
|
80
|
+
height: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ea-input_suggestion-wrap {
|
|
84
|
+
@include clear-ul-default-style;
|
|
85
|
+
|
|
86
|
+
position: absolute;
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
|
|
89
|
+
z-index: 3;
|
|
90
|
+
|
|
91
|
+
top: calc(100% + 5px);
|
|
92
|
+
left: 0;
|
|
93
|
+
|
|
94
|
+
transform-origin: top center;
|
|
95
|
+
transform: scaleY(0);
|
|
96
|
+
|
|
97
|
+
padding: 0.5rem 0;
|
|
98
|
+
width: 100%;
|
|
99
|
+
max-height: 10rem;
|
|
100
|
+
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
scrollbar-width: thin;
|
|
103
|
+
|
|
104
|
+
background-color: white;
|
|
105
|
+
box-shadow: 0 1px 8px 1px rgba(0, 0, 0, 0.2);
|
|
106
|
+
|
|
107
|
+
li {
|
|
108
|
+
padding: 0.5rem;
|
|
109
|
+
font-size: 0.9rem;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
|
|
112
|
+
&:hover {
|
|
113
|
+
background-color: #f5f7fa;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.loading-icon {
|
|
118
|
+
display: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.loading {
|
|
122
|
+
height: 5rem;
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
|
|
127
|
+
li {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.loading-icon {
|
|
132
|
+
display: block;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.is-open {
|
|
137
|
+
transform: scaleY(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&.word-limit {
|
|
142
|
+
border: 1px solid;
|
|
143
|
+
border-color: $color-border;
|
|
144
|
+
border-radius: 3px;
|
|
145
|
+
|
|
146
|
+
.ea-input_inner {
|
|
147
|
+
border: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ea-input_word-limit {
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-items: center;
|
|
154
|
+
flex-wrap: wrap;
|
|
155
|
+
|
|
156
|
+
padding-right: 0.5rem;
|
|
157
|
+
|
|
158
|
+
font-size: 0.75rem;
|
|
159
|
+
text-align: center;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.focus {
|
|
164
|
+
border-color: $color-primary-border;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&.with-transition {
|
|
168
|
+
transition: border 0.3s;
|
|
169
|
+
|
|
170
|
+
.ea-input_inner {
|
|
171
|
+
transition: border 0.3s;
|
|
172
|
+
}
|
|
173
|
+
\ .ea-input_suggestion-wrap {
|
|
174
|
+
transition: transform 0.3s;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -1 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 在指定容器中创建一个固定的图标元素
|
|
3
|
+
*
|
|
4
|
+
* 此函数通过接受一个容器元素、图标名称和类型作为参数,动态创建一个自定义的<ea-icon>元素
|
|
5
|
+
* 它为新创建的图标设置类名和属性,以确保其样式和行为符合预期
|
|
6
|
+
*
|
|
7
|
+
* @param {HTMLElement} container - 图标将被添加到的容器元素
|
|
8
|
+
* @param {string} icon - 图标名称,用于设置<ea-icon>的icon属性
|
|
9
|
+
* @param {string} type - 图标类型,用于确定类名和part属性值
|
|
10
|
+
* @returns {HTMLElement} 返回创建的<ea-icon>元素,以便进行进一步的操作或引用
|
|
11
|
+
*/
|
|
12
|
+
export function createFixIcon(container, icon, type) {
|
|
13
|
+
const fixIcon = document.createElement('ea-icon');
|
|
14
|
+
fixIcon.className = `fix-icon ${type}-icon`;
|
|
15
|
+
fixIcon.icon = icon;
|
|
16
|
+
fixIcon.part = `${type}-icon`;
|
|
17
|
+
|
|
18
|
+
container.classList.add(type);
|
|
19
|
+
|
|
20
|
+
container.appendChild(fixIcon);
|
|
21
|
+
|
|
22
|
+
return fixIcon;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 控制图标显示与隐藏
|
|
26
|
+
*
|
|
27
|
+
* @param {HTMLElement} icon - 需要控制显示状态的图标元素
|
|
28
|
+
* @param {boolean} flag - 标志位,决定图标是否显示如果为true,则图标显示;如果为false,则图标隐藏
|
|
29
|
+
*/
|
|
30
|
+
function handleIconDisplay(icon, flag) {
|
|
31
|
+
if (flag) {
|
|
32
|
+
icon.style.display = 'block';
|
|
33
|
+
} else {
|
|
34
|
+
icon.style.display = 'none';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 绑定事件监听器或清除图标显示逻辑
|
|
40
|
+
*
|
|
41
|
+
* @param {string} eventName - 需要监听的事件名称,用于决定是否显示密码清除图标
|
|
42
|
+
* @param {HTMLElement} input - 输入框元素,通常为密码输入框
|
|
43
|
+
* @param {HTMLElement} icon - 清除密码的图标元素
|
|
44
|
+
*
|
|
45
|
+
* 此函数的作用是为输入框绑定一个事件监听器,当输入框的内容变化时,
|
|
46
|
+
* 根据输入框的内容决定是否显示清除图标。如果输入框有内容,则显示清除图标;
|
|
47
|
+
* 如果输入框为空,则隐藏清除图标。
|
|
48
|
+
*/
|
|
49
|
+
function clearableEvent(eventName, input, icon) {
|
|
50
|
+
input.addEventListener(eventName, (e) => {
|
|
51
|
+
handleIconDisplay(icon, e.target?.value);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 在指定容器中创建一个固定位置的图标,该图标在特定条件下可见并可响应点击事件
|
|
58
|
+
* 当输入框内容变化时,显示或隐藏该图标
|
|
59
|
+
* 当图标被点击时,清空输入框内容或执行其他预定义操作
|
|
60
|
+
*
|
|
61
|
+
* @param {HTMLElement} container - 图标将被放置的容器元素
|
|
62
|
+
* @param {HTMLElement} input - 与图标关联的输入框元素
|
|
63
|
+
* @param {string} icon - 图标名称,用于确定图标的样式或资源
|
|
64
|
+
* @returns {HTMLElement} - 创建的图标元素
|
|
65
|
+
*/
|
|
66
|
+
export function createClearableFixIcon(container, input, icon) {
|
|
67
|
+
const clearIcon = createFixIcon(container, icon, 'surfix');
|
|
68
|
+
clearIcon.addEventListener('click', () => {
|
|
69
|
+
this.value = '';
|
|
70
|
+
input.focus();
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
handleIconDisplay(clearIcon, input.value);
|
|
74
|
+
|
|
75
|
+
clearableEvent('input', input, clearIcon);
|
|
76
|
+
clearableEvent('focus', input, clearIcon);
|
|
77
|
+
clearableEvent('blur', input, clearIcon);
|
|
78
|
+
|
|
79
|
+
return clearIcon;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 创建显示/隐藏密码图标
|
|
84
|
+
*
|
|
85
|
+
* 此函数用于在密码输入框旁创建一个图标,该图标允许用户点击后切换密码的显示状态(显示或隐藏)
|
|
86
|
+
*
|
|
87
|
+
* @param {HTMLElement} container - 输入框容器,用于确定图标的位置
|
|
88
|
+
* @param {HTMLElement} input - 密码输入框元素,其类型将被切换
|
|
89
|
+
* @param {string} icon - 图标名称,用于初始状态的图标显示
|
|
90
|
+
* @returns {HTMLElement} - 创建的显示/隐藏密码图标元素
|
|
91
|
+
*/
|
|
92
|
+
export function createShowPasswordIcon(container, input, icon) {
|
|
93
|
+
const showPasswordIcon = createFixIcon(container, icon, 'surfix');
|
|
94
|
+
showPasswordIcon.addEventListener('click', () => {
|
|
95
|
+
input.type = input.type === 'password' ? 'text' : 'password';
|
|
96
|
+
showPasswordIcon.icon = input.type === 'password' ? 'icon-eye' : 'icon-eye-off';
|
|
97
|
+
|
|
98
|
+
input.focus();
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
input.addEventListener('input', () => {
|
|
102
|
+
handleIconDisplay(showPasswordIcon, input.value);
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
handleIconDisplay(showPasswordIcon, input.value);
|
|
106
|
+
|
|
107
|
+
return showPasswordIcon;
|
|
108
|
+
}
|