litos-ui 0.21.0 → 0.23.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 (387) hide show
  1. package/README.md +121 -15
  2. package/README.zh-CN.md +155 -0
  3. package/lib/base.d.ts +1 -0
  4. package/lib/base.js +1 -1
  5. package/lib/button/index.js +4 -4
  6. package/lib/{style-gKR_qwzm.js → button/index.less_inline.js} +2 -3
  7. package/lib/button/style.js +8 -2
  8. package/lib/calendar/index.js +140 -2
  9. package/lib/calendar/index.less_inline.js +4 -0
  10. package/lib/calendar/langs.js +12 -0
  11. package/lib/card/index.js +64 -2
  12. package/lib/card/index.less_inline.js +4 -0
  13. package/lib/carousel/index.js +257 -2
  14. package/lib/carousel/index.less_inline.js +4 -0
  15. package/lib/carousel/item.js +15 -2
  16. package/lib/carousel/item.less_inline.js +4 -0
  17. package/lib/carousel/timer.js +19 -0
  18. package/lib/check/check.d.ts +1 -0
  19. package/lib/check/check.js +117 -0
  20. package/lib/check/check.less_inline.js +4 -0
  21. package/lib/check/checkbox.js +18 -2
  22. package/lib/{checkbox-DhGHJXwI.js → check/checkbox.less_inline.js} +2 -14
  23. package/lib/check/checkbox_group.js +1 -1
  24. package/lib/check/index.d.ts +1 -0
  25. package/lib/{check-DFlwStH9.js → check/index.js} +10 -9
  26. package/lib/check/index.less_inline.js +4 -0
  27. package/lib/check/radio.js +15 -2
  28. package/lib/{radio-C9NPQWGI.js → check/radio.less_inline.js} +2 -11
  29. package/lib/check/radio_group.js +1 -1
  30. package/lib/collapse/index.js +103 -2
  31. package/lib/collapse/index.less_inline.js +4 -0
  32. package/lib/collapse/item.d.ts +1 -0
  33. package/lib/collapse/item.js +118 -2
  34. package/lib/collapse/item.less_inline.js +4 -0
  35. package/lib/collapse/types.d.ts +1 -0
  36. package/lib/color_picker/index.js +42 -2
  37. package/lib/color_picker/index.less_inline.js +4 -0
  38. package/lib/date_picker/index.js +100 -3
  39. package/lib/date_picker/index.less_inline.js +4 -0
  40. package/lib/date_picker_ori/index.js +121 -2
  41. package/lib/date_picker_ori/index.less_inline.js +4 -0
  42. package/lib/description_panel/index.js +54 -2
  43. package/lib/description_panel/index.less_inline.js +4 -0
  44. package/lib/dialog/dialog_box.js +10 -10
  45. package/lib/{dialog_container_style-C1s0aBf7.js → dialog/dialog_container.css_inline.js} +2 -3
  46. package/lib/dialog/dialog_container.d.ts +1 -0
  47. package/lib/dialog/dialog_container.js +71 -60
  48. package/lib/dialog/dialog_container_style.js +8 -2
  49. package/lib/dialog/index.d.ts +1 -0
  50. package/lib/dialog/index.js +11 -6
  51. package/lib/entries/base.d.ts +2 -0
  52. package/lib/entries/base.js +2 -0
  53. package/lib/entries/button.d.ts +2 -0
  54. package/lib/entries/button.js +6 -0
  55. package/lib/entries/calendar.d.ts +2 -0
  56. package/lib/entries/calendar.js +6 -0
  57. package/lib/entries/card.d.ts +2 -0
  58. package/lib/entries/card.js +6 -0
  59. package/lib/entries/carousel-item.d.ts +2 -0
  60. package/lib/entries/carousel-item.js +6 -0
  61. package/lib/entries/carousel.d.ts +5 -0
  62. package/lib/entries/carousel.js +6 -0
  63. package/lib/entries/checkbox-group.d.ts +3 -0
  64. package/lib/entries/checkbox-group.js +6 -0
  65. package/lib/entries/checkbox.d.ts +2 -0
  66. package/lib/entries/checkbox.js +6 -0
  67. package/lib/entries/collapse-item.d.ts +3 -0
  68. package/lib/entries/collapse-item.js +6 -0
  69. package/lib/entries/collapse.d.ts +3 -0
  70. package/lib/entries/collapse.js +6 -0
  71. package/lib/entries/color-picker.d.ts +3 -0
  72. package/lib/entries/color-picker.js +6 -0
  73. package/lib/entries/date-picker-ori.d.ts +2 -0
  74. package/lib/entries/date-picker-ori.js +6 -0
  75. package/lib/entries/date-picker.d.ts +9 -0
  76. package/lib/entries/date-picker.js +6 -0
  77. package/lib/entries/description-panel.d.ts +4 -0
  78. package/lib/entries/description-panel.js +6 -0
  79. package/lib/entries/dialog-box.d.ts +6 -0
  80. package/lib/entries/dialog-box.js +2 -0
  81. package/lib/entries/dialog-container.d.ts +4 -0
  82. package/lib/entries/dialog-container.js +6 -0
  83. package/lib/entries/dialog.d.ts +3 -0
  84. package/lib/entries/dialog.js +2 -0
  85. package/lib/entries/form-item.d.ts +2 -0
  86. package/lib/entries/form-item.js +6 -0
  87. package/lib/entries/form.d.ts +3 -0
  88. package/lib/entries/form.js +6 -0
  89. package/lib/entries/icon-arrow-down.d.ts +2 -0
  90. package/lib/entries/icon-arrow-down.js +6 -0
  91. package/lib/entries/icon-arrow-left.d.ts +2 -0
  92. package/lib/entries/icon-arrow-left.js +6 -0
  93. package/lib/entries/icon-arrow-right.d.ts +2 -0
  94. package/lib/entries/icon-arrow-right.js +6 -0
  95. package/lib/entries/icon-arrow-up.d.ts +2 -0
  96. package/lib/entries/icon-arrow-up.js +6 -0
  97. package/lib/entries/icon-base.d.ts +2 -0
  98. package/lib/entries/icon-base.js +6 -0
  99. package/lib/entries/icon-calendar.d.ts +2 -0
  100. package/lib/entries/icon-calendar.js +6 -0
  101. package/lib/entries/icon-caret-bottom.d.ts +2 -0
  102. package/lib/entries/icon-caret-bottom.js +6 -0
  103. package/lib/entries/icon-caret-top.d.ts +2 -0
  104. package/lib/entries/icon-caret-top.js +6 -0
  105. package/lib/entries/icon-close-filled.d.ts +2 -0
  106. package/lib/entries/icon-close-filled.js +6 -0
  107. package/lib/entries/icon-close.d.ts +2 -0
  108. package/lib/entries/icon-close.js +6 -0
  109. package/lib/entries/icon-copy.d.ts +2 -0
  110. package/lib/entries/icon-copy.js +6 -0
  111. package/lib/entries/icon-d-arrow-left.d.ts +2 -0
  112. package/lib/entries/icon-d-arrow-left.js +6 -0
  113. package/lib/entries/icon-d-arrow-right.d.ts +2 -0
  114. package/lib/entries/icon-d-arrow-right.js +6 -0
  115. package/lib/entries/icon-delete.d.ts +2 -0
  116. package/lib/entries/icon-delete.js +6 -0
  117. package/lib/entries/icon-eye-outline.d.ts +2 -0
  118. package/lib/entries/icon-eye-outline.js +6 -0
  119. package/lib/entries/icon-font-icon.d.ts +2 -0
  120. package/lib/entries/icon-font-icon.js +6 -0
  121. package/lib/entries/icon-info.d.ts +2 -0
  122. package/lib/entries/icon-info.js +6 -0
  123. package/lib/entries/icon-loading.d.ts +2 -0
  124. package/lib/entries/icon-loading.js +6 -0
  125. package/lib/entries/icon-minus.d.ts +2 -0
  126. package/lib/entries/icon-minus.js +6 -0
  127. package/lib/entries/icon-moon.d.ts +2 -0
  128. package/lib/entries/icon-moon.js +6 -0
  129. package/lib/entries/icon-more.d.ts +2 -0
  130. package/lib/entries/icon-more.js +6 -0
  131. package/lib/entries/icon-picture.d.ts +2 -0
  132. package/lib/entries/icon-picture.js +6 -0
  133. package/lib/entries/icon-plus.d.ts +2 -0
  134. package/lib/entries/icon-plus.js +6 -0
  135. package/lib/entries/icon-reduction.d.ts +2 -0
  136. package/lib/entries/icon-reduction.js +6 -0
  137. package/lib/entries/icon-refresh-left.d.ts +2 -0
  138. package/lib/entries/icon-refresh-left.js +6 -0
  139. package/lib/entries/icon-refresh-right.d.ts +2 -0
  140. package/lib/entries/icon-refresh-right.js +6 -0
  141. package/lib/entries/icon-refresh.d.ts +2 -0
  142. package/lib/entries/icon-refresh.js +6 -0
  143. package/lib/entries/icon-search.d.ts +2 -0
  144. package/lib/entries/icon-search.js +6 -0
  145. package/lib/entries/icon-select.d.ts +2 -0
  146. package/lib/entries/icon-select.js +6 -0
  147. package/lib/entries/icon-sort.d.ts +2 -0
  148. package/lib/entries/icon-sort.js +6 -0
  149. package/lib/entries/icon-success.d.ts +2 -0
  150. package/lib/entries/icon-success.js +6 -0
  151. package/lib/entries/icon-sun.d.ts +2 -0
  152. package/lib/entries/icon-sun.js +6 -0
  153. package/lib/entries/icon-theme-default.d.ts +2 -0
  154. package/lib/entries/icon-theme-default.js +6 -0
  155. package/lib/entries/icon-warn.d.ts +2 -0
  156. package/lib/entries/icon-warn.js +6 -0
  157. package/lib/entries/icon-zoom-in.d.ts +2 -0
  158. package/lib/entries/icon-zoom-in.js +6 -0
  159. package/lib/entries/icon-zoom-out.d.ts +2 -0
  160. package/lib/entries/icon-zoom-out.js +6 -0
  161. package/lib/entries/image-preview.d.ts +10 -0
  162. package/lib/entries/image-preview.js +6 -0
  163. package/lib/entries/image.d.ts +2 -0
  164. package/lib/entries/image.js +6 -0
  165. package/lib/entries/input-number.d.ts +2 -0
  166. package/lib/entries/input-number.js +6 -0
  167. package/lib/entries/input.d.ts +2 -0
  168. package/lib/entries/input.js +6 -0
  169. package/lib/entries/list.d.ts +3 -0
  170. package/lib/entries/list.js +6 -0
  171. package/lib/entries/loading.d.ts +2 -0
  172. package/lib/entries/loading.js +2 -0
  173. package/lib/entries/mask.d.ts +2 -0
  174. package/lib/entries/mask.js +6 -0
  175. package/lib/entries/md-input.d.ts +2 -0
  176. package/lib/entries/md-input.js +6 -0
  177. package/lib/entries/menu.d.ts +3 -0
  178. package/lib/entries/menu.js +6 -0
  179. package/lib/entries/message.d.ts +6 -0
  180. package/lib/entries/message.js +2 -0
  181. package/lib/entries/modal-box.d.ts +6 -0
  182. package/lib/entries/modal-box.js +2 -0
  183. package/lib/entries/modal.d.ts +4 -0
  184. package/lib/entries/modal.js +6 -0
  185. package/lib/entries/notification-box.d.ts +2 -0
  186. package/lib/entries/notification-box.js +2 -0
  187. package/lib/entries/notification.d.ts +2 -0
  188. package/lib/entries/notification.js +2 -0
  189. package/lib/entries/page-header.d.ts +4 -0
  190. package/lib/entries/page-header.js +6 -0
  191. package/lib/entries/pagination.d.ts +9 -0
  192. package/lib/entries/pagination.js +6 -0
  193. package/lib/entries/polygon.d.ts +2 -0
  194. package/lib/entries/polygon.js +6 -0
  195. package/lib/entries/popconfirm.d.ts +3 -0
  196. package/lib/entries/popconfirm.js +2 -0
  197. package/lib/entries/popover.d.ts +1 -0
  198. package/lib/entries/popover.js +2 -0
  199. package/lib/entries/qrcode.d.ts +2 -0
  200. package/lib/entries/qrcode.js +6 -0
  201. package/lib/entries/radio-group.d.ts +3 -0
  202. package/lib/entries/radio-group.js +6 -0
  203. package/lib/entries/radio.d.ts +2 -0
  204. package/lib/entries/radio.js +6 -0
  205. package/lib/entries/select-ori.d.ts +2 -0
  206. package/lib/entries/select-ori.js +6 -0
  207. package/lib/entries/select.d.ts +4 -0
  208. package/lib/entries/select.js +6 -0
  209. package/lib/entries/space.d.ts +2 -0
  210. package/lib/entries/space.js +6 -0
  211. package/lib/entries/switch.d.ts +2 -0
  212. package/lib/entries/switch.js +6 -0
  213. package/lib/entries/tabbar-item.d.ts +2 -0
  214. package/lib/entries/tabbar-item.js +6 -0
  215. package/lib/entries/tabbar.d.ts +3 -0
  216. package/lib/entries/tabbar.js +6 -0
  217. package/lib/entries/table.d.ts +3 -0
  218. package/lib/entries/table.js +6 -0
  219. package/lib/entries/tabs.d.ts +3 -0
  220. package/lib/entries/tabs.js +2 -0
  221. package/lib/entries/tag.d.ts +2 -0
  222. package/lib/entries/tag.js +6 -0
  223. package/lib/entries/theme-color.d.ts +3 -0
  224. package/lib/entries/theme-color.js +6 -0
  225. package/lib/entries/theme.d.ts +9 -0
  226. package/lib/entries/theme.js +6 -0
  227. package/lib/entries/transition.d.ts +1 -0
  228. package/lib/entries/transition.js +2 -0
  229. package/lib/entries/upload.d.ts +3 -0
  230. package/lib/entries/upload.js +6 -0
  231. package/lib/entries/utils.d.ts +1 -0
  232. package/lib/entries/utils.js +2 -0
  233. package/lib/form/form_inner.d.ts +1 -0
  234. package/lib/{form_inner-Cnwb6f_Q.js → form/form_inner.js} +9 -9
  235. package/lib/form/form_item.d.ts +2 -1
  236. package/lib/form/form_item.js +148 -2
  237. package/lib/form/form_item.less_inline.js +4 -0
  238. package/lib/form/index.d.ts +3 -2
  239. package/lib/form/index.js +191 -2
  240. package/lib/form/index.less_inline.js +4 -0
  241. package/lib/icon/base.js +1 -1
  242. package/lib/icon/delete.d.ts +5 -0
  243. package/lib/icon/delete.js +10 -0
  244. package/lib/icon/eye_outline.d.ts +6 -0
  245. package/lib/icon/eye_outline.js +13 -0
  246. package/lib/icon/icon_style.js +8 -2
  247. package/lib/{icon_style-J7iiDS_a.js → icon/index.less_inline.js} +2 -3
  248. package/lib/icon/minus.d.ts +5 -0
  249. package/lib/icon/minus.js +10 -0
  250. package/lib/icon/picture.d.ts +5 -0
  251. package/lib/icon/picture.js +10 -0
  252. package/lib/icon/plus.d.ts +5 -0
  253. package/lib/icon/plus.js +10 -0
  254. package/lib/image/image_preview.js +91 -2
  255. package/lib/image/image_preview.less_inline.js +4 -0
  256. package/lib/image/index.js +163 -2
  257. package/lib/image/index.less_inline.js +4 -0
  258. package/lib/index.d.ts +12 -0
  259. package/lib/index.js +48 -40
  260. package/lib/input/index.js +4 -4
  261. package/lib/{input-DUBlLEXS.js → input/index.less_inline.js} +1 -1
  262. package/lib/{input_inner-x4GfLGjj.js → input/input_inner.less_inline.js} +1 -1
  263. package/lib/input_number/index.js +3 -3
  264. package/lib/{style-C5wUmE2b.js → input_number/index.less_inline.js} +2 -3
  265. package/lib/input_number/style.js +8 -2
  266. package/lib/list/index.js +52 -2
  267. package/lib/list/index.less_inline.js +4 -0
  268. package/lib/loading/index.js +1 -1
  269. package/lib/mask/index.d.ts +1 -1
  270. package/lib/mask/index.js +109 -2
  271. package/lib/mask/index.less_inline.js +4 -0
  272. package/lib/md_input/index.js +59 -2
  273. package/lib/md_input/index.less_inline.js +4 -0
  274. package/lib/menu/index.js +275 -2
  275. package/lib/menu/index.less_inline.js +4 -0
  276. package/lib/message/index.js +1 -1
  277. package/lib/modal/index.js +199 -2
  278. package/lib/modal/index.less_inline.js +4 -0
  279. package/lib/modal/modal_box.js +21 -22
  280. package/lib/notification/index.d.ts +171 -0
  281. package/lib/notification/index.js +326 -0
  282. package/lib/notification/index.less_inline.js +4 -0
  283. package/lib/notification/notification_box.d.ts +40 -0
  284. package/lib/notification/notification_box.js +57 -0
  285. package/lib/notification/placement.d.ts +49 -0
  286. package/lib/notification/placement.js +48 -0
  287. package/lib/notification/style.d.ts +2 -0
  288. package/lib/notification/style.js +8 -0
  289. package/lib/page_header/index.js +100 -2
  290. package/lib/page_header/index.less_inline.js +4 -0
  291. package/lib/pagination/index.js +214 -2
  292. package/lib/pagination/index.less_inline.js +4 -0
  293. package/lib/polygon/index.js +21 -2
  294. package/lib/{polygon-DhhovlrG.js → polygon/index.less_inline.js} +2 -18
  295. package/lib/qrcode/index.js +65 -2
  296. package/lib/qrcode/index.less_inline.js +4 -0
  297. package/lib/select/index.js +355 -3
  298. package/lib/select/index.less_inline.js +4 -0
  299. package/lib/select_ori/index.js +58 -2
  300. package/lib/select_ori/index.less_inline.js +4 -0
  301. package/lib/space/index.js +40 -2
  302. package/lib/space/index.less_inline.js +4 -0
  303. package/lib/{animation-Bo4jbSGK.js → styles/animation/index.css_inline.js} +2 -3
  304. package/lib/styles/animation/index.js +8 -2
  305. package/lib/{mask-Ox6CoyFB.js → styles/mask/index.css_inline.js} +2 -3
  306. package/lib/styles/mask/index.js +8 -2
  307. package/lib/switch/index.js +51 -2
  308. package/lib/switch/index.less_inline.js +4 -0
  309. package/lib/tabbar/index.js +97 -2
  310. package/lib/tabbar/index.less_inline.js +4 -0
  311. package/lib/tabbar/item.js +61 -2
  312. package/lib/tabbar/item.less_inline.js +4 -0
  313. package/lib/table/index.js +234 -2
  314. package/lib/table/index.less_inline.js +4 -0
  315. package/lib/tabs/index.js +1 -1
  316. package/lib/tag/index.js +75 -2
  317. package/lib/tag/index.less_inline.js +4 -0
  318. package/lib/theme/index.js +86 -2
  319. package/lib/theme/index.less_inline.js +4 -0
  320. package/lib/theme/theme_color.js +1 -1
  321. package/lib/upload/index.d.ts +170 -0
  322. package/lib/upload/index.js +848 -0
  323. package/lib/upload/index.less_inline.js +4 -0
  324. package/lib/upload/style.d.ts +2 -0
  325. package/lib/upload/style.js +8 -0
  326. package/lib/utils/context_provide.d.ts +1 -0
  327. package/lib/utils/context_provide.js +1 -1
  328. package/lib/utils/event.d.ts +30 -0
  329. package/lib/utils/index.d.ts +3 -0
  330. package/lib/utils/index.js +1 -1
  331. package/lib/utils/popover.js +1 -1
  332. package/lib/utils/signal_types.d.ts +5 -0
  333. package/lib/utils/transition.d.ts +28 -0
  334. package/lib/utils/transition.js +1 -1
  335. package/package.json +39 -18
  336. package/styles/animation.css +2 -2
  337. package/styles/container.css +8 -8
  338. package/styles/dark.css +21 -1
  339. package/styles/datepicker.css +9 -9
  340. package/styles/dialog.css +7 -7
  341. package/styles/loading.css +17 -17
  342. package/styles/message.css +9 -9
  343. package/styles/modal_box.css +3 -3
  344. package/styles/notification.css +17 -0
  345. package/styles/popover.css +11 -14
  346. package/styles/reset.css +13 -15
  347. package/styles/scrollbar.css +5 -5
  348. package/styles/select.css +6 -6
  349. package/styles/tabs.css +3 -3
  350. package/styles/theme-coral.css +35 -0
  351. package/styles/theme-jade.css +35 -0
  352. package/styles/theme-tangerine.css +35 -0
  353. package/styles/transition.css +1 -1
  354. package/styles/vars.css +7 -7
  355. package/lib/calendar-CvlUsN6w.js +0 -146
  356. package/lib/card-3DM-lJQV.js +0 -63
  357. package/lib/carousel-DvkZ1YXq.js +0 -276
  358. package/lib/check-doQ2ZpQj.js +0 -117
  359. package/lib/collapse-B6-Rn05A.js +0 -102
  360. package/lib/color_picker-0a-IGZY9.js +0 -41
  361. package/lib/date_picker-BDN2PAz5.js +0 -99
  362. package/lib/date_picker_ori-BXFs1eET.js +0 -120
  363. package/lib/description_panel--AKXBzLL.js +0 -53
  364. package/lib/esm-DAha108i.js +0 -270
  365. package/lib/form-DJxvBiLy.js +0 -190
  366. package/lib/form_item-BqPMRABd.js +0 -147
  367. package/lib/image-CVQai6NX.js +0 -162
  368. package/lib/image_preview-DfQAKSJH.js +0 -90
  369. package/lib/item-CQ2Sknbz.js +0 -14
  370. package/lib/item-DI6mQXtB.js +0 -117
  371. package/lib/item-D_ZOPXuE.js +0 -60
  372. package/lib/list-MG8PRzos.js +0 -51
  373. package/lib/mask-Bx-yNIJv.js +0 -108
  374. package/lib/md_input-BX3bujz8.js +0 -58
  375. package/lib/menu-DKscK5mw.js +0 -274
  376. package/lib/modal-Cwi3qlEf.js +0 -198
  377. package/lib/page_header-ujV3pncE.js +0 -99
  378. package/lib/pagination-aRbGd3Rf.js +0 -213
  379. package/lib/qrcode-Dip8uLSA.js +0 -64
  380. package/lib/select-BZMDj5VE.js +0 -354
  381. package/lib/select_ori-C7sUZxen.js +0 -57
  382. package/lib/space-CKuTk0YB.js +0 -39
  383. package/lib/switch-wh2-ivty.js +0 -50
  384. package/lib/tabbar-CBXK-_AV.js +0 -96
  385. package/lib/table-BQxMD2Ae.js +0 -233
  386. package/lib/tag-Di1z9PoZ.js +0 -74
  387. package/lib/theme-CLbBS-in.js +0 -85
@@ -1,147 +0,0 @@
1
- import { kebabToCamel as e, parseAttrValue as t, stopSignal as n, unitNumberStr as r } from "./utils/index.js";
2
- import i from "./utils/context_provide.js";
3
- import { n as a, t as o } from "./esm-DAha108i.js";
4
- import { $$ as s, $one as c, addClass as l, removeClass as u } from "ph-utils/browser";
5
- //#region src/components/form/form_item.less?inline
6
- var d = ":host{display:var(--l-form-item-display,flex);font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);width:var(--l-form-label-width,auto);height:var(--l-form-label-height,var(--l-form-control-height,32px));line-height:var(--l-form-label-height,var(--l-form-control-height,32px));color:#606266;box-sizing:border-box;padding:0 10px 0 0;display:inline-block}.l-form-item__label:empty{display:var(--l-form-label-empty-display,inline-block)}:host(.is-required) .l-form-item__label:before{content:\"*\";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}:host(.l-form-item--left){--l-form-label-align:left}:host(.l-form-item--top){--l-form-item-display:grid;--l-form-label-align:left;--l-form-label-empty-display:none;grid-template-columns:1fr}", f = class extends i {
7
- static baseName = "form-item";
8
- formErrors;
9
- _errorSignalStop;
10
- constructor() {
11
- super(), this.version = 2, this.contextEventName = "form-item-context-request", this._state = {
12
- labelPosition: "right",
13
- required: !1
14
- }, this.context = a({ innerBlock: !1 });
15
- }
16
- static get observedAttributes() {
17
- return [
18
- "error",
19
- "label",
20
- "required",
21
- "inner-block",
22
- "prop",
23
- "label-position",
24
- "verify",
25
- "pattern",
26
- "validity",
27
- "label-width",
28
- "label-height"
29
- ];
30
- }
31
- attributeChanged(n, i, a) {
32
- switch (n) {
33
- case "error":
34
- case "label":
35
- case "verify":
36
- case "pattern":
37
- case "validity":
38
- this._state[n] = a;
39
- break;
40
- case "label-position":
41
- this._state.labelPosition = a;
42
- break;
43
- case "inner-block":
44
- let i = t(a, !1, n);
45
- this.context({ innerBlock: i });
46
- break;
47
- case "required":
48
- let o = t(a, !1, n);
49
- this._state.required = o;
50
- break;
51
- case "prop":
52
- this._state.prop = a, this.context({
53
- ...this.context(),
54
- prop: a
55
- });
56
- break;
57
- case "label-width":
58
- case "label-height": this._state[e(n)] = r(a);
59
- }
60
- }
61
- updateDOM(e) {
62
- e.has("required") && this._updateRequired(), e.has("label") && this._updateLabel(), e.has("error") && this._updateError(), e.has("label-width") && (this._state.labelWidth ? this.style.setProperty("--l-form-label-width", this._state.labelWidth) : this.style.removeProperty("--l-form-label-width")), e.has("label-height") && (this._state.labelHeight ? this.style.setProperty("--l-form-label-height", this._state.labelHeight) : this.style.removeProperty("--l-form-label-height"));
63
- }
64
- connectedCallback() {
65
- super.connectedCallback(), this._updateRequired(), this._parseSchema(), this.emitInject("form-context-request", ((e, t) => {
66
- this.formErrors = t;
67
- })), this._errorSignalStop = o(() => {
68
- let e = this.context().prop, t = this.formErrors ? this.formErrors() : null;
69
- e && t && (this._state.error = t[e], this._updateError());
70
- });
71
- }
72
- beforeDestroy() {
73
- this._errorSignalStop = n(this._errorSignalStop);
74
- }
75
- setRules(e) {
76
- let t = this._state.prop;
77
- if (t) {
78
- let n = {
79
- ...e,
80
- key: t
81
- };
82
- this._updateRules(n);
83
- }
84
- }
85
- render_v2() {
86
- return {
87
- template: this.render(),
88
- style: [d]
89
- };
90
- }
91
- render() {
92
- this.classList.add(`l-form-item--${this._state.labelPosition}`);
93
- let e = document.createDocumentFragment();
94
- this._state.label != null && e.appendChild(s("label", {
95
- class: "l-form-item__label",
96
- textContent: this._state.label
97
- }));
98
- let t = s("div", { class: "l-form-item__content" }), n = s("slot");
99
- return t.appendChild(n), this._state.error && t.appendChild(s("div", {
100
- class: "l-form-item__error",
101
- textContent: this._state.error
102
- })), e.appendChild(t), e;
103
- }
104
- _updateRequired() {
105
- this._state.required ? l(this, "is-required") : u(this, "is-required");
106
- }
107
- _parseSchema() {
108
- let e = this.context().prop;
109
- if (e) {
110
- let t = [], n = this._state.verify;
111
- n && (t = n.split("|"));
112
- let r = this._state.pattern;
113
- r && t.push(new RegExp(r));
114
- let i = {
115
- key: e,
116
- required: this._state.required,
117
- message: this._state.validity,
118
- rules: t
119
- };
120
- this._updateRules(i);
121
- }
122
- }
123
- _updateError() {
124
- if (this._state.error ? l(this, "is-error") : u(this, "is-error"), !this.rendered) return;
125
- let e = c(".l-form-item__error", this.root);
126
- if (e) this._state.error ? e.textContent = this._state.error : e.remove();
127
- else if (this._state.error) {
128
- e = document.createElement("div"), e.className = "l-form-item__error", e.textContent = this._state.error;
129
- let t = c(".l-form-item__content", this.root);
130
- t && t.appendChild(e);
131
- }
132
- }
133
- _updateLabel() {
134
- if (!this.rendered) return;
135
- let e = c(".l-form-item__label", this.root);
136
- e == null ? this._state.label != null && (e = document.createElement("div"), e.className = "l-form-item__label", e.textContent = this._state.label, this.root.prepend(e)) : this._state.label == null ? e.remove() : e.textContent = this._state.label;
137
- }
138
- _updateRules(e) {
139
- this.emit("form-rule-change", {
140
- bubbles: !0,
141
- composed: !0,
142
- detail: e
143
- });
144
- }
145
- };
146
- //#endregion
147
- export { f as t };
@@ -1,162 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n } from "./utils/index.js";
3
- import { $$ as r, $one as i, addClass as a, formatClass as o, off as s, on as c, removeClass as l, shouldEventNext as u } from "ph-utils/browser";
4
- //#region src/components/image/index.less?inline
5
- var d = ":host{vertical-align:middle;box-sizing:border-box;width:auto;height:auto;display:inline-flex}.l-image-inner{vertical-align:middle;object-fit:var(--l-image-fit,fill);width:100%;height:100%}.l-image-inner--preview{cursor:pointer}.l-image-hide{display:none}.l-image-fallback{background-color:#0000001a;justify-content:center;align-items:center;width:100%;height:100%;display:inline-flex}", f = class extends e {
6
- static baseName = "image";
7
- alt;
8
- _src = "";
9
- _loading = "eager";
10
- fit;
11
- width;
12
- height;
13
- fallback;
14
- customFallback = !1;
15
- isError = !1;
16
- previewDisabled = !1;
17
- _previewEl;
18
- _previewImageList;
19
- _previewIndex = 0;
20
- _placeholder;
21
- _imageInner;
22
- get src() {
23
- return this._src;
24
- }
25
- set src(e) {
26
- this._src = e, this._loadActualImage();
27
- }
28
- get loading() {
29
- return this._loading;
30
- }
31
- set loading(e) {
32
- this._loading = e;
33
- }
34
- get placeholder() {
35
- return this._placeholder;
36
- }
37
- set placeholder(e) {
38
- this._placeholder = e;
39
- }
40
- get previewImageList() {
41
- return this._previewImageList;
42
- }
43
- set previewImageList(e) {
44
- this.setPreviewImageList(e);
45
- }
46
- get previewIndex() {
47
- return this._previewIndex;
48
- }
49
- set previewIndex(e) {
50
- this.setPreviewIndex(e);
51
- }
52
- setPreviewImageList(e) {
53
- this._previewImageList = e;
54
- }
55
- setPreviewIndex(e) {
56
- this._previewIndex = e;
57
- }
58
- connectedCallback() {
59
- this.loadStyleText(d), super.connectedCallback();
60
- }
61
- static get observedAttributes() {
62
- return [
63
- "src",
64
- "loading",
65
- "fit",
66
- "width",
67
- "height",
68
- "placeholder",
69
- "preview-disabled",
70
- "preview-image-list",
71
- "preview-index",
72
- "fallback",
73
- "custom-fallback"
74
- ];
75
- }
76
- attributeChangedCallback(e, r, i) {
77
- e = t(e);
78
- let a = n(i, this[e], e);
79
- switch (a !== this[e] && (e === "previewImageList" ? this.setPreviewImageList(a ? a.split(",") : void 0) : this[e] = a), e) {
80
- case "width":
81
- case "height": this.rendered && this._updateSize();
82
- }
83
- }
84
- render() {
85
- let e = this.alt || this.getAttribute("alt"), t = this.placeholder || this.src;
86
- return r("img", {
87
- class: o(["l-image-inner", this.previewDisabled ? void 0 : "l-image-inner--preview"]),
88
- alt: e,
89
- loading: this.loading,
90
- src: t,
91
- part: "inner",
92
- "l-action": "inner"
93
- });
94
- }
95
- _updateSize() {
96
- this.width ? this.style.setProperty("width", this.width) : this.style.removeProperty("width"), this.height ? this.style.setProperty("height", this.height) : this.style.removeProperty("height");
97
- }
98
- afterInit() {
99
- this.fit && this.fit !== "fill" && this.style.setProperty("--l-image-fit", this.fit), this._updateSize(), this._imageInner = i(".l-image-inner", this.root), c(this._imageInner, "click", this._onTap), c(this._imageInner, "error", this._onError), c(this._imageInner, "load", this._onLoad), this._loadActualImage();
100
- }
101
- beforeDestroy() {
102
- this._imageInner && (s(this._imageInner, "click", this._onTap), s(this._imageInner, "error", this._onError), s(this._imageInner, "load", this._onLoad));
103
- }
104
- setIsError(e = !1) {
105
- if (this.isError !== e) {
106
- if (this.isError = e, e) {
107
- if (!this.customFallback) {
108
- this.fallback && this._imageInner && (this._imageInner.src = this.fallback);
109
- return;
110
- }
111
- this._imageInner && a(this._imageInner, "l-image-hide");
112
- let e = i(".l-image-fallback", this.root);
113
- this.fallback || (e = r("div", {
114
- class: "l-image-fallback",
115
- part: "fallback",
116
- innerHTML: "<slot name='fallback'></slot>"
117
- }), this.root.appendChild(e));
118
- } else {
119
- this._imageInner && l(this._imageInner, "l-image-hide");
120
- let e = i(".l-image-fallback", this.root);
121
- e && e.remove();
122
- }
123
- }
124
- }
125
- openPreview() {
126
- if (!this._previewEl) {
127
- let e = r("l-image-preview");
128
- e.setImages(this.previewImageList || [this.src]), e.setCurrentIndex(this.previewIndex || 0), e.setAttribute("open", "on"), this._previewEl = e, document.body.appendChild(e), c(this._previewEl, "closed", this._onPreviewClosed);
129
- }
130
- }
131
- closePreview() {
132
- this._previewEl &&= (s(this._previewEl, "closed", this._onPreviewClosed), this._previewEl.remove(), void 0);
133
- }
134
- _onError = () => {
135
- this.setIsError(!0);
136
- };
137
- _onLoad = () => {
138
- this.setIsError(!1);
139
- };
140
- _onPreviewClosed = () => {
141
- this.closePreview();
142
- };
143
- _onTap = (e) => {
144
- let [t, n] = u(e, "l-action", this.root);
145
- t && n === "inner" && !this.previewDisabled && !this.isError && this.openPreview();
146
- };
147
- _clearTmpImg(e) {
148
- e &&= (e.onload = null, e.onerror = null, void 0);
149
- }
150
- _loadActualImage() {
151
- if (this.placeholder && this.rendered) {
152
- let e = new Image();
153
- e.src = this.src, e.onload = () => {
154
- this._imageInner && (this._imageInner.src = this.src), this._clearTmpImg(e);
155
- }, e.onerror = () => {
156
- this.setIsError(!0), this._clearTmpImg(e);
157
- };
158
- }
159
- }
160
- };
161
- //#endregion
162
- export { f as t };
@@ -1,90 +0,0 @@
1
- import { t as e } from "./mask-Bx-yNIJv.js";
2
- import { $$ as t, $one as n, off as r, on as i } from "ph-utils/browser";
3
- //#region src/components/image/image_preview.less?inline
4
- var a = ".l-image-preview--container{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:relative}.l-image-preview__btn,.l-image-preview-operations{background-color:#606666;justify-content:center;align-items:center;display:flex}.l-image-preview__btn{z-index:1;opacity:.8;cursor:pointer;color:#fff;background-color:#606666;border:none;border-radius:50%;outline:none;justify-content:center;align-items:center;width:40px;height:40px;font-size:20px;transition:color .3s ease-in-out;display:flex;position:absolute}.l-image-preview__btn:hover{color:var(--l-primary-color,#4998f6)}.l-image-preview__close{top:30px;right:30px}.l-image-preview__prev,.l-image-preview__next{top:50%;transform:translateY(-50%)}.l-image-preview__prev{left:30px}.l-image-preview__next{right:30px}.l-image-preview-footer{z-index:1;flex-direction:column;align-items:center;display:flex;position:absolute;bottom:30px;left:50%;transform:translate(-50%)}.l-image-preview-progress{color:#fff;margin-bottom:10px}.l-image-preview-operations{cursor:default;border-radius:20px;padding:0 25px}.l-image-preview-operations .l-image-preview__btn{width:40px;position:static}.l-image-preview-img{vertical-align:middle;transform-origin:50%;user-select:none;z-index:0;max-width:calc(100vw - 40px);max-height:calc(100vh - 200px);transition:transform .25s}", o = class extends e {
5
- static baseName = "image-preview";
6
- urlList = [];
7
- currentIndex = 0;
8
- _scale = 1;
9
- _rotate = 0;
10
- setImages(e) {
11
- this.urlList = e;
12
- }
13
- setCurrentIndex(e) {
14
- this.currentIndex = e;
15
- }
16
- static customAttributes = ["current-index"];
17
- connectedCallback() {
18
- this.loadStyleText(a), super.connectedCallback();
19
- }
20
- contentRender() {
21
- let e = [this._generateBtnString("close", "close")];
22
- this.urlList.length > 1 && (e.push(this._generateBtnString("prev", "arrow-left")), e.push(this._generateBtnString("next", "arrow-right"))), e.push("<div class=\"l-image-preview-footer\">"), e.push(`<div class="l-image-preview-progress">${this._getProgress()}</div>`), e.push("<div data-action=\"operations\" class=\"l-image-preview-operations\">"), e.push(this._generateBtnString("zoom-in", "zoom-in")), e.push(this._generateBtnString("zoom-out", "zoom-out")), e.push(this._generateBtnString("reduction", "reduction")), e.push(this._generateBtnString("refresh-left", "refresh-left")), e.push(this._generateBtnString("refresh-right", "refresh-right")), e.push("</div></div>");
23
- let n = this.urlList[this.currentIndex], r = this._getTransformStyleValue();
24
- return e.push(`<img src="${n}" data-action="previewer" class="l-image-preview-img" style="transform: ${r};" />`), t("div", {
25
- class: "l-image-preview--container",
26
- innerHTML: e.join("")
27
- });
28
- }
29
- _generateBtnString(e, t) {
30
- return `<button aria-label="${e}" data-action="${e}" class="l-image-preview__btn l-image-preview__${e}"><l-${t}-icon></l-${t}-icon></button>`;
31
- }
32
- _getProgress() {
33
- return `${this.currentIndex + 1}&nbsp;/&nbsp;${this.urlList.length}`;
34
- }
35
- _getTransformStyleValue() {
36
- return `scale3d(${this._scale}, ${this._scale}, 1) rotate3d(0, 0, 1, ${this._rotate}deg)`;
37
- }
38
- _updateImgAttr() {
39
- let e = n(".l-image-preview-img", this.root);
40
- e && (e.src = this.urlList[this.currentIndex], e.style.transform = this._getTransformStyleValue());
41
- }
42
- _updateProgress() {
43
- let e = n(".l-image-preview-progress", this.root);
44
- e && (e.innerHTML = this._getProgress());
45
- }
46
- _resetTransform() {
47
- this._scale = 1, this._rotate = 0, this._updateImgAttr();
48
- }
49
- onAction(e) {
50
- switch (e) {
51
- case "close":
52
- this.open = !1;
53
- break;
54
- case "prev":
55
- this.currentIndex === 0 ? this.currentIndex = this.urlList.length - 1 : this.currentIndex--, this._resetTransform(), this._updateProgress();
56
- break;
57
- case "next":
58
- this.currentIndex === this.urlList.length - 1 ? this.currentIndex = 0 : this.currentIndex++, this._resetTransform(), this._updateProgress();
59
- break;
60
- case "zoom-in":
61
- this._transformScale("in");
62
- break;
63
- case "zoom-out":
64
- this._transformScale("out");
65
- break;
66
- case "reduction":
67
- this._resetTransform();
68
- break;
69
- case "refresh-left":
70
- this._rotate -= 90, this._updateImgAttr();
71
- break;
72
- case "refresh-right": this._rotate += 90, this._updateImgAttr();
73
- }
74
- return !0;
75
- }
76
- _handleWhell = (e) => {
77
- e.deltaY > 0 ? this._transformScale("out") : this._transformScale("in");
78
- };
79
- afterOpened() {
80
- i(document, "wheel", this._handleWhell, { passive: !0 });
81
- }
82
- _transformScale(e) {
83
- e === "in" ? this._scale < 3 && (this._scale += .25) : this._scale > .25 && (this._scale -= .25), this._updateImgAttr();
84
- }
85
- afterClosed() {
86
- r(document, "wheel", this._handleWhell);
87
- }
88
- };
89
- //#endregion
90
- export { o as t };
@@ -1,14 +0,0 @@
1
- import e from "./base.js";
2
- import { $$ as t } from "ph-utils/browser";
3
- //#region src/components/carousel/item.less?inline
4
- var n = ":host{width:var(--carousel-width,100%);box-sizing:border-box;height:100%;display:block}:host(.active){display:block}", r = class extends e {
5
- static baseName = "carousel-item";
6
- connectedCallback() {
7
- this.loadStyleText(n), super.connectedCallback();
8
- }
9
- render() {
10
- return t("slot");
11
- }
12
- };
13
- //#endregion
14
- export { r as t };
@@ -1,117 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n, stopSignal as r } from "./utils/index.js";
3
- import { t as i } from "./esm-DAha108i.js";
4
- import { $$ as a, $one as o, off as s, on as c, queryHideNodeSize as l } from "ph-utils/browser";
5
- //#region src/components/collapse/item.less?inline
6
- var u = ":host{box-sizing:border-box;border-bottom:1px solid var(--l-collapse-border-color);color:#333;font-size:14px;display:block}.l-collapse-item__header{cursor:pointer;justify-content:flex-start;align-items:center;gap:5px;padding:10px 0;display:flex}.l-collapse-item__header.arrow-right{flex-direction:row-reverse;justify-content:flex-end}.l-collapse-item__header.space-between{justify-content:space-between}.l-collapse-arrow-icon{transition:transform .3s;transform:rotate(0)}.l-collapse-content{box-sizing:border-box;transition:height .3s;overflow-y:hidden}.l-collapse-content-box{padding-bottom:15px}:host(.l-collapse-expand) .l-collapse-arrow-icon{transform:rotate(90deg)}:host(.background){border-left:1px solid var(--l-collapse-border-color);border-right:1px solid var(--l-collapse-border-color);background-color:#00000005}:host(.background:first-child),:host(.background.space){border-top:1px solid var(--l-collapse-border-color)}:host(.background) .l-collapse-item__header{padding:10px 15px}:host(.background) .l-collapse-content{border-top:1px solid var(--l-collapse-border-color);background:#fff}:host(.background) .l-collapse-content-box{padding:15px}:host(:first-child){border-top-left-radius:var(--l-collapse-border-radius,0px);border-top-right-radius:var(--l-collapse-border-radius,0px)}:host(:last-child){border-bottom-left-radius:var(--l-collapse-border-radius,0px);border-bottom-right-radius:var(--l-collapse-border-radius,0px)}:host(.space){border-radius:var(--l-collapse-border-radius,0px)}", d = class extends e {
7
- static baseName = "collapse-item";
8
- $header;
9
- context;
10
- _ctxStop;
11
- _expandStop;
12
- expands;
13
- constructor() {
14
- super(), this.version = 2, this._state = {
15
- prop: "",
16
- headerText: "",
17
- expand: !1
18
- };
19
- }
20
- updateDOM(e) {
21
- e.has("expand") && (this._setStyleAndClass(), this._handleExpand());
22
- }
23
- _setStyleAndClass() {
24
- this._state.expand ? this.classList.add("l-collapse-expand") : this.classList.remove("l-collapse-expand");
25
- }
26
- static get observedAttributes() {
27
- return [
28
- "prop",
29
- "header-text",
30
- "expand"
31
- ];
32
- }
33
- attributeChanged(e, r, i) {
34
- switch (e) {
35
- case "prop":
36
- case "header-text":
37
- this._state[t(e)] = i;
38
- break;
39
- case "expand":
40
- let r = n(i, !1, "expand");
41
- r !== this._state.expand && (this._state.expand = r);
42
- }
43
- }
44
- render_v2() {
45
- this._state.expand && this._emitChange();
46
- let e = document.createDocumentFragment(), t = a("div", {
47
- class: "l-collapse-item__header",
48
- part: "header"
49
- }), n = a("l-arrow-right-icon", { class: "l-collapse-arrow-icon" });
50
- if (t.appendChild(n), this._state.headerText) {
51
- let e = a("span", {
52
- part: "header-text",
53
- textContent: `${this._state.headerText}`
54
- });
55
- t.appendChild(e);
56
- } else t.appendChild(a("slot", { name: "header-text" }));
57
- return e.appendChild(t), this._state.expand && e.appendChild(this._createContentElement(!1)), {
58
- template: e,
59
- style: u
60
- };
61
- }
62
- afterInit() {
63
- this._setStyleAndClass(), this.$header = o(".l-collapse-item__header", this.root), this.emitInject("collapse-context-request", this.contextInject), this._ctxStop = i(this._updateLayout), this._expandStop = i(this._handleExpandsChange), this.$header && c(this.$header, "click", this._handleHeaderTap);
64
- }
65
- beforeDestroy() {
66
- this._ctxStop = r(this._ctxStop), this._expandStop = r(this._expandStop), this.$header && s(this.$header, "click", this._handleHeaderTap), this.$header = void 0;
67
- }
68
- _handleExpandsChange = () => {
69
- this.expands && this.expands().includes(this._state.prop) !== this._state.expand && this._handleHeaderTap();
70
- };
71
- _handleHeaderTap = () => {
72
- this._state.expand = !this._state.expand, this._setStyleAndClass(), this._handleExpand();
73
- };
74
- _updateLayout = () => {
75
- if (!this.context) return;
76
- let e = this.context();
77
- this.$header && (e.arrowPlacement === "right" ? this.$header.classList.add("arrow-right") : this.$header.classList.remove("arrow-right"), e.headerJustify === "space-between" ? this.$header.classList.add("space-between") : this.$header.classList.remove("space-between")), e.background ? this.classList.add("background") : this.classList.remove("background"), e.gap ? this.classList.add("space") : this.classList.remove("space");
78
- };
79
- contextInject = (e, t) => {
80
- this.context = e, this.expands = t;
81
- };
82
- _handleExpand() {
83
- if (!this.rendered) return;
84
- let e = o(".l-collapse-content", this.root), t = 0;
85
- if (this._state.expand) {
86
- this.classList.add("l-collapse-expand"), e || (e = this._createContentElement(!0), this.root.appendChild(e));
87
- let n = l(e, null);
88
- e.style.height = `${n.height}px`, e.style.display = "block", t = n.height;
89
- } else this.classList.remove("l-collapse-expand"), e && (t = e.getBoundingClientRect().height);
90
- if (e) {
91
- let n = [{ height: "0px" }, { height: `${t}px` }];
92
- this._state.expand || n.reverse();
93
- let r = e.animate(n, { duration: 150 });
94
- r.onfinish = () => {
95
- this._state.expand || (e.style.display = "none"), r.onfinish = null, r = null;
96
- };
97
- }
98
- this._emitChange();
99
- }
100
- _emitChange = () => {
101
- this.emit("expand-change", { detail: {
102
- prop: this._state.prop,
103
- expand: this._state.expand
104
- } });
105
- };
106
- _createContentElement(e = !0) {
107
- return a("div", {
108
- class: "l-collapse-content",
109
- style: e ? "display: none;" : ""
110
- }, [a("div", {
111
- class: "l-collapse-content-box",
112
- innerHTML: "<slot></slot>"
113
- })]);
114
- }
115
- };
116
- //#endregion
117
- export { d as t };
@@ -1,60 +0,0 @@
1
- import e from "./base.js";
2
- import { parseAttrValue as t } from "./utils/index.js";
3
- import { $$ as n, $one as r, addClass as i, removeClass as a } from "ph-utils/browser";
4
- //#region src/components/tabbar/item.less?inline
5
- var o = ":host{color:#666;cursor:pointer;flex-direction:column;flex-grow:var(--l-tabbar-item-grow,0);box-sizing:border-box;justify-content:center;align-items:center;line-height:1;transition:all .3s ease-in-out;display:inline-flex}:host(:hover){color:var(--l-tabbar-hover-color)}:host(.active){color:var(--l-tabbar-active-color)}.icon-wrapper{justify-content:center;align-items:center;margin-bottom:3px;font-size:18px;display:flex}.icon-wrapper.only{margin-bottom:0;font-size:24px}:host(.l-item--card){background:#f5f7fa;border:1px solid #f0f0f0;padding:0 15px}:host(.l-item--card:first-child){border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card:last-child){border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card.active){background:#fff}:host(.l-item--gap){border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}", s = class extends e {
6
- static baseName = "tabbar-item";
7
- name;
8
- icon;
9
- onlyIcon;
10
- static get observedAttributes() {
11
- return [
12
- "name",
13
- "label",
14
- "icon",
15
- "only-icon"
16
- ];
17
- }
18
- connectedCallback() {
19
- this.loadStyleText(o);
20
- let e = this.parentElement;
21
- e.gap && i(this, "l-item--gap"), e.type === "card" && i(this, "l-item--card"), super.connectedCallback();
22
- }
23
- attributeChangedCallback(e, n, r) {
24
- if (e === "icon" || e === "only-icon") {
25
- let n = t(r, !1, "icon");
26
- this[e] = n, this.#e();
27
- } else this[e] = r;
28
- }
29
- #e() {
30
- if (!this.rendered) return;
31
- let e = r(".icon-wrapper", this.root);
32
- this.icon ? e ? this.onlyIcon ? i(e, "only") : a(e, "only") : (e = n("div", {
33
- class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
34
- innerHTML: "<slot name='icon'></slot>"
35
- }), this.root.prepend(e)) : e && e.remove();
36
- let t = r("slot:not([name])", this.root);
37
- if (this.onlyIcon) t && t.remove();
38
- else if (!t) {
39
- let e = n("slot");
40
- this.root.appendChild(e);
41
- }
42
- }
43
- render() {
44
- let e = document.createDocumentFragment();
45
- if (this.icon) {
46
- let t = n("div", {
47
- class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
48
- innerHTML: "<slot name='icon'></slot>"
49
- });
50
- e.appendChild(t);
51
- }
52
- if (!this.onlyIcon) {
53
- let t = n("slot");
54
- e.appendChild(t);
55
- }
56
- return e;
57
- }
58
- };
59
- //#endregion
60
- export { s as t };
@@ -1,51 +0,0 @@
1
- import e from "./base.js";
2
- import { parseAttrValue as t } from "./utils/index.js";
3
- import { t as n } from "./animation-Bo4jbSGK.js";
4
- import { $one as r } from "ph-utils/browser";
5
- //#region src/components/list/index.less?inline
6
- var i = ":host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}", a = class extends e {
7
- static baseName = "list";
8
- finish = !1;
9
- infinite = !0;
10
- observer;
11
- $more;
12
- _page = 0;
13
- static get observedAttributes() {
14
- return ["finish", "infinite"];
15
- }
16
- attributeChangedCallback(e, n, r) {
17
- if (e === "finish") {
18
- let n = t(r, !1, e);
19
- this.finish !== n && (this.finish = n, this._finishChange());
20
- } else if (e === "infinite") {
21
- let n = t(r, !0, e);
22
- this.infinite !== n && (this.infinite = n);
23
- }
24
- }
25
- connectedCallback() {
26
- this.loadStyleText([i]), this.root.adoptedStyleSheets = [n], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
27
- e[0].isIntersecting && !this.finish && (this._page++, this.setAttribute("loading", ""), this.emit("load", { detail: { page: this._page } }));
28
- }), this.$more = r(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
29
- }
30
- disconnectedCallback() {
31
- super.disconnectedCallback(), this.observer &&= (this.$more &&= (this.observer.unobserve(this.$more), void 0), this.observer.disconnect(), void 0);
32
- }
33
- render() {
34
- let e = ["<slot></slot>"];
35
- return this.infinite && (e.push("<div class=\"l-list-loadmore\">"), this.finish || e.push("<l-loading-icon class=\"l-list-icon l-rotate-anim\"></l-loading-icon>"), e.push(`<span class="l-list-loadmore-text">${this._loadingText()}</span></div>`)), e.join("");
36
- }
37
- _loadingText() {
38
- return this.finish ? "已经到底啦!" : "加载中……";
39
- }
40
- _finishChange() {
41
- if (this.$more) {
42
- this.observer && (this.finish ? this.observer.unobserve(this.$more) : this.observer.observe(this.$more));
43
- let e = r(".l-list-loadmore-text", this.$more);
44
- e && (e.textContent = this._loadingText());
45
- let t = r(".l-list-icon", this.$more);
46
- this.finish ? t && t.remove() : t ?? (t = document.createElement("l-loading-icon"), t.className = "l-list-icon l-rotate-anim", this.$more.prepend(t));
47
- }
48
- }
49
- };
50
- //#endregion
51
- export { a as t };