easy-component-ui 2.0.4 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -0
  3. package/build/components/Base.js +1 -0
  4. package/build/components/ea-alert/index.js +1 -0
  5. package/build/components/ea-alert/src/style/stylesheet.js +1 -0
  6. package/build/components/ea-aside/index.js +1 -0
  7. package/build/components/ea-avatar/index.js +1 -0
  8. package/build/components/ea-avatar/src/assets/defaultAvatar.js +1 -0
  9. package/build/components/ea-avatar/src/assets/errorAvatar.js +1 -0
  10. package/build/components/ea-avatar/src/assets/iconAndTextAvatar.js +1 -0
  11. package/build/components/ea-avatar/src/style/stylesheet.js +1 -0
  12. package/build/components/ea-backtop/index.js +1 -0
  13. package/build/components/ea-backtop/src/style/stylesheet.js +1 -0
  14. package/build/components/ea-badge/index.js +1 -0
  15. package/build/components/ea-badge/src/style/stylesheet.js +1 -0
  16. package/build/components/ea-breadcrumb/index.js +1 -0
  17. package/build/components/ea-breadcrumb/src/style/stylesheet.js +1 -0
  18. package/build/components/ea-breadcrumb-item/index.js +1 -0
  19. package/build/components/ea-breadcrumb-item/src/style/style.js +1 -0
  20. package/build/components/ea-button/index.js +1 -0
  21. package/build/components/ea-button/src/components/ButtonComm.js +1 -0
  22. package/build/components/ea-button/src/components/HrefComm.js +1 -0
  23. package/build/components/ea-button/src/style/stylesheet.js +1 -0
  24. package/build/components/ea-button-group/index.js +1 -0
  25. package/build/components/ea-button-group/src/style/stylesheet.js +1 -0
  26. package/build/components/ea-calendar/index.js +1 -0
  27. package/build/components/ea-calendar/src/style/stylesheet.js +1 -0
  28. package/build/components/ea-calendar/src/utils/createChangerElement.js +1 -0
  29. package/build/components/ea-calendar/src/utils/createThead.js +1 -0
  30. package/build/components/ea-calendar/src/utils/getDate.js +1 -0
  31. package/build/components/ea-calendar/src/utils/getUserWeekStart.js +1 -0
  32. package/build/components/ea-card/index.js +1 -0
  33. package/build/components/ea-card/src/style/stylesheet.js +1 -0
  34. package/build/components/ea-carousel/index.js +1 -0
  35. package/build/components/ea-carousel/src/style/stylesheet.js +1 -0
  36. package/build/components/ea-carousel/src/utils/handleIndexOverflow.js +1 -0
  37. package/build/components/ea-carousel-item/index.js +1 -0
  38. package/build/components/ea-carousel-item/src/style/stylesheet.js +1 -0
  39. package/build/components/ea-checkbox/index.js +1 -0
  40. package/build/components/ea-checkbox/src/style/stylesheet.js +1 -0
  41. package/build/components/ea-checkbox-group/index.js +1 -0
  42. package/build/components/ea-checkbox-group/src/style/stylesheet.js +1 -0
  43. package/build/components/ea-collapse/index.js +1 -0
  44. package/build/components/ea-collapse-item/index.js +1 -0
  45. package/build/components/ea-collapse-item/src/style/stylesheet.js +1 -0
  46. package/build/components/ea-container/index.js +1 -0
  47. package/build/components/ea-date-picker/index.js +1 -0
  48. package/build/components/ea-date-picker/src/style/stylesheet.js +1 -0
  49. package/build/components/ea-descriptions/index.js +1 -0
  50. package/build/components/ea-descriptions/src/components/contentTemplate.js +1 -0
  51. package/build/components/ea-descriptions/src/components/getTdTemplate_border.js +1 -0
  52. package/build/components/ea-descriptions/src/components/getTdTemplate_direction.js +1 -0
  53. package/build/components/ea-descriptions/src/components/getThTemplate_direction.js +1 -0
  54. package/build/components/ea-descriptions/src/components/getThTemplate_normal.js +1 -0
  55. package/build/components/ea-descriptions/src/style/stylesheet.js +1 -0
  56. package/build/components/ea-descriptions-item/index.js +1 -0
  57. package/build/components/ea-descriptions-item/src/stylesheet.js +1 -0
  58. package/build/components/ea-drawer/index.js +1 -0
  59. package/build/components/ea-drawer/src/style/stylesheet.js +1 -0
  60. package/build/components/ea-empty/index.js +1 -0
  61. package/build/components/ea-empty/src/assets/emptyStatusSVG.js +1 -0
  62. package/build/components/ea-empty/src/style/stylesheet.js +1 -0
  63. package/build/components/ea-footer/index.js +1 -0
  64. package/build/components/ea-form/index.js +1 -0
  65. package/build/components/ea-form-item/index.js +1 -0
  66. package/build/components/ea-form-item/src/style/stylesheet.js +1 -0
  67. package/build/components/ea-header/index.js +1 -0
  68. package/build/components/ea-icon/config.json +1030 -0
  69. package/{components/ea-icon/css/fontello-codes.css → build/components/ea-icon/css/fontello.css} +312 -123
  70. package/build/components/ea-icon/font/fontello.eot +0 -0
  71. package/build/components/ea-icon/font/fontello.svg +350 -0
  72. package/build/components/ea-icon/font/fontello.ttf +0 -0
  73. package/build/components/ea-icon/font/fontello.woff +0 -0
  74. package/build/components/ea-icon/font/fontello.woff2 +0 -0
  75. package/build/components/ea-icon/index.css +1 -0
  76. package/build/components/ea-icon/index.js +1 -0
  77. package/build/components/ea-image/index.js +1 -0
  78. package/build/components/ea-image/src/assets/errorImage.js +1 -0
  79. package/build/components/ea-image/src/style/stylesheet.js +1 -0
  80. package/build/components/ea-image/src/utils/createPreviewTools.js +1 -0
  81. package/build/components/ea-infinite-scroll/index.js +1 -0
  82. package/build/components/ea-infinite-scroll-item/index.js +1 -0
  83. package/build/components/ea-input/index.js +1 -0
  84. package/build/components/ea-input/src/components/createFixIcon.js +1 -0
  85. package/build/components/ea-input/src/components/createSuggestionBoard.js +1 -0
  86. package/build/components/ea-input/src/components/createWordLimitElement.js +1 -0
  87. package/build/components/ea-input/src/style/stylesheet.js +1 -0
  88. package/build/components/ea-input/src/utils/dispatchEvent.js +1 -0
  89. package/build/components/ea-input/src/utils/handleSearchResult.js +1 -0
  90. package/build/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +1 -0
  91. package/build/components/ea-input-number/index.js +1 -0
  92. package/build/components/ea-input-number/src/style/stylesheet.js +1 -0
  93. package/build/components/ea-input-number/src/utils/handleCustomEvent.js +1 -0
  94. package/build/components/ea-link/index.js +1 -0
  95. package/build/components/ea-link/src/style/stylesheet.js +1 -0
  96. package/build/components/ea-loading/index.js +1 -0
  97. package/build/components/ea-loading/src/style/stylesheet.js +1 -0
  98. package/build/components/ea-main/index.js +1 -0
  99. package/build/components/ea-menu/index.js +1 -0
  100. package/build/components/ea-menu/src/style/stylesheet.js +1 -0
  101. package/build/components/ea-menu/src/utils/handleMenuItemEvent.js +1 -0
  102. package/build/components/ea-menu-item/index.js +1 -0
  103. package/build/components/ea-menu-item/src/style/stylesheet.js +1 -0
  104. package/build/components/ea-menu-item-group/index.js +1 -0
  105. package/build/components/ea-menu-item-group/src/style/stylesheet.js +1 -0
  106. package/build/components/ea-message/index.js +1 -0
  107. package/build/components/ea-message/src/style/stylesheet.js +1 -0
  108. package/build/components/ea-message/src/utils/MessageClass.js +1 -0
  109. package/build/components/ea-message-box/index.js +1 -0
  110. package/build/components/ea-message-box/src/style/stylesheet.js +1 -0
  111. package/build/components/ea-message-box/src/utils/EaMessageBoxClass.js +1 -0
  112. package/build/components/ea-option/index.js +1 -0
  113. package/build/components/ea-option/src/style/stylesheet.js +1 -0
  114. package/build/components/ea-option-gropu/index.js +1 -0
  115. package/build/components/ea-page-header/index.js +1 -0
  116. package/build/components/ea-page-header/src/style/stylesheet.js +1 -0
  117. package/build/components/ea-pagination/index.js +1 -0
  118. package/build/components/ea-pagination/src/components/getMoreItem.js +1 -0
  119. package/build/components/ea-pagination/src/components/getPageItem.js +1 -0
  120. package/build/components/ea-pagination/src/components/getShowTotalItem.js +1 -0
  121. package/build/components/ea-pagination/src/style/stylesheet.js +1 -0
  122. package/build/components/ea-pane/index.js +1 -0
  123. package/build/components/ea-pane/src/stylesheet.js +1 -0
  124. package/build/components/ea-progress/index.js +1 -0
  125. package/build/components/ea-progress/src/components/SVGComm.js +1 -0
  126. package/build/components/ea-progress/src/style/stylesheet.js +1 -0
  127. package/build/components/ea-radio/index.js +1 -0
  128. package/build/components/ea-radio/src/style/stylesheet.js +1 -0
  129. package/build/components/ea-radio-group/index.js +1 -0
  130. package/build/components/ea-rate/index.js +1 -0
  131. package/build/components/ea-rate/src/components/rateComm.js +1 -0
  132. package/build/components/ea-rate/src/style/stylesheet.js +1 -0
  133. package/build/components/ea-result/index.js +1 -0
  134. package/build/components/ea-result/src/style/stylesheet.js +1 -0
  135. package/build/components/ea-select/index.js +1 -0
  136. package/build/components/ea-select/src/style/stylesheet.js +1 -0
  137. package/build/components/ea-skeleton/index.js +1 -0
  138. package/build/components/ea-skeleton/src/style/stylesheet.js +1 -0
  139. package/build/components/ea-skeleton/src/utils/createSkeletonElement.js +1 -0
  140. package/build/components/ea-skeleton-item/index.js +1 -0
  141. package/build/components/ea-skeleton-item/src/assets/imageSVG.js +1 -0
  142. package/build/components/ea-skeleton-item/src/style/stylesheet.js +1 -0
  143. package/build/components/ea-step/index.js +1 -0
  144. package/build/components/ea-step/src/style/stylesheet.js +1 -0
  145. package/build/components/ea-steps/index.js +1 -0
  146. package/build/components/ea-steps/src/style/stylesheet.js +1 -0
  147. package/build/components/ea-submenu/index.js +1 -0
  148. package/build/components/ea-submenu/src/style/stylesheet.js +1 -0
  149. package/build/components/ea-switch/index.js +1 -0
  150. package/build/components/ea-switch/src/style/stylesheet.js +1 -0
  151. package/build/components/ea-tab/index.js +1 -0
  152. package/build/components/ea-tab/src/style/stylesheet.js +1 -0
  153. package/build/components/ea-table/index.js +1 -0
  154. package/build/components/ea-table/src/style/stylesheet.js +1 -0
  155. package/build/components/ea-table-column/index.js +1 -0
  156. package/build/components/ea-tabs/index.js +1 -0
  157. package/build/components/ea-tabs/src/style/stylesheet.js +1 -0
  158. package/build/components/ea-tag/index.js +1 -0
  159. package/build/components/ea-tag/src/style/stylesheet.js +1 -0
  160. package/build/components/ea-textarea/index.js +1 -0
  161. package/build/components/ea-textarea/src/style/stylesheet.js +1 -0
  162. package/build/components/ea-time-picker/index.js +1 -0
  163. package/build/components/ea-time-picker/src/style/stylesheet.js +1 -0
  164. package/build/components/ea-timeline/index.js +1 -0
  165. package/build/components/ea-timeline/style/stylesheet.js +1 -0
  166. package/build/components/ea-timeline-item/index.js +1 -0
  167. package/build/components/ea-timeline-item/src/style/stylesheet.js +1 -0
  168. package/build/components/globalConfig.js +1 -0
  169. package/build/components/index.js +1 -0
  170. package/build/utils/Validator.js +1 -0
  171. package/build/utils/createElement.js +1 -0
  172. package/build/utils/handleDefaultAttrIsTrue.js +1 -0
  173. package/build/utils/handleTemplate.js +1 -0
  174. package/build/utils/setStyle.js +1 -0
  175. package/build/utils/timeout.js +1 -0
  176. package/components/Base.js +75 -1
  177. package/components/ea-alert/index.css +91 -0
  178. package/components/ea-alert/index.js +210 -1
  179. package/components/ea-alert/index.scss +108 -0
  180. package/components/ea-alert/src/style/stylesheet.js +85 -1
  181. package/components/ea-aside/index.css +9 -0
  182. package/components/ea-aside/index.js +54 -1
  183. package/components/ea-aside/index.scss +12 -0
  184. package/components/ea-avatar/index.css +66 -0
  185. package/components/ea-avatar/index.js +156 -1
  186. package/components/ea-avatar/index.scss +59 -0
  187. package/components/ea-avatar/src/assets/defaultAvatar.js +12 -1
  188. package/components/ea-avatar/src/assets/errorAvatar.js +9 -1
  189. package/components/ea-avatar/src/assets/iconAndTextAvatar.js +18 -1
  190. package/components/ea-avatar/src/style/stylesheet.js +61 -1
  191. package/components/ea-backtop/index.css +27 -0
  192. package/components/ea-backtop/index.js +167 -1
  193. package/components/ea-backtop/index.scss +29 -0
  194. package/components/ea-backtop/src/style/stylesheet.js +21 -1
  195. package/components/ea-badge/index.css +49 -0
  196. package/components/ea-badge/index.js +103 -1
  197. package/components/ea-badge/index.scss +56 -0
  198. package/components/ea-badge/src/style/stylesheet.js +43 -1
  199. package/components/ea-breadcrumb/index.css +6 -0
  200. package/components/ea-breadcrumb/index.js +90 -1
  201. package/components/ea-breadcrumb/index.scss +7 -0
  202. package/components/ea-breadcrumb/src/style/stylesheet.js +8 -1
  203. package/components/ea-breadcrumb-item/index.css +10 -0
  204. package/components/ea-breadcrumb-item/index.js +23 -1
  205. package/components/ea-breadcrumb-item/index.scss +12 -0
  206. package/components/ea-breadcrumb-item/src/style/style.js +12 -1
  207. package/components/ea-button/index.css +206 -0
  208. package/components/ea-button/index.js +198 -1
  209. package/components/ea-button/index.scss +143 -0
  210. package/components/ea-button/src/components/ButtonComm.js +5 -1
  211. package/components/ea-button/src/components/HrefComm.js +5 -1
  212. package/components/ea-button/src/style/stylesheet.js +208 -1
  213. package/components/ea-button-group/index.css +16 -0
  214. package/components/ea-button-group/index.js +44 -1
  215. package/components/ea-button-group/index.scss +20 -0
  216. package/components/ea-button-group/src/style/stylesheet.js +18 -1
  217. package/components/ea-calendar/index.css +72 -0
  218. package/components/ea-calendar/index.js +298 -1
  219. package/components/ea-calendar/index.scss +106 -0
  220. package/components/ea-calendar/src/style/stylesheet.js +74 -1
  221. package/components/ea-calendar/src/utils/createChangerElement.js +10 -1
  222. package/components/ea-calendar/src/utils/createThead.js +18 -1
  223. package/components/ea-calendar/src/utils/getDate.js +11 -1
  224. package/components/ea-calendar/src/utils/getUserWeekStart.js +11 -1
  225. package/components/ea-card/index.css +25 -0
  226. package/components/ea-card/index.js +51 -1
  227. package/components/ea-card/index.scss +24 -0
  228. package/components/ea-card/src/style/stylesheet.js +19 -1
  229. package/components/ea-carousel/index.css +103 -0
  230. package/components/ea-carousel/index.js +222 -1
  231. package/components/ea-carousel/index.scss +140 -0
  232. package/components/ea-carousel/src/style/stylesheet.js +105 -1
  233. package/components/ea-carousel/src/utils/handleIndexOverflow.js +9 -1
  234. package/components/ea-carousel-item/index.css +20 -0
  235. package/components/ea-carousel-item/index.js +23 -1
  236. package/components/ea-carousel-item/index.scss +26 -0
  237. package/components/ea-carousel-item/src/style/stylesheet.js +22 -1
  238. package/components/ea-checkbox/index.css +108 -0
  239. package/components/ea-checkbox/index.js +160 -1
  240. package/components/ea-checkbox/index.scss +141 -0
  241. package/components/ea-checkbox/src/style/stylesheet.js +110 -1
  242. package/components/ea-checkbox-group/index.css +6 -0
  243. package/components/ea-checkbox-group/index.js +120 -1
  244. package/components/ea-checkbox-group/index.scss +7 -0
  245. package/components/ea-checkbox-group/src/style/stylesheet.js +8 -1
  246. package/components/ea-collapse/index.css +0 -0
  247. package/components/ea-collapse/index.js +109 -1
  248. package/components/ea-collapse/index.scss +4 -0
  249. package/components/ea-collapse-item/index.css +31 -0
  250. package/components/ea-collapse-item/index.js +111 -1
  251. package/components/ea-collapse-item/index.scss +46 -0
  252. package/components/ea-collapse-item/src/style/stylesheet.js +33 -1
  253. package/components/ea-container/index.css +14 -0
  254. package/components/ea-container/index.js +85 -1
  255. package/components/ea-container/index.scss +18 -0
  256. package/components/ea-date-picker/index.css +17 -0
  257. package/components/ea-date-picker/index.js +191 -1
  258. package/components/ea-date-picker/index.scss +29 -0
  259. package/components/ea-date-picker/src/style/stylesheet.js +19 -1
  260. package/components/ea-descriptions/index.css +33 -0
  261. package/components/ea-descriptions/index.js +171 -1
  262. package/components/ea-descriptions/index.scss +45 -0
  263. package/components/ea-descriptions/src/components/contentTemplate.js +11 -1
  264. package/components/ea-descriptions/src/components/getTdTemplate_border.js +6 -1
  265. package/components/ea-descriptions/src/components/getTdTemplate_direction.js +7 -1
  266. package/components/ea-descriptions/src/components/getThTemplate_direction.js +7 -1
  267. package/components/ea-descriptions/src/components/getThTemplate_normal.js +8 -1
  268. package/components/ea-descriptions/src/style/stylesheet.js +35 -1
  269. package/components/ea-descriptions-item/index.css +21 -0
  270. package/components/ea-descriptions-item/index.js +71 -1
  271. package/components/ea-descriptions-item/index.scss +29 -0
  272. package/components/ea-descriptions-item/src/stylesheet.js +23 -1
  273. package/components/ea-drawer/index.css +138 -0
  274. package/components/ea-drawer/index.js +251 -1
  275. package/components/ea-drawer/index.scss +208 -0
  276. package/components/ea-drawer/src/style/stylesheet.js +141 -1
  277. package/components/ea-empty/index.css +30 -0
  278. package/components/ea-empty/index.js +93 -1
  279. package/components/ea-empty/index.scss +30 -0
  280. package/components/ea-empty/src/assets/emptyStatusSVG.js +6 -1
  281. package/components/ea-empty/src/style/stylesheet.js +24 -1
  282. package/components/ea-footer/index.css +7 -0
  283. package/components/ea-footer/index.js +57 -1
  284. package/components/ea-footer/index.scss +10 -0
  285. package/components/ea-form/index.css +0 -0
  286. package/components/ea-form/index.js +121 -1
  287. package/components/ea-form/index.scss +0 -0
  288. package/components/ea-form-item/index.css +62 -0
  289. package/components/ea-form-item/index.js +152 -1
  290. package/components/ea-form-item/index.scss +83 -0
  291. package/components/ea-form-item/src/style/stylesheet.js +64 -1
  292. package/components/ea-header/index.css +7 -0
  293. package/components/ea-header/index.js +55 -1
  294. package/components/ea-header/index.scss +10 -0
  295. package/components/ea-icon/css/fontello.css +312 -226
  296. package/components/ea-icon/index.css +1 -2
  297. package/components/ea-icon/index.js +84 -1
  298. package/components/ea-image/index.css +84 -0
  299. package/components/ea-image/index.js +182 -1
  300. package/components/ea-image/index.scss +111 -0
  301. package/components/ea-image/src/assets/errorImage.js +9 -1
  302. package/components/ea-image/src/assets/errorImage.svg +7 -0
  303. package/components/ea-image/src/style/stylesheet.js +86 -1
  304. package/components/ea-image/src/utils/createPreviewTools.js +140 -1
  305. package/components/ea-infinite-scroll/index.css +0 -0
  306. package/components/ea-infinite-scroll/index.js +119 -1
  307. package/components/ea-infinite-scroll/index.scss +0 -0
  308. package/components/ea-infinite-scroll-item/index.css +0 -0
  309. package/components/ea-infinite-scroll-item/index.js +18 -1
  310. package/components/ea-infinite-scroll-item/index.scss +0 -0
  311. package/components/ea-input/index.css +139 -0
  312. package/components/ea-input/index.js +398 -1
  313. package/components/ea-input/index.scss +178 -0
  314. package/components/ea-input/src/components/createFixIcon.js +108 -1
  315. package/components/ea-input/src/components/createSuggestionBoard.js +43 -1
  316. package/components/ea-input/src/components/createWordLimitElement.js +18 -1
  317. package/components/ea-input/src/style/stylesheet.js +141 -1
  318. package/components/ea-input/src/utils/dispatchEvent.js +9 -1
  319. package/components/ea-input/src/utils/handleSearchResult.js +9 -1
  320. package/components/ea-input/src/utils/handleSuggestionBoardTrigger.js +31 -1
  321. package/components/ea-input-number/index.css +120 -0
  322. package/components/ea-input-number/index.js +308 -1
  323. package/components/ea-input-number/index.scss +132 -0
  324. package/components/ea-input-number/src/style/stylesheet.js +122 -1
  325. package/components/ea-input-number/src/utils/handleCustomEvent.js +5 -1
  326. package/components/ea-link/index.css +48 -0
  327. package/components/ea-link/index.js +122 -1
  328. package/components/ea-link/index.scss +36 -0
  329. package/components/ea-link/src/style/stylesheet.js +50 -1
  330. package/components/ea-loading/index.css +38 -0
  331. package/components/ea-loading/index.js +166 -1
  332. package/components/ea-loading/index.scss +55 -0
  333. package/components/ea-loading/src/style/stylesheet.js +40 -1
  334. package/components/ea-main/index.css +8 -0
  335. package/components/ea-main/index.js +32 -1
  336. package/components/ea-main/index.scss +11 -0
  337. package/components/ea-menu/index.css +19 -0
  338. package/components/ea-menu/index.js +131 -1
  339. package/components/ea-menu/index.scss +22 -0
  340. package/components/ea-menu/src/style/stylesheet.js +21 -1
  341. package/components/ea-menu/src/utils/handleMenuItemEvent.js +32 -1
  342. package/components/ea-menu-item/index.css +48 -0
  343. package/components/ea-menu-item/index.js +130 -1
  344. package/components/ea-menu-item/index.scss +62 -0
  345. package/components/ea-menu-item/src/style/stylesheet.js +50 -1
  346. package/components/ea-menu-item-group/index.css +42 -0
  347. package/components/ea-menu-item-group/index.js +130 -1
  348. package/components/ea-menu-item-group/index.scss +60 -0
  349. package/components/ea-menu-item-group/src/style/stylesheet.js +44 -1
  350. package/components/ea-message/index.css +47 -0
  351. package/components/ea-message/index.js +171 -1
  352. package/components/ea-message/index.scss +70 -0
  353. package/components/ea-message/src/style/stylesheet.js +48 -1
  354. package/components/ea-message/src/utils/MessageClass.js +67 -1
  355. package/components/ea-message-box/index.css +85 -0
  356. package/components/ea-message-box/index.js +211 -1
  357. package/components/ea-message-box/index.scss +113 -0
  358. package/components/ea-message-box/src/style/stylesheet.js +87 -1
  359. package/components/ea-message-box/src/utils/EaMessageBoxClass.js +60 -1
  360. package/components/ea-option/index.css +24 -0
  361. package/components/ea-option/index.js +74 -1
  362. package/components/ea-option/index.scss +31 -0
  363. package/components/ea-option/src/style/stylesheet.js +26 -1
  364. package/components/ea-option-gropu/index.css +6 -0
  365. package/components/ea-option-gropu/index.js +57 -1
  366. package/components/ea-option-gropu/index.scss +8 -0
  367. package/components/ea-page-header/index.css +33 -0
  368. package/components/ea-page-header/index.js +91 -1
  369. package/components/ea-page-header/index.scss +44 -0
  370. package/components/ea-page-header/src/style/stylesheet.js +35 -1
  371. package/components/ea-pagination/index.css +69 -0
  372. package/components/ea-pagination/index.js +305 -1
  373. package/components/ea-pagination/index.scss +89 -0
  374. package/components/ea-pagination/src/components/getMoreItem.js +20 -1
  375. package/components/ea-pagination/src/components/getPageItem.js +11 -1
  376. package/components/ea-pagination/src/components/getShowTotalItem.js +7 -1
  377. package/components/ea-pagination/src/style/stylesheet.js +71 -1
  378. package/components/ea-pane/index.css +6 -0
  379. package/components/ea-pane/index.js +52 -1
  380. package/components/ea-pane/index.scss +7 -0
  381. package/components/ea-pane/src/stylesheet.js +8 -1
  382. package/components/ea-progress/index.css +61 -0
  383. package/components/ea-progress/index.js +249 -1
  384. package/components/ea-progress/index.scss +74 -0
  385. package/components/ea-progress/src/components/SVGComm.js +18 -1
  386. package/components/ea-progress/src/style/stylesheet.js +55 -1
  387. package/components/ea-radio/index.css +82 -0
  388. package/components/ea-radio/index.js +137 -1
  389. package/components/ea-radio/index.scss +119 -0
  390. package/components/ea-radio/src/style/stylesheet.js +84 -1
  391. package/components/ea-radio-group/index.css +3 -0
  392. package/components/ea-radio-group/index.js +96 -1
  393. package/components/ea-radio-group/index.scss +3 -0
  394. package/components/ea-rate/index.css +44 -0
  395. package/components/ea-rate/index.js +243 -1
  396. package/components/ea-rate/index.scss +55 -0
  397. package/components/ea-rate/src/components/rateComm.js +20 -1
  398. package/components/ea-rate/src/style/stylesheet.js +45 -1
  399. package/components/ea-result/index.css +37 -0
  400. package/components/ea-result/index.js +109 -1
  401. package/components/ea-result/index.scss +46 -0
  402. package/components/ea-result/src/style/stylesheet.js +39 -1
  403. package/components/ea-select/index.css +47 -0
  404. package/components/ea-select/index.js +312 -1
  405. package/components/ea-select/index.scss +70 -0
  406. package/components/ea-select/src/style/stylesheet.js +49 -1
  407. package/components/ea-skeleton/index.css +12 -0
  408. package/components/ea-skeleton/index.js +148 -1
  409. package/components/ea-skeleton/index.scss +16 -0
  410. package/components/ea-skeleton/src/style/stylesheet.js +14 -1
  411. package/components/ea-skeleton/src/utils/createSkeletonElement.js +7 -1
  412. package/components/ea-skeleton-item/index.css +69 -0
  413. package/components/ea-skeleton-item/index.js +82 -1
  414. package/components/ea-skeleton-item/index.scss +107 -0
  415. package/components/ea-skeleton-item/src/assets/imageSVG.js +8 -1
  416. package/components/ea-skeleton-item/src/style/stylesheet.js +71 -1
  417. package/components/ea-step/index.css +84 -0
  418. package/components/ea-step/index.js +230 -1
  419. package/components/ea-step/index.scss +110 -0
  420. package/components/ea-step/src/style/stylesheet.js +86 -1
  421. package/components/ea-steps/index.css +19 -0
  422. package/components/ea-steps/index.js +104 -1
  423. package/components/ea-steps/index.scss +23 -0
  424. package/components/ea-steps/src/style/stylesheet.js +21 -1
  425. package/components/ea-submenu/index.css +65 -0
  426. package/components/ea-submenu/index.js +141 -1
  427. package/components/ea-submenu/index.scss +88 -0
  428. package/components/ea-submenu/src/style/stylesheet.js +67 -1
  429. package/components/ea-switch/index.css +90 -0
  430. package/components/ea-switch/index.js +189 -1
  431. package/components/ea-switch/index.scss +117 -0
  432. package/components/ea-switch/src/style/stylesheet.js +92 -1
  433. package/components/ea-tab/index.css +68 -0
  434. package/components/ea-tab/index.js +138 -1
  435. package/components/ea-tab/index.scss +96 -0
  436. package/components/ea-tab/src/style/stylesheet.js +70 -1
  437. package/components/ea-table/index.css +98 -0
  438. package/components/ea-table/index.js +555 -1
  439. package/components/ea-table/index.scss +90 -0
  440. package/components/ea-table/src/style/stylesheet.js +100 -1
  441. package/components/ea-table-column/index.css +0 -0
  442. package/components/ea-table-column/index.js +164 -1
  443. package/components/ea-table-column/index.scss +0 -0
  444. package/components/ea-tabs/index.css +45 -0
  445. package/components/ea-tabs/index.js +245 -1
  446. package/components/ea-tabs/index.scss +64 -0
  447. package/components/ea-tabs/src/style/stylesheet.js +47 -1
  448. package/components/ea-tag/index.css +90 -0
  449. package/components/ea-tag/index.js +107 -1
  450. package/components/ea-tag/index.scss +71 -0
  451. package/components/ea-tag/src/style/stylesheet.js +92 -1
  452. package/components/ea-textarea/index.css +37 -0
  453. package/components/ea-textarea/index.js +277 -1
  454. package/components/ea-textarea/index.scss +48 -0
  455. package/components/ea-textarea/src/style/stylesheet.js +39 -1
  456. package/components/ea-time-picker/index.css +82 -0
  457. package/components/ea-time-picker/index.js +379 -1
  458. package/components/ea-time-picker/index.scss +110 -0
  459. package/components/ea-time-picker/src/style/stylesheet.js +84 -1
  460. package/components/ea-timeline/index.css +0 -0
  461. package/components/ea-timeline/index.js +74 -1
  462. package/components/ea-timeline/index.scss +1 -0
  463. package/components/ea-timeline/style/stylesheet.js +3 -1
  464. package/components/ea-timeline-item/index.css +79 -0
  465. package/components/ea-timeline-item/index.js +146 -1
  466. package/components/ea-timeline-item/index.scss +92 -0
  467. package/components/ea-timeline-item/src/style/stylesheet.js +81 -1
  468. package/components/ea-ui-base-style.css +0 -0
  469. package/components/ea-ui-base-style.scss +153 -0
  470. package/components/globalConfig.js +10 -0
  471. package/components/index.js +67 -0
  472. package/package.json +1 -1
  473. package/public/logo.png +0 -0
  474. package/utils/Validator.js +16 -1
  475. package/utils/createElement.js +30 -1
  476. package/utils/handleDefaultAttrIsTrue.js +11 -1
  477. package/utils/handleTemplate.js +19 -1
  478. package/utils/setStyle.js +8 -1
  479. package/utils/timeout.js +16 -1
  480. package/components/ea-icon/css/animation.css +0 -85
  481. package/components/ea-icon/css/fontello-embedded.css +0 -181
  482. package/components/ea-icon/css/fontello-ie7-codes.css +0 -123
  483. package/components/ea-icon/css/fontello-ie7.css +0 -134
@@ -1 +1,131 @@
1
- import{timeout}from"../../utils/timeout.js";import{handleMenuItemEvent}from"./src/utils/handleMenuItemEvent.js";import{stylesheet}from"./src/style/stylesheet.js";import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-menu-item/index.js";import"../ea-submenu/index.js";import"../ea-menu-item-group/index.js";export class EaMenu extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-menu_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#t=t.querySelector(".ea-menu_wrap"),this.build(t,stylesheet)}get mode(){return this.getAttribute("mode")||"vertical"}set mode(t){this.setAttribute("mode",t),this.#t.classList.toggle("is-vertical","vertical"===t),this.querySelectorAll("ea-submenu").forEach((e=>{e.mode=t}))}get backgroundColor(){return this.getAttribute("background-color")||"#fff"}set backgroundColor(t){this.setAttribute("background-color",t),this.#t.style.backgroundColor=t}get textColor(){return this.getAttribute("text-color")||"#303133"}set textColor(t){this.setAttribute("text-color",t)}get activeTextColor(){return this.getAttribute("active-text-color")||"#409eff"}set activeTextColor(t){this.setAttribute("active-text-color",t)}get collapse(){return this.getAttrBoolean("collapse")}set collapse(t){this.toggleAttr("collapse",t),this.querySelectorAll("ea-menu-item-group").forEach((e=>{"vertical"===this.mode&&(e.collapse=!t)}))}connectedCallback(){this.mode=this.mode,this.collapse=!0,this.backgroundColor=this.backgroundColor,this.textColor=this.textColor,this.activeTextColor=this.activeTextColor;const t=this.querySelectorAll("ea-menu-item"),e=this.querySelectorAll("ea-submenu"),o=this.querySelectorAll("ea-menu-item-group");handleMenuItemEvent.call(this,t,e,o);const r=(t,e)=>{t.backgroundColor=this.backgroundColor,t.textColor=this.textColor,t.activeTextColor=this.activeTextColor};t.forEach(r),e.forEach(r),o.forEach(r)}}customElements.get("ea-menu")||customElements.define("ea-menu",EaMenu);
1
+ // @ts-nocheck
2
+ import { timeout } from '../../utils/timeout.js';
3
+ import { handleMenuItemEvent } from './src/utils/handleMenuItemEvent.js';
4
+
5
+ import { stylesheet } from './src/style/stylesheet.js';
6
+
7
+ import Base from '../Base.js';
8
+ import '../ea-icon/index.js'
9
+ import "../ea-menu-item/index.js"
10
+ import "../ea-submenu/index.js"
11
+ import "../ea-menu-item-group/index.js"
12
+
13
+ export class EaMenu extends Base {
14
+ #wrap;
15
+ constructor() {
16
+ super();
17
+
18
+ const shadowRoot = this.attachShadow({ mode: 'open' });
19
+ shadowRoot.innerHTML = `
20
+ <div class="ea-menu_wrap" part="container">
21
+ <slot></slot>
22
+ </div>
23
+ `;
24
+
25
+ this.#wrap = shadowRoot.querySelector('.ea-menu_wrap');
26
+
27
+ this.build(shadowRoot, stylesheet);
28
+ }
29
+
30
+ // ------- mode 顶栏排列方式 -------
31
+ // #region
32
+ get mode() {
33
+ return this.getAttribute('mode') || 'vertical';
34
+ }
35
+
36
+ set mode(value) {
37
+ this.setAttribute('mode', value);
38
+
39
+ this.#wrap.classList.toggle('is-vertical', value === 'vertical');
40
+ this.querySelectorAll('ea-submenu').forEach((item) => {
41
+ item.mode = value;
42
+ });
43
+ }
44
+ // #endregion
45
+ // ------- end -------
46
+
47
+ // ------- background-color 背景颜色 -------
48
+ // #region
49
+ get backgroundColor() {
50
+ return this.getAttribute('background-color') || '#fff';
51
+ }
52
+
53
+ set backgroundColor(value) {
54
+ this.setAttribute('background-color', value);
55
+
56
+ this.#wrap.style.backgroundColor = value;
57
+ }
58
+ // #endregion
59
+ // ------- end -------
60
+
61
+ // ------- text-color 文字颜色 -------
62
+ // #region
63
+ get textColor() {
64
+ return this.getAttribute('text-color') || '#303133';
65
+ }
66
+
67
+ set textColor(value) {
68
+ this.setAttribute('text-color', value);
69
+ }
70
+ // #endregion
71
+ // ------- end -------
72
+
73
+ // ------- active-text-color 激活文字颜色 -------
74
+ // #region
75
+ get activeTextColor() {
76
+ return this.getAttribute('active-text-color') || '#409eff';
77
+ }
78
+
79
+ set activeTextColor(value) {
80
+ this.setAttribute('active-text-color', value);
81
+ }
82
+ // #endregion
83
+ // ------- end -------
84
+
85
+ // ------- collapse 是否折叠 -------
86
+ // #region
87
+ get collapse() {
88
+ return this.getAttrBoolean('collapse');
89
+ }
90
+
91
+ set collapse(value) {
92
+ this.toggleAttr('collapse', value);
93
+
94
+ this.querySelectorAll('ea-menu-item-group').forEach((item) => {
95
+ if (this.mode === 'vertical') item.collapse = !value;
96
+ });
97
+ }
98
+ // #endregion
99
+ // ------- end -------
100
+
101
+ connectedCallback() {
102
+ this.mode = this.mode;
103
+
104
+ this.collapse = true;
105
+
106
+ this.backgroundColor = this.backgroundColor;
107
+ this.textColor = this.textColor;
108
+ this.activeTextColor = this.activeTextColor;
109
+
110
+ const menuItems = this.querySelectorAll('ea-menu-item');
111
+ const subMenuItems = this.querySelectorAll('ea-submenu');
112
+ const menuItemGroups = this.querySelectorAll('ea-menu-item-group');
113
+
114
+ handleMenuItemEvent.call(this, menuItems, subMenuItems, menuItemGroups);
115
+
116
+ const callback = (item, index) => {
117
+ item.backgroundColor = this.backgroundColor;
118
+ item.textColor = this.textColor;
119
+ item.activeTextColor = this.activeTextColor;
120
+ }
121
+ menuItems.forEach(callback);
122
+
123
+ subMenuItems.forEach(callback);
124
+
125
+ menuItemGroups.forEach(callback);
126
+ }
127
+ }
128
+
129
+ if (!customElements.get('ea-menu')) {
130
+ customElements.define('ea-menu', EaMenu);
131
+ }
@@ -0,0 +1,22 @@
1
+ .ea-menu_wrap {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ padding: 0 20px;
6
+
7
+ &.is-vertical {
8
+ flex-direction: column;
9
+ align-items: flex-start;
10
+ border-right: 1px solid #e6e6e6;
11
+ overflow: auto;
12
+
13
+ ::slotted(ea-menu-item),
14
+ ::slotted(ea-submenu) {
15
+ width: 100%;
16
+ }
17
+
18
+ ::slotted(ea-submenu) {
19
+ width: 100%;
20
+ }
21
+ }
22
+ }
@@ -1 +1,21 @@
1
- export const stylesheet="\n.ea-menu_wrap {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 20px;\n}\n.ea-menu_wrap.is-vertical {\n flex-direction: column;\n align-items: flex-start;\n border-right: 1px solid #e6e6e6;\n overflow: auto;\n}\n.ea-menu_wrap.is-vertical ::slotted(ea-menu-item),\n.ea-menu_wrap.is-vertical ::slotted(ea-submenu) {\n width: 100%;\n}\n.ea-menu_wrap.is-vertical ::slotted(ea-submenu) {\n width: 100%;\n}\n";
1
+ export const stylesheet = `
2
+ .ea-menu_wrap {
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ padding: 0 20px;
7
+ }
8
+ .ea-menu_wrap.is-vertical {
9
+ flex-direction: column;
10
+ align-items: flex-start;
11
+ border-right: 1px solid #e6e6e6;
12
+ overflow: auto;
13
+ }
14
+ .ea-menu_wrap.is-vertical ::slotted(ea-menu-item),
15
+ .ea-menu_wrap.is-vertical ::slotted(ea-submenu) {
16
+ width: 100%;
17
+ }
18
+ .ea-menu_wrap.is-vertical ::slotted(ea-submenu) {
19
+ width: 100%;
20
+ }
21
+ `;
@@ -1 +1,32 @@
1
- const callback=e=>{e.actived=!1};function cancelItemActived(e,t,c){e.forEach(callback),t.forEach(callback),c.forEach(callback)}export function handleMenuItemEvent(e,t,c){e.forEach(((a,n)=>{a.itemIndex=n,a.addEventListener("item-selected",(l=>{const i=l.detail.title;cancelItemActived(e,t,c),a.actived=!0,this.dispatchEvent(new CustomEvent("select",{detail:{index:n,title:i}}))}))}))}
1
+ const callback = (item) => {
2
+ item.actived = false;
3
+ }
4
+
5
+ function cancelItemActived(menuItems, subMenuItems, menuItemGroups) {
6
+ menuItems.forEach(callback);
7
+
8
+ subMenuItems.forEach(callback);
9
+
10
+ menuItemGroups.forEach(callback);
11
+ }
12
+
13
+ export function handleMenuItemEvent(menuItems, subMenuItems, menuItemGroups) {
14
+ menuItems.forEach((item, index) => {
15
+ item.itemIndex = index;
16
+
17
+ item.addEventListener('item-selected', (e) => {
18
+ const itemTitle = e.detail.title;
19
+
20
+ cancelItemActived(menuItems, subMenuItems, menuItemGroups);
21
+
22
+ item.actived = true;
23
+
24
+ this.dispatchEvent(new CustomEvent('select', {
25
+ detail: {
26
+ index,
27
+ title: itemTitle,
28
+ },
29
+ }));
30
+ });
31
+ });
32
+ }
@@ -0,0 +1,48 @@
1
+ .ea-menu-item_wrap {
2
+ --normal-bgc: #fff;
3
+ --normal-text-color: #303133;
4
+ --actived-text-color: #409eff;
5
+ --actived-bgc: #fff;
6
+ box-sizing: border-box;
7
+ padding: 0 20px;
8
+ border-bottom: 2px solid;
9
+ border-color: transparent;
10
+ height: 60px;
11
+ line-height: 60px;
12
+ font-size: 14px;
13
+ color: var(--normal-text-color);
14
+ background-color: var(--normal-bgc);
15
+ white-space: nowrap;
16
+ overflow: hidden;
17
+ text-overflow: ellipsis;
18
+ cursor: pointer;
19
+ transition: border-color 0.3s, background-color 0.3s, color 0.3s;
20
+ }
21
+ .ea-menu-item_wrap.is-actived {
22
+ color: var(--actived-text-color);
23
+ border-color: var(--actived-text-color);
24
+ }
25
+ .ea-menu-item_wrap.is-actived ::slotted(a) {
26
+ color: var(--actived-text-color);
27
+ }
28
+ .ea-menu-item_wrap.is-sub-actived {
29
+ color: var(--actived-text-color);
30
+ }
31
+ .ea-menu-item_wrap.is-sub-actived ::slotted(a) {
32
+ color: var(--actived-text-color);
33
+ }
34
+ .ea-menu-item_wrap.is-disabled {
35
+ color: #c0c4cc;
36
+ pointer-events: none;
37
+ cursor: not-allowed;
38
+ }
39
+ .ea-menu-item_wrap.is-disabled ::slotted(a) {
40
+ color: #c0c4cc;
41
+ }
42
+ .ea-menu-item_wrap ::slotted(a) {
43
+ color: var(--normal-text-color);
44
+ text-decoration: none;
45
+ white-space: nowrap;
46
+ overflow: hidden;
47
+ text-overflow: ellipsis;
48
+ }
@@ -1 +1,130 @@
1
- import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaMenuItem extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-menu-item_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#t=t.querySelector(".ea-menu-item_wrap"),this.build(t,stylesheet)}get actived(){return this.getAttrBoolean("actived")}set actived(t){this.setAttribute("actived",t),this.isSubItem?this.#t.classList.toggle("is-sub-actived",t):this.#t.classList.toggle("is-actived",t)}get isSubItem(){return this.getAttrBoolean("is-sub-item")}set isSubItem(t){t&&this.setAttribute("is-sub-item",t)}get backgroundColor(){return this.getAttribute("background-color")||"#fff"}set backgroundColor(t){this.setAttribute("background-color",t),this.#t.style.setProperty("--normal-bgc",t)}get textColor(){return this.getAttribute("text-color")||"#303133"}set textColor(t){this.setAttribute("text-color",t),this.#t.style.setProperty("--normal-text-color",t)}get activeTextColor(){return this.getAttribute("active-text-color")||"#409eff"}set activeTextColor(t){this.setAttribute("active-text-color",t),this.#t.style.setProperty("--actived-text-color",t)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#t.classList.toggle("is-disabled",t)}connectedCallback(){this.actived=this.actived,this.disabled=this.disabled,this.#t.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("item-selected",{detail:{index:this.index,title:this.textContent}}))}))}}customElements.get("ea-menu-item")||customElements.define("ea-menu-item",EaMenuItem);
1
+ // @ts-nocheck
2
+ import Base from '../Base.js';
3
+ import '../ea-icon/index.js'
4
+
5
+ import { stylesheet } from './src/style/stylesheet.js';
6
+
7
+ export class EaMenuItem extends Base {
8
+ #wrap;
9
+
10
+ constructor() {
11
+ super();
12
+
13
+ const shadowRoot = this.attachShadow({ mode: 'open' });
14
+ shadowRoot.innerHTML = `
15
+ <div class="ea-menu-item_wrap" part="container">
16
+ <slot></slot>
17
+ </div>
18
+ `;
19
+
20
+ this.#wrap = shadowRoot.querySelector('.ea-menu-item_wrap');
21
+
22
+ this.build(shadowRoot, stylesheet);
23
+ }
24
+
25
+ // ------- actived 菜单激活状态 -------
26
+ // #region
27
+ get actived() {
28
+ return this.getAttrBoolean('actived');
29
+ }
30
+
31
+ set actived(value) {
32
+ this.setAttribute('actived', value);
33
+
34
+ if (this.isSubItem) {
35
+ this.#wrap.classList.toggle('is-sub-actived', value);
36
+ } else {
37
+ this.#wrap.classList.toggle('is-actived', value);
38
+ }
39
+ }
40
+ // #endregion
41
+ // ------- end -------
42
+
43
+ // ------- isSubItem 是否为子菜单 -------
44
+ // #region
45
+ get isSubItem() {
46
+ return this.getAttrBoolean('is-sub-item');
47
+ }
48
+ set isSubItem(value) {
49
+ if (!value) return;
50
+
51
+ this.setAttribute('is-sub-item', value);
52
+ }
53
+ // #endregion
54
+ // ------- end -------
55
+
56
+ // ------- background-color 背景颜色 -------
57
+ // #region
58
+ get backgroundColor() {
59
+ return this.getAttribute('background-color') || '#fff';
60
+ }
61
+
62
+ set backgroundColor(value) {
63
+ this.setAttribute('background-color', value);
64
+
65
+ this.#wrap.style.setProperty('--normal-bgc', value);
66
+ }
67
+ // #endregion
68
+ // ------- end -------
69
+
70
+ // ------- text-color 文字颜色 -------
71
+ // #region
72
+ get textColor() {
73
+ return this.getAttribute('text-color') || '#303133';
74
+ }
75
+
76
+ set textColor(value) {
77
+ this.setAttribute('text-color', value);
78
+
79
+ this.#wrap.style.setProperty('--normal-text-color', value);
80
+ }
81
+ // #endregion
82
+ // ------- end -------
83
+
84
+ // ------- active-text-color 激活文字颜色 -------
85
+ // #region
86
+ get activeTextColor() {
87
+ return this.getAttribute('active-text-color') || '#409eff';
88
+ }
89
+
90
+ set activeTextColor(value) {
91
+ this.setAttribute('active-text-color', value);
92
+
93
+ this.#wrap.style.setProperty('--actived-text-color', value);
94
+ }
95
+ // #endregion
96
+ // ------- end -------
97
+
98
+ // ------- disabled 禁用 -------
99
+ // #region
100
+ get disabled() {
101
+ return this.getAttrBoolean('disabled');
102
+ }
103
+
104
+ set disabled(value) {
105
+ this.setAttribute('disabled', value);
106
+
107
+ this.#wrap.classList.toggle('is-disabled', value);
108
+ }
109
+ // #endregion
110
+ // ------- end -------
111
+
112
+ connectedCallback() {
113
+ this.actived = this.actived;
114
+
115
+ this.disabled = this.disabled;
116
+
117
+ this.#wrap.addEventListener('click', () => {
118
+ this.dispatchEvent(new CustomEvent('item-selected', {
119
+ detail: {
120
+ index: this.index,
121
+ title: this.textContent,
122
+ },
123
+ }));
124
+ });
125
+ }
126
+ }
127
+
128
+ if (!customElements.get('ea-menu-item')) {
129
+ customElements.define('ea-menu-item', EaMenuItem);
130
+ }
@@ -0,0 +1,62 @@
1
+ .ea-menu-item_wrap {
2
+ --normal-bgc: #fff;
3
+ --normal-text-color: #303133;
4
+
5
+ --actived-text-color: #409eff;
6
+ --actived-bgc: #fff;
7
+
8
+ box-sizing: border-box;
9
+ padding: 0 20px;
10
+ border-bottom: 2px solid;
11
+ border-color: transparent;
12
+
13
+ height: 60px;
14
+ line-height: 60px;
15
+
16
+ font-size: 14px;
17
+ color: var(--normal-text-color);
18
+ background-color: var(--normal-bgc);
19
+ white-space: nowrap;
20
+ overflow: hidden;
21
+ text-overflow: ellipsis;
22
+
23
+ cursor: pointer;
24
+
25
+ transition: border-color 0.3s, background-color 0.3s, color 0.3s;
26
+
27
+ &.is-actived {
28
+ color: var(--actived-text-color);
29
+ border-color: var(--actived-text-color);
30
+
31
+ ::slotted(a) {
32
+ color: var(--actived-text-color);
33
+ }
34
+ }
35
+
36
+ &.is-sub-actived {
37
+ color: var(--actived-text-color);
38
+
39
+ ::slotted(a) {
40
+ color: var(--actived-text-color);
41
+ }
42
+ }
43
+
44
+ &.is-disabled {
45
+ color: #c0c4cc;
46
+ pointer-events: none;
47
+ cursor: not-allowed;
48
+
49
+ ::slotted(a) {
50
+ color: #c0c4cc;
51
+ }
52
+ }
53
+
54
+ ::slotted(a) {
55
+ color: var(--normal-text-color);
56
+ text-decoration: none;
57
+
58
+ white-space: nowrap;
59
+ overflow: hidden;
60
+ text-overflow: ellipsis;
61
+ }
62
+ }
@@ -1 +1,50 @@
1
- export const stylesheet="\n.ea-menu-item_wrap {\n --normal-bgc: #fff;\n --normal-text-color: #303133;\n --actived-text-color: #409eff;\n --actived-bgc: #fff;\n box-sizing: border-box;\n padding: 0 20px;\n border-bottom: 2px solid;\n border-color: transparent;\n height: 60px;\n line-height: 60px;\n font-size: 14px;\n color: var(--normal-text-color);\n background-color: var(--normal-bgc);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n transition: border-color 0.3s, background-color 0.3s, color 0.3s;\n}\n.ea-menu-item_wrap.is-actived {\n color: var(--actived-text-color);\n border-color: var(--actived-text-color);\n}\n.ea-menu-item_wrap.is-actived ::slotted(a) {\n color: var(--actived-text-color);\n}\n.ea-menu-item_wrap.is-sub-actived {\n color: var(--actived-text-color);\n}\n.ea-menu-item_wrap.is-sub-actived ::slotted(a) {\n color: var(--actived-text-color);\n}\n.ea-menu-item_wrap.is-disabled {\n color: #c0c4cc;\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-menu-item_wrap.is-disabled ::slotted(a) {\n color: #c0c4cc;\n}\n.ea-menu-item_wrap ::slotted(a) {\n color: var(--normal-text-color);\n text-decoration: none;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n";
1
+ export const stylesheet = `
2
+ .ea-menu-item_wrap {
3
+ --normal-bgc: #fff;
4
+ --normal-text-color: #303133;
5
+ --actived-text-color: #409eff;
6
+ --actived-bgc: #fff;
7
+ box-sizing: border-box;
8
+ padding: 0 20px;
9
+ border-bottom: 2px solid;
10
+ border-color: transparent;
11
+ height: 60px;
12
+ line-height: 60px;
13
+ font-size: 14px;
14
+ color: var(--normal-text-color);
15
+ background-color: var(--normal-bgc);
16
+ white-space: nowrap;
17
+ overflow: hidden;
18
+ text-overflow: ellipsis;
19
+ cursor: pointer;
20
+ transition: border-color 0.3s, background-color 0.3s, color 0.3s;
21
+ }
22
+ .ea-menu-item_wrap.is-actived {
23
+ color: var(--actived-text-color);
24
+ border-color: var(--actived-text-color);
25
+ }
26
+ .ea-menu-item_wrap.is-actived ::slotted(a) {
27
+ color: var(--actived-text-color);
28
+ }
29
+ .ea-menu-item_wrap.is-sub-actived {
30
+ color: var(--actived-text-color);
31
+ }
32
+ .ea-menu-item_wrap.is-sub-actived ::slotted(a) {
33
+ color: var(--actived-text-color);
34
+ }
35
+ .ea-menu-item_wrap.is-disabled {
36
+ color: #c0c4cc;
37
+ pointer-events: none;
38
+ cursor: not-allowed;
39
+ }
40
+ .ea-menu-item_wrap.is-disabled ::slotted(a) {
41
+ color: #c0c4cc;
42
+ }
43
+ .ea-menu-item_wrap ::slotted(a) {
44
+ color: var(--normal-text-color);
45
+ text-decoration: none;
46
+ white-space: nowrap;
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ }
50
+ `;
@@ -0,0 +1,42 @@
1
+ .ea-menu-item-group_wrap {
2
+ --normal-bgc: #fff;
3
+ --normal-text-color: #303133;
4
+ --actived-text-color: #409eff;
5
+ --actived-bgc: #fff;
6
+ width: 100%;
7
+ }
8
+ .ea-menu-item-group_wrap.is-actived .ea-submenu_title_wrap {
9
+ color: var(--actived-text-color);
10
+ border-color: var(--actived-text-color);
11
+ }
12
+ .ea-menu-item-group_wrap .ea-submenu_title_wrap {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ width: 100%;
17
+ box-sizing: border-box;
18
+ padding: 0 20px;
19
+ border-bottom: 2px solid;
20
+ border-color: transparent;
21
+ height: 60px;
22
+ line-height: 60px;
23
+ font-size: 14px;
24
+ color: var(--normal-text-color);
25
+ background-color: var(--normal-bgc);
26
+ white-space: nowrap;
27
+ cursor: pointer;
28
+ transition: border-color 0.3s, background-color 0.3s, color 0.3s;
29
+ }
30
+ .ea-menu-item-group_wrap .ea-submenu_items_wrap {
31
+ margin: 0 20px;
32
+ height: 0;
33
+ overflow: hidden;
34
+ transition: height 0.3s;
35
+ }
36
+ .ea-menu-item-group_wrap .ea-submenu_dropdown_icon {
37
+ transform: rotate(-90deg);
38
+ transition: transform 0.3s;
39
+ }
40
+ .ea-menu-item-group_wrap.is-open .ea-submenu_dropdown_icon {
41
+ transform: rotate(0deg);
42
+ }
@@ -1 +1,130 @@
1
- import Base from"../Base.js";import"../ea-icon/index.js";import{timeout}from"../../utils/timeout.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaMenuItemGroup extends Base{#t;#e;#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-menu-item-group_wrap" part="container">\n <div class="ea-submenu_title_wrap" part="title-wrap">\n <slot name="title"></slot>\n <ea-icon class="ea-submenu_dropdown_icon" icon="icon-angle-down" part="dropdown-icon"></ea-icon>\n </div>\n <div class="ea-submenu_items_wrap" part="dropdown-wrap">\n <slot></slot>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-menu-item-group_wrap"),this.#e=t.querySelector(".ea-submenu_title_wrap"),this.#s=t.querySelector(".ea-submenu_items_wrap"),this.build(t,stylesheet)}get actived(){return this.getAttrBoolean("actived")}set actived(t){this.setAttribute("actived",t),this.#t.classList.toggle("is-actived",t)}get backgroundColor(){return this.getAttribute("background-color")||"#fff"}set backgroundColor(t){this.setAttribute("background-color",t),this.#t.style.setProperty("--normal-bgc",t)}get textColor(){return this.getAttribute("text-color")||"#303133"}set textColor(t){this.setAttribute("text-color",t),this.#t.style.setProperty("--normal-text-color",t)}get activeTextColor(){return this.getAttribute("active-text-color")||"#409eff"}set activeTextColor(t){this.setAttribute("active-text-color",t),this.#t.style.setProperty("--actived-text-color",t)}get collapse(){return this.getAttrBoolean("collapse")||!1}set collapse(t){this.setAttribute("collapse",t),this.#s.style.height=t?this.#s.scrollHeight+"px":"0",this.#t.classList.toggle("is-open",t)}connectedCallback(){this.style.width="100%";this.querySelectorAll("ea-menu-item").forEach((t=>{t.isSubItem=!0,t.addEventListener("item-selected",(t=>{timeout((()=>{this.actived=!0}),20)}))})),this.#e.addEventListener("click",(t=>{this.collapse=!this.collapse}))}}customElements.get("ea-menu-item-group")||customElements.define("ea-menu-item-group",EaMenuItemGroup);
1
+ import Base from '../Base.js';
2
+ import '../ea-icon/index.js'
3
+ import { timeout } from '../../utils/timeout.js';
4
+
5
+ import { stylesheet } from './src/style/stylesheet.js';
6
+
7
+ export class EaMenuItemGroup extends Base {
8
+ #wrap;
9
+ #titleWrap;
10
+ #subItemsWrap;
11
+ constructor() {
12
+ super();
13
+
14
+ const shadowRoot = this.attachShadow({ mode: 'open' });
15
+ shadowRoot.innerHTML = `
16
+ <div class="ea-menu-item-group_wrap" part="container">
17
+ <div class="ea-submenu_title_wrap" part="title-wrap">
18
+ <slot name="title"></slot>
19
+ <ea-icon class="ea-submenu_dropdown_icon" icon="icon-angle-down" part="dropdown-icon"></ea-icon>
20
+ </div>
21
+ <div class="ea-submenu_items_wrap" part="dropdown-wrap">
22
+ <slot></slot>
23
+ </div>
24
+ </div>
25
+ `;
26
+
27
+ this.#wrap = shadowRoot.querySelector('.ea-menu-item-group_wrap');
28
+ this.#titleWrap = shadowRoot.querySelector('.ea-submenu_title_wrap');
29
+ this.#subItemsWrap = shadowRoot.querySelector('.ea-submenu_items_wrap');
30
+
31
+ this.build(shadowRoot, stylesheet);
32
+ }
33
+
34
+
35
+ // ------- actived 菜单激活状态 -------
36
+ // #region
37
+ get actived() {
38
+ return this.getAttrBoolean('actived');
39
+ }
40
+
41
+ set actived(value) {
42
+ this.setAttribute('actived', value);
43
+
44
+ this.#wrap.classList.toggle('is-actived', value);
45
+ }
46
+ // #endregion
47
+ // ------- end -------
48
+
49
+
50
+ // ------- background-color 背景颜色 -------
51
+ // #region
52
+ get backgroundColor() {
53
+ return this.getAttribute('background-color') || '#fff';
54
+ }
55
+
56
+ set backgroundColor(value) {
57
+ this.setAttribute('background-color', value);
58
+
59
+ this.#wrap.style.setProperty('--normal-bgc', value);
60
+ }
61
+ // #endregion
62
+ // ------- end -------
63
+
64
+
65
+ // ------- text-color 文字颜色 -------
66
+ // #region
67
+ get textColor() {
68
+ return this.getAttribute('text-color') || '#303133';
69
+ }
70
+
71
+ set textColor(value) {
72
+ this.setAttribute('text-color', value);
73
+
74
+ this.#wrap.style.setProperty('--normal-text-color', value);
75
+ }
76
+ // #endregion
77
+ // ------- end -------
78
+
79
+ // ------- active-text-color 激活文字颜色 -------
80
+ // #region
81
+ get activeTextColor() {
82
+ return this.getAttribute('active-text-color') || '#409eff';
83
+ }
84
+
85
+ set activeTextColor(value) {
86
+ this.setAttribute('active-text-color', value);
87
+
88
+ this.#wrap.style.setProperty('--actived-text-color', value);
89
+ }
90
+ // #endregion
91
+ // ------- end -------
92
+
93
+ // ------- collapse 是否折叠 -------
94
+ // #region
95
+ get collapse() {
96
+ return this.getAttrBoolean('collapse') || false;
97
+ }
98
+
99
+ set collapse(value) {
100
+ this.setAttribute('collapse', value);
101
+
102
+ this.#subItemsWrap.style.height = value ? this.#subItemsWrap.scrollHeight + 'px' : '0';
103
+ this.#wrap.classList.toggle('is-open', value)
104
+ }
105
+ // #endregion
106
+ // ------- end -------
107
+
108
+ connectedCallback() {
109
+ this.style.width = "100%";
110
+
111
+ const items = this.querySelectorAll('ea-menu-item');
112
+ items.forEach((item) => {
113
+ item.isSubItem = true;
114
+
115
+ item.addEventListener('item-selected', (e) => {
116
+ timeout(() => {
117
+ this.actived = true;
118
+ }, 20);
119
+ });
120
+ });
121
+
122
+ this.#titleWrap.addEventListener('click', (e) => {
123
+ this.collapse = !this.collapse;
124
+ });
125
+ }
126
+ }
127
+
128
+ if (!customElements.get('ea-menu-item-group')) {
129
+ customElements.define('ea-menu-item-group', EaMenuItemGroup);
130
+ }