easy-component-ui 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/build/components/Base.js +1 -0
- package/build/components/ea-alert/index.js +1 -0
- package/build/components/ea-alert/src/style/stylesheet.js +1 -0
- package/build/components/ea-aside/index.js +1 -0
- package/build/components/ea-avatar/index.js +1 -0
- package/build/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/errorAvatar.js +1 -0
- package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
- package/build/components/ea-avatar/src/style/stylesheet.js +1 -0
- package/build/components/ea-backtop/index.js +1 -0
- package/build/components/ea-backtop/src/style/stylesheet.js +1 -0
- package/build/components/ea-badge/index.js +1 -0
- package/build/components/ea-badge/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb/index.js +1 -0
- package/build/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
- package/build/components/ea-breadcrumb-item/index.js +1 -0
- package/build/components/ea-breadcrumb-item/src/style/style.js +1 -0
- package/build/components/ea-button/index.js +1 -0
- package/build/components/ea-button/src/components/ButtonComm.js +1 -0
- package/build/components/ea-button/src/components/HrefComm.js +1 -0
- package/build/components/ea-button/src/style/stylesheet.js +1 -0
- package/build/components/ea-button-group/index.js +1 -0
- package/build/components/ea-button-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/index.js +1 -0
- package/build/components/ea-calendar/src/style/stylesheet.js +1 -0
- package/build/components/ea-calendar/src/utils/createChangerElement.js +1 -0
- package/build/components/ea-calendar/src/utils/createThead.js +1 -0
- package/build/components/ea-calendar/src/utils/getDate.js +1 -0
- package/build/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
- package/build/components/ea-card/index.js +1 -0
- package/build/components/ea-card/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/index.js +1 -0
- package/build/components/ea-carousel/src/style/stylesheet.js +1 -0
- package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
- package/build/components/ea-carousel-item/index.js +1 -0
- package/build/components/ea-carousel-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox/index.js +1 -0
- package/build/components/ea-checkbox/src/style/stylesheet.js +1 -0
- package/build/components/ea-checkbox-group/index.js +1 -0
- package/build/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-collapse/index.js +1 -0
- package/build/components/ea-collapse-item/index.js +1 -0
- package/build/components/ea-collapse-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-container/index.js +1 -0
- package/build/components/ea-date-picker/index.js +1 -0
- package/build/components/ea-date-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions/index.js +1 -0
- package/build/components/ea-descriptions/src/components/contentTemplate.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
- package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
- package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
- package/build/components/ea-descriptions/src/style/stylesheet.js +1 -0
- package/build/components/ea-descriptions-item/index.js +1 -0
- package/build/components/ea-descriptions-item/src/stylesheet.js +1 -0
- package/build/components/ea-drawer/index.js +1 -0
- package/build/components/ea-drawer/src/style/stylesheet.js +1 -0
- package/build/components/ea-empty/index.js +1 -0
- package/build/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
- package/build/components/ea-empty/src/style/stylesheet.js +1 -0
- package/build/components/ea-footer/index.js +1 -0
- package/build/components/ea-form/index.js +1 -0
- package/build/components/ea-form-item/index.js +1 -0
- package/build/components/ea-form-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-header/index.js +1 -0
- package/build/components/ea-icon/config.json +1030 -0
- package/{components/ea-icon/css/fontello-codes.css → build/components/ea-icon/css/fontello.css} +312 -123
- package/build/components/ea-icon/font/fontello.eot +0 -0
- package/build/components/ea-icon/font/fontello.svg +350 -0
- package/build/components/ea-icon/font/fontello.ttf +0 -0
- package/build/components/ea-icon/font/fontello.woff +0 -0
- package/build/components/ea-icon/font/fontello.woff2 +0 -0
- package/build/components/ea-icon/index.css +1 -0
- package/build/components/ea-icon/index.js +1 -0
- package/build/components/ea-image/index.js +1 -0
- package/build/components/ea-image/src/assets/errorImage.js +1 -0
- package/build/components/ea-image/src/style/stylesheet.js +1 -0
- package/build/components/ea-image/src/utils/createPreviewTools.js +1 -0
- package/build/components/ea-infinite-scroll/index.js +1 -0
- package/build/components/ea-infinite-scroll-item/index.js +1 -0
- package/build/components/ea-input/index.js +1 -0
- package/build/components/ea-input/src/components/createFixIcon.js +1 -0
- package/build/components/ea-input/src/components/createSuggestionBoard.js +1 -0
- package/build/components/ea-input/src/components/createWordLimitElement.js +1 -0
- package/build/components/ea-input/src/style/stylesheet.js +1 -0
- package/build/components/ea-input/src/utils/dispatchEvent.js +1 -0
- package/build/components/ea-input/src/utils/handleSearchResult.js +1 -0
- package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
- package/build/components/ea-input-number/index.js +1 -0
- package/build/components/ea-input-number/src/style/stylesheet.js +1 -0
- package/build/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
- package/build/components/ea-link/index.js +1 -0
- package/build/components/ea-link/src/style/stylesheet.js +1 -0
- package/build/components/ea-loading/index.js +1 -0
- package/build/components/ea-loading/src/style/stylesheet.js +1 -0
- package/build/components/ea-main/index.js +1 -0
- package/build/components/ea-menu/index.js +1 -0
- package/build/components/ea-menu/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
- package/build/components/ea-menu-item/index.js +1 -0
- package/build/components/ea-menu-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-menu-item-group/index.js +1 -0
- package/build/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/index.js +1 -0
- package/build/components/ea-message/src/style/stylesheet.js +1 -0
- package/build/components/ea-message/src/utils/MessageClass.js +1 -0
- package/build/components/ea-message-box/index.js +1 -0
- package/build/components/ea-message-box/src/style/stylesheet.js +1 -0
- package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
- package/build/components/ea-option/index.js +1 -0
- package/build/components/ea-option/src/style/stylesheet.js +1 -0
- package/build/components/ea-option-gropu/index.js +1 -0
- package/build/components/ea-page-header/index.js +1 -0
- package/build/components/ea-page-header/src/style/stylesheet.js +1 -0
- package/build/components/ea-pagination/index.js +1 -0
- package/build/components/ea-pagination/src/components/getMoreItem.js +1 -0
- package/build/components/ea-pagination/src/components/getPageItem.js +1 -0
- package/build/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
- package/build/components/ea-pagination/src/style/stylesheet.js +1 -0
- package/build/components/ea-pane/index.js +1 -0
- package/build/components/ea-pane/src/stylesheet.js +1 -0
- package/build/components/ea-progress/index.js +1 -0
- package/build/components/ea-progress/src/components/SVGComm.js +1 -0
- package/build/components/ea-progress/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio/index.js +1 -0
- package/build/components/ea-radio/src/style/stylesheet.js +1 -0
- package/build/components/ea-radio-group/index.js +1 -0
- package/build/components/ea-rate/index.js +1 -0
- package/build/components/ea-rate/src/components/rateComm.js +1 -0
- package/build/components/ea-rate/src/style/stylesheet.js +1 -0
- package/build/components/ea-result/index.js +1 -0
- package/build/components/ea-result/src/style/stylesheet.js +1 -0
- package/build/components/ea-select/index.js +1 -0
- package/build/components/ea-select/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/index.js +1 -0
- package/build/components/ea-skeleton/src/style/stylesheet.js +1 -0
- package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
- package/build/components/ea-skeleton-item/index.js +1 -0
- package/build/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
- package/build/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
- package/build/components/ea-step/index.js +1 -0
- package/build/components/ea-step/src/style/stylesheet.js +1 -0
- package/build/components/ea-steps/index.js +1 -0
- package/build/components/ea-steps/src/style/stylesheet.js +1 -0
- package/build/components/ea-submenu/index.js +1 -0
- package/build/components/ea-submenu/src/style/stylesheet.js +1 -0
- package/build/components/ea-switch/index.js +1 -0
- package/build/components/ea-switch/src/style/stylesheet.js +1 -0
- package/build/components/ea-tab/index.js +1 -0
- package/build/components/ea-tab/src/style/stylesheet.js +1 -0
- package/build/components/ea-table/index.js +1 -0
- package/build/components/ea-table/src/style/stylesheet.js +1 -0
- package/build/components/ea-table-column/index.js +1 -0
- package/build/components/ea-tabs/index.js +1 -0
- package/build/components/ea-tabs/src/style/stylesheet.js +1 -0
- package/build/components/ea-tag/index.js +1 -0
- package/build/components/ea-tag/src/style/stylesheet.js +1 -0
- package/build/components/ea-textarea/index.js +1 -0
- package/build/components/ea-textarea/src/style/stylesheet.js +1 -0
- package/build/components/ea-time-picker/index.js +1 -0
- package/build/components/ea-time-picker/src/style/stylesheet.js +1 -0
- package/build/components/ea-timeline/index.js +1 -0
- package/build/components/ea-timeline/style/stylesheet.js +1 -0
- package/build/components/ea-timeline-item/index.js +1 -0
- package/build/components/ea-timeline-item/src/style/stylesheet.js +1 -0
- package/build/components/globalConfig.js +1 -0
- package/build/components/index.js +1 -0
- package/build/utils/Validator.js +1 -0
- package/build/utils/createElement.js +1 -0
- package/build/utils/handleDefaultAttrIsTrue.js +1 -0
- package/build/utils/handleTemplate.js +1 -0
- package/build/utils/setStyle.js +1 -0
- package/build/utils/timeout.js +1 -0
- package/components/Base.js +75 -1
- package/components/ea-alert/index.css +91 -0
- package/components/ea-alert/index.js +210 -1
- package/components/ea-alert/index.scss +108 -0
- package/components/ea-alert/src/style/stylesheet.js +85 -1
- package/components/ea-aside/index.css +9 -0
- package/components/ea-aside/index.js +54 -1
- package/components/ea-aside/index.scss +12 -0
- package/components/ea-avatar/index.css +66 -0
- package/components/ea-avatar/index.js +156 -1
- package/components/ea-avatar/index.scss +59 -0
- package/components/ea-avatar/src/assets/defaultAvatar.js +12 -1
- package/components/ea-avatar/src/assets/errorAvatar.js +9 -1
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +18 -1
- package/components/ea-avatar/src/style/stylesheet.js +61 -1
- package/components/ea-backtop/index.css +27 -0
- package/components/ea-backtop/index.js +167 -1
- package/components/ea-backtop/index.scss +29 -0
- package/components/ea-backtop/src/style/stylesheet.js +21 -1
- package/components/ea-badge/index.css +49 -0
- package/components/ea-badge/index.js +103 -1
- package/components/ea-badge/index.scss +56 -0
- package/components/ea-badge/src/style/stylesheet.js +43 -1
- package/components/ea-breadcrumb/index.css +6 -0
- package/components/ea-breadcrumb/index.js +90 -1
- package/components/ea-breadcrumb/index.scss +7 -0
- package/components/ea-breadcrumb/src/style/stylesheet.js +8 -1
- package/components/ea-breadcrumb-item/index.css +10 -0
- package/components/ea-breadcrumb-item/index.js +23 -1
- package/components/ea-breadcrumb-item/index.scss +12 -0
- package/components/ea-breadcrumb-item/src/style/style.js +12 -1
- package/components/ea-button/index.css +206 -0
- package/components/ea-button/index.js +198 -1
- package/components/ea-button/index.scss +143 -0
- package/components/ea-button/src/components/ButtonComm.js +5 -1
- package/components/ea-button/src/components/HrefComm.js +5 -1
- package/components/ea-button/src/style/stylesheet.js +208 -1
- package/components/ea-button-group/index.css +16 -0
- package/components/ea-button-group/index.js +44 -1
- package/components/ea-button-group/index.scss +20 -0
- package/components/ea-button-group/src/style/stylesheet.js +18 -1
- package/components/ea-calendar/index.css +72 -0
- package/components/ea-calendar/index.js +298 -1
- package/components/ea-calendar/index.scss +106 -0
- package/components/ea-calendar/src/style/stylesheet.js +74 -1
- package/components/ea-calendar/src/utils/createChangerElement.js +10 -1
- package/components/ea-calendar/src/utils/createThead.js +18 -1
- package/components/ea-calendar/src/utils/getDate.js +11 -1
- package/components/ea-calendar/src/utils/getUserWeekStart.js +11 -1
- package/components/ea-card/index.css +25 -0
- package/components/ea-card/index.js +51 -1
- package/components/ea-card/index.scss +24 -0
- package/components/ea-card/src/style/stylesheet.js +19 -1
- package/components/ea-carousel/index.css +103 -0
- package/components/ea-carousel/index.js +222 -1
- package/components/ea-carousel/index.scss +140 -0
- package/components/ea-carousel/src/style/stylesheet.js +105 -1
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +9 -1
- package/components/ea-carousel-item/index.css +20 -0
- package/components/ea-carousel-item/index.js +23 -1
- package/components/ea-carousel-item/index.scss +26 -0
- package/components/ea-carousel-item/src/style/stylesheet.js +22 -1
- package/components/ea-checkbox/index.css +108 -0
- package/components/ea-checkbox/index.js +160 -1
- package/components/ea-checkbox/index.scss +141 -0
- package/components/ea-checkbox/src/style/stylesheet.js +110 -1
- package/components/ea-checkbox-group/index.css +6 -0
- package/components/ea-checkbox-group/index.js +120 -1
- package/components/ea-checkbox-group/index.scss +7 -0
- package/components/ea-checkbox-group/src/style/stylesheet.js +8 -1
- package/components/ea-collapse/index.css +0 -0
- package/components/ea-collapse/index.js +109 -1
- package/components/ea-collapse/index.scss +4 -0
- package/components/ea-collapse-item/index.css +31 -0
- package/components/ea-collapse-item/index.js +111 -1
- package/components/ea-collapse-item/index.scss +46 -0
- package/components/ea-collapse-item/src/style/stylesheet.js +33 -1
- package/components/ea-container/index.css +14 -0
- package/components/ea-container/index.js +85 -1
- package/components/ea-container/index.scss +18 -0
- package/components/ea-date-picker/index.css +17 -0
- package/components/ea-date-picker/index.js +191 -1
- package/components/ea-date-picker/index.scss +29 -0
- package/components/ea-date-picker/src/style/stylesheet.js +19 -1
- package/components/ea-descriptions/index.css +33 -0
- package/components/ea-descriptions/index.js +171 -1
- package/components/ea-descriptions/index.scss +45 -0
- package/components/ea-descriptions/src/components/contentTemplate.js +11 -1
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +6 -1
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +7 -1
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +8 -1
- package/components/ea-descriptions/src/style/stylesheet.js +35 -1
- package/components/ea-descriptions-item/index.css +21 -0
- package/components/ea-descriptions-item/index.js +71 -1
- package/components/ea-descriptions-item/index.scss +29 -0
- package/components/ea-descriptions-item/src/stylesheet.js +23 -1
- package/components/ea-drawer/index.css +138 -0
- package/components/ea-drawer/index.js +251 -1
- package/components/ea-drawer/index.scss +208 -0
- package/components/ea-drawer/src/style/stylesheet.js +141 -1
- package/components/ea-empty/index.css +30 -0
- package/components/ea-empty/index.js +93 -1
- package/components/ea-empty/index.scss +30 -0
- package/components/ea-empty/src/assets/emptyStatusSVG.js +6 -1
- package/components/ea-empty/src/style/stylesheet.js +24 -1
- package/components/ea-footer/index.css +7 -0
- package/components/ea-footer/index.js +57 -1
- package/components/ea-footer/index.scss +10 -0
- package/components/ea-form/index.css +0 -0
- package/components/ea-form/index.js +121 -1
- package/components/ea-form/index.scss +0 -0
- package/components/ea-form-item/index.css +62 -0
- package/components/ea-form-item/index.js +152 -1
- package/components/ea-form-item/index.scss +83 -0
- package/components/ea-form-item/src/style/stylesheet.js +64 -1
- package/components/ea-header/index.css +7 -0
- package/components/ea-header/index.js +55 -1
- package/components/ea-header/index.scss +10 -0
- package/components/ea-icon/css/fontello.css +312 -226
- package/components/ea-icon/index.css +1 -2
- package/components/ea-icon/index.js +84 -1
- package/components/ea-image/index.css +84 -0
- package/components/ea-image/index.js +182 -1
- package/components/ea-image/index.scss +111 -0
- package/components/ea-image/src/assets/errorImage.js +9 -1
- package/components/ea-image/src/assets/errorImage.svg +7 -0
- package/components/ea-image/src/style/stylesheet.js +86 -1
- package/components/ea-image/src/utils/createPreviewTools.js +140 -1
- package/components/ea-infinite-scroll/index.css +0 -0
- package/components/ea-infinite-scroll/index.js +119 -1
- package/components/ea-infinite-scroll/index.scss +0 -0
- package/components/ea-infinite-scroll-item/index.css +0 -0
- package/components/ea-infinite-scroll-item/index.js +18 -1
- package/components/ea-infinite-scroll-item/index.scss +0 -0
- package/components/ea-input/index.css +139 -0
- package/components/ea-input/index.js +398 -1
- package/components/ea-input/index.scss +178 -0
- package/components/ea-input/src/components/createFixIcon.js +108 -1
- package/components/ea-input/src/components/createSuggestionBoard.js +43 -1
- package/components/ea-input/src/components/createWordLimitElement.js +18 -1
- package/components/ea-input/src/style/stylesheet.js +141 -1
- package/components/ea-input/src/utils/dispatchEvent.js +9 -1
- package/components/ea-input/src/utils/handleSearchResult.js +9 -1
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +31 -1
- package/components/ea-input-number/index.css +120 -0
- package/components/ea-input-number/index.js +308 -1
- package/components/ea-input-number/index.scss +132 -0
- package/components/ea-input-number/src/style/stylesheet.js +122 -1
- package/components/ea-input-number/src/utils/handleCustomEvent.js +5 -1
- package/components/ea-link/index.css +48 -0
- package/components/ea-link/index.js +122 -1
- package/components/ea-link/index.scss +36 -0
- package/components/ea-link/src/style/stylesheet.js +50 -1
- package/components/ea-loading/index.css +38 -0
- package/components/ea-loading/index.js +166 -1
- package/components/ea-loading/index.scss +55 -0
- package/components/ea-loading/src/style/stylesheet.js +40 -1
- package/components/ea-main/index.css +8 -0
- package/components/ea-main/index.js +32 -1
- package/components/ea-main/index.scss +11 -0
- package/components/ea-menu/index.css +19 -0
- package/components/ea-menu/index.js +131 -1
- package/components/ea-menu/index.scss +22 -0
- package/components/ea-menu/src/style/stylesheet.js +21 -1
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +32 -1
- package/components/ea-menu-item/index.css +48 -0
- package/components/ea-menu-item/index.js +130 -1
- package/components/ea-menu-item/index.scss +62 -0
- package/components/ea-menu-item/src/style/stylesheet.js +50 -1
- package/components/ea-menu-item-group/index.css +42 -0
- package/components/ea-menu-item-group/index.js +130 -1
- package/components/ea-menu-item-group/index.scss +60 -0
- package/components/ea-menu-item-group/src/style/stylesheet.js +44 -1
- package/components/ea-message/index.css +47 -0
- package/components/ea-message/index.js +171 -1
- package/components/ea-message/index.scss +70 -0
- package/components/ea-message/src/style/stylesheet.js +48 -1
- package/components/ea-message/src/utils/MessageClass.js +67 -1
- package/components/ea-message-box/index.css +85 -0
- package/components/ea-message-box/index.js +211 -1
- package/components/ea-message-box/index.scss +113 -0
- package/components/ea-message-box/src/style/stylesheet.js +87 -1
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +60 -1
- package/components/ea-option/index.css +24 -0
- package/components/ea-option/index.js +74 -1
- package/components/ea-option/index.scss +31 -0
- package/components/ea-option/src/style/stylesheet.js +26 -1
- package/components/ea-option-gropu/index.css +6 -0
- package/components/ea-option-gropu/index.js +57 -1
- package/components/ea-option-gropu/index.scss +8 -0
- package/components/ea-page-header/index.css +33 -0
- package/components/ea-page-header/index.js +91 -1
- package/components/ea-page-header/index.scss +44 -0
- package/components/ea-page-header/src/style/stylesheet.js +35 -1
- package/components/ea-pagination/index.css +69 -0
- package/components/ea-pagination/index.js +305 -1
- package/components/ea-pagination/index.scss +89 -0
- package/components/ea-pagination/src/components/getMoreItem.js +20 -1
- package/components/ea-pagination/src/components/getPageItem.js +11 -1
- package/components/ea-pagination/src/components/getShowTotalItem.js +7 -1
- package/components/ea-pagination/src/style/stylesheet.js +71 -1
- package/components/ea-pane/index.css +6 -0
- package/components/ea-pane/index.js +52 -1
- package/components/ea-pane/index.scss +7 -0
- package/components/ea-pane/src/stylesheet.js +8 -1
- package/components/ea-progress/index.css +61 -0
- package/components/ea-progress/index.js +249 -1
- package/components/ea-progress/index.scss +74 -0
- package/components/ea-progress/src/components/SVGComm.js +18 -1
- package/components/ea-progress/src/style/stylesheet.js +55 -1
- package/components/ea-radio/index.css +82 -0
- package/components/ea-radio/index.js +137 -1
- package/components/ea-radio/index.scss +119 -0
- package/components/ea-radio/src/style/stylesheet.js +84 -1
- package/components/ea-radio-group/index.css +3 -0
- package/components/ea-radio-group/index.js +96 -1
- package/components/ea-radio-group/index.scss +3 -0
- package/components/ea-rate/index.css +44 -0
- package/components/ea-rate/index.js +243 -1
- package/components/ea-rate/index.scss +55 -0
- package/components/ea-rate/src/components/rateComm.js +20 -1
- package/components/ea-rate/src/style/stylesheet.js +45 -1
- package/components/ea-result/index.css +37 -0
- package/components/ea-result/index.js +109 -1
- package/components/ea-result/index.scss +46 -0
- package/components/ea-result/src/style/stylesheet.js +39 -1
- package/components/ea-select/index.css +47 -0
- package/components/ea-select/index.js +312 -1
- package/components/ea-select/index.scss +70 -0
- package/components/ea-select/src/style/stylesheet.js +49 -1
- package/components/ea-skeleton/index.css +12 -0
- package/components/ea-skeleton/index.js +148 -1
- package/components/ea-skeleton/index.scss +16 -0
- package/components/ea-skeleton/src/style/stylesheet.js +14 -1
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +7 -1
- package/components/ea-skeleton-item/index.css +69 -0
- package/components/ea-skeleton-item/index.js +82 -1
- package/components/ea-skeleton-item/index.scss +107 -0
- package/components/ea-skeleton-item/src/assets/imageSVG.js +8 -1
- package/components/ea-skeleton-item/src/style/stylesheet.js +71 -1
- package/components/ea-step/index.css +84 -0
- package/components/ea-step/index.js +230 -1
- package/components/ea-step/index.scss +110 -0
- package/components/ea-step/src/style/stylesheet.js +86 -1
- package/components/ea-steps/index.css +19 -0
- package/components/ea-steps/index.js +104 -1
- package/components/ea-steps/index.scss +23 -0
- package/components/ea-steps/src/style/stylesheet.js +21 -1
- package/components/ea-submenu/index.css +65 -0
- package/components/ea-submenu/index.js +141 -1
- package/components/ea-submenu/index.scss +88 -0
- package/components/ea-submenu/src/style/stylesheet.js +67 -1
- package/components/ea-switch/index.css +90 -0
- package/components/ea-switch/index.js +189 -1
- package/components/ea-switch/index.scss +117 -0
- package/components/ea-switch/src/style/stylesheet.js +92 -1
- package/components/ea-tab/index.css +68 -0
- package/components/ea-tab/index.js +138 -1
- package/components/ea-tab/index.scss +96 -0
- package/components/ea-tab/src/style/stylesheet.js +70 -1
- package/components/ea-table/index.css +98 -0
- package/components/ea-table/index.js +555 -1
- package/components/ea-table/index.scss +90 -0
- package/components/ea-table/src/style/stylesheet.js +100 -1
- package/components/ea-table-column/index.css +0 -0
- package/components/ea-table-column/index.js +164 -1
- package/components/ea-table-column/index.scss +0 -0
- package/components/ea-tabs/index.css +45 -0
- package/components/ea-tabs/index.js +245 -1
- package/components/ea-tabs/index.scss +64 -0
- package/components/ea-tabs/src/style/stylesheet.js +47 -1
- package/components/ea-tag/index.css +90 -0
- package/components/ea-tag/index.js +107 -1
- package/components/ea-tag/index.scss +71 -0
- package/components/ea-tag/src/style/stylesheet.js +92 -1
- package/components/ea-textarea/index.css +37 -0
- package/components/ea-textarea/index.js +277 -1
- package/components/ea-textarea/index.scss +48 -0
- package/components/ea-textarea/src/style/stylesheet.js +39 -1
- package/components/ea-time-picker/index.css +82 -0
- package/components/ea-time-picker/index.js +379 -1
- package/components/ea-time-picker/index.scss +110 -0
- package/components/ea-time-picker/src/style/stylesheet.js +84 -1
- package/components/ea-timeline/index.css +0 -0
- package/components/ea-timeline/index.js +74 -1
- package/components/ea-timeline/index.scss +1 -0
- package/components/ea-timeline/style/stylesheet.js +3 -1
- package/components/ea-timeline-item/index.css +79 -0
- package/components/ea-timeline-item/index.js +146 -1
- package/components/ea-timeline-item/index.scss +92 -0
- package/components/ea-timeline-item/src/style/stylesheet.js +81 -1
- package/components/ea-ui-base-style.css +0 -0
- package/components/ea-ui-base-style.scss +153 -0
- package/components/globalConfig.js +10 -0
- package/components/index.js +67 -0
- package/package.json +1 -1
- package/public/logo.png +0 -0
- package/utils/Validator.js +16 -1
- package/utils/createElement.js +30 -1
- package/utils/handleDefaultAttrIsTrue.js +11 -1
- package/utils/handleTemplate.js +19 -1
- package/utils/setStyle.js +8 -1
- package/utils/timeout.js +16 -1
- package/components/ea-icon/css/animation.css +0 -85
- package/components/ea-icon/css/fontello-embedded.css +0 -181
- package/components/ea-icon/css/fontello-ie7-codes.css +0 -123
- package/components/ea-icon/css/fontello-ie7.css +0 -134
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@import "../ea-ui-base-style.scss";
|
|
2
|
+
|
|
3
|
+
.ea-textarea_wrap {
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
.ea-textarea_inner {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
box-shadow: none;
|
|
10
|
+
resize: vertical;
|
|
11
|
+
min-height: 1.75rem;
|
|
12
|
+
|
|
13
|
+
border: 1px solid $color-border;
|
|
14
|
+
outline: 0;
|
|
15
|
+
transition: border 0.2s;
|
|
16
|
+
border-radius: 3px;
|
|
17
|
+
|
|
18
|
+
padding: 0.5rem;
|
|
19
|
+
|
|
20
|
+
line-height: 0.8;
|
|
21
|
+
font-size: 0.8rem;
|
|
22
|
+
scrollbar-width: none;
|
|
23
|
+
|
|
24
|
+
&:focus {
|
|
25
|
+
border-color: $color-primary-border;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::placeholder {
|
|
29
|
+
color: $color-disabled-text;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:disabled {
|
|
33
|
+
background-color: $color-disabled-btn-bgc;
|
|
34
|
+
color: $color-disabled-text;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:invalid {
|
|
38
|
+
border-color: $color-danger-border;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ea-input_word-limit {
|
|
43
|
+
position: absolute;
|
|
44
|
+
font-size: 0.75rem;
|
|
45
|
+
bottom: 0.5rem;
|
|
46
|
+
right: 0.5rem;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
export const stylesheet=
|
|
1
|
+
export const stylesheet = `
|
|
2
|
+
.ea-textarea_wrap {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
.ea-textarea_wrap .ea-textarea_inner {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
box-shadow: none;
|
|
9
|
+
resize: vertical;
|
|
10
|
+
min-height: 1.75rem;
|
|
11
|
+
border: 1px solid #dcdfe6;
|
|
12
|
+
outline: 0;
|
|
13
|
+
transition: border 0.2s;
|
|
14
|
+
border-radius: 3px;
|
|
15
|
+
padding: 0.5rem;
|
|
16
|
+
line-height: 0.8;
|
|
17
|
+
font-size: 0.8rem;
|
|
18
|
+
scrollbar-width: none;
|
|
19
|
+
}
|
|
20
|
+
.ea-textarea_wrap .ea-textarea_inner:focus {
|
|
21
|
+
border-color: #409eff;
|
|
22
|
+
}
|
|
23
|
+
.ea-textarea_wrap .ea-textarea_inner::placeholder {
|
|
24
|
+
color: #c0c4cc;
|
|
25
|
+
}
|
|
26
|
+
.ea-textarea_wrap .ea-textarea_inner:disabled {
|
|
27
|
+
background-color: #eeeeee;
|
|
28
|
+
color: #c0c4cc;
|
|
29
|
+
}
|
|
30
|
+
.ea-textarea_wrap .ea-textarea_inner:invalid {
|
|
31
|
+
border-color: #f56c6c;
|
|
32
|
+
}
|
|
33
|
+
.ea-textarea_wrap .ea-input_word-limit {
|
|
34
|
+
position: absolute;
|
|
35
|
+
font-size: 0.75rem;
|
|
36
|
+
bottom: 0.5rem;
|
|
37
|
+
right: 0.5rem;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.ea-time-picker_wrap {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap {
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: -12px;
|
|
7
|
+
left: 0;
|
|
8
|
+
transform-origin: center top;
|
|
9
|
+
transform: translateY(100%) scaleY(0);
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
background-color: #fff;
|
|
12
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
13
|
+
z-index: 2;
|
|
14
|
+
}
|
|
15
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap::before {
|
|
16
|
+
content: "";
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0.5rem;
|
|
20
|
+
border: 0.5rem solid transparent;
|
|
21
|
+
border-bottom-color: #fff;
|
|
22
|
+
transform: translateY(-100%);
|
|
23
|
+
}
|
|
24
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap {
|
|
25
|
+
display: flex;
|
|
26
|
+
position: relative;
|
|
27
|
+
margin: 1rem 0;
|
|
28
|
+
}
|
|
29
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::before, .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::after {
|
|
30
|
+
content: "";
|
|
31
|
+
position: absolute;
|
|
32
|
+
left: 0;
|
|
33
|
+
transform: translateY(-50%);
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::before {
|
|
37
|
+
top: calc(50% - 16px);
|
|
38
|
+
border-bottom: 1px solid #e4e7ed;
|
|
39
|
+
}
|
|
40
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::after {
|
|
41
|
+
top: calc(50% + 16px);
|
|
42
|
+
border-bottom: 1px solid #e4e7ed;
|
|
43
|
+
}
|
|
44
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner {
|
|
45
|
+
flex: 1;
|
|
46
|
+
max-height: 190px;
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
padding: 5rem 0;
|
|
49
|
+
text-align: center;
|
|
50
|
+
overflow: auto;
|
|
51
|
+
scrollbar-width: none;
|
|
52
|
+
margin-block-start: 0;
|
|
53
|
+
margin-block-end: 0;
|
|
54
|
+
margin-inline-start: 0px;
|
|
55
|
+
margin-inline-end: 0px;
|
|
56
|
+
padding-inline-start: 0px;
|
|
57
|
+
list-style-type: none;
|
|
58
|
+
}
|
|
59
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item {
|
|
60
|
+
height: 32px;
|
|
61
|
+
line-height: 32px;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
color: #606266;
|
|
64
|
+
transition: color 0.3s;
|
|
65
|
+
}
|
|
66
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item.is-active {
|
|
67
|
+
color: #409eff;
|
|
68
|
+
}
|
|
69
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item.is-disabled {
|
|
70
|
+
color: #c0c4cc;
|
|
71
|
+
}
|
|
72
|
+
.ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-button-group {
|
|
73
|
+
text-align: right;
|
|
74
|
+
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
|
|
75
|
+
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
76
|
+
}
|
|
77
|
+
.ea-time-picker_wrap.is-open .ea-time-picker_dropdown-wrap {
|
|
78
|
+
transform: translateY(100%) scaleY(1);
|
|
79
|
+
}
|
|
80
|
+
.ea-time-picker_wrap.with-transition .ea-time-picker_dropdown-wrap {
|
|
81
|
+
transition: transform 0.3s ease-in-out;
|
|
82
|
+
}
|
|
@@ -1 +1,379 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import Base from '../Base.js';
|
|
3
|
+
import '../ea-icon/index.js'
|
|
4
|
+
|
|
5
|
+
import { createElement } from '../../utils/createElement.js';
|
|
6
|
+
import { timeout } from '../../utils/timeout.js';
|
|
7
|
+
import { stylesheet } from './src/style/stylesheet.js';
|
|
8
|
+
|
|
9
|
+
import "../ea-input/index.js"
|
|
10
|
+
import '../ea-button/index.js'
|
|
11
|
+
|
|
12
|
+
export class EaTimePicker extends Base {
|
|
13
|
+
#container;
|
|
14
|
+
#timePickerInput;
|
|
15
|
+
|
|
16
|
+
#dropdownWrap;
|
|
17
|
+
#timePickerHourWrap;
|
|
18
|
+
#timePickerMinuteWrap;
|
|
19
|
+
#timePickerSecondWrap;
|
|
20
|
+
|
|
21
|
+
#timePickerIsInit = false;
|
|
22
|
+
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
|
|
26
|
+
const shadowRoot = this.attachShadow({ mode: 'open' });
|
|
27
|
+
|
|
28
|
+
shadowRoot.innerHTML = `
|
|
29
|
+
<div class='ea-time-picker_wrap' part='container'>
|
|
30
|
+
<ea-input part='input' autocomplete="off" readonly prefix-icon="icon-clock"></ea-input>
|
|
31
|
+
<div class="ea-time-picker_dropdown-wrap" part='dropdown-wrap'>
|
|
32
|
+
<div class="ea-time-picker_dropdown-inner-wrap" part='dropdown-inner-wrap'>
|
|
33
|
+
<ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-hour" part='dropdown-time'>
|
|
34
|
+
</ul>
|
|
35
|
+
<ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-minute" part='dropdown-time'>
|
|
36
|
+
</ul>
|
|
37
|
+
<ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-second" part='dropdown-time'>
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
this.#container = shadowRoot.querySelector('.ea-time-picker_wrap');
|
|
45
|
+
this.#timePickerInput = shadowRoot.querySelector('ea-input');
|
|
46
|
+
|
|
47
|
+
this.#dropdownWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-wrap');
|
|
48
|
+
this.#timePickerHourWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-hour');
|
|
49
|
+
this.#timePickerMinuteWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-minute');
|
|
50
|
+
this.#timePickerSecondWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-second');
|
|
51
|
+
|
|
52
|
+
this.build(shadowRoot, stylesheet);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ------- width 宽度 -------
|
|
56
|
+
// #region
|
|
57
|
+
get width() {
|
|
58
|
+
return this.getAttribute('width') || "200px";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
set width(value) {
|
|
62
|
+
this.setAttribute('width', value);
|
|
63
|
+
|
|
64
|
+
this.#container.style.width = value;
|
|
65
|
+
}
|
|
66
|
+
// #endregion
|
|
67
|
+
// ------- end -------
|
|
68
|
+
|
|
69
|
+
// ------- time 时间 -------
|
|
70
|
+
// #region
|
|
71
|
+
get time() {
|
|
72
|
+
return this.getAttribute('time') || '00:00:00';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
set time(value) {
|
|
76
|
+
this.setAttribute('time', value);
|
|
77
|
+
|
|
78
|
+
const [hour, minute, second] = value.split(':');
|
|
79
|
+
|
|
80
|
+
this.hour = hour;
|
|
81
|
+
this.minute = minute;
|
|
82
|
+
this.second = second;
|
|
83
|
+
}
|
|
84
|
+
// #endregion
|
|
85
|
+
// ------- end -------
|
|
86
|
+
|
|
87
|
+
// ------- name 属性 -------
|
|
88
|
+
// #region
|
|
89
|
+
get name() {
|
|
90
|
+
return this.getAttribute('name') || 'timePicker';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
set name(value) {
|
|
94
|
+
this.setAttribute('name', value);
|
|
95
|
+
}
|
|
96
|
+
// #endregion
|
|
97
|
+
// ------- end -------
|
|
98
|
+
|
|
99
|
+
// ------- hour 小时 -------
|
|
100
|
+
// #region
|
|
101
|
+
get hour() {
|
|
102
|
+
const attr = this.getAttrNumber('hour');
|
|
103
|
+
return this.#handleLessThanTen(attr);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
set hour(value) {
|
|
107
|
+
this.setAttribute('hour', value);
|
|
108
|
+
|
|
109
|
+
this.#handleTimeItemPicker(this.#timePickerHourWrap, value);
|
|
110
|
+
}
|
|
111
|
+
// #endregion
|
|
112
|
+
// ------- end -------
|
|
113
|
+
|
|
114
|
+
// ------- minute 分钟 -------
|
|
115
|
+
// #region
|
|
116
|
+
get minute() {
|
|
117
|
+
const attr = this.getAttrNumber('minute');
|
|
118
|
+
return this.#handleLessThanTen(attr);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
set minute(value) {
|
|
122
|
+
this.setAttribute('minute', value);
|
|
123
|
+
|
|
124
|
+
this.#handleTimeItemPicker(this.#timePickerMinuteWrap, value);
|
|
125
|
+
}
|
|
126
|
+
// #endregion
|
|
127
|
+
// ------- end -------
|
|
128
|
+
|
|
129
|
+
// ------- second 秒 -------
|
|
130
|
+
// #region
|
|
131
|
+
get second() {
|
|
132
|
+
const attr = this.getAttrNumber('second');
|
|
133
|
+
return this.#handleLessThanTen(attr);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
set second(value) {
|
|
137
|
+
this.setAttribute('second', value);
|
|
138
|
+
|
|
139
|
+
this.#handleTimeItemPicker(this.#timePickerSecondWrap, value);
|
|
140
|
+
}
|
|
141
|
+
// #endregion
|
|
142
|
+
// ------- end -------
|
|
143
|
+
|
|
144
|
+
// ------- value 时间 -------
|
|
145
|
+
// #region
|
|
146
|
+
get value() {
|
|
147
|
+
return this.time;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
set value(value) {
|
|
151
|
+
this.time = value;
|
|
152
|
+
}
|
|
153
|
+
// #endregion
|
|
154
|
+
// ------- end -------
|
|
155
|
+
|
|
156
|
+
// ------- disabled 禁用 -------
|
|
157
|
+
// #region
|
|
158
|
+
get disabled() {
|
|
159
|
+
return this.getAttrBoolean('disabled') || false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
set disabled(value) {
|
|
163
|
+
this.setAttribute('disabled', value);
|
|
164
|
+
|
|
165
|
+
this.#timePickerInput.disabled = value;
|
|
166
|
+
}
|
|
167
|
+
// #endregion
|
|
168
|
+
// ------- end -------
|
|
169
|
+
|
|
170
|
+
// ------- align 对齐方式 -------
|
|
171
|
+
// #region
|
|
172
|
+
get align() {
|
|
173
|
+
return this.getAttribute('align') || 'left';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
set align(value) {
|
|
177
|
+
this.setAttribute('align', value);
|
|
178
|
+
|
|
179
|
+
this.#timePickerInput.shadowRoot.querySelector('input').style.textAlign = value;
|
|
180
|
+
}
|
|
181
|
+
// #endregion
|
|
182
|
+
// ------- end -------
|
|
183
|
+
|
|
184
|
+
// ------- limit-range-start 限制起始时间 -------
|
|
185
|
+
// #region
|
|
186
|
+
get limitRangeStart() {
|
|
187
|
+
const attr = this.getAttribute('limit-range-start');
|
|
188
|
+
if (!attr) return "00:00:00";
|
|
189
|
+
else {
|
|
190
|
+
const [hour, minute, second] = this.getAttribute('limit-range-start')?.split(':');
|
|
191
|
+
return `${this.#handleLessThanTen(hour)}:${this.#handleLessThanTen(minute)}:${this.#handleLessThanTen(second)}`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
set limitRangeStart(value) {
|
|
196
|
+
this.setAttribute('limit-range-start', value);
|
|
197
|
+
}
|
|
198
|
+
// #endregion
|
|
199
|
+
// ------- end -------
|
|
200
|
+
|
|
201
|
+
// ------- limit-range-end 限制结束时间 -------
|
|
202
|
+
// #region
|
|
203
|
+
get limitRangeEnd() {
|
|
204
|
+
const attr = this.getAttribute('limit-range-end');
|
|
205
|
+
if (!attr) return "23:59:59"
|
|
206
|
+
else {
|
|
207
|
+
const [hour, minute, second] = this.getAttribute('limit-range-end')?.split(':');
|
|
208
|
+
return `${this.#handleLessThanTen(hour)}:${this.#handleLessThanTen(minute)}:${this.#handleLessThanTen(second)}`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
set limitRangeEnd(value) {
|
|
213
|
+
this.setAttribute('limit-range-end', value);
|
|
214
|
+
}
|
|
215
|
+
// #endregion
|
|
216
|
+
// ------- end -------
|
|
217
|
+
|
|
218
|
+
#handleLessThanTen(num, defaultNum = '00') {
|
|
219
|
+
num = Number(num);
|
|
220
|
+
return num < 10 ? `0${num}` : (num || defaultNum);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
#handleTimeItemPicker(wrap, value) {
|
|
224
|
+
wrap.querySelectorAll('li').forEach(li => {
|
|
225
|
+
if (Number(li.innerText) === Number(this.#handleLessThanTen(value))) li.click();
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
#initElementsStyle() {
|
|
230
|
+
this.#dropdownWrap.style.width = this.#timePickerInput.getBoundingClientRect().width + "px";
|
|
231
|
+
|
|
232
|
+
timeout(() => {
|
|
233
|
+
this.#container.classList.add('with-transition');
|
|
234
|
+
}, 50);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
#handleTimeItemClickEvent(li, index, timeItemWrap, type) {
|
|
238
|
+
li.addEventListener('click', () => {
|
|
239
|
+
const lis = timeItemWrap.querySelectorAll('li');
|
|
240
|
+
lis.forEach(li => {
|
|
241
|
+
li.classList.remove('is-active');
|
|
242
|
+
});
|
|
243
|
+
li.classList.add('is-active');
|
|
244
|
+
|
|
245
|
+
const value = this.#handleLessThanTen(index);
|
|
246
|
+
switch (type) {
|
|
247
|
+
case 'hour':
|
|
248
|
+
this.hour = value;
|
|
249
|
+
break;
|
|
250
|
+
case 'minute':
|
|
251
|
+
this.minute = value;
|
|
252
|
+
break;
|
|
253
|
+
case 'second':
|
|
254
|
+
this.second = value;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (this.#timePickerIsInit) this.dispatchEvent(new CustomEvent('change', { detail: { time: this.time } }));
|
|
259
|
+
|
|
260
|
+
this.#timePickerInput.value = `${this.hour}:${this.minute}:${this.second}`;
|
|
261
|
+
this.time = `${this.hour}:${this.minute}:${this.second}`;
|
|
262
|
+
|
|
263
|
+
const top = li.getBoundingClientRect().height * index;
|
|
264
|
+
timeItemWrap.scrollTo({
|
|
265
|
+
top,
|
|
266
|
+
behavior: 'smooth',
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
#handleTimeWrapScroll(wrap) {
|
|
272
|
+
wrap.addEventListener('wheel', () => {
|
|
273
|
+
timeout(() => {
|
|
274
|
+
const lis = wrap.querySelectorAll('li');
|
|
275
|
+
const height = lis[0].getBoundingClientRect().height;
|
|
276
|
+
const { scrollTop } = wrap
|
|
277
|
+
const index = Math.floor(scrollTop / height);
|
|
278
|
+
|
|
279
|
+
if (lis[index]) lis[index].click();
|
|
280
|
+
}, 100);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
#initTimerPickerTimeItem() {
|
|
285
|
+
const [startHour, startMinute, startSecond] = this.limitRangeStart.split(':');
|
|
286
|
+
const [endHour, endMinute, endSecond] = this.limitRangeEnd.split(':');
|
|
287
|
+
|
|
288
|
+
const todayDate = new Date();
|
|
289
|
+
const startDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate(), startHour, startMinute, startSecond);
|
|
290
|
+
const endDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate(), endHour, endMinute, endSecond);
|
|
291
|
+
if (startDate > endDate) throw new Error('limit-range-start must be less than limit-range-end');
|
|
292
|
+
|
|
293
|
+
const initTimeItem = (startTime, endTime, wrap, type) => {
|
|
294
|
+
startTime = Number(startTime);
|
|
295
|
+
endTime = Number(endTime);
|
|
296
|
+
let start = 0;
|
|
297
|
+
let end = 0;
|
|
298
|
+
|
|
299
|
+
switch (type) {
|
|
300
|
+
case 'hour':
|
|
301
|
+
start = 0;
|
|
302
|
+
end = 23;
|
|
303
|
+
break;
|
|
304
|
+
default:
|
|
305
|
+
start = 0;
|
|
306
|
+
end = 59;
|
|
307
|
+
if (!String(startTime).localeCompare(endTime) && (startHour !== endHour)) endTime = endTime === 0 ? 59 : endTime;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
for (let i = start; i <= end; i++) {
|
|
311
|
+
const li = createElement('li', 'ea-time-picker_dropdown-item');
|
|
312
|
+
li.innerText = this.#handleLessThanTen(i);
|
|
313
|
+
wrap.appendChild(li);
|
|
314
|
+
|
|
315
|
+
if (i >= startTime && i <= endTime) this.#handleTimeItemClickEvent(li, i, wrap, type);
|
|
316
|
+
else li.classList.add('is-disabled');
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
initTimeItem(startHour, endHour, this.#timePickerHourWrap, 'hour');
|
|
321
|
+
initTimeItem(startMinute, endMinute, this.#timePickerMinuteWrap, 'minute');
|
|
322
|
+
initTimeItem(startSecond, endSecond, this.#timePickerSecondWrap, 'second');
|
|
323
|
+
|
|
324
|
+
this.#handleTimeWrapScroll(this.#timePickerHourWrap);
|
|
325
|
+
this.#handleTimeWrapScroll(this.#timePickerMinuteWrap);
|
|
326
|
+
this.#handleTimeWrapScroll(this.#timePickerSecondWrap);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
#initToggleDropdownWrapShow() {
|
|
330
|
+
let timePickerIsInit = false;
|
|
331
|
+
|
|
332
|
+
const dropdownWrapInitCallback = () => {
|
|
333
|
+
this.time = this.time;
|
|
334
|
+
timePickerIsInit = true;
|
|
335
|
+
this.#timePickerIsInit = true;
|
|
336
|
+
this.#dropdownWrap.removeEventListener('transitionend', dropdownWrapInitCallback);
|
|
337
|
+
}
|
|
338
|
+
this.#timePickerInput.addEventListener('focus', () => {
|
|
339
|
+
this.#container.classList.add('is-open');
|
|
340
|
+
|
|
341
|
+
if (!timePickerIsInit) this.#dropdownWrap.addEventListener('transitionend', dropdownWrapInitCallback);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
window.addEventListener('click', (e) => {
|
|
345
|
+
if (!this.contains(e.target)) {
|
|
346
|
+
this.#container.classList.remove('is-open');
|
|
347
|
+
} else {
|
|
348
|
+
this.#timePickerInput.shadowRoot.querySelector('.ea-input_inner').focus();
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
connectedCallback() {
|
|
354
|
+
this.setAttribute('data-ea-component', true);
|
|
355
|
+
|
|
356
|
+
this.name = this.name;
|
|
357
|
+
|
|
358
|
+
this.width = this.width;
|
|
359
|
+
|
|
360
|
+
this.disabled = this.disabled;
|
|
361
|
+
|
|
362
|
+
this.align = this.align;
|
|
363
|
+
|
|
364
|
+
this.limitRangeStart = this.limitRangeStart;
|
|
365
|
+
this.limitRangeEnd = this.limitRangeEnd;
|
|
366
|
+
|
|
367
|
+
this.#initElementsStyle();
|
|
368
|
+
this.#initTimerPickerTimeItem();
|
|
369
|
+
|
|
370
|
+
this.time = this.time;
|
|
371
|
+
this.#timePickerInput.value = `${this.hour}:${this.minute}:${this.second}`;
|
|
372
|
+
|
|
373
|
+
this.#initToggleDropdownWrapShow();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (!customElements.get('ea-time-picker')) {
|
|
378
|
+
customElements.define('ea-time-picker', EaTimePicker);
|
|
379
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
.ea-time-picker_wrap {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.ea-time-picker_dropdown-wrap {
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: -12px;
|
|
7
|
+
left: 0;
|
|
8
|
+
transform-origin: center top;
|
|
9
|
+
transform: translateY(100%) scaleY(0);
|
|
10
|
+
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
15
|
+
|
|
16
|
+
z-index: 2;
|
|
17
|
+
|
|
18
|
+
&::before {
|
|
19
|
+
content: "";
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
left: 0.5rem;
|
|
23
|
+
border: 0.5rem solid transparent;
|
|
24
|
+
border-bottom-color: #fff;
|
|
25
|
+
|
|
26
|
+
transform: translateY(-100%);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ea-time-picker_dropdown-inner-wrap {
|
|
30
|
+
display: flex;
|
|
31
|
+
position: relative;
|
|
32
|
+
margin: 1rem 0;
|
|
33
|
+
|
|
34
|
+
&::before,
|
|
35
|
+
&::after {
|
|
36
|
+
content: "";
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 0;
|
|
39
|
+
|
|
40
|
+
transform: translateY(-50%);
|
|
41
|
+
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::before {
|
|
46
|
+
top: calc(50% - 16px);
|
|
47
|
+
border-bottom: 1px solid #e4e7ed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&::after {
|
|
51
|
+
top: calc(50% + 16px);
|
|
52
|
+
border-bottom: 1px solid #e4e7ed;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ea-time-picker_dropdown-inner {
|
|
56
|
+
flex: 1;
|
|
57
|
+
max-height: 190px;
|
|
58
|
+
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
padding: 5rem 0;
|
|
61
|
+
|
|
62
|
+
text-align: center;
|
|
63
|
+
|
|
64
|
+
overflow: auto;
|
|
65
|
+
scrollbar-width: none;
|
|
66
|
+
|
|
67
|
+
margin-block-start: 0;
|
|
68
|
+
margin-block-end: 0;
|
|
69
|
+
margin-inline-start: 0px;
|
|
70
|
+
margin-inline-end: 0px;
|
|
71
|
+
padding-inline-start: 0px;
|
|
72
|
+
list-style-type: none;
|
|
73
|
+
|
|
74
|
+
.ea-time-picker_dropdown-item {
|
|
75
|
+
height: 32px;
|
|
76
|
+
line-height: 32px;
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
color: #606266;
|
|
79
|
+
transition: color 0.3s;
|
|
80
|
+
|
|
81
|
+
&.is-active {
|
|
82
|
+
color: #409eff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.is-disabled {
|
|
86
|
+
color: #c0c4cc;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ea-time-picker_dropdown-button-group {
|
|
93
|
+
text-align: right;
|
|
94
|
+
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
|
|
95
|
+
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.is-open {
|
|
100
|
+
.ea-time-picker_dropdown-wrap {
|
|
101
|
+
transform: translateY(100%) scaleY(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.with-transition {
|
|
106
|
+
.ea-time-picker_dropdown-wrap {
|
|
107
|
+
transition: transform 0.3s ease-in-out;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|