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
@@ -0,0 +1 @@
1
+ export function initTriggerAfterInputEvent(e,t){e.addEventListener("input",(e=>{const n=Array.from(t.querySelectorAll("li")).some(((t,n)=>t.innerText.includes(e.target.value)));t.classList.toggle("is-open",n&&""!==e.target.value)}))}export function initTriggerOnFocusEvent(e,t){t.addEventListener("focus",(t=>{e.classList.add("is-open")}))}
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";import{handleCustomEvent}from"./src/utils/handleCustomEvent.js";export class EaInputNumber extends Base{#t;#e;#i;#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-input-number_wrap" part="container">\n <span class="ea-input-number_sign minus" part="minus-wrap">-</span>\n <input class="ea-input-number_inner" part="input" type="text" />\n <span class="ea-input-number_sign plus" part="plus-wrap">+</span>\n </div>\n ',this.#t=t.querySelector(".ea-input-number_wrap"),this.#e=t.querySelector(".ea-input-number_inner"),this.#i=t.querySelector(".minus"),this.#s=t.querySelector(".plus"),this.build(t,stylesheet)}#n(t,e,i){if(this.getAttrBoolean("disabled"))return;const s=Number(this.#e.value),n=this.#e.value.split(".")[1],u="minus"===t?s-this.step:s+this.step;this.#e.value=e?u.toFixed(e):n?.length?u.toFixed(n.length):u,this.#u(),i&&this.#a("change",u)}#l(t){let e=setInterval((()=>{this.#n(t,this.precision),this.#u()}),100);this.addEventListener("mouseup",(function(){clearInterval(e),e=null}))}#u(){!1===this.min&&!1===this.max||(void 0!==this.min&&this.#e.value<this.min?this.#e.value=this.min:void 0!==this.max&&this.#e.value>this.max&&(this.#e.value=this.max),this.#i.classList.toggle("disabled",this.#e.value==this.min),this.#s.classList.toggle("disabled",this.#e.value==this.max))}#h(){isNaN(Number(this.#e.value))?this.#e.value=this.value:this.value=Number(this.#e.value)}#a(t,e=this.value){handleCustomEvent.call(this,t,{value:e})}get value(){return Number(this.getAttribute("value"))||0}set value(t){t=this.precision?Number(t).toFixed(this.precision):Number(t),this.setAttribute("value",t),this.#e.value=t}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),this.#e.disabled=t,this.#t.classList.toggle("disabled",t),this.style.cursor=t?"not-allowed":"pointer"}get readonly(){return this.getAttrBoolean("readonly")}set readonly(t){t&&(this.#e.readOnly=t)}get step(){return this.getAttrNumber("step")||1}set step(t){t&&this.setAttribute("step",t)}get stepStrictly(){return this.getAttrBoolean("step-strictly")}set stepStrictly(t){this.toggleAttr("step-strictly",t)}get min(){return this.getAttrNumber("min")||-1/0}set min(t){Number.isNaN(t)&&!Number.isFinite(t)&&this.setAttribute("min",t)}get max(){return this.getAttrNumber("max")||1/0}set max(t){t&&this.setAttribute("max",t)}get precision(){const t=this.getAttrNumber("precision");return t<0||!Number.isInteger(t)?0:t}set precision(t){t&&this.setAttribute("precision",t)}get sizeType(){return["medium","small","mini"]}get size(){const t=this.getAttribute("size");return this.sizeType.includes(t)?t:"medium"}set size(t){this.setAttribute("size",t),this.#t.classList.add(`ea-input-number--${t}`)}connectedCallback(){this.style.display="inline-block",this.disabled=this.disabled,this.readonly=this.readonly,this.size=this.size,this.value=this.value,this.min!==-1/0&&(this.value=this.min),this.#u(),this.#e.addEventListener("focus",(t=>{this.#t.classList.add("focus"),this.#a("focus")})),this.#e.addEventListener("blur",(t=>{if(this.#t.classList.remove("focus"),this.stepStrictly){const t=that.step,e=Number(that.#e.value),i=e%t;e<0&&0!==i?that.#e.value=e-i-t:e<0&&0===i||0===i?that.#e.value=e:this.#e.value=e-i+t}this.#u(),this.#a("blur")})),this.#i.addEventListener("click",(()=>{this.#h(),this.#n("minus",this.precision,"minus")})),this.#s.addEventListener("click",(()=>{this.#h(),this.#n("plus",this.precision,"plus")})),this.#i.addEventListener("mousedown",(()=>{this.#h(),this.#l("minus",this.precision)})),this.#s.addEventListener("mousedown",(()=>{this.#h(),this.#l("plus",this.precision)})),this.#e.addEventListener("input",(()=>{this.#h(),this.#u(),this.#a("change")}))}}window.customElements.get("ea-input-number")||window.customElements.define("ea-input-number",EaInputNumber);
@@ -0,0 +1 @@
1
+ export const stylesheet='\n.ea-input-number_wrap {\n display: flex;\n align-items: center;\n border: 1px solid transparent;\n border-radius: 3px;\n transition: border 0.2s;\n}\n.ea-input-number_wrap .ea-input-number_sign {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n border: 1px solid #dcdfe6;\n background-color: #f5f7fa;\n height: 2rem;\n width: 2rem;\n cursor: pointer;\n font-size: 1rem;\n line-height: 1;\n user-select: none;\n}\n.ea-input-number_wrap .ea-input-number_sign:first-child {\n border-top-left-radius: 3px;\n border-bottom-left-radius: 3px;\n border-right: 0;\n}\n.ea-input-number_wrap .ea-input-number_sign:last-child {\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n border-left: 0;\n}\n.ea-input-number_wrap .ea-input-number_sign:hover {\n color: #409eff;\n}\n.ea-input-number_wrap .ea-input-number_sign.disabled {\n pointer-events: none;\n cursor: not-allowed;\n color: #c0c4cc;\n}\n.ea-input-number_wrap .ea-input-number_inner {\n box-sizing: border-box;\n box-shadow: none;\n border: 1px solid #dcdfe6;\n outline: 0;\n transition: border 0.2s;\n border-radius: 3px;\n padding: 0.5rem;\n line-height: 0.8;\n font-size: 0.8rem;\n scrollbar-width: none;\n width: 5rem;\n height: 2rem;\n border-radius: 0;\n text-align: center;\n}\n.ea-input-number_wrap .ea-input-number_inner:focus {\n border-color: #409eff;\n}\n.ea-input-number_wrap .ea-input-number_inner::placeholder {\n color: #c0c4cc;\n}\n.ea-input-number_wrap .ea-input-number_inner.invalid {\n border-color: #f56c6c;\n}\n.ea-input-number_wrap .ea-input-number_inner.disabled {\n background-color: #eeeeee;\n color: #c0c4cc;\n}\n.ea-input-number_wrap .ea-input-number_inner.ea-input_clear ::before {\n content: "e9c3";\n display: block;\n}\n.ea-input-number_wrap .ea-input-number_inner:focus {\n border-color: #dcdfe6;\n}\n.ea-input-number_wrap .ea-input-number_inner.disabled {\n pointer-events: none;\n cursor: not-allowed;\n color: #c0c4cc;\n background-color: #f5f7fa;\n}\n.ea-input-number_wrap.focus {\n border: 1px solid #409eff;\n}\n.ea-input-number_wrap.focus .ea-input-number_sign {\n border-color: transparent;\n}\n.ea-input-number_wrap.disabled {\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-input-number_wrap.disabled .ea-input-number_sign,\n.ea-input-number_wrap.disabled .ea-input-number_inner {\n color: #c0c4cc;\n border-color: #dcdfe6;\n}\n.ea-input-number_wrap.ea-input-number--medium .ea-input-number_sign {\n height: 1.75rem;\n width: 1.75rem;\n}\n.ea-input-number_wrap.ea-input-number--medium .ea-input-number_inner {\n height: 1.75rem;\n line-height: 1.75rem;\n}\n.ea-input-number_wrap.ea-input-number--small .ea-input-number_sign {\n height: 1.5rem;\n width: 1.5rem;\n}\n.ea-input-number_wrap.ea-input-number--small .ea-input-number_inner {\n height: 1.5rem;\n line-height: 1.5rem;\n}\n.ea-input-number_wrap.ea-input-number--mini .ea-input-number_sign {\n height: 1.25rem;\n width: 1.25rem;\n}\n.ea-input-number_wrap.ea-input-number--mini .ea-input-number_inner {\n height: 1.25rem;\n line-height: 1.25rem;\n}\n';
@@ -0,0 +1 @@
1
+ export function handleCustomEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaLink extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <a class="ea-link" part="container">\n <slot></slot>\n </a>\n ',this.#t=t.querySelector(".ea-link"),this.build(t,stylesheet)}get LINK_TYPE(){return["primary","success","info","warning","danger"]}get href(){return this.getAttribute("href")}set href(t){t&&(this.setAttribute("href",t),this.#t.href=t)}get type(){const t=this.getAttribute("type");return this.LINK_TYPE.includes(t)?t:null}set type(t){t&&this.LINK_TYPE.includes(t)&&this.#t.classList.add(t)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#t.classList.toggle("disabled",t),this.style.cursor=t?"not-allowed":"pointer"}get underline(){return this.getAttrBoolean("underline")}set underline(t){this.setAttribute("underline",t),this.#t.classList.toggle("underline",t)}get icon(){return this.getAttribute("icon")}set icon(t){if(!t)return;const e=document.createElement("ea-icon");e.icon=t,this.#t.insertBefore(e,this.#t.firstChild)}connectedCallback(){this.style.display="inline-block",this.href=this.href,this.type=this.type,this.disabled=this.disabled,this.underline=this.underline,this.icon=this.icon}}window.customElements.get("ea-link")||window.customElements.define("ea-link",EaLink);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-link {\n text-decoration: none;\n color: #606266;\n cursor: pointer;\n}\n.ea-link:hover {\n color: #797b80;\n}\n.ea-link.underline:hover {\n text-decoration: underline;\n}\n.ea-link.primary {\n color: #409eff;\n}\n.ea-link.primary:hover {\n color: #73b8ff;\n}\n.ea-link.success {\n color: #67c23a;\n}\n.ea-link.success:hover {\n color: #85cf60;\n}\n.ea-link.info {\n color: #909399;\n}\n.ea-link.info:hover {\n color: #abadb1;\n}\n.ea-link.warning {\n color: #e6a23c;\n}\n.ea-link.warning:hover {\n color: #ecb869;\n}\n.ea-link.danger {\n color: #f56c6c;\n}\n.ea-link.danger:hover {\n color: #f89c9c;\n}\n.ea-link.disabled {\n color: #c0c4cc;\n pointer-events: none;\n}\n.ea-link.disabled:hover {\n color: #dcdee3;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaLoading extends Base{#t;#e;#n;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-loading_wrap" part="container">\n <div class="ea-loading_mask" part="mask-wrap">\n <ea-icon icon="icon-spin6 animate-spin" class="ea-loading_spinner" part="icon"></ea-icon>\n </div>\n <div class="ea-loading_content" part="content-wrap">\n <slot></slot>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-loading_wrap"),this.#e=t.querySelector(".ea-loading_mask"),this.#n=t.querySelector(".ea-loading_spinner"),this.build(t,stylesheet)}get loading(){return this.getAttrBoolean("loading")||!1}set loading(t){this.setAttribute("loading",t),this.#t.classList.toggle("ea-loading_wrap--loading",t),this.#s(this.fullscreen,t,this.lock)}get spinner(){return this.getAttribute("spinner")||"icon-spin6"}set spinner(t){this.setAttribute("spinner",t),this.#n.icon=`${t} animate-spin`}get spinnerSize(){return this.getAttrNumber("spinner-size")||16}set spinnerSize(t){this.setAttribute("spinner-size",t),this.#n.style.fontSize=`${t}px`}get background(){return this.getAttribute("background")||"hsla(0, 0%, 100%, 0.9)"}set background(t){this.setAttribute("background",t),this.#e.style.backgroundColor=t}get text(){return this.getAttribute("text")||""}set text(t){t&&this.setAttribute("text",t)}get fullscreen(){return this.getAttrBoolean("fullscreen")||!1}set fullscreen(t){t&&this.setAttribute("fullscreen",t)}get lock(){return this.getAttrBoolean("lock")||!1}set lock(t){t&&this.setAttribute("lock",t)}#s(t,e,n){t&&(this.#t.classList.toggle("ea-loading_wrap--fullscreen",e),n&&(document.body.style.overflow=e?"hidden":"auto"))}connectedCallback(){if(this.fullscreen=this.fullscreen,this.loading=this.loading,this.spinnerSize=this.spinnerSize,this.spinner=this.spinner,this.background=this.background,this.text){const t=document.createElement("div");t.className="ea-loading_text",t.innerHTML=this.text,this.#e.appendChild(t)}}}customElements.get("ea-loading")||customElements.define("ea-loading",EaLoading);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-loading_wrap {\n position: relative;\n}\n.ea-loading_wrap .ea-loading_mask {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n background-color: hsla(0, 0%, 100%, 0.9);\n z-index: 1;\n transition: background-color 0.2s;\n}\n.ea-loading_wrap .ea-loading_spinner,\n.ea-loading_wrap .ea-loading_text {\n color: #409eff;\n}\n.ea-loading_wrap .ea-loading_spinner {\n font-size: 2rem;\n}\n.ea-loading_wrap .ea-loading_text {\n margin-left: 0.5rem;\n}\n.ea-loading_wrap.ea-loading_wrap--fullscreen {\n position: fixed;\n left: 0;\n top: 0;\n z-index: 3000;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.ea-loading_wrap.ea-loading_wrap--loading .ea-loading_mask {\n display: flex;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";const stylesheet="\n.ea-main_wrap {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n padding: 0 20px;\n overflow: auto;\n color: #333;\n}\n";export class EaMain extends Base{constructor(){super();const n=this.attachShadow({mode:"open"});n.innerHTML='\n <main class="ea-main_wrap" part="container">\n <slot></slot>\n </main>\n ',this.build(n,stylesheet)}}customElements.get("ea-main")||customElements.define("ea-main",EaMain);
@@ -0,0 +1 @@
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);
@@ -0,0 +1 @@
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";
@@ -0,0 +1 @@
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}}))}))}))}
@@ -0,0 +1 @@
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);
@@ -0,0 +1 @@
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";
@@ -0,0 +1 @@
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);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-menu-item-group_wrap {\n --normal-bgc: #fff;\n --normal-text-color: #303133;\n --actived-text-color: #409eff;\n --actived-bgc: #fff;\n width: 100%;\n}\n.ea-menu-item-group_wrap.is-actived .ea-submenu_title_wrap {\n color: var(--actived-text-color);\n border-color: var(--actived-text-color);\n}\n.ea-menu-item-group_wrap .ea-submenu_title_wrap {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\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 cursor: pointer;\n transition: border-color 0.3s, background-color 0.3s, color 0.3s;\n}\n.ea-menu-item-group_wrap .ea-submenu_items_wrap {\n margin: 0 20px;\n height: 0;\n overflow: hidden;\n transition: height 0.3s;\n}\n.ea-menu-item-group_wrap .ea-submenu_dropdown_icon {\n transform: rotate(-90deg);\n transition: transform 0.3s;\n}\n.ea-menu-item-group_wrap.is-open .ea-submenu_dropdown_icon {\n transform: rotate(0deg);\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{createElement}from"../../utils/createElement.js";import"../ea-icon/index.js";import{EaMessage}from"./src/utils/MessageClass.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaMessageElement extends Base{#e;#t;#s;#n;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-message_wrap" part="container">\n <ea-icon class="ea-icon-wrap" part="icon"></ea-icon>\n <div class="ea-text-content" part="content-wrap"></div>\n <ea-icon class="ea-close-icon" icon="icon-cancel"></ea-icon>\n </div>\n ',this.#e=e.querySelector(".ea-message_wrap"),this.wrap=this.#e,this.#t=e.querySelector(".ea-icon-wrap"),this.#s=e.querySelector(".ea-text-content"),this.#n=e.querySelector(".ea-close-icon"),this.closeWrap=this.#n,this.build(e,stylesheet)}get attrs(){return["show","text","icon","type","showClose","center"]}get iconList(){return{success:"icon-ok-circled",error:"icon-cancel-circled",warning:"icon-attention-alt",info:"icon-info"}}get show(){return this.getAttrBoolean("show")}set show(e){this.setAttribute("show",e);const t=document.querySelectorAll("ea-message");if(e){const e=t.length-1,s=this.#e.getBoundingClientRect().height;let n=e<=0?10:10*(e+1);this.#e.style.top=`${e*s+n}px`,this.#e.style.opacity=1}else{this.#e.style.top="-100%",this.#e.style.opacity=0;let e=this.#e.addEventListener("transitionend",(()=>{this.removeEventListener("transitionend",e),this.remove()}))}}get text(){return this.getAttribute("text")}set text(e){e&&(this.setAttribute("text",e),this.#s.innerText=e)}get type(){return this.getAttribute("type")||"info"}set type(e){this.setAttribute("type",e),this.#e.classList.add(`ea-message--${e}`),this.#t.icon=this.iconList[e]}get showClose(){return this.getAttrBoolean("showClose")||!1}set showClose(e){e&&(this.setAttribute("showClose",e),this.#n.style.display=e?"block":"none")}get center(){return this.getAttrBoolean("center")||!1}set center(e){e&&(this.setAttribute("center",e),this.#t.style.marginLeft=e?"auto":"0")}connectedCallback(){this.#n.addEventListener("click",(()=>{this.show=!1}))}disconnectedCallback(){const e=document.querySelectorAll("ea-message");e.length>0&&Array.from(e).forEach(((e,t)=>{const s=e.wrap.getBoundingClientRect().height;e.wrap.style.top=t*s+10*t+"px"}))}}customElements.get("ea-message")||customElements.define("ea-message",EaMessageElement),window.$message=new EaMessage;
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-message_wrap {\n position: fixed;\n left: 50%;\n z-index: 999;\n display: flex;\n align-items: center;\n padding: 15px 15px 15px 20px;\n border: 1px solid #ebeef5;\n border-radius: 4px;\n top: -100%;\n transform-origin: center;\n opacity: 0;\n transform: translate(-50%, 0);\n min-width: 380px;\n overflow: hidden;\n background-color: black;\n transition: opacity 0.3s, top 0.3s;\n}\n.ea-message_wrap .ea-icon-wrap {\n margin-right: 0.5rem;\n line-height: 1;\n}\n.ea-message_wrap .ea-text-content {\n line-height: 1;\n margin-right: auto;\n vertical-align: middle;\n}\n.ea-message_wrap .ea-close-icon {\n margin-left: auto;\n}\n.ea-message_wrap.ea-message--success {\n background-color: #f0f9eb;\n color: #67c23a;\n}\n.ea-message_wrap.ea-message--info {\n background-color: #f4f4f5;\n color: #909399;\n}\n.ea-message_wrap.ea-message--warning {\n background-color: #fdf6ec;\n color: #e6a23c;\n}\n.ea-message_wrap.ea-message--error {\n background-color: #fef0f0;\n color: #f56c6c;\n}\n";
@@ -0,0 +1 @@
1
+ export class EaMessage{handleStringMsg(e,t){e.text=t,e.type="info",e.hasClose=!1}handleObjectMsg(e,t,n){for(const s in t)n.includes(s)&&(e[s]=t[s]);Object.keys(t).includes("type")||(e.type="info")}handleDuration(e,t=3){if(0===t)return;let n=setTimeout((()=>{e.show=!1,clearTimeout(n),n=null}),1e3*t+40)}open(e){const t=document.createElement("ea-message");if(document.body.appendChild(t),"string"==typeof e)this.handleStringMsg(t,e),this.handleDuration(t);else{if("object"!=typeof e)throw new Error("[EaMessage] TypeError");this.handleObjectMsg(t,e,t.attrs),this.handleDuration(t,e.duration)}return t.show=!0,{onClose(e){"function"==typeof e&&t.addEventListener("click",(function(){e()}))}}}}
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{EaMessageBox}from"./src/utils/EaMessageBoxClass.js";import"../ea-button/index.js";import"../ea-input/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaMessageBoxElement extends Base{#t;#e;#n;#o;#a;#i;#s;#r;#c;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-dialog_wrap" part="container" role="dialog">\n <div class="ea-dialog_board" part="dialog-body">\n <div class="ea-dialog_header" part="dialog-header">\n <span class="ea-dialog_header-title" part="dialog-title"></span>\n <ea-icon class="ea-dialog_header-close" icon="icon-cancel" part="close-icon"></ea-icon>\n </div>\n <div class="ea-dialog_content" part="dialog-content">\n <div class="ea-dialog_content-text" part="dialog-content-text"></div>\n <ea-input class="ea-dialog_content-input" part="dialog-input"></ea-input>\n </div>\n <div class="ea-dialog_footer" part="dialog-footer">\n <div class="ea-dialog_footer-cancel-button" part="footer-cancel-button"></div>\n <div class="ea-dialog_footer-confirm-button" part="footer-confirm-button"></div>\n </div>\n </div>\n <div class="ea-dialog_mask" part="mask-wrap"></div>\n </div>\n ',this.#t=t.querySelector(".ea-dialog_wrap"),this.#e=t.querySelector(".ea-dialog_header"),this.#n=t.querySelector(".ea-dialog_content"),this.#o=t.querySelector(".ea-dialog_content-text"),this.#a=t.querySelector(".ea-dialog_content-input"),this.#i=t.querySelector(".ea-dialog_footer"),this.#s=t.querySelector(".ea-dialog_footer-confirm-button"),this.#r=t.querySelector(".ea-dialog_footer-cancel-button"),this.build(t,stylesheet)}get open(){return this.getAttrBoolean("open")}set open(t){this.toggleAttr("open",t),this.#t.style.display=t?"block":"none"}get content(){return this.getAttribute("content")}set content(t){this.#o.innerHTML=t}get isPrompt(){return this.getAttrBoolean("isPrompt")}set isPrompt(t){this.toggleAttr("isPrompt",t),this.#t?.classList.toggle("is-prompt",t)}get reg(){return this.#c}set reg(t){this.isPrompt&&(this.#c=t,this.#a.addEventListener("change",(e=>{const n=e.detail.value;e.target.shadowRoot.querySelector(".ea-input_inner").setAttribute("aria-invalid",!t.test(n)),this.#a.setAttribute("aria-invalid",!t.test(n)),t.test(n)})))}get inputPlaceholder(){return this.getAttribute("input-placeholder")}set inputPlaceholder(t){t&&(this.#a.placeholder=t)}get title(){return this.getAttribute("title")}set title(t){this.#e.innerHTML=t}get confirmButtonText(){return this.getAttribute("confirmButtonText")}set confirmButtonText(t){t&&(this.setAttribute("confirmButtonText",t),this.#s.innerHTML=`<ea-button size="medium" type="primary">${t}</ea-button>`,this.#s.addEventListener("click",(()=>{this.isPrompt?this.dispatchEvent(new CustomEvent("confirm",{detail:{target:this.#a,value:this.#a.value}})):this.dispatchEvent(new CustomEvent("confirm"))})))}get cancelButtonText(){return this.getAttribute("cancelButtonText")}set cancelButtonText(t){t&&(this.setAttribute("cancelButtonText",t),this.#r.innerHTML=`<ea-button size="medium">${t}</ea-button>`,this.#r.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cancel"))})))}connectedCallback(){this.dispatchEvent(new CustomEvent("ready"))}}customElements.get("ea-message-box")||customElements.define("ea-message-box",EaMessageBoxElement);const messageBox=new EaMessageBox(!1);window.$alert=messageBox,window.$confirm=messageBox;const promptBox=new EaMessageBox(!0);window.$prompt=promptBox;
@@ -0,0 +1 @@
1
+ export const stylesheet='\n:host {\n --invalid-message: "";\n}\n\n.ea-dialog_wrap {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 2024;\n}\n.ea-dialog_wrap .ea-dialog_board {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n background-color: #fff;\n width: 420px;\n padding-bottom: 10px;\n border-radius: 4px;\n border: 1px solid #ebeef5;\n box-sizing: 0 2px 12px 0;\n font-size: 18px;\n text-align: left;\n overflow: hidden;\n backface-visibility: hidden;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_header {\n padding: 15px 15px 10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_header .ea-dialog_header-title {\n font-size: 18px;\n line-height: 1;\n color: #303133;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_header .ea-dialog_header-close {\n display: inline-block;\n font-size: 16px;\n color: #909399;\n cursor: pointer;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_content {\n padding: 10px 15px;\n color: #606266;\n font-size: 14px;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_content .ea-dialog_content-input {\n display: none;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_footer {\n padding: 5px 15px 0;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n.ea-dialog_wrap .ea-dialog_board .ea-dialog_footer :first-child {\n margin-right: 0.5rem;\n}\n.ea-dialog_wrap.is-prompt .ea-dialog_board .ea-dialog_content {\n position: relative;\n}\n.ea-dialog_wrap.is-prompt .ea-dialog_board .ea-dialog_content .ea-dialog_content-input {\n margin-top: 15px;\n padding-bottom: 15px;\n display: block;\n}\n.ea-dialog_wrap.is-prompt .ea-dialog_board .ea-dialog_content .ea-dialog_content-input::after {\n content: var(--invalid-message);\n position: absolute;\n display: block;\n bottom: 0;\n transform-origin: top center;\n transform: scaleY(0);\n transition: transform 0.3s;\n}\n.ea-dialog_wrap.is-prompt .ea-dialog_board .ea-dialog_content .ea-dialog_content-input[aria-invalid=true]::after {\n transform-origin: top center;\n transform: scaleY(1);\n color: #f56c6c;\n}\n';
@@ -0,0 +1 @@
1
+ import{createElement}from"../../../../utils/createElement.js";export class EaMessageBox{constructor(e){this.isPrompt=e}get attrs(){return["cancelButtonText","confirmButtonText"]}#e(e,t,r){r.forEach((r=>{t[r]&&(e[r]=t[r])}))}#t(e){e.remove()}open(e,t,r){const s=createElement("ea-message-box");return s.addEventListener("ready",(()=>{this.isPrompt&&(s.isPrompt=!0),s.reg=new RegExp(r.reg),s.style.setProperty("--invalid-message",`"${r.invalidMessage}"`),s.inputPlaceholder=r.inputPlaceholder})),document.body.appendChild(s),s.open=!0,s.content=e,s.title=t,this.#e(s,r,this.attrs),new Promise(((e,t)=>{s.addEventListener("cancel",(()=>{this.#t(s),t()})),s.addEventListener("confirm",(t=>{if(this.isPrompt&&!r.reg.test(t.detail.value))return t.detail.target.setAttribute("aria-invalid",!0),void t.detail.target.focus();this.#t(s),this.isPrompt?e(t.detail.value):e(!0)}))}))}}
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaOption extends Base{#e;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML="\n <div class='ea-option_wrap' part='container'>\n <slot></slot>\n </div>\n ",this.#e=e.querySelector(".ea-option_wrap"),this.build(e,stylesheet)}get value(){return this.getAttribute("value")||""}set value(e){this.setAttribute("value",e)}get checked(){return this.getAttrBoolean("checked")||!1}set checked(e){this.setAttribute("checked",e),this.#e.classList.toggle("is-checked",e)}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(e){this.setAttribute("disabled",e),this.#e.classList.toggle("is-disabled",e)}connectedCallback(){this.value=this.value,this.disabled=this.disabled}}customElements.get("ea-option")||customElements.define("ea-option",EaOption);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-option_wrap {\n position: relative;\n padding: 0 20px;\n height: 30px;\n line-height: 30px;\n font-size: 14px;\n color: #606266;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.ea-option_wrap.is-checked {\n color: #409eff;\n font-weight: 700;\n}\n.ea-option_wrap.is-disabled {\n color: #c0c4cc;\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-option_wrap:hover {\n background-color: #f5f7fa;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";const stylesheet="\n.ea-option-group_wrap .ea-option-group_title {\n padding-left: 20px;\n font-size: 12px;\n color: #909399;\n line-height: 30px;\n}\n";export class EaOptionGroup extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-option-group_wrap' part='container'>\n <div class='ea-option-group_title' part='title-wrap'></div>\n <slot></slot>\n </div>\n ",this.#t=t.querySelector(".ea-option-group_wrap"),this.#e=t.querySelector(".ea-option-group_title"),this.build(t,stylesheet)}get label(){return this.getAttribute("label")||""}set label(t){this.setAttribute("label",t),this.#e.innerHTML=t}connectedCallback(){this.label=this.label}}customElements.get("ea-option-group")||customElements.define("ea-option-group",EaOptionGroup);
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{createSlotElement,createElement}from"../../utils/createElement.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaPageHeader extends Base{#t;#e;#n;#a;#i;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML="\n <div class='ea-page-header_wrap' part='container'>\n <div class='ea-page-header_title-wrap' part='title-wrap'>\n <ea-icon class='ea-page-header_back-icon' part='back-icon' icon=\"icon-angle-left\"></ea-icon>\n <slot name=\"title\"></slot>\n </div>\n <div class='ea-page-header_divider' part='divider'>|</div>\n <div class='ea-page-header_content-wrap' part='content-wrap'>\n <slot name=\"content\"></slot>\n </div>\n </div>\n ",this.#t=t.querySelector(".ea-page-header_wrap"),this.#e=t.querySelector(".ea-page-header_title-wrap"),this.#a=t.querySelector('slot[name="title"]'),this.#n=t.querySelector(".ea-page-header_content-wrap"),this.#i=t.querySelector('slot[name="content"]'),this.build(t,stylesheet)}get title(){return this.getAttribute("title")||""}set title(t){t?(this.setAttribute("title",t),this.#a.innerText=t):(this.setAttribute("title","返回"),this.#a.innerText="返回")}get content(){return this.getAttribute("content")||""}set content(t){t?(this.setAttribute("content",t),this.#i.innerText=t):(this.setAttribute("content",""),this.#i.innerText="")}connectedCallback(){this.title=this.title,this.content=this.content,this.#e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("back"))}))}}customElements.get("ea-page-header")||customElements.define("ea-page-header",EaPageHeader);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-page-header_wrap {\n display: flex;\n align-items: center;\n line-height: 24px;\n}\n.ea-page-header_wrap .ea-page-header_title-wrap,\n.ea-page-header_wrap .ea-page-header_divider,\n.ea-page-header_wrap .ea-page-header_content-wrap {\n line-height: 24px;\n}\n.ea-page-header_wrap .ea-page-header_title-wrap {\n display: flex;\n align-items: center;\n font-size: 14px;\n font-weight: 500;\n line-height: 1;\n cursor: pointer;\n}\n.ea-page-header_wrap .ea-page-header_divider {\n margin: 0 1rem;\n margin-bottom: 1px;\n font-size: 14px;\n height: 14px;\n overflow: hidden;\n color: #dcdfe6;\n line-height: 1;\n vertical-align: middle;\n}\n.ea-page-header_wrap .ea-page-header_content-wrap {\n font-size: 18px;\n color: #303133;\n line-height: 1;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";import{getMoreItem}from"./src/components/getMoreItem.js";import{getPageItem}from"./src/components/getPageItem.js";import{getShowTotalItem}from"./src/components/getShowTotalItem.js";export class EaPagination extends Base{#t;#e;#i;#a;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML=`\n <div class="ea-pagination_wrap" part="container">\n <span class="ea-pagination_arrow prev ${this.background?"background":""}" part="arrow">&lt;</span>\n <div class="ea-pagination_item_wrap" part="item-wrap"></div>\n <span class="ea-pagination_arrow next ${this.background?"background":""}" part="arrow">&gt;</span>\n </div>\n `,this.#t=t.querySelector(".ea-pagination_wrap"),this.#i=t.querySelector(".prev"),this.#e=t.querySelector(".ea-pagination_item_wrap"),this.#a=t.querySelector(".next"),this.build(t,stylesheet)}get layout(){return this.getAttribute("layout").split(",").map((t=>t.trim()))||["prev","pager","next"]}set layout(t){this.setAttribute("layout",t)}get sizes(){return this.getAttrNumber("sizes")||10}set sizes(t){this.setAttribute("sizes",t)}get currentPage(){return this.getAttrNumber("current-page")||1}set currentPage(t){this.setAttribute("current-page",t)}get pageCount(){return this.getAttrNumber("page-count")||6}set pageCount(t){this.setAttribute("page-count",t)}get total(){return this.getAttrNumber("total")}set total(t){this.setAttribute("total",t)}get paginationCount(){return Math.ceil(this.total/this.sizes)}get background(){return this.getAttrBoolean("background")}set background(t){t&&this.setAttribute("background",t)}#n(t,e){this.dispatchEvent(new CustomEvent(t,e))}#s(){this.#r(),this.layout.includes("prev")?this.#i.addEventListener("click",(()=>{this.currentPage<=1||(this.currentPage--,this.#o(),this.#n("change",{detail:{currentPage:this.currentPage}}))})):this.#i.style.display="none",this.layout.includes("next")?this.#a.addEventListener("click",(()=>{this.currentPage>=this.paginationCount||(this.currentPage++,this.#o(),this.#n("change",{detail:{currentPage:this.currentPage}}))})):this.#a.style.display="none"}#r(){(this.layout.includes("prev")||this.layout.includes("next"))&&(1===this.currentPage&&this.layout.includes("prev")?this.#i.classList.add("disabled"):this.currentPage>=this.paginationCount&&this.layout.includes("next")?this.#a.classList.add("disabled"):(this.#i.classList.remove("disabled"),this.#a.classList.remove("disabled")))}#h(t,e){t.addEventListener("click",(t=>{this.currentPage=e,this.#o(),this.#n("change",{detail:{currentPage:this.currentPage}})}))}#g(t,e){t.addEventListener("click",(t=>{this.currentPage+="prev"===e?-5:5,this.currentPage<1?this.currentPage=1:this.currentPage>this.paginationCount&&(this.currentPage=this.paginationCount),this.#o(),this.#n("change",{detail:{currentPage:this.currentPage}})}))}#c(){if(!this.layout.includes("pager"))return;this.#e.innerHTML="";const t=Math.floor(this.pageCount/2);let e=this.currentPage-t,i=this.currentPage+t;e<=1?(e=1,i=this.pageCount<this.paginationCount?this.pageCount:this.paginationCount):i>=this.paginationCount?(e=this.paginationCount-this.pageCount+1,i=this.paginationCount):i--;for(let t=e;t<=i;t++){const e=getPageItem(t,this.background);this.#e.appendChild(e),t===this.currentPage&&(e.classList.add("ea-pagination_item--active"),this.background&&e.classList.add("active")),this.#h(e,t)}if(this.total>this.pageCount&&this.currentPage>=this.pageCount&&this.paginationCount!==this.pageCount){const t=getMoreItem("prev",this.background);this.#g(t,"prev");const e=getPageItem(1,this.background);this.#h(e,1),this.#e.insertBefore(t,this.#e.firstChild),this.#e.insertBefore(e,this.#e.firstChild)}if(this.total>this.pageCount&&this.currentPage<this.paginationCount-t&&this.paginationCount!==this.pageCount){const t=getMoreItem("next",this.background);this.#g(t,"next");const e=getPageItem(this.paginationCount,this.background);this.#h(e,this.paginationCount),this.#e.appendChild(t),this.#e.appendChild(e)}}#o(){this.#r(),this.#c()}#u(){if(!this.layout.includes("total"))return;const t=getShowTotalItem();t.innerHTML=`共 ${this.total} 条`,this.#t.insertBefore(t,this.#t.firstChild)}connectedCallback(){this.sizes=this.sizes,this.currentPage=this.currentPage,this.total=this.total,this.#s(),this.#c(),this.#u()}}customElements.get("ea-pagination")||customElements.define("ea-pagination",EaPagination);
@@ -0,0 +1 @@
1
+ export const getMoreItem=(e,t)=>{const n=document.createElement("span");return n.className="ea-pagination_more",n.innerHTML="···",n.part="more-item",t&&n.classList.add("background"),n.addEventListener("mouseenter",(function(t){n.classList.add("ea-pagination_more--active"),n.innerHTML="prev"===e?"&lt;&lt;":"&gt;&gt;"})),n.addEventListener("mouseleave",(function(e){n.classList.remove("ea-pagination_more--active"),n.innerHTML="···"})),n};
@@ -0,0 +1 @@
1
+ export const getPageItem=(e,t)=>{const a=document.createElement("span");return a.part="page-item",a.className="ea-pagination_item",a.innerText=e,a.setAttribute("data-page",e),t&&a.classList.add("background"),a};
@@ -0,0 +1 @@
1
+ export const getShowTotalItem=()=>{const t=document.createElement("span");return t.className="ea-pagination_show_total",t.part="total-wrap",t};
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-pagination_wrap {\n display: flex;\n align-items: center;\n font-size: 0.9rem;\n}\n.ea-pagination_wrap .ea-pagination_item_wrap {\n display: flex;\n align-items: center;\n}\n.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_item,\n.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more {\n cursor: pointer;\n box-sizing: border-box;\n margin: 0 5px;\n padding: 0 4px;\n min-width: 30px;\n height: 28px;\n line-height: 28px;\n font-size: 13px;\n text-align: center;\n}\n.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_item.ea-pagination_item--active {\n color: #409eff;\n}\n.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more {\n cursor: pointer;\n user-select: none;\n}\n.ea-pagination_wrap .ea-pagination_item_wrap .ea-pagination_more.ea-pagination_more--active {\n color: #409eff;\n}\n.ea-pagination_wrap .ea-pagination_arrow {\n user-select: none;\n cursor: pointer;\n padding: 0 10px;\n line-height: 28px;\n}\n.ea-pagination_wrap .ea-pagination_arrow.disabled {\n cursor: default;\n pointer-events: none;\n color: #c0c4cc;\n}\n.ea-pagination_wrap .ea-pagination_arrow:first-child {\n margin-right: 0.25rem;\n}\n.ea-pagination_wrap .ea-pagination_arrow:last-child {\n margin-left: 0.25rem;\n}\n.ea-pagination_wrap .ea-pagination_item.background,\n.ea-pagination_wrap .ea-pagination_more.background,\n.ea-pagination_wrap .ea-pagination_arrow.background {\n background-color: #f4f4f5;\n border-radius: 3px;\n}\n.ea-pagination_wrap .ea-pagination_item.background:hover,\n.ea-pagination_wrap .ea-pagination_more.background:hover,\n.ea-pagination_wrap .ea-pagination_arrow.background:hover {\n color: #409eff;\n}\n.ea-pagination_wrap .ea-pagination_item.background.active,\n.ea-pagination_wrap .ea-pagination_more.background.active,\n.ea-pagination_wrap .ea-pagination_arrow.background.active {\n background-color: #409eff;\n color: #f4f4f5;\n}\n.ea-pagination_wrap .ea-pagination_show_total {\n margin-right: 0.5rem;\n font-size: 13px;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/stylesheet.js";export class EaPane extends Base{#e;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-pane_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#e=e.querySelector(".ea-pane_wrap"),this.build(e,stylesheet)}get actived(){return this.getAttribute("actived")}set actived(e){this.setAttribute("actived",e),this.#e.classList.toggle("is-actived",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}}customElements.get("ea-pane")||customElements.define("ea-pane",EaPane);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-pane_wrap {\n display: none;\n}\n.ea-pane_wrap.is-actived {\n display: block;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{SVGComm}from"./src/components/SVGComm.js";export class EaProgress extends Base{#t;#e;#s;#r;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-progress_wrap" part="container">\n <section class="ea-progress_track" part="track-wrap">\n <section class="ea-progress_path" part="path"></section>\n </section>\n <section class="ea-progress_text" part="text-wrap"></section>\n </div>\n ',this.#t=t.querySelector(".ea-progress_wrap"),this.#e=t.querySelector(".ea-progress_track"),this.#s=t.querySelector(".ea-progress_path"),this.#r=t.querySelector(".ea-progress_text"),this.build(t,stylesheet)}get type(){return this.getAttribute("type")}set type(t){if(t)switch(this.setAttribute("type",t),this.type){case"circle":this.#i("circle");break;case"dashboard":this.#i("dashboard")}}get percentage(){return this.getAttribute("percentage")||0}#a(t){return 302*(100-Number(t))/100}#h(t){return 152*(100-Number(t))/100+100}set percentage(t){if(!isNaN(Number(t)))switch(Number(t)<0?t=0:Number(t)>100&&(t=100),this.setAttribute("percentage",t),(this.textInside||"dashboard"===this.type||"circle"===this.type)&&(this.#r.innerHTML=`${t}%`),this.type){case"circle":this.#s.style.strokeDashoffset=`${this.#a(t)}px`;break;case"dashboard":this.#s.style.strokeDashoffset=`${this.#h(t)}px`;break;default:this.#s.style.width=`${t}%`,this.textInside&&this.#c(t)}}get statusList(){return{success:{icon:"icon-ok-circled",color:"#67c23a"},warning:{icon:"icon-attention-circled",color:"#e6a23c"},exception:{icon:"icon-cancel-circled",color:"#f56c6c"},primary:{}}}#o(t,e){!this.type&&this.textInside||"dashboard"===this.type||"circle"===this.type?this.#r.innerText=`${this.percentage}%`:this.#r.innerText="",this.#r.className=`${e} ${this.statusList[t].icon||""}`,this.#r.style.color=this.statusList[t].color}get status(){return this.getAttribute("status")||"primary"}set status(t){switch(this.setAttribute("status",t),this.type){case"circle":this.#o(t,"ea-progress_text--circle"),this.#s.style.stroke=this.statusList[t].color;break;case"dashboard":this.#o(t,"ea-progress_text--dashboard"),this.#s.style.stroke=this.statusList[t].color;break;default:this.#o(t,"ea-progress_text"),this.#s.style.backgroundColor=this.statusList[t].color}}get textInside(){return this.getAttrBoolean("text-inside")}set textInside(t){"circle"!==this.type&&t&&(this.setAttribute("text-inside",t),this.#c(t))}get strokeWidth(){return this.getAttribute("stroke-width")}set strokeWidth(t){t=t?Number(t):4,this.toggleAttr("stroke-width",t),"circle"===this.type||"dashboard"===this.type?(this.#e.style.strokeWidth=`${t}px`,this.#s.style.strokeWidth=`${t}px`):(t+=4,this.#e.style.height=`${t}px`,this.#e.style.lineHeight=`${t}px`,this.#s.style.height=`${t}px`,this.#s.style.lineHeight=`${t}px`,this.#t.style.height=`${t}px`,this.#t.style.lineHeight=`${t}px`)}#i(t){this.#t.style.height="126px",this.#t.style.width="126px",this.#t.innerHTML=SVGComm[t];const e=this.#t.querySelector(`circle[class="track--${t}"]`),s=this.#t.querySelector(`circle[class="path--${t}"]`),r=this.#t.querySelector(`span[class="ea-progress_text--${t}"]`);this.#e=e,this.#s=s,this.#r=r}#c(t){t?(this.#r.style.display="none",this.#s.innerText=`${this.percentage}%`):(this.#r.style.display="block",this.#s.innerText="")}connectedCallback(){this.type=this.type,this.percentage=this.percentage,this.status=this.status,this.textInside=this.textInside,this.strokeWidth=this.strokeWidth}}customElements.get("ea-progress")||customElements.define("ea-progress",EaProgress);
@@ -0,0 +1 @@
1
+ export const SVGComm={dashboard:'\n <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <circle class="track--dashboard" cx="50" cy="50" r="40" fill="none" stroke-dasharray="252px" stroke="aliceblue"\n stroke-width="4px" stroke-dashoffset="100" stroke-linecap="round" />\n <circle class="path--dashboard" cx="50" cy="50" r="40" fill="none" stroke-dasharray="252px" stroke="rgb(32, 160, 255)" stroke-width="4px"\n stroke-dashoffset="252" stroke-linecap="round" />\n </svg>\n <span class="ea-progress_text--dashboard"></span>\n ',circle:'\n <svg viewBox="0 0 100 100">\n <circle class="track--circle" cx="50" cy="50" r="48" fill="none" stroke="aliceblue" stroke-width="4" stroke-dasharray="302px" stroke-dashoffset="0" />\n <circle class="path--circle" cx="50" cy="50" r="48" fill="none" stroke="rgb(32, 160, 255)" stroke-width="4" stroke-dasharray="302px" stroke-dashoffset="0" stroke-linecap="round" />\n </svg>\n <span class="ea-progress_text--circle"></span>\n '};
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-progress_wrap {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n line-height: 1;\n height: 1rem;\n}\n.ea-progress_wrap .ea-progress_track,\n.ea-progress_wrap .ea-progress_path {\n height: 0.5rem;\n line-height: 1;\n background-color: rgb(235, 238, 245);\n border-radius: 999px;\n}\n.ea-progress_wrap .ea-progress_track {\n width: 100%;\n}\n.ea-progress_wrap .ea-progress_track .ea-progress_path {\n box-sizing: border-box;\n padding-right: 0.5rem;\n color: aliceblue;\n font-size: 0.8rem;\n text-align: right;\n width: 0%;\n background-color: #409eff;\n transition: width 0.2s;\n}\n.ea-progress_wrap .ea-progress_text {\n margin-left: 0.5rem;\n font-size: 0.8rem;\n width: 3rem;\n}\n.ea-progress_wrap .ea-progress_text--circle,\n.ea-progress_wrap .ea-progress_text--dashboard {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.ea-progress_wrap svg circle {\n stroke-width: 4px;\n transform-origin: center center;\n transition: stroke-dashoffset 0.2s;\n}\n.ea-progress_wrap svg .track--circle,\n.ea-progress_wrap svg .path--circle {\n transform: rotate(-90deg);\n}\n.ea-progress_wrap svg .track--dashboard,\n.ea-progress_wrap svg .path--dashboard {\n transform: rotate(161deg);\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaRadio extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <label class="ea-radio_wrap" part="container">\n <span class="ea-radio-input_wrap" part="input-wrap">\n <span class="ea-radio-input_inner" part="input"></span>\n <input class="ea-radio-input_input" type="radio" />\n </span>\n <span class="ea-radio-label_desc" part="label-wrap">\n <slot></slot>\n </span>\n </label>\n ',this.#t=e.querySelector(".ea-radio_wrap"),this.#e=e.querySelector(".ea-radio-input_input"),this.build(e,stylesheet)}get checked(){return this.getAttrBoolean("checked")}set checked(e){this.setAttribute("checked",e),this.#t.setAttribute("checked",e),this.#e.checked=e,this.#t.classList.toggle("checked",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e),this.#e.setAttribute("name",e)}get value(){return this.getAttribute("value")}set value(e){this.setAttribute("value",e),this.#t.setAttribute("for",e),this.#e.setAttribute("id",e),this.#e.setAttribute("value",e)}get disabled(){return this.getAttrBoolean("disabled")}set disabled(e){this.#e.disabled=e,this.#t.setAttribute("disabled",e),this.#t.classList.toggle("disabled",e)}get border(){return this.getAttrBoolean("border")}set border(e){this.#t.classList.toggle("border",e)}connectedCallback(){this.checked=this.checked,this.name=this.name,this.value=this.value,this.disabled=this.disabled,this.border=this.border,this.#e.addEventListener("change",(e=>{document.querySelectorAll(`ea-radio[name="${this.name}"]`).forEach((e=>{const t=e.shadowRoot.querySelector("input");e.checked=t===this.#e})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,checked:this.checked}}))}))}}window.customElements.get("ea-radio")||window.customElements.define("ea-radio",EaRadio);
@@ -0,0 +1 @@
1
+ export const stylesheet='\n:host {\n --margin-right: 0.75rem;\n --text-color: #606266;\n --radio-show-type: inline-block;\n --button-size: 1rem;\n --button-margin: 0.5rem;\n}\n\n.ea-radio_wrap {\n display: flex;\n align-items: center;\n margin-right: 1rem;\n}\n.ea-radio_wrap .ea-radio-input_wrap {\n width: var(--button-size);\n height: var(--button-size);\n line-height: 1;\n margin-right: var(--button-margin);\n}\n.ea-radio_wrap .ea-radio-input_wrap input {\n display: none;\n}\n.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner {\n position: relative;\n display: var(--radio-show-type);\n width: 1rem;\n height: 1rem;\n line-height: 1;\n box-sizing: border-box;\n border-radius: 50%;\n border: 1px solid #606266;\n}\n.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner::before {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n content: "";\n width: 0.35rem;\n height: 0.35rem;\n border-radius: 50%;\n background-color: transparent;\n box-sizing: border-box;\n transition: all 0.3s ease;\n}\n.ea-radio_wrap .ea-radio-input_wrap .ea-radio-input_inner:hover {\n border-color: #409eff;\n}\n.ea-radio_wrap .ea-radio-label_desc {\n color: var(--text-color);\n}\n.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner {\n border-color: #409eff;\n background-color: #409eff;\n}\n.ea-radio_wrap.checked .ea-radio-input_wrap .ea-radio-input_inner::before {\n background-color: white;\n}\n.ea-radio_wrap.checked .ea-radio-label_desc {\n color: #409eff;\n}\n.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner {\n border-color: #eeeeee;\n background-color: #eeeeee;\n}\n.ea-radio_wrap.disabled .ea-radio-input_wrap .ea-radio-input_inner::before {\n background-color: transparent;\n}\n.ea-radio_wrap.disabled .ea-radio-label_desc {\n color: #c0c4cc;\n}\n.ea-radio_wrap.disabled[checked=true] .ea-radio-input_inner::before {\n background-color: #c0c4cc;\n}\n.ea-radio_wrap.border {\n border: 1px solid #ccc;\n padding: 0.25rem 0.5rem;\n border-radius: 8px;\n}\n.ea-radio_wrap.border[checked=true] {\n border: 1px solid #409eff;\n}\n';
@@ -0,0 +1 @@
1
+ import{timeout}from"../../utils/timeout.js";import Base from"../Base.js";const stylesheet="\n.ea-radio-group_wrap {\n display: flex;\n}\n";export class EaRadioGroup extends Base{constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-radio-group_wrap" part="container">\n <slot></slot>\n </div>\n ',this.build(e,stylesheet)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e),this.querySelectorAll("ea-radio").forEach((t=>{t.setAttribute("name",e)}))}get value(){return this.getAttribute("value")||""}set value(e){e&&this.setAttribute("value",e)}#e(e){e.forEach((e=>{e.checked&&(this.value=e.value),e.addEventListener("change",(t=>{this.value=e.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{target:e,value:this.value}}))}))}))}#t(e){const t=Array.from(e).find((e=>e.value===this.value));t&&(t.checked=!0)}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.value=this.value,timeout((()=>{const e=this.querySelectorAll("ea-radio");this.#e(e),this.#t(e)}),20)}}window.customElements.get("ea-radio-group")||window.customElements.define("ea-radio-group",EaRadioGroup);
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{initRateTempalte}from"./src/components/rateComm.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaRate extends Base{#t;#e;#s;#i;#a;#o=["极差","失望","一般","满意","惊喜"];constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-rate_wrap" part="container">\n <section class="ea-rate_item-wrap" part="item-wrap">\n </section>\n <span class="ea-rate_text" part="text-wrap"></span>\n </div>\n ',this.#t=t.querySelector(".ea-rate_wrap"),this.#e=t.querySelector(".ea-rate_item-wrap"),this.#s=t.querySelector(".ea-rate_text"),initRateTempalte(this.#e),this.#i=t.querySelectorAll(".ea-rate_item"),this.#a=t.querySelectorAll("ea-icon"),this.build(t,stylesheet)}get value(){const t=this.getAttrNumber("value")||0;return t<1||t>5||!t?0:t}set value(t){t&&!isNaN(Number(t))&&(this.setAttribute("value",t),this.#r(),this.#n(t))}get color(){return this.getAttribute("color")}set color(t){t&&(this.setAttribute("color",t),this.#e.style.setProperty("--i-color",t))}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),this.#i.forEach((e=>{e.classList.toggle("disabled",t)})),this.#t.style.cursor=t?"not-allowed":"pointer"}get showText(){return this.getAttrBoolean("show-text")}set showText(t){this.toggleAttr("show-text",t)}get showTextList(){return this.#o}set showTextList(t){"object"==typeof t&&5===t.length&&(this.#o=t)}get voidIcon(){return this.getAttribute("void-icon")||"icon-star-empty"}set voidIcon(t){this.setAttribute("void-icon",t),this.#c(t)}get activeIcon(){return this.getAttribute("active-icon")||"icon-star"}set activeIcon(t){this.setAttribute("active-icon",t),this.#c(t)}#c(t){this.#a.forEach((e=>{e.icon=t}))}#n(t){for(let e=0;e<t;e++)this.#i[e].classList.add("active"),this.#a[e].icon=this.activeIcon,this.showText&&(this.#s.innerText=this.showTextList[t-1])}#r(){this.#i.forEach(((t,e)=>{t.classList.remove("active"),this.#a[e].icon=this.voidIcon,this.showText&&(this.#s.innerText="")}))}#h(){this.#i.forEach((t=>{const{index:e}=t;t.addEventListener("mouseenter",(()=>{this.#r(),this.#n(e+1),this.dispatchEvent(new CustomEvent("hover",{detail:{value:e+1,rateText:this.#o[e]}}))})),t.addEventListener("mouseleave",(()=>{this.#r(),this.#n(this.value)})),t.addEventListener("click",(()=>{this.value=e+1,this.dispatchEvent(new CustomEvent("change",{detail:{value:e+1,rateText:this.#o[e]}}))}))}))}connectedCallback(){this.activeIconClass=this.activeIconClass,this.voidIconClass=this.voidIconClass,this.showText=this.showText,this.color=this.color,this.value=this.value,this.disabled=this.disabled,this.disabled||this.#h()}}customElements.get("ea-rate")||customElements.define("ea-rate",EaRate);
@@ -0,0 +1 @@
1
+ import{createElement}from"../../../../utils/createElement.js";const rateComm=e=>{const t=createElement("span","ea-rate_item");t.index=e,t.part="rate-item";const a=createElement("ea-icon");return a.icon="icon-star-empty",t.appendChild(a),t};export const initRateTempalte=e=>{for(let t=0;t<5;t++)e.appendChild(rateComm(t))};
@@ -0,0 +1 @@
1
+ export const stylesheet="\n:host {\n --i-color: rgb(247, 186, 42);\n}\n.ea-rate_wrap {\n position: relative;\n display: flex;\n align-items: center;\n}\n.ea-rate_wrap .ea-rate_item {\n cursor: pointer;\n}\n.ea-rate_wrap .ea-rate_item ea-icon::part(container) {\n color: var(--i-color);\n transition: color 0.3s, font-size 0.1s;\n}\n.ea-rate_wrap .ea-rate_item.active ea-icon::part(container) {\n font-size: 1.1rem;\n}\n.ea-rate_wrap .ea-rate_item.disabled {\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-rate_wrap .ea-rate_text {\n margin-left: 0.25rem;\n min-width: 2rem;\n font-size: 0.8rem;\n line-height: 0.8;\n vertical-align: middle;\n}\n.ea-rate_wrap .ea-rate_score {\n position: absolute;\n left: 0;\n top: 0;\n}\n.ea-rate_wrap .ea-rate_score .ea-rate_score_item {\n width: 24px;\n height: 24px;\n}\n.ea-rate_wrap .ea-rate_score .ea-rate_score_item > i {\n color: #c0c4cc;\n font-size: 1rem;\n line-height: 1;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaResult extends Base{#t;#e;#s;#l;#i;#r;#u;#n;#o;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-result_wrap" part="container">\n <div class="ea-result_icon" part="icon-wrap">\n <slot name="icon"></slot>\n </div>\n <div class="ea-result_title" part="title-wrap">\n <slot name="title"></slot>\n </div>\n <div class="ea-result_subtitle" part="subTitle-wrap">\n <slot name="subTitle"></slot>\n </div>\n <div class="ea-result_extra" part="extra-wrap">\n <slot name="extra"></slot>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-result_wrap"),this.#e=t.querySelector(".ea-result_icon"),this.#s=t.querySelector(".ea-result_title"),this.#l=t.querySelector(".ea-result_subtitle"),this.#i=t.querySelector(".ea-result_extra"),this.#r=t.querySelector('slot[name="icon"]'),this.#u=t.querySelector('slot[name="title"]'),this.#n=t.querySelector('slot[name="subTitle"]'),this.#o=t.querySelector('slot[name="extra"]'),this.build(t,stylesheet)}get icon(){return this.getAttribute("icon")||""}set icon(t){t&&(this.setAttribute("icon",t),this.#e.innerHTML=`<ea-icon icon="${t}"></ea-icon>`)}get title(){return this.getAttribute("title")||""}set title(t){t&&(this.setAttribute("title",t),this.#s.innerText=t)}get subtitle(){return this.getAttribute("sub-title")||""}set subtitle(t){t&&(this.setAttribute("sub-title",t),this.#l.innerText=t)}connectedCallback(){this.icon=this.icon,this.title=this.title,this.subtitle=this.subtitle}}customElements.get("ea-result")||customElements.define("ea-result",EaResult);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-result_wrap {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n padding: 40px 30px;\n}\n.ea-result_wrap .ea-result_icon {\n font-size: 3rem;\n}\n.ea-result_wrap .ea-result_icon ea-icon[icon=icon-ok-circled] {\n color: #67c23a;\n}\n.ea-result_wrap .ea-result_icon ea-icon[icon=icon-cancel-circled] {\n color: #f56c6c;\n}\n.ea-result_wrap .ea-result_icon ea-icon[icon=icon-attention-alt] {\n color: #e6a23c;\n}\n.ea-result_wrap .ea-result_icon ea-icon[icon=icon-info] {\n color: #909399;\n}\n.ea-result_wrap .ea-result_title,\n.ea-result_wrap .ea-result_subtitle {\n color: #5e6d82;\n font-size: 14px;\n}\n.ea-result_wrap .ea-result_title {\n margin-top: 20px;\n}\n.ea-result_wrap .ea-result_subtitle {\n margin-top: 10px;\n}\n.ea-result_wrap .ea-result_extra {\n margin-top: 30px;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-option/index.js";import"../ea-option-gropu/index.js";import"../ea-input/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{timeout,withTransitionTimeOut}from"../../utils/timeout.js";export class EaSelect extends Base{#e;#t;#i;#s;#n;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-select_wrap" part="container">\n <div class="ea-select_input-wrap" part="input-wrap">\n <ea-input type="text" part="input" readonly autocomplete="off"></ea-input>\n <span class="ea-select_dropdown-icon" part="dropdown-icon-wrap">\n <ea-icon part="icon" icon="icon-angle-down" color="#c0c4cc"></ea-icon>\n </span>\n </div>\n <div class="ea-select_dropdown-wrap" part="dropdown-wrap">\n <slot></slot>\n <slot name="empty" class="ea-select_dropdown-empty" style="display: none;">\n <p>暂无数据</p>\n </slot>\n </div>\n </div>\n ',this.#e=this.shadowRoot.querySelector(".ea-select_wrap"),this.#t=this.shadowRoot.querySelector("ea-input"),this.#i=this.shadowRoot.querySelector(".ea-select_dropdown-icon"),this.#s=this.shadowRoot.querySelector(".ea-select_dropdown-wrap"),this.#n=this.shadowRoot.querySelector(".ea-select_dropdown-empty"),this.build(e,stylesheet)}get name(){return this.getAttribute("name")||"select"}set name(e){this.setAttribute("name",e)}get width(){return this.getAttribute("width")||"200px"}set width(e){this.setAttribute("width",e),this.#e.style.width=e}get value(){const e=this.selection;return this.multiple?e.split(",")||[]:this.selection}set value(e){this.setAttribute("value",e),this.multiple?this.selection=e.join(","):this.selection=e}get selection(){return this.getAttribute("selection")||""}set selection(e){this.setAttribute("selection",e),this.#t.value=e}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(e){this.setAttribute("placeholder",e),this.#t.placeholder=e}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(e){this.toggleAttr("disabled",e),this.#t.disabled=e}get clearable(){return this.getAttrBoolean("clearable")||!1}set clearable(e){if(this.setAttribute("clearable",e),e){const e=this.#i.querySelector("ea-icon");this.#i.addEventListener("mouseenter",(t=>{e.icon="icon-cancel-circled2"})),this.#i.addEventListener("mouseleave",(t=>{e.icon="icon-angle-down"})),this.#i.addEventListener("click",(e=>{this.dispatchEvent(new CustomEvent("clear",{detail:{originValue:this.selection}})),this.querySelectorAll("ea-option").forEach((e=>{e.checked=!1})),this.selection=""}))}}get filterable(){return this.getAttrBoolean("filterable")||!1}set filterable(e){this.setAttribute("filterable",e),this.#t.readonly=!1===e,e&&this.#t.addEventListener("change",(e=>{const t=this.querySelectorAll("ea-option"),{value:i}=e.detail;t.forEach((e=>{e.style.display=e.value.includes(i)?"block":"none"}));let s=Array.from(t).every((e=>"block"!==e.style.display));this.#n.style.display=s?"block":"none"}))}get multiple(){return this.getAttrBoolean("multiple")||!1}set multiple(e){this.setAttribute("multiple",e)}get isInvalid(){return this.getAttrBoolean("is-invalid")||!1}set isInvalid(e){this.setAttribute("is-invalid",e),this.#t.isInvalid=e}#l(){const e=this.querySelectorAll("ea-option");e.forEach((t=>{t.disabled||t.addEventListener("click",(i=>{if(this.multiple)if(t.checked=!t.checked,t.checked)this.selection=this.selection?this.selection+","+t.value:t.value;else{const e=this.selection.split(",");e.splice(e.indexOf(t.value),1),this.selection=e.join(",")}else this.#t.value=t.value,this.selection=t.value,e.forEach((e=>{e.checked=!1})),t.checked=!0;this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selection}}))}))}))}connectedCallback(){this.setAttribute("data-ea-component",!0),this.#s.style.width=this.width,this.name=this.name,this.width=this.width,this.selection=this.selection,this.placeholder=this.placeholder,this.disabled=this.disabled,this.clearable=this.clearable,this.filterable=this.filterable,this.multiple=this.multiple,this.#l(),this.#t.addEventListener("focus",(e=>{this.#e.classList.add("is-open"),this.dispatchEvent(new CustomEvent("visible-change",{detail:{visible:!0}}))})),this.#t.addEventListener("blur",(e=>{timeout((()=>{this.#e.classList.remove("is-open")}),100),this.dispatchEvent(new CustomEvent("visible-change",{detail:{visible:!1}}))})),withTransitionTimeOut(this.#e)}}customElements.get("ea-select")||customElements.define("ea-select",EaSelect);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-select_wrap {\n position: relative;\n}\n.ea-select_wrap .ea-select_input-wrap .ea-select_dropdown-icon {\n position: absolute;\n left: calc(100% - 24px);\n top: 50%;\n transform-origin: center;\n transform: translateY(-50%);\n}\n.ea-select_wrap .ea-select_input-wrap .ea-select_dropdown-icon.is-open {\n transform: translateY(-50%) rotate(180deg);\n}\n.ea-select_wrap .ea-select_dropdown-wrap {\n position: absolute;\n left: 0;\n bottom: -12px;\n transform: translateY(100%) scaleY(0);\n transform-origin: center top;\n box-sizing: border-box;\n background-color: #fff;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n z-index: 2035;\n}\n.ea-select_wrap .ea-select_dropdown-wrap .ea-select_dropdown-empty {\n padding: 10px 0;\n margin: 0;\n text-align: center;\n color: #999;\n font-size: 14px;\n}\n.ea-select_wrap.is-open .ea-select_input-wrap .ea-select_dropdown-icon {\n transform: translateY(-50%) rotate(180deg);\n}\n.ea-select_wrap.is-open .ea-select_dropdown-wrap {\n transform: translateY(100%) scaleY(1);\n}\n.ea-select_wrap.is-disabled {\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-select_wrap.with-transition .ea-select_input-wrap .ea-select_dropdown-icon {\n transition: transform 0.3s;\n}\n.ea-select_wrap.with-transition .ea-select_dropdown-wrap {\n transition: transform 0.3s;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-skeleton-item/index.js";import{handleDefaultAttrIsTrue}from"../../utils/handleDefaultAttrIsTrue.js";import{createSkeletonElement}from"./src/utils/createSkeletonElement.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaSkeleton extends Base{#t;#e;#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-skeleton_wrap" part="container">\n <slot></slot>\n <slot name="template"></slot>\n </div>\n ',this.#t=t.querySelector(".ea-skeleton_wrap"),this.#s=t.querySelector("slot"),this.#e=t.querySelector('slot[name="template"]'),this.build(t,stylesheet)}get row(){return this.getAttrNumber("row")||4}set row(t){this.setAttribute("row",t)}get animated(){return this.getAttrBoolean("animated")}set animated(t){t&&this.setAttribute("animated",t)}get count(){return this.getAttrNumber("count")||1}set count(t){this.setAttribute("count",t)}get loading(){const t=this.getAttribute("loading");return handleDefaultAttrIsTrue(t)}set loading(t){this.setAttribute("loading",t),this.#e.style.display=t?"block":"none",this.#s.style.display=t?"none":"block"}#n(t){t=Number(t)||4;this.#s.assignedNodes(),this.#e.assignedNodes();if(!(this.children.length>0)){this.#t.innerHTML="";for(let e=0;e<t;e++){const t=createSkeletonElement("p",this.animated);this.#t.appendChild(t)}}}#i(t){if(!t)return;this.querySelectorAll("ea-skeleton-item").forEach((t=>{t.animated=!0}))}#o(t){if(0===this.children.length||t<1)return;const e=this.querySelector('[slot="template"]');let s="";for(let n=0;n<t;n++)s+=e.innerHTML;e.innerHTML=s}connectedCallback(){this.animated=this.animated,this.loading=this.loading,this.count=this.count,this.row=this.row,this.#n(this.row),this.#o(this.count),this.#i(this.animated)}}customElements.get("ea-skeleton")||customElements.define("ea-skeleton",EaSkeleton);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-skeleton_wrap {\n width: 100%;\n position: relative;\n border-radius: 4px;\n}\n.ea-skeleton_wrap ea-skeleton-item[variant=p]:first-child {\n --p-width: 33%;\n --margin-top: 0;\n}\n.ea-skeleton_wrap ea-skeleton-item[variant=p]:last-child {\n --p-width: 61%;\n}\n";
@@ -0,0 +1 @@
1
+ export const createSkeletonElement=(e,t)=>{const n=document.createElement("ea-skeleton-item");return n.variant=e,n.animated=t,n};
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{imageSVG}from"./src/assets/imageSVG.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaSkeletonItem extends Base{#t;get variantOptions(){return["text","image","p","h1","h2","h3","h4","h5","h6"]}constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-skeleton-item_wrap" part="container"></div>\n ',this.#t=t.querySelector(".ea-skeleton-item_wrap"),this.build(t,stylesheet)}get elementStyle(){return this.getAttribute("style")}set elementStyle(t){t&&this.#t.setAttribute("style",t)}get variant(){return this.getAttribute("variant")}set variant(t){this.variantOptions.includes(t)?this.setAttribute("variant",t):this.setAttribute("variant","text"),"image"===t&&(this.#t.innerHTML=imageSVG),this.#t.classList.add("ea-skeleton_"+this.variant)}get animated(){return this.getAttrBoolean("animated")}set animated(t){t&&(this.setAttribute("animated",t),this.#t.classList.toggle("animated",t))}connectedCallback(){this.style.display="block",this.variant=this.variant,this.animated=this.animated}}customElements.get("ea-skeleton-item")||customElements.define("ea-skeleton-item",EaSkeletonItem);
@@ -0,0 +1 @@
1
+ export const imageSVG='\n<svg class="skeleton-image" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 20h70v60H15z" stroke="#c0c4cc" stroke-width="5px" fill="none" />\n <circle r="8" cx="32" cy="35" fill="#c0c4cc" />\n <path d="M60 42.5L39 75h42z" fill="#c0c4cc" />\n <path d="M35 52.5L20 75h-4 32z" fill="#c0c4cc" />\n</svg>\n';
@@ -0,0 +1 @@
1
+ export const stylesheet="\n:host {\n --p-width: 100%;\n --margin-top: 1rem;\n}\n\n@keyframes skeleton-loading {\n 0% {\n background-position: 100% 50%;\n }\n}\n.ea-skeleton-item_wrap {\n position: relative;\n background-color: #f2f2f2;\n border-radius: 4px;\n}\n.ea-skeleton-item_wrap.animated {\n background-image: linear-gradient(90deg, #f6f6f6 25%, #e8e8e8 37%, #f6f6f6 63%);\n background-size: 400% 100%;\n animation: skeleton-loading 1.4s ease infinite;\n}\n\n.ea-skeleton-item_wrap.ea-skeleton_p, .ea-skeleton-item_wrap.ea-skeleton_image, .ea-skeleton-item_wrap.ea-skeleton_text, .ea-skeleton-item_wrap.ea-skeleton_h1, .ea-skeleton-item_wrap.ea-skeleton_h2, .ea-skeleton-item_wrap.ea-skeleton_h3, .ea-skeleton-item_wrap.ea-skeleton_h4, .ea-skeleton-item_wrap.ea-skeleton_h5, .ea-skeleton-item_wrap.ea-skeleton_h6 {\n width: 100%;\n}\n.ea-skeleton-item_wrap.ea-skeleton_p {\n width: var(--p-width);\n height: 16px;\n margin-top: var(--margin-top);\n}\n.ea-skeleton-item_wrap.ea-skeleton_image {\n width: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 0;\n height: 100%;\n}\n.ea-skeleton-item_wrap.ea-skeleton_image .skeleton-image {\n width: 30%;\n height: 30%;\n}\n.ea-skeleton-item_wrap.ea-skeleton_text {\n height: 13px;\n margin: 2px 0;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h1 {\n height: 2rem;\n margin-block: 0.67rem;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h2 {\n height: 1.5rem;\n margin-block: 0.83rem;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h3 {\n height: 1.17rem;\n margin-block: 1rem;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h4 {\n height: 1rem;\n margin-block: 1.33rem;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h5 {\n height: 0.83rem;\n margin-block: 1.67rem;\n}\n.ea-skeleton-item_wrap.ea-skeleton_h6 {\n height: 0.67rem;\n margin-block: 2.33rem;\n}\n";
@@ -0,0 +1 @@
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 EaStep extends Base{#t;#e;#s;#i;#r;#n;#a;#o;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-step_wrap" part="container">\n <div class="ea-step_head-wrap" part="head-wrap">\n <div class="ea-step_bar" part="step-bar"></div>\n <div class="ea-step_head-icon" part="head-icon"></div>\n </div>\n <div class="ea-step_main-wrap" part="main-wrap">\n <div class="ea-step_title-wrap" part="title-wrap">\n <slot name="title"></slot>\n </div>\n <div class="ea-step_description-wrap" part="description-wrap">\n <slot name="description"></slot>\n </div>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-step_wrap"),this.#e=t.querySelector(".ea-step_head-wrap"),this.#s=t.querySelector(".ea-step_head-icon"),this.#i=t.querySelector(".ea-step_bar"),this.#r=t.querySelector(".ea-step_title-wrap"),this.#a=t.querySelector('slot[name="title"]'),this.#n=t.querySelector(".ea-step_description-wrap"),this.#o=t.querySelector('slot[name="description"]'),this.build(t,stylesheet)}get title(){return this.getAttribute("title")}set title(t){if(!t)return;const e=this.querySelector('[slot="title"]');e?(t=e.innerHTML,this.#a.innerHTML=t):this.#r.innerText=t,this.setAttribute("title",t)}get description(){return this.getAttribute("description")}set description(t){if(!t)return;const e=this.querySelector('[slot="description"]');e?(t=e.innerHTML,this.#o.innerHTML=t):this.#n.innerText=t,this.setAttribute("description",t)}get space(){return this.getAttribute("space")||"50%"}set space(t){this.setAttribute("space",t||"50%"),this.style.flexBasis=t||"50%"}get icon(){return this.getAttribute("icon")}set icon(t){t?this.#s.innerHTML=`\n <ea-icon icon="${t}" size="24"></ea-icon>\n `:(this.#s.innerHTML=this.index+1,this.#s.classList.add("is-text"),t=this.index+1),this.setAttribute("icon",t)}get active(){return this.getAttrBoolean("active")||!1}set active(t){this.toggleAttr("active",t)}get isLast(){return this.getAttrBoolean("is-last")||!1}set isLast(t){this.toggleAttr("is-last",t),this.#e.classList.toggle("is-last",t)}get status(){return this.getAttribute("status")}set status(t){if(this.setAttribute("status",t),this.#t.classList.toggle("is-finish","finish"===t),this.#t.classList.toggle("is-process","process"===t),this.#t.classList.toggle("is-wait","wait"===t),"finish"===t){this.#s.querySelector("ea-icon")||(this.#s.innerHTML='\n <ea-icon icon="icon-ok" color="#67c23a" style="font-size: 14px; line-height: 14px;"></ea-icon>\n ')}else this.#s.innerHTML=this.index+1}get simple(){return this.getAttrBoolean("simple")||!1}set simple(t){this.toggleAttr("simple",t),this.#t.classList.toggle("is-simple",t),t&&!this.isLast?(this.#i.innerHTML='\n <ea-icon icon="icon-angle-right" color="#c0c4cc" style="font-size: 24px; line-height: 24px;"></ea-icon>\n ',this.#i.style.flex="1",this.#i.style.textAlign="center",this.#n.remove(),this.#t.appendChild(this.#i)):t&&!this.isLast&&(this.#i.innerHTML="")}connectedCallback(){this.title=this.title,this.description=this.description,this.simple=this.simple,timeout((()=>{this.icon=this.icon}),20)}}customElements.get("ea-step")||customElements.define("ea-step",EaStep);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-step_wrap {\n color: #c0c4cc;\n transition: color 0.3s;\n}\n.ea-step_wrap .ea-step_head-wrap {\n position: relative;\n}\n.ea-step_wrap .ea-step_head-wrap .ea-step_head-icon {\n position: relative;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 24px;\n height: 24px;\n background-color: #fff;\n font-size: 14px;\n z-index: 1;\n}\n.ea-step_wrap .ea-step_head-wrap .ea-step_head-icon.is-text {\n border-radius: 50%;\n border: 2px solid;\n}\n.ea-step_wrap .ea-step_head-wrap .ea-step_bar {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 2px;\n width: 100%;\n height: 2px;\n background-color: #c0c4cc;\n}\n.ea-step_wrap .ea-step_head-wrap.is-last {\n flex-basis: auto;\n}\n.ea-step_wrap .ea-step_head-wrap.is-last .ea-step_bar {\n display: none;\n}\n.ea-step_wrap .ea-step_main-wrap {\n white-space: normal;\n text-align: left;\n}\n.ea-step_wrap .ea-step_main-wrap .ea-step_title-wrap {\n font-size: 16px;\n line-height: 38px;\n}\n.ea-step_wrap .ea-step_main-wrap .ea-step_description-wrap {\n margin-top: -5px;\n font-size: 12px;\n line-height: 20px;\n}\n.ea-step_wrap.is-process {\n color: #303133;\n border-color: #303133;\n}\n.ea-step_wrap.is-finish {\n color: #67c23a;\n border-color: #67c23a;\n}\n.ea-step_wrap.is-finish .ea-step_head-wrap .ea-step_bar {\n background-color: #67c23a;\n}\n.ea-step_wrap.is-simple {\n display: flex;\n align-items: center;\n}\n.ea-step_wrap.is-simple .ea-step_head-wrap {\n position: relative;\n}\n.ea-step_wrap.is-simple .ea-step_head-wrap .ea-step_bar {\n position: relative;\n width: auto;\n height: auto;\n transform: translateY(0%);\n margin-left: 2px;\n flex: 1;\n}\n.ea-step_wrap.is-simple .ea-step_main-wrap {\n margin-left: 16px;\n line-height: 24px;\n height: 24px;\n}\n.ea-step_wrap.is-simple .ea-step_main-wrap .ea-step_title-wrap {\n line-height: 24px;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-step/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaSteps extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-steps_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#t=t.querySelector(".ea-steps_wrap"),this.build(t,stylesheet)}get active(){return this.getAttrNumber("active")||0}set active(t){this.setAttribute("active",t),this.#e.forEach(((e,s)=>{e.status=s<t?"finish":s>t?"wait":"process"}))}get space(){return this.getAttribute("space")||"50%"}set space(t){this.setAttribute("space",t),this.#e.forEach(((e,s)=>{s<this.#e.length-1&&(e.space=t)}))}get simple(){return this.getAttrBoolean("simple")||!1}set simple(t){this.toggleAttr("simple",t),this.#e.forEach(((e,s)=>{e.simple=t,this.#t.classList.toggle("is-simple",t),s<this.#e.length-1&&(e.space=t?"auto":this.space)}))}connectedCallback(){const t=this.querySelectorAll("ea-step");this.#e=t,this.#e.forEach(((t,e)=>{t.setAttribute("index",e),t.index=e})),this.#e[this.#e.length-1].isLast=!0,this.simple=this.simple,this.active=this.active}}customElements.get("ea-steps")||customElements.define("ea-steps",EaSteps);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-steps_wrap {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ea-steps_wrap ::slotted(ea-step) {\n flex-basis: 50%;\n}\n.ea-steps_wrap.is-simple {\n justify-content: unset;\n}\n.ea-steps_wrap ::slotted(ea-step:last-child) {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n}\n.ea-steps_wrap ::slotted(ea-step[simple]) {\n flex: 1;\n}\n";
@@ -0,0 +1 @@
1
+ import{timeout}from"../../utils/timeout.js";import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaSubmenu extends Base{#t;#e;#s;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-submenu_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-submenu_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 disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#t.classList.toggle("is-disabled",t)}get mode(){return this.getAttribute("mode")||"horizontal"}set mode(t){this.setAttribute("mode",t),this.#t.classList.toggle("is-vertical","vertical"===t)}connectedCallback(){this.disabled=this.disabled;this.querySelectorAll("ea-menu-item").forEach(((t,e)=>{t.isSubItem=!0,t.addEventListener("item-selected",(t=>{this.actived=!0}))})),timeout((()=>{this.#s.style.display="block"}),20)}}customElements.get("ea-submenu")||customElements.define("ea-submenu",EaSubmenu);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-submenu_wrap {\n --normal-bgc: #fff;\n --normal-text-color: #303133;\n --actived-text-color: #409eff;\n --actived-bgc: #fff;\n position: relative;\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 cursor: pointer;\n transition: border-color 0.3s, background-color 0.3s, color 0.3s;\n}\n.ea-submenu_wrap .ea-submenu_title_wrap {\n display: flex;\n justify-content: space-between;\n}\n.ea-submenu_wrap .ea-submenu_title_wrap .ea-submenu_dropdown_icon {\n rotate: -90deg;\n transition: rotate 0.3s;\n}\n.ea-submenu_wrap .ea-submenu_items_wrap {\n display: none;\n position: absolute;\n left: 0;\n margin-top: 3px;\n border-radius: 8px;\n overflow: hidden;\n min-width: 200px;\n z-index: 100;\n opacity: 0;\n transform-origin: left top;\n transform: scale(0);\n transition: opacity 0.3s, transform 0.3s;\n}\n.ea-submenu_wrap:hover .ea-submenu_items_wrap {\n opacity: 1;\n transform: scale(1);\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n}\n.ea-submenu_wrap:hover .ea-submenu_title_wrap .ea-submenu_dropdown_icon {\n rotate: 0deg;\n}\n.ea-submenu_wrap.is-actived {\n color: var(--actived-text-color);\n border-color: var(--actived-text-color);\n}\n.ea-submenu_wrap.is-sub-actived {\n color: var(--actived-text-color);\n}\n.ea-submenu_wrap.is-disabled {\n color: #c0c4cc;\n pointer-events: none;\n cursor: not-allowed;\n}\n.ea-submenu_wrap ::slotted(a) {\n color: var(--normal-text-color);\n text-decoration: none;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaSwitch extends Base{#t;#e;#i;#s;#a;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <label class="ea-switch_wrap" part="container">\n <input class="ea-switch_input" type="checkbox">\n <span class="ea-switch_label ea-switch_label--left" part="label-left"></span>\n <span class="ea-switch_core" part="switch"></span>\n <span class="ea-switch_label ea-switch_label--right" part="label-right"></span>\n </label>\n ',this.#t=t.querySelector(".ea-switch_wrap"),this.#e=t.querySelector(".ea-switch_input"),this.#i=t.querySelector(".ea-switch_label--left"),this.#s=t.querySelector(".ea-switch_core"),this.#a=t.querySelector(".ea-switch_label--right"),this.build(t,stylesheet)}get name(){return this.getAttribute("name")||"ea-switch"}set name(t){this.setAttribute("name",t),this.#t.setAttribute("for",t),this.#e.setAttribute("name",t),this.#e.setAttribute("id",t)}get value(){return this.inactiveText&&!this.checked?this.inactiveText:this.activeText&&this.checked?this.activeText:this.checked}set value(t){this.#e.value=t}get inactiveText(){return this.getAttribute("inactive-text")||""}set inactiveText(t){t&&(this.setAttribute("inactive-text",t),this.#i.innerText=t)}get activeText(){return this.getAttribute("active-text")||""}set activeText(t){t&&(this.setAttribute("active-text",t),this.#a.innerText=t)}get checked(){return this.getAttrBoolean("checked")}set checked(t){this.setAttribute("checked",t),this.#e.checked=t}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.setAttribute("disabled",t),this.#e.disabled=t,this.#t.classList.toggle("disabled",t)}get inactiveColor(){return this.getAttribute("inactive-color")||""}set inactiveColor(t){t&&this.style.setProperty("--inactive-checkbox-bgc",t)}get activeColor(){return this.getAttribute("active-color")}set activeColor(t){t&&this.style.setProperty("--active-checkbox-bgc",t)}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.value=this.value,this.checked=this.checked,this.inactiveText=this.inactiveText,this.activeText=this.activeText,this.disabled=this.disabled,this.inactiveColor=this.inactiveColor,this.activeColor=this.activeColor,this.#e.addEventListener("change",(t=>{t.preventDefault(),t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,value:this.value}}))}))}}customElements.get("ea-switch")||customElements.define("ea-switch",EaSwitch);
@@ -0,0 +1 @@
1
+ export const stylesheet='\n:host {\n --active-text-color: #409eff;\n --inactive-text-color: ##606266;\n --active-checkbox-bgc: #409eff;\n --inactive-checkbox-bgc: #eff1f5;\n --active-disabled-text-color: #7ebfff;\n --active-disabled-bgc: #bbdcff;\n --inactive-disabled-text-color: #c0c4cc;\n --inactive-disabled-bgc: #eff1f5;\n}\n\n.ea-switch_wrap {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.ea-switch_wrap input {\n display: none;\n}\n.ea-switch_wrap .ea-switch_label {\n font-size: 0.875rem;\n transition: color 0.2s;\n}\n.ea-switch_wrap input + .ea-switch_label--left {\n color: var(--active-text-color);\n}\n.ea-switch_wrap input:checked + .ea-switch_label--left {\n color: var(--inactive-text-color);\n}\n.ea-switch_wrap input:checked + .ea-switch_label--left + .ea-switch_core {\n background-color: var(--active-checkbox-bgc);\n}\n.ea-switch_wrap input:checked + .ea-switch_label--left + .ea-switch_core::after {\n left: calc(100% - 1rem - 2px);\n}\n.ea-switch_wrap input:checked + .ea-switch_label--left + .ea-switch_core + .ea-switch_label--right {\n color: var(--active-text-color);\n}\n.ea-switch_wrap input:disabled + .ea-switch_label--left {\n color: var(--active-disabled-text-color);\n}\n.ea-switch_wrap input:disabled + .ea-switch_label--left + .ea-switch_core {\n background-color: var(--inactive-disabled-bgc);\n}\n.ea-switch_wrap input:disabled + .ea-switch_label--left + .ea-switch_core + .ea-switch_label--right {\n color: var(--inactive-disabled-text-color);\n}\n.ea-switch_wrap input:checked:disabled + .ea-switch_label--left {\n color: var(--inactive-disabled-text-color);\n}\n.ea-switch_wrap input:checked:disabled + .ea-switch_label--left + .ea-switch_core {\n background-color: var(--active-disabled-bgc);\n}\n.ea-switch_wrap input:checked:disabled + .ea-switch_label--left + .ea-switch_core::after {\n left: calc(100% - 1rem - 2px);\n}\n.ea-switch_wrap input:checked:disabled + .ea-switch_label--left + .ea-switch_core + .ea-switch_label--right {\n color: var(--inactive-disabled-text-color);\n}\n.ea-switch_wrap .ea-switch_core {\n position: relative;\n cursor: pointer;\n margin: 0 0.75rem;\n width: 2.5rem;\n height: 1.25rem;\n line-height: 1.25rem;\n background-color: var(--inactive-checkbox-bgc);\n border-radius: 999px;\n transition: background-color 0.2s;\n}\n.ea-switch_wrap .ea-switch_core::after {\n content: "";\n display: block;\n position: absolute;\n left: 2px;\n top: 50%;\n transform: translate(0, -50%);\n width: 1rem;\n height: 1rem;\n border-radius: 999px;\n background-color: #fff;\n transition: left 0.2s, transform 0.2s;\n}\n.ea-switch_wrap.disabled {\n cursor: not-allowed;\n}\n.ea-switch_wrap.disabled .ea-switch_label,\n.ea-switch_wrap.disabled .ea-switch_core {\n pointer-events: none;\n}\n';
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-pane/index.js";import{createElement}from"../../utils/createElement.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaTab extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-tab_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#t=t.querySelector(".ea-tab_wrap"),this.build(t,stylesheet)}get name(){return this.getAttribute("name")}set name(t){this.setAttribute("name",t)}get type(){return this.getAttrBoolean("type")||"normal"}set type(t){this.setAttribute("type",t),this.#t.classList.add(`ea-tab_wrap--${t}`)}get actived(){return this.getAttrBoolean("actived")}set actived(t){this.toggleAttr("actived",t),this.#t.classList.toggle("is-actived",t)}get editable(){return this.getAttrBoolean("editable")}set editable(t){this.setAttribute("editable",t),this.#t.classList.toggle("ea-tab_wrap--editable",t),t&&this.#e()}#a(){this.addEventListener("click",(t=>{const e=t.detail.value===this.getAttrBoolean("selected");this.toggleAttr("selected",e),this.dispatchEvent(new CustomEvent("tab-click",{detail:{name:this.name,event:this},bubbles:!0}))}))}#e(){const t=createElement("span","ea-tab_wrap--editable-sign");t.innerText="x",this.#t.appendChild(t),t.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-close",{detail:{event:this,name:this.name,index:this.index},bubbles:!0}))}))}handleBorderRadius(t){this.#t.style.setProperty(t,"3px")}handleBorderRightWidth(){this.#t.style.setProperty("--border-right-width","1px")}connectedCallback(){this.editable=this.editable,this.label=this.label,this.#a()}}customElements.get("ea-tab")||customElements.define("ea-tab",EaTab);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-tab_wrap {\n --border-radius-top-left: 0;\n --border-radius-top-right: 0;\n --border-right-width: 0;\n position: relative;\n box-sizing: border-box;\n padding: 0 1.25rem;\n height: 40px;\n line-height: 40px;\n min-width: 1rem;\n font-size: 14px;\n font-weight: 500;\n color: #303133;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n transition: color 0.3s, background-color 0.3s, width 0.3s, min-width 0.3s;\n}\n.ea-tab_wrap:hover {\n color: #409eff;\n}\n.ea-tab_wrap.ea-tab_wrap--normal.is-actived {\n color: #409eff;\n}\n.ea-tab_wrap.ea-tabs_wrap--card {\n border-bottom: 1px solid #e4e7ed;\n}\n.ea-tab_wrap.ea-tabs_wrap--card .ea-tabs_tab-bottom-bar {\n height: 1px;\n bottom: -1px;\n background-color: white;\n}\n.ea-tab_wrap.ea-tab_wrap--card {\n border-top-left-radius: var(--border-radius-top-left);\n border-top-right-radius: var(--border-radius-top-right);\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-right-width: var(--border-right-width);\n}\n.ea-tab_wrap.ea-tab_wrap--card.is-actived {\n border-bottom-color: white;\n color: #409eff;\n}\n.ea-tab_wrap.ea-tab_wrap--border-card {\n border-top-left-radius: var(--border-radius-top-left);\n border-top-right-radius: var(--border-radius-top-right);\n border: 0px solid rgba(0, 0, 0, 0.1);\n border-right-width: var(--border-right-width);\n}\n.ea-tab_wrap.ea-tab_wrap--border-card.is-actived {\n border-bottom-color: white;\n color: #409eff;\n background-color: white;\n}\n.ea-tab_wrap.ea-tab_wrap--editable .ea-tab_wrap--editable-sign {\n display: block;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translate(0, -50%);\n user-select: none;\n width: 0;\n overflow: hidden;\n transition: width 0.3s;\n}\n.ea-tab_wrap.ea-tab_wrap--editable:hover .ea-tab_wrap--editable-sign {\n width: 14px;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{createElement}from"../../utils/createElement.js";import"../ea-table-column/index.js";import"../ea-checkbox/index.js";import{stylesheet}from"./src/style/stylesheet.js";import{timeout}from"../../utils/timeout.js";export class EaTable extends Base{#e;#t;#r;#a;#l;#o;#s;#i;#n;#h;#d;#c;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-table_wrap" part="container">\n <div class="ea-table_header-wrap" part="header-wrap">\n <table class="ea-table_header" part="header-table">\n <colgroup></colgroup>\n <thead></thead>\n </table>\n </div>\n <div class="ea-table_body-wrap" part="body-wrap">\n <table class="ea-table_main" part="body-table">\n <colgroup></colgroup>\n <tbody></tbody>\n <slot name="empty" style="display: none;"></slot>\n </table>\n </div>\n </div>\n <slot></slot>\n <slot name="header"></slot>\n <slot name="body"></slot>\n ',this.build(e,stylesheet),this.#e=this.shadowRoot.querySelector(".ea-table_wrap"),this.#t=this.shadowRoot.querySelector(".ea-table_header"),this.#r=this.#t.querySelector(".ea-table_header colgroup"),this.#a=this.#t.querySelector(".ea-table_header thead"),this.#l=this.shadowRoot.querySelector(".ea-table_main"),this.#o=this.#l.querySelector(".ea-table_body-wrap colgroup"),this.#s=this.#l.querySelector(".ea-table_body-wrap tbody"),this.#i=this.querySelectorAll("ea-table-column")}get border(){return this.getAttrBoolean("border")}set border(e){this.setAttribute("border",e),this.#e.classList.toggle("border",e),this.#t.classList.toggle("border",e),this.#l.classList.toggle("border",e)}get stripe(){return this.getAttrBoolean("stripe")}set stripe(e){this.setAttribute("stripe",e),this.#e.classList.toggle("stripe",e)}get height(){return this.getAttrNumber("height")}set height(e){if(this.setAttribute("height",e),e){this.shadowRoot.querySelector(".ea-table_body-wrap").style.height=`${e}px`}else this.#e.style.height=""}get highlightCurrentRow(){return this.getAttrBoolean("highlight-current-row")||!1}set highlightCurrentRow(e){this.setAttribute("highlight-current-row",e)}get currentRow(){return this.getAttrNumber("current-row")||0}set currentRow(e){this.setAttribute("current-row",e)}get data(){return this.#h||[]}set data(e){const t=JSON.stringify(e);let r=JSON.parse(t);this.#h=r,this.renderTableBody(r)}get currentRowDetail(){const e=this.currentRow;return{index:e,data:this.data[e],target:this.#l.querySelectorAll(".ea-table__row")[e]||null}}#b(e,t,r,a,l,o=!1){const s=this.parentNode.clientWidth,i=Array.from(a.children).reduce(((e,t)=>e+Number(t.getAttribute("width"))),0);s>0&&i<=s?(r.style.width=s-l+"px",e.style.width=`${s}px`,t.style.width=s-l+"px",o&&(e.style.width=`${s}px`)):(r.style.width=`${s}px`,e.style.width=`${s}px`,t.style.width=`${s}px`)}#p(){const e=this.shadowRoot.querySelector(".ea-table_header-wrap"),t=this.shadowRoot.querySelector(".ea-table_body-wrap");let r=null;const a=()=>{this.#b(this.#e,this.#l,this.#t,this.#r,r)};window.addEventListener("resize",(()=>{a()})),setTimeout((()=>{r=this.#e.getBoundingClientRect().width-this.#l.getBoundingClientRect().width,a()}),0),t.addEventListener("scroll",(r=>{e.style.transform=`translateX(-${t.scrollLeft}px)`}))}#u(e,t){if(t.sortable&&"selection"!==t.type){const r=createElement("ea-icon");r.icon="icon-angle-down",r.style.float="right",e.appendChild(r),e.addEventListener("click",(()=>{r.color="#5cb6ff";"asc"===t.order?(t.order="desc",r.icon="icon-angle-up"):(t.order="asc",r.icon="icon-angle-down");let e=this.data.sort(((e,r)=>{const a="null"!==t.prop?t.prop:t.type;return"asc"===t.order?String(e[a]).localeCompare(r[a]):String(r[a]).localeCompare(e[a])}));this.renderTableBody(e),this.dispatchEvent(new CustomEvent("sort-change",{detail:{prop:t.prop,order:t.order},composed:!0,bubbles:!0}))}))}}#y(){this.querySelectorAll("ea-table-column");this.#r.innerHTML="",this.#o.innerHTML="",this.#a.innerHTML="";const e=(t,r=1)=>{const a=createElement("tr");a.part="row",a.setAttribute("index",r),Array.from(t).forEach((t=>{if("EA-TABLE-COLUMN"!==t.nodeName)return;const l=createElement("th","ea-table__cell th-cell");if(l.part="th-cell",l.setAttribute("colspan",t.colspan||1),l.setAttribute("rowspan",t.rowspan||1),l.appendChild(t),a.appendChild(l),"selection"===t.type&&(this.#n=t.querySelector("ea-checkbox")),t.children.length>0)e(t.children,++r);else{const e=createElement("col");e.setAttribute("width",t.getAttribute("width")||100);const r=createElement("col");r.setAttribute("width",t.getAttribute("width")||100),this.#r.appendChild(e),this.#o.appendChild(r),this.#a.appendChild(a),this.#u(l,t)}}))};e(this.children)}#g(e,t){e.addEventListener("click",(()=>{const r=this.#s.querySelectorAll(".ea-table__row");let a=!1,l=!1;r.forEach(((e,t)=>{"index"===e.type&&(a=!0),"selection"===e.type&&(l=!0),e.index=t,this.highlightCurrentRow&&e.classList.remove("is-current-row")})),this.highlightCurrentRow&&e.classList.add("is-current-row"),l&&delete t.selection,this.currentRow=e.index,this.dispatchEvent(new CustomEvent("current-change",{composed:!0,bubbles:!0,detail:{index:e.index,row:e,data:t}}))}))}#m(e,t){const r=this.#t.querySelectorAll("ea-table-column");let a=0,l=!1;return r.forEach(((e,r)=>{e.type===t&&(a=r,l=!0)})),l?e.map(((e,r)=>{const l={},o=Object.keys(e);return o.splice(a,0,t),o.forEach(((t,a)=>{l[t]="index"===t?r+1:"selection"===t?"<ea-checkbox></ea-checkbox>":e[t]})),l})):e}#T(){const e=this.#s.querySelectorAll("tr"),t=this.shadowRoot.querySelector('slot[name="body"]');timeout((()=>{t.assignedNodes().length?(e.forEach((e=>{const r=createElement("td","ea-table__cell");r.part="td-cell",Array.from(t.assignedNodes()).forEach((t=>{const a=t.cloneNode(!0);r.appendChild(a),a.addEventListener("click",(()=>{t.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0,detail:{row:e}}))}))})),e.appendChild(r)})),t.style.display="none"):t.remove()}),0)}renderTableBody(e){if(this.#s.innerHTML="",!this.#d){e=this.#m(e,"index"),e=this.#m(e,"selection");const t=Array.from(this.#t.querySelectorAll("ea-table-column")).map(((e,t)=>"default"===e.type?e.prop:e.type));e=e.map((e=>{const r={};return t.forEach((t=>{null!==t&&"null"!==t&&void 0!==t&&"undefined"!==t&&(r[t]=e[t])})),r})),this.#d=!0}e.forEach(((t,r)=>{const a=createElement("tr","ea-table__row");a.part="row",Object.entries(t).forEach((([r,l])=>{const o=createElement("td","ea-table__cell td_cell");o.part="td-cell",o.innerHTML=l,"selection"===r&&o.querySelector("ea-checkbox").addEventListener("change",(r=>{const l=this.shadowRoot.querySelectorAll("ea-checkbox"),o=Array.from(l).filter(((e,t)=>(e.index=t,e.checked))),s=o.map((t=>{const r=e[t.index];return delete r.selection,r}));this.dispatchEvent(new CustomEvent("body-selection-change",{composed:!0,bubbles:!0,detail:{checked:r.detail.checked,currentRow:a,currentRowData:t,checkedElements:o,checkedElementsData:s}}))})),a.appendChild(o)})),this.#g(a,t),this.#s.appendChild(a)})),this.#h=e;const t=this.shadowRoot.querySelector('slot[name="empty"]');e.length>0?t.style.display="none":t.style.display="block",this.#T()}#w(){const e=this.shadowRoot.querySelectorAll("ea-table-column");Array.from(e).some((e=>"selection"===e.type))&&(this.addEventListener("header-selection-change",(e=>{this.#l.querySelectorAll("ea-checkbox").forEach((t=>{t.checked=e.detail.checked}))})),this.addEventListener("body-selection-change",(e=>{const t=this.#a.querySelector("ea-table-column").shadowRoot.querySelector("ea-checkbox"),r=this.#l.querySelectorAll("ea-checkbox");let a=Array.from(r).map((e=>e.checked));a.every((e=>!0===e))?t.checked=!0:a.every((e=>!1===e))?t.checked=!1:t.indeterminate=!0})))}#E(){const e=this.shadowRoot.querySelector('slot[name="header"]');if(e.assignedNodes().length>0){const t=this.#a.querySelector("tr"),r=createElement("th","ea-table__cell th-cell");r.part="th-cell";let a=1;Array.from(this.#a.querySelectorAll("th")).forEach((e=>{e.rowSpan>a&&(a=e.rowSpan)})),r.rowSpan=a,r.appendChild(e),t.appendChild(r)}else e.remove()}connectedCallback(){this.style.position="relative",this.border=this.border,this.stripe=this.stripe,this.height=this.height,this.highlightCurrentRow=this.highlightCurrentRow,this.#y(),this.#p(),this.#w(),this.#E(),timeout((()=>{this.dispatchEvent(new CustomEvent("table-ready"))}),20)}}customElements.get("ea-table")||customElements.define("ea-table",EaTable);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-table_wrap,\n.ea-table_fixed-column {\n position: relative;\n background-color: #fff;\n overflow: hidden;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main,\n.ea-table_wrap .ea-table_main,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main,\n.ea-table_fixed-column .ea-table_main {\n position: relative;\n box-sizing: border-box;\n padding: 12px 0;\n width: 100%;\n min-width: 0;\n text-overflow: ellipsis;\n vertical-align: middle;\n text-align: left;\n border-collapse: collapse;\n table-layout: fixed;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header .ea-table__cell,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main .ea-table__cell,\n.ea-table_wrap .ea-table_main .ea-table__cell,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header .ea-table__cell,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main .ea-table__cell,\n.ea-table_fixed-column .ea-table_main .ea-table__cell {\n border-top: 1px solid #ebeef5;\n border-bottom: 1px solid #ebeef5;\n box-sizing: border-box;\n padding: 8px;\n color: #606266;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header .ea-table__cell.th-cell,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main .ea-table__cell.th-cell,\n.ea-table_wrap .ea-table_main .ea-table__cell.th-cell,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header .ea-table__cell.th-cell,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main .ea-table__cell.th-cell,\n.ea-table_fixed-column .ea-table_main .ea-table__cell.th-cell {\n color: #909399;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header .ea-table__cell.is-gutter,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main .ea-table__cell.is-gutter,\n.ea-table_wrap .ea-table_main .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_main .ea-table__cell.is-gutter {\n width: 15px;\n padding: 0;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header.border .ea-table__cell,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main.border .ea-table__cell,\n.ea-table_wrap .ea-table_main.border .ea-table__cell,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header.border .ea-table__cell,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main.border .ea-table__cell,\n.ea-table_fixed-column .ea-table_main.border .ea-table__cell {\n border: 1px solid #ebeef5;\n padding: 8px;\n color: #606266;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header.border .ea-table__cell.is-gutter,\n.ea-table_wrap .ea-table_body-wrap .ea-table_main.border .ea-table__cell.is-gutter,\n.ea-table_wrap .ea-table_main.border .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header.border .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main.border .ea-table__cell.is-gutter,\n.ea-table_fixed-column .ea-table_main.border .ea-table__cell.is-gutter {\n width: 15px;\n padding: 0;\n min-width: none;\n}\n.ea-table_wrap .ea-table_header-wrap .ea-table_header.stripe .ea-table__row:nth-child(2n),\n.ea-table_wrap .ea-table_body-wrap .ea-table_main.stripe .ea-table__row:nth-child(2n),\n.ea-table_wrap .ea-table_main.stripe .ea-table__row:nth-child(2n),\n.ea-table_fixed-column .ea-table_header-wrap .ea-table_header.stripe .ea-table__row:nth-child(2n),\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main.stripe .ea-table__row:nth-child(2n),\n.ea-table_fixed-column .ea-table_main.stripe .ea-table__row:nth-child(2n) {\n background-color: #fafafa;\n}\n.ea-table_wrap .ea-table_main,\n.ea-table_fixed-column .ea-table_main {\n position: absolute;\n left: 0;\n top: 0;\n}\n.ea-table_wrap .ea-table_body-wrap,\n.ea-table_fixed-column .ea-table_body-wrap {\n overflow-y: auto;\n}\n.ea-table_wrap .ea-table_body-wrap .ea-table_main .ea-table__row:hover,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main .ea-table__row:hover {\n background-color: #f5f7fa;\n}\n.ea-table_wrap .ea-table_body-wrap .ea-table_main .ea-table__row.is-current-row,\n.ea-table_fixed-column .ea-table_body-wrap .ea-table_main .ea-table__row.is-current-row {\n background-color: #ecf5ff;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-checkbox/index.js";const stylesheet="";export class EaTableColumn extends Base{#t;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <th part="container">\n <slot></slot>\n <span></span>\n </th>\n ',this.build(t,""),this.#t=t.querySelector("span")}get prop(){return this.getAttribute("prop")}set prop(t){this.setAttribute("prop",t)}get width(){return this.getAttrNumber("width")||350}set width(t){this.setAttribute("width",t)}get label(){return this.getAttribute("label")||""}set label(t){this.setAttribute("label",t),""!==t&&(this.#t.innerHTML=t)}get colspan(){return this.getAttrNumber("colspan")||1}set colspan(t){this.setAttribute("colspan",t)}get rowspan(){return this.getAttrNumber("rowspan")||1}set rowspan(t){this.setAttribute("rowspan",t)}get type(){const t=this.getAttribute("type");return["default","index","selection"].includes(t)?t:"default"}set type(t){this.setAttribute("type",t),"selection"===t&&(this.#t.innerHTML="\n <ea-checkbox></ea-checkbox>\n ",this.#t.querySelector("ea-checkbox").addEventListener("change",(t=>{this.dispatchEvent(new CustomEvent("header-selection-change",{detail:{checked:t.detail.checked},composed:!0}))})))}get sortable(){return this.getAttrBoolean("sortable")||!1}set sortable(t){this.setAttribute("sortable",t)}get order(){return this.getAttribute("order")||"asc"}set order(t){this.setAttribute("order",t)}connectedCallback(){this.prop=this.prop,this.width=this.width,this.label=this.label,this.colspan=this.colspan,this.rowspan=this.rowspan,this.type=this.type,this.sortable=this.sortable,this.order=this.order}}customElements.get("ea-table-column")||customElements.define("ea-table-column",EaTableColumn);
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import"../ea-tab/index.js";import"../ea-pane/index.js";import{timeout}from"../../utils/timeout.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaTabs extends Base{#t;#e;#a;#s;#i=0;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-tabs_wrap" part="container">\n <div class="ea-tabs_tab-wrap" part="tab-wrap">\n <slot></slot>\n </div>\n <div class="ea-tabs_tab-bottom-bar" part="tab-bottom-bar"></div>\n <div class="ea-tabs_pane-wrap" part="pane-wrap">\n <slot name="pane"></slot>\n </div>\n </div>\n ',this.#t=t.querySelector(".ea-tabs_wrap"),this.#e=t.querySelector(".ea-tabs_tab-bottom-bar"),this.#a=t.querySelector(".ea-tabs_pane-wrap"),this.#s=t.querySelector(".ea-tabs_tab-wrap > slot"),this.build(t,stylesheet)}get type(){return this.getAttribute("type")||"normal"}set type(t){this.setAttribute("type",t),this.#t.classList.add("ea-tabs_wrap--"+t);const e=this.querySelectorAll("ea-tab");e.forEach((e=>{e.type=t})),"border-card"!==t&&(e[0].handleBorderRadius("--border-radius-top-left"),e[e.length-1].handleBorderRadius("--border-radius-top-right"),e[e.length-1].handleBorderRightWidth())}get actived(){return this.getAttribute("actived")||this.querySelectorAll("ea-tab")[0].name||0}set actived(t){this.setAttribute("actived",t),this.querySelectorAll("ea-tab").forEach(((e,a)=>{e.actived=e.name===t}))}get editable(){return this.getAttrBoolean("editable")||!1}set editable(t){this.setAttribute("editable",t),this.#o(t)}#r(t){const e=this.querySelectorAll("ea-tab"),a=this.querySelectorAll("ea-pane"),{width:s,height:i}=t.getBoundingClientRect(),o=Array.from(e).reduce(((e,a,s)=>s<=t.index?e+a.offsetWidth:e),0),r=(t,e)=>{t.actived=!1,t.index=e};e.forEach(r),a.forEach(r),t.actived=!0,this.querySelector(`ea-pane[name="${t.name}"]`).actived=!0,this.#e.style.left=o-s+"px",this.#e.style.width=s+"px",this.#e.style.top=i+"px"}#n(){const t=this.querySelectorAll("ea-tab"),e=this.querySelectorAll("ea-pane"),a=t=>{this.#r(t.detail.event),this.actived=t.detail.name,t.detail.event.actived=!0};t.forEach(((t,e)=>{t.index=e,t.name||(t.name=e),t.removeEventListener("tab-click",a),t.addEventListener("tab-click",a)})),e.forEach(((t,e)=>{t.index=e,t.name||(t.name=e)}))}#l(){timeout((()=>{const t=this.querySelector('ea-tab[name="'+this.actived+'"]');t.actived=!0,this.#r(t)}),20)}#d(t){t.stopPropagation();const e=this.querySelectorAll("ea-tab"),{name:a,event:s,index:i}=t.detail;let o=i;e[i+1]?o=i+1:e[i-1]&&(o=i-1);try{this.actived=e[o]?.name,s.remove(),this.querySelector(`ea-pane[name="${a}"]`).remove(),e.length<=1?this.#e.style.width=0:(this.#l(),this.#n())}catch(t){}}#o(t){this.querySelectorAll("ea-tab").forEach((e=>{e.editable=t})),this.removeEventListener("tab-close",this.#d),this.addEventListener("tab-close",this.#d)}#h(){timeout((()=>{this.#i=this.#s.assignedNodes().length,this.#s.addEventListener("slotchange",(t=>{const e=t.target.assignedNodes().length;e>=this.#i?(this.#n(),this.#o(this.editable),this.type=this.type,this.#i=e,this.dispatchEvent(new CustomEvent("tab-add",{detail:{event:t,tabs:this.querySelectorAll("ea-tab"),panes:this.querySelectorAll("ea-pane")},bubbles:!0,composed:!0}))):this.#i=this.#s.assignedNodes().length}))}),20)}connectedCallback(){this.type=this.type,this.actived=this.actived,this.editable=this.editable,this.#l(),this.#n(),this.#h()}}customElements.get("ea-tabs")||customElements.define("ea-tabs",EaTabs);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-tabs_wrap {\n position: relative;\n}\n.ea-tabs_wrap .ea-tabs_tab-wrap {\n display: flex;\n align-items: center;\n overflow-x: auto;\n scrollbar-width: thin;\n}\n.ea-tabs_wrap .ea-tabs_pane-wrap {\n padding: 20px;\n}\n.ea-tabs_wrap .ea-tabs_tab-bottom-bar {\n position: absolute;\n height: 2px;\n width: 0;\n top: 40px;\n left: 0;\n border-radius: 999px;\n background-color: #409eff;\n transition: left 0.3s;\n}\n.ea-tabs_wrap.ea-tabs_wrap--normal .ea-tabs_tab-wrap {\n border-bottom: 2px solid #e4e7ed;\n}\n.ea-tabs_wrap.ea-tabs_wrap--card .ea-tabs_tab-wrap {\n border-bottom: 1px solid #e4e7ed;\n}\n.ea-tabs_wrap.ea-tabs_wrap--card .ea-tabs_tab-bottom-bar {\n height: 1px;\n bottom: -1px;\n background-color: white;\n}\n.ea-tabs_wrap.ea-tabs_wrap--border-card {\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n}\n.ea-tabs_wrap.ea-tabs_wrap--border-card .ea-tabs_tab-wrap {\n background-color: #f5f7fa;\n border-bottom: 1px solid #e4e7ed;\n}\n.ea-tabs_wrap.ea-tabs_wrap--border-card .ea-tabs_tab-bottom-bar {\n height: 1px;\n bottom: -1px;\n background-color: white;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import"../ea-icon/index.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaTag extends Base{#e;#t;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML='\n <div class="ea-tag_wrap" part="container">\n <slot></slot>\n </div>\n ',this.#e=e.querySelector(".ea-tag_wrap"),this.build(e,stylesheet)}get type(){return this.getAttribute("type")||"default"}set type(e){this.setAttribute("type",e),this.#e.classList.add(`ea-tag--${e}`)}get closable(){return this.getAttrBoolean("closable")}set closable(e){this.toggleAttr("closable",e)}get effect(){return this.getAttribute("effect")||"light"}set effect(e){"light"!==e&&(this.setAttribute("effect",e),this.#e.classList.add(`ea-tag--${e}`))}#s(){if(!this.closable)return;const e=document.createElement("ea-icon");e.icon="icon-cancel-circled2",e.part="close-icon",e.addEventListener("mouseenter",(t=>{e.icon="icon-cancel-circled"})),e.addEventListener("mouseleave",(t=>{e.icon="icon-cancel-circled2"})),e.addEventListener("click",(e=>{this.dispatchEvent(new CustomEvent("close",{detail:{value:this.innerText},bubbles:!0}))})),this.#e.appendChild(e)}connectedCallback(){this.effect=this.effect,this.type=this.type,this.closable=this.closable,this.#s()}}customElements.get("ea-tag")||customElements.define("ea-tag",EaTag);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-tag_wrap {\n display: inline-block;\n height: 2rem;\n line-height: 30px;\n white-space: nowrap;\n padding: 0 0.625rem;\n border-width: 1px;\n border-style: solid;\n border-radius: 4px;\n}\n.ea-tag_wrap ea-icon {\n font-size: 1rem;\n margin-left: 0.5rem;\n cursor: pointer;\n}\n.ea-tag_wrap.ea-tag--default {\n color: #409eff;\n background-color: #ecf5ff;\n border-color: #dcdfe6;\n}\n.ea-tag_wrap.ea-tag--default.ea-tag--dark {\n color: #fff;\n background-color: #409eff;\n border-color: #409eff;\n}\n.ea-tag_wrap.ea-tag--default.ea-tag--plain {\n color: #409eff;\n background-color: #fff;\n border-color: #dcdfe6;\n}\n.ea-tag_wrap.ea-tag--success {\n color: #67c23a;\n background-color: #f0f9eb;\n border-color: #e1f3d8;\n}\n.ea-tag_wrap.ea-tag--success.ea-tag--dark {\n color: #fff;\n background-color: #67c23a;\n border-color: #67c23a;\n}\n.ea-tag_wrap.ea-tag--success.ea-tag--plain {\n color: #67c23a;\n background-color: #fff;\n border-color: #e1f3d8;\n}\n.ea-tag_wrap.ea-tag--info {\n color: #909399;\n background-color: #f4f4f5;\n border-color: #e9e9eb;\n}\n.ea-tag_wrap.ea-tag--info.ea-tag--dark {\n color: #fff;\n background-color: #909399;\n border-color: #909399;\n}\n.ea-tag_wrap.ea-tag--info.ea-tag--plain {\n color: #909399;\n background-color: #fff;\n border-color: #e9e9eb;\n}\n.ea-tag_wrap.ea-tag--warning {\n color: #e6a23c;\n background-color: #fdf6ec;\n border-color: #faecd8;\n}\n.ea-tag_wrap.ea-tag--warning.ea-tag--dark {\n color: #fff;\n background-color: #e6a23c;\n border-color: #e6a23c;\n}\n.ea-tag_wrap.ea-tag--warning.ea-tag--plain {\n color: #e6a23c;\n background-color: #fff;\n border-color: #faecd8;\n}\n.ea-tag_wrap.ea-tag--danger {\n color: #f56c6c;\n background-color: #fef0f0;\n border-color: #fbc4c4;\n}\n.ea-tag_wrap.ea-tag--danger.ea-tag--dark {\n color: #fff;\n background-color: #f56c6c;\n border-color: #f56c6c;\n}\n.ea-tag_wrap.ea-tag--danger.ea-tag--plain {\n color: #f56c6c;\n background-color: #fff;\n border-color: #fbc4c4;\n}\n";
@@ -0,0 +1 @@
1
+ import Base from"../Base.js";import{stylesheet}from"./src/style/stylesheet.js";export class EaTextarea extends Base{#t;#e;constructor(){super();const t=this.attachShadow({mode:"open"});t.innerHTML='\n <div class="ea-textarea_wrap" part="container">\n <textarea class="ea-textarea_inner" part="textarea" placeholder="请输入内容"></textarea>\n </div>\n ',this.#t=t.querySelector(".ea-textarea_wrap"),this.#e=t.querySelector(".ea-textarea_inner"),this.build(t,stylesheet)}get name(){return this.getAttribute("name")||"ea-textarea"}set name(t){this.setAttribute("name",t)}get value(){return this.#e.value}set value(t){this.#e.value=t}get disabled(){return this.getAttrBoolean("disabled")}set disabled(t){this.toggleAttr("disabled",t),this.#e.disabled=t}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(t){t&&(this.setAttribute("placeholder",t),this.#e.placeholder=t)}get rows(){return this.getAttribute("rows")||2}set rows(t){this.setAttribute("rows",t),this.#e.rows=t}get autosize(){return this.getAttrBoolean("autosize")}set autosize(t){t&&(this.setAttribute("autosize",t),this.#e.addEventListener("input",(t=>{if(this.#e.style.height!==this.#e.scrollHeight+"px"&&(this.#e.style.height=this.#e.scrollHeight+"px",this.#e.style.minHeight=this.#e.scrollHeight+"px"),"textarea"===t.target.type){const e=this.#e.cols,i=t.target.value.length;let s=Math.ceil(i/e)<=Number(this.#e.rows)?Number(this.#e.rows):Math.ceil(i/e);i%e==1&&(this.minRows>s?this.#i(this.minRows):this.maxRows<s?this.#i(this.maxRows):this.#i(s))}})))}get minRows(){const t=this.getAttrNumber("min-rows");return 0!==t&&t>0?t:0}set minRows(t){t&&(this.setAttribute("min-rows",t),this.#i(Number(t)))}get maxRows(){const t=Number(this.getAttribute("max-rows"));return 0!==t&&t>0?t:0}set maxRows(t){t&&(this.setAttribute("max-rows",t),this.#i(Number(t)))}get maxLength(){return this.getAttribute("max-length")}set maxLength(t){t&&(this.setAttribute("max-length",t),this.#e.maxLength=t,this.showWordLimit&&(this.showWordLimit=!0))}get minLength(){return this.getAttribute("min-length")}set minLength(t){t&&(this.setAttribute("min-length",t),this.#e.minLength=t)}get showWordLimit(){return this.getAttrBoolean("show-word-limit")}set showWordLimit(t){if(!t)return;this.setAttribute("show-word-limit",t);const e=document.createElement("span");e.part="word-limit",e.className="ea-input_word-limit",e.innerText=`${this.#e.value.length}/${this.maxLength}`,this.#e.addEventListener("input",(t=>{e.innerText=`${t.target.value.length}/${this.maxLength}`})),this.#t.appendChild(e),e.style.left=this.#e.getBoundingClientRect().width-e.getBoundingClientRect().width-5+"px"}#i(t){t=Number(t),this.#e.rows=t}#s(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{value:e.target.value}}))}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.placeholder=this.placeholder,this.value=this.value,this.#e.value=this.getAttribute("value")||"",this.disabled=this.disabled,this.autosize=this.autosize,this.maxRows&&(this.maxRows=this.maxRows),this.minRows&&(this.minRows=this.minRows),this.rows=this.rows,this.maxLength=this.maxLength,this.minLength=this.minLength,this.#e.addEventListener("input",(t=>{this.#s("change",t)})),this.#e.addEventListener("focus",(t=>{this.#s("focus",t)})),this.#e.addEventListener("blur",(t=>{this.#s("blur",t)}))}}window.customElements.get("ea-textarea")||window.customElements.define("ea-textarea",EaTextarea);
@@ -0,0 +1 @@
1
+ export const stylesheet="\n.ea-textarea_wrap {\n position: relative;\n width: 100%;\n}\n.ea-textarea_wrap .ea-textarea_inner {\n box-sizing: border-box;\n box-shadow: none;\n resize: vertical;\n min-height: 1.75rem;\n border: 1px solid #dcdfe6;\n outline: 0;\n transition: border 0.2s;\n border-radius: 3px;\n padding: 0.5rem;\n line-height: 0.8;\n font-size: 0.8rem;\n scrollbar-width: none;\n}\n.ea-textarea_wrap .ea-textarea_inner:focus {\n border-color: #409eff;\n}\n.ea-textarea_wrap .ea-textarea_inner::placeholder {\n color: #c0c4cc;\n}\n.ea-textarea_wrap .ea-textarea_inner:disabled {\n background-color: #eeeeee;\n color: #c0c4cc;\n}\n.ea-textarea_wrap .ea-textarea_inner:invalid {\n border-color: #f56c6c;\n}\n.ea-textarea_wrap .ea-input_word-limit {\n position: absolute;\n font-size: 0.75rem;\n bottom: 0.5rem;\n right: 0.5rem;\n}\n";