easy-component-ui 2.1.0 → 3.0.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 -21
- package/README.md +162 -90
- package/dist/assets/icon.css +1 -0
- package/dist/components/Base.js +872 -0
- package/dist/components/ea-alert.js +196 -0
- package/dist/components/ea-avatar.js +159 -0
- package/dist/components/ea-backtop.js +136 -0
- package/dist/components/ea-badge.js +144 -0
- package/dist/components/ea-breadcrumb.js +148 -0
- package/dist/components/ea-button.js +261 -0
- package/dist/components/ea-calendar.js +10 -0
- package/dist/components/ea-calendar2.js +673 -0
- package/dist/components/ea-card.js +85 -0
- package/dist/components/ea-carousel.js +374 -0
- package/dist/components/ea-checkbox.js +446 -0
- package/dist/components/ea-collapse.js +293 -0
- package/dist/components/ea-color-picker.js +888 -0
- package/dist/components/ea-container.js +177 -0
- package/dist/components/ea-countdown.js +121 -0
- package/dist/components/ea-date-picker.js +649 -0
- package/dist/components/ea-descriptions.js +411 -0
- package/dist/components/ea-dialog.js +249 -0
- package/dist/components/ea-drawer.js +194 -0
- package/dist/components/ea-dropdown.js +228 -0
- package/dist/components/ea-empty.js +85 -0
- package/dist/components/ea-icon.js +68 -0
- package/dist/components/ea-image-preview.js +488 -0
- package/dist/components/ea-image.js +302 -0
- package/dist/components/ea-infinite-scroll.js +109 -0
- package/dist/components/ea-input-number.js +367 -0
- package/dist/components/ea-input.js +588 -0
- package/dist/components/ea-layout.js +125 -0
- package/dist/components/ea-link.js +95 -0
- package/dist/components/ea-loading.js +151 -0
- package/dist/components/ea-menu.js +417 -0
- package/dist/components/ea-message-box.js +624 -0
- package/dist/components/ea-message.js +251 -0
- package/dist/components/ea-notification.js +331 -0
- package/dist/components/ea-overlay.js +161 -0
- package/dist/components/ea-page-header.js +108 -0
- package/dist/components/ea-pagination.js +480 -0
- package/dist/components/ea-popconfirm.js +220 -0
- package/dist/components/ea-popover.js +123 -0
- package/dist/components/ea-popper.js +203 -0
- package/dist/components/ea-progress.js +269 -0
- package/dist/components/ea-radio.js +364 -0
- package/dist/components/ea-rate.js +241 -0
- package/dist/components/ea-result.js +100 -0
- package/dist/components/ea-scrollbar.js +235 -0
- package/dist/components/ea-segmented.js +215 -0
- package/dist/components/ea-select.js +598 -0
- package/dist/components/ea-skeleton.js +246 -0
- package/dist/components/ea-slider.js +421 -0
- package/dist/components/ea-space.js +109 -0
- package/dist/components/ea-splitter.js +217 -0
- package/dist/components/ea-statistic.js +6 -0
- package/dist/components/ea-statistic2.js +83 -0
- package/dist/components/ea-steps.js +312 -0
- package/dist/components/ea-switch.js +271 -0
- package/dist/components/ea-table.js +1007 -0
- package/dist/components/ea-tabs.js +501 -0
- package/dist/components/ea-tag.js +234 -0
- package/dist/components/ea-text.js +103 -0
- package/dist/components/ea-time-picker.js +514 -0
- package/dist/components/ea-timeline.js +186 -0
- package/dist/components/ea-tooltip.js +121 -0
- package/dist/components/ea-tour.js +544 -0
- package/dist/components/ea-transfer.js +949 -0
- package/dist/components/ea-tree.js +1088 -0
- package/dist/components/index.js +61 -0
- package/dist/core/FormBase.js +238 -0
- package/dist/css/ea-alert.style.js +4 -0
- package/dist/css/ea-aside.style.js +4 -0
- package/dist/css/ea-avatar.style.js +4 -0
- package/dist/css/ea-backtop.style.js +4 -0
- package/dist/css/ea-badge.style.js +4 -0
- package/dist/css/ea-breadcrumb-item.style.js +4 -0
- package/dist/css/ea-breadcrumb.style.js +4 -0
- package/dist/css/ea-button-group.style.js +4 -0
- package/dist/css/ea-button.style.js +4 -0
- package/dist/css/ea-calendar.style.js +4 -0
- package/dist/css/ea-card.style.js +4 -0
- package/dist/css/ea-carousel-item.style.js +4 -0
- package/dist/css/ea-carousel.style.js +4 -0
- package/dist/css/ea-check-tag.style.js +4 -0
- package/dist/css/ea-checkbox-group.style.js +4 -0
- package/dist/css/ea-checkbox.style.js +4 -0
- package/dist/css/ea-col.style.js +4 -0
- package/dist/css/ea-collapse-item.style.js +4 -0
- package/dist/css/ea-collapse.style.js +4 -0
- package/dist/css/ea-color-picker-panel.style.js +4 -0
- package/dist/css/ea-color-picker.style.js +4 -0
- package/dist/css/ea-container.style.js +4 -0
- package/dist/css/ea-date-picker.style.js +4 -0
- package/dist/css/ea-descriptions-item.style.js +4 -0
- package/dist/css/ea-descriptions.style.js +4 -0
- package/dist/css/ea-dialog.style.js +4 -0
- package/dist/css/ea-drawer.style.js +4 -0
- package/dist/css/ea-dropdown-item.style.js +4 -0
- package/dist/css/ea-dropdown-menu.style.js +4 -0
- package/dist/css/ea-dropdown.style.js +4 -0
- package/dist/css/ea-empty.style.js +4 -0
- package/dist/css/ea-footer.style.js +4 -0
- package/dist/css/ea-header.style.js +4 -0
- package/dist/css/ea-icon.style.js +4 -0
- package/dist/css/ea-image-preview.style.js +4 -0
- package/dist/css/ea-image.style.js +4 -0
- package/dist/css/ea-infinite-scroll.style.js +4 -0
- package/dist/css/ea-input-number.style.js +4 -0
- package/dist/css/ea-input.style.js +4 -0
- package/dist/css/ea-link.style.js +4 -0
- package/dist/css/ea-main.style.js +4 -0
- package/dist/css/ea-menu-item-group.style.js +4 -0
- package/dist/css/ea-menu-item.style.js +4 -0
- package/dist/css/ea-menu.style.js +4 -0
- package/dist/css/ea-message-box.style.js +4 -0
- package/dist/css/ea-message.style.js +4 -0
- package/dist/css/ea-notification.style.js +4 -0
- package/dist/css/ea-option-gropu.style.js +4 -0
- package/dist/css/ea-option.style.js +4 -0
- package/dist/css/ea-overlay.style.js +4 -0
- package/dist/css/ea-page-header.style.js +4 -0
- package/dist/css/ea-pagination.style.js +4 -0
- package/dist/css/ea-popconfirm.style.js +4 -0
- package/dist/css/ea-popover.style.js +4 -0
- package/dist/css/ea-popper.style.js +4 -0
- package/dist/css/ea-progress.style.js +4 -0
- package/dist/css/ea-radio-group.style.js +4 -0
- package/dist/css/ea-radio.style.js +4 -0
- package/dist/css/ea-rate.style.js +4 -0
- package/dist/css/ea-result.style.js +4 -0
- package/dist/css/ea-row.style.js +4 -0
- package/dist/css/ea-scrollbar.style.js +4 -0
- package/dist/css/ea-segmented.style.js +4 -0
- package/dist/css/ea-select.style.js +4 -0
- package/dist/css/ea-skeleton-item.style.js +4 -0
- package/dist/css/ea-skeleton.style.js +4 -0
- package/dist/css/ea-slider.style.js +4 -0
- package/dist/css/ea-space.style.js +4 -0
- package/dist/css/ea-splitter-bar.style.js +4 -0
- package/dist/css/ea-splitter-panel.style.js +4 -0
- package/dist/css/ea-splitter.style.js +4 -0
- package/dist/css/ea-statistic.style.js +4 -0
- package/dist/css/ea-step.style.js +4 -0
- package/dist/css/ea-steps.style.js +4 -0
- package/dist/css/ea-sub-menu.style.js +4 -0
- package/dist/css/ea-switch.style.js +4 -0
- package/dist/css/ea-tab-panel.style.js +4 -0
- package/dist/css/ea-tab.style.js +4 -0
- package/dist/css/ea-table.style.js +4 -0
- package/dist/css/ea-tabs.style.js +4 -0
- package/dist/css/ea-tag.style.js +4 -0
- package/dist/css/ea-text.style.js +4 -0
- package/dist/css/ea-time-picker.style.js +4 -0
- package/dist/css/ea-timeline-item.style.js +4 -0
- package/dist/css/ea-timeline.style.js +4 -0
- package/dist/css/ea-tooltip.style.js +4 -0
- package/dist/css/ea-tour-step.style.js +4 -0
- package/dist/css/ea-tour.style.js +4 -0
- package/dist/css/ea-transfer.style.js +5 -0
- package/dist/css/ea-tree.style.js +6 -0
- package/dist/css/ea-ui-component.style.js +4 -0
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +439 -0
- package/dist/utils/I18nManager.js +218 -0
- package/dist/utils/Utils.js +65 -0
- package/dist/utils/Variables.js +19 -0
- package/dist/utils/timeout.js +9 -0
- package/package.json +294 -11
- package/build/components/Base.js +0 -1
- package/build/components/ea-alert/index.js +0 -1
- package/build/components/ea-alert/src/style/stylesheet.js +0 -1
- package/build/components/ea-aside/index.js +0 -1
- package/build/components/ea-avatar/index.js +0 -1
- package/build/components/ea-avatar/src/assets/defaultAvatar.js +0 -1
- package/build/components/ea-avatar/src/assets/errorAvatar.js +0 -1
- package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -1
- package/build/components/ea-avatar/src/style/stylesheet.js +0 -1
- package/build/components/ea-backtop/index.js +0 -1
- package/build/components/ea-backtop/src/style/stylesheet.js +0 -1
- package/build/components/ea-badge/index.js +0 -1
- package/build/components/ea-badge/src/style/stylesheet.js +0 -1
- package/build/components/ea-breadcrumb/index.js +0 -1
- package/build/components/ea-breadcrumb/src/style/stylesheet.js +0 -1
- package/build/components/ea-breadcrumb-item/index.js +0 -1
- package/build/components/ea-breadcrumb-item/src/style/style.js +0 -1
- package/build/components/ea-button/index.js +0 -1
- package/build/components/ea-button/src/components/ButtonComm.js +0 -1
- package/build/components/ea-button/src/components/HrefComm.js +0 -1
- package/build/components/ea-button/src/style/stylesheet.js +0 -1
- package/build/components/ea-button-group/index.js +0 -1
- package/build/components/ea-button-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-calendar/index.js +0 -1
- package/build/components/ea-calendar/src/style/stylesheet.js +0 -1
- package/build/components/ea-calendar/src/utils/createChangerElement.js +0 -1
- package/build/components/ea-calendar/src/utils/createThead.js +0 -1
- package/build/components/ea-calendar/src/utils/getDate.js +0 -1
- package/build/components/ea-calendar/src/utils/getUserWeekStart.js +0 -1
- package/build/components/ea-card/index.js +0 -1
- package/build/components/ea-card/src/style/stylesheet.js +0 -1
- package/build/components/ea-carousel/index.js +0 -1
- package/build/components/ea-carousel/src/style/stylesheet.js +0 -1
- package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -1
- package/build/components/ea-carousel-item/index.js +0 -1
- package/build/components/ea-carousel-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-checkbox/index.js +0 -1
- package/build/components/ea-checkbox/src/style/stylesheet.js +0 -1
- package/build/components/ea-checkbox-group/index.js +0 -1
- package/build/components/ea-checkbox-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-collapse/index.js +0 -1
- package/build/components/ea-collapse-item/index.js +0 -1
- package/build/components/ea-collapse-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-container/index.js +0 -1
- package/build/components/ea-date-picker/index.js +0 -1
- package/build/components/ea-date-picker/src/style/stylesheet.js +0 -1
- package/build/components/ea-descriptions/index.js +0 -1
- package/build/components/ea-descriptions/src/components/contentTemplate.js +0 -1
- package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -1
- package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -1
- package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -1
- package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -1
- package/build/components/ea-descriptions/src/style/stylesheet.js +0 -1
- package/build/components/ea-descriptions-item/index.js +0 -1
- package/build/components/ea-descriptions-item/src/stylesheet.js +0 -1
- package/build/components/ea-drawer/index.js +0 -1
- package/build/components/ea-drawer/src/style/stylesheet.js +0 -1
- package/build/components/ea-empty/index.js +0 -1
- package/build/components/ea-empty/src/assets/emptyStatusSVG.js +0 -1
- package/build/components/ea-empty/src/style/stylesheet.js +0 -1
- package/build/components/ea-footer/index.js +0 -1
- package/build/components/ea-form/index.js +0 -1
- package/build/components/ea-form-item/index.js +0 -1
- package/build/components/ea-form-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-header/index.js +0 -1
- package/build/components/ea-icon/config.json +0 -1030
- package/build/components/ea-icon/css/fontello.css +0 -312
- package/build/components/ea-icon/font/fontello.eot +0 -0
- package/build/components/ea-icon/font/fontello.svg +0 -350
- 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 +0 -1
- package/build/components/ea-icon/index.js +0 -1
- package/build/components/ea-image/index.js +0 -1
- package/build/components/ea-image/src/assets/errorImage.js +0 -1
- package/build/components/ea-image/src/style/stylesheet.js +0 -1
- package/build/components/ea-image/src/utils/createPreviewTools.js +0 -1
- package/build/components/ea-infinite-scroll/index.js +0 -1
- package/build/components/ea-infinite-scroll-item/index.js +0 -1
- package/build/components/ea-input/index.js +0 -1
- package/build/components/ea-input/src/components/createFixIcon.js +0 -1
- package/build/components/ea-input/src/components/createSuggestionBoard.js +0 -1
- package/build/components/ea-input/src/components/createWordLimitElement.js +0 -1
- package/build/components/ea-input/src/style/stylesheet.js +0 -1
- package/build/components/ea-input/src/utils/dispatchEvent.js +0 -1
- package/build/components/ea-input/src/utils/handleSearchResult.js +0 -1
- package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -1
- package/build/components/ea-input-number/index.js +0 -1
- package/build/components/ea-input-number/src/style/stylesheet.js +0 -1
- package/build/components/ea-input-number/src/utils/handleCustomEvent.js +0 -1
- package/build/components/ea-link/index.js +0 -1
- package/build/components/ea-link/src/style/stylesheet.js +0 -1
- package/build/components/ea-loading/index.js +0 -1
- package/build/components/ea-loading/src/style/stylesheet.js +0 -1
- package/build/components/ea-main/index.js +0 -1
- package/build/components/ea-menu/index.js +0 -1
- package/build/components/ea-menu/src/style/stylesheet.js +0 -1
- package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -1
- package/build/components/ea-menu-item/index.js +0 -1
- package/build/components/ea-menu-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-menu-item-group/index.js +0 -1
- package/build/components/ea-menu-item-group/src/style/stylesheet.js +0 -1
- package/build/components/ea-message/index.js +0 -1
- package/build/components/ea-message/src/style/stylesheet.js +0 -1
- package/build/components/ea-message/src/utils/MessageClass.js +0 -1
- package/build/components/ea-message-box/index.js +0 -1
- package/build/components/ea-message-box/src/style/stylesheet.js +0 -1
- package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -1
- package/build/components/ea-option/index.js +0 -1
- package/build/components/ea-option/src/style/stylesheet.js +0 -1
- package/build/components/ea-option-gropu/index.js +0 -1
- package/build/components/ea-page-header/index.js +0 -1
- package/build/components/ea-page-header/src/style/stylesheet.js +0 -1
- package/build/components/ea-pagination/index.js +0 -1
- package/build/components/ea-pagination/src/components/getMoreItem.js +0 -1
- package/build/components/ea-pagination/src/components/getPageItem.js +0 -1
- package/build/components/ea-pagination/src/components/getShowTotalItem.js +0 -1
- package/build/components/ea-pagination/src/style/stylesheet.js +0 -1
- package/build/components/ea-pane/index.js +0 -1
- package/build/components/ea-pane/src/stylesheet.js +0 -1
- package/build/components/ea-progress/index.js +0 -1
- package/build/components/ea-progress/src/components/SVGComm.js +0 -1
- package/build/components/ea-progress/src/style/stylesheet.js +0 -1
- package/build/components/ea-radio/index.js +0 -1
- package/build/components/ea-radio/src/style/stylesheet.js +0 -1
- package/build/components/ea-radio-group/index.js +0 -1
- package/build/components/ea-rate/index.js +0 -1
- package/build/components/ea-rate/src/components/rateComm.js +0 -1
- package/build/components/ea-rate/src/style/stylesheet.js +0 -1
- package/build/components/ea-result/index.js +0 -1
- package/build/components/ea-result/src/style/stylesheet.js +0 -1
- package/build/components/ea-select/index.js +0 -1
- package/build/components/ea-select/src/style/stylesheet.js +0 -1
- package/build/components/ea-skeleton/index.js +0 -1
- package/build/components/ea-skeleton/src/style/stylesheet.js +0 -1
- package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -1
- package/build/components/ea-skeleton-item/index.js +0 -1
- package/build/components/ea-skeleton-item/src/assets/imageSVG.js +0 -1
- package/build/components/ea-skeleton-item/src/style/stylesheet.js +0 -1
- package/build/components/ea-step/index.js +0 -1
- package/build/components/ea-step/src/style/stylesheet.js +0 -1
- package/build/components/ea-steps/index.js +0 -1
- package/build/components/ea-steps/src/style/stylesheet.js +0 -1
- package/build/components/ea-submenu/index.js +0 -1
- package/build/components/ea-submenu/src/style/stylesheet.js +0 -1
- package/build/components/ea-switch/index.js +0 -1
- package/build/components/ea-switch/src/style/stylesheet.js +0 -1
- package/build/components/ea-tab/index.js +0 -1
- package/build/components/ea-tab/src/style/stylesheet.js +0 -1
- package/build/components/ea-table/index.js +0 -1
- package/build/components/ea-table/src/style/stylesheet.js +0 -1
- package/build/components/ea-table-column/index.js +0 -1
- package/build/components/ea-tabs/index.js +0 -1
- package/build/components/ea-tabs/src/style/stylesheet.js +0 -1
- package/build/components/ea-tag/index.js +0 -1
- package/build/components/ea-tag/src/style/stylesheet.js +0 -1
- package/build/components/ea-textarea/index.js +0 -1
- package/build/components/ea-textarea/src/style/stylesheet.js +0 -1
- package/build/components/ea-time-picker/index.js +0 -1
- package/build/components/ea-time-picker/src/style/stylesheet.js +0 -1
- package/build/components/ea-timeline/index.js +0 -1
- package/build/components/ea-timeline/style/stylesheet.js +0 -1
- package/build/components/ea-timeline-item/index.js +0 -1
- package/build/components/ea-timeline-item/src/style/stylesheet.js +0 -1
- package/build/components/globalConfig.js +0 -1
- package/build/components/index.js +0 -1
- package/build/utils/Validator.js +0 -1
- package/build/utils/createElement.js +0 -1
- package/build/utils/handleDefaultAttrIsTrue.js +0 -1
- package/build/utils/handleTemplate.js +0 -1
- package/build/utils/setStyle.js +0 -1
- package/build/utils/timeout.js +0 -1
- package/components/Base.js +0 -75
- package/components/ea-alert/index.css +0 -91
- package/components/ea-alert/index.js +0 -210
- package/components/ea-alert/index.scss +0 -108
- package/components/ea-alert/src/style/stylesheet.js +0 -85
- package/components/ea-aside/index.css +0 -9
- package/components/ea-aside/index.js +0 -54
- package/components/ea-aside/index.scss +0 -12
- package/components/ea-avatar/index.css +0 -66
- package/components/ea-avatar/index.js +0 -156
- package/components/ea-avatar/index.scss +0 -59
- package/components/ea-avatar/src/assets/defaultAvatar.js +0 -12
- package/components/ea-avatar/src/assets/errorAvatar.js +0 -9
- package/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -18
- package/components/ea-avatar/src/style/stylesheet.js +0 -61
- package/components/ea-backtop/index.css +0 -27
- package/components/ea-backtop/index.js +0 -167
- package/components/ea-backtop/index.scss +0 -29
- package/components/ea-backtop/src/style/stylesheet.js +0 -21
- package/components/ea-badge/index.css +0 -49
- package/components/ea-badge/index.js +0 -103
- package/components/ea-badge/index.scss +0 -56
- package/components/ea-badge/src/style/stylesheet.js +0 -43
- package/components/ea-breadcrumb/index.css +0 -6
- package/components/ea-breadcrumb/index.js +0 -90
- package/components/ea-breadcrumb/index.scss +0 -7
- package/components/ea-breadcrumb/src/style/stylesheet.js +0 -8
- package/components/ea-breadcrumb-item/index.css +0 -10
- package/components/ea-breadcrumb-item/index.js +0 -23
- package/components/ea-breadcrumb-item/index.scss +0 -12
- package/components/ea-breadcrumb-item/src/style/style.js +0 -12
- package/components/ea-button/index.css +0 -206
- package/components/ea-button/index.js +0 -198
- package/components/ea-button/index.scss +0 -143
- package/components/ea-button/src/components/ButtonComm.js +0 -5
- package/components/ea-button/src/components/HrefComm.js +0 -5
- package/components/ea-button/src/style/stylesheet.js +0 -208
- package/components/ea-button-group/index.css +0 -16
- package/components/ea-button-group/index.js +0 -44
- package/components/ea-button-group/index.scss +0 -20
- package/components/ea-button-group/src/style/stylesheet.js +0 -18
- package/components/ea-calendar/index.css +0 -72
- package/components/ea-calendar/index.js +0 -298
- package/components/ea-calendar/index.scss +0 -106
- package/components/ea-calendar/src/style/stylesheet.js +0 -74
- package/components/ea-calendar/src/utils/createChangerElement.js +0 -10
- package/components/ea-calendar/src/utils/createThead.js +0 -18
- package/components/ea-calendar/src/utils/getDate.js +0 -11
- package/components/ea-calendar/src/utils/getUserWeekStart.js +0 -11
- package/components/ea-card/index.css +0 -25
- package/components/ea-card/index.js +0 -51
- package/components/ea-card/index.scss +0 -24
- package/components/ea-card/src/style/stylesheet.js +0 -19
- package/components/ea-carousel/index.css +0 -103
- package/components/ea-carousel/index.js +0 -222
- package/components/ea-carousel/index.scss +0 -140
- package/components/ea-carousel/src/style/stylesheet.js +0 -105
- package/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -9
- package/components/ea-carousel-item/index.css +0 -20
- package/components/ea-carousel-item/index.js +0 -23
- package/components/ea-carousel-item/index.scss +0 -26
- package/components/ea-carousel-item/src/style/stylesheet.js +0 -22
- package/components/ea-checkbox/index.css +0 -108
- package/components/ea-checkbox/index.js +0 -160
- package/components/ea-checkbox/index.scss +0 -141
- package/components/ea-checkbox/src/style/stylesheet.js +0 -110
- package/components/ea-checkbox-group/index.css +0 -6
- package/components/ea-checkbox-group/index.js +0 -120
- package/components/ea-checkbox-group/index.scss +0 -7
- package/components/ea-checkbox-group/src/style/stylesheet.js +0 -8
- package/components/ea-collapse/index.css +0 -0
- package/components/ea-collapse/index.js +0 -109
- package/components/ea-collapse/index.scss +0 -4
- package/components/ea-collapse-item/index.css +0 -31
- package/components/ea-collapse-item/index.js +0 -111
- package/components/ea-collapse-item/index.scss +0 -46
- package/components/ea-collapse-item/src/style/stylesheet.js +0 -33
- package/components/ea-container/index.css +0 -14
- package/components/ea-container/index.js +0 -85
- package/components/ea-container/index.scss +0 -18
- package/components/ea-date-picker/index.css +0 -17
- package/components/ea-date-picker/index.js +0 -191
- package/components/ea-date-picker/index.scss +0 -29
- package/components/ea-date-picker/src/style/stylesheet.js +0 -19
- package/components/ea-descriptions/index.css +0 -33
- package/components/ea-descriptions/index.js +0 -171
- package/components/ea-descriptions/index.scss +0 -45
- package/components/ea-descriptions/src/components/contentTemplate.js +0 -11
- package/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -6
- package/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -7
- package/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -7
- package/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -8
- package/components/ea-descriptions/src/style/stylesheet.js +0 -35
- package/components/ea-descriptions-item/index.css +0 -21
- package/components/ea-descriptions-item/index.js +0 -71
- package/components/ea-descriptions-item/index.scss +0 -29
- package/components/ea-descriptions-item/src/stylesheet.js +0 -23
- package/components/ea-drawer/index.css +0 -138
- package/components/ea-drawer/index.js +0 -251
- package/components/ea-drawer/index.scss +0 -208
- package/components/ea-drawer/src/style/stylesheet.js +0 -141
- package/components/ea-empty/index.css +0 -30
- package/components/ea-empty/index.js +0 -93
- package/components/ea-empty/index.scss +0 -30
- package/components/ea-empty/src/assets/emptyStatusSVG.js +0 -6
- package/components/ea-empty/src/style/stylesheet.js +0 -24
- package/components/ea-footer/index.css +0 -7
- package/components/ea-footer/index.js +0 -57
- package/components/ea-footer/index.scss +0 -10
- package/components/ea-form/index.css +0 -0
- package/components/ea-form/index.js +0 -121
- package/components/ea-form/index.scss +0 -0
- package/components/ea-form-item/index.css +0 -62
- package/components/ea-form-item/index.js +0 -152
- package/components/ea-form-item/index.scss +0 -83
- package/components/ea-form-item/src/style/stylesheet.js +0 -64
- package/components/ea-header/index.css +0 -7
- package/components/ea-header/index.js +0 -55
- package/components/ea-header/index.scss +0 -10
- package/components/ea-icon/config.json +0 -1030
- package/components/ea-icon/css/fontello.css +0 -312
- package/components/ea-icon/font/fontello.eot +0 -0
- package/components/ea-icon/font/fontello.svg +0 -350
- package/components/ea-icon/font/fontello.ttf +0 -0
- package/components/ea-icon/font/fontello.woff +0 -0
- package/components/ea-icon/font/fontello.woff2 +0 -0
- package/components/ea-icon/index.css +0 -1
- package/components/ea-icon/index.js +0 -84
- package/components/ea-image/index.css +0 -84
- package/components/ea-image/index.js +0 -182
- package/components/ea-image/index.scss +0 -111
- package/components/ea-image/src/assets/errorImage.js +0 -9
- package/components/ea-image/src/assets/errorImage.svg +0 -7
- package/components/ea-image/src/style/stylesheet.js +0 -86
- package/components/ea-image/src/utils/createPreviewTools.js +0 -140
- package/components/ea-infinite-scroll/index.css +0 -0
- package/components/ea-infinite-scroll/index.js +0 -119
- 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 +0 -18
- package/components/ea-infinite-scroll-item/index.scss +0 -0
- package/components/ea-input/index.css +0 -139
- package/components/ea-input/index.js +0 -398
- package/components/ea-input/index.scss +0 -178
- package/components/ea-input/src/components/createFixIcon.js +0 -108
- package/components/ea-input/src/components/createSuggestionBoard.js +0 -43
- package/components/ea-input/src/components/createWordLimitElement.js +0 -18
- package/components/ea-input/src/style/stylesheet.js +0 -141
- package/components/ea-input/src/utils/dispatchEvent.js +0 -9
- package/components/ea-input/src/utils/handleSearchResult.js +0 -9
- package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -31
- package/components/ea-input-number/index.css +0 -120
- package/components/ea-input-number/index.js +0 -308
- package/components/ea-input-number/index.scss +0 -132
- package/components/ea-input-number/src/style/stylesheet.js +0 -122
- package/components/ea-input-number/src/utils/handleCustomEvent.js +0 -5
- package/components/ea-link/index.css +0 -48
- package/components/ea-link/index.js +0 -122
- package/components/ea-link/index.scss +0 -36
- package/components/ea-link/src/style/stylesheet.js +0 -50
- package/components/ea-loading/index.css +0 -38
- package/components/ea-loading/index.js +0 -166
- package/components/ea-loading/index.scss +0 -55
- package/components/ea-loading/src/style/stylesheet.js +0 -40
- package/components/ea-main/index.css +0 -8
- package/components/ea-main/index.js +0 -32
- package/components/ea-main/index.scss +0 -11
- package/components/ea-menu/index.css +0 -19
- package/components/ea-menu/index.js +0 -131
- package/components/ea-menu/index.scss +0 -22
- package/components/ea-menu/src/style/stylesheet.js +0 -21
- package/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -32
- package/components/ea-menu-item/index.css +0 -48
- package/components/ea-menu-item/index.js +0 -130
- package/components/ea-menu-item/index.scss +0 -62
- package/components/ea-menu-item/src/style/stylesheet.js +0 -50
- package/components/ea-menu-item-group/index.css +0 -42
- package/components/ea-menu-item-group/index.js +0 -130
- package/components/ea-menu-item-group/index.scss +0 -60
- package/components/ea-menu-item-group/src/style/stylesheet.js +0 -44
- package/components/ea-message/index.css +0 -47
- package/components/ea-message/index.js +0 -171
- package/components/ea-message/index.scss +0 -70
- package/components/ea-message/src/style/stylesheet.js +0 -48
- package/components/ea-message/src/utils/MessageClass.js +0 -67
- package/components/ea-message-box/index.css +0 -85
- package/components/ea-message-box/index.js +0 -211
- package/components/ea-message-box/index.scss +0 -113
- package/components/ea-message-box/src/style/stylesheet.js +0 -87
- package/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -60
- package/components/ea-option/index.css +0 -24
- package/components/ea-option/index.js +0 -74
- package/components/ea-option/index.scss +0 -31
- package/components/ea-option/src/style/stylesheet.js +0 -26
- package/components/ea-option-gropu/index.css +0 -6
- package/components/ea-option-gropu/index.js +0 -57
- package/components/ea-option-gropu/index.scss +0 -8
- package/components/ea-page-header/index.css +0 -33
- package/components/ea-page-header/index.js +0 -91
- package/components/ea-page-header/index.scss +0 -44
- package/components/ea-page-header/src/style/stylesheet.js +0 -35
- package/components/ea-pagination/index.css +0 -69
- package/components/ea-pagination/index.js +0 -305
- package/components/ea-pagination/index.scss +0 -89
- package/components/ea-pagination/src/components/getMoreItem.js +0 -20
- package/components/ea-pagination/src/components/getPageItem.js +0 -11
- package/components/ea-pagination/src/components/getShowTotalItem.js +0 -7
- package/components/ea-pagination/src/style/stylesheet.js +0 -71
- package/components/ea-pane/index.css +0 -6
- package/components/ea-pane/index.js +0 -52
- package/components/ea-pane/index.scss +0 -7
- package/components/ea-pane/src/stylesheet.js +0 -8
- package/components/ea-progress/index.css +0 -61
- package/components/ea-progress/index.js +0 -249
- package/components/ea-progress/index.scss +0 -74
- package/components/ea-progress/src/components/SVGComm.js +0 -18
- package/components/ea-progress/src/style/stylesheet.js +0 -55
- package/components/ea-radio/index.css +0 -82
- package/components/ea-radio/index.js +0 -137
- package/components/ea-radio/index.scss +0 -119
- package/components/ea-radio/src/style/stylesheet.js +0 -84
- package/components/ea-radio-group/index.css +0 -3
- package/components/ea-radio-group/index.js +0 -96
- package/components/ea-radio-group/index.scss +0 -3
- package/components/ea-rate/index.css +0 -44
- package/components/ea-rate/index.js +0 -243
- package/components/ea-rate/index.scss +0 -55
- package/components/ea-rate/src/components/rateComm.js +0 -20
- package/components/ea-rate/src/style/stylesheet.js +0 -45
- package/components/ea-result/index.css +0 -37
- package/components/ea-result/index.js +0 -109
- package/components/ea-result/index.scss +0 -46
- package/components/ea-result/src/style/stylesheet.js +0 -39
- package/components/ea-select/index.css +0 -47
- package/components/ea-select/index.js +0 -312
- package/components/ea-select/index.scss +0 -70
- package/components/ea-select/src/style/stylesheet.js +0 -49
- package/components/ea-skeleton/index.css +0 -12
- package/components/ea-skeleton/index.js +0 -148
- package/components/ea-skeleton/index.scss +0 -16
- package/components/ea-skeleton/src/style/stylesheet.js +0 -14
- package/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -7
- package/components/ea-skeleton-item/index.css +0 -69
- package/components/ea-skeleton-item/index.js +0 -82
- package/components/ea-skeleton-item/index.scss +0 -107
- package/components/ea-skeleton-item/src/assets/imageSVG.js +0 -8
- package/components/ea-skeleton-item/src/style/stylesheet.js +0 -71
- package/components/ea-step/index.css +0 -84
- package/components/ea-step/index.js +0 -230
- package/components/ea-step/index.scss +0 -110
- package/components/ea-step/src/style/stylesheet.js +0 -86
- package/components/ea-steps/index.css +0 -19
- package/components/ea-steps/index.js +0 -104
- package/components/ea-steps/index.scss +0 -23
- package/components/ea-steps/src/style/stylesheet.js +0 -21
- package/components/ea-submenu/index.css +0 -65
- package/components/ea-submenu/index.js +0 -141
- package/components/ea-submenu/index.scss +0 -88
- package/components/ea-submenu/src/style/stylesheet.js +0 -67
- package/components/ea-switch/index.css +0 -90
- package/components/ea-switch/index.js +0 -189
- package/components/ea-switch/index.scss +0 -117
- package/components/ea-switch/src/style/stylesheet.js +0 -92
- package/components/ea-tab/index.css +0 -68
- package/components/ea-tab/index.js +0 -138
- package/components/ea-tab/index.scss +0 -96
- package/components/ea-tab/src/style/stylesheet.js +0 -70
- package/components/ea-table/index.css +0 -98
- package/components/ea-table/index.js +0 -555
- package/components/ea-table/index.scss +0 -90
- package/components/ea-table/src/style/stylesheet.js +0 -100
- package/components/ea-table-column/index.css +0 -0
- package/components/ea-table-column/index.js +0 -164
- package/components/ea-table-column/index.scss +0 -0
- package/components/ea-tabs/index.css +0 -45
- package/components/ea-tabs/index.js +0 -245
- package/components/ea-tabs/index.scss +0 -64
- package/components/ea-tabs/src/style/stylesheet.js +0 -47
- package/components/ea-tag/index.css +0 -90
- package/components/ea-tag/index.js +0 -107
- package/components/ea-tag/index.scss +0 -71
- package/components/ea-tag/src/style/stylesheet.js +0 -92
- package/components/ea-textarea/index.css +0 -37
- package/components/ea-textarea/index.js +0 -277
- package/components/ea-textarea/index.scss +0 -48
- package/components/ea-textarea/src/style/stylesheet.js +0 -39
- package/components/ea-time-picker/index.css +0 -82
- package/components/ea-time-picker/index.js +0 -379
- package/components/ea-time-picker/index.scss +0 -110
- package/components/ea-time-picker/src/style/stylesheet.js +0 -84
- package/components/ea-timeline/index.css +0 -0
- package/components/ea-timeline/index.js +0 -74
- package/components/ea-timeline/index.scss +0 -1
- package/components/ea-timeline/style/stylesheet.js +0 -3
- package/components/ea-timeline-item/index.css +0 -79
- package/components/ea-timeline-item/index.js +0 -146
- package/components/ea-timeline-item/index.scss +0 -92
- package/components/ea-timeline-item/src/style/stylesheet.js +0 -81
- package/components/ea-ui-base-style.css +0 -0
- package/components/ea-ui-base-style.scss +0 -153
- package/components/globalConfig.js +0 -10
- package/components/index.js +0 -67
- package/public/logo.png +0 -0
- package/utils/Validator.js +0 -16
- package/utils/createElement.js +0 -30
- package/utils/handleDefaultAttrIsTrue.js +0 -11
- package/utils/handleTemplate.js +0 -19
- package/utils/setStyle.js +0 -8
- package/utils/timeout.js +0 -16
|
@@ -0,0 +1,888 @@
|
|
|
1
|
+
var Et = Object.defineProperty;
|
|
2
|
+
var ot = (n) => {
|
|
3
|
+
throw TypeError(n);
|
|
4
|
+
};
|
|
5
|
+
var xt = (n, h, e) => h in n ? Et(n, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[h] = e;
|
|
6
|
+
var D = (n, h, e) => xt(n, typeof h != "symbol" ? h + "" : h, e), tt = (n, h, e) => h.has(n) || ot("Cannot " + e);
|
|
7
|
+
var t = (n, h, e) => (tt(n, h, "read from private field"), e ? e.call(n) : h.get(n)), l = (n, h, e) => h.has(n) ? ot("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(n) : h.set(n, e), d = (n, h, e, a) => (tt(n, h, "write to private field"), a ? a.call(n, e) : h.set(n, e), e), i = (n, h, e) => (tt(n, h, "access private method"), e);
|
|
8
|
+
import { F as Mt } from "../core/FormBase.js";
|
|
9
|
+
import { n as rt } from "./ea-calendar2.js";
|
|
10
|
+
import { C as H } from "../utils/Color.js";
|
|
11
|
+
import { s as kt } from "../css/ea-color-picker.style.js";
|
|
12
|
+
import { E as $t } from "../utils/Variables.js";
|
|
13
|
+
import { B as At } from "./Base.js";
|
|
14
|
+
import { s as Rt } from "../css/ea-color-picker-panel.style.js";
|
|
15
|
+
import "./ea-input.js";
|
|
16
|
+
import { E as G } from "../utils/Utils.js";
|
|
17
|
+
import "./ea-popper.js";
|
|
18
|
+
import "./ea-button.js";
|
|
19
|
+
class Pt extends Event {
|
|
20
|
+
constructor(h) {
|
|
21
|
+
super("ea-active-change", {
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
cancelable: !0,
|
|
24
|
+
composed: !0
|
|
25
|
+
}), this.detail = h;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class qt extends Event {
|
|
29
|
+
constructor(h) {
|
|
30
|
+
super("ea-invalid-color", {
|
|
31
|
+
bubbles: !0,
|
|
32
|
+
composed: !0
|
|
33
|
+
}), this.detail = h;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var W, x, M, $, P, A, J, q, L, f, B, m, v, s, o, lt, nt, ht, ct, et, I, ut, T, dt, pt, st, it, Z, vt, bt;
|
|
37
|
+
class Lt extends At {
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
l(this, o);
|
|
41
|
+
/** @type {HTMLDivElement} */
|
|
42
|
+
l(this, W);
|
|
43
|
+
/** @type {HTMLDivElement} */
|
|
44
|
+
l(this, x);
|
|
45
|
+
/** @type {HTMLDivElement} */
|
|
46
|
+
l(this, M);
|
|
47
|
+
/** @type {HTMLDivElement} */
|
|
48
|
+
l(this, $);
|
|
49
|
+
/** @type {HTMLDivElement} */
|
|
50
|
+
l(this, P);
|
|
51
|
+
/** @type {HTMLDivElement} */
|
|
52
|
+
l(this, A);
|
|
53
|
+
/** @type {HTMLDivElement} */
|
|
54
|
+
l(this, J);
|
|
55
|
+
/** @type {HTMLDivElement} */
|
|
56
|
+
l(this, q);
|
|
57
|
+
/** @type {HTMLDivElement} */
|
|
58
|
+
l(this, L);
|
|
59
|
+
/** @type {HTMLInputElement} */
|
|
60
|
+
l(this, f);
|
|
61
|
+
/** @type {HTMLDivElement} */
|
|
62
|
+
l(this, B);
|
|
63
|
+
l(this, m, new AbortController());
|
|
64
|
+
l(this, v, {
|
|
65
|
+
/** @type {AbortController | null} 饱和度拖拽控制器 */
|
|
66
|
+
saturationMove: null,
|
|
67
|
+
/** @type {AbortController | null} 色调拖拽控制器 */
|
|
68
|
+
hueMove: null,
|
|
69
|
+
/** @type {AbortController | null} 透明度拖拽控制器 */
|
|
70
|
+
alphaMove: null
|
|
71
|
+
});
|
|
72
|
+
l(this, s, {
|
|
73
|
+
/** @type {boolean} 是否首次更新值 */
|
|
74
|
+
isFirstValueUpdate: !1,
|
|
75
|
+
/** @type {number} 色调值 (0-360) */
|
|
76
|
+
hue: 0,
|
|
77
|
+
/** @type {number} 饱和度值 (0-1) */
|
|
78
|
+
saturation: 1,
|
|
79
|
+
/** @type {number} 亮度值 (0-1) */
|
|
80
|
+
value: 1,
|
|
81
|
+
/** @type {number} 透明度值 (0-1) */
|
|
82
|
+
alpha: 1,
|
|
83
|
+
/** @type {import("@/utils/Color").Color} 当前颜色对象 */
|
|
84
|
+
color: new H(),
|
|
85
|
+
/** @type {boolean} 是否正在拖拽 */
|
|
86
|
+
isDragging: !1,
|
|
87
|
+
/** @type {string} 上一个验证通过的颜色值 */
|
|
88
|
+
lastValidValue: ""
|
|
89
|
+
});
|
|
90
|
+
D(this, "state", this.properties({
|
|
91
|
+
value: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "",
|
|
94
|
+
observer: (e) => {
|
|
95
|
+
t(this, s).lastValidValue = e, i(this, o, et).call(this), t(this, I).call(this), i(this, o, Z).call(this);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"color-format": {
|
|
99
|
+
type: ["hsl", "hsv", "hex", "rgb", "rgba"],
|
|
100
|
+
default: () => this.hasAttribute("show-alpha") ? "rgba" : "hex",
|
|
101
|
+
observer: (e) => {
|
|
102
|
+
this.value && (this.value = t(this, s).color.toString(e));
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"show-alpha": {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: !1,
|
|
108
|
+
observer: (e) => {
|
|
109
|
+
this.updateContainerClasslist();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
disabled: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: !1,
|
|
115
|
+
observer: (e) => {
|
|
116
|
+
this.updateContainerClasslist();
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
border: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1,
|
|
122
|
+
observer: (e) => {
|
|
123
|
+
this.updateContainerClasslist();
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
clearable: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: !0,
|
|
129
|
+
observer: (e) => {
|
|
130
|
+
i(this, o, it).call(this);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
D(this, "propStates", this.properties({
|
|
135
|
+
predefine: {
|
|
136
|
+
props: !0,
|
|
137
|
+
type: Array,
|
|
138
|
+
default: [],
|
|
139
|
+
observer: (e) => {
|
|
140
|
+
i(this, o, dt).call(this, e);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
144
|
+
/**
|
|
145
|
+
* 更新饱和度面板的背景颜色
|
|
146
|
+
*/
|
|
147
|
+
l(this, I, () => {
|
|
148
|
+
const e = new H({
|
|
149
|
+
h: t(this, s).hue,
|
|
150
|
+
s: 1,
|
|
151
|
+
v: 1,
|
|
152
|
+
a: 1
|
|
153
|
+
});
|
|
154
|
+
t(this, x).style.setProperty(
|
|
155
|
+
"--ea-color-picker-panel-background-color",
|
|
156
|
+
e.toString(this["color-format"])
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
this.stylesheet = Rt, this.$render();
|
|
160
|
+
}
|
|
161
|
+
static get observedAttributes() {
|
|
162
|
+
return [
|
|
163
|
+
...super.observedAttributes,
|
|
164
|
+
"value",
|
|
165
|
+
"color-format",
|
|
166
|
+
"predefine",
|
|
167
|
+
"show-alpha",
|
|
168
|
+
"disabled",
|
|
169
|
+
"border",
|
|
170
|
+
"clearable"
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
$render() {
|
|
174
|
+
const e = rt("color-picker-panel");
|
|
175
|
+
this.ns = e, this.shadowRoot.innerHTML = this.html(`
|
|
176
|
+
<div class="${e.b()}" part="container">
|
|
177
|
+
<div class="${e.e("wrapper")}" part="wrapper">
|
|
178
|
+
<div class="${e.e("svpanel")}" part="svpanel">
|
|
179
|
+
<div class="${e.e("cursor")} ${e.e("svpanel-cursor")}" part="svpanel-cursor"></div>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="${e.e("hue-slider")} ${e.m("vertical")}" part="hue-slider">
|
|
182
|
+
<div class="${e.e("thumb")} ${e.e("hue-slider-thumb")}" part="hue-slider-thumb"></div>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
<div class="${e.e("alpha-slider")}" part="alpha-slider">
|
|
186
|
+
<div class="${e.e("thumb")} ${e.e("alpha-slider-thumb")}" part="alpha-slider-thumb"></div>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="${e.e("predefine")}" part="predefine">
|
|
189
|
+
<div class="${e.e("colors")}" part="predefine-colors"></div>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="${e.e("footer")}" part="footer">
|
|
192
|
+
<div class="${e.e("text-display")}" part="text-display"></div>
|
|
193
|
+
<ea-input class="${e.e("color-input")}" part="color-input" type="text" size="small"></ea-input>
|
|
194
|
+
<section class="${e.e("append")}" part="append">
|
|
195
|
+
<slot name="footer"></slot>
|
|
196
|
+
</section>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
`), d(this, W, this.shadowRoot.querySelector(e.cb())), d(this, x, this.shadowRoot.querySelector(e.ce("svpanel"))), d(this, M, this.shadowRoot.querySelector(
|
|
200
|
+
e.ce("svpanel-cursor")
|
|
201
|
+
)), d(this, $, this.shadowRoot.querySelector(e.ce("hue-slider"))), d(this, P, this.shadowRoot.querySelector(e.ce("hue-slider-thumb"))), d(this, A, this.shadowRoot.querySelector(e.ce("alpha-slider"))), d(this, J, this.shadowRoot.querySelector(
|
|
202
|
+
e.ce("alpha-slider-bar")
|
|
203
|
+
)), d(this, q, this.shadowRoot.querySelector(
|
|
204
|
+
e.ce("alpha-slider-thumb")
|
|
205
|
+
)), d(this, L, this.shadowRoot.querySelector(e.ce("predefine"))), d(this, f, this.shadowRoot.querySelector(e.ce("color-input"))), d(this, B, this.shadowRoot.querySelector(e.ce("text-display"))), this.updateContainerClasslist(), i(this, o, it).call(this);
|
|
206
|
+
}
|
|
207
|
+
connectedCallback() {
|
|
208
|
+
var e;
|
|
209
|
+
super.connectedCallback(), (e = t(this, m)) == null || e.abort(), d(this, m, new AbortController()), i(this, o, lt).call(this);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* 获取 classlist 列表
|
|
213
|
+
* @return {string} 属性值
|
|
214
|
+
*/
|
|
215
|
+
updateContainerClasslist() {
|
|
216
|
+
const e = this.computedClasslist(
|
|
217
|
+
this.ns.b("container"),
|
|
218
|
+
{},
|
|
219
|
+
{
|
|
220
|
+
disabled: this.disabled,
|
|
221
|
+
border: this.border,
|
|
222
|
+
"show-alpha": this["show-alpha"],
|
|
223
|
+
clearable: this.clearable
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
return t(this, W).className = e, e;
|
|
227
|
+
}
|
|
228
|
+
$beforeUnmounted() {
|
|
229
|
+
var e;
|
|
230
|
+
(e = t(this, m)) == null || e.abort();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
W = new WeakMap(), x = new WeakMap(), M = new WeakMap(), $ = new WeakMap(), P = new WeakMap(), A = new WeakMap(), J = new WeakMap(), q = new WeakMap(), L = new WeakMap(), f = new WeakMap(), B = new WeakMap(), m = new WeakMap(), v = new WeakMap(), s = new WeakMap(), o = new WeakSet(), /**
|
|
234
|
+
* 绑定组件事件监听器
|
|
235
|
+
*/
|
|
236
|
+
lt = function() {
|
|
237
|
+
t(this, x).addEventListener(
|
|
238
|
+
"mousedown",
|
|
239
|
+
i(this, o, nt).bind(this),
|
|
240
|
+
{
|
|
241
|
+
signal: t(this, m).signal
|
|
242
|
+
}
|
|
243
|
+
), t(this, $).addEventListener("mousedown", i(this, o, ht).bind(this), {
|
|
244
|
+
signal: t(this, m).signal
|
|
245
|
+
}), t(this, A).addEventListener(
|
|
246
|
+
"mousedown",
|
|
247
|
+
i(this, o, ct).bind(this),
|
|
248
|
+
{
|
|
249
|
+
signal: t(this, m).signal
|
|
250
|
+
}
|
|
251
|
+
), t(this, f).addEventListener(
|
|
252
|
+
"change",
|
|
253
|
+
i(this, o, ut).bind(this),
|
|
254
|
+
{
|
|
255
|
+
signal: t(this, m).signal
|
|
256
|
+
}
|
|
257
|
+
), t(this, f).addEventListener(
|
|
258
|
+
"blur",
|
|
259
|
+
i(this, o, vt).bind(this),
|
|
260
|
+
{
|
|
261
|
+
signal: t(this, m).signal
|
|
262
|
+
}
|
|
263
|
+
), t(this, L) && t(this, L).addEventListener(
|
|
264
|
+
"click",
|
|
265
|
+
i(this, o, pt).bind(this),
|
|
266
|
+
{
|
|
267
|
+
signal: t(this, m).signal
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}, /**
|
|
271
|
+
* 处理饱和度和值的更新
|
|
272
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
273
|
+
*/
|
|
274
|
+
nt = function(e) {
|
|
275
|
+
var c, b;
|
|
276
|
+
if ((c = t(this, v).saturationMove) == null || c.abort(), (b = t(this, v).hueMove) == null || b.abort(), this.disabled) return;
|
|
277
|
+
e.preventDefault(), t(this, v).saturationMove = new AbortController(), t(this, s).isDragging = !0;
|
|
278
|
+
const a = (u) => {
|
|
279
|
+
const p = t(this, x).getBoundingClientRect(), V = Math.max(0, Math.min(u.clientX - p.left, p.width)), E = Math.max(0, Math.min(u.clientY - p.top, p.height)), C = V / p.width, Q = 1 - E / p.height;
|
|
280
|
+
t(this, s).saturation = C, t(this, s).value = Q, t(this, s).color.setValue({
|
|
281
|
+
h: t(this, s).hue,
|
|
282
|
+
s: C,
|
|
283
|
+
v: Q,
|
|
284
|
+
a: t(this, s).alpha
|
|
285
|
+
}), this.value = t(this, s).color.toString(this["color-format"]), i(this, o, T).call(this), t(this, M).style.left = C * p.width + "px", t(this, M).style.top = (1 - Q) * p.height + "px";
|
|
286
|
+
};
|
|
287
|
+
a(e), window.addEventListener("mousemove", a, {
|
|
288
|
+
signal: t(this, v).saturationMove.signal
|
|
289
|
+
}), window.addEventListener(
|
|
290
|
+
"mouseup",
|
|
291
|
+
() => {
|
|
292
|
+
var u;
|
|
293
|
+
(u = t(this, v).saturationMove) == null || u.abort(), t(this, s).isDragging = !1;
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
signal: t(this, v).saturationMove.signal
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}, /**
|
|
300
|
+
* 处理色调的更新
|
|
301
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
302
|
+
*/
|
|
303
|
+
ht = function(e) {
|
|
304
|
+
var c, b;
|
|
305
|
+
if ((c = t(this, v).hueMove) == null || c.abort(), (b = t(this, v).saturationMove) == null || b.abort(), this.disabled) return;
|
|
306
|
+
e.preventDefault(), t(this, v).hueMove = new AbortController(), t(this, s).isDragging = !0;
|
|
307
|
+
const a = (u) => {
|
|
308
|
+
const p = t(this, $).getBoundingClientRect(), E = (1 - Math.max(0.01, Math.min(u.clientY - p.top, p.height)) / p.height) * 360;
|
|
309
|
+
t(this, s).hue = E, t(this, s).color.setValue({
|
|
310
|
+
h: E,
|
|
311
|
+
s: t(this, s).saturation,
|
|
312
|
+
v: t(this, s).value,
|
|
313
|
+
a: t(this, s).alpha
|
|
314
|
+
}), this.value = t(this, s).color.toString(this["color-format"]), i(this, o, T).call(this), t(this, P).style.top = (1 - E / 360) * p.height + "px", t(this, I).call(this);
|
|
315
|
+
};
|
|
316
|
+
a(e), window.addEventListener("mousemove", a, {
|
|
317
|
+
signal: t(this, v).hueMove.signal
|
|
318
|
+
}), window.addEventListener(
|
|
319
|
+
"mouseup",
|
|
320
|
+
() => {
|
|
321
|
+
var u;
|
|
322
|
+
(u = t(this, v).hueMove) == null || u.abort(), t(this, s).isDragging = !1;
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
signal: t(this, v).hueMove.signal
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}, /**
|
|
329
|
+
* 处理透明度的更新
|
|
330
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
331
|
+
*/
|
|
332
|
+
ct = function(e) {
|
|
333
|
+
var c, b, u;
|
|
334
|
+
if ((c = t(this, v).alphaMove) == null || c.abort(), (b = t(this, v).saturationMove) == null || b.abort(), (u = t(this, v).hueMove) == null || u.abort(), this.disabled) return;
|
|
335
|
+
e.preventDefault(), t(this, v).alphaMove = new AbortController(), t(this, s).isDragging = !0;
|
|
336
|
+
const a = (p) => {
|
|
337
|
+
const V = t(this, A).getBoundingClientRect(), E = Math.max(0, Math.min(p.clientX - V.left, V.width)), C = Number((E / V.width).toFixed(2));
|
|
338
|
+
Math.abs(t(this, s).alpha - C) > 1e-3 && (t(this, s).alpha = C, t(this, s).color.setValue({
|
|
339
|
+
h: t(this, s).hue,
|
|
340
|
+
s: t(this, s).saturation,
|
|
341
|
+
v: t(this, s).value,
|
|
342
|
+
a: C
|
|
343
|
+
}), this.value = t(this, s).color.toString(this["color-format"]), i(this, o, T).call(this), t(this, q).style.left = C * V.width + "px");
|
|
344
|
+
};
|
|
345
|
+
a(e), window.addEventListener("mousemove", a, {
|
|
346
|
+
signal: t(this, v).alphaMove.signal
|
|
347
|
+
}), window.addEventListener(
|
|
348
|
+
"mouseup",
|
|
349
|
+
() => {
|
|
350
|
+
var p;
|
|
351
|
+
(p = t(this, v).alphaMove) == null || p.abort(), t(this, s).isDragging = !1;
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
signal: t(this, v).alphaMove.signal
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}, /**
|
|
358
|
+
* 更新光标位置
|
|
359
|
+
*/
|
|
360
|
+
et = function() {
|
|
361
|
+
if (!t(this, s).isFirstValueUpdate) {
|
|
362
|
+
t(this, s).color.setValue(this.value);
|
|
363
|
+
const e = t(this, s).color.hsvStrToHsvObject(
|
|
364
|
+
t(this, s).color.toHsv(!0)
|
|
365
|
+
);
|
|
366
|
+
if (e) {
|
|
367
|
+
const a = parseInt(e.h), c = e.s, b = e.v, u = e.a ? parseFloat(e.a) : 1;
|
|
368
|
+
t(this, s).hue = a, t(this, s).saturation = c, t(this, s).value = b, t(this, s).alpha = u;
|
|
369
|
+
}
|
|
370
|
+
t(this, s).isFirstValueUpdate = !0;
|
|
371
|
+
}
|
|
372
|
+
if (t(this, M) && t(this, x)) {
|
|
373
|
+
const e = t(this, s).saturation, a = t(this, s).value, c = t(this, x).getBoundingClientRect(), b = G.CSS.px2num(
|
|
374
|
+
this.style.getPropertyValue("--ea-color-picker-panel-svpanel-width")
|
|
375
|
+
) || 280, u = G.CSS.px2num(
|
|
376
|
+
this.style.getPropertyValue("--ea-color-picker-panel-svpanel-height")
|
|
377
|
+
) || 180, p = Math.max(
|
|
378
|
+
0,
|
|
379
|
+
Math.min(c.width, b),
|
|
380
|
+
b
|
|
381
|
+
), V = Math.max(
|
|
382
|
+
0,
|
|
383
|
+
Math.min(c.height, u),
|
|
384
|
+
u
|
|
385
|
+
), E = e * p, C = (1 - a) * V;
|
|
386
|
+
t(this, M).style.left = E + "px", t(this, M).style.top = C + "px";
|
|
387
|
+
}
|
|
388
|
+
if (t(this, P) && t(this, $)) {
|
|
389
|
+
const e = t(this, s).hue, a = t(this, $).getBoundingClientRect(), c = G.CSS.px2num(
|
|
390
|
+
this.style.getPropertyValue(
|
|
391
|
+
"--ea-color-picker-panel-hue-slider-height"
|
|
392
|
+
)
|
|
393
|
+
) || 180, b = Math.max(0, Math.min(a.height, c), c), u = (1 - e / 360) * b;
|
|
394
|
+
t(this, P).style.top = u + "px";
|
|
395
|
+
}
|
|
396
|
+
if (t(this, q) && t(this, A)) {
|
|
397
|
+
const e = t(this, s).alpha, a = t(this, A).getBoundingClientRect(), c = G.CSS.px2num(
|
|
398
|
+
this.style.getPropertyValue(
|
|
399
|
+
"--ea-color-picker-panel-alpha-slider-width"
|
|
400
|
+
)
|
|
401
|
+
) || 280, b = Math.max(0, Math.min(a.width, c), c), u = e * b;
|
|
402
|
+
t(this, q).style.left = u + "px";
|
|
403
|
+
}
|
|
404
|
+
}, I = new WeakMap(), /**
|
|
405
|
+
* 处理颜色输入框变化事件
|
|
406
|
+
* @param {Event} e - 事件对象
|
|
407
|
+
*/
|
|
408
|
+
ut = function(e) {
|
|
409
|
+
const a = e.target.value;
|
|
410
|
+
try {
|
|
411
|
+
const c = new H(a);
|
|
412
|
+
this.value = c.toString(this["color-format"]), i(this, o, T).call(this);
|
|
413
|
+
} catch {
|
|
414
|
+
t(this, f).value = this.value;
|
|
415
|
+
}
|
|
416
|
+
}, /**
|
|
417
|
+
* 触发颜色变化事件
|
|
418
|
+
*/
|
|
419
|
+
T = function() {
|
|
420
|
+
this.dispatchEvent(
|
|
421
|
+
new CustomEvent("change", {
|
|
422
|
+
detail: {
|
|
423
|
+
value: this.value,
|
|
424
|
+
color: t(this, s).color
|
|
425
|
+
},
|
|
426
|
+
bubbles: !0,
|
|
427
|
+
composed: !0
|
|
428
|
+
})
|
|
429
|
+
), this.dispatchEvent(
|
|
430
|
+
new Pt({ value: this.value })
|
|
431
|
+
);
|
|
432
|
+
}, /**
|
|
433
|
+
* 渲染预设颜色列表
|
|
434
|
+
* @param {Array} list - 预设颜色列表
|
|
435
|
+
*/
|
|
436
|
+
dt = function(e) {
|
|
437
|
+
!e || e.length === 0 || (t(this, L).innerHTML = this.html(
|
|
438
|
+
e.map(
|
|
439
|
+
(a) => `
|
|
440
|
+
<div class="${this.ns.e("predefine-color")}"
|
|
441
|
+
part="predefine-color"
|
|
442
|
+
style="background-color: ${a}"
|
|
443
|
+
data-color="${a}"
|
|
444
|
+
></div>
|
|
445
|
+
`
|
|
446
|
+
).join("")
|
|
447
|
+
));
|
|
448
|
+
}, /**
|
|
449
|
+
* 处理预设颜色点击事件
|
|
450
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
451
|
+
*/
|
|
452
|
+
pt = function(e) {
|
|
453
|
+
if (this.disabled) return;
|
|
454
|
+
const a = e.target.closest(this.ns.ce("predefine-color"));
|
|
455
|
+
if (!a) return;
|
|
456
|
+
const c = a.getAttribute("data-color");
|
|
457
|
+
c && i(this, o, st).call(this, c);
|
|
458
|
+
}, /**
|
|
459
|
+
* 根据颜色值更新所有相关状态
|
|
460
|
+
* @param {string} colorValue - 颜色值字符串
|
|
461
|
+
*/
|
|
462
|
+
st = function(e) {
|
|
463
|
+
i(this, o, Z).call(this), this.value = e, t(this, s).color.setValue(e);
|
|
464
|
+
const a = t(this, s).color.hsvStrToHsvObject(
|
|
465
|
+
t(this, s).color.toHsv(!0)
|
|
466
|
+
);
|
|
467
|
+
if (a) {
|
|
468
|
+
const c = parseInt(a.h), b = a.s, u = a.v, p = a.a ? parseFloat(a.a) : 1;
|
|
469
|
+
t(this, s).hue = c, t(this, s).saturation = b, t(this, s).value = u, t(this, s).alpha = p;
|
|
470
|
+
}
|
|
471
|
+
i(this, o, et).call(this), t(this, I).call(this), i(this, o, T).call(this);
|
|
472
|
+
}, /**
|
|
473
|
+
* 更新文字展示模式
|
|
474
|
+
*/
|
|
475
|
+
it = function() {
|
|
476
|
+
!t(this, f) || !t(this, B) || (i(this, o, Z).call(this), this.updateContainerClasslist());
|
|
477
|
+
}, /**
|
|
478
|
+
* 更新颜色输入框的值
|
|
479
|
+
*/
|
|
480
|
+
Z = function() {
|
|
481
|
+
this.clearable && t(this, f) ? t(this, f).setAttribute("value", this.value) : !this.clearable && t(this, B) && (t(this, B).textContent = this.value);
|
|
482
|
+
}, /**
|
|
483
|
+
* 处理颜色输入框blur事件
|
|
484
|
+
* @param {FocusEvent} e - 焦点事件对象
|
|
485
|
+
*/
|
|
486
|
+
vt = function(e) {
|
|
487
|
+
if (!t(this, f)) return;
|
|
488
|
+
const a = t(this, f).getAttribute("value") || "";
|
|
489
|
+
if (!a) {
|
|
490
|
+
this.value = "", t(this, s).lastValidValue = "";
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
i(this, o, bt).call(this, a) ? (t(this, s).lastValidValue = a, i(this, o, st).call(this, a)) : (t(this, f).setAttribute("value", t(this, s).lastValidValue || ""), this.dispatchEvent(
|
|
494
|
+
new qt({ value: a })
|
|
495
|
+
));
|
|
496
|
+
}, /**
|
|
497
|
+
* 验证颜色格式是否合法
|
|
498
|
+
* @param {string} colorValue - 颜色值
|
|
499
|
+
* @returns {boolean} 是否合法
|
|
500
|
+
*/
|
|
501
|
+
bt = function(e) {
|
|
502
|
+
return H.isValidColor(e);
|
|
503
|
+
};
|
|
504
|
+
customElements.get("ea-color-picker-panel") || customElements.define("ea-color-picker-panel", Lt);
|
|
505
|
+
class Bt extends Event {
|
|
506
|
+
constructor() {
|
|
507
|
+
super("ea-clear", { bubbles: !0, composed: !0 });
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
var k, w, F, K, R, U, S, X, Y, _, y, g, N, r, gt, ft, mt, wt, yt, Ct, at, O, z, j, St, Vt;
|
|
511
|
+
class Dt extends Mt {
|
|
512
|
+
constructor() {
|
|
513
|
+
super();
|
|
514
|
+
l(this, r);
|
|
515
|
+
/** @type {HTMLDivElement} */
|
|
516
|
+
l(this, k);
|
|
517
|
+
/** @type {import("@/common/ea-popper").EaPopper} */
|
|
518
|
+
l(this, w);
|
|
519
|
+
/** @type {HTMLDivElement} */
|
|
520
|
+
l(this, F);
|
|
521
|
+
/** @type {HTMLDivElement} */
|
|
522
|
+
l(this, K);
|
|
523
|
+
/** @type {HTMLDivElement} */
|
|
524
|
+
l(this, R);
|
|
525
|
+
/** @type {import("@/components/ea-icon").EaIcon} */
|
|
526
|
+
l(this, U);
|
|
527
|
+
/** @type {import("@/components/ea-color-picker-panel").EaColorPickerPanel} */
|
|
528
|
+
l(this, S);
|
|
529
|
+
/** @type {HTMLLabelElement} */
|
|
530
|
+
l(this, X);
|
|
531
|
+
/** @type {import("@/components/ea-button").EaButton} */
|
|
532
|
+
l(this, Y);
|
|
533
|
+
/** @type {import("@/components/ea-button").EaButton} */
|
|
534
|
+
l(this, _);
|
|
535
|
+
l(this, y, new AbortController());
|
|
536
|
+
l(this, g, {
|
|
537
|
+
/** @type {boolean} 弹窗是否打开 */
|
|
538
|
+
isOpen: !1,
|
|
539
|
+
/** @type {import("@/utils/Color").Color} 当前颜色对象 */
|
|
540
|
+
color: new H(),
|
|
541
|
+
isPanelDefined: !1,
|
|
542
|
+
/** @type {string} 打开面板前的颜色值 */
|
|
543
|
+
previousValue: ""
|
|
544
|
+
});
|
|
545
|
+
l(this, N, {
|
|
546
|
+
/** @type {AbortController | null} 关闭弹窗的控制器 */
|
|
547
|
+
close: null
|
|
548
|
+
});
|
|
549
|
+
D(this, "state", this.properties({
|
|
550
|
+
label: {
|
|
551
|
+
type: String,
|
|
552
|
+
default: "",
|
|
553
|
+
observer: async (e) => {
|
|
554
|
+
t(this, X).textContent = e;
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
value: {
|
|
558
|
+
type: String,
|
|
559
|
+
default: "",
|
|
560
|
+
observer: (e) => {
|
|
561
|
+
i(this, r, z).call(this), i(this, r, j).call(this, e), t(this, S).setAttribute("value", e);
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
disabled: {
|
|
565
|
+
type: Boolean,
|
|
566
|
+
default: !1,
|
|
567
|
+
observer: (e) => {
|
|
568
|
+
this.updateContainerClasslist();
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
clearable: {
|
|
572
|
+
type: Boolean,
|
|
573
|
+
default: !1,
|
|
574
|
+
observer: (e) => {
|
|
575
|
+
this.updateContainerClasslist();
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
size: {
|
|
579
|
+
type: $t,
|
|
580
|
+
default: "",
|
|
581
|
+
observer: (e) => {
|
|
582
|
+
this.updateContainerClasslist();
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
"color-format": {
|
|
586
|
+
type: ["hsl", "hsv", "hex", "rgb"],
|
|
587
|
+
default: "hex",
|
|
588
|
+
observer: (e) => {
|
|
589
|
+
t(this, S).setAttribute("color-format", e);
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"show-alpha": {
|
|
593
|
+
type: Boolean,
|
|
594
|
+
default: !1,
|
|
595
|
+
observer: (e) => {
|
|
596
|
+
t(this, S).setAttribute("show-alpha", e);
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
clearable: {
|
|
600
|
+
type: Boolean,
|
|
601
|
+
default: !0,
|
|
602
|
+
observer: (e) => {
|
|
603
|
+
t(this, S).setAttribute("clearable", e);
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
tabindex: {
|
|
607
|
+
type: Number,
|
|
608
|
+
default: 0,
|
|
609
|
+
observer: (e) => {
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
required: {
|
|
613
|
+
type: Boolean,
|
|
614
|
+
default: !1
|
|
615
|
+
}
|
|
616
|
+
}));
|
|
617
|
+
D(this, "propState", this.properties({
|
|
618
|
+
predefine: {
|
|
619
|
+
props: !0,
|
|
620
|
+
type: Array,
|
|
621
|
+
default: [],
|
|
622
|
+
observer: async (e) => {
|
|
623
|
+
t(this, g).isPanelDefined || (await customElements.whenDefined("ea-color-picker-panel"), t(this, g).isPanelDefined = !0), t(this, S).predefine = e;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}));
|
|
627
|
+
D(this, "popperState", this.properties({
|
|
628
|
+
placement: {
|
|
629
|
+
type: [
|
|
630
|
+
"top",
|
|
631
|
+
"top-start",
|
|
632
|
+
"top-end",
|
|
633
|
+
"bottom",
|
|
634
|
+
"bottom-start",
|
|
635
|
+
"bottom-end",
|
|
636
|
+
"left",
|
|
637
|
+
"left-start",
|
|
638
|
+
"left-end",
|
|
639
|
+
"right",
|
|
640
|
+
"right-start",
|
|
641
|
+
"right-end"
|
|
642
|
+
],
|
|
643
|
+
default: "bottom",
|
|
644
|
+
observer: (e) => {
|
|
645
|
+
t(this, w).setAttribute("placement", e);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}));
|
|
649
|
+
this.stylesheet = kt, this.$render();
|
|
650
|
+
}
|
|
651
|
+
static get observedAttributes() {
|
|
652
|
+
return [
|
|
653
|
+
...super.observedAttributes,
|
|
654
|
+
"label",
|
|
655
|
+
"value",
|
|
656
|
+
"disabled",
|
|
657
|
+
"clearable",
|
|
658
|
+
"size",
|
|
659
|
+
"color-format",
|
|
660
|
+
"predefine",
|
|
661
|
+
"tabindex",
|
|
662
|
+
"placement",
|
|
663
|
+
"show-alpha",
|
|
664
|
+
"required"
|
|
665
|
+
];
|
|
666
|
+
}
|
|
667
|
+
$render() {
|
|
668
|
+
const e = rt("color-picker");
|
|
669
|
+
this.ns = e, this.shadowRoot.innerHTML = this.html(`
|
|
670
|
+
<label class="${e.e("form-label")}" part="form-label"></label>
|
|
671
|
+
<div class="${e.b("container")}" part="container" tabindex="${this.tabindex}">
|
|
672
|
+
<ea-popper
|
|
673
|
+
class="${e.e("popper")}"
|
|
674
|
+
part="popper"
|
|
675
|
+
show-arrow="false"
|
|
676
|
+
>
|
|
677
|
+
<div class="${e.e("trigger")}" part="trigger" slot="reference">
|
|
678
|
+
<div class="${e.e("outer")}" part="outer">
|
|
679
|
+
<div class="${e.e("inner")}" part="inner"></div>
|
|
680
|
+
</div>
|
|
681
|
+
<div class="${e.e("icon-wrapper")}" part="icon-wrapper">
|
|
682
|
+
<ea-icon class="${e.e("icon", "status")}" part="status-icon" icon="icon-cancel"></ea-icon>
|
|
683
|
+
</div>
|
|
684
|
+
</div>
|
|
685
|
+
<ea-color-picker-panel class="${e.e("panel")}" part="panel">
|
|
686
|
+
<div slot="footer" class="${e.e("footer-actions")}" part="footer-actions">
|
|
687
|
+
<ea-button class="${e.e("clear-btn")}" part="clear-btn" plain text>clear</ea-button>
|
|
688
|
+
<ea-button class="${e.e("confirm-btn")}" part="confirm-btn" plain>ok</ea-button>
|
|
689
|
+
</div>
|
|
690
|
+
</ea-color-picker-panel>
|
|
691
|
+
</ea-popper>
|
|
692
|
+
</div>
|
|
693
|
+
`), d(this, X, this.shadowRoot.querySelector(e.ce("form-label"))), d(this, k, this.shadowRoot.querySelector(e.cb())), d(this, w, this.shadowRoot.querySelector(e.ce("popper"))), d(this, F, this.shadowRoot.querySelector(e.ce("trigger"))), d(this, K, this.shadowRoot.querySelector(e.ce("outer"))), d(this, R, this.shadowRoot.querySelector(e.ce("inner"))), d(this, U, this.shadowRoot.querySelector(e.ce("icon", "status"))), d(this, S, this.shadowRoot.querySelector(e.ce("panel"))), d(this, Y, this.shadowRoot.querySelector(this.ns.ce("clear-btn"))), d(this, _, this.shadowRoot.querySelector(this.ns.ce("confirm-btn"))), this.updateContainerClasslist();
|
|
694
|
+
}
|
|
695
|
+
connectedCallback() {
|
|
696
|
+
var e;
|
|
697
|
+
super.connectedCallback(), (e = t(this, y)) == null || e.abort(), d(this, y, new AbortController()), i(this, r, gt).call(this);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* 获取 classlist 列表
|
|
701
|
+
* @return {string} 属性值
|
|
702
|
+
*/
|
|
703
|
+
updateContainerClasslist() {
|
|
704
|
+
const e = this.computedClasslist(
|
|
705
|
+
this.ns.b("container"),
|
|
706
|
+
{
|
|
707
|
+
["--" + this.size]: this.size
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"has-value": this.value,
|
|
711
|
+
disabled: this.disabled
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
return t(this, k).className = e, e;
|
|
715
|
+
}
|
|
716
|
+
$beforeUnmounted() {
|
|
717
|
+
var e;
|
|
718
|
+
(e = t(this, y)) == null || e.abort();
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* 手动显示颜色选择器面板
|
|
722
|
+
*/
|
|
723
|
+
show() {
|
|
724
|
+
i(this, r, at).call(this);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* 手动隐藏颜色选择器面板
|
|
728
|
+
*/
|
|
729
|
+
hide() {
|
|
730
|
+
i(this, r, O).call(this);
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* 使颜色选择器获得焦点
|
|
734
|
+
*/
|
|
735
|
+
focus() {
|
|
736
|
+
t(this, k) && t(this, k).focus();
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* 使颜色选择器失去焦点
|
|
740
|
+
*/
|
|
741
|
+
blur() {
|
|
742
|
+
t(this, k) && t(this, k).blur();
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* 获取验证目标元素
|
|
746
|
+
* @returns {HTMLElement}
|
|
747
|
+
*/
|
|
748
|
+
get validationTarget() {
|
|
749
|
+
return this;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* 更新表单验证状态
|
|
753
|
+
*/
|
|
754
|
+
updateValidity() {
|
|
755
|
+
this.required && !this.value ? this.internals.setValidity(
|
|
756
|
+
{ valueMissing: !0 },
|
|
757
|
+
"请选择一个颜色",
|
|
758
|
+
this
|
|
759
|
+
) : this.internals.setValidity({}, "", this);
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* 检查表单字段的有效性
|
|
763
|
+
* @returns {boolean} 如果字段有效返回 true,否则返回 false
|
|
764
|
+
*/
|
|
765
|
+
checkValidity() {
|
|
766
|
+
return this.updateValidity(), this.internals.checkValidity();
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* 报告表单字段的有效性(显示验证提示)
|
|
770
|
+
* @returns {boolean} 如果字段有效返回 true,否则返回 false
|
|
771
|
+
*/
|
|
772
|
+
reportValidity() {
|
|
773
|
+
return this.updateValidity(), this.internals.reportValidity();
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
k = new WeakMap(), w = new WeakMap(), F = new WeakMap(), K = new WeakMap(), R = new WeakMap(), U = new WeakMap(), S = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), _ = new WeakMap(), y = new WeakMap(), g = new WeakMap(), N = new WeakMap(), r = new WeakSet(), /**
|
|
777
|
+
* 绑定组件事件监听器
|
|
778
|
+
*/
|
|
779
|
+
gt = function() {
|
|
780
|
+
!t(this, F) || !t(this, w) || (t(this, F).addEventListener("click", i(this, r, ft).bind(this), {
|
|
781
|
+
signal: t(this, y).signal
|
|
782
|
+
}), t(this, w).addEventListener("show", i(this, r, mt).bind(this), {
|
|
783
|
+
signal: t(this, y).signal
|
|
784
|
+
}), t(this, w).addEventListener("hide", i(this, r, wt).bind(this), {
|
|
785
|
+
signal: t(this, y).signal
|
|
786
|
+
}), t(this, S).addEventListener("change", i(this, r, yt).bind(this), {
|
|
787
|
+
signal: t(this, y).signal
|
|
788
|
+
}), t(this, Y).addEventListener("click", i(this, r, St).bind(this), {
|
|
789
|
+
signal: t(this, y).signal
|
|
790
|
+
}), t(this, _).addEventListener(
|
|
791
|
+
"click",
|
|
792
|
+
i(this, r, Vt).bind(this),
|
|
793
|
+
{
|
|
794
|
+
signal: t(this, y).signal
|
|
795
|
+
}
|
|
796
|
+
));
|
|
797
|
+
}, /**
|
|
798
|
+
* 处理触发器点击事件
|
|
799
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
800
|
+
*/
|
|
801
|
+
ft = function(e) {
|
|
802
|
+
var a;
|
|
803
|
+
this.disabled || ((a = t(this, N).close) == null || a.abort(), t(this, N).close = new AbortController(), t(this, g).previousValue = this.value, i(this, r, at).call(this), document.addEventListener("click", i(this, r, Ct).bind(this), {
|
|
804
|
+
signal: t(this, N).close.signal
|
|
805
|
+
}));
|
|
806
|
+
}, /**
|
|
807
|
+
* 处理弹窗显示事件
|
|
808
|
+
*/
|
|
809
|
+
mt = function() {
|
|
810
|
+
t(this, g).isOpen = !0, this.updateContainerClasslist();
|
|
811
|
+
}, /**
|
|
812
|
+
* 处理弹窗隐藏事件
|
|
813
|
+
*/
|
|
814
|
+
wt = function() {
|
|
815
|
+
t(this, g).isOpen = !1, this.updateContainerClasslist(), t(this, g).previousValue !== void 0 && t(this, g).previousValue !== this.value && (this.value = t(this, g).previousValue, i(this, r, z).call(this), i(this, r, j).call(this));
|
|
816
|
+
}, /**
|
|
817
|
+
* 处理面板颜色变化事件
|
|
818
|
+
* @param {CustomEvent} e - 自定义事件对象
|
|
819
|
+
*/
|
|
820
|
+
yt = function(e) {
|
|
821
|
+
const { value: a } = e.detail;
|
|
822
|
+
this.value = a, i(this, r, z).call(this), i(this, r, j).call(this);
|
|
823
|
+
}, /**
|
|
824
|
+
* 处理文档点击事件(用于关闭弹窗)
|
|
825
|
+
* @param {MouseEvent} e - 鼠标事件对象
|
|
826
|
+
*/
|
|
827
|
+
Ct = function(e) {
|
|
828
|
+
t(this, g).isOpen && (!this.contains(e.target) || e.target !== this) && i(this, r, O).call(this);
|
|
829
|
+
}, /**
|
|
830
|
+
* 显示颜色选择器弹窗
|
|
831
|
+
*/
|
|
832
|
+
at = function() {
|
|
833
|
+
t(this, w) && t(this, w).show();
|
|
834
|
+
}, /**
|
|
835
|
+
* 隐藏颜色选择器弹窗
|
|
836
|
+
*/
|
|
837
|
+
O = function() {
|
|
838
|
+
t(this, w) && t(this, w).hide();
|
|
839
|
+
}, /**
|
|
840
|
+
* 更新触发元素的背景颜色
|
|
841
|
+
*/
|
|
842
|
+
z = function() {
|
|
843
|
+
if (t(this, R)) {
|
|
844
|
+
if (!this.value) {
|
|
845
|
+
t(this, R).style.setProperty(
|
|
846
|
+
"--ea-color-picker-inner-background-color",
|
|
847
|
+
"transparent"
|
|
848
|
+
);
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
try {
|
|
852
|
+
const e = new H(this.value);
|
|
853
|
+
t(this, R).style.setProperty(
|
|
854
|
+
"--ea-color-picker-inner-background-color",
|
|
855
|
+
e.toRgb(!0)
|
|
856
|
+
);
|
|
857
|
+
} catch {
|
|
858
|
+
t(this, R).style.setProperty(
|
|
859
|
+
"--ea-color-picker-inner-background-color",
|
|
860
|
+
"transparent"
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}, /**
|
|
865
|
+
* 更新状态图标
|
|
866
|
+
* @param {string} colorValue - 颜色值
|
|
867
|
+
*/
|
|
868
|
+
j = function(e = this.value) {
|
|
869
|
+
t(this, U) && t(this, U).setAttribute(
|
|
870
|
+
"icon",
|
|
871
|
+
e ? "icon-angle-down" : "icon-cancel"
|
|
872
|
+
);
|
|
873
|
+
}, /**
|
|
874
|
+
* 处理清除按钮点击事件
|
|
875
|
+
*/
|
|
876
|
+
St = function() {
|
|
877
|
+
this.value = "", i(this, r, z).call(this), i(this, r, j).call(this), this.emit("change", { detail: { value: "" } }), this.dispatchEvent(new Bt()), t(this, g).previousValue = "", i(this, r, O).call(this);
|
|
878
|
+
}, /**
|
|
879
|
+
* 处理确认按钮点击事件
|
|
880
|
+
*/
|
|
881
|
+
Vt = function() {
|
|
882
|
+
t(this, g).previousValue = this.value, i(this, r, O).call(this);
|
|
883
|
+
};
|
|
884
|
+
customElements.get("ea-color-picker") || customElements.define("ea-color-picker", Dt);
|
|
885
|
+
export {
|
|
886
|
+
Dt as EaColorPicker,
|
|
887
|
+
Lt as EaColorPickerPanel
|
|
888
|
+
};
|