litos-ui 0.20.1 → 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 (421) 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 +11 -11
  45. package/lib/dialog/dialog_container.css_inline.js +4 -0
  46. package/lib/dialog/dialog_container.d.ts +1 -1
  47. package/lib/dialog/dialog_container.js +156 -2
  48. package/lib/dialog/dialog_container_style.d.ts +2 -0
  49. package/lib/dialog/dialog_container_style.js +6 -0
  50. package/lib/dialog/index.js +1 -1
  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.d.ts +7 -0
  186. package/lib/entries/notification.js +6 -0
  187. package/lib/entries/page-header.d.ts +4 -0
  188. package/lib/entries/page-header.js +6 -0
  189. package/lib/entries/pagination.d.ts +9 -0
  190. package/lib/entries/pagination.js +6 -0
  191. package/lib/entries/polygon.d.ts +2 -0
  192. package/lib/entries/polygon.js +6 -0
  193. package/lib/entries/popconfirm.d.ts +3 -0
  194. package/lib/entries/popconfirm.js +2 -0
  195. package/lib/entries/popover.d.ts +1 -0
  196. package/lib/entries/popover.js +2 -0
  197. package/lib/entries/qrcode.d.ts +2 -0
  198. package/lib/entries/qrcode.js +6 -0
  199. package/lib/entries/radio-group.d.ts +3 -0
  200. package/lib/entries/radio-group.js +6 -0
  201. package/lib/entries/radio.d.ts +2 -0
  202. package/lib/entries/radio.js +6 -0
  203. package/lib/entries/select-ori.d.ts +2 -0
  204. package/lib/entries/select-ori.js +6 -0
  205. package/lib/entries/select.d.ts +4 -0
  206. package/lib/entries/select.js +6 -0
  207. package/lib/entries/space.d.ts +2 -0
  208. package/lib/entries/space.js +6 -0
  209. package/lib/entries/switch.d.ts +2 -0
  210. package/lib/entries/switch.js +6 -0
  211. package/lib/entries/tabbar-item.d.ts +2 -0
  212. package/lib/entries/tabbar-item.js +6 -0
  213. package/lib/entries/tabbar.d.ts +3 -0
  214. package/lib/entries/tabbar.js +6 -0
  215. package/lib/entries/table.d.ts +3 -0
  216. package/lib/entries/table.js +6 -0
  217. package/lib/entries/tabs.d.ts +3 -0
  218. package/lib/entries/tabs.js +2 -0
  219. package/lib/entries/tag.d.ts +2 -0
  220. package/lib/entries/tag.js +6 -0
  221. package/lib/entries/theme-color.d.ts +3 -0
  222. package/lib/entries/theme-color.js +6 -0
  223. package/lib/entries/theme.d.ts +9 -0
  224. package/lib/entries/theme.js +6 -0
  225. package/lib/entries/transition.d.ts +1 -0
  226. package/lib/entries/transition.js +2 -0
  227. package/lib/entries/upload.d.ts +3 -0
  228. package/lib/entries/upload.js +6 -0
  229. package/lib/entries/utils.d.ts +1 -0
  230. package/lib/entries/utils.js +2 -0
  231. package/lib/form/form_inner.d.ts +1 -0
  232. package/lib/{form_inner-Cnwb6f_Q.js → form/form_inner.js} +9 -9
  233. package/lib/form/form_item.d.ts +2 -1
  234. package/lib/form/form_item.js +148 -2
  235. package/lib/form/form_item.less_inline.js +4 -0
  236. package/lib/form/index.d.ts +3 -2
  237. package/lib/form/index.js +191 -2
  238. package/lib/form/index.less_inline.js +4 -0
  239. package/lib/icon/arrow_down.js +1 -1
  240. package/lib/icon/arrow_left.js +1 -1
  241. package/lib/icon/arrow_right.js +1 -1
  242. package/lib/icon/arrow_up.js +1 -1
  243. package/lib/icon/base.d.ts +2 -1
  244. package/lib/icon/base.js +63 -2
  245. package/lib/icon/calendar.js +1 -1
  246. package/lib/icon/caret_bottom.js +1 -1
  247. package/lib/icon/caret_top.js +1 -1
  248. package/lib/icon/close.js +1 -1
  249. package/lib/icon/close_filled.js +1 -1
  250. package/lib/icon/copy.d.ts +6 -0
  251. package/lib/icon/copy.js +13 -0
  252. package/lib/icon/d_arrow_left.js +1 -1
  253. package/lib/icon/d_arrow_right.js +1 -1
  254. package/lib/icon/delete.d.ts +5 -0
  255. package/lib/icon/delete.js +10 -0
  256. package/lib/icon/eye_outline.d.ts +6 -0
  257. package/lib/icon/eye_outline.js +13 -0
  258. package/lib/icon/font_icon.js +1 -1
  259. package/lib/icon/icon_style.d.ts +2 -0
  260. package/lib/icon/icon_style.js +6 -0
  261. package/lib/icon/index.less_inline.js +4 -0
  262. package/lib/icon/info.js +1 -1
  263. package/lib/icon/loading.js +1 -1
  264. package/lib/icon/minus.d.ts +5 -0
  265. package/lib/icon/minus.js +10 -0
  266. package/lib/icon/moon.js +1 -1
  267. package/lib/icon/more.js +1 -1
  268. package/lib/icon/picture.d.ts +5 -0
  269. package/lib/icon/picture.js +10 -0
  270. package/lib/icon/plus.d.ts +5 -0
  271. package/lib/icon/plus.js +10 -0
  272. package/lib/icon/reduction.js +1 -1
  273. package/lib/icon/refresh.js +1 -1
  274. package/lib/icon/refresh_left.js +1 -1
  275. package/lib/icon/refresh_right.js +1 -1
  276. package/lib/icon/search.js +1 -1
  277. package/lib/icon/select.js +1 -1
  278. package/lib/icon/sort.js +1 -1
  279. package/lib/icon/success.js +1 -1
  280. package/lib/icon/sun.js +1 -1
  281. package/lib/icon/theme_default.js +1 -1
  282. package/lib/icon/warn.js +1 -1
  283. package/lib/icon/zoom_in.js +1 -1
  284. package/lib/icon/zoom_out.js +1 -1
  285. package/lib/image/image_preview.js +91 -2
  286. package/lib/image/image_preview.less_inline.js +4 -0
  287. package/lib/image/index.js +163 -2
  288. package/lib/image/index.less_inline.js +4 -0
  289. package/lib/index.d.ts +14 -0
  290. package/lib/index.js +75 -65
  291. package/lib/input/index.js +4 -4
  292. package/lib/{input-DUBlLEXS.js → input/index.less_inline.js} +1 -1
  293. package/lib/{input_inner-x4GfLGjj.js → input/input_inner.less_inline.js} +1 -1
  294. package/lib/input_number/index.d.ts +59 -0
  295. package/lib/input_number/index.js +203 -0
  296. package/lib/input_number/index.less_inline.js +4 -0
  297. package/lib/input_number/style.d.ts +2 -0
  298. package/lib/input_number/style.js +6 -0
  299. package/lib/list/index.js +52 -2
  300. package/lib/list/index.less_inline.js +4 -0
  301. package/lib/loading/index.js +1 -1
  302. package/lib/mask/index.d.ts +1 -1
  303. package/lib/mask/index.js +109 -2
  304. package/lib/mask/index.less_inline.js +4 -0
  305. package/lib/md_input/index.js +59 -2
  306. package/lib/md_input/index.less_inline.js +4 -0
  307. package/lib/menu/index.js +275 -2
  308. package/lib/menu/index.less_inline.js +4 -0
  309. package/lib/message/index.js +1 -1
  310. package/lib/modal/index.js +199 -2
  311. package/lib/modal/index.less_inline.js +4 -0
  312. package/lib/modal/modal_box.d.ts +22 -0
  313. package/lib/modal/modal_box.js +21 -22
  314. package/lib/notification/index.d.ts +212 -0
  315. package/lib/notification/index.js +380 -0
  316. package/lib/notification/index.less_inline.js +4 -0
  317. package/lib/notification/placement.d.ts +49 -0
  318. package/lib/notification/placement.js +48 -0
  319. package/lib/notification/style.d.ts +2 -0
  320. package/lib/notification/style.js +6 -0
  321. package/lib/page_header/index.js +100 -2
  322. package/lib/page_header/index.less_inline.js +4 -0
  323. package/lib/pagination/index.js +214 -2
  324. package/lib/pagination/index.less_inline.js +4 -0
  325. package/lib/polygon/index.js +21 -2
  326. package/lib/{polygon-DhhovlrG.js → polygon/index.less_inline.js} +2 -18
  327. package/lib/qrcode/index.js +65 -2
  328. package/lib/qrcode/index.less_inline.js +4 -0
  329. package/lib/select/index.js +355 -3
  330. package/lib/select/index.less_inline.js +4 -0
  331. package/lib/select_ori/index.js +58 -2
  332. package/lib/select_ori/index.less_inline.js +4 -0
  333. package/lib/space/index.js +40 -2
  334. package/lib/space/index.less_inline.js +4 -0
  335. package/lib/{animation-Bo4jbSGK.js → styles/animation/index.css_inline.js} +2 -3
  336. package/lib/styles/animation/index.js +6 -2
  337. package/lib/{mask-Ox6CoyFB.js → styles/mask/index.css_inline.js} +2 -3
  338. package/lib/styles/mask/index.js +6 -2
  339. package/lib/switch/index.js +51 -2
  340. package/lib/switch/index.less_inline.js +4 -0
  341. package/lib/tabbar/index.js +97 -2
  342. package/lib/tabbar/index.less_inline.js +4 -0
  343. package/lib/tabbar/item.js +61 -2
  344. package/lib/tabbar/item.less_inline.js +4 -0
  345. package/lib/table/index.js +234 -2
  346. package/lib/table/index.less_inline.js +4 -0
  347. package/lib/tabs/index.js +1 -1
  348. package/lib/tag/index.js +75 -2
  349. package/lib/tag/index.less_inline.js +4 -0
  350. package/lib/theme/index.js +86 -2
  351. package/lib/theme/index.less_inline.js +4 -0
  352. package/lib/theme/theme_color.js +1 -1
  353. package/lib/upload/index.d.ts +170 -0
  354. package/lib/upload/index.js +848 -0
  355. package/lib/upload/index.less_inline.js +4 -0
  356. package/lib/upload/style.d.ts +2 -0
  357. package/lib/upload/style.js +6 -0
  358. package/lib/utils/context_provide.d.ts +1 -0
  359. package/lib/utils/context_provide.js +1 -1
  360. package/lib/utils/event.d.ts +30 -0
  361. package/lib/utils/index.d.ts +3 -0
  362. package/lib/utils/index.js +1 -1
  363. package/lib/utils/popover.js +1 -1
  364. package/lib/utils/signal_types.d.ts +5 -0
  365. package/lib/utils/transition.d.ts +28 -0
  366. package/lib/utils/transition.js +1 -1
  367. package/package.json +39 -18
  368. package/styles/animation.css +2 -2
  369. package/styles/container.css +8 -8
  370. package/styles/datepicker.css +9 -9
  371. package/styles/dialog.css +7 -7
  372. package/styles/loading.css +17 -17
  373. package/styles/message.css +9 -9
  374. package/styles/modal_box.css +3 -3
  375. package/styles/notification.css +17 -0
  376. package/styles/popover.css +11 -14
  377. package/styles/reset.css +13 -15
  378. package/styles/scrollbar.css +5 -5
  379. package/styles/select.css +6 -6
  380. package/styles/tabs.css +3 -3
  381. package/styles/theme-coral.css +35 -0
  382. package/styles/theme-jade.css +35 -0
  383. package/styles/theme-tangerine.css +35 -0
  384. package/styles/transition.css +1 -1
  385. package/styles/vars.css +41 -7
  386. package/lib/base-Dyj1rzaK.js +0 -61
  387. package/lib/calendar-CvlUsN6w.js +0 -146
  388. package/lib/card-3DM-lJQV.js +0 -63
  389. package/lib/carousel-DvkZ1YXq.js +0 -276
  390. package/lib/check-doQ2ZpQj.js +0 -117
  391. package/lib/collapse-B6-Rn05A.js +0 -102
  392. package/lib/color_picker-0a-IGZY9.js +0 -41
  393. package/lib/date_picker-BDN2PAz5.js +0 -99
  394. package/lib/date_picker_ori-BXFs1eET.js +0 -120
  395. package/lib/description_panel--AKXBzLL.js +0 -53
  396. package/lib/dialog_container-BNPQ9n0V.js +0 -145
  397. package/lib/esm-DAha108i.js +0 -270
  398. package/lib/form-DJxvBiLy.js +0 -190
  399. package/lib/form_item-BqPMRABd.js +0 -147
  400. package/lib/image-CVQai6NX.js +0 -162
  401. package/lib/image_preview-DfQAKSJH.js +0 -90
  402. package/lib/item-CQ2Sknbz.js +0 -14
  403. package/lib/item-DI6mQXtB.js +0 -117
  404. package/lib/item-D_ZOPXuE.js +0 -60
  405. package/lib/list-MG8PRzos.js +0 -51
  406. package/lib/mask-Bx-yNIJv.js +0 -108
  407. package/lib/md_input-BX3bujz8.js +0 -58
  408. package/lib/menu-DKscK5mw.js +0 -274
  409. package/lib/modal-Cwi3qlEf.js +0 -198
  410. package/lib/page_header-ujV3pncE.js +0 -99
  411. package/lib/pagination-aRbGd3Rf.js +0 -213
  412. package/lib/qrcode-Dip8uLSA.js +0 -64
  413. package/lib/select-BZMDj5VE.js +0 -354
  414. package/lib/select_ori-C7sUZxen.js +0 -57
  415. package/lib/space-CKuTk0YB.js +0 -39
  416. package/lib/switch-wh2-ivty.js +0 -50
  417. package/lib/tabbar-CBXK-_AV.js +0 -96
  418. package/lib/table-BQxMD2Ae.js +0 -233
  419. package/lib/tag-Di1z9PoZ.js +0 -74
  420. package/lib/theme-CLbBS-in.js +0 -85
  421. package/styles/dark.css +0 -13
@@ -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 };
@@ -1,99 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n } from "./utils/index.js";
3
- import { $$ as r, off as i, on as a, shouldEventNext as o } from "ph-utils/browser";
4
- import { isBlank as s } from "ph-utils";
5
- //#region src/components/page_header/index.less?inline
6
- var c = ":host{box-sizing:border-box;height:var(--l-page-header-height,auto);align-items:center;display:flex;position:relative}.l-page-header-left,.l-page-header-right{z-index:1;flex:none;align-items:center;display:flex}.l-page-header-back{height:auto}.l-page-header-back::part(default){--l-btn-padding:5px 0}.l-page-header-content{align-items:center;line-height:1;display:flex}.l-page-header-title{font-size:16px;font-weight:600}.l-page-header-sub-title{color:#999;margin-left:10px;font-size:14px;font-weight:500}:host(.l-page-header-align-left) .l-page-header-left{margin-right:15px}:host(.l-page-header-align-left) .l-page-header-content{flex:1 0 auto}:host(.l-page-header-align-left) .l-page-header-right{margin-left:15px}:host(.l-page-header-align-center){justify-content:space-between}:host(.l-page-header-align-center) .l-page-header-content{justify-content:center;position:absolute;inset:0}:host(.l-page-header-align-center) .l-page-header-back::part(default){--l-btn-padding:8px 0;--l-btn-gap:0}:host(.l-page-header-border){border-bottom:1px solid var(--l-border-color,#dedede)}", l = class extends e {
7
- static baseName = "page-header";
8
- showLeft = !0;
9
- showBack = !0;
10
- backText = "返回";
11
- pageTitle;
12
- pageSubTitle;
13
- align = "left";
14
- showRight = !0;
15
- border = !1;
16
- height;
17
- connectedCallback() {
18
- this.loadStyleText(c), this.classList.add(`l-page-header-align-${this.align}`), super.connectedCallback();
19
- }
20
- static get observedAttributes() {
21
- return [
22
- "show-left",
23
- "show-back",
24
- "back-text",
25
- "page-title",
26
- "page-sub-title",
27
- "align",
28
- "show-right",
29
- "border",
30
- "height"
31
- ];
32
- }
33
- attributeChangedCallback(e, r, i) {
34
- e = t(e);
35
- let a = n(i, this[e], e);
36
- switch (a !== this[e] && (this[e] = a), e) {
37
- case "border":
38
- a ? this.classList.add("l-page-header-border") : this.classList.remove("l-page-header-border");
39
- break;
40
- case "height": a && this.style.setProperty("--l-page-header-height", a);
41
- }
42
- }
43
- render() {
44
- let e = document.createDocumentFragment();
45
- if (this.showLeft) {
46
- let t = r("div", { class: "l-page-header-left" });
47
- if (this.showBack) {
48
- let e = r("l-button", {
49
- text: !0,
50
- class: "l-page-header-back",
51
- "l-action": "back",
52
- innerHTML: `<l-arrow-left-icon></l-arrow-left-icon><span>${this.backText}</span>`
53
- });
54
- t.appendChild(e);
55
- }
56
- let n = r("slot", { name: "left" });
57
- t.appendChild(n), e.appendChild(t);
58
- }
59
- let t = r("div", { class: "l-page-header-content" });
60
- if (!s(this.pageTitle)) {
61
- let e = r("div", {
62
- class: "l-page-header-title",
63
- innerHTML: this.pageTitle
64
- });
65
- t.appendChild(e);
66
- }
67
- if (!s(this.pageSubTitle)) {
68
- let e = r("div", {
69
- class: "l-page-header-sub-title",
70
- innerHTML: this.pageSubTitle
71
- });
72
- t.appendChild(e);
73
- }
74
- let n = r("slot");
75
- if (t.appendChild(n), e.appendChild(t), this.showRight) {
76
- let t = r("div", { class: "l-page-header-right" }), n = r("slot", { name: "right" });
77
- t.appendChild(n), e.appendChild(t);
78
- }
79
- return e;
80
- }
81
- #e = (e) => {
82
- let [t, n, r] = o(e, "l-action", this.root);
83
- if (t) {
84
- let e = r.dataset;
85
- this.emit("action", { detail: {
86
- action: n,
87
- ...e
88
- } });
89
- }
90
- };
91
- afterInit() {
92
- a(this.root, "click", this.#e);
93
- }
94
- beforeDestroy() {
95
- i(this.root, "click", this.#e);
96
- }
97
- };
98
- //#endregion
99
- export { l as t };
@@ -1,213 +0,0 @@
1
- import e from "./base.js";
2
- import { kebabToCamel as t, parseAttrValue as n, tagAttr as r } from "./utils/index.js";
3
- import { $one as i, clsx as a, off as o, on as s, shouldEventNext as c } from "ph-utils/browser";
4
- //#region src/components/pagination/index.less?inline
5
- var l = ":host{white-space:nowrap;color:#333;font-size:14px;line-height:1}.l-pagination{align-items:center;justify-content:var(--l-pagination-justify-content,flex-start);display:flex}.l-pagination-item{box-sizing:border-box;width:30px;height:30px}.l-pagination-item+.l-pagination-item{margin-left:5px}.l-pagination--btn{--l-btn-padding:0}.l-pagination--link{color:#666;cursor:pointer;border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;text-decoration:none;transition:color .3s,border-color .3s;display:inline-flex}.l-pagination--link.active{color:var(--l-primary-color,#722ed1);border-color:var(--l-primary-color,#722ed1)}.darrow-icon{display:none}.more-icon{display:inline-block}.l-pagination--link:hover{color:var(--l-primary-color-light1,#9254de)}.l-pagination--link:hover .darrow-icon{display:inline-block}.l-pagination--link:hover .more-icon{display:none}.l-pagination--link:active{color:var(--l-primary-color-light1,#9254de)}.l-pagination-simple-layout{align-items:center;width:auto;display:inline-flex}.l-pagination-simple-input{--l-form-control-height:30px;box-sizing:border-box;text-align:center;width:60px}.l-pagination-simple-divide{margin:0 5px}", u = class extends e {
6
- static baseName = "pagination";
7
- constructor() {
8
- super(), this.version = 2, this._state = {
9
- total: 0,
10
- pageCount: 0,
11
- pageSize: 10,
12
- align: "start",
13
- simple: !1,
14
- hideOnSinglePage: !1,
15
- currentPage: 1
16
- };
17
- }
18
- static get observedAttributes() {
19
- return [
20
- "align",
21
- "current-page",
22
- "page-count",
23
- "total",
24
- "hide-on-single-page",
25
- "simple",
26
- "page-size"
27
- ];
28
- }
29
- attributeChanged(e, r, i) {
30
- switch (e) {
31
- case "align":
32
- this._state.align = i || "start";
33
- break;
34
- case "total":
35
- case "page-count":
36
- case "page-size":
37
- case "current-page":
38
- let r = n(i, this._state[e]);
39
- this._state[t(e)] = r, (e === "total" || e === "page-count") && (this._state.pageCount = this.#t());
40
- break;
41
- case "simple":
42
- case "hide-on-single-page": this._state[t(e)] = n(i, !1, e);
43
- }
44
- }
45
- updateDOM(e) {
46
- if (e.has("align")) {
47
- let e = this._state.align === "center" ? this._state.align : `flex-${this._state.align}`;
48
- this.style.setProperty("--l-pagination-justify-content", e);
49
- } else this.rerender(), e.clear();
50
- }
51
- rerender() {
52
- let e = i(".l-pagination", this.root);
53
- e && (this.#i(), e.innerHTML = this.#n(), this.#r());
54
- }
55
- render() {
56
- return `<div class="l-pagination">${this.#n()}</div>`;
57
- }
58
- render_v2() {
59
- return {
60
- template: this.render(),
61
- style: l
62
- };
63
- }
64
- afterInit() {
65
- s(this.root, "click", this.#e), this.#r();
66
- }
67
- beforeDestroy() {
68
- o(this.root, "click", this.#e), this.#i();
69
- }
70
- #e = (e) => {
71
- let [t, n] = c(e, "data-page", this.root);
72
- if (t) {
73
- let e = Number(n);
74
- e = Math.min(this._state.pageCount, Math.max(1, e)), e !== this._state.currentPage && (this._state.currentPage = e, this.rerender(), this.emit("change", { detail: {
75
- current: e,
76
- pageSize: this._state.pageSize || 10,
77
- totalPage: this._state.pageCount
78
- } }));
79
- }
80
- };
81
- #t() {
82
- let e = this._state.pageCount, t = this._state.total;
83
- return e === 0 && t > 0 && (e = Math.ceil(t / (this._state.pageSize || 10))), e;
84
- }
85
- #n() {
86
- if (this._state.pageCount <= 1) return "";
87
- let e = [];
88
- if (e.push(this.#c("l-button", {
89
- title: "上一页",
90
- disabled: this._state.currentPage === 1,
91
- "data-page": this._state.currentPage - 1,
92
- innerHTML: "<l-arrow-left-icon></l-arrow-left-icon>",
93
- class: [
94
- "l-pagination-item",
95
- "l-pagination--btn",
96
- "prev-btn"
97
- ]
98
- })), this._state.simple) e.push(this.#c("div", {
99
- class: ["l-pagination-item", "l-pagination-simple-layout"],
100
- innerHTML: [
101
- this.#c("l-input", {
102
- inputmode: "numeric",
103
- value: `${this._state.currentPage}`,
104
- class: ["l-pagination-simple-input"],
105
- "allow-input": "integer"
106
- }),
107
- "<span class=\"l-pagination-simple-divide\">/</span>",
108
- `<span>${this._state.pageCount}</span>`
109
- ]
110
- }));
111
- else {
112
- e.push(this.#c("a", {
113
- title: "1",
114
- innerHTML: "1",
115
- class: [
116
- "l-pagination-item",
117
- "l-pagination--link",
118
- this._state.currentPage === 1 ? "active" : ""
119
- ],
120
- "data-page": "1"
121
- })), this._state.currentPage > 4 && e.push(this.#c("a", {
122
- title: "上5页",
123
- innerHTML: ["<l-d-arrow-left-icon class='darrow-icon'></l-d-arrow-left-icon>", "<l-more-icon class='more-icon'></l-more-icon>"],
124
- class: ["l-pagination-item", "l-pagination--link"],
125
- "data-page": `${this._state.currentPage - 5}`
126
- }));
127
- let t = Math.max(this._state.currentPage - 2, 1), n = Math.min(this._state.currentPage + 2, this._state.pageCount), r = n - t;
128
- r < 4 && (n = Math.min(this._state.pageCount, n + (4 - r))), r = n - t, r < 4 && (t = Math.max(1, t - (4 - r)));
129
- for (let r = t; r <= n; r++) if (!(r <= 1)) {
130
- if (r >= this._state.pageCount) break;
131
- e.push(this.#c("a", {
132
- title: `${r}`,
133
- innerHTML: `${r}`,
134
- class: [
135
- "l-pagination-item",
136
- "l-pagination--link",
137
- this._state.currentPage === r ? "active" : ""
138
- ],
139
- "data-page": `${r}`
140
- }));
141
- }
142
- this._state.currentPage < this._state.pageCount - 3 && e.push(this.#c("a", {
143
- title: "下5页",
144
- innerHTML: ["<l-d-arrow-right-icon class='darrow-icon'></l-d-arrow-right-icon>", "<l-more-icon class='more-icon'></l-more-icon>"],
145
- class: ["l-pagination-item", "l-pagination--link"],
146
- "data-page": `${this._state.currentPage + 5}`
147
- })), this._state.pageCount > 1 && e.push(this.#c("a", {
148
- title: `${this._state.pageCount}`,
149
- innerHTML: `${this._state.pageCount}`,
150
- class: [
151
- "l-pagination-item",
152
- "l-pagination--link",
153
- this._state.currentPage === this._state.pageCount ? "active" : ""
154
- ],
155
- "data-page": `${this._state.pageCount}`
156
- }));
157
- }
158
- return e.push(this.#c("l-button", {
159
- title: `${this._state.currentPage + 1}`,
160
- innerHTML: "<l-arrow-right-icon></l-arrow-right-icon>",
161
- class: [
162
- "l-pagination-item",
163
- "l-pagination--btn",
164
- "next-btn"
165
- ],
166
- disabled: this._state.currentPage === this._state.pageCount,
167
- "data-page": `${this._state.currentPage + 1}`
168
- })), e.join("");
169
- }
170
- #r() {
171
- let e = i(".l-pagination-simple-input", this.root);
172
- e && (e.setParser(this.#s), s(e, "keyup", this.#o), s(e, "blur", this.#a));
173
- }
174
- #i() {
175
- let e = i(".l-pagination-simple-input", this.root);
176
- e && (e.setParser(void 0), o(e, "keyup", this.#o), o(e, "blur", this.#a));
177
- }
178
- #a = (e) => {
179
- let t = e.target, n = t.value;
180
- if (!n) {
181
- t.value = `${this._state.currentPage}`;
182
- return;
183
- }
184
- this._state.currentPage = Number(n), this.rerender();
185
- };
186
- #o = (e) => {
187
- if (e.key === "Enter") {
188
- let t = e.target.value;
189
- if (t) {
190
- let e = Number(t);
191
- this._state.currentPage = e, this.rerender();
192
- }
193
- }
194
- };
195
- #s = (e) => {
196
- if (e) {
197
- let t = Number(e);
198
- t = Math.max(1, Math.min(this._state.pageCount, t)), e = String(t);
199
- }
200
- return e;
201
- };
202
- #c(e = "a", t) {
203
- let n = [], i = "";
204
- for (let e in t) if (e === "innerHTML") i = t[e], Array.isArray(i) && (i = i.join(""));
205
- else if (e === "class") {
206
- let e = t.class;
207
- n.push(` class="${a(e)}"`);
208
- } else n.push(r(e, t[e]));
209
- return `<${e}${n.join("")}>${i}</${e}>`;
210
- }
211
- };
212
- //#endregion
213
- export { u as t };
@@ -1,64 +0,0 @@
1
- import e from "./base.js";
2
- import { $one as t } from "ph-utils/browser";
3
- import { QRCodeRender as n, renderToCanvas as r } from "qrcode-generator-es";
4
- //#region src/components/qrcode/index.less?inline
5
- var i = ":host,.renderer-el{display:inline-flex}", a = class extends e {
6
- static baseName = "qrcode";
7
- _qrcode;
8
- constructor() {
9
- super(), this.version = 2;
10
- }
11
- connectedCallback() {
12
- this.loadStyleText(i), super.connectedCallback();
13
- }
14
- static get observedAttributes() {
15
- return [
16
- "text",
17
- "fill",
18
- "size",
19
- "level",
20
- "icon"
21
- ];
22
- }
23
- attributeChanged(e, t, n) {
24
- t !== n && (this._state[e] = n, this.#e(e, n));
25
- }
26
- updateDOM() {
27
- this.#t();
28
- }
29
- afterInit() {
30
- this.#t();
31
- }
32
- beforeDestroy() {
33
- this._qrcode &&= (this._qrcode.destroy(), void 0);
34
- }
35
- #e(e, t) {
36
- this._qrcode && (e === "icon" ? this._qrcode.option.icon = t ? { src: t } : void 0 : this._qrcode.option[e] = t);
37
- }
38
- #t() {
39
- if (!this._qrcode) {
40
- let e = t("canvas", this.root);
41
- e && (this._qrcode = new n({
42
- renderFn: r,
43
- text: this._state.text,
44
- size: Number(this._state.size || 120),
45
- level: this._state.level || "M",
46
- fill: this._state.fill || "#000000",
47
- icon: this._state.icon ? { src: this._state.icon } : void 0,
48
- el: e
49
- }));
50
- }
51
- this._qrcode != null && this._state.text && this._qrcode.render();
52
- }
53
- render_v2() {
54
- return {
55
- template: this.render(),
56
- style: i
57
- };
58
- }
59
- render() {
60
- return "<canvas class='renderer-el'></canvas>";
61
- }
62
- };
63
- //#endregion
64
- export { a as t };