easy-component-ui 2.1.1 → 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,1007 @@
|
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var z = (n) => {
|
|
3
|
+
throw TypeError(n);
|
|
4
|
+
};
|
|
5
|
+
var Y = (n, l, e) => l in n ? X(n, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[l] = e;
|
|
6
|
+
var w = (n, l, e) => Y(n, typeof l != "symbol" ? l + "" : l, e), J = (n, l, e) => l.has(n) || z("Cannot " + e);
|
|
7
|
+
var t = (n, l, e) => (J(n, l, "read from private field"), e ? e.call(n) : l.get(n)), b = (n, l, e) => l.has(n) ? z("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(n) : l.set(n, e), k = (n, l, e, s) => (J(n, l, "write to private field"), s ? s.call(n, e) : l.set(n, e), e);
|
|
8
|
+
import { E } from "../utils/Utils.js";
|
|
9
|
+
import { B as Q } from "./Base.js";
|
|
10
|
+
import "./ea-empty.js";
|
|
11
|
+
import { s as Z } from "../css/ea-table.style.js";
|
|
12
|
+
class ee extends Event {
|
|
13
|
+
constructor(l) {
|
|
14
|
+
super("ea-cell-click", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class te extends Event {
|
|
18
|
+
constructor(l) {
|
|
19
|
+
super("ea-current-change", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class se extends Event {
|
|
23
|
+
constructor(l) {
|
|
24
|
+
super("ea-row-click", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class oe extends Event {
|
|
28
|
+
constructor(l) {
|
|
29
|
+
super("ea-select-all", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class ae extends Event {
|
|
33
|
+
constructor(l) {
|
|
34
|
+
super("ea-select", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
class re extends Event {
|
|
38
|
+
constructor(l) {
|
|
39
|
+
super("ea-selection-change", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const ne = (n) => E.EaElement.h(
|
|
43
|
+
"colgroup",
|
|
44
|
+
"ea-table__colgroup",
|
|
45
|
+
{
|
|
46
|
+
part: "colgroup"
|
|
47
|
+
},
|
|
48
|
+
n.map(
|
|
49
|
+
(l) => E.EaElement.h("col", "ea-table__col", {
|
|
50
|
+
width: l.width,
|
|
51
|
+
part: "col"
|
|
52
|
+
})
|
|
53
|
+
)
|
|
54
|
+
), le = (n) => E.EaElement.h(
|
|
55
|
+
"tfoot",
|
|
56
|
+
"ea-table__tfoot",
|
|
57
|
+
{
|
|
58
|
+
part: "tfoot"
|
|
59
|
+
},
|
|
60
|
+
E.EaElement.h(
|
|
61
|
+
"tr",
|
|
62
|
+
"ea-table__tr",
|
|
63
|
+
{
|
|
64
|
+
part: "tfoot-tr"
|
|
65
|
+
},
|
|
66
|
+
n.map(
|
|
67
|
+
(l) => E.EaElement.h(
|
|
68
|
+
"td",
|
|
69
|
+
`ea-table__td ${l.fixed ? ` is-fixed fixed-${l.fixed}` : ""}`,
|
|
70
|
+
{
|
|
71
|
+
part: "tfoot-td",
|
|
72
|
+
"data-scope": l.prop
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
), ie = (n) => E.EaElement.h("span", "ea-table__sort-wrapper", {}, [
|
|
78
|
+
E.EaElement.h("span", null, {}, n),
|
|
79
|
+
E.EaElement.h(
|
|
80
|
+
"span",
|
|
81
|
+
"ea-table__sort",
|
|
82
|
+
{},
|
|
83
|
+
[
|
|
84
|
+
E.EaElement.h("ea-icon", "ea-table__sort-icon", {
|
|
85
|
+
part: "asc-icon",
|
|
86
|
+
icon: "icon-angle-up"
|
|
87
|
+
}),
|
|
88
|
+
E.EaElement.h("ea-icon", "ea-table__sort-icon", {
|
|
89
|
+
part: "desc-icon",
|
|
90
|
+
icon: "icon-angle-down"
|
|
91
|
+
})
|
|
92
|
+
].join("")
|
|
93
|
+
)
|
|
94
|
+
]), ce = () => E.EaElement.h(
|
|
95
|
+
"ea-checkbox",
|
|
96
|
+
"ea-table__checkbox",
|
|
97
|
+
{
|
|
98
|
+
"data-type": "selection",
|
|
99
|
+
part: "checkbox"
|
|
100
|
+
},
|
|
101
|
+
null
|
|
102
|
+
), he = () => "", de = (n) => {
|
|
103
|
+
const l = (c) => c === "selection" ? ce() : c === "index" ? he() : null, e = (c, p) => c ? ie(p) : null;
|
|
104
|
+
let s = null;
|
|
105
|
+
const a = n.label || n.prop || "", r = l(n.type), i = e(n.sortable, a);
|
|
106
|
+
return r ? s = r : i ? s = i : n.header ? s = n.header : s = a, E.EaElement.h(
|
|
107
|
+
"th",
|
|
108
|
+
`ea-table__th${n.fixed ? ` is-fixed fixed-${n.fixed}` : ""}${n.sortable ? " is-sortable" : ""}${n.width ? " is-width" : ""}`.trim(),
|
|
109
|
+
{
|
|
110
|
+
part: "thead-th",
|
|
111
|
+
colspan: n.colspan,
|
|
112
|
+
rowspan: n.rowspan,
|
|
113
|
+
style: [n.width ? `--ea-table-cell-width: ${n.width}` : ""],
|
|
114
|
+
"data-scope": n.prop || ""
|
|
115
|
+
},
|
|
116
|
+
s
|
|
117
|
+
);
|
|
118
|
+
}, ue = (n) => n.map(
|
|
119
|
+
(l) => E.EaElement.h(
|
|
120
|
+
"tr",
|
|
121
|
+
"ea-table__tr is-thead",
|
|
122
|
+
{
|
|
123
|
+
part: "thead-tr"
|
|
124
|
+
},
|
|
125
|
+
l.map(de)
|
|
126
|
+
)
|
|
127
|
+
), pe = (n) => {
|
|
128
|
+
const l = n.reduce((e, s) => (e[s.depth] || (e[s.depth] = []), e[s.depth].push(s), e), []);
|
|
129
|
+
return E.EaElement.h(
|
|
130
|
+
"thead",
|
|
131
|
+
"ea-table__thead",
|
|
132
|
+
{
|
|
133
|
+
part: "thead"
|
|
134
|
+
},
|
|
135
|
+
ue(l)
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
class be extends Event {
|
|
139
|
+
constructor(l) {
|
|
140
|
+
super("ea-sort-change", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
class me extends Event {
|
|
144
|
+
constructor(l) {
|
|
145
|
+
super("ea-cell-mouse-enter", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
class fe extends Event {
|
|
149
|
+
constructor(l) {
|
|
150
|
+
super("ea-cell-mouse-leave", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
class ge extends Event {
|
|
154
|
+
constructor(l) {
|
|
155
|
+
super("ea-cell-dblclick", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
class Ee extends Event {
|
|
159
|
+
constructor(l) {
|
|
160
|
+
super("ea-row-dblclick", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
class ye extends Event {
|
|
164
|
+
constructor(l) {
|
|
165
|
+
super("ea-row-contextmenu", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
class ve extends Event {
|
|
169
|
+
constructor(l) {
|
|
170
|
+
super("ea-cell-contextmenu", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
class we extends Event {
|
|
174
|
+
constructor(l) {
|
|
175
|
+
super("ea-header-contextmenu", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
class xe extends Event {
|
|
179
|
+
constructor(l) {
|
|
180
|
+
super("ea-header-click", { bubbles: !0, composed: !0 }), this.detail = l;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
var f, S, v, q, g, x, d, N, H, A, M, F, L, I, T, B, C, K, P, D, j, W, U, O, G;
|
|
184
|
+
class Ce extends Q {
|
|
185
|
+
constructor() {
|
|
186
|
+
super();
|
|
187
|
+
/** @type {HTMLElement} */
|
|
188
|
+
b(this, f);
|
|
189
|
+
/** @type {HTMLElement} */
|
|
190
|
+
b(this, S);
|
|
191
|
+
/** @type {HTMLElement} */
|
|
192
|
+
b(this, v);
|
|
193
|
+
/** @type {HTMLElement} */
|
|
194
|
+
b(this, q);
|
|
195
|
+
/** @type {AbortController} */
|
|
196
|
+
b(this, g);
|
|
197
|
+
b(this, x, {
|
|
198
|
+
/** @type {AbortController | null} */
|
|
199
|
+
selectionChangeAbortController: null,
|
|
200
|
+
/** @type {AbortController | null} */
|
|
201
|
+
selectAbortController: null
|
|
202
|
+
});
|
|
203
|
+
b(this, d, {
|
|
204
|
+
isDataRendered: !1,
|
|
205
|
+
currentRow: {
|
|
206
|
+
target: null,
|
|
207
|
+
value: {}
|
|
208
|
+
},
|
|
209
|
+
/** @type {import("../ea-table-column/index.js").TableColumnCtx[]} */
|
|
210
|
+
columns: [],
|
|
211
|
+
originData: [],
|
|
212
|
+
dataSource: /* @__PURE__ */ new WeakMap(),
|
|
213
|
+
dataIndex: /* @__PURE__ */ new WeakMap()
|
|
214
|
+
});
|
|
215
|
+
w(this, "state", this.properties({
|
|
216
|
+
stripe: {
|
|
217
|
+
type: Boolean,
|
|
218
|
+
default: !1,
|
|
219
|
+
observer: () => {
|
|
220
|
+
this.updateContainerClasslist();
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
border: {
|
|
224
|
+
type: Boolean,
|
|
225
|
+
default: !1,
|
|
226
|
+
observer: () => {
|
|
227
|
+
this.updateContainerClasslist();
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
height: {
|
|
231
|
+
type: String,
|
|
232
|
+
default: null,
|
|
233
|
+
observer: (e) => {
|
|
234
|
+
this.style.setProperty("--ea-table-height", e), this.updateContainerClasslist();
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"max-height": {
|
|
238
|
+
type: String,
|
|
239
|
+
default: null,
|
|
240
|
+
observer: (e) => {
|
|
241
|
+
this.style.setProperty("--ea-table-max-height", e), this.updateContainerClasslist();
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"highlight-current-row": {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
default: !1,
|
|
247
|
+
observer: () => {
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"show-summary": {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: !1,
|
|
253
|
+
observer: () => {
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}));
|
|
257
|
+
w(this, "propStates", this.properties({
|
|
258
|
+
data: {
|
|
259
|
+
props: !0,
|
|
260
|
+
type: Array,
|
|
261
|
+
default: () => t(this, d).originData,
|
|
262
|
+
observer: (e) => {
|
|
263
|
+
this.setData(e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}));
|
|
267
|
+
w(this, "funcStates", this.properties({
|
|
268
|
+
selectable: {
|
|
269
|
+
props: !0,
|
|
270
|
+
type: Function,
|
|
271
|
+
rawFunction: !0,
|
|
272
|
+
default: null
|
|
273
|
+
},
|
|
274
|
+
indexMethod: {
|
|
275
|
+
props: !0,
|
|
276
|
+
type: Function,
|
|
277
|
+
rawFunction: !0,
|
|
278
|
+
default: () => (e) => e
|
|
279
|
+
},
|
|
280
|
+
summaryMethod: {
|
|
281
|
+
props: !0,
|
|
282
|
+
type: Function,
|
|
283
|
+
rawFunction: !0,
|
|
284
|
+
default: () => (
|
|
285
|
+
/** @param {{columns: ColumnOption, data: any[]}} param */
|
|
286
|
+
(e) => {
|
|
287
|
+
const { columns: s, data: a } = e, r = [];
|
|
288
|
+
return s.forEach((i, c) => {
|
|
289
|
+
if (c === 0) {
|
|
290
|
+
r[c] = "Sum";
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const p = a.map((o) => Number(o[i.prop]));
|
|
294
|
+
p.every((o) => Number.isNaN(o)) ? r[c] = "" : r[c] = p.reduce((o, u) => {
|
|
295
|
+
const m = Number(u);
|
|
296
|
+
return Number.isNaN(m) ? o : o + u;
|
|
297
|
+
}, 0);
|
|
298
|
+
}), r;
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
}
|
|
302
|
+
}));
|
|
303
|
+
/**
|
|
304
|
+
* 渲染表格的基本结构
|
|
305
|
+
*/
|
|
306
|
+
b(this, N, () => {
|
|
307
|
+
const e = [...this.querySelectorAll("ea-table-column")].map(
|
|
308
|
+
(c) => c.getColumnTree
|
|
309
|
+
);
|
|
310
|
+
t(this, d).columns = e;
|
|
311
|
+
const s = ne(e), a = pe(e), r = E.EaElement.h("tbody", "ea-table__tbody", {
|
|
312
|
+
part: "tbody"
|
|
313
|
+
}), i = le(e);
|
|
314
|
+
t(this, f).innerHTML = this.html(`
|
|
315
|
+
<table>
|
|
316
|
+
${s}
|
|
317
|
+
${a}
|
|
318
|
+
${r}
|
|
319
|
+
${i}
|
|
320
|
+
</table>
|
|
321
|
+
<slot class="ea-table__empty" name="empty">No Data</slot>
|
|
322
|
+
`), k(this, S, this.shadowRoot.querySelector(".ea-table__thead")), k(this, v, this.shadowRoot.querySelector(".ea-table__tbody")), k(this, q, this.shadowRoot.querySelector(".ea-table__tfoot"));
|
|
323
|
+
});
|
|
324
|
+
/**
|
|
325
|
+
* 初始化带有筛选的列
|
|
326
|
+
*/
|
|
327
|
+
b(this, H, () => {
|
|
328
|
+
if (![
|
|
329
|
+
...t(this, f).querySelectorAll(".ea-table__th.is-sortable")
|
|
330
|
+
].length) return;
|
|
331
|
+
const s = (a) => {
|
|
332
|
+
const r = a.target.closest(".is-sortable");
|
|
333
|
+
if (!r) return;
|
|
334
|
+
const { prop: i, order: c } = r.dataset;
|
|
335
|
+
if (!i) return;
|
|
336
|
+
const p = c === "asc" ? "desc" : "asc", o = {
|
|
337
|
+
asc: r.querySelector('[part="asc-icon"]'),
|
|
338
|
+
desc: r.querySelector('[part="desc-icon"]')
|
|
339
|
+
};
|
|
340
|
+
r.dataset.order = p, r.querySelectorAll(".ea-table__sort-icon").forEach((u) => {
|
|
341
|
+
u.classList.toggle("is-active", o[p] === u);
|
|
342
|
+
}), this.sort(i, p);
|
|
343
|
+
};
|
|
344
|
+
t(this, S).addEventListener("click", s, {
|
|
345
|
+
signal: t(this, g).signal
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
/**
|
|
349
|
+
* @param {any[]} dataSource
|
|
350
|
+
*/
|
|
351
|
+
w(this, "setData", async (e) => {
|
|
352
|
+
var p;
|
|
353
|
+
const s = document.createDocumentFragment(), a = document.createElement("tr");
|
|
354
|
+
a.part = "tbody-tr", a.className = "ea-table__tr";
|
|
355
|
+
const r = t(this, d).columns.filter(
|
|
356
|
+
(o) => !o.template || o.template instanceof HTMLTemplateElement
|
|
357
|
+
), i = r.some((o) => o.type === "selection"), c = {
|
|
358
|
+
selection: () => this.html(
|
|
359
|
+
E.EaElement.h(
|
|
360
|
+
"ea-checkbox",
|
|
361
|
+
"ea-table__selection",
|
|
362
|
+
{
|
|
363
|
+
"data-type": "selection"
|
|
364
|
+
},
|
|
365
|
+
null
|
|
366
|
+
)
|
|
367
|
+
),
|
|
368
|
+
index: () => this.html(
|
|
369
|
+
E.EaElement.h(
|
|
370
|
+
"span",
|
|
371
|
+
"ea-table__index",
|
|
372
|
+
{
|
|
373
|
+
"data-type": "index"
|
|
374
|
+
},
|
|
375
|
+
null
|
|
376
|
+
)
|
|
377
|
+
)
|
|
378
|
+
};
|
|
379
|
+
for (const o in t(this, x))
|
|
380
|
+
(p = t(this, x)[o]) == null || p.abort(), t(this, x)[o] = new AbortController();
|
|
381
|
+
if (t(this, d).isDataRendered = !1, t(this, v).innerHTML = "", t(this, d).dataSource = /* @__PURE__ */ new WeakMap(), t(this, d).originData = e, r.forEach((o) => {
|
|
382
|
+
var y;
|
|
383
|
+
const u = a, { template: m } = o, h = document.createElement("td");
|
|
384
|
+
h.part = "tbody-td", h.className = "ea-table__td", h.classList.toggle("is-fixed", o.fixed), h.classList.toggle(`fixed-${o.fixed}`, o.fixed), h.classList.toggle(
|
|
385
|
+
`ea-table__cell--align-${o.align}`,
|
|
386
|
+
o.align
|
|
387
|
+
), o.width && h.style.setProperty("--ea-table-cell-width", o.width), m ? h.appendChild(m.content.cloneNode(!0)) : o.type ? h.innerHTML = (y = c[o.type]) == null ? void 0 : y.call(c) : h.dataset.scope = o.prop, u.appendChild(h);
|
|
388
|
+
}), e.forEach((o, u) => {
|
|
389
|
+
const m = a.cloneNode(!0);
|
|
390
|
+
if (m.dataset.index = u, typeof this.selectable == "function") {
|
|
391
|
+
const h = !this.selectable(o);
|
|
392
|
+
m.querySelector(
|
|
393
|
+
'ea-checkbox[data-type="selection"]'
|
|
394
|
+
).toggleAttribute("disabled", h);
|
|
395
|
+
}
|
|
396
|
+
if (r.some((h) => h.type === "index") && typeof this.indexMethod == "function") {
|
|
397
|
+
const h = m.querySelector(".ea-table__index");
|
|
398
|
+
h.textContent = this.indexMethod(u);
|
|
399
|
+
}
|
|
400
|
+
m.querySelectorAll("[data-scope]").forEach((h) => {
|
|
401
|
+
const y = h.getAttribute("data-scope"), _ = r.find(($) => $.prop === y);
|
|
402
|
+
_ ? h.textContent = o[_.prop] : y in o && (h.textContent = o[y]);
|
|
403
|
+
}), s.appendChild(m), t(this, d).dataSource.set(m, o), o && typeof o == "object" && t(this, d).dataIndex.set(o, m);
|
|
404
|
+
}), this["show-summary"] && typeof this.summaryMethod == "function") {
|
|
405
|
+
const o = t(this, q).querySelectorAll(
|
|
406
|
+
".ea-table__td[data-scope]"
|
|
407
|
+
), u = this.summaryMethod({ columns: r, data: e });
|
|
408
|
+
o.forEach((m, h) => {
|
|
409
|
+
m.textContent = u[h];
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
t(this, v).appendChild(s), i && t(this, f).addEventListener("change", t(this, G), {
|
|
413
|
+
signal: t(this, g).signal
|
|
414
|
+
}), t(this, F).call(this), t(this, D).call(this), this.updateContainerClasslist(), t(this, d).isDataRendered = !0, this.emit("ea-table-data-rendered");
|
|
415
|
+
});
|
|
416
|
+
/**
|
|
417
|
+
* 排序
|
|
418
|
+
* @param {string} prop
|
|
419
|
+
* @param {"asc" | "desc"} order
|
|
420
|
+
*/
|
|
421
|
+
w(this, "sort", (e, s = "asc") => {
|
|
422
|
+
const a = document.createDocumentFragment(), r = t(this, v).nextElementSibling;
|
|
423
|
+
a.appendChild(t(this, v)), [...a.querySelectorAll("tr")].sort((c, p) => {
|
|
424
|
+
const o = t(this, d).dataSource.get(c), u = t(this, d).dataSource.get(p);
|
|
425
|
+
return s === "asc" ? String(o[e]).localeCompare(u[e]) : String(u[e]).localeCompare(o[e]);
|
|
426
|
+
}).forEach((c) => {
|
|
427
|
+
t(this, v).appendChild(c);
|
|
428
|
+
}), t(this, f).insertBefore(a, r), this.dispatchEvent(
|
|
429
|
+
new be({
|
|
430
|
+
prop: e,
|
|
431
|
+
order: s
|
|
432
|
+
})
|
|
433
|
+
);
|
|
434
|
+
});
|
|
435
|
+
/**
|
|
436
|
+
* 设置行样式
|
|
437
|
+
* @param {Function | String} handler
|
|
438
|
+
*/
|
|
439
|
+
w(this, "setRowStylePart", (e) => {
|
|
440
|
+
if (!t(this, d).isDataRendered)
|
|
441
|
+
return console.warn("[EaTable] Please set data first!", this);
|
|
442
|
+
const s = [...t(this, v).querySelectorAll("tr")];
|
|
443
|
+
if (typeof e == "function")
|
|
444
|
+
s.forEach((a, r) => {
|
|
445
|
+
const i = e({
|
|
446
|
+
row: t(this, d).dataSource.get(a),
|
|
447
|
+
rowIndex: r
|
|
448
|
+
});
|
|
449
|
+
i && a.part.add(i);
|
|
450
|
+
});
|
|
451
|
+
else if (typeof e == "string") {
|
|
452
|
+
if (!e) return;
|
|
453
|
+
s.forEach((a) => {
|
|
454
|
+
a.part.add(e);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
/**
|
|
459
|
+
* 设置当前行是否被选中
|
|
460
|
+
* @param {any} row
|
|
461
|
+
* @param {Boolean} selected
|
|
462
|
+
* @param {boolean} [ignoreSelectable]
|
|
463
|
+
*/
|
|
464
|
+
w(this, "toggleRowSelection", (e, s, a = !0) => {
|
|
465
|
+
if (!t(this, d).columns.some(
|
|
466
|
+
(o) => o.type === "selection"
|
|
467
|
+
)) return;
|
|
468
|
+
const i = t(this, d).dataIndex.get(e);
|
|
469
|
+
if (!i) return;
|
|
470
|
+
const c = `ea-checkbox[data-type="selection"]${a ? "" : ":not([disabled])"}`, p = i.querySelector(c);
|
|
471
|
+
p && (s ? p.toggleAttribute("checked", s) : p.toggleAttribute("checked", !p.checked), t(this, M).call(this), t(this, T).call(this));
|
|
472
|
+
});
|
|
473
|
+
/**
|
|
474
|
+
* 清空选择
|
|
475
|
+
*/
|
|
476
|
+
w(this, "clearSelection", () => {
|
|
477
|
+
[
|
|
478
|
+
...t(this, f).querySelectorAll('ea-checkbox[data-type="selection"]')
|
|
479
|
+
].forEach((s) => {
|
|
480
|
+
s.removeAttribute("checked"), s.removeAttribute("indeterminate");
|
|
481
|
+
}), t(this, T).call(this);
|
|
482
|
+
});
|
|
483
|
+
/**
|
|
484
|
+
* 获取当前选中的行
|
|
485
|
+
* @returns {any[]}
|
|
486
|
+
*/
|
|
487
|
+
b(this, A, () => [
|
|
488
|
+
...t(this, v).querySelectorAll(
|
|
489
|
+
'ea-checkbox[data-type="selection"][checked]'
|
|
490
|
+
)
|
|
491
|
+
].map(
|
|
492
|
+
(e) => t(this, d).dataSource.get(e.closest('.ea-table__tr[part="tbody-tr"]'))
|
|
493
|
+
));
|
|
494
|
+
/**
|
|
495
|
+
* 更新选中状态
|
|
496
|
+
*/
|
|
497
|
+
b(this, M, () => {
|
|
498
|
+
const e = t(this, S).querySelector(
|
|
499
|
+
'ea-checkbox[data-type="selection"]'
|
|
500
|
+
), s = [
|
|
501
|
+
...t(this, v).querySelectorAll(
|
|
502
|
+
'ea-checkbox[data-type="selection"]:not([disabled])'
|
|
503
|
+
)
|
|
504
|
+
].every((r) => r.hasAttribute("checked")), a = [
|
|
505
|
+
...t(this, v).querySelectorAll('ea-checkbox[data-type="selection"]')
|
|
506
|
+
].some((r) => r.hasAttribute("checked"));
|
|
507
|
+
s ? (e.toggleAttribute("checked", !0), e.removeAttribute("indeterminate")) : a ? (e.removeAttribute("checked"), e.toggleAttribute("indeterminate", !0)) : (e.removeAttribute("checked"), e.removeAttribute("indeterminate"));
|
|
508
|
+
});
|
|
509
|
+
/**
|
|
510
|
+
* 处理固定列的位置和阴影(box-shadow)
|
|
511
|
+
*/
|
|
512
|
+
b(this, F, () => {
|
|
513
|
+
const e = [...t(this, f).querySelectorAll(".is-fixed")], s = e.filter(
|
|
514
|
+
(o) => o.classList.contains("fixed-left")
|
|
515
|
+
), a = e.filter(
|
|
516
|
+
(o) => o.classList.contains("fixed-right")
|
|
517
|
+
), r = (o) => {
|
|
518
|
+
const u = o.filter((h) => h.part.contains("thead-th"));
|
|
519
|
+
if (u.length <= 1) return [o];
|
|
520
|
+
const m = [];
|
|
521
|
+
for (let h = 0; h < o.length; h += u.length)
|
|
522
|
+
m.push(o.slice(h, h + u.length));
|
|
523
|
+
return m.reduce((h, y) => (y.forEach((_, $) => {
|
|
524
|
+
h[$] = [...h[$], _];
|
|
525
|
+
}), h), Array(u.length).fill([]));
|
|
526
|
+
}, i = (o) => {
|
|
527
|
+
if (!o.length) return;
|
|
528
|
+
const u = o.slice(-1)[0];
|
|
529
|
+
o.forEach((m, h) => {
|
|
530
|
+
const y = o[h - 1] || [];
|
|
531
|
+
m.forEach((_) => {
|
|
532
|
+
u && y[0] && _.style.setProperty(
|
|
533
|
+
"--ea-table-fixed-x",
|
|
534
|
+
`${h * y[0].offsetWidth}px`
|
|
535
|
+
);
|
|
536
|
+
});
|
|
537
|
+
}), u.forEach((m) => {
|
|
538
|
+
m.classList.add("is-last");
|
|
539
|
+
});
|
|
540
|
+
}, [c, p] = [
|
|
541
|
+
r(s),
|
|
542
|
+
r(a).reverse()
|
|
543
|
+
];
|
|
544
|
+
i(c), i(p);
|
|
545
|
+
});
|
|
546
|
+
/**
|
|
547
|
+
* 设置高亮当前行样式
|
|
548
|
+
* @param {HTMLTableRowElement} currentRow
|
|
549
|
+
* @param {HTMLTableRowElement} [oldRow]
|
|
550
|
+
*/
|
|
551
|
+
b(this, L, (e, s = t(this, d).currentRow.target) => {
|
|
552
|
+
var a, r;
|
|
553
|
+
this["highlight-current-row"] && ((a = s == null ? void 0 : s.classList) == null || a.remove("is-current"), (r = e == null ? void 0 : e.classList) == null || r.add("is-current"));
|
|
554
|
+
});
|
|
555
|
+
/**
|
|
556
|
+
* 取消高亮当前行样式
|
|
557
|
+
* @param {HTMLTableRowElement} currentRow
|
|
558
|
+
*/
|
|
559
|
+
b(this, I, (e) => {
|
|
560
|
+
var s;
|
|
561
|
+
!this["highlight-current-row"] || !e || (s = e == null ? void 0 : e.classList) == null || s.remove("is-current");
|
|
562
|
+
});
|
|
563
|
+
/**
|
|
564
|
+
* 派发选择改变事件
|
|
565
|
+
*/
|
|
566
|
+
b(this, T, () => {
|
|
567
|
+
const e = t(this, A).call(this);
|
|
568
|
+
this.dispatchEvent(
|
|
569
|
+
new re({
|
|
570
|
+
newSelection: e
|
|
571
|
+
})
|
|
572
|
+
);
|
|
573
|
+
});
|
|
574
|
+
/**
|
|
575
|
+
* 点击事件: 行点击, 单元格点击
|
|
576
|
+
* @param {MouseEvent} e
|
|
577
|
+
*/
|
|
578
|
+
b(this, B, (e) => {
|
|
579
|
+
var i;
|
|
580
|
+
const s = e.target.closest("tr[part='tbody-tr']");
|
|
581
|
+
if ((i = t(this, x).selectAbortController) == null || i.abort(), !s) return;
|
|
582
|
+
const a = () => {
|
|
583
|
+
var c;
|
|
584
|
+
(c = t(this, x).selectAbortController) == null || c.abort();
|
|
585
|
+
}, r = (c) => {
|
|
586
|
+
var h;
|
|
587
|
+
const p = c.target.closest("tr[part='tbody-tr']"), o = c.target.closest("td[part='tbody-td']");
|
|
588
|
+
if (a(), p !== s) return;
|
|
589
|
+
const u = t(this, d).dataSource.get(s), m = (h = o == null ? void 0 : o.dataset) == null ? void 0 : h.scope;
|
|
590
|
+
t(this, L).call(this, s, t(this, d).currentRow.target), t(this, d).currentRow.target = s, t(this, d).currentRow.value = u, this.dispatchEvent(
|
|
591
|
+
new se({
|
|
592
|
+
target: s,
|
|
593
|
+
column: m,
|
|
594
|
+
row: u
|
|
595
|
+
})
|
|
596
|
+
), this.dispatchEvent(
|
|
597
|
+
new te({
|
|
598
|
+
target: s,
|
|
599
|
+
column: m,
|
|
600
|
+
row: u
|
|
601
|
+
})
|
|
602
|
+
), o && this.dispatchEvent(
|
|
603
|
+
new ee({
|
|
604
|
+
cell: o,
|
|
605
|
+
column: m,
|
|
606
|
+
row: u
|
|
607
|
+
})
|
|
608
|
+
);
|
|
609
|
+
};
|
|
610
|
+
t(this, x).selectAbortController = new AbortController(), this.addEventListener("mouseout", a, {
|
|
611
|
+
once: !0,
|
|
612
|
+
signal: t(this, x).selectAbortController.signal
|
|
613
|
+
}), t(this, f).addEventListener("mouseup", r, {
|
|
614
|
+
once: !0,
|
|
615
|
+
signal: t(this, x).selectAbortController.signal
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
/**
|
|
619
|
+
* 鼠标相关事件的共同处理逻辑
|
|
620
|
+
* @param {MouseEvent} e
|
|
621
|
+
* @param {'body' | 'head'} part
|
|
622
|
+
* @returns {{
|
|
623
|
+
* cell: HTMLTableCellElement;
|
|
624
|
+
* row: HTMLTableRowElement;
|
|
625
|
+
* data: any;
|
|
626
|
+
* columnKey: string;
|
|
627
|
+
* } | {
|
|
628
|
+
* cell: HTMLTableCellElement;
|
|
629
|
+
* columnKey: string;
|
|
630
|
+
* }}
|
|
631
|
+
*/
|
|
632
|
+
b(this, C, (e, s) => {
|
|
633
|
+
var o;
|
|
634
|
+
const a = e.target.closest(`tr[part='t${s}-tr']`);
|
|
635
|
+
if (!a) return { cell: null, row: null, data: null, columnKey: null };
|
|
636
|
+
const r = s === "body" ? "td" : "th", i = e.target.closest(`${r}[part='t${s}-${r}']`), c = t(this, d).dataSource.get(a), p = (o = i == null ? void 0 : i.dataset) == null ? void 0 : o.scope;
|
|
637
|
+
return s === "body" ? (t(this, L).call(this, a, t(this, d).currentRow.target), t(this, d).currentRow.target = a, t(this, d).currentRow.value = c, {
|
|
638
|
+
cell: i,
|
|
639
|
+
row: a,
|
|
640
|
+
data: c,
|
|
641
|
+
columnKey: p
|
|
642
|
+
}) : {
|
|
643
|
+
cell: i,
|
|
644
|
+
columnKey: p
|
|
645
|
+
};
|
|
646
|
+
});
|
|
647
|
+
/**
|
|
648
|
+
* 鼠标双击事件: 行双击, 单元格双击
|
|
649
|
+
* @param {MouseEvent} e
|
|
650
|
+
*/
|
|
651
|
+
b(this, K, (e) => {
|
|
652
|
+
const { row: s, cell: a, data: r, columnKey: i } = t(this, C).call(this, e, "body");
|
|
653
|
+
s && (this.dispatchEvent(
|
|
654
|
+
new Ee({
|
|
655
|
+
target: s,
|
|
656
|
+
column: i,
|
|
657
|
+
row: r
|
|
658
|
+
})
|
|
659
|
+
), this.dispatchEvent(
|
|
660
|
+
new ge({
|
|
661
|
+
cell: a,
|
|
662
|
+
column: i,
|
|
663
|
+
row: r
|
|
664
|
+
})
|
|
665
|
+
));
|
|
666
|
+
});
|
|
667
|
+
/**
|
|
668
|
+
* 鼠标右击事件: 行右击, 单元格右击
|
|
669
|
+
* @param {MouseEvent} e
|
|
670
|
+
*/
|
|
671
|
+
b(this, P, (e) => {
|
|
672
|
+
const { row: s, cell: a, data: r, columnKey: i } = t(this, C).call(this, e, "body");
|
|
673
|
+
s && (this.dispatchEvent(
|
|
674
|
+
new ye({
|
|
675
|
+
target: s,
|
|
676
|
+
column: i,
|
|
677
|
+
row: r
|
|
678
|
+
})
|
|
679
|
+
), this.dispatchEvent(
|
|
680
|
+
new ve({
|
|
681
|
+
cell: a,
|
|
682
|
+
column: i,
|
|
683
|
+
row: r
|
|
684
|
+
})
|
|
685
|
+
));
|
|
686
|
+
});
|
|
687
|
+
/**
|
|
688
|
+
* 滚动事件: 固定列样式
|
|
689
|
+
*/
|
|
690
|
+
b(this, D, () => {
|
|
691
|
+
const e = [...t(this, f).querySelectorAll(".is-fixed")], { scrollLeft: s } = t(this, f), a = Math.floor(t(this, f).scrollWidth - t(this, f).offsetWidth) - 1;
|
|
692
|
+
s < a ? s ? e.forEach((r) => {
|
|
693
|
+
r.classList.add("not-origin-position");
|
|
694
|
+
}) : e.forEach((r) => {
|
|
695
|
+
r.classList.toggle(
|
|
696
|
+
"not-origin-position",
|
|
697
|
+
!r.classList.contains("fixed-left")
|
|
698
|
+
);
|
|
699
|
+
}) : e.forEach((r) => {
|
|
700
|
+
r.classList.toggle(
|
|
701
|
+
"not-origin-position",
|
|
702
|
+
!r.classList.contains("fixed-right")
|
|
703
|
+
);
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
/**
|
|
707
|
+
* 鼠标进入单元格事件
|
|
708
|
+
* @param {MouseEvent} e
|
|
709
|
+
*/
|
|
710
|
+
b(this, j, (e) => {
|
|
711
|
+
const { row: s, cell: a, data: r, columnKey: i } = t(this, C).call(this, e, "body");
|
|
712
|
+
s && this.dispatchEvent(
|
|
713
|
+
new me({
|
|
714
|
+
column: i,
|
|
715
|
+
row: r,
|
|
716
|
+
cell: a
|
|
717
|
+
})
|
|
718
|
+
);
|
|
719
|
+
});
|
|
720
|
+
/**
|
|
721
|
+
* 鼠标进入单元格事件
|
|
722
|
+
* @param {MouseEvent} e
|
|
723
|
+
*/
|
|
724
|
+
b(this, W, (e) => {
|
|
725
|
+
const { row: s, cell: a, data: r, columnKey: i } = t(this, C).call(this, e, "body");
|
|
726
|
+
s && this.dispatchEvent(
|
|
727
|
+
new fe({
|
|
728
|
+
column: i,
|
|
729
|
+
row: r,
|
|
730
|
+
cell: a
|
|
731
|
+
})
|
|
732
|
+
);
|
|
733
|
+
});
|
|
734
|
+
/**
|
|
735
|
+
* 鼠标点击单元格事件
|
|
736
|
+
* @param {MouseEvent} e
|
|
737
|
+
*/
|
|
738
|
+
b(this, U, (e) => {
|
|
739
|
+
const { cell: s, columnKey: a } = t(this, C).call(this, e, "head");
|
|
740
|
+
s && this.dispatchEvent(
|
|
741
|
+
new xe({
|
|
742
|
+
column: a,
|
|
743
|
+
cell: s
|
|
744
|
+
})
|
|
745
|
+
);
|
|
746
|
+
});
|
|
747
|
+
/**
|
|
748
|
+
* 表头鼠标右键事件
|
|
749
|
+
* @param {MouseEvent} e
|
|
750
|
+
*/
|
|
751
|
+
b(this, O, (e) => {
|
|
752
|
+
const { cell: s, columnKey: a } = t(this, C).call(this, e, "head");
|
|
753
|
+
s && this.dispatchEvent(
|
|
754
|
+
new we({
|
|
755
|
+
column: a,
|
|
756
|
+
cell: s
|
|
757
|
+
})
|
|
758
|
+
);
|
|
759
|
+
});
|
|
760
|
+
/**
|
|
761
|
+
* 当存在 selection 列时,checkbox 的改变事件
|
|
762
|
+
* @param {Event} e
|
|
763
|
+
*/
|
|
764
|
+
b(this, G, (e) => {
|
|
765
|
+
if (e.target.dataset.type !== "selection") return;
|
|
766
|
+
e.stopImmediatePropagation();
|
|
767
|
+
const { checked: s } = e.detail;
|
|
768
|
+
if (e.target.closest(".ea-table__thead")) {
|
|
769
|
+
const r = [
|
|
770
|
+
...t(this, v).querySelectorAll('ea-checkbox[data-type="selection"]')
|
|
771
|
+
];
|
|
772
|
+
e.target.toggleAttribute("checked", e.target.hasAttribute("checked")), r.forEach((c) => {
|
|
773
|
+
c.hasAttribute("disabled") || c.toggleAttribute("checked", s);
|
|
774
|
+
});
|
|
775
|
+
const i = t(this, A).call(this);
|
|
776
|
+
this.dispatchEvent(new oe({ selection: i }));
|
|
777
|
+
} else {
|
|
778
|
+
const r = t(this, A).call(this), i = t(this, d).dataSource.get(
|
|
779
|
+
e.target.closest('.ea-table__tr[part="tbody-tr"]')
|
|
780
|
+
);
|
|
781
|
+
t(this, M).call(this), this.dispatchEvent(
|
|
782
|
+
new ae({ selection: r, row: i })
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
t(this, T).call(this);
|
|
786
|
+
});
|
|
787
|
+
this.stylesheet = Z, this.shadowRoot.innerHTML = this.html`
|
|
788
|
+
<table class='ea-table' part='container'></table>
|
|
789
|
+
<slot></slot>
|
|
790
|
+
`, k(this, f, this.shadowRoot.querySelector(".ea-table"));
|
|
791
|
+
}
|
|
792
|
+
static get observedAttributes() {
|
|
793
|
+
return [
|
|
794
|
+
...super.observedAttributes,
|
|
795
|
+
"stripe",
|
|
796
|
+
"border",
|
|
797
|
+
"height",
|
|
798
|
+
"max-height",
|
|
799
|
+
"highlight-current-row",
|
|
800
|
+
"show-summary"
|
|
801
|
+
];
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* 获取 classlist 列表
|
|
805
|
+
* @return {string} 属性值
|
|
806
|
+
*/
|
|
807
|
+
updateContainerClasslist() {
|
|
808
|
+
const e = this.computedClasslist(
|
|
809
|
+
"ea-table",
|
|
810
|
+
{},
|
|
811
|
+
{
|
|
812
|
+
stripe: this.stripe,
|
|
813
|
+
border: this.border,
|
|
814
|
+
"sticky-header": CSS.supports("height", this.height) || CSS.supports("height", this.maxHeight),
|
|
815
|
+
data: t(this, d).originData.length > 0
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
return t(this, f).className = e, e;
|
|
819
|
+
}
|
|
820
|
+
async $render() {
|
|
821
|
+
var e;
|
|
822
|
+
await customElements.whenDefined("ea-table-column"), (e = t(this, g)) == null || e.abort(), k(this, g, new AbortController()), t(this, N).call(this), t(this, H).call(this), t(this, f).addEventListener("mousedown", t(this, B), {
|
|
823
|
+
signal: t(this, g).signal
|
|
824
|
+
}), t(this, f).addEventListener("dblclick", t(this, K), {
|
|
825
|
+
signal: t(this, g).signal
|
|
826
|
+
}), t(this, f).addEventListener("contextmenu", t(this, P), {
|
|
827
|
+
signal: t(this, g).signal
|
|
828
|
+
}), t(this, S).addEventListener("click", t(this, U), {
|
|
829
|
+
signal: t(this, g).signal
|
|
830
|
+
}), t(this, S).addEventListener(
|
|
831
|
+
"contextmenu",
|
|
832
|
+
t(this, O),
|
|
833
|
+
{
|
|
834
|
+
signal: t(this, g).signal
|
|
835
|
+
}
|
|
836
|
+
), t(this, f).addEventListener("scroll", t(this, D), {
|
|
837
|
+
signal: t(this, g).signal
|
|
838
|
+
}), t(this, f).addEventListener("mouseover", t(this, j), {
|
|
839
|
+
signal: t(this, g).signal
|
|
840
|
+
}), t(this, f).addEventListener("mouseout", t(this, W), {
|
|
841
|
+
signal: t(this, g).signal
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* 获取当前行数据
|
|
846
|
+
* @returns {Promise<Object>}
|
|
847
|
+
*/
|
|
848
|
+
getCurrentRow() {
|
|
849
|
+
return t(this, d).currentRow;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* 设置当前行数据
|
|
853
|
+
* @param {any} row 当前行数据
|
|
854
|
+
*/
|
|
855
|
+
setCurrentRow(e) {
|
|
856
|
+
let s = null, a = null;
|
|
857
|
+
e && typeof e == "object" && (s = t(this, d).dataIndex.get(e) || null, a = e), s && a ? (t(this, L).call(this, s, t(this, d).currentRow.target), t(this, d).currentRow.target = s, t(this, d).currentRow.value = a) : (t(this, I).call(this, t(this, d).currentRow.target), t(this, d).currentRow.value = null, t(this, d).currentRow.target = null);
|
|
858
|
+
}
|
|
859
|
+
connectedCallback() {
|
|
860
|
+
var e;
|
|
861
|
+
super.connectedCallback(), (e = t(this, g)) == null || e.abort(), k(this, g, new AbortController()), this.$render();
|
|
862
|
+
}
|
|
863
|
+
$beforeUnmounted() {
|
|
864
|
+
var e;
|
|
865
|
+
(e = t(this, g)) == null || e.abort();
|
|
866
|
+
for (const s in t(this, d))
|
|
867
|
+
t(this, d)[s] = null;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
f = new WeakMap(), S = new WeakMap(), v = new WeakMap(), q = new WeakMap(), g = new WeakMap(), x = new WeakMap(), d = new WeakMap(), N = new WeakMap(), H = new WeakMap(), A = new WeakMap(), M = new WeakMap(), F = new WeakMap(), L = new WeakMap(), I = new WeakMap(), T = new WeakMap(), B = new WeakMap(), C = new WeakMap(), K = new WeakMap(), P = new WeakMap(), D = new WeakMap(), j = new WeakMap(), W = new WeakMap(), U = new WeakMap(), O = new WeakMap(), G = new WeakMap();
|
|
871
|
+
window.customElements.get("ea-table") || window.customElements.define("ea-table", Ce);
|
|
872
|
+
var R, V;
|
|
873
|
+
class Se extends Q {
|
|
874
|
+
constructor() {
|
|
875
|
+
super();
|
|
876
|
+
w(this, "state", this.properties({
|
|
877
|
+
type: {
|
|
878
|
+
type: ["selection", "index"],
|
|
879
|
+
default: "",
|
|
880
|
+
/** @param {"selection" | "index"} newVal */
|
|
881
|
+
observer: (e) => {
|
|
882
|
+
e === "selection" && !customElements.get("ea-checkbox") && import("./ea-checkbox.js");
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
align: {
|
|
886
|
+
type: ["left", "center", "right"],
|
|
887
|
+
default: "left"
|
|
888
|
+
},
|
|
889
|
+
label: {
|
|
890
|
+
type: String,
|
|
891
|
+
default: ""
|
|
892
|
+
},
|
|
893
|
+
prop: {
|
|
894
|
+
type: String,
|
|
895
|
+
default: ""
|
|
896
|
+
},
|
|
897
|
+
colspan: {
|
|
898
|
+
type: Number,
|
|
899
|
+
default: () => this.querySelectorAll("ea-table-column").length || 1
|
|
900
|
+
},
|
|
901
|
+
width: {
|
|
902
|
+
type: String,
|
|
903
|
+
default: ""
|
|
904
|
+
},
|
|
905
|
+
sortable: {
|
|
906
|
+
type: Boolean,
|
|
907
|
+
default: !1
|
|
908
|
+
},
|
|
909
|
+
fixed: {
|
|
910
|
+
type: String,
|
|
911
|
+
default: () => this.hasAttribute("fixed") ? this.getAttribute("fixed") || "left" : null
|
|
912
|
+
}
|
|
913
|
+
}));
|
|
914
|
+
w(this, "propState", this.properties({
|
|
915
|
+
option: {
|
|
916
|
+
props: !0,
|
|
917
|
+
type: Object,
|
|
918
|
+
default: {}
|
|
919
|
+
}
|
|
920
|
+
}));
|
|
921
|
+
w(this, "funcStates", this.properties({
|
|
922
|
+
getColumnTree: {
|
|
923
|
+
props: !0,
|
|
924
|
+
type: Object,
|
|
925
|
+
/**
|
|
926
|
+
* @returns {TableColumnCtx}
|
|
927
|
+
*/
|
|
928
|
+
default: () => {
|
|
929
|
+
var p, o;
|
|
930
|
+
const e = this.closest("ea-table"), s = [...this.querySelectorAll("& > ea-table-column")], a = this.shadowRoot.querySelector('slot[name="header"]'), r = this.shadowRoot.querySelector("#defaultSlot"), i = ["prop", "label", "width", "fixed", "sortable"];
|
|
931
|
+
let c = null;
|
|
932
|
+
if (s.length)
|
|
933
|
+
c = s.map((u) => u.getColumnTree);
|
|
934
|
+
else if (this.innerHTML) {
|
|
935
|
+
const u = document.createElement("template"), m = this.html(
|
|
936
|
+
Array.from(
|
|
937
|
+
r.assignedNodes(),
|
|
938
|
+
(h) => {
|
|
939
|
+
var y;
|
|
940
|
+
return (y = h.outerHTML) == null ? void 0 : y.trim();
|
|
941
|
+
}
|
|
942
|
+
).filter((h) => h).join("")
|
|
943
|
+
);
|
|
944
|
+
u.innerHTML = m, c = u;
|
|
945
|
+
} else
|
|
946
|
+
c = null;
|
|
947
|
+
return {
|
|
948
|
+
label: this.label,
|
|
949
|
+
prop: this.prop,
|
|
950
|
+
type: this.type,
|
|
951
|
+
colspan: this.colspan,
|
|
952
|
+
rowspan: c ? 1 : t(this, V).call(this, e) - t(this, R).call(this, this, e) + 1,
|
|
953
|
+
align: this.align,
|
|
954
|
+
width: this.width,
|
|
955
|
+
sortable: this.sortable,
|
|
956
|
+
fixed: this.fixed,
|
|
957
|
+
depth: t(this, R).call(this, this, e),
|
|
958
|
+
props: [...this.attributes].filter(
|
|
959
|
+
(u) => !i.includes(u.name)
|
|
960
|
+
),
|
|
961
|
+
header: ((o = (p = a.assignedNodes()[0]) == null ? void 0 : p.outerHTML) == null ? void 0 : o.trim()) || null,
|
|
962
|
+
template: c
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}));
|
|
967
|
+
/**
|
|
968
|
+
* 获取当前组件的深度
|
|
969
|
+
* @param {EaTableColumn} el
|
|
970
|
+
* @param {import("../ea-table/index.js").EaTable} root
|
|
971
|
+
* @returns {number}
|
|
972
|
+
*/
|
|
973
|
+
b(this, R, (e, s) => {
|
|
974
|
+
let a = 0;
|
|
975
|
+
for (; e !== s; )
|
|
976
|
+
e = e.parentElement, a++;
|
|
977
|
+
return a;
|
|
978
|
+
});
|
|
979
|
+
/**
|
|
980
|
+
* 获取最大深度
|
|
981
|
+
* @param {import("../ea-table/index.js").EaTable} root
|
|
982
|
+
* @returns {number}
|
|
983
|
+
*/
|
|
984
|
+
b(this, V, (e) => {
|
|
985
|
+
let s = 0;
|
|
986
|
+
return e.querySelectorAll("ea-table-column").forEach((a) => {
|
|
987
|
+
s = Math.max(s, t(this, R).call(this, a, e));
|
|
988
|
+
}), s;
|
|
989
|
+
});
|
|
990
|
+
this.shadowRoot.innerHTML = `
|
|
991
|
+
<slot name="header"></slot>
|
|
992
|
+
<slot id="defaultSlot"></slot>
|
|
993
|
+
`;
|
|
994
|
+
}
|
|
995
|
+
static get observedAttributes() {
|
|
996
|
+
return [...super.observedAttributes, "type"];
|
|
997
|
+
}
|
|
998
|
+
connectedCallback() {
|
|
999
|
+
super.connectedCallback();
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
R = new WeakMap(), V = new WeakMap();
|
|
1003
|
+
window.customElements.get("ea-table-column") || window.customElements.define("ea-table-column", Se);
|
|
1004
|
+
export {
|
|
1005
|
+
Ce as EaTable,
|
|
1006
|
+
Se as EaTableColumn
|
|
1007
|
+
};
|