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.
Files changed (651) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +162 -90
  3. package/dist/assets/icon.css +1 -0
  4. package/dist/components/Base.js +872 -0
  5. package/dist/components/ea-alert.js +196 -0
  6. package/dist/components/ea-avatar.js +159 -0
  7. package/dist/components/ea-backtop.js +136 -0
  8. package/dist/components/ea-badge.js +144 -0
  9. package/dist/components/ea-breadcrumb.js +148 -0
  10. package/dist/components/ea-button.js +261 -0
  11. package/dist/components/ea-calendar.js +10 -0
  12. package/dist/components/ea-calendar2.js +673 -0
  13. package/dist/components/ea-card.js +85 -0
  14. package/dist/components/ea-carousel.js +374 -0
  15. package/dist/components/ea-checkbox.js +446 -0
  16. package/dist/components/ea-collapse.js +293 -0
  17. package/dist/components/ea-color-picker.js +888 -0
  18. package/dist/components/ea-container.js +177 -0
  19. package/dist/components/ea-countdown.js +121 -0
  20. package/dist/components/ea-date-picker.js +649 -0
  21. package/dist/components/ea-descriptions.js +411 -0
  22. package/dist/components/ea-dialog.js +249 -0
  23. package/dist/components/ea-drawer.js +194 -0
  24. package/dist/components/ea-dropdown.js +228 -0
  25. package/dist/components/ea-empty.js +85 -0
  26. package/dist/components/ea-icon.js +68 -0
  27. package/dist/components/ea-image-preview.js +488 -0
  28. package/dist/components/ea-image.js +302 -0
  29. package/dist/components/ea-infinite-scroll.js +109 -0
  30. package/dist/components/ea-input-number.js +367 -0
  31. package/dist/components/ea-input.js +588 -0
  32. package/dist/components/ea-layout.js +125 -0
  33. package/dist/components/ea-link.js +95 -0
  34. package/dist/components/ea-loading.js +151 -0
  35. package/dist/components/ea-menu.js +417 -0
  36. package/dist/components/ea-message-box.js +624 -0
  37. package/dist/components/ea-message.js +251 -0
  38. package/dist/components/ea-notification.js +331 -0
  39. package/dist/components/ea-overlay.js +161 -0
  40. package/dist/components/ea-page-header.js +108 -0
  41. package/dist/components/ea-pagination.js +480 -0
  42. package/dist/components/ea-popconfirm.js +220 -0
  43. package/dist/components/ea-popover.js +123 -0
  44. package/dist/components/ea-popper.js +203 -0
  45. package/dist/components/ea-progress.js +269 -0
  46. package/dist/components/ea-radio.js +364 -0
  47. package/dist/components/ea-rate.js +241 -0
  48. package/dist/components/ea-result.js +100 -0
  49. package/dist/components/ea-scrollbar.js +235 -0
  50. package/dist/components/ea-segmented.js +215 -0
  51. package/dist/components/ea-select.js +598 -0
  52. package/dist/components/ea-skeleton.js +246 -0
  53. package/dist/components/ea-slider.js +421 -0
  54. package/dist/components/ea-space.js +109 -0
  55. package/dist/components/ea-splitter.js +217 -0
  56. package/dist/components/ea-statistic.js +6 -0
  57. package/dist/components/ea-statistic2.js +83 -0
  58. package/dist/components/ea-steps.js +312 -0
  59. package/dist/components/ea-switch.js +271 -0
  60. package/dist/components/ea-table.js +1007 -0
  61. package/dist/components/ea-tabs.js +501 -0
  62. package/dist/components/ea-tag.js +234 -0
  63. package/dist/components/ea-text.js +103 -0
  64. package/dist/components/ea-time-picker.js +514 -0
  65. package/dist/components/ea-timeline.js +186 -0
  66. package/dist/components/ea-tooltip.js +121 -0
  67. package/dist/components/ea-tour.js +544 -0
  68. package/dist/components/ea-transfer.js +949 -0
  69. package/dist/components/ea-tree.js +1088 -0
  70. package/dist/components/index.js +61 -0
  71. package/dist/core/FormBase.js +238 -0
  72. package/dist/css/ea-alert.style.js +4 -0
  73. package/dist/css/ea-aside.style.js +4 -0
  74. package/dist/css/ea-avatar.style.js +4 -0
  75. package/dist/css/ea-backtop.style.js +4 -0
  76. package/dist/css/ea-badge.style.js +4 -0
  77. package/dist/css/ea-breadcrumb-item.style.js +4 -0
  78. package/dist/css/ea-breadcrumb.style.js +4 -0
  79. package/dist/css/ea-button-group.style.js +4 -0
  80. package/dist/css/ea-button.style.js +4 -0
  81. package/dist/css/ea-calendar.style.js +4 -0
  82. package/dist/css/ea-card.style.js +4 -0
  83. package/dist/css/ea-carousel-item.style.js +4 -0
  84. package/dist/css/ea-carousel.style.js +4 -0
  85. package/dist/css/ea-check-tag.style.js +4 -0
  86. package/dist/css/ea-checkbox-group.style.js +4 -0
  87. package/dist/css/ea-checkbox.style.js +4 -0
  88. package/dist/css/ea-col.style.js +4 -0
  89. package/dist/css/ea-collapse-item.style.js +4 -0
  90. package/dist/css/ea-collapse.style.js +4 -0
  91. package/dist/css/ea-color-picker-panel.style.js +4 -0
  92. package/dist/css/ea-color-picker.style.js +4 -0
  93. package/dist/css/ea-container.style.js +4 -0
  94. package/dist/css/ea-date-picker.style.js +4 -0
  95. package/dist/css/ea-descriptions-item.style.js +4 -0
  96. package/dist/css/ea-descriptions.style.js +4 -0
  97. package/dist/css/ea-dialog.style.js +4 -0
  98. package/dist/css/ea-drawer.style.js +4 -0
  99. package/dist/css/ea-dropdown-item.style.js +4 -0
  100. package/dist/css/ea-dropdown-menu.style.js +4 -0
  101. package/dist/css/ea-dropdown.style.js +4 -0
  102. package/dist/css/ea-empty.style.js +4 -0
  103. package/dist/css/ea-footer.style.js +4 -0
  104. package/dist/css/ea-header.style.js +4 -0
  105. package/dist/css/ea-icon.style.js +4 -0
  106. package/dist/css/ea-image-preview.style.js +4 -0
  107. package/dist/css/ea-image.style.js +4 -0
  108. package/dist/css/ea-infinite-scroll.style.js +4 -0
  109. package/dist/css/ea-input-number.style.js +4 -0
  110. package/dist/css/ea-input.style.js +4 -0
  111. package/dist/css/ea-link.style.js +4 -0
  112. package/dist/css/ea-main.style.js +4 -0
  113. package/dist/css/ea-menu-item-group.style.js +4 -0
  114. package/dist/css/ea-menu-item.style.js +4 -0
  115. package/dist/css/ea-menu.style.js +4 -0
  116. package/dist/css/ea-message-box.style.js +4 -0
  117. package/dist/css/ea-message.style.js +4 -0
  118. package/dist/css/ea-notification.style.js +4 -0
  119. package/dist/css/ea-option-gropu.style.js +4 -0
  120. package/dist/css/ea-option.style.js +4 -0
  121. package/dist/css/ea-overlay.style.js +4 -0
  122. package/dist/css/ea-page-header.style.js +4 -0
  123. package/dist/css/ea-pagination.style.js +4 -0
  124. package/dist/css/ea-popconfirm.style.js +4 -0
  125. package/dist/css/ea-popover.style.js +4 -0
  126. package/dist/css/ea-popper.style.js +4 -0
  127. package/dist/css/ea-progress.style.js +4 -0
  128. package/dist/css/ea-radio-group.style.js +4 -0
  129. package/dist/css/ea-radio.style.js +4 -0
  130. package/dist/css/ea-rate.style.js +4 -0
  131. package/dist/css/ea-result.style.js +4 -0
  132. package/dist/css/ea-row.style.js +4 -0
  133. package/dist/css/ea-scrollbar.style.js +4 -0
  134. package/dist/css/ea-segmented.style.js +4 -0
  135. package/dist/css/ea-select.style.js +4 -0
  136. package/dist/css/ea-skeleton-item.style.js +4 -0
  137. package/dist/css/ea-skeleton.style.js +4 -0
  138. package/dist/css/ea-slider.style.js +4 -0
  139. package/dist/css/ea-space.style.js +4 -0
  140. package/dist/css/ea-splitter-bar.style.js +4 -0
  141. package/dist/css/ea-splitter-panel.style.js +4 -0
  142. package/dist/css/ea-splitter.style.js +4 -0
  143. package/dist/css/ea-statistic.style.js +4 -0
  144. package/dist/css/ea-step.style.js +4 -0
  145. package/dist/css/ea-steps.style.js +4 -0
  146. package/dist/css/ea-sub-menu.style.js +4 -0
  147. package/dist/css/ea-switch.style.js +4 -0
  148. package/dist/css/ea-tab-panel.style.js +4 -0
  149. package/dist/css/ea-tab.style.js +4 -0
  150. package/dist/css/ea-table.style.js +4 -0
  151. package/dist/css/ea-tabs.style.js +4 -0
  152. package/dist/css/ea-tag.style.js +4 -0
  153. package/dist/css/ea-text.style.js +4 -0
  154. package/dist/css/ea-time-picker.style.js +4 -0
  155. package/dist/css/ea-timeline-item.style.js +4 -0
  156. package/dist/css/ea-timeline.style.js +4 -0
  157. package/dist/css/ea-tooltip.style.js +4 -0
  158. package/dist/css/ea-tour-step.style.js +4 -0
  159. package/dist/css/ea-tour.style.js +4 -0
  160. package/dist/css/ea-transfer.style.js +5 -0
  161. package/dist/css/ea-tree.style.js +6 -0
  162. package/dist/css/ea-ui-component.style.js +4 -0
  163. package/dist/favicon.ico +0 -0
  164. package/dist/utils/Color.js +439 -0
  165. package/dist/utils/I18nManager.js +218 -0
  166. package/dist/utils/Utils.js +65 -0
  167. package/dist/utils/Variables.js +19 -0
  168. package/dist/utils/timeout.js +9 -0
  169. package/package.json +294 -11
  170. package/build/components/Base.js +0 -1
  171. package/build/components/ea-alert/index.js +0 -1
  172. package/build/components/ea-alert/src/style/stylesheet.js +0 -1
  173. package/build/components/ea-aside/index.js +0 -1
  174. package/build/components/ea-avatar/index.js +0 -1
  175. package/build/components/ea-avatar/src/assets/defaultAvatar.js +0 -1
  176. package/build/components/ea-avatar/src/assets/errorAvatar.js +0 -1
  177. package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -1
  178. package/build/components/ea-avatar/src/style/stylesheet.js +0 -1
  179. package/build/components/ea-backtop/index.js +0 -1
  180. package/build/components/ea-backtop/src/style/stylesheet.js +0 -1
  181. package/build/components/ea-badge/index.js +0 -1
  182. package/build/components/ea-badge/src/style/stylesheet.js +0 -1
  183. package/build/components/ea-breadcrumb/index.js +0 -1
  184. package/build/components/ea-breadcrumb/src/style/stylesheet.js +0 -1
  185. package/build/components/ea-breadcrumb-item/index.js +0 -1
  186. package/build/components/ea-breadcrumb-item/src/style/style.js +0 -1
  187. package/build/components/ea-button/index.js +0 -1
  188. package/build/components/ea-button/src/components/ButtonComm.js +0 -1
  189. package/build/components/ea-button/src/components/HrefComm.js +0 -1
  190. package/build/components/ea-button/src/style/stylesheet.js +0 -1
  191. package/build/components/ea-button-group/index.js +0 -1
  192. package/build/components/ea-button-group/src/style/stylesheet.js +0 -1
  193. package/build/components/ea-calendar/index.js +0 -1
  194. package/build/components/ea-calendar/src/style/stylesheet.js +0 -1
  195. package/build/components/ea-calendar/src/utils/createChangerElement.js +0 -1
  196. package/build/components/ea-calendar/src/utils/createThead.js +0 -1
  197. package/build/components/ea-calendar/src/utils/getDate.js +0 -1
  198. package/build/components/ea-calendar/src/utils/getUserWeekStart.js +0 -1
  199. package/build/components/ea-card/index.js +0 -1
  200. package/build/components/ea-card/src/style/stylesheet.js +0 -1
  201. package/build/components/ea-carousel/index.js +0 -1
  202. package/build/components/ea-carousel/src/style/stylesheet.js +0 -1
  203. package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -1
  204. package/build/components/ea-carousel-item/index.js +0 -1
  205. package/build/components/ea-carousel-item/src/style/stylesheet.js +0 -1
  206. package/build/components/ea-checkbox/index.js +0 -1
  207. package/build/components/ea-checkbox/src/style/stylesheet.js +0 -1
  208. package/build/components/ea-checkbox-group/index.js +0 -1
  209. package/build/components/ea-checkbox-group/src/style/stylesheet.js +0 -1
  210. package/build/components/ea-collapse/index.js +0 -1
  211. package/build/components/ea-collapse-item/index.js +0 -1
  212. package/build/components/ea-collapse-item/src/style/stylesheet.js +0 -1
  213. package/build/components/ea-container/index.js +0 -1
  214. package/build/components/ea-date-picker/index.js +0 -1
  215. package/build/components/ea-date-picker/src/style/stylesheet.js +0 -1
  216. package/build/components/ea-descriptions/index.js +0 -1
  217. package/build/components/ea-descriptions/src/components/contentTemplate.js +0 -1
  218. package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -1
  219. package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -1
  220. package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -1
  221. package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -1
  222. package/build/components/ea-descriptions/src/style/stylesheet.js +0 -1
  223. package/build/components/ea-descriptions-item/index.js +0 -1
  224. package/build/components/ea-descriptions-item/src/stylesheet.js +0 -1
  225. package/build/components/ea-drawer/index.js +0 -1
  226. package/build/components/ea-drawer/src/style/stylesheet.js +0 -1
  227. package/build/components/ea-empty/index.js +0 -1
  228. package/build/components/ea-empty/src/assets/emptyStatusSVG.js +0 -1
  229. package/build/components/ea-empty/src/style/stylesheet.js +0 -1
  230. package/build/components/ea-footer/index.js +0 -1
  231. package/build/components/ea-form/index.js +0 -1
  232. package/build/components/ea-form-item/index.js +0 -1
  233. package/build/components/ea-form-item/src/style/stylesheet.js +0 -1
  234. package/build/components/ea-header/index.js +0 -1
  235. package/build/components/ea-icon/config.json +0 -1030
  236. package/build/components/ea-icon/css/fontello.css +0 -312
  237. package/build/components/ea-icon/font/fontello.eot +0 -0
  238. package/build/components/ea-icon/font/fontello.svg +0 -350
  239. package/build/components/ea-icon/font/fontello.ttf +0 -0
  240. package/build/components/ea-icon/font/fontello.woff +0 -0
  241. package/build/components/ea-icon/font/fontello.woff2 +0 -0
  242. package/build/components/ea-icon/index.css +0 -1
  243. package/build/components/ea-icon/index.js +0 -1
  244. package/build/components/ea-image/index.js +0 -1
  245. package/build/components/ea-image/src/assets/errorImage.js +0 -1
  246. package/build/components/ea-image/src/style/stylesheet.js +0 -1
  247. package/build/components/ea-image/src/utils/createPreviewTools.js +0 -1
  248. package/build/components/ea-infinite-scroll/index.js +0 -1
  249. package/build/components/ea-infinite-scroll-item/index.js +0 -1
  250. package/build/components/ea-input/index.js +0 -1
  251. package/build/components/ea-input/src/components/createFixIcon.js +0 -1
  252. package/build/components/ea-input/src/components/createSuggestionBoard.js +0 -1
  253. package/build/components/ea-input/src/components/createWordLimitElement.js +0 -1
  254. package/build/components/ea-input/src/style/stylesheet.js +0 -1
  255. package/build/components/ea-input/src/utils/dispatchEvent.js +0 -1
  256. package/build/components/ea-input/src/utils/handleSearchResult.js +0 -1
  257. package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -1
  258. package/build/components/ea-input-number/index.js +0 -1
  259. package/build/components/ea-input-number/src/style/stylesheet.js +0 -1
  260. package/build/components/ea-input-number/src/utils/handleCustomEvent.js +0 -1
  261. package/build/components/ea-link/index.js +0 -1
  262. package/build/components/ea-link/src/style/stylesheet.js +0 -1
  263. package/build/components/ea-loading/index.js +0 -1
  264. package/build/components/ea-loading/src/style/stylesheet.js +0 -1
  265. package/build/components/ea-main/index.js +0 -1
  266. package/build/components/ea-menu/index.js +0 -1
  267. package/build/components/ea-menu/src/style/stylesheet.js +0 -1
  268. package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -1
  269. package/build/components/ea-menu-item/index.js +0 -1
  270. package/build/components/ea-menu-item/src/style/stylesheet.js +0 -1
  271. package/build/components/ea-menu-item-group/index.js +0 -1
  272. package/build/components/ea-menu-item-group/src/style/stylesheet.js +0 -1
  273. package/build/components/ea-message/index.js +0 -1
  274. package/build/components/ea-message/src/style/stylesheet.js +0 -1
  275. package/build/components/ea-message/src/utils/MessageClass.js +0 -1
  276. package/build/components/ea-message-box/index.js +0 -1
  277. package/build/components/ea-message-box/src/style/stylesheet.js +0 -1
  278. package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -1
  279. package/build/components/ea-option/index.js +0 -1
  280. package/build/components/ea-option/src/style/stylesheet.js +0 -1
  281. package/build/components/ea-option-gropu/index.js +0 -1
  282. package/build/components/ea-page-header/index.js +0 -1
  283. package/build/components/ea-page-header/src/style/stylesheet.js +0 -1
  284. package/build/components/ea-pagination/index.js +0 -1
  285. package/build/components/ea-pagination/src/components/getMoreItem.js +0 -1
  286. package/build/components/ea-pagination/src/components/getPageItem.js +0 -1
  287. package/build/components/ea-pagination/src/components/getShowTotalItem.js +0 -1
  288. package/build/components/ea-pagination/src/style/stylesheet.js +0 -1
  289. package/build/components/ea-pane/index.js +0 -1
  290. package/build/components/ea-pane/src/stylesheet.js +0 -1
  291. package/build/components/ea-progress/index.js +0 -1
  292. package/build/components/ea-progress/src/components/SVGComm.js +0 -1
  293. package/build/components/ea-progress/src/style/stylesheet.js +0 -1
  294. package/build/components/ea-radio/index.js +0 -1
  295. package/build/components/ea-radio/src/style/stylesheet.js +0 -1
  296. package/build/components/ea-radio-group/index.js +0 -1
  297. package/build/components/ea-rate/index.js +0 -1
  298. package/build/components/ea-rate/src/components/rateComm.js +0 -1
  299. package/build/components/ea-rate/src/style/stylesheet.js +0 -1
  300. package/build/components/ea-result/index.js +0 -1
  301. package/build/components/ea-result/src/style/stylesheet.js +0 -1
  302. package/build/components/ea-select/index.js +0 -1
  303. package/build/components/ea-select/src/style/stylesheet.js +0 -1
  304. package/build/components/ea-skeleton/index.js +0 -1
  305. package/build/components/ea-skeleton/src/style/stylesheet.js +0 -1
  306. package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -1
  307. package/build/components/ea-skeleton-item/index.js +0 -1
  308. package/build/components/ea-skeleton-item/src/assets/imageSVG.js +0 -1
  309. package/build/components/ea-skeleton-item/src/style/stylesheet.js +0 -1
  310. package/build/components/ea-step/index.js +0 -1
  311. package/build/components/ea-step/src/style/stylesheet.js +0 -1
  312. package/build/components/ea-steps/index.js +0 -1
  313. package/build/components/ea-steps/src/style/stylesheet.js +0 -1
  314. package/build/components/ea-submenu/index.js +0 -1
  315. package/build/components/ea-submenu/src/style/stylesheet.js +0 -1
  316. package/build/components/ea-switch/index.js +0 -1
  317. package/build/components/ea-switch/src/style/stylesheet.js +0 -1
  318. package/build/components/ea-tab/index.js +0 -1
  319. package/build/components/ea-tab/src/style/stylesheet.js +0 -1
  320. package/build/components/ea-table/index.js +0 -1
  321. package/build/components/ea-table/src/style/stylesheet.js +0 -1
  322. package/build/components/ea-table-column/index.js +0 -1
  323. package/build/components/ea-tabs/index.js +0 -1
  324. package/build/components/ea-tabs/src/style/stylesheet.js +0 -1
  325. package/build/components/ea-tag/index.js +0 -1
  326. package/build/components/ea-tag/src/style/stylesheet.js +0 -1
  327. package/build/components/ea-textarea/index.js +0 -1
  328. package/build/components/ea-textarea/src/style/stylesheet.js +0 -1
  329. package/build/components/ea-time-picker/index.js +0 -1
  330. package/build/components/ea-time-picker/src/style/stylesheet.js +0 -1
  331. package/build/components/ea-timeline/index.js +0 -1
  332. package/build/components/ea-timeline/style/stylesheet.js +0 -1
  333. package/build/components/ea-timeline-item/index.js +0 -1
  334. package/build/components/ea-timeline-item/src/style/stylesheet.js +0 -1
  335. package/build/components/globalConfig.js +0 -1
  336. package/build/components/index.js +0 -1
  337. package/build/utils/Validator.js +0 -1
  338. package/build/utils/createElement.js +0 -1
  339. package/build/utils/handleDefaultAttrIsTrue.js +0 -1
  340. package/build/utils/handleTemplate.js +0 -1
  341. package/build/utils/setStyle.js +0 -1
  342. package/build/utils/timeout.js +0 -1
  343. package/components/Base.js +0 -75
  344. package/components/ea-alert/index.css +0 -91
  345. package/components/ea-alert/index.js +0 -210
  346. package/components/ea-alert/index.scss +0 -108
  347. package/components/ea-alert/src/style/stylesheet.js +0 -85
  348. package/components/ea-aside/index.css +0 -9
  349. package/components/ea-aside/index.js +0 -54
  350. package/components/ea-aside/index.scss +0 -12
  351. package/components/ea-avatar/index.css +0 -66
  352. package/components/ea-avatar/index.js +0 -156
  353. package/components/ea-avatar/index.scss +0 -59
  354. package/components/ea-avatar/src/assets/defaultAvatar.js +0 -12
  355. package/components/ea-avatar/src/assets/errorAvatar.js +0 -9
  356. package/components/ea-avatar/src/assets/iconAndTextAvatar.js +0 -18
  357. package/components/ea-avatar/src/style/stylesheet.js +0 -61
  358. package/components/ea-backtop/index.css +0 -27
  359. package/components/ea-backtop/index.js +0 -167
  360. package/components/ea-backtop/index.scss +0 -29
  361. package/components/ea-backtop/src/style/stylesheet.js +0 -21
  362. package/components/ea-badge/index.css +0 -49
  363. package/components/ea-badge/index.js +0 -103
  364. package/components/ea-badge/index.scss +0 -56
  365. package/components/ea-badge/src/style/stylesheet.js +0 -43
  366. package/components/ea-breadcrumb/index.css +0 -6
  367. package/components/ea-breadcrumb/index.js +0 -90
  368. package/components/ea-breadcrumb/index.scss +0 -7
  369. package/components/ea-breadcrumb/src/style/stylesheet.js +0 -8
  370. package/components/ea-breadcrumb-item/index.css +0 -10
  371. package/components/ea-breadcrumb-item/index.js +0 -23
  372. package/components/ea-breadcrumb-item/index.scss +0 -12
  373. package/components/ea-breadcrumb-item/src/style/style.js +0 -12
  374. package/components/ea-button/index.css +0 -206
  375. package/components/ea-button/index.js +0 -198
  376. package/components/ea-button/index.scss +0 -143
  377. package/components/ea-button/src/components/ButtonComm.js +0 -5
  378. package/components/ea-button/src/components/HrefComm.js +0 -5
  379. package/components/ea-button/src/style/stylesheet.js +0 -208
  380. package/components/ea-button-group/index.css +0 -16
  381. package/components/ea-button-group/index.js +0 -44
  382. package/components/ea-button-group/index.scss +0 -20
  383. package/components/ea-button-group/src/style/stylesheet.js +0 -18
  384. package/components/ea-calendar/index.css +0 -72
  385. package/components/ea-calendar/index.js +0 -298
  386. package/components/ea-calendar/index.scss +0 -106
  387. package/components/ea-calendar/src/style/stylesheet.js +0 -74
  388. package/components/ea-calendar/src/utils/createChangerElement.js +0 -10
  389. package/components/ea-calendar/src/utils/createThead.js +0 -18
  390. package/components/ea-calendar/src/utils/getDate.js +0 -11
  391. package/components/ea-calendar/src/utils/getUserWeekStart.js +0 -11
  392. package/components/ea-card/index.css +0 -25
  393. package/components/ea-card/index.js +0 -51
  394. package/components/ea-card/index.scss +0 -24
  395. package/components/ea-card/src/style/stylesheet.js +0 -19
  396. package/components/ea-carousel/index.css +0 -103
  397. package/components/ea-carousel/index.js +0 -222
  398. package/components/ea-carousel/index.scss +0 -140
  399. package/components/ea-carousel/src/style/stylesheet.js +0 -105
  400. package/components/ea-carousel/src/utils/handleIndexOverflow.js +0 -9
  401. package/components/ea-carousel-item/index.css +0 -20
  402. package/components/ea-carousel-item/index.js +0 -23
  403. package/components/ea-carousel-item/index.scss +0 -26
  404. package/components/ea-carousel-item/src/style/stylesheet.js +0 -22
  405. package/components/ea-checkbox/index.css +0 -108
  406. package/components/ea-checkbox/index.js +0 -160
  407. package/components/ea-checkbox/index.scss +0 -141
  408. package/components/ea-checkbox/src/style/stylesheet.js +0 -110
  409. package/components/ea-checkbox-group/index.css +0 -6
  410. package/components/ea-checkbox-group/index.js +0 -120
  411. package/components/ea-checkbox-group/index.scss +0 -7
  412. package/components/ea-checkbox-group/src/style/stylesheet.js +0 -8
  413. package/components/ea-collapse/index.css +0 -0
  414. package/components/ea-collapse/index.js +0 -109
  415. package/components/ea-collapse/index.scss +0 -4
  416. package/components/ea-collapse-item/index.css +0 -31
  417. package/components/ea-collapse-item/index.js +0 -111
  418. package/components/ea-collapse-item/index.scss +0 -46
  419. package/components/ea-collapse-item/src/style/stylesheet.js +0 -33
  420. package/components/ea-container/index.css +0 -14
  421. package/components/ea-container/index.js +0 -85
  422. package/components/ea-container/index.scss +0 -18
  423. package/components/ea-date-picker/index.css +0 -17
  424. package/components/ea-date-picker/index.js +0 -191
  425. package/components/ea-date-picker/index.scss +0 -29
  426. package/components/ea-date-picker/src/style/stylesheet.js +0 -19
  427. package/components/ea-descriptions/index.css +0 -33
  428. package/components/ea-descriptions/index.js +0 -171
  429. package/components/ea-descriptions/index.scss +0 -45
  430. package/components/ea-descriptions/src/components/contentTemplate.js +0 -11
  431. package/components/ea-descriptions/src/components/getTdTemplate_border.js +0 -6
  432. package/components/ea-descriptions/src/components/getTdTemplate_direction.js +0 -7
  433. package/components/ea-descriptions/src/components/getThTemplate_direction.js +0 -7
  434. package/components/ea-descriptions/src/components/getThTemplate_normal.js +0 -8
  435. package/components/ea-descriptions/src/style/stylesheet.js +0 -35
  436. package/components/ea-descriptions-item/index.css +0 -21
  437. package/components/ea-descriptions-item/index.js +0 -71
  438. package/components/ea-descriptions-item/index.scss +0 -29
  439. package/components/ea-descriptions-item/src/stylesheet.js +0 -23
  440. package/components/ea-drawer/index.css +0 -138
  441. package/components/ea-drawer/index.js +0 -251
  442. package/components/ea-drawer/index.scss +0 -208
  443. package/components/ea-drawer/src/style/stylesheet.js +0 -141
  444. package/components/ea-empty/index.css +0 -30
  445. package/components/ea-empty/index.js +0 -93
  446. package/components/ea-empty/index.scss +0 -30
  447. package/components/ea-empty/src/assets/emptyStatusSVG.js +0 -6
  448. package/components/ea-empty/src/style/stylesheet.js +0 -24
  449. package/components/ea-footer/index.css +0 -7
  450. package/components/ea-footer/index.js +0 -57
  451. package/components/ea-footer/index.scss +0 -10
  452. package/components/ea-form/index.css +0 -0
  453. package/components/ea-form/index.js +0 -121
  454. package/components/ea-form/index.scss +0 -0
  455. package/components/ea-form-item/index.css +0 -62
  456. package/components/ea-form-item/index.js +0 -152
  457. package/components/ea-form-item/index.scss +0 -83
  458. package/components/ea-form-item/src/style/stylesheet.js +0 -64
  459. package/components/ea-header/index.css +0 -7
  460. package/components/ea-header/index.js +0 -55
  461. package/components/ea-header/index.scss +0 -10
  462. package/components/ea-icon/config.json +0 -1030
  463. package/components/ea-icon/css/fontello.css +0 -312
  464. package/components/ea-icon/font/fontello.eot +0 -0
  465. package/components/ea-icon/font/fontello.svg +0 -350
  466. package/components/ea-icon/font/fontello.ttf +0 -0
  467. package/components/ea-icon/font/fontello.woff +0 -0
  468. package/components/ea-icon/font/fontello.woff2 +0 -0
  469. package/components/ea-icon/index.css +0 -1
  470. package/components/ea-icon/index.js +0 -84
  471. package/components/ea-image/index.css +0 -84
  472. package/components/ea-image/index.js +0 -182
  473. package/components/ea-image/index.scss +0 -111
  474. package/components/ea-image/src/assets/errorImage.js +0 -9
  475. package/components/ea-image/src/assets/errorImage.svg +0 -7
  476. package/components/ea-image/src/style/stylesheet.js +0 -86
  477. package/components/ea-image/src/utils/createPreviewTools.js +0 -140
  478. package/components/ea-infinite-scroll/index.css +0 -0
  479. package/components/ea-infinite-scroll/index.js +0 -119
  480. package/components/ea-infinite-scroll/index.scss +0 -0
  481. package/components/ea-infinite-scroll-item/index.css +0 -0
  482. package/components/ea-infinite-scroll-item/index.js +0 -18
  483. package/components/ea-infinite-scroll-item/index.scss +0 -0
  484. package/components/ea-input/index.css +0 -139
  485. package/components/ea-input/index.js +0 -398
  486. package/components/ea-input/index.scss +0 -178
  487. package/components/ea-input/src/components/createFixIcon.js +0 -108
  488. package/components/ea-input/src/components/createSuggestionBoard.js +0 -43
  489. package/components/ea-input/src/components/createWordLimitElement.js +0 -18
  490. package/components/ea-input/src/style/stylesheet.js +0 -141
  491. package/components/ea-input/src/utils/dispatchEvent.js +0 -9
  492. package/components/ea-input/src/utils/handleSearchResult.js +0 -9
  493. package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +0 -31
  494. package/components/ea-input-number/index.css +0 -120
  495. package/components/ea-input-number/index.js +0 -308
  496. package/components/ea-input-number/index.scss +0 -132
  497. package/components/ea-input-number/src/style/stylesheet.js +0 -122
  498. package/components/ea-input-number/src/utils/handleCustomEvent.js +0 -5
  499. package/components/ea-link/index.css +0 -48
  500. package/components/ea-link/index.js +0 -122
  501. package/components/ea-link/index.scss +0 -36
  502. package/components/ea-link/src/style/stylesheet.js +0 -50
  503. package/components/ea-loading/index.css +0 -38
  504. package/components/ea-loading/index.js +0 -166
  505. package/components/ea-loading/index.scss +0 -55
  506. package/components/ea-loading/src/style/stylesheet.js +0 -40
  507. package/components/ea-main/index.css +0 -8
  508. package/components/ea-main/index.js +0 -32
  509. package/components/ea-main/index.scss +0 -11
  510. package/components/ea-menu/index.css +0 -19
  511. package/components/ea-menu/index.js +0 -131
  512. package/components/ea-menu/index.scss +0 -22
  513. package/components/ea-menu/src/style/stylesheet.js +0 -21
  514. package/components/ea-menu/src/utils/handleMenuItemEvent.js +0 -32
  515. package/components/ea-menu-item/index.css +0 -48
  516. package/components/ea-menu-item/index.js +0 -130
  517. package/components/ea-menu-item/index.scss +0 -62
  518. package/components/ea-menu-item/src/style/stylesheet.js +0 -50
  519. package/components/ea-menu-item-group/index.css +0 -42
  520. package/components/ea-menu-item-group/index.js +0 -130
  521. package/components/ea-menu-item-group/index.scss +0 -60
  522. package/components/ea-menu-item-group/src/style/stylesheet.js +0 -44
  523. package/components/ea-message/index.css +0 -47
  524. package/components/ea-message/index.js +0 -171
  525. package/components/ea-message/index.scss +0 -70
  526. package/components/ea-message/src/style/stylesheet.js +0 -48
  527. package/components/ea-message/src/utils/MessageClass.js +0 -67
  528. package/components/ea-message-box/index.css +0 -85
  529. package/components/ea-message-box/index.js +0 -211
  530. package/components/ea-message-box/index.scss +0 -113
  531. package/components/ea-message-box/src/style/stylesheet.js +0 -87
  532. package/components/ea-message-box/src/utils/EaMessageBoxClass.js +0 -60
  533. package/components/ea-option/index.css +0 -24
  534. package/components/ea-option/index.js +0 -74
  535. package/components/ea-option/index.scss +0 -31
  536. package/components/ea-option/src/style/stylesheet.js +0 -26
  537. package/components/ea-option-gropu/index.css +0 -6
  538. package/components/ea-option-gropu/index.js +0 -57
  539. package/components/ea-option-gropu/index.scss +0 -8
  540. package/components/ea-page-header/index.css +0 -33
  541. package/components/ea-page-header/index.js +0 -91
  542. package/components/ea-page-header/index.scss +0 -44
  543. package/components/ea-page-header/src/style/stylesheet.js +0 -35
  544. package/components/ea-pagination/index.css +0 -69
  545. package/components/ea-pagination/index.js +0 -305
  546. package/components/ea-pagination/index.scss +0 -89
  547. package/components/ea-pagination/src/components/getMoreItem.js +0 -20
  548. package/components/ea-pagination/src/components/getPageItem.js +0 -11
  549. package/components/ea-pagination/src/components/getShowTotalItem.js +0 -7
  550. package/components/ea-pagination/src/style/stylesheet.js +0 -71
  551. package/components/ea-pane/index.css +0 -6
  552. package/components/ea-pane/index.js +0 -52
  553. package/components/ea-pane/index.scss +0 -7
  554. package/components/ea-pane/src/stylesheet.js +0 -8
  555. package/components/ea-progress/index.css +0 -61
  556. package/components/ea-progress/index.js +0 -249
  557. package/components/ea-progress/index.scss +0 -74
  558. package/components/ea-progress/src/components/SVGComm.js +0 -18
  559. package/components/ea-progress/src/style/stylesheet.js +0 -55
  560. package/components/ea-radio/index.css +0 -82
  561. package/components/ea-radio/index.js +0 -137
  562. package/components/ea-radio/index.scss +0 -119
  563. package/components/ea-radio/src/style/stylesheet.js +0 -84
  564. package/components/ea-radio-group/index.css +0 -3
  565. package/components/ea-radio-group/index.js +0 -96
  566. package/components/ea-radio-group/index.scss +0 -3
  567. package/components/ea-rate/index.css +0 -44
  568. package/components/ea-rate/index.js +0 -243
  569. package/components/ea-rate/index.scss +0 -55
  570. package/components/ea-rate/src/components/rateComm.js +0 -20
  571. package/components/ea-rate/src/style/stylesheet.js +0 -45
  572. package/components/ea-result/index.css +0 -37
  573. package/components/ea-result/index.js +0 -109
  574. package/components/ea-result/index.scss +0 -46
  575. package/components/ea-result/src/style/stylesheet.js +0 -39
  576. package/components/ea-select/index.css +0 -47
  577. package/components/ea-select/index.js +0 -312
  578. package/components/ea-select/index.scss +0 -70
  579. package/components/ea-select/src/style/stylesheet.js +0 -49
  580. package/components/ea-skeleton/index.css +0 -12
  581. package/components/ea-skeleton/index.js +0 -148
  582. package/components/ea-skeleton/index.scss +0 -16
  583. package/components/ea-skeleton/src/style/stylesheet.js +0 -14
  584. package/components/ea-skeleton/src/utils/createSkeletonElement.js +0 -7
  585. package/components/ea-skeleton-item/index.css +0 -69
  586. package/components/ea-skeleton-item/index.js +0 -82
  587. package/components/ea-skeleton-item/index.scss +0 -107
  588. package/components/ea-skeleton-item/src/assets/imageSVG.js +0 -8
  589. package/components/ea-skeleton-item/src/style/stylesheet.js +0 -71
  590. package/components/ea-step/index.css +0 -84
  591. package/components/ea-step/index.js +0 -230
  592. package/components/ea-step/index.scss +0 -110
  593. package/components/ea-step/src/style/stylesheet.js +0 -86
  594. package/components/ea-steps/index.css +0 -19
  595. package/components/ea-steps/index.js +0 -104
  596. package/components/ea-steps/index.scss +0 -23
  597. package/components/ea-steps/src/style/stylesheet.js +0 -21
  598. package/components/ea-submenu/index.css +0 -65
  599. package/components/ea-submenu/index.js +0 -141
  600. package/components/ea-submenu/index.scss +0 -88
  601. package/components/ea-submenu/src/style/stylesheet.js +0 -67
  602. package/components/ea-switch/index.css +0 -90
  603. package/components/ea-switch/index.js +0 -189
  604. package/components/ea-switch/index.scss +0 -117
  605. package/components/ea-switch/src/style/stylesheet.js +0 -92
  606. package/components/ea-tab/index.css +0 -68
  607. package/components/ea-tab/index.js +0 -138
  608. package/components/ea-tab/index.scss +0 -96
  609. package/components/ea-tab/src/style/stylesheet.js +0 -70
  610. package/components/ea-table/index.css +0 -98
  611. package/components/ea-table/index.js +0 -555
  612. package/components/ea-table/index.scss +0 -90
  613. package/components/ea-table/src/style/stylesheet.js +0 -100
  614. package/components/ea-table-column/index.css +0 -0
  615. package/components/ea-table-column/index.js +0 -164
  616. package/components/ea-table-column/index.scss +0 -0
  617. package/components/ea-tabs/index.css +0 -45
  618. package/components/ea-tabs/index.js +0 -245
  619. package/components/ea-tabs/index.scss +0 -64
  620. package/components/ea-tabs/src/style/stylesheet.js +0 -47
  621. package/components/ea-tag/index.css +0 -90
  622. package/components/ea-tag/index.js +0 -107
  623. package/components/ea-tag/index.scss +0 -71
  624. package/components/ea-tag/src/style/stylesheet.js +0 -92
  625. package/components/ea-textarea/index.css +0 -37
  626. package/components/ea-textarea/index.js +0 -277
  627. package/components/ea-textarea/index.scss +0 -48
  628. package/components/ea-textarea/src/style/stylesheet.js +0 -39
  629. package/components/ea-time-picker/index.css +0 -82
  630. package/components/ea-time-picker/index.js +0 -379
  631. package/components/ea-time-picker/index.scss +0 -110
  632. package/components/ea-time-picker/src/style/stylesheet.js +0 -84
  633. package/components/ea-timeline/index.css +0 -0
  634. package/components/ea-timeline/index.js +0 -74
  635. package/components/ea-timeline/index.scss +0 -1
  636. package/components/ea-timeline/style/stylesheet.js +0 -3
  637. package/components/ea-timeline-item/index.css +0 -79
  638. package/components/ea-timeline-item/index.js +0 -146
  639. package/components/ea-timeline-item/index.scss +0 -92
  640. package/components/ea-timeline-item/src/style/stylesheet.js +0 -81
  641. package/components/ea-ui-base-style.css +0 -0
  642. package/components/ea-ui-base-style.scss +0 -153
  643. package/components/globalConfig.js +0 -10
  644. package/components/index.js +0 -67
  645. package/public/logo.png +0 -0
  646. package/utils/Validator.js +0 -16
  647. package/utils/createElement.js +0 -30
  648. package/utils/handleDefaultAttrIsTrue.js +0 -11
  649. package/utils/handleTemplate.js +0 -19
  650. package/utils/setStyle.js +0 -8
  651. package/utils/timeout.js +0 -16
@@ -1,84 +0,0 @@
1
- .ea-image_wrap {
2
- align-content: center;
3
- text-align: center;
4
- }
5
- .ea-image_wrap.is-error {
6
- background-color: #f5f7fa;
7
- }
8
- .ea-image_wrap.is-error svg {
9
- width: 20px;
10
- height: 20px;
11
- }
12
- .ea-image_wrap img {
13
- position: relative;
14
- width: 100%;
15
- height: 100%;
16
- user-zoom: scale;
17
- object-fit: cover;
18
- transition: rotate 0.3s, scale 0.3s;
19
- }
20
- .ea-image_wrap .ea-image_preview-wrap {
21
- position: fixed;
22
- top: 0;
23
- left: 0;
24
- width: 100%;
25
- height: 100%;
26
- z-index: 999;
27
- opacity: 0;
28
- transform: translateY(-1rem);
29
- transition: opacity 0.3s, transform 0.3s;
30
- background-color: rgba(0, 0, 0, 0.4);
31
- }
32
- .ea-image_wrap .ea-image_preview-wrap.entry {
33
- opacity: 1;
34
- transform: translateY(0);
35
- }
36
- .ea-image_wrap .ea-image_preview-wrap .ea-icon-close {
37
- position: absolute;
38
- right: 40px;
39
- top: 40px;
40
- cursor: pointer;
41
- width: 40px;
42
- height: 40px;
43
- font-size: 24px;
44
- line-height: 36px;
45
- border-radius: 50%;
46
- color: #fff;
47
- background-color: #606266;
48
- text-align: center;
49
- }
50
- .ea-image_wrap .ea-image_preview-wrap img {
51
- width: 100%;
52
- height: 100%;
53
- object-fit: contain;
54
- }
55
- .ea-image_wrap .ea-image_preview-tools {
56
- display: flex;
57
- align-items: center;
58
- justify-content: space-around;
59
- position: absolute;
60
- bottom: 20px;
61
- left: 50%;
62
- padding: 0.5rem 1rem;
63
- user-select: none;
64
- border-radius: 999px;
65
- transform: translateX(-50%);
66
- background-color: rgba(96, 98, 102, 0.568627451);
67
- color: #fff;
68
- }
69
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom,
70
- .ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {
71
- width: 2rem;
72
- text-align: center;
73
- cursor: pointer;
74
- margin: 0 1rem;
75
- }
76
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom {
77
- font-size: 2rem;
78
- }
79
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom-in {
80
- font-size: 1.75rem;
81
- }
82
- .ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {
83
- font-size: 1.5rem;
84
- }
@@ -1,182 +0,0 @@
1
- import Base from '../Base.js';
2
-
3
- import "../ea-icon/index.js"
4
-
5
- import { errorImage } from "./src/assets/errorImage.js";
6
-
7
- import { stylesheet } from './src/style/stylesheet.js';
8
- import { initImagePreview } from './src/utils/createPreviewTools.js';
9
-
10
- export class EaImage extends Base {
11
- #wrap;
12
-
13
- #img;
14
- #imgSlot;
15
-
16
- constructor() {
17
- super();
18
-
19
- const shadowRoot = this.attachShadow({ mode: 'open' });
20
- shadowRoot.innerHTML = `
21
- <div class='ea-image_wrap' part='container'>
22
- <img part='image' class='ea-image' />
23
- <div class='ea-image_placeholder-wrap' part='placeholder-wrap'>
24
- <slot name='placeholder'></slot>
25
- </div>
26
- </div>
27
- `;
28
-
29
- this.#wrap = shadowRoot.querySelector('.ea-image_wrap');
30
- this.#img = shadowRoot.querySelector('.ea-image');
31
- this.#imgSlot = shadowRoot.querySelector('slot[name="placeholder"]');
32
-
33
- this.build(shadowRoot, stylesheet);
34
- }
35
-
36
- // ------- src 图片的路径 -------
37
- // #region
38
- get src() {
39
- return this.getAttribute('src') || "";
40
- }
41
-
42
- set src(src) {
43
- this.setAttribute('src', src);
44
- }
45
- // #endregion
46
- // ------- end -------
47
-
48
- // ------- width 图片宽度 -------
49
- // #region
50
- get width() {
51
- return this.getAttribute('width') || "100px";
52
- }
53
-
54
- set width(value) {
55
- this.setAttribute('width', value);
56
-
57
- this.#wrap.style.width = value;
58
- }
59
- // #endregion
60
- // ------- end -------
61
-
62
- // ------- height 图片高度 -------
63
- // #region
64
- get height() {
65
- return this.getAttribute('height') || "100px";
66
- }
67
-
68
- set height(value) {
69
- this.setAttribute('height', value);
70
-
71
- this.#wrap.style.height = value;
72
- }
73
- // #endregion
74
- // ------- end -------
75
-
76
- // ------- alt 图片描述 -------
77
- // #region
78
- get alt() {
79
- return this.getAttribute('alt') || "";
80
- }
81
-
82
- set alt(value) {
83
- this.setAttribute('alt', value);
84
-
85
- this.#img.alt = value;
86
- }
87
- // #endregion
88
- // ------- end -------
89
-
90
- // ------- fit 图片缩放模式 -------
91
- // #region
92
- get fit() {
93
- return this.getAttribute('fit') || "cover";
94
- }
95
-
96
- set fit(value) {
97
- this.setAttribute('fit', value);
98
-
99
- this.#img.style.objectFit = value;
100
- }
101
- // #endregion
102
- // ------- end -------
103
-
104
- // ------- lazy 图片懒加载 -------
105
- // #region
106
- get lazy() {
107
- return this.getAttrBoolean('lazy');
108
- }
109
-
110
- set lazy(value) {
111
- if (!value) return;
112
-
113
- this.setAttribute('lazy', value);
114
- }
115
- // #endregion
116
- // ------- end -------
117
-
118
- // ------- preview 大图预览 -------
119
- // #region
120
- get preview() {
121
- return this.getAttrBoolean('preview');
122
- }
123
-
124
- set preview(value) {
125
- if (!value) return;
126
- this.setAttribute('preview', value);
127
- }
128
- // #endregion
129
- // ------- end -------
130
-
131
- #initImageLoadEvent() {
132
- const image = new Image();
133
-
134
- if (this.lazy) {
135
- const observer = new IntersectionObserver((entries) => {
136
- if (entries[0].intersectionRatio <= 0) return;
137
-
138
- image.src = this.src;
139
- observer.disconnect();
140
- });
141
-
142
- observer.observe(this.#wrap);
143
- } else {
144
- image.src = this.src;
145
- }
146
-
147
- image.onload = () => {
148
- this.#img.setAttribute('src', this.src);
149
- this.#imgSlot.remove();
150
-
151
- this.dispatchEvent(new CustomEvent('load', { detail: { src: this.src } }));
152
- };
153
-
154
- image.onerror = () => {
155
- this.#wrap.innerHTML = errorImage;
156
- this.#wrap.classList.add('is-error');
157
- this.#imgSlot.remove();
158
-
159
- this.dispatchEvent(new CustomEvent('error', { detail: { src: this.src } }));
160
- };
161
- }
162
-
163
- connectedCallback() {
164
- this.width = this.width;
165
- this.height = this.height;
166
- this.fit = this.fit;
167
- this.alt = this.alt;
168
-
169
- this.lazy = this.lazy;
170
- this.src = this.src;
171
-
172
- this.preview = this.preview;
173
-
174
- initImagePreview(this.#wrap, this.#img, this.preview);
175
-
176
- this.#initImageLoadEvent();
177
- }
178
- }
179
-
180
- if (!customElements.get('ea-image')) {
181
- customElements.define('ea-image', EaImage);
182
- }
@@ -1,111 +0,0 @@
1
- @import "../ea-ui-base-style.scss";
2
-
3
- .ea-image_wrap {
4
- align-content: center;
5
- text-align: center;
6
- &.is-error {
7
- background-color: #f5f7fa;
8
- svg {
9
- width: 20px;
10
- height: 20px;
11
- }
12
- }
13
-
14
- img {
15
- position: relative;
16
- width: 100%;
17
- height: 100%;
18
-
19
- user-zoom: scale;
20
-
21
- object-fit: cover;
22
- transition: rotate 0.3s, scale 0.3s;
23
- }
24
-
25
- .ea-image_preview-wrap {
26
- position: fixed;
27
- top: 0;
28
- left: 0;
29
-
30
- width: 100%;
31
- height: 100%;
32
-
33
- z-index: 999;
34
-
35
- opacity: 0;
36
- transform: translateY(-1rem);
37
- transition: opacity 0.3s, transform 0.3s;
38
- background-color: rgba(0, 0, 0, 0.4);
39
-
40
- &.entry {
41
- opacity: 1;
42
- transform: translateY(0);
43
- }
44
-
45
- .ea-icon-close {
46
- position: absolute;
47
- right: 40px;
48
- top: 40px;
49
-
50
- cursor: pointer;
51
- width: 40px;
52
- height: 40px;
53
-
54
- font-size: 24px;
55
- line-height: 36px;
56
- border-radius: 50%;
57
- color: #fff;
58
- background-color: #606266;
59
- text-align: center;
60
- }
61
-
62
- img {
63
- width: 100%;
64
- height: 100%;
65
-
66
- object-fit: contain;
67
- }
68
- }
69
-
70
- .ea-image_preview-tools {
71
- display: flex;
72
- align-items: center;
73
- justify-content: space-around;
74
-
75
- position: absolute;
76
- bottom: 20px;
77
- left: 50%;
78
-
79
- padding: 0.5rem 1rem;
80
-
81
- user-select: none;
82
-
83
- border-radius: 999px;
84
-
85
- transform: translateX(-50%);
86
-
87
- background-color: #60626691;
88
- color: #fff;
89
-
90
- .ea-icon-zoom,
91
- .ea-icon-rotate {
92
- width: 2rem;
93
- text-align: center;
94
- cursor: pointer;
95
-
96
- margin: 0 1rem;
97
- }
98
-
99
- .ea-icon-zoom {
100
- font-size: 2rem;
101
- }
102
-
103
- .ea-icon-zoom-in {
104
- font-size: 1.75rem;
105
- }
106
-
107
- .ea-icon-rotate {
108
- font-size: 1.5rem;
109
- }
110
- }
111
- }
@@ -1,9 +0,0 @@
1
- export const errorImage = `
2
- <svg id="errorImage" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" part="error-image">
3
- <path fill="#c0c4cc" d="M0 0h100v100H0z" />
4
- <path fill="#fff" d="M15 20h70v60H15z" />
5
- <circle r="8" cx="32" cy="35" fill="#c0c4cc" />
6
- <path d="M60 42.5L39 75h42z" fill="#c0c4cc" />
7
- <path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />
8
- </svg>
9
- `;
@@ -1,7 +0,0 @@
1
- <svg id="errorImage" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
2
- <path fill="#c0c4cc" d="M0 0h100v100H0z" />
3
- <path fill="#fff" d="M15 20h70v60H15z" />
4
- <circle r="8" cx="32" cy="35" fill="#c0c4cc" />
5
- <path d="M60 42.5L39 75h42z" fill="#c0c4cc" />
6
- <path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />
7
- </svg>
@@ -1,86 +0,0 @@
1
- export const stylesheet = `
2
- .ea-image_wrap {
3
- align-content: center;
4
- text-align: center;
5
- }
6
- .ea-image_wrap.is-error {
7
- background-color: #f5f7fa;
8
- }
9
- .ea-image_wrap.is-error svg {
10
- width: 20px;
11
- height: 20px;
12
- }
13
- .ea-image_wrap img {
14
- position: relative;
15
- width: 100%;
16
- height: 100%;
17
- user-zoom: scale;
18
- object-fit: cover;
19
- transition: rotate 0.3s, scale 0.3s;
20
- }
21
- .ea-image_wrap .ea-image_preview-wrap {
22
- position: fixed;
23
- top: 0;
24
- left: 0;
25
- width: 100%;
26
- height: 100%;
27
- z-index: 999;
28
- opacity: 0;
29
- transform: translateY(-1rem);
30
- transition: opacity 0.3s, transform 0.3s;
31
- background-color: rgba(0, 0, 0, 0.4);
32
- }
33
- .ea-image_wrap .ea-image_preview-wrap.entry {
34
- opacity: 1;
35
- transform: translateY(0);
36
- }
37
- .ea-image_wrap .ea-image_preview-wrap .ea-icon-close {
38
- position: absolute;
39
- right: 40px;
40
- top: 40px;
41
- cursor: pointer;
42
- width: 40px;
43
- height: 40px;
44
- font-size: 24px;
45
- line-height: 36px;
46
- border-radius: 50%;
47
- color: #fff;
48
- background-color: #606266;
49
- text-align: center;
50
- }
51
- .ea-image_wrap .ea-image_preview-wrap img {
52
- width: 100%;
53
- height: 100%;
54
- object-fit: contain;
55
- }
56
- .ea-image_wrap .ea-image_preview-tools {
57
- display: flex;
58
- align-items: center;
59
- justify-content: space-around;
60
- position: absolute;
61
- bottom: 20px;
62
- left: 50%;
63
- padding: 0.5rem 1rem;
64
- user-select: none;
65
- border-radius: 999px;
66
- transform: translateX(-50%);
67
- background-color: rgba(96, 98, 102, 0.568627451);
68
- color: #fff;
69
- }
70
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom,
71
- .ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {
72
- width: 2rem;
73
- text-align: center;
74
- cursor: pointer;
75
- margin: 0 1rem;
76
- }
77
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom {
78
- font-size: 2rem;
79
- }
80
- .ea-image_wrap .ea-image_preview-tools .ea-icon-zoom-in {
81
- font-size: 1.75rem;
82
- }
83
- .ea-image_wrap .ea-image_preview-tools .ea-icon-rotate {
84
- font-size: 1.5rem;
85
- }
86
- `;
@@ -1,140 +0,0 @@
1
-
2
-
3
- import { createElement } from "../../../../utils/createElement.js";
4
-
5
- function handlePreviewDisplay(wrap) {
6
- wrap.classList.remove('entry');
7
-
8
- wrap.addEventListener('transitionend', () => {
9
- wrap.remove();
10
- document.body.style.overflow = 'auto';
11
- })
12
- }
13
-
14
- /**
15
- * 创建一个图片预览的关闭按钮
16
- *
17
- * @returns {HTMLElement} 返回创建的关闭按钮元素
18
- */
19
- function createCloseBtn(wrap) {
20
- const closeBtn = createElement('ea-icon', 'ea-icon-close');
21
- closeBtn.part = 'close-btn';
22
- closeBtn.icon = 'icon-cancel';
23
-
24
- closeBtn.addEventListener('click', () => {
25
- handlePreviewDisplay(wrap);
26
- });
27
-
28
- // 返回创建的关闭按钮元素
29
- return closeBtn;
30
- }
31
-
32
- /**
33
- * 构建图片预览工具
34
- * @param {HTMLElement} img 图片元素
35
- */
36
- function handleImageDrag(wrap, img) {
37
- let startX = 0;
38
- let startY = 0;
39
-
40
- function handleMouseMove(e) {
41
- const { clientX, clientY } = e;
42
-
43
- img.style.marginLeft = `${clientX - startX}px`;
44
- img.style.marginTop = `${clientY - startY}px`;
45
- }
46
-
47
- img.addEventListener('dragstart', (e) => {
48
- e.preventDefault();
49
- });
50
-
51
- img.addEventListener('mousedown', (e) => {
52
- startX = e.clientX;
53
- startY = e.clientY;
54
-
55
- img.addEventListener('mousemove', handleMouseMove);
56
-
57
- img.addEventListener('mouseup', () => {
58
- img.removeEventListener('mousemove', handleMouseMove);
59
- });
60
- });
61
- }
62
-
63
- /**
64
- * 创建一个图片预览的关闭按钮
65
- *
66
- * @param {HTMLElement} img 图片元素
67
- * @returns {HTMLElement} 返回创建的关闭按钮元素
68
- */
69
- function createPreviewTools(img) {
70
- const toolsWrap = createElement('div', 'ea-image_preview-tools');
71
- toolsWrap.part = 'tools-wrap';
72
- toolsWrap.innerHTML = `
73
- <span class="ea-icon-zoom ea-icon-zoom-in" part="zoom-in">+</span>
74
- <span class="ea-icon-zoom ea-icon-zoom-out" part="zoom-out">-</span>
75
- <span class="ea-icon-rotate ea-icon-rotate-left" part="rotate-left">↺</span>
76
- <span class="ea-icon-rotate ea-icon-rotate-right" part="rotate-righ">↻</span>
77
- `;
78
-
79
- const zoomInBtn = toolsWrap.querySelector('.ea-icon-zoom-in');
80
- zoomInBtn.addEventListener('click', () => {
81
- img.style.scale = img.style.scale ? Number(img.style.scale) + 0.2 : 1.2;
82
- });
83
-
84
- const zoomOutBtn = toolsWrap.querySelector('.ea-icon-zoom-out');
85
- zoomOutBtn.addEventListener('click', () => {
86
- img.style.scale = img.style.scale ? Number(img.style.scale) - 0.2 : 0.8;
87
- });
88
-
89
- const rotateLeft = toolsWrap.querySelector('.ea-icon-rotate-left');
90
- rotateLeft.addEventListener('click', () => {
91
- img.style.rotate = (img.style.rotate ? Number(img.style.rotate.split('deg')[0]) - 90 : -90) + "deg";
92
- });
93
-
94
- const rotateRight = toolsWrap.querySelector('.ea-icon-rotate-right');
95
- rotateRight.addEventListener('click', () => {
96
- img.style.rotate = (img.style.rotate ? Number(img.style.rotate.split('deg')[0]) + 90 : 90) + "deg";
97
- });
98
-
99
-
100
- return toolsWrap;
101
- }
102
-
103
-
104
- /**
105
- * 处理图片预览功能。
106
- * 当isPreview参数为true时,为图片添加点击事件监听器,以实现预览功能。
107
- * 预览功能包括:克隆图片元素、设置图片样式、处理图片拖动、创建关闭按钮和工具栏、以及隐藏滚动条。
108
- * @param {boolean} isPreview - 是否开启图片预览功能。
109
- */
110
- export function initImagePreview(container, img, isPreview) {
111
- if (isPreview) {
112
- img.addEventListener('click', () => {
113
- // 克隆图片元素以用于预览,并设置图片的object-fit属性为contain。
114
- img = img.cloneNode(true);
115
- img.style.objectFit = "contain";
116
-
117
- // 创建预览包装元素,并将克隆的图片添加到其中。
118
- const wrap = createElement('div', 'ea-image_preview-wrap', [img]);
119
- wrap.part = 'preview-wrap';
120
- container.appendChild(wrap);
121
-
122
- // 创建并添加关闭按钮到预览窗口。
123
- const closeBtn = createCloseBtn(wrap);
124
- wrap.appendChild(closeBtn);
125
-
126
- // 创建并添加预览工具栏到预览窗口。
127
- const toolkit = createPreviewTools(img, wrap);
128
- wrap.appendChild(toolkit);
129
-
130
- // 延迟20毫秒后添加动画入口类,以平滑地显示预览窗口。
131
- setTimeout(() => {
132
- wrap.classList.add('entry');
133
- }, 20)
134
-
135
- handleImageDrag(wrap, img);
136
-
137
- document.body.style.overflow = 'hidden';
138
- });
139
- }
140
- }
File without changes