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,48 @@
1
+ @import "../ea-ui-base-style.scss";
2
+
3
+ .ea-textarea_wrap {
4
+ position: relative;
5
+ width: 100%;
6
+
7
+ .ea-textarea_inner {
8
+ box-sizing: border-box;
9
+ box-shadow: none;
10
+ resize: vertical;
11
+ min-height: 1.75rem;
12
+
13
+ border: 1px solid $color-border;
14
+ outline: 0;
15
+ transition: border 0.2s;
16
+ border-radius: 3px;
17
+
18
+ padding: 0.5rem;
19
+
20
+ line-height: 0.8;
21
+ font-size: 0.8rem;
22
+ scrollbar-width: none;
23
+
24
+ &:focus {
25
+ border-color: $color-primary-border;
26
+ }
27
+
28
+ &::placeholder {
29
+ color: $color-disabled-text;
30
+ }
31
+
32
+ &:disabled {
33
+ background-color: $color-disabled-btn-bgc;
34
+ color: $color-disabled-text;
35
+ }
36
+
37
+ &:invalid {
38
+ border-color: $color-danger-border;
39
+ }
40
+ }
41
+
42
+ .ea-input_word-limit {
43
+ position: absolute;
44
+ font-size: 0.75rem;
45
+ bottom: 0.5rem;
46
+ right: 0.5rem;
47
+ }
48
+ }
@@ -1 +1,39 @@
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";
1
+ export const stylesheet = `
2
+ .ea-textarea_wrap {
3
+ position: relative;
4
+ width: 100%;
5
+ }
6
+ .ea-textarea_wrap .ea-textarea_inner {
7
+ box-sizing: border-box;
8
+ box-shadow: none;
9
+ resize: vertical;
10
+ min-height: 1.75rem;
11
+ border: 1px solid #dcdfe6;
12
+ outline: 0;
13
+ transition: border 0.2s;
14
+ border-radius: 3px;
15
+ padding: 0.5rem;
16
+ line-height: 0.8;
17
+ font-size: 0.8rem;
18
+ scrollbar-width: none;
19
+ }
20
+ .ea-textarea_wrap .ea-textarea_inner:focus {
21
+ border-color: #409eff;
22
+ }
23
+ .ea-textarea_wrap .ea-textarea_inner::placeholder {
24
+ color: #c0c4cc;
25
+ }
26
+ .ea-textarea_wrap .ea-textarea_inner:disabled {
27
+ background-color: #eeeeee;
28
+ color: #c0c4cc;
29
+ }
30
+ .ea-textarea_wrap .ea-textarea_inner:invalid {
31
+ border-color: #f56c6c;
32
+ }
33
+ .ea-textarea_wrap .ea-input_word-limit {
34
+ position: absolute;
35
+ font-size: 0.75rem;
36
+ bottom: 0.5rem;
37
+ right: 0.5rem;
38
+ }
39
+ `;
@@ -0,0 +1,82 @@
1
+ .ea-time-picker_wrap {
2
+ position: relative;
3
+ }
4
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap {
5
+ position: absolute;
6
+ bottom: -12px;
7
+ left: 0;
8
+ transform-origin: center top;
9
+ transform: translateY(100%) scaleY(0);
10
+ box-sizing: border-box;
11
+ background-color: #fff;
12
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
13
+ z-index: 2;
14
+ }
15
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap::before {
16
+ content: "";
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0.5rem;
20
+ border: 0.5rem solid transparent;
21
+ border-bottom-color: #fff;
22
+ transform: translateY(-100%);
23
+ }
24
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap {
25
+ display: flex;
26
+ position: relative;
27
+ margin: 1rem 0;
28
+ }
29
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::before, .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::after {
30
+ content: "";
31
+ position: absolute;
32
+ left: 0;
33
+ transform: translateY(-50%);
34
+ width: 100%;
35
+ }
36
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::before {
37
+ top: calc(50% - 16px);
38
+ border-bottom: 1px solid #e4e7ed;
39
+ }
40
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap::after {
41
+ top: calc(50% + 16px);
42
+ border-bottom: 1px solid #e4e7ed;
43
+ }
44
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner {
45
+ flex: 1;
46
+ max-height: 190px;
47
+ box-sizing: border-box;
48
+ padding: 5rem 0;
49
+ text-align: center;
50
+ overflow: auto;
51
+ scrollbar-width: none;
52
+ margin-block-start: 0;
53
+ margin-block-end: 0;
54
+ margin-inline-start: 0px;
55
+ margin-inline-end: 0px;
56
+ padding-inline-start: 0px;
57
+ list-style-type: none;
58
+ }
59
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item {
60
+ height: 32px;
61
+ line-height: 32px;
62
+ font-size: 12px;
63
+ color: #606266;
64
+ transition: color 0.3s;
65
+ }
66
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item.is-active {
67
+ color: #409eff;
68
+ }
69
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-inner-wrap .ea-time-picker_dropdown-inner .ea-time-picker_dropdown-item.is-disabled {
70
+ color: #c0c4cc;
71
+ }
72
+ .ea-time-picker_wrap .ea-time-picker_dropdown-wrap .ea-time-picker_dropdown-button-group {
73
+ text-align: right;
74
+ box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
75
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
76
+ }
77
+ .ea-time-picker_wrap.is-open .ea-time-picker_dropdown-wrap {
78
+ transform: translateY(100%) scaleY(1);
79
+ }
80
+ .ea-time-picker_wrap.with-transition .ea-time-picker_dropdown-wrap {
81
+ transition: transform 0.3s ease-in-out;
82
+ }
@@ -1 +1,379 @@
1
- import Base from"../Base.js";import"../ea-icon/index.js";import{createElement}from"../../utils/createElement.js";import{timeout}from"../../utils/timeout.js";import{stylesheet}from"./src/style/stylesheet.js";import"../ea-input/index.js";import"../ea-button/index.js";export class EaTimePicker extends Base{#e;#t;#i;#n;#r;#s;#a=!1;constructor(){super();const e=this.attachShadow({mode:"open"});e.innerHTML="\n <div class='ea-time-picker_wrap' part='container'>\n <ea-input part='input' autocomplete=\"off\" readonly prefix-icon=\"icon-clock\"></ea-input>\n <div class=\"ea-time-picker_dropdown-wrap\" part='dropdown-wrap'>\n <div class=\"ea-time-picker_dropdown-inner-wrap\" part='dropdown-inner-wrap'>\n <ul class=\"ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-hour\" part='dropdown-time'>\n </ul>\n <ul class=\"ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-minute\" part='dropdown-time'>\n </ul>\n <ul class=\"ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-second\" part='dropdown-time'>\n </ul>\n </div>\n </div>\n </div>\n ",this.#e=e.querySelector(".ea-time-picker_wrap"),this.#t=e.querySelector("ea-input"),this.#i=e.querySelector(".ea-time-picker_dropdown-wrap"),this.#n=e.querySelector(".ea-time-picker_dropdown-inner-hour"),this.#r=e.querySelector(".ea-time-picker_dropdown-inner-minute"),this.#s=e.querySelector(".ea-time-picker_dropdown-inner-second"),this.build(e,stylesheet)}get width(){return this.getAttribute("width")||"200px"}set width(e){this.setAttribute("width",e),this.#e.style.width=e}get time(){return this.getAttribute("time")||"00:00:00"}set time(e){this.setAttribute("time",e);const[t,i,n]=e.split(":");this.hour=t,this.minute=i,this.second=n}get name(){return this.getAttribute("name")||"timePicker"}set name(e){this.setAttribute("name",e)}get hour(){const e=this.getAttrNumber("hour");return this.#o(e)}set hour(e){this.setAttribute("hour",e),this.#h(this.#n,e)}get minute(){const e=this.getAttrNumber("minute");return this.#o(e)}set minute(e){this.setAttribute("minute",e),this.#h(this.#r,e)}get second(){const e=this.getAttrNumber("second");return this.#o(e)}set second(e){this.setAttribute("second",e),this.#h(this.#s,e)}get value(){return this.time}set value(e){this.time=e}get disabled(){return this.getAttrBoolean("disabled")||!1}set disabled(e){this.setAttribute("disabled",e),this.#t.disabled=e}get align(){return this.getAttribute("align")||"left"}set align(e){this.setAttribute("align",e),this.#t.shadowRoot.querySelector("input").style.textAlign=e}get limitRangeStart(){if(this.getAttribute("limit-range-start")){const[e,t,i]=this.getAttribute("limit-range-start")?.split(":");return`${this.#o(e)}:${this.#o(t)}:${this.#o(i)}`}return"00:00:00"}set limitRangeStart(e){this.setAttribute("limit-range-start",e)}get limitRangeEnd(){if(this.getAttribute("limit-range-end")){const[e,t,i]=this.getAttribute("limit-range-end")?.split(":");return`${this.#o(e)}:${this.#o(t)}:${this.#o(i)}`}return"23:59:59"}set limitRangeEnd(e){this.setAttribute("limit-range-end",e)}#o(e,t="00"){return(e=Number(e))<10?`0${e}`:e||t}#h(e,t){e.querySelectorAll("li").forEach((e=>{Number(e.innerText)===Number(this.#o(t))&&e.click()}))}#d(){this.#i.style.width=this.#t.getBoundingClientRect().width+"px",timeout((()=>{this.#e.classList.add("with-transition")}),50)}#l(e,t,i,n){e.addEventListener("click",(()=>{i.querySelectorAll("li").forEach((e=>{e.classList.remove("is-active")})),e.classList.add("is-active");const r=this.#o(t);switch(n){case"hour":this.hour=r;break;case"minute":this.minute=r;break;case"second":this.second=r}this.#a&&this.dispatchEvent(new CustomEvent("change",{detail:{time:this.time}})),this.#t.value=`${this.hour}:${this.minute}:${this.second}`,this.time=`${this.hour}:${this.minute}:${this.second}`;const s=e.getBoundingClientRect().height*t;i.scrollTo({top:s,behavior:"smooth"})}))}#c(e){e.addEventListener("wheel",(()=>{timeout((()=>{const t=e.querySelectorAll("li"),i=t[0].getBoundingClientRect().height,{scrollTop:n}=e,r=Math.floor(n/i);t[r]&&t[r].click()}),100)}))}#m(){const[e,t,i]=this.limitRangeStart.split(":"),[n,r,s]=this.limitRangeEnd.split(":"),a=new Date;if(new Date(a.getFullYear(),a.getMonth(),a.getDate(),e,t,i)>new Date(a.getFullYear(),a.getMonth(),a.getDate(),n,r,s))throw new Error("limit-range-start must be less than limit-range-end");const o=(t,i,r,s)=>{t=Number(t),i=Number(i);let a=0,o=0;if("hour"===s)a=0,o=23;else a=0,o=59,String(t).localeCompare(i)||e===n||(i=0===i?59:i);for(let e=a;e<=o;e++){const n=createElement("li","ea-time-picker_dropdown-item");n.innerText=this.#o(e),r.appendChild(n),e>=t&&e<=i?this.#l(n,e,r,s):n.classList.add("is-disabled")}};o(e,n,this.#n,"hour"),o(t,r,this.#r,"minute"),o(i,s,this.#s,"second"),this.#c(this.#n),this.#c(this.#r),this.#c(this.#s)}#u(){let e=!1;const t=()=>{this.time=this.time,e=!0,this.#a=!0,this.#i.removeEventListener("transitionend",t)};this.#t.addEventListener("focus",(()=>{this.#e.classList.add("is-open"),e||this.#i.addEventListener("transitionend",t)})),window.addEventListener("click",(e=>{this.contains(e.target)?this.#t.shadowRoot.querySelector(".ea-input_inner").focus():this.#e.classList.remove("is-open")}))}connectedCallback(){this.setAttribute("data-ea-component",!0),this.name=this.name,this.width=this.width,this.disabled=this.disabled,this.align=this.align,this.limitRangeStart=this.limitRangeStart,this.limitRangeEnd=this.limitRangeEnd,this.#d(),this.#m(),this.time=this.time,this.#t.value=`${this.hour}:${this.minute}:${this.second}`,this.#u()}}customElements.get("ea-time-picker")||customElements.define("ea-time-picker",EaTimePicker);
1
+ // @ts-nocheck
2
+ import Base from '../Base.js';
3
+ import '../ea-icon/index.js'
4
+
5
+ import { createElement } from '../../utils/createElement.js';
6
+ import { timeout } from '../../utils/timeout.js';
7
+ import { stylesheet } from './src/style/stylesheet.js';
8
+
9
+ import "../ea-input/index.js"
10
+ import '../ea-button/index.js'
11
+
12
+ export class EaTimePicker extends Base {
13
+ #container;
14
+ #timePickerInput;
15
+
16
+ #dropdownWrap;
17
+ #timePickerHourWrap;
18
+ #timePickerMinuteWrap;
19
+ #timePickerSecondWrap;
20
+
21
+ #timePickerIsInit = false;
22
+
23
+ constructor() {
24
+ super();
25
+
26
+ const shadowRoot = this.attachShadow({ mode: 'open' });
27
+
28
+ shadowRoot.innerHTML = `
29
+ <div class='ea-time-picker_wrap' part='container'>
30
+ <ea-input part='input' autocomplete="off" readonly prefix-icon="icon-clock"></ea-input>
31
+ <div class="ea-time-picker_dropdown-wrap" part='dropdown-wrap'>
32
+ <div class="ea-time-picker_dropdown-inner-wrap" part='dropdown-inner-wrap'>
33
+ <ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-hour" part='dropdown-time'>
34
+ </ul>
35
+ <ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-minute" part='dropdown-time'>
36
+ </ul>
37
+ <ul class="ea-time-picker_dropdown-inner ea-time-picker_dropdown-inner-second" part='dropdown-time'>
38
+ </ul>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ `;
43
+
44
+ this.#container = shadowRoot.querySelector('.ea-time-picker_wrap');
45
+ this.#timePickerInput = shadowRoot.querySelector('ea-input');
46
+
47
+ this.#dropdownWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-wrap');
48
+ this.#timePickerHourWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-hour');
49
+ this.#timePickerMinuteWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-minute');
50
+ this.#timePickerSecondWrap = shadowRoot.querySelector('.ea-time-picker_dropdown-inner-second');
51
+
52
+ this.build(shadowRoot, stylesheet);
53
+ }
54
+
55
+ // ------- width 宽度 -------
56
+ // #region
57
+ get width() {
58
+ return this.getAttribute('width') || "200px";
59
+ }
60
+
61
+ set width(value) {
62
+ this.setAttribute('width', value);
63
+
64
+ this.#container.style.width = value;
65
+ }
66
+ // #endregion
67
+ // ------- end -------
68
+
69
+ // ------- time 时间 -------
70
+ // #region
71
+ get time() {
72
+ return this.getAttribute('time') || '00:00:00';
73
+ }
74
+
75
+ set time(value) {
76
+ this.setAttribute('time', value);
77
+
78
+ const [hour, minute, second] = value.split(':');
79
+
80
+ this.hour = hour;
81
+ this.minute = minute;
82
+ this.second = second;
83
+ }
84
+ // #endregion
85
+ // ------- end -------
86
+
87
+ // ------- name 属性 -------
88
+ // #region
89
+ get name() {
90
+ return this.getAttribute('name') || 'timePicker';
91
+ }
92
+
93
+ set name(value) {
94
+ this.setAttribute('name', value);
95
+ }
96
+ // #endregion
97
+ // ------- end -------
98
+
99
+ // ------- hour 小时 -------
100
+ // #region
101
+ get hour() {
102
+ const attr = this.getAttrNumber('hour');
103
+ return this.#handleLessThanTen(attr);
104
+ }
105
+
106
+ set hour(value) {
107
+ this.setAttribute('hour', value);
108
+
109
+ this.#handleTimeItemPicker(this.#timePickerHourWrap, value);
110
+ }
111
+ // #endregion
112
+ // ------- end -------
113
+
114
+ // ------- minute 分钟 -------
115
+ // #region
116
+ get minute() {
117
+ const attr = this.getAttrNumber('minute');
118
+ return this.#handleLessThanTen(attr);
119
+ }
120
+
121
+ set minute(value) {
122
+ this.setAttribute('minute', value);
123
+
124
+ this.#handleTimeItemPicker(this.#timePickerMinuteWrap, value);
125
+ }
126
+ // #endregion
127
+ // ------- end -------
128
+
129
+ // ------- second 秒 -------
130
+ // #region
131
+ get second() {
132
+ const attr = this.getAttrNumber('second');
133
+ return this.#handleLessThanTen(attr);
134
+ }
135
+
136
+ set second(value) {
137
+ this.setAttribute('second', value);
138
+
139
+ this.#handleTimeItemPicker(this.#timePickerSecondWrap, value);
140
+ }
141
+ // #endregion
142
+ // ------- end -------
143
+
144
+ // ------- value 时间 -------
145
+ // #region
146
+ get value() {
147
+ return this.time;
148
+ }
149
+
150
+ set value(value) {
151
+ this.time = value;
152
+ }
153
+ // #endregion
154
+ // ------- end -------
155
+
156
+ // ------- disabled 禁用 -------
157
+ // #region
158
+ get disabled() {
159
+ return this.getAttrBoolean('disabled') || false;
160
+ }
161
+
162
+ set disabled(value) {
163
+ this.setAttribute('disabled', value);
164
+
165
+ this.#timePickerInput.disabled = value;
166
+ }
167
+ // #endregion
168
+ // ------- end -------
169
+
170
+ // ------- align 对齐方式 -------
171
+ // #region
172
+ get align() {
173
+ return this.getAttribute('align') || 'left';
174
+ }
175
+
176
+ set align(value) {
177
+ this.setAttribute('align', value);
178
+
179
+ this.#timePickerInput.shadowRoot.querySelector('input').style.textAlign = value;
180
+ }
181
+ // #endregion
182
+ // ------- end -------
183
+
184
+ // ------- limit-range-start 限制起始时间 -------
185
+ // #region
186
+ get limitRangeStart() {
187
+ const attr = this.getAttribute('limit-range-start');
188
+ if (!attr) return "00:00:00";
189
+ else {
190
+ const [hour, minute, second] = this.getAttribute('limit-range-start')?.split(':');
191
+ return `${this.#handleLessThanTen(hour)}:${this.#handleLessThanTen(minute)}:${this.#handleLessThanTen(second)}`;
192
+ }
193
+ }
194
+
195
+ set limitRangeStart(value) {
196
+ this.setAttribute('limit-range-start', value);
197
+ }
198
+ // #endregion
199
+ // ------- end -------
200
+
201
+ // ------- limit-range-end 限制结束时间 -------
202
+ // #region
203
+ get limitRangeEnd() {
204
+ const attr = this.getAttribute('limit-range-end');
205
+ if (!attr) return "23:59:59"
206
+ else {
207
+ const [hour, minute, second] = this.getAttribute('limit-range-end')?.split(':');
208
+ return `${this.#handleLessThanTen(hour)}:${this.#handleLessThanTen(minute)}:${this.#handleLessThanTen(second)}`;
209
+ }
210
+ }
211
+
212
+ set limitRangeEnd(value) {
213
+ this.setAttribute('limit-range-end', value);
214
+ }
215
+ // #endregion
216
+ // ------- end -------
217
+
218
+ #handleLessThanTen(num, defaultNum = '00') {
219
+ num = Number(num);
220
+ return num < 10 ? `0${num}` : (num || defaultNum);
221
+ }
222
+
223
+ #handleTimeItemPicker(wrap, value) {
224
+ wrap.querySelectorAll('li').forEach(li => {
225
+ if (Number(li.innerText) === Number(this.#handleLessThanTen(value))) li.click();
226
+ });
227
+ }
228
+
229
+ #initElementsStyle() {
230
+ this.#dropdownWrap.style.width = this.#timePickerInput.getBoundingClientRect().width + "px";
231
+
232
+ timeout(() => {
233
+ this.#container.classList.add('with-transition');
234
+ }, 50);
235
+ }
236
+
237
+ #handleTimeItemClickEvent(li, index, timeItemWrap, type) {
238
+ li.addEventListener('click', () => {
239
+ const lis = timeItemWrap.querySelectorAll('li');
240
+ lis.forEach(li => {
241
+ li.classList.remove('is-active');
242
+ });
243
+ li.classList.add('is-active');
244
+
245
+ const value = this.#handleLessThanTen(index);
246
+ switch (type) {
247
+ case 'hour':
248
+ this.hour = value;
249
+ break;
250
+ case 'minute':
251
+ this.minute = value;
252
+ break;
253
+ case 'second':
254
+ this.second = value;
255
+ break;
256
+ }
257
+
258
+ if (this.#timePickerIsInit) this.dispatchEvent(new CustomEvent('change', { detail: { time: this.time } }));
259
+
260
+ this.#timePickerInput.value = `${this.hour}:${this.minute}:${this.second}`;
261
+ this.time = `${this.hour}:${this.minute}:${this.second}`;
262
+
263
+ const top = li.getBoundingClientRect().height * index;
264
+ timeItemWrap.scrollTo({
265
+ top,
266
+ behavior: 'smooth',
267
+ });
268
+ });
269
+ }
270
+
271
+ #handleTimeWrapScroll(wrap) {
272
+ wrap.addEventListener('wheel', () => {
273
+ timeout(() => {
274
+ const lis = wrap.querySelectorAll('li');
275
+ const height = lis[0].getBoundingClientRect().height;
276
+ const { scrollTop } = wrap
277
+ const index = Math.floor(scrollTop / height);
278
+
279
+ if (lis[index]) lis[index].click();
280
+ }, 100);
281
+ });
282
+ }
283
+
284
+ #initTimerPickerTimeItem() {
285
+ const [startHour, startMinute, startSecond] = this.limitRangeStart.split(':');
286
+ const [endHour, endMinute, endSecond] = this.limitRangeEnd.split(':');
287
+
288
+ const todayDate = new Date();
289
+ const startDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate(), startHour, startMinute, startSecond);
290
+ const endDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate(), endHour, endMinute, endSecond);
291
+ if (startDate > endDate) throw new Error('limit-range-start must be less than limit-range-end');
292
+
293
+ const initTimeItem = (startTime, endTime, wrap, type) => {
294
+ startTime = Number(startTime);
295
+ endTime = Number(endTime);
296
+ let start = 0;
297
+ let end = 0;
298
+
299
+ switch (type) {
300
+ case 'hour':
301
+ start = 0;
302
+ end = 23;
303
+ break;
304
+ default:
305
+ start = 0;
306
+ end = 59;
307
+ if (!String(startTime).localeCompare(endTime) && (startHour !== endHour)) endTime = endTime === 0 ? 59 : endTime;
308
+ }
309
+
310
+ for (let i = start; i <= end; i++) {
311
+ const li = createElement('li', 'ea-time-picker_dropdown-item');
312
+ li.innerText = this.#handleLessThanTen(i);
313
+ wrap.appendChild(li);
314
+
315
+ if (i >= startTime && i <= endTime) this.#handleTimeItemClickEvent(li, i, wrap, type);
316
+ else li.classList.add('is-disabled');
317
+ }
318
+ }
319
+
320
+ initTimeItem(startHour, endHour, this.#timePickerHourWrap, 'hour');
321
+ initTimeItem(startMinute, endMinute, this.#timePickerMinuteWrap, 'minute');
322
+ initTimeItem(startSecond, endSecond, this.#timePickerSecondWrap, 'second');
323
+
324
+ this.#handleTimeWrapScroll(this.#timePickerHourWrap);
325
+ this.#handleTimeWrapScroll(this.#timePickerMinuteWrap);
326
+ this.#handleTimeWrapScroll(this.#timePickerSecondWrap);
327
+ }
328
+
329
+ #initToggleDropdownWrapShow() {
330
+ let timePickerIsInit = false;
331
+
332
+ const dropdownWrapInitCallback = () => {
333
+ this.time = this.time;
334
+ timePickerIsInit = true;
335
+ this.#timePickerIsInit = true;
336
+ this.#dropdownWrap.removeEventListener('transitionend', dropdownWrapInitCallback);
337
+ }
338
+ this.#timePickerInput.addEventListener('focus', () => {
339
+ this.#container.classList.add('is-open');
340
+
341
+ if (!timePickerIsInit) this.#dropdownWrap.addEventListener('transitionend', dropdownWrapInitCallback);
342
+ });
343
+
344
+ window.addEventListener('click', (e) => {
345
+ if (!this.contains(e.target)) {
346
+ this.#container.classList.remove('is-open');
347
+ } else {
348
+ this.#timePickerInput.shadowRoot.querySelector('.ea-input_inner').focus();
349
+ }
350
+ });
351
+ }
352
+
353
+ connectedCallback() {
354
+ this.setAttribute('data-ea-component', true);
355
+
356
+ this.name = this.name;
357
+
358
+ this.width = this.width;
359
+
360
+ this.disabled = this.disabled;
361
+
362
+ this.align = this.align;
363
+
364
+ this.limitRangeStart = this.limitRangeStart;
365
+ this.limitRangeEnd = this.limitRangeEnd;
366
+
367
+ this.#initElementsStyle();
368
+ this.#initTimerPickerTimeItem();
369
+
370
+ this.time = this.time;
371
+ this.#timePickerInput.value = `${this.hour}:${this.minute}:${this.second}`;
372
+
373
+ this.#initToggleDropdownWrapShow();
374
+ }
375
+ }
376
+
377
+ if (!customElements.get('ea-time-picker')) {
378
+ customElements.define('ea-time-picker', EaTimePicker);
379
+ }
@@ -0,0 +1,110 @@
1
+ .ea-time-picker_wrap {
2
+ position: relative;
3
+
4
+ .ea-time-picker_dropdown-wrap {
5
+ position: absolute;
6
+ bottom: -12px;
7
+ left: 0;
8
+ transform-origin: center top;
9
+ transform: translateY(100%) scaleY(0);
10
+
11
+ box-sizing: border-box;
12
+
13
+ background-color: #fff;
14
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
15
+
16
+ z-index: 2;
17
+
18
+ &::before {
19
+ content: "";
20
+ position: absolute;
21
+ top: 0;
22
+ left: 0.5rem;
23
+ border: 0.5rem solid transparent;
24
+ border-bottom-color: #fff;
25
+
26
+ transform: translateY(-100%);
27
+ }
28
+
29
+ .ea-time-picker_dropdown-inner-wrap {
30
+ display: flex;
31
+ position: relative;
32
+ margin: 1rem 0;
33
+
34
+ &::before,
35
+ &::after {
36
+ content: "";
37
+ position: absolute;
38
+ left: 0;
39
+
40
+ transform: translateY(-50%);
41
+
42
+ width: 100%;
43
+ }
44
+
45
+ &::before {
46
+ top: calc(50% - 16px);
47
+ border-bottom: 1px solid #e4e7ed;
48
+ }
49
+
50
+ &::after {
51
+ top: calc(50% + 16px);
52
+ border-bottom: 1px solid #e4e7ed;
53
+ }
54
+
55
+ .ea-time-picker_dropdown-inner {
56
+ flex: 1;
57
+ max-height: 190px;
58
+
59
+ box-sizing: border-box;
60
+ padding: 5rem 0;
61
+
62
+ text-align: center;
63
+
64
+ overflow: auto;
65
+ scrollbar-width: none;
66
+
67
+ margin-block-start: 0;
68
+ margin-block-end: 0;
69
+ margin-inline-start: 0px;
70
+ margin-inline-end: 0px;
71
+ padding-inline-start: 0px;
72
+ list-style-type: none;
73
+
74
+ .ea-time-picker_dropdown-item {
75
+ height: 32px;
76
+ line-height: 32px;
77
+ font-size: 12px;
78
+ color: #606266;
79
+ transition: color 0.3s;
80
+
81
+ &.is-active {
82
+ color: #409eff;
83
+ }
84
+
85
+ &.is-disabled {
86
+ color: #c0c4cc;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ .ea-time-picker_dropdown-button-group {
93
+ text-align: right;
94
+ box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
95
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
96
+ }
97
+ }
98
+
99
+ &.is-open {
100
+ .ea-time-picker_dropdown-wrap {
101
+ transform: translateY(100%) scaleY(1);
102
+ }
103
+ }
104
+
105
+ &.with-transition {
106
+ .ea-time-picker_dropdown-wrap {
107
+ transition: transform 0.3s ease-in-out;
108
+ }
109
+ }
110
+ }