litos-ui 0.21.0 → 0.22.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 (381) hide show
  1. package/README.md +119 -15
  2. package/README.zh-CN.md +153 -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 +6 -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.js +2 -2
  47. package/lib/dialog/dialog_container_style.js +6 -2
  48. package/lib/dialog/index.js +1 -1
  49. package/lib/entries/base.d.ts +2 -0
  50. package/lib/entries/base.js +2 -0
  51. package/lib/entries/button.d.ts +2 -0
  52. package/lib/entries/button.js +6 -0
  53. package/lib/entries/calendar.d.ts +2 -0
  54. package/lib/entries/calendar.js +6 -0
  55. package/lib/entries/card.d.ts +2 -0
  56. package/lib/entries/card.js +6 -0
  57. package/lib/entries/carousel-item.d.ts +2 -0
  58. package/lib/entries/carousel-item.js +6 -0
  59. package/lib/entries/carousel.d.ts +5 -0
  60. package/lib/entries/carousel.js +6 -0
  61. package/lib/entries/checkbox-group.d.ts +3 -0
  62. package/lib/entries/checkbox-group.js +6 -0
  63. package/lib/entries/checkbox.d.ts +2 -0
  64. package/lib/entries/checkbox.js +6 -0
  65. package/lib/entries/collapse-item.d.ts +3 -0
  66. package/lib/entries/collapse-item.js +6 -0
  67. package/lib/entries/collapse.d.ts +3 -0
  68. package/lib/entries/collapse.js +6 -0
  69. package/lib/entries/color-picker.d.ts +3 -0
  70. package/lib/entries/color-picker.js +6 -0
  71. package/lib/entries/date-picker-ori.d.ts +2 -0
  72. package/lib/entries/date-picker-ori.js +6 -0
  73. package/lib/entries/date-picker.d.ts +9 -0
  74. package/lib/entries/date-picker.js +6 -0
  75. package/lib/entries/description-panel.d.ts +4 -0
  76. package/lib/entries/description-panel.js +6 -0
  77. package/lib/entries/dialog-box.d.ts +6 -0
  78. package/lib/entries/dialog-box.js +2 -0
  79. package/lib/entries/dialog-container.d.ts +4 -0
  80. package/lib/entries/dialog-container.js +6 -0
  81. package/lib/entries/dialog.d.ts +3 -0
  82. package/lib/entries/dialog.js +2 -0
  83. package/lib/entries/form-item.d.ts +2 -0
  84. package/lib/entries/form-item.js +6 -0
  85. package/lib/entries/form.d.ts +3 -0
  86. package/lib/entries/form.js +6 -0
  87. package/lib/entries/icon-arrow-down.d.ts +2 -0
  88. package/lib/entries/icon-arrow-down.js +6 -0
  89. package/lib/entries/icon-arrow-left.d.ts +2 -0
  90. package/lib/entries/icon-arrow-left.js +6 -0
  91. package/lib/entries/icon-arrow-right.d.ts +2 -0
  92. package/lib/entries/icon-arrow-right.js +6 -0
  93. package/lib/entries/icon-arrow-up.d.ts +2 -0
  94. package/lib/entries/icon-arrow-up.js +6 -0
  95. package/lib/entries/icon-base.d.ts +2 -0
  96. package/lib/entries/icon-base.js +6 -0
  97. package/lib/entries/icon-calendar.d.ts +2 -0
  98. package/lib/entries/icon-calendar.js +6 -0
  99. package/lib/entries/icon-caret-bottom.d.ts +2 -0
  100. package/lib/entries/icon-caret-bottom.js +6 -0
  101. package/lib/entries/icon-caret-top.d.ts +2 -0
  102. package/lib/entries/icon-caret-top.js +6 -0
  103. package/lib/entries/icon-close-filled.d.ts +2 -0
  104. package/lib/entries/icon-close-filled.js +6 -0
  105. package/lib/entries/icon-close.d.ts +2 -0
  106. package/lib/entries/icon-close.js +6 -0
  107. package/lib/entries/icon-copy.d.ts +2 -0
  108. package/lib/entries/icon-copy.js +6 -0
  109. package/lib/entries/icon-d-arrow-left.d.ts +2 -0
  110. package/lib/entries/icon-d-arrow-left.js +6 -0
  111. package/lib/entries/icon-d-arrow-right.d.ts +2 -0
  112. package/lib/entries/icon-d-arrow-right.js +6 -0
  113. package/lib/entries/icon-delete.d.ts +2 -0
  114. package/lib/entries/icon-delete.js +6 -0
  115. package/lib/entries/icon-eye-outline.d.ts +2 -0
  116. package/lib/entries/icon-eye-outline.js +6 -0
  117. package/lib/entries/icon-font-icon.d.ts +2 -0
  118. package/lib/entries/icon-font-icon.js +6 -0
  119. package/lib/entries/icon-info.d.ts +2 -0
  120. package/lib/entries/icon-info.js +6 -0
  121. package/lib/entries/icon-loading.d.ts +2 -0
  122. package/lib/entries/icon-loading.js +6 -0
  123. package/lib/entries/icon-minus.d.ts +2 -0
  124. package/lib/entries/icon-minus.js +6 -0
  125. package/lib/entries/icon-moon.d.ts +2 -0
  126. package/lib/entries/icon-moon.js +6 -0
  127. package/lib/entries/icon-more.d.ts +2 -0
  128. package/lib/entries/icon-more.js +6 -0
  129. package/lib/entries/icon-picture.d.ts +2 -0
  130. package/lib/entries/icon-picture.js +6 -0
  131. package/lib/entries/icon-plus.d.ts +2 -0
  132. package/lib/entries/icon-plus.js +6 -0
  133. package/lib/entries/icon-reduction.d.ts +2 -0
  134. package/lib/entries/icon-reduction.js +6 -0
  135. package/lib/entries/icon-refresh-left.d.ts +2 -0
  136. package/lib/entries/icon-refresh-left.js +6 -0
  137. package/lib/entries/icon-refresh-right.d.ts +2 -0
  138. package/lib/entries/icon-refresh-right.js +6 -0
  139. package/lib/entries/icon-refresh.d.ts +2 -0
  140. package/lib/entries/icon-refresh.js +6 -0
  141. package/lib/entries/icon-search.d.ts +2 -0
  142. package/lib/entries/icon-search.js +6 -0
  143. package/lib/entries/icon-select.d.ts +2 -0
  144. package/lib/entries/icon-select.js +6 -0
  145. package/lib/entries/icon-sort.d.ts +2 -0
  146. package/lib/entries/icon-sort.js +6 -0
  147. package/lib/entries/icon-success.d.ts +2 -0
  148. package/lib/entries/icon-success.js +6 -0
  149. package/lib/entries/icon-sun.d.ts +2 -0
  150. package/lib/entries/icon-sun.js +6 -0
  151. package/lib/entries/icon-theme-default.d.ts +2 -0
  152. package/lib/entries/icon-theme-default.js +6 -0
  153. package/lib/entries/icon-warn.d.ts +2 -0
  154. package/lib/entries/icon-warn.js +6 -0
  155. package/lib/entries/icon-zoom-in.d.ts +2 -0
  156. package/lib/entries/icon-zoom-in.js +6 -0
  157. package/lib/entries/icon-zoom-out.d.ts +2 -0
  158. package/lib/entries/icon-zoom-out.js +6 -0
  159. package/lib/entries/image-preview.d.ts +10 -0
  160. package/lib/entries/image-preview.js +6 -0
  161. package/lib/entries/image.d.ts +2 -0
  162. package/lib/entries/image.js +6 -0
  163. package/lib/entries/input-number.d.ts +2 -0
  164. package/lib/entries/input-number.js +6 -0
  165. package/lib/entries/input.d.ts +2 -0
  166. package/lib/entries/input.js +6 -0
  167. package/lib/entries/list.d.ts +3 -0
  168. package/lib/entries/list.js +6 -0
  169. package/lib/entries/loading.d.ts +2 -0
  170. package/lib/entries/loading.js +2 -0
  171. package/lib/entries/mask.d.ts +2 -0
  172. package/lib/entries/mask.js +6 -0
  173. package/lib/entries/md-input.d.ts +2 -0
  174. package/lib/entries/md-input.js +6 -0
  175. package/lib/entries/menu.d.ts +3 -0
  176. package/lib/entries/menu.js +6 -0
  177. package/lib/entries/message.d.ts +6 -0
  178. package/lib/entries/message.js +2 -0
  179. package/lib/entries/modal-box.d.ts +6 -0
  180. package/lib/entries/modal-box.js +2 -0
  181. package/lib/entries/modal.d.ts +4 -0
  182. package/lib/entries/modal.js +6 -0
  183. package/lib/entries/notification.d.ts +7 -0
  184. package/lib/entries/notification.js +6 -0
  185. package/lib/entries/page-header.d.ts +4 -0
  186. package/lib/entries/page-header.js +6 -0
  187. package/lib/entries/pagination.d.ts +9 -0
  188. package/lib/entries/pagination.js +6 -0
  189. package/lib/entries/polygon.d.ts +2 -0
  190. package/lib/entries/polygon.js +6 -0
  191. package/lib/entries/popconfirm.d.ts +3 -0
  192. package/lib/entries/popconfirm.js +2 -0
  193. package/lib/entries/popover.d.ts +1 -0
  194. package/lib/entries/popover.js +2 -0
  195. package/lib/entries/qrcode.d.ts +2 -0
  196. package/lib/entries/qrcode.js +6 -0
  197. package/lib/entries/radio-group.d.ts +3 -0
  198. package/lib/entries/radio-group.js +6 -0
  199. package/lib/entries/radio.d.ts +2 -0
  200. package/lib/entries/radio.js +6 -0
  201. package/lib/entries/select-ori.d.ts +2 -0
  202. package/lib/entries/select-ori.js +6 -0
  203. package/lib/entries/select.d.ts +4 -0
  204. package/lib/entries/select.js +6 -0
  205. package/lib/entries/space.d.ts +2 -0
  206. package/lib/entries/space.js +6 -0
  207. package/lib/entries/switch.d.ts +2 -0
  208. package/lib/entries/switch.js +6 -0
  209. package/lib/entries/tabbar-item.d.ts +2 -0
  210. package/lib/entries/tabbar-item.js +6 -0
  211. package/lib/entries/tabbar.d.ts +3 -0
  212. package/lib/entries/tabbar.js +6 -0
  213. package/lib/entries/table.d.ts +3 -0
  214. package/lib/entries/table.js +6 -0
  215. package/lib/entries/tabs.d.ts +3 -0
  216. package/lib/entries/tabs.js +2 -0
  217. package/lib/entries/tag.d.ts +2 -0
  218. package/lib/entries/tag.js +6 -0
  219. package/lib/entries/theme-color.d.ts +3 -0
  220. package/lib/entries/theme-color.js +6 -0
  221. package/lib/entries/theme.d.ts +9 -0
  222. package/lib/entries/theme.js +6 -0
  223. package/lib/entries/transition.d.ts +1 -0
  224. package/lib/entries/transition.js +2 -0
  225. package/lib/entries/upload.d.ts +3 -0
  226. package/lib/entries/upload.js +6 -0
  227. package/lib/entries/utils.d.ts +1 -0
  228. package/lib/entries/utils.js +2 -0
  229. package/lib/form/form_inner.d.ts +1 -0
  230. package/lib/{form_inner-Cnwb6f_Q.js → form/form_inner.js} +9 -9
  231. package/lib/form/form_item.d.ts +2 -1
  232. package/lib/form/form_item.js +148 -2
  233. package/lib/form/form_item.less_inline.js +4 -0
  234. package/lib/form/index.d.ts +3 -2
  235. package/lib/form/index.js +191 -2
  236. package/lib/form/index.less_inline.js +4 -0
  237. package/lib/icon/base.js +1 -1
  238. package/lib/icon/delete.d.ts +5 -0
  239. package/lib/icon/delete.js +10 -0
  240. package/lib/icon/eye_outline.d.ts +6 -0
  241. package/lib/icon/eye_outline.js +13 -0
  242. package/lib/icon/icon_style.js +6 -2
  243. package/lib/{icon_style-J7iiDS_a.js → icon/index.less_inline.js} +2 -3
  244. package/lib/icon/minus.d.ts +5 -0
  245. package/lib/icon/minus.js +10 -0
  246. package/lib/icon/picture.d.ts +5 -0
  247. package/lib/icon/picture.js +10 -0
  248. package/lib/icon/plus.d.ts +5 -0
  249. package/lib/icon/plus.js +10 -0
  250. package/lib/image/image_preview.js +91 -2
  251. package/lib/image/image_preview.less_inline.js +4 -0
  252. package/lib/image/index.js +163 -2
  253. package/lib/image/index.less_inline.js +4 -0
  254. package/lib/index.d.ts +11 -0
  255. package/lib/index.js +47 -40
  256. package/lib/input/index.js +4 -4
  257. package/lib/{input-DUBlLEXS.js → input/index.less_inline.js} +1 -1
  258. package/lib/{input_inner-x4GfLGjj.js → input/input_inner.less_inline.js} +1 -1
  259. package/lib/input_number/index.js +3 -3
  260. package/lib/{style-C5wUmE2b.js → input_number/index.less_inline.js} +2 -3
  261. package/lib/input_number/style.js +6 -2
  262. package/lib/list/index.js +52 -2
  263. package/lib/list/index.less_inline.js +4 -0
  264. package/lib/loading/index.js +1 -1
  265. package/lib/mask/index.d.ts +1 -1
  266. package/lib/mask/index.js +109 -2
  267. package/lib/mask/index.less_inline.js +4 -0
  268. package/lib/md_input/index.js +59 -2
  269. package/lib/md_input/index.less_inline.js +4 -0
  270. package/lib/menu/index.js +275 -2
  271. package/lib/menu/index.less_inline.js +4 -0
  272. package/lib/message/index.js +1 -1
  273. package/lib/modal/index.js +199 -2
  274. package/lib/modal/index.less_inline.js +4 -0
  275. package/lib/modal/modal_box.js +21 -22
  276. package/lib/notification/index.d.ts +212 -0
  277. package/lib/notification/index.js +380 -0
  278. package/lib/notification/index.less_inline.js +4 -0
  279. package/lib/notification/placement.d.ts +49 -0
  280. package/lib/notification/placement.js +48 -0
  281. package/lib/notification/style.d.ts +2 -0
  282. package/lib/notification/style.js +6 -0
  283. package/lib/page_header/index.js +100 -2
  284. package/lib/page_header/index.less_inline.js +4 -0
  285. package/lib/pagination/index.js +214 -2
  286. package/lib/pagination/index.less_inline.js +4 -0
  287. package/lib/polygon/index.js +21 -2
  288. package/lib/{polygon-DhhovlrG.js → polygon/index.less_inline.js} +2 -18
  289. package/lib/qrcode/index.js +65 -2
  290. package/lib/qrcode/index.less_inline.js +4 -0
  291. package/lib/select/index.js +355 -3
  292. package/lib/select/index.less_inline.js +4 -0
  293. package/lib/select_ori/index.js +58 -2
  294. package/lib/select_ori/index.less_inline.js +4 -0
  295. package/lib/space/index.js +40 -2
  296. package/lib/space/index.less_inline.js +4 -0
  297. package/lib/{animation-Bo4jbSGK.js → styles/animation/index.css_inline.js} +2 -3
  298. package/lib/styles/animation/index.js +6 -2
  299. package/lib/{mask-Ox6CoyFB.js → styles/mask/index.css_inline.js} +2 -3
  300. package/lib/styles/mask/index.js +6 -2
  301. package/lib/switch/index.js +51 -2
  302. package/lib/switch/index.less_inline.js +4 -0
  303. package/lib/tabbar/index.js +97 -2
  304. package/lib/tabbar/index.less_inline.js +4 -0
  305. package/lib/tabbar/item.js +61 -2
  306. package/lib/tabbar/item.less_inline.js +4 -0
  307. package/lib/table/index.js +234 -2
  308. package/lib/table/index.less_inline.js +4 -0
  309. package/lib/tabs/index.js +1 -1
  310. package/lib/tag/index.js +75 -2
  311. package/lib/tag/index.less_inline.js +4 -0
  312. package/lib/theme/index.js +86 -2
  313. package/lib/theme/index.less_inline.js +4 -0
  314. package/lib/theme/theme_color.js +1 -1
  315. package/lib/upload/index.d.ts +170 -0
  316. package/lib/upload/index.js +848 -0
  317. package/lib/upload/index.less_inline.js +4 -0
  318. package/lib/upload/style.d.ts +2 -0
  319. package/lib/upload/style.js +6 -0
  320. package/lib/utils/context_provide.d.ts +1 -0
  321. package/lib/utils/context_provide.js +1 -1
  322. package/lib/utils/event.d.ts +30 -0
  323. package/lib/utils/index.d.ts +3 -0
  324. package/lib/utils/index.js +1 -1
  325. package/lib/utils/popover.js +1 -1
  326. package/lib/utils/signal_types.d.ts +5 -0
  327. package/lib/utils/transition.d.ts +28 -0
  328. package/lib/utils/transition.js +1 -1
  329. package/package.json +39 -18
  330. package/styles/animation.css +2 -2
  331. package/styles/container.css +8 -8
  332. package/styles/datepicker.css +9 -9
  333. package/styles/dialog.css +7 -7
  334. package/styles/loading.css +17 -17
  335. package/styles/message.css +9 -9
  336. package/styles/modal_box.css +3 -3
  337. package/styles/notification.css +17 -0
  338. package/styles/popover.css +11 -14
  339. package/styles/reset.css +13 -15
  340. package/styles/scrollbar.css +5 -5
  341. package/styles/select.css +6 -6
  342. package/styles/tabs.css +3 -3
  343. package/styles/theme-coral.css +35 -0
  344. package/styles/theme-jade.css +35 -0
  345. package/styles/theme-tangerine.css +35 -0
  346. package/styles/transition.css +1 -1
  347. package/styles/vars.css +41 -7
  348. package/lib/calendar-CvlUsN6w.js +0 -146
  349. package/lib/card-3DM-lJQV.js +0 -63
  350. package/lib/carousel-DvkZ1YXq.js +0 -276
  351. package/lib/check-doQ2ZpQj.js +0 -117
  352. package/lib/collapse-B6-Rn05A.js +0 -102
  353. package/lib/color_picker-0a-IGZY9.js +0 -41
  354. package/lib/date_picker-BDN2PAz5.js +0 -99
  355. package/lib/date_picker_ori-BXFs1eET.js +0 -120
  356. package/lib/description_panel--AKXBzLL.js +0 -53
  357. package/lib/esm-DAha108i.js +0 -270
  358. package/lib/form-DJxvBiLy.js +0 -190
  359. package/lib/form_item-BqPMRABd.js +0 -147
  360. package/lib/image-CVQai6NX.js +0 -162
  361. package/lib/image_preview-DfQAKSJH.js +0 -90
  362. package/lib/item-CQ2Sknbz.js +0 -14
  363. package/lib/item-DI6mQXtB.js +0 -117
  364. package/lib/item-D_ZOPXuE.js +0 -60
  365. package/lib/list-MG8PRzos.js +0 -51
  366. package/lib/mask-Bx-yNIJv.js +0 -108
  367. package/lib/md_input-BX3bujz8.js +0 -58
  368. package/lib/menu-DKscK5mw.js +0 -274
  369. package/lib/modal-Cwi3qlEf.js +0 -198
  370. package/lib/page_header-ujV3pncE.js +0 -99
  371. package/lib/pagination-aRbGd3Rf.js +0 -213
  372. package/lib/qrcode-Dip8uLSA.js +0 -64
  373. package/lib/select-BZMDj5VE.js +0 -354
  374. package/lib/select_ori-C7sUZxen.js +0 -57
  375. package/lib/space-CKuTk0YB.js +0 -39
  376. package/lib/switch-wh2-ivty.js +0 -50
  377. package/lib/tabbar-CBXK-_AV.js +0 -96
  378. package/lib/table-BQxMD2Ae.js +0 -233
  379. package/lib/tag-Di1z9PoZ.js +0 -74
  380. package/lib/theme-CLbBS-in.js +0 -85
  381. package/styles/dark.css +0 -13
@@ -1,108 +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, hasClass as o, off as s, on as c, removeClass as l, shouldEventNext as u, transition as d } from "ph-utils/browser";
4
- //#region src/components/mask/index.less?inline
5
- var f = ":host{display:none;position:relative}:host(.open){display:block}.l-mask,.l-panel{opacity:1;position:fixed;inset:0}.l-mask{z-index:var(--l-mask-zindex,100);background-color:#00000080}.l-panel{z-index:calc(var(--l-mask-zindex,100) + 1);color:#fff}", p = class extends e {
6
- static baseName = "mask";
7
- #e = !1;
8
- zIndex = 100;
9
- maskClosable = !0;
10
- lockScroll = !0;
11
- #t = "";
12
- get open() {
13
- return this.#e;
14
- }
15
- set open(e) {
16
- this.#e = e, this.rendered && this.#n();
17
- }
18
- static customAttributes = [];
19
- static get observedAttributes() {
20
- return [
21
- "open",
22
- "z-index",
23
- "mask-closable",
24
- "lock-scroll",
25
- ...this.customAttributes
26
- ];
27
- }
28
- connectedCallback() {
29
- this.loadStyleText(f), super.connectedCallback();
30
- }
31
- attributeChangedCallback(e, r, i) {
32
- e = t(e);
33
- let a = n(i, this[e], e);
34
- a !== this[e] && (this[e] = a, e === "zIndex") && (a === 100 ? this.style.removeProperty("--l-mask-zindex") : this.style.setProperty("--l-mask-zindex", a));
35
- }
36
- render() {
37
- let e = document.createDocumentFragment(), t = r("div", {
38
- class: "l-mask",
39
- part: "mask"
40
- });
41
- e.appendChild(t);
42
- let n = r("div", {
43
- class: "l-panel",
44
- part: "panel"
45
- }), i = this.contentRender();
46
- return typeof i == "string" ? n.innerHTML = i : n.appendChild(i), e.appendChild(n), e;
47
- }
48
- contentRender() {
49
- return "<slot></slot>";
50
- }
51
- #n() {
52
- if (this.open) {
53
- this.lockScroll && (this.#t = getComputedStyle(document.body).overflow, document.body.style.overflow = "hidden"), a(this, "open");
54
- let e = i(".l-mask", this.root);
55
- e && d(e, [[
56
- "opacity",
57
- "0",
58
- "0.3s"
59
- ]], "enter");
60
- let t = i(".l-panel", this.root);
61
- t && d(t, [[
62
- "opacity",
63
- "0",
64
- "0.3s"
65
- ]], "enter"), this.afterOpened();
66
- } else if (o(this, "open")) {
67
- this.emit("close");
68
- let e = i(".l-panel", this.root);
69
- e && d(e, [[
70
- "opacity",
71
- "0",
72
- "0.3s"
73
- ]], "leave");
74
- let t = i(".l-mask", this.root);
75
- t && d(t, [[
76
- "opacity",
77
- "0",
78
- "0.3s"
79
- ]], "leave", () => {
80
- l(this, "open"), this.emit("closed");
81
- }), this.lockScroll && (document.body.style.overflow = this.#t), this.afterClosed();
82
- }
83
- }
84
- afterInit() {
85
- this.#n();
86
- let e = i(".l-panel", this.root);
87
- e && c(e, "click", this.#r);
88
- }
89
- beforeDestroy() {
90
- let e = i(".l-panel", this.root);
91
- e && s(e, "click", this.#r);
92
- }
93
- #r = (e) => {
94
- let [t, n] = u(e, "data-action", e.currentTarget);
95
- if (!t) {
96
- this.maskClosable && (this.open = !1);
97
- return;
98
- }
99
- this.onAction(n) || this.emit("action", { detail: n });
100
- };
101
- afterOpened() {}
102
- afterClosed() {}
103
- onAction(e) {
104
- return !1;
105
- }
106
- };
107
- //#endregion
108
- export { p as t };
@@ -1,58 +0,0 @@
1
- import { initAttr as e } from "./utils/index.js";
2
- import { t } from "./form_inner-Cnwb6f_Q.js";
3
- import { $$ as n, $one as r, addClass as i, off as a, on as o, removeClass as s } from "ph-utils/browser";
4
- import { isBlank as c, random as l } from "ph-utils";
5
- //#region src/components/md_input/index.less?inline
6
- var u = ":host{--l-input-width:180px;width:var(--l-input-width,180px);height:var(--l-form-control-height,32px);display:inline-block;position:relative}.l-md-input__inner{box-sizing:border-box;background:0 0;border:0 solid silver;border-bottom-width:1px;outline:none;width:100%;height:100%;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color,#722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{font-size:12px;transform:translateY(-150%)}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color,#722ed1)}.l-md-input__label{color:#8c8c8c;cursor:text;align-items:center;font-size:13px;line-height:1;transition:color .3s,transform .3s;display:flex;position:absolute;top:50%;bottom:0;left:0;transform:translateY(-50%)}:host(.l-md-input-outline){--l-input-label-background:#fff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{background-color:#fff;padding-left:4px;padding-right:4px}", d = class extends t {
7
- static baseName = "md-input";
8
- outline = !1;
9
- htmlType = "text";
10
- inputmode;
11
- label;
12
- static get observedAttributes() {
13
- return ["disabled"];
14
- }
15
- connectedCallback() {
16
- e(this), this.loadStyleText(u), super.connectedCallback(), this.#e();
17
- }
18
- disconnectedCallback() {
19
- super.disconnectedCallback(), this.#t();
20
- }
21
- render() {
22
- c(this.value) || i(this, "l-has-value"), this.outline && i(this, "l-md-input-outline");
23
- let e = document.createDocumentFragment(), t = `l-md-input-${l(8)}`, r = n("input", {
24
- class: "l-md-input__inner",
25
- type: this.htmlType,
26
- name: this.getName(),
27
- inputmode: this.inputmode,
28
- id: t
29
- });
30
- if (e.appendChild(r), this.label) {
31
- let r = n("label", {
32
- class: "l-md-input__label",
33
- for: t
34
- });
35
- r.textContent = this.label, e.appendChild(r);
36
- }
37
- return e;
38
- }
39
- setValue(e) {
40
- super.setValue(e);
41
- let t = r("input", this.root);
42
- t && (t.value = e);
43
- }
44
- #e() {
45
- let e = r("input", this.root);
46
- e && o(e, "input", this.#n);
47
- }
48
- #t() {
49
- let e = r("input", this.root);
50
- e && a(e, "input", this.#n);
51
- }
52
- #n = (e) => {
53
- let t = e.target.value;
54
- this.setValue(t), c(t) ? s(this, "l-has-value") : i(this, "l-has-value");
55
- };
56
- };
57
- //#endregion
58
- export { d as t };
@@ -1,274 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
3
- import { $ as i, $$ as a, $one as o, iterate as s, off as c, on as l } from "ph-utils/browser";
4
- //#region src/components/menu/index.less?inline
5
- var u = ":host{--l-menu-width:240px;--l-menu-height:auto;--l-menu-level:0;--l-menu-item-height:40px;--l-menu-item-padding-x:10px;--l-menu-item-indent:15px;--l-menu-item-radius:0;--l-menu-item-hover-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-item-active-color:var(--l-primary-color,#722ed1);--l-menu-item-active-background:var(--l-primary-color-light5,#f9f0ff);--l-menu-border-color:transparent;--l-menu-border-width:0px;--l-menu-arrow-color:var(--l-info-color,#8c8c8c);--l-menu-collapsed-width:40px;--l-menu-icon-size:1.8rem;--l-menu-collapsed-icon-size:1.8rem;width:var(--l-menu-width);height:var(--l-menu-height);box-sizing:border-box;transition:width .3s;display:block}.l-menu{min-width:0;color:inherit;box-sizing:border-box;border-right:var(--l-menu-border-width) solid var(--l-menu-border-color);font-size:14px;transition:height .3s,width .3s;display:block;position:relative;overflow:hidden}.l-menu .l-menu{--l-menu-border-color:transparent}.l-menu-item,.l-submenu-title{padding:0 var(--l-menu-item-padding-x) 0 calc(var(--l-menu-item-padding-x) + var(--l-menu-level) * var(--l-menu-item-indent));height:var(--l-menu-item-height);cursor:pointer;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;border-radius:var(--l-menu-item-radius);border-right:2px solid #0000;align-items:center;gap:6px;transition:color .3s,background-color .3s,border-color .3s,transform .2s;display:flex;position:relative;overflow:hidden}.l-menu-item:hover,.l-submenu-title:hover{background-color:var(--l-menu-item-hover-background)}.l-menu-item.active{background-color:var(--l-menu-item-active-background);color:var(--l-menu-item-active-color);box-shadow:inset 3px 0 var(--l-primary-color-light1,#39f);font-weight:500}.l-menu-icon-wrap{font-size:var(--l-menu-icon-size);flex:none;align-items:center;line-height:1;display:inline-flex}.l-menu-submenu{width:100%;display:block;overflow:hidden}.l-submenu-arrow-icon{color:var(--l-menu-arrow-color);transition:transform .3s;position:absolute;top:50%;right:10px;transform:translateY(-50%)rotate(90deg)}.l-menu-submenu.collapsed .l-submenu-arrow-icon{transform:translateY(-50%)rotate(0)}.l-menu--collapsed{display:none}.l-menu--hide{visibility:hidden;pointer-events:none;position:absolute}.l-menu-submenu.active .l-submenu-title{color:var(--l-menu-item-active-color)}:host(.menu--collapsed){width:var(--l-menu-collapsed-width)}:host(.menu--collapsed) .l-submenu-arrow-icon,:host(.menu--collapsed) .l-menu-item--label{display:none}:host(.menu--collapsed) .l-menu-icon-wrap{font-size:var(--l-menu-collapsed-icon-size,var(--l-menu-icon-size,1.8rem))}@media (prefers-reduced-motion:reduce){.l-menu,.l-menu-item,.l-submenu-title,.l-submenu-arrow-icon{transition:none}}", d = 350, f = class extends e {
6
- static baseName = "menu";
7
- _items;
8
- _menuEl;
9
- _activeKeys;
10
- #e;
11
- #t;
12
- #n;
13
- constructor() {
14
- super(), this._items = [], this._activeKeys = /* @__PURE__ */ new Set(), this.#n = /* @__PURE__ */ new Map(), this.#e = /* @__PURE__ */ new Map(), this.#t = /* @__PURE__ */ new Map(), this.version = 2, this._state = { selectedIndex: "" };
15
- }
16
- static get observedAttributes() {
17
- return [
18
- "selected-index",
19
- "accordion",
20
- "collapsed",
21
- "collapsed-width",
22
- "icon-size",
23
- "collapsed-icon-size"
24
- ];
25
- }
26
- attributeChanged(e, r, i) {
27
- switch (e) {
28
- case "selected-index":
29
- this._state.selectedIndex = i || "";
30
- break;
31
- case "accordion":
32
- this._state.accordion = n(i, !1, "accordion");
33
- break;
34
- case "collapsed":
35
- this._state.collapsed = n(i, !1, "collapsed");
36
- break;
37
- case "collapsed-width":
38
- case "icon-size":
39
- case "collapsed-icon-size":
40
- let r = t(e);
41
- this._state[r] = i;
42
- }
43
- }
44
- updateDOM(e) {
45
- if (e.has("collapsed") && (this._state.collapsed ? (this.classList.add("menu--collapsed"), this.#s()) : this.classList.remove("menu--collapsed")), e.has("selected-index") && this.updateSelectedKeys(this._state.selectedIndex), e.has("collapsed-width")) {
46
- let e = r(this._state.collapsedWidth);
47
- this.setStyleProperty("collapsed-width", e);
48
- }
49
- if (e.has("icon-size")) {
50
- let e = r(this._state.iconSize);
51
- this.setStyleProperty("icon-size", e);
52
- }
53
- if (e.has("collapsed-icon-size")) {
54
- let e = r(this._state.collapsedIconSize);
55
- this.setStyleProperty("collapsed-icon-size", e);
56
- }
57
- }
58
- setStyleProperty(e, t) {
59
- let n = `--l-menu-${e}`;
60
- t ? this.style.setProperty(n, t) : this.style.removeProperty(n);
61
- }
62
- afterInit() {
63
- this.classList.add("l-menu", "l-menu--vertical"), l(this.root, "click", this._handleClick), l(this.root, "transitionend", this._onTransitionEnd), this._menuEl = o(".l-menu", this.root);
64
- }
65
- beforeDestroy() {
66
- c(this.root, "click", this._handleClick), c(this.root, "transitionend", this._onTransitionEnd), this.#n.forEach((e) => clearTimeout(e)), this.#n.clear(), this.#e.forEach((e) => cancelAnimationFrame(e)), this.#e.clear(), this.#t.clear(), this._menuEl = void 0;
67
- }
68
- render_v2() {
69
- return {
70
- style: u,
71
- template: a("div", { class: "l-menu" })
72
- };
73
- }
74
- _handleClick = (e) => {
75
- let { type: t, key: n, keyPaths: r, target: i } = this.#r(e.target);
76
- if (i) {
77
- if (t === 2 && !this._state.collapsed) {
78
- let e = i.hasAttribute("expanded");
79
- this._toggleSubMenu(i, !e), !e && this._state.accordion && this.#o(i);
80
- } else t === 1 && (this.#i(r), this.updateSelectedKeys(n), this.emit("select", { detail: {
81
- key: n,
82
- keyPaths: r
83
- } }));
84
- }
85
- };
86
- #r(e, t) {
87
- let n = 0, r = "", i, a = [];
88
- do {
89
- if (!e) break;
90
- let o = e.getAttribute("index");
91
- if (o && (r ||= o, a.unshift(o), t && t(e, o)), n === 0) {
92
- let t = e.getAttribute("menu-role");
93
- t && (n = Number(t), i = e);
94
- }
95
- e = e.parentElement;
96
- } while (n >= 0);
97
- return {
98
- type: n,
99
- key: r,
100
- keyPaths: a,
101
- target: i
102
- };
103
- }
104
- expandSubmenus(e, t = !1) {
105
- let n = i(".l-menu-submenu[index]", this.root), r = new Set(e);
106
- s(n, (e) => {
107
- let n = e.getAttribute("index") || "";
108
- r.has(n) ? this._toggleSubMenu(e, !0) : t && this._toggleSubMenu(e, !1);
109
- });
110
- }
111
- updateSelectedKeys(e) {
112
- this._state.selectedIndex = e;
113
- let t = e ? o(`.l-menu-item[index="${e}"]`, this.root) : null;
114
- if (t) {
115
- let e = this.#r(t, (e) => {
116
- e.classList.add("active"), e.getAttribute("menu-role") === "2" && this._toggleSubMenu(e, !0);
117
- });
118
- this.#i(e.keyPaths);
119
- } else this.#i([]);
120
- }
121
- #i(e) {
122
- let t = i(".l-menu [index].active", this.root), n = new Set(e);
123
- s(t, (e) => {
124
- let t = e.getAttribute("index") || "";
125
- n.has(t) || this.#r(e, (e, t) => {
126
- n.has(t) || e.classList.remove("active");
127
- });
128
- });
129
- }
130
- _toggleSubMenu(e, t) {
131
- let n = e.getAttribute("index") || "", r = o(".l-menu", e);
132
- if (r && t !== e.hasAttribute("expanded")) {
133
- if (this.#a(n), this.#t.set(n, { expand: t }), t) {
134
- e.setAttribute("expanded", ""), e.classList.remove("collapsed"), r.classList.add("l-menu--hide"), r.classList.remove("l-menu--collapsed"), r.style.removeProperty("height");
135
- let t = requestAnimationFrame(() => {
136
- this.#e.delete(n);
137
- let t = r.getBoundingClientRect();
138
- r.style.height = "0", r.classList.remove("l-menu--hide"), requestAnimationFrame(() => {
139
- e.hasAttribute("expanded") && (r.style.height = `${t.height}px`);
140
- });
141
- });
142
- this.#e.set(n, t);
143
- } else {
144
- e.removeAttribute("expanded");
145
- let t = r.getBoundingClientRect();
146
- r.style.height = `${t.height}px`, e.classList.add("collapsed");
147
- let i = requestAnimationFrame(() => {
148
- this.#e.delete(n), e.hasAttribute("expanded") || (r.style.height = "0");
149
- });
150
- this.#e.set(n, i);
151
- }
152
- this.#n.set(n, window.setTimeout(() => {
153
- this.#n.delete(n), this._onTransitionEnd({
154
- target: r,
155
- propertyName: "height"
156
- });
157
- }, d));
158
- }
159
- }
160
- #a(e) {
161
- let t = this.#n.get(e);
162
- t && (clearTimeout(t), this.#n.delete(e));
163
- let n = this.#e.get(e);
164
- n && (cancelAnimationFrame(n), this.#e.delete(e));
165
- }
166
- #o(e) {
167
- let t = e.parentElement;
168
- if (!t) return;
169
- let n = i(".l-menu-submenu[expanded]", t);
170
- s(n, (t) => {
171
- t !== e && this._toggleSubMenu(t, !1);
172
- });
173
- }
174
- #s() {
175
- let e = i(".l-menu-submenu[expanded]", this.root);
176
- s(e, (e) => {
177
- this._toggleSubMenu(e, !1);
178
- });
179
- }
180
- _onTransitionEnd = (e) => {
181
- if (e.propertyName !== "height") return;
182
- let t = e.target;
183
- if (!t.classList.contains("l-menu")) return;
184
- let n = t.closest(".l-menu-submenu");
185
- if (!n) return;
186
- let r = n.getAttribute("index") || "", i = this.#n.get(r);
187
- i && (clearTimeout(i), this.#n.delete(r));
188
- let a = this.#t.get(r);
189
- if (a && a.expand !== n.hasAttribute("expanded")) {
190
- this.#t.delete(r);
191
- return;
192
- }
193
- this.#t.delete(r), t.style.removeProperty("height"), n.hasAttribute("expanded") || t.classList.add("l-menu--collapsed");
194
- };
195
- set items(e) {
196
- this._items = e, this._menuEl && this._menuEl.replaceChildren(this._renderItems());
197
- }
198
- get items() {
199
- return this._items;
200
- }
201
- _renderItems() {
202
- this._activeKeys = this._state.selectedIndex ? new Set(this.#c(this._items, this._state.selectedIndex)) : /* @__PURE__ */ new Set();
203
- let e = document.createDocumentFragment();
204
- for (let t = 0, n = this._items.length; t < n; t++) e.appendChild(this._renderItem(this._items[t], 0));
205
- return e;
206
- }
207
- _renderItem(e, t = 0) {
208
- return e.children && e.children.length > 0 ? this._renderSubMenu(e, t) : this._renderMenuItem(e);
209
- }
210
- _renderMenuItem(e) {
211
- let t = e.label, n = a("div", {
212
- class: ["l-menu-item", this._activeKeys.has(e.key) ? "active" : ""],
213
- index: e.key,
214
- "menu-role": "1",
215
- title: typeof t == "string" ? t : void 0
216
- });
217
- if (e.icon) {
218
- let t = e.icon(e);
219
- t.setAttribute("slot", "icon");
220
- let r = a("span", { class: "l-menu-icon-wrap" });
221
- r.appendChild(t), n.appendChild(r);
222
- }
223
- return n.appendChild(this._renderTitle(e)), n;
224
- }
225
- _renderSubMenu(e, t) {
226
- let n = this._activeKeys.has(e.key), r = a("div", {
227
- index: e.key,
228
- class: [
229
- "l-menu-submenu",
230
- n ? "active" : void 0,
231
- n ? void 0 : "collapsed"
232
- ],
233
- "menu-role": "2"
234
- });
235
- n && r.setAttribute("expanded", ""), r.setAttribute("data-level", String(t));
236
- let i = e.label, o = a("div", {
237
- class: "l-submenu-title",
238
- title: typeof i == "string" ? i : void 0
239
- });
240
- if (e.icon) {
241
- let t = e.icon(e), n = a("span", { class: "l-menu-icon-wrap" });
242
- n.appendChild(t), o.appendChild(n);
243
- }
244
- o.appendChild(this._renderTitle(e));
245
- let s = a("l-arrow-right-icon", { class: "l-submenu-arrow-icon" });
246
- if (o.appendChild(s), r.appendChild(o), e.children) {
247
- let i = a("div", { class: ["l-menu", n ? void 0 : "l-menu--collapsed"] });
248
- i.style.setProperty("--l-menu-level", String(t + 1));
249
- for (let n = 0, r = e.children.length; n < r; n++) i.appendChild(this._renderItem(e.children[n], t + 1));
250
- r.appendChild(i);
251
- }
252
- return r;
253
- }
254
- _renderTitle(e) {
255
- let t;
256
- return t = typeof e.label == "string" ? a("span", { textContent: e.label }) : e.label(e), t.classList.add("l-menu-item--label"), t;
257
- }
258
- #c(e, t) {
259
- let n = (e, r) => {
260
- for (let i of e) {
261
- let e = [...r, i.key];
262
- if (t === i.key) return e;
263
- if (i.children) {
264
- let t = n(i.children, e);
265
- if (t.length > 0) return t;
266
- }
267
- }
268
- return [];
269
- };
270
- return n(e, []);
271
- }
272
- };
273
- //#endregion
274
- export { f as t };
@@ -1,198 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n, unitNumberStr as r } from "./utils/index.js";
3
- import { t as i } from "./mask-Ox6CoyFB.js";
4
- import { $$ as a, $one as o, off as s, on as c, shouldEventNext as l, transition as u } from "ph-utils/browser";
5
- //#region src/components/modal/index.less?inline
6
- var d = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex,100)}.l-modal-wrapper{width:100%;height:100%;z-index:calc(var(--l-modal-zindex,100) + 1);position:fixed;top:0;left:0}.l-modal{--l-modal-translate:translate3d(0, 80px, 0);border-radius:var(--l-modal-border-radius,5px);width:var(--l-modal-width,27%);opacity:1;transform:var(--l-modal-translate) scale3d(1, 1, 1);background-color:#fff;margin:auto;transition:opacity .3s,transform .3s;position:relative;box-shadow:0 0 8px #0000001a}.l-modal-header{padding:var(--l-modal-header-padding,10px);border-bottom:1px solid var(--l-modal-line-color,#0000000f);align-items:center;gap:5px;font-size:16px;font-weight:600;display:flex}.l-modal-footer{padding:var(--l-modal-footer-padding,10px);border-top:1px solid var(--l-modal-line-color,#0000000f);justify-content:flex-end;gap:10px;display:flex}.l-modal-container{padding:var(--l-modal-container-padding,15px 10px);font-size:14px}.l-btn-modal-close{--l-form-control-height:auto;position:absolute}.l-modal-close1{top:8px;right:5px}.l-modal-close1::part(default){border:none;width:auto;height:auto;padding:5px;font-size:16px}.l-modal-close2{top:-10px;right:-10px}.l-modal-close2::part(default){background-color:#fff;width:20px;height:20px;padding:0}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translate(0,0)scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:#0000;justify-content:center;padding:20px 10px 5px;display:flex}.l-modal--mobile .l-modal-container{--l-modal-container-padding:5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{text-align:center;justify-content:stretch;align-items:stretch;gap:0;height:50px;padding:0;display:flex}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color,#0000000f)}.l-modal--middle{--l-modal-translate:translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate:translate3d(0, -100%, 0);border-bottom-right-radius:0;border-bottom-left-radius:0;width:100%;top:100%}@media screen and (width<=768px){:host{--l-modal-width:80%}}", f = class extends e {
7
- static baseName = "modal";
8
- _bodyOverflow = "";
9
- constructor() {
10
- super(), this.version = 2, this._state = {
11
- destroyOnClose: !1,
12
- maskClosable: !0,
13
- mask: !0,
14
- cancel: !0,
15
- cancelText: "取消",
16
- okText: "确定",
17
- confirmLoading: !1,
18
- close: 1,
19
- verticalAlign: "top",
20
- mobile: !1,
21
- show: !1,
22
- header: !0,
23
- footer: !0
24
- };
25
- }
26
- static get observedAttributes() {
27
- return [
28
- "show",
29
- "width",
30
- "confirm-loading",
31
- "destroy-on-close",
32
- "mask-closable",
33
- "mask",
34
- "cancel",
35
- "cancel-text",
36
- "ok-text",
37
- "close",
38
- "vertical-align",
39
- "mobile",
40
- "z-index",
41
- "header",
42
- "footer",
43
- "header-title"
44
- ];
45
- }
46
- attributeChanged(e, i, a) {
47
- switch (e) {
48
- case "show":
49
- case "confirm-loading":
50
- case "destroy-on-close":
51
- case "mask-closable":
52
- case "mask":
53
- case "cancel":
54
- case "mobile":
55
- case "header":
56
- case "footer":
57
- this._state[t(e)] = n(a, !1, e);
58
- break;
59
- case "cancel-text":
60
- this._state.cancelText = n(a, "取消");
61
- break;
62
- case "ok-text":
63
- this._state.okText = n(a, "确定");
64
- break;
65
- case "close":
66
- this._state.close = n(a, 1);
67
- break;
68
- case "width":
69
- this._state[e] = r(a);
70
- break;
71
- case "vertical-align":
72
- this._state.verticalAlign = n(a, "top");
73
- break;
74
- case "z-index":
75
- this._state.zIndex = a;
76
- break;
77
- case "header-title": this._state.headerTitle = a;
78
- }
79
- }
80
- updateDOM(e) {
81
- if (e.has("show") && (this._state.show ? this.#e() : this.#t()), e.has("width") && this._setWidth(), e.has("confirm-loading")) {
82
- let e = o("l-button[modal-action=\"ok\"]", this.root);
83
- e && e.setAttribute("loading", this._state.confirmLoading.toString());
84
- }
85
- e.has("z-index") && this._setZIndex();
86
- }
87
- afterInit() {
88
- this._setWidth(), this._setZIndex(), this._state.show && this.#e();
89
- }
90
- render_v2() {
91
- return {
92
- style: [d],
93
- styleSheets: [i]
94
- };
95
- }
96
- _setZIndex() {
97
- this._state.zIndex ? this.style.setProperty("--l-modal-zindex", this._state.zIndex) : this.style.removeProperty("--l-modal-zindex");
98
- }
99
- _setWidth() {
100
- this._state.width ? this.style.setProperty("--l-modal-width", this._state.width) : this.style.removeProperty("--l-modal-width");
101
- }
102
- #e() {
103
- this._bodyOverflow = getComputedStyle(document.body).overflow, this.classList.add("open"), document.body.style.overflow = "hidden";
104
- let e = o(".l-modal-wrapper", this.root);
105
- if (e) {
106
- let e = o(".l-mask", this.root);
107
- e && u(e, "mask-transition");
108
- let t = o(".l-modal", this.root);
109
- u(t, "modal-transition");
110
- } else {
111
- let t = document.createDocumentFragment(), n = null;
112
- this._state.mask && (n = a("div", {
113
- class: "l-mask l-modal-mask",
114
- part: "mask"
115
- }), t.appendChild(n)), e = a("div", {
116
- class: "l-modal-wrapper",
117
- part: "wrapper"
118
- });
119
- let r = a("div", {
120
- class: [
121
- "l-modal",
122
- `l-modal--${this._state.mobile ? "mobile" : "pc"}`,
123
- `l-modal--${this._state.verticalAlign}`
124
- ],
125
- part: "default"
126
- });
127
- if (r.setAttribute("modal-action", "modal"), this._state.close !== 0) {
128
- let e = a("l-button", {
129
- shape: "circle",
130
- type: "normal",
131
- class: `l-btn-modal-close l-modal-close${this._state.close}`,
132
- "modal-action": "close",
133
- part: "close-btn"
134
- }), t = a("l-close-icon");
135
- e.appendChild(t), r.appendChild(e);
136
- }
137
- if (this._state.header) {
138
- let e = a("header", {
139
- class: "l-modal-header",
140
- part: "header"
141
- }), t = a("slot", { name: "header" });
142
- t.textContent = this._state.headerTitle || "", e.appendChild(t), r.appendChild(e);
143
- }
144
- let i = a("div", {
145
- class: "l-modal-container",
146
- part: "container"
147
- }), o = a("slot");
148
- if (i.appendChild(o), r.appendChild(i), this._state.footer) {
149
- let e = a("footer", {
150
- class: "l-modal-footer",
151
- part: "footer"
152
- }), t = a("slot", { name: "footer" });
153
- if (this._state.cancel) {
154
- let e = a("l-button", {
155
- class: "l-modal-footer-btn",
156
- text: this._state.mobile
157
- });
158
- e.textContent = this._state.cancelText, e.setAttribute("modal-action", "cancel"), t.appendChild(e);
159
- }
160
- let n = a("l-button", {
161
- type: "primary",
162
- class: "l-modal-footer-btn",
163
- loading: this._state.confirmLoading,
164
- text: this._state.mobile
165
- });
166
- n.textContent = this._state.okText, n.setAttribute("modal-action", "ok"), t.appendChild(n), e.appendChild(t), r.appendChild(e);
167
- }
168
- e.appendChild(r), e.setAttribute("role", "dialog"), e.setAttribute("modal-action", "mask"), c(e, "click", this.#r), t.appendChild(e), this.appendToRoot(t), u(r, "modal-transition"), n && u(n, "mask-transition");
169
- }
170
- }
171
- #t() {
172
- document.body.style.setProperty("overflow", this._bodyOverflow);
173
- let e = o(".l-modal", this.root);
174
- u(e, "modal-transition", "leave", () => {
175
- this._state.destroyOnClose && this.#n(), this.classList.remove("open"), this.emit("close");
176
- });
177
- let t = o(".l-mask", this.root);
178
- t && u(t, "mask-transition", "leave");
179
- }
180
- disconnectedCallback() {
181
- this.#n(), super.disconnectedCallback();
182
- }
183
- #n() {
184
- let e = o(".l-modal-wrapper", this.root);
185
- e && (s(e, "click", this.#r), this.root.removeChild(e));
186
- let t = o(".l-mask", this.root);
187
- t && this.root.removeChild(t);
188
- }
189
- #r = (e) => {
190
- let [t, n] = l(e, "modal-action", this.root);
191
- if (t) {
192
- let e = "";
193
- this._state.maskClosable && n === "mask" || n === "cancel" || n === "close" ? e = "cancel" : n === "ok" && (e = "ok"), e && this.dispatchEvent(new CustomEvent(e, { detail: { action: n } }));
194
- }
195
- };
196
- };
197
- //#endregion
198
- export { f as t };