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,2 +1,97 @@
1
- import { t as e } from "../tabbar-CBXK-_AV.js";
2
- export { e as default };
1
+ import e from "../base.js";
2
+ import { parseAttrValue as t } from "../utils/index.js";
3
+ import n from "./index.less_inline.js";
4
+ import { $$ as r, $one as i, addClass as a, create as o, isVisible as s, off as c, on as l, removeClass as u, shouldEventNext as d } from "utilane/browser";
5
+ import { isBlank as f, isNumeric as p } from "utilane";
6
+ //#region src/components/tabbar/index.ts
7
+ var m = class extends e {
8
+ static baseName = "tabbar";
9
+ type = "nav";
10
+ _name = "";
11
+ gap;
12
+ $line;
13
+ get name() {
14
+ return this._name;
15
+ }
16
+ set name(e) {
17
+ this._name = e;
18
+ }
19
+ connectedCallback() {
20
+ this.loadStyleText(n), a(this, `l-tabbar--${this.type}`), this.#e(), super.connectedCallback();
21
+ }
22
+ static get observedAttributes() {
23
+ return [
24
+ "name",
25
+ "type",
26
+ "justify-content",
27
+ "gap"
28
+ ];
29
+ }
30
+ attributeChangedCallback(e, n, r) {
31
+ if (e === "name") {
32
+ let e = t(r, void 0);
33
+ this.name = e, this._updateActive(), this._updateLine();
34
+ } else if (e === "type") {
35
+ let e = t(r, "nav");
36
+ if (e !== this.type && (u(this, `l-tabbar--${this.type}`), this.type = e, u(this, `l-tabbar--${e}`), e === "card")) {
37
+ let e = i(".l-tabbar-card-border", this.root);
38
+ e || (e = o("div", { class: "l-tabbar-card-border" }), this.root.appendChild(e));
39
+ }
40
+ } else {
41
+ let n = t(r, void 0);
42
+ this[e] = n, this.#e();
43
+ }
44
+ }
45
+ render() {
46
+ let e = document.createDocumentFragment();
47
+ if (e.appendChild(r("slot")), this.type === "card") {
48
+ let t = o("div", { class: "l-tabbar-card-border" });
49
+ e.appendChild(t);
50
+ }
51
+ return e;
52
+ }
53
+ afterInit() {
54
+ l(this.root, "click", this._handleClick), setTimeout(() => {
55
+ this._updateLine();
56
+ }, 300);
57
+ }
58
+ beforeDestroy() {
59
+ c(this.root, "click", this._handleClick), this.$line = void 0;
60
+ }
61
+ _handleClick = (e) => {
62
+ let [t, n] = d(e, "name", this);
63
+ t && n !== this.name && (this.name = n, this.dispatchEvent(new CustomEvent("change", { detail: { name: n } })), this._updateActive(), this._updateLine());
64
+ };
65
+ _updateActive() {
66
+ let e = i(".active", this);
67
+ e && u(e, "active");
68
+ let t = i(`[name="${this.name}"]`, this);
69
+ t && a(t, "active");
70
+ }
71
+ _updateLine() {
72
+ queueMicrotask(() => {
73
+ if (!this.name || this.type === "nav" || !this.rendered) return;
74
+ let e = i(".active", this);
75
+ if (!e) return;
76
+ let t = e.offsetLeft;
77
+ if (!this.$line) {
78
+ let e = o("div", { class: "l-tabbar--bar-line" });
79
+ e.part = "line", this.root.appendChild(e), this.$line = i(".l-tabbar--bar-line", this.root);
80
+ }
81
+ this.$line.style.cssText = `width:${e.offsetWidth}px;left:${t}px`, s(e, this) || this.scrollTo({
82
+ left: t,
83
+ behavior: "smooth"
84
+ });
85
+ });
86
+ }
87
+ #e() {
88
+ let e = this.getAttr("justify-content");
89
+ if (f(e) ? this.style.removeProperty("justify-content") : this.style.setProperty("justify-content", e), f(this.gap)) this.style.removeProperty("--l-tabbar-item-gap"), u(this, "l-tabbar-gap");
90
+ else {
91
+ let e = this.gap;
92
+ p(e, { isPositive: !0 }) && (e = `${e}px`), a(this, "l-tabbar-gap"), this.style.setProperty("--l-tabbar-item-gap", e);
93
+ }
94
+ }
95
+ };
96
+ //#endregion
97
+ export { m as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/tabbar/index.less?inline
2
+ var e = ":host{--l-tabbar-hover-color:var(--l-primary-color-light1,#9254de);--l-tabbar-active-color:var(--l-primary-color,#722ed1);--l-tabbar-item-gap:0;--l-tabbar-height:38px;height:var(--l-tabbar-height);align-items:stretch;gap:var(--l-tabbar-item-gap);box-sizing:border-box;background-color:#fff;flex-wrap:nowrap;display:flex;position:relative;overflow:hidden}:host(.l-tabbar--nav){--l-tabbar-height:50px;--l-tabbar-item-grow:1;width:100%}:host(.l-tabbar--bar){--l-tabbar-bar-vertical-padding:10px;--l-tabbar-item-gap:30px;--l-tabbar-line-color:var(--l-primary-color,#722ed1);white-space:nowrap;overflow:auto}.l-tabbar--bar-line{background-color:var(--l-tabbar-line-color);border-radius:1px;width:32px;height:2px;transition:all .3s ease-in-out;position:absolute;bottom:0;left:0}:host(.l-tabbar--card){--l-tabbar-card-border-color:#f5f7fa;--l-tabbar-line-color:#fff;--l-tabbar-item-gap:0;--l-tabbar-card-border-radius:5px}.l-tabbar-card-border{background-color:var(--l-tabbar-card-border-color);height:1px;position:absolute;bottom:0;left:0;right:0}";
3
+ //#endregion
4
+ export { e as default };
@@ -1,2 +1,61 @@
1
- import { t as e } from "../item-D_ZOPXuE.js";
2
- export { e as default };
1
+ import e from "../base.js";
2
+ import { parseAttrValue as t } from "../utils/index.js";
3
+ import n from "./item.less_inline.js";
4
+ import { $$ as r, $one as i, addClass as a, removeClass as o } from "utilane/browser";
5
+ //#region src/components/tabbar/item.ts
6
+ var s = class extends e {
7
+ static baseName = "tabbar-item";
8
+ name;
9
+ icon;
10
+ onlyIcon;
11
+ static get observedAttributes() {
12
+ return [
13
+ "name",
14
+ "label",
15
+ "icon",
16
+ "only-icon"
17
+ ];
18
+ }
19
+ connectedCallback() {
20
+ this.loadStyleText(n);
21
+ let e = this.parentElement;
22
+ e.gap && a(this, "l-item--gap"), e.type === "card" && a(this, "l-item--card"), super.connectedCallback();
23
+ }
24
+ attributeChangedCallback(e, n, r) {
25
+ if (e === "icon" || e === "only-icon") {
26
+ let n = t(r, !1, "icon");
27
+ this[e] = n, this.#e();
28
+ } else this[e] = r;
29
+ }
30
+ #e() {
31
+ if (!this.rendered) return;
32
+ let e = i(".icon-wrapper", this.root);
33
+ this.icon ? e ? this.onlyIcon ? a(e, "only") : o(e, "only") : (e = r("div", {
34
+ class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
35
+ innerHTML: "<slot name='icon'></slot>"
36
+ }), this.root.prepend(e)) : e && e.remove();
37
+ let t = i("slot:not([name])", this.root);
38
+ if (this.onlyIcon) t && t.remove();
39
+ else if (!t) {
40
+ let e = r("slot");
41
+ this.root.appendChild(e);
42
+ }
43
+ }
44
+ render() {
45
+ let e = document.createDocumentFragment();
46
+ if (this.icon) {
47
+ let t = r("div", {
48
+ class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
49
+ innerHTML: "<slot name='icon'></slot>"
50
+ });
51
+ e.appendChild(t);
52
+ }
53
+ if (!this.onlyIcon) {
54
+ let t = r("slot");
55
+ e.appendChild(t);
56
+ }
57
+ return e;
58
+ }
59
+ };
60
+ //#endregion
61
+ export { s as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/tabbar/item.less?inline
2
+ var e = ":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)}";
3
+ //#endregion
4
+ export { e as default };
@@ -1,2 +1,234 @@
1
- import { t as e } from "../table-BQxMD2Ae.js";
2
- export { e as default };
1
+ import e from "../base.js";
2
+ import { kebabToCamel as t, parseAttrValue as n } from "../utils/index.js";
3
+ import r from "./index.less_inline.js";
4
+ import { $$ as i, $one as a, formatStyle as o, iterate as s, off as c, on as l, shouldEventNext as u } from "utilane/browser";
5
+ import { random as d } from "utilane";
6
+ //#region src/components/table/index.ts
7
+ var f = class extends e {
8
+ static baseName = "table";
9
+ constructor() {
10
+ super(), this._state = {
11
+ stripe: !0,
12
+ border: !1,
13
+ fixedHead: !1,
14
+ fixedColumn: !1
15
+ };
16
+ }
17
+ columns = [];
18
+ data = [];
19
+ sortInfo;
20
+ _globalColStyles;
21
+ connectedCallback() {
22
+ this.loadStyleText(r), super.connectedCallback();
23
+ }
24
+ setColumns(e) {
25
+ this.columns = this._parseColumns(e, 0, 0), this.rerender("all");
26
+ }
27
+ setData(e, t) {
28
+ this.data = e, this.sortInfo = t, this.columns && this.columns.length > 0 && this.rerender(t ? "all" : "body");
29
+ }
30
+ changeFixed(e) {
31
+ let t = {
32
+ fixedHead: this._state.fixedHead,
33
+ fixedColumn: this._state.fixedColumn,
34
+ ...e
35
+ };
36
+ if (this._state.fixedHead = t.fixedHead, this._state.fixedColumn = t.fixedColumn, this.rendered) {
37
+ let e = a(".l-table", this.root);
38
+ e && (this._state.fixedHead || this._state.fixedColumn ? e.classList.add("l-table-fixed") : e.classList.remove("l-table-fixed"));
39
+ }
40
+ }
41
+ static get observedAttributes() {
42
+ return [
43
+ "stripe",
44
+ "border",
45
+ "fixed-head",
46
+ "max-height",
47
+ "table-layout"
48
+ ];
49
+ }
50
+ attributeChanged(e, r, i) {
51
+ let a = t(e);
52
+ switch (a) {
53
+ case "stripe":
54
+ case "border":
55
+ case "fixedHead":
56
+ case "fixedColumn":
57
+ this._state[a] = n(i, !1, e);
58
+ break;
59
+ case "maxHeight":
60
+ this._state.maxHeight = i || void 0;
61
+ break;
62
+ case "tableLayout": this._state.tableLayout = i || void 0;
63
+ }
64
+ }
65
+ updateDOM(e) {
66
+ e.has("stripe") && this._classAttrChannge("stripe", this._state.stripe), e.has("border") && this._classAttrChannge("border", this._state.border), e.has("fixedHead") && (this._updateFixedHead(), this.changeFixed()), e.has("maxHeight") && this._changeMaxHeight(), e.has("tableLayout") && this._changeCssVar("layout", this._state.tableLayout);
67
+ }
68
+ render() {
69
+ let e = i("table", { class: [
70
+ "l-table",
71
+ this._state.stripe ? "l-table-stripe" : "",
72
+ this._state.border ? "l-table-border" : "",
73
+ this._state.fixedHead || this._state.fixedColumn ? "l-table-fixed" : ""
74
+ ] });
75
+ return e.appendChild(this._headRender()), e.appendChild(this._bodyRender()), e;
76
+ }
77
+ rerender(e) {
78
+ if (this.rendered) {
79
+ if (e === "all" || e === "head") {
80
+ let e = a("thead", this.root);
81
+ e && e.replaceWith(this._headRender());
82
+ }
83
+ if (e === "all" || e === "body") {
84
+ let e = a("tbody", this.root);
85
+ e && e.replaceWith(this._bodyRender());
86
+ }
87
+ }
88
+ }
89
+ _changeCssVar(e, t) {
90
+ if (!this.rendered) return;
91
+ let n = `--l-table-${e}`;
92
+ t ? this.style.setProperty(n, t) : this.style.removeProperty(n);
93
+ }
94
+ _changeMaxHeight() {
95
+ let e = this._state.maxHeight;
96
+ e && typeof e == "number" && (e = `${e}px`), this._changeCssVar("max-height", e);
97
+ }
98
+ _classAttrChannge(e, t) {
99
+ if (this.rendered) {
100
+ let n = a("table", this.root);
101
+ n && n.classList.toggle(`l-table-${e}`, t);
102
+ }
103
+ }
104
+ _updateFixedHead() {
105
+ if (this.rendered) {
106
+ let e = a("thead", this.root);
107
+ e && (e.classList.toggle("l-fixed", this._state.fixedHead), e.style.top = this._state.fixedHead ? "0" : "");
108
+ }
109
+ }
110
+ _headRender() {
111
+ let e = i("thead", {
112
+ class: { "l-fixed": this._state.fixedHead },
113
+ style: { top: this._state.fixedHead ? "0" : void 0 }
114
+ });
115
+ return this.columns && this._rendHeadRow(e, this.columns), e;
116
+ }
117
+ _rendHeadRow(e, t) {
118
+ let n = i("tr");
119
+ for (let r = 0, i = t.length; r < i; r++) {
120
+ let i = t[r];
121
+ n.appendChild(this._headColRender(i, r)), i.children && this._rendHeadRow(e, i.children);
122
+ }
123
+ e.appendChild(n);
124
+ }
125
+ _headColRender(e, t) {
126
+ let n = i("th");
127
+ if (e.titleColspan && e.titleColspan > 1 && (n.colSpan = e.titleColspan), e.titleRowspan && e.titleRowspan > 1 && (n.rowSpan = e.titleRowspan), n.style.cssText = this._getColumnStyle(e, "th"), e.fixed && n.classList.add("l-fixed"), n.appendChild(i("span", { textContent: e.title })), e.sorter) {
128
+ let e = i("span", { class: "caret-wrapper" });
129
+ e.appendChild(i("span", { class: "sort-caret ascending" })), e.appendChild(i("span", { class: "sort-caret descending" })), n.classList.add("sort-column"), n.setAttribute("data-action", "sort"), n.setAttribute("data-col", `${t}`), n.appendChild(e);
130
+ }
131
+ return this.sortInfo && this.sortInfo.key === e.key && n.classList.add(this.sortInfo.order === "asc" ? "sort-asc" : "sort-desc"), n;
132
+ }
133
+ _bodyRender() {
134
+ let e = i("tbody");
135
+ if (this.data && this.data.length > 0) for (let t = 0, n = this.data.length; t < n; t++) {
136
+ let n = this.data[t];
137
+ if (this.columns) {
138
+ let r = i("tr");
139
+ this._bodyRowRender(this.columns, t, n, r), e.appendChild(r);
140
+ }
141
+ }
142
+ else {
143
+ let t = i("tr"), n = i("td", {
144
+ class: "l-table__empty-col",
145
+ textContent: "暂无数据"
146
+ });
147
+ this.columns && (n.colSpan = this.columns.length), t.appendChild(n), e.appendChild(t);
148
+ }
149
+ return e;
150
+ }
151
+ _bodyRowRender(e, t, n, r) {
152
+ for (let a = 0, o = e.length; a < o; a++) {
153
+ let o = e[a];
154
+ if (o.children && o.children.length > 0) this._bodyRowRender(o.children, t, n, r);
155
+ else {
156
+ let e = i("td");
157
+ if (typeof o.rowspan == "number" && (e.rowSpan = o.rowspan), typeof o.rowspan == "function" && (e.rowSpan = o.rowspan(n, t)), typeof o.colspan == "number" && (e.colSpan = o.colspan), typeof o.colspan == "function" && (e.colSpan = o.colspan(n, t)), o.fixed && (e.className = "l-fixed"), e.style.cssText = this._getColumnStyle(o), o.render) {
158
+ let r = o.render(n, t);
159
+ typeof r == "string" ? e.innerHTML = r : Array.isArray(r) ? s(r, (t) => {
160
+ e.appendChild(t);
161
+ }) : e.appendChild(r);
162
+ } else e.textContent = o.key ? n[o.key] : "";
163
+ r.appendChild(e);
164
+ }
165
+ }
166
+ }
167
+ _parseColumns(e, t, n) {
168
+ let r = [];
169
+ for (let i = 0, a = e.length; i < a; i++) {
170
+ let a = e[i];
171
+ if (a.id ||= a.key || a.title, a.id ||= `${i}_${d(6)}`, a.fixed) {
172
+ let e = Number.parseFloat(`${a.width || 0}`);
173
+ a.fixed === "left" ? (a.left = t, t += e) : a.fixed === "right" && (a.right = n, n += e);
174
+ }
175
+ if (a.children) {
176
+ let e = this._parseColumns(a.children, t, n);
177
+ a.titleRowspan = a.titleRowspan || 1, a.titleColspan ||= e.reduce((e, t) => e + (t.titleColspan || 1), 0), r.push({
178
+ ...a,
179
+ children: e
180
+ });
181
+ } else a.titleRowspan = a.titleRowspan || this._getMaxDepth(e), a.titleColspan = a.titleColspan || 1, r.push({ ...a });
182
+ }
183
+ return r;
184
+ }
185
+ _getMaxDepth(e) {
186
+ let t = 1;
187
+ for (let n of e) n.children && (t = Math.max(t, this._getMaxDepth(n.children) + 1));
188
+ return t;
189
+ }
190
+ _getColumnStyle(e, t = "td") {
191
+ let n = e.id;
192
+ if (this._globalColStyles && n in this._globalColStyles) return this._globalColStyles[n][t];
193
+ let r = {};
194
+ e.width && (r.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.fixed && (e.fixed === "left" ? (r.left = `${e.left}px`, r["box-shadow"] = "-4px 0 4px -4px #d9d9d9 inset") : e.fixed === "right" && (r.right = `${e.right}px`, r["box-shadow"] = "4px 0 4px -4px #d9d9d9 inset")), this._globalColStyles ||= {};
195
+ let i = o(r), a = {
196
+ th: i,
197
+ td: i + o(e.style || "")
198
+ };
199
+ return this._globalColStyles[n] = a, a[t];
200
+ }
201
+ _handleTap = (e) => {
202
+ let [t, n, r] = u(e, "data-action", e.currentTarget);
203
+ if (t) {
204
+ let e = r.dataset;
205
+ if (n === "sort") {
206
+ let t = parseInt(e.col), n = this.columns[t], r = this.sortInfo && this.sortInfo.order === "desc" ? "asc" : "desc";
207
+ this.sortInfo = {
208
+ key: n.key,
209
+ order: r
210
+ }, n.sorter === "custom" ? this.emit("sort", { detail: {
211
+ index: t,
212
+ key: n.key,
213
+ dir: r
214
+ } }) : (this.data = this._dataSort(), this.rerender("all"));
215
+ } else this.emit(n, { detail: e });
216
+ }
217
+ };
218
+ afterInit() {
219
+ this._changeMaxHeight(), l(this.root, "click", this._handleTap);
220
+ }
221
+ beforeDestroy() {
222
+ c(this.root, "click", this._handleTap);
223
+ }
224
+ _dataSort() {
225
+ if (!this.sortInfo || !this.data) return;
226
+ let { key: e, order: t } = this.sortInfo;
227
+ return this.data.sort((n, r) => {
228
+ let i = n[e], a = r[e];
229
+ return t === "asc" ? i - a : a - i;
230
+ });
231
+ }
232
+ };
233
+ //#endregion
234
+ export { f as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/table/index.less?inline
2
+ var e = ":host{width:100%;max-height:var(--l-table-max-height,100%);font-size:var(--l-table-font-size,14px);display:inline-block;overflow:auto}.l-table{border-collapse:collapse;border-spacing:0;table-layout:var(--l-table-layout,auto);width:100%}.l-table th,.l-table td{border-bottom:1px solid var(--l-table-border-color,#e6e6e6)}.l-table th{padding:var(--l-table-th-padding,10px);text-align:left;background-color:var(--l-table-th-bg,#f2f2f2);color:var(--l-table-th-color,#000)}.l-table td{background-color:var(--l-table-td-bg,#fff);color:var(--l-table-td-color,#000);padding:var(--l-table-td-padding,10px);transition:background-color .3s}.l-table tr:hover td{background-color:var(--l-table-row-hover-bg,#f2f2f2)}.l-table .l-table__empty-col{color:var(--l-table-empty-color,#999);text-align:center}.l-table-stripe tr:nth-child(2n) td{background-color:var(--l-table-stripe-bg,#fafafa)}.l-table-stripe tr:nth-child(2n):hover td{background-color:var(--l-table-row-hover-bg,#f2f2f2)}.l-table-border th,.l-table-border td{border:1px solid var(--l-table-border-color,#e6e6e6)}.l-table-fixed{--l-table-layout:fixed}.l-table-fixed .l-fixed{z-index:1;box-sizing:border-box;position:-webkit-sticky;position:sticky}.l-table-fixed thead.l-fixed,.l-table-fixed tfoot.l-fixed{z-index:2}.l-table .caret-wrapper{vertical-align:middle;justify-content:center;align-items:center;width:20px;height:14px;display:inline-flex;position:relative}.l-table .caret-wrapper .ascending{border-bottom-color:var(--l-table-sort-inactive-color,#c0c4cc);top:-5px}.l-table .caret-wrapper .descending{border-top-color:var(--l-table-sort-inactive-color,#c0c4cc);bottom:-3px}.l-table .sort-caret{border:5px solid #0000;border-radius:3px;width:0;height:0;display:inline-block;position:absolute}.l-table .sort-column{cursor:pointer}.l-table .sort-asc .ascending{border-bottom-color:var(--l-primary-color,#52c41a)}.l-table .sort-desc .descending{border-top-color:var(--l-primary-color,#52c41a)}";
3
+ //#endregion
4
+ export { e as default };
package/lib/tabs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, $one as t, iterate as n, off as r, on as i } from "ph-utils/browser";
1
+ import { $ as e, $one as t, iterate as n, off as r, on as i } from "utilane/browser";
2
2
  //#region src/components/tabs/index.ts
3
3
  function a() {
4
4
  let a = e(".l-tabs");
package/lib/tag/index.js CHANGED
@@ -1,2 +1,75 @@
1
- import { t as e } from "../tag-Di1z9PoZ.js";
2
- export { e as default };
1
+ import e from "../base.js";
2
+ import { parseAttrValue as t } from "../utils/index.js";
3
+ import n from "./index.less_inline.js";
4
+ import { $$ as r, $one as i, off as a, on as o, shouldEventNext as s } from "utilane/browser";
5
+ import { adjust as c, isBlank as l } from "utilane";
6
+ //#region src/components/tag/index.ts
7
+ var u = class extends e {
8
+ static baseName = "tag";
9
+ connectedCallback() {
10
+ this.loadStyleText(n), super.connectedCallback();
11
+ }
12
+ static get observedAttributes() {
13
+ return [
14
+ "type",
15
+ "color",
16
+ "closeable"
17
+ ];
18
+ }
19
+ attributeChangedCallback(e, n, r) {
20
+ let a = r.trim();
21
+ switch (e) {
22
+ case "type":
23
+ this._toggleTypeClass(a);
24
+ break;
25
+ case "color":
26
+ this._toggleColorStyle(a);
27
+ break;
28
+ case "closable":
29
+ if (!this.rendered) return;
30
+ let e = t(a, !1, "closeable"), n = i(".l-tag-close", this.root);
31
+ if (n) {
32
+ if (e) return;
33
+ n.remove();
34
+ } else e && this.root.appendChild(this.#e());
35
+ }
36
+ }
37
+ render() {
38
+ let e = document.createDocumentFragment();
39
+ return e.appendChild(r("div", {
40
+ class: "l-tag-content",
41
+ innerHTML: "<slot></slot>"
42
+ })), this.getAttr("closeable", !1) && e.appendChild(this.#e()), e.appendChild(r("slot", { name: "suffix" })), e;
43
+ }
44
+ #e() {
45
+ return r("div", {
46
+ class: "l-tag-close",
47
+ innerHTML: "<l-close-icon></l-close-icon>",
48
+ "data-action": "close"
49
+ });
50
+ }
51
+ #t = (e) => {
52
+ let [t, n, r] = s(e, "data-action", this);
53
+ t && n === "close" && this.emit("close", { detail: { ...r.dataset } });
54
+ };
55
+ afterInit() {
56
+ this.classList.add(`l-tag--${this.getAttr("type", "info")}`), this._toggleColorStyle(), o(this.root, "click", this.#t);
57
+ }
58
+ _toggleTypeClass(e) {
59
+ if (!this.rendered) return;
60
+ let t = !1;
61
+ for (let n of this.classList) if (n.startsWith("l-tag--")) {
62
+ this.classList.replace(n, `l-tag--${e}`), t = !0;
63
+ break;
64
+ }
65
+ t || this.classList.add(`l-tag--${e}`);
66
+ }
67
+ _toggleColorStyle(e) {
68
+ this.rendered && (l(e) ? (this.style.removeProperty("--l-tag-color"), this.style.removeProperty("--l-tag-border-color"), this.style.removeProperty("--l-tag-background")) : (this.style.setProperty("--l-tag-color", e), this.style.setProperty("--l-tag-border-color", e), this.style.setProperty("--l-tag-background", c(e, 5, !0))));
69
+ }
70
+ beforeDestroy() {
71
+ a(this.root, "click", this.#t);
72
+ }
73
+ };
74
+ //#endregion
75
+ export { u as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/tag/index.less?inline
2
+ var e = ":host{box-sizing:border-box;vertical-align:middle;height:var(--l-tag-height,22px);border:1px solid var(--l-tag-border-color,var(--l-border-color,#dedede));background:var(--l-tag-background,#fff);white-space:nowrap;color:var(--l-tag-color,#333);border-radius:4px;justify-content:center;align-items:center;padding:0 5px;font-size:12px;line-height:1;display:inline-flex}:host(.l-tag--primary){--l-tag-border-color:var(--l-primary-color-light3,#d3adf7);--l-tag-background:var(--l-primary-color-light5,#f9f0ff);--l-tag-color:var(--l-primary-color-light3,#d3adf7)}:host(.l-tag--error){--l-tag-color:var(--l-error-color,#ed3f13);--l-tag-background:var(--l-error-color-light5,#fff1f0);--l-tag-border-color:var(--l-error-color,#ed3f13)}:host(.l-tag--success){--l-tag-color:var(--l-success-color,#a0d911);--l-tag-background:var(--l-success-color-light5,#fcffe6);--l-tag-border-color:var(--l-success-color,#a0d911)}:host(.l-tag--info){--l-tag-color:var(--l-text-color,#999);--l-tag-background:var(--l-text-secondary-color,#f5f5f5);--l-tag-border-color:var(--l-border-color,#dedede)}:host(.l-tag--warning){--l-tag-color:var(--l-warning-color,#f90);--l-tag-background:var(--l-warning-color-light5,#fff5e6);--l-tag-border-color:var(--l-warning-color,#f90)}.l-tag-close{cursor:pointer;border-radius:50%;justify-content:center;align-items:center;width:14px;height:14px;margin-left:3px;font-size:12px;transition:color .3s,background-color .3s;display:inline-flex}.l-tag-close:hover{background-color:var(--l-tag-color,#1890ff);color:#fff}";
3
+ //#endregion
4
+ export { e as default };
@@ -1,2 +1,86 @@
1
- import { t as e } from "../theme-CLbBS-in.js";
2
- export { e as default };
1
+ import e from "../base.js";
2
+ import { initAttr as t } from "../utils/index.js";
3
+ import n from "./index.less_inline.js";
4
+ import { $one as r, applyTheme as i, create as a, getTheme as o, off as s, on as c } from "utilane/browser";
5
+ //#region src/components/theme/index.ts
6
+ var l = [
7
+ {
8
+ value: "auto",
9
+ text: "跟随系统",
10
+ icon: "l-theme-default-icon"
11
+ },
12
+ {
13
+ value: "light",
14
+ text: "浅色模式",
15
+ icon: "l-sun-icon"
16
+ },
17
+ {
18
+ value: "dark",
19
+ text: "深色模式",
20
+ icon: "l-moon-icon"
21
+ }
22
+ ], u = class extends e {
23
+ static baseName = "theme";
24
+ type = "button";
25
+ label = "text";
26
+ theme;
27
+ #e;
28
+ connectedCallback() {
29
+ t(this), this.theme = o(), this.loadStyleText(n), super.connectedCallback(), this.#s();
30
+ }
31
+ disconnectedCallback() {
32
+ super.disconnectedCallback(), this.#c();
33
+ }
34
+ render() {
35
+ switch (this.type) {
36
+ case "select": return this.#r();
37
+ case "radio": return this.#a();
38
+ case "switch": return this.#i();
39
+ default: return this.#t();
40
+ }
41
+ }
42
+ #t() {
43
+ let e = a("l-button", { class: "l-theme-btn l-theme-inner" });
44
+ return this.#n(e), e;
45
+ }
46
+ #n(e) {
47
+ let t = this.theme === "auto" ? "sun" : "moon";
48
+ e.innerHTML = `<l-${t}-icon></l-${t}-icon>`;
49
+ }
50
+ #r() {
51
+ let e = a("l-select-ori", { class: "l-theme-inner" });
52
+ return e.value = this.theme, e.innerHTML = [
53
+ "<option value=\"auto\">跟随系统</option>",
54
+ "<option value=\"light\">浅色模式</option>",
55
+ "<option value=\"dark\">深色模式</option>"
56
+ ].join(""), e;
57
+ }
58
+ #i() {
59
+ let e = a("l-switch", { class: "l-theme-switch l-theme-inner" });
60
+ return e.value = this.theme === "dark", e.innerHTML = "<l-sun-icon slot=\"unchecked-action\"></l-sun-icon><l-moon-icon slot=\"checked-action\"></l-moon-icon>", e;
61
+ }
62
+ #a() {
63
+ let e = a("l-radio-group", { class: "l-theme-inner" });
64
+ return e.value = this.theme, e.innerHTML = l.map((e) => {
65
+ let t = "";
66
+ return t = this.label === "icon" ? `<${e.icon}></${e.icon}>` : e.text, `<l-radio value="${e.value}" button>${t}</l-radio>`;
67
+ }).join(""), e;
68
+ }
69
+ #o = async (e) => {
70
+ let t;
71
+ if (this.type === "button") t = this.theme === "dark" ? "auto" : "dark";
72
+ else {
73
+ let n = e.target.value;
74
+ t = this.type === "switch" ? n ? "dark" : "light" : n;
75
+ }
76
+ await i(t), this.theme = t, this.type === "button" && this.#n(this.#e), this.emit("change", { detail: t });
77
+ };
78
+ #s() {
79
+ this.#e = r(".l-theme-inner", this.root), this.type === "button" ? c(this.#e, "click", this.#o) : c(this.#e, "change", this.#o);
80
+ }
81
+ #c() {
82
+ this.#e &&= (this.type === "button" ? s(this.#e, "click", this.#o) : s(this.#e, "change", this.#o), void 0);
83
+ }
84
+ };
85
+ //#endregion
86
+ export { u as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/theme/index.less?inline
2
+ var e = ":host{box-sizing:border-box;width:auto;display:inline-flex}.l-theme-btn::part(default){--l-btn-background:transparent;--l-btn-hover-background:transparent;--l-btn-text-color:#9ca3af;--l-btn-hover-text-color:#666;width:var(--l-form-control-height,32px);padding:0;font-size:18px}.l-theme-switch.l-switch--checked{background-color:#65757129;border-color:#3c3f44}.l-theme-switch.l-switch--checked::part(action){color:#fff;background-color:#000}html.dark .l-theme-btn{--l-btn-hover-text-color:#fff}";
3
+ //#endregion
4
+ export { e as default };
@@ -1,5 +1,5 @@
1
1
  import e from "../base.js";
2
- import { $one as t, applyColorTheme as n, getColorTheme as r, on as i } from "ph-utils/browser";
2
+ import { $one as t, applyColorTheme as n, getColorTheme as r, on as i } from "utilane/browser";
3
3
  //#region src/components/theme/theme_color.ts
4
4
  var a = class extends e {
5
5
  static baseName = "theme-color";