neko-ui 2.8.21 → 2.8.23

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 (671) hide show
  1. package/es/avatar/README.mdx +10 -0
  2. package/es/avatar/examples/basic.md +14 -0
  3. package/es/avatar/examples/group.md +57 -0
  4. package/es/avatar/examples/size.md +21 -0
  5. package/es/avatar/group.js +2 -2
  6. package/es/avatar/group.js.map +1 -1
  7. package/es/avatar/index.js +2 -2
  8. package/es/avatar/index.js.map +1 -1
  9. package/es/avatar/style.js +2 -2
  10. package/es/avatar/style.js.map +1 -1
  11. package/es/back-top/README.mdx +10 -0
  12. package/es/back-top/examples/basic.md +19 -0
  13. package/es/back-top/examples/mount.md +36 -0
  14. package/es/back-top/examples/target.md +46 -0
  15. package/es/back-top/index.js +1 -1
  16. package/es/back-top/index.js.map +1 -1
  17. package/es/basic-config/README.mdx +11 -0
  18. package/es/button/README.mdx +10 -0
  19. package/es/button/examples/basic.md +21 -0
  20. package/es/button/examples/block.md +33 -0
  21. package/es/button/examples/circle.md +21 -0
  22. package/es/button/examples/danger.md +23 -0
  23. package/es/button/examples/dashed.md +21 -0
  24. package/es/button/examples/disabled.md +35 -0
  25. package/es/button/examples/fill.md +21 -0
  26. package/es/button/examples/flat.md +21 -0
  27. package/es/button/examples/ghost.md +21 -0
  28. package/es/button/examples/icon.md +30 -0
  29. package/es/button/examples/link.md +21 -0
  30. package/es/button/examples/size.md +23 -0
  31. package/es/button/index.js +1 -1
  32. package/es/button/index.js.map +1 -1
  33. package/es/button/style.js +1 -0
  34. package/es/button/style.js.map +1 -1
  35. package/es/capture-screen/README.mdx +10 -0
  36. package/es/capture-screen/examples/basic.md +13 -0
  37. package/es/capture-screen/examples/custom-save.md +30 -0
  38. package/es/capture-screen/examples/preview.md +13 -0
  39. package/es/capture-screen/examples/recorder-save.md +13 -0
  40. package/es/capture-screen/index.js +1 -1
  41. package/es/capture-screen/index.js.map +1 -1
  42. package/es/carousel/README.mdx +10 -0
  43. package/es/carousel/examples/autoplay.md +21 -0
  44. package/es/carousel/examples/basic.md +23 -0
  45. package/es/carousel/examples/dots.md +23 -0
  46. package/es/carousel/examples/header.md +38 -0
  47. package/es/carousel/index.js +1 -1
  48. package/es/carousel/index.js.map +1 -1
  49. package/es/checkbox/README.mdx +10 -0
  50. package/es/checkbox/examples/basic.md +31 -0
  51. package/es/checkbox/examples/check-all.md +37 -0
  52. package/es/checkbox/examples/disabled-all.md +28 -0
  53. package/es/checkbox/examples/disabled-option.md +35 -0
  54. package/es/checkbox/examples/field-names.md +40 -0
  55. package/es/checkbox/examples/status.md +37 -0
  56. package/es/checkbox/examples/vertical.md +36 -0
  57. package/es/checkbox/index.js +1 -1
  58. package/es/checkbox/index.js.map +1 -1
  59. package/es/code/README.mdx +10 -0
  60. package/es/code/examples/basic.md +19 -0
  61. package/es/code/examples/diff.md +45 -0
  62. package/es/code/examples/line-number.md +18 -0
  63. package/es/code/examples/live-edit.md +20 -0
  64. package/es/code/examples/toolbar.md +18 -0
  65. package/es/code/index.js +2 -2
  66. package/es/code/index.js.map +1 -1
  67. package/es/code/worker.js.map +1 -1
  68. package/es/color-palette/README.mdx +10 -0
  69. package/es/color-palette/examples/default-value.md +25 -0
  70. package/es/color-palette/examples/hexa.md +13 -0
  71. package/es/color-palette/examples/hsla.md +13 -0
  72. package/es/color-palette/examples/rgba.md +13 -0
  73. package/es/color-palette/index.js +1 -1
  74. package/es/color-palette/index.js.map +1 -1
  75. package/es/color-picker/README.mdx +10 -0
  76. package/es/color-picker/examples/basic.md +12 -0
  77. package/es/color-picker/examples/default-value.md +20 -0
  78. package/es/color-picker/examples/size.md +17 -0
  79. package/es/color-picker/index.js +1 -1
  80. package/es/color-picker/index.js.map +1 -1
  81. package/es/cron/README.mdx +10 -0
  82. package/es/cron/begin-interval.js.map +1 -1
  83. package/es/cron/day.js.map +1 -1
  84. package/es/cron/examples/basic.md +19 -0
  85. package/es/cron/examples/card.md +12 -0
  86. package/es/cron/examples/show-cron.md +12 -0
  87. package/es/cron/hour.js +1 -1
  88. package/es/cron/hour.js.map +1 -1
  89. package/es/cron/index.js +1 -1
  90. package/es/cron/index.js.map +1 -1
  91. package/es/cron/item.js.map +1 -1
  92. package/es/cron/minute.js +1 -1
  93. package/es/cron/minute.js.map +1 -1
  94. package/es/cron/month.js +1 -1
  95. package/es/cron/month.js.map +1 -1
  96. package/es/cron/period.js.map +1 -1
  97. package/es/cron/second.js +1 -1
  98. package/es/cron/second.js.map +1 -1
  99. package/es/cron/some.js.map +1 -1
  100. package/es/date-picker/README.mdx +10 -0
  101. package/es/date-picker/date.js +1 -1
  102. package/es/date-picker/date.js.map +1 -1
  103. package/es/date-picker/dayjs.js +1 -1
  104. package/es/date-picker/dayjs.js.map +1 -1
  105. package/es/date-picker/examples/basic.md +24 -0
  106. package/es/date-picker/examples/date.md +13 -0
  107. package/es/date-picker/examples/disbaled.md +13 -0
  108. package/es/date-picker/examples/header.md +13 -0
  109. package/es/date-picker/examples/month.md +13 -0
  110. package/es/date-picker/examples/time.md +15 -0
  111. package/es/date-picker/examples/today.md +13 -0
  112. package/es/date-picker/examples/year.md +13 -0
  113. package/es/date-picker/index.js +1 -1
  114. package/es/date-picker/index.js.map +1 -1
  115. package/es/date-picker/month.js +1 -1
  116. package/es/date-picker/month.js.map +1 -1
  117. package/es/date-picker/panel.js +1 -1
  118. package/es/date-picker/panel.js.map +1 -1
  119. package/es/date-picker/time.js +1 -1
  120. package/es/date-picker/time.js.map +1 -1
  121. package/es/date-picker/year.js +1 -1
  122. package/es/date-picker/year.js.map +1 -1
  123. package/es/dropdown/README.mdx +10 -0
  124. package/es/dropdown/examples/arrow.md +59 -0
  125. package/es/dropdown/examples/basic.md +17 -0
  126. package/es/dropdown/examples/click.md +45 -0
  127. package/es/dropdown/examples/context-menu.md +66 -0
  128. package/es/dropdown/examples/field-names.md +44 -0
  129. package/es/dropdown/examples/icon.md +30 -0
  130. package/es/dropdown/examples/multiple.md +45 -0
  131. package/es/dropdown/examples/no-data.md +16 -0
  132. package/es/dropdown/examples/placement.md +59 -0
  133. package/es/dropdown/examples/toggle.md +36 -0
  134. package/es/dropdown/index.js +1 -1
  135. package/es/dropdown/index.js.map +1 -1
  136. package/es/empty/index.js.map +1 -1
  137. package/es/from-schema/index.js +1 -1
  138. package/es/from-schema/index.js.map +1 -1
  139. package/es/highlight-text/README.mdx +10 -0
  140. package/es/highlight-text/examples/basic.md +19 -0
  141. package/es/highlight-text/examples/mut.md +47 -0
  142. package/es/highlight-text/examples/not-hightlight.md +19 -0
  143. package/es/highlight-text/index.js +2 -2
  144. package/es/highlight-text/index.js.map +1 -1
  145. package/es/img/README.mdx +10 -0
  146. package/es/img/examples/basic.md +17 -0
  147. package/es/img/examples/close-mask.md +21 -0
  148. package/es/img/examples/disabled.md +16 -0
  149. package/es/img/examples/error.md +13 -0
  150. package/es/img/examples/esc.md +21 -0
  151. package/es/img/examples/open-change.md +25 -0
  152. package/es/img/index.js +1 -1
  153. package/es/img/index.js.map +1 -1
  154. package/es/img/lazy.js +1 -1
  155. package/es/img/lazy.js.map +1 -1
  156. package/es/index.js +1 -1
  157. package/es/index.js.map +1 -1
  158. package/es/input/README.mdx +10 -0
  159. package/es/input/examples/basic.md +31 -0
  160. package/es/input/examples/prefix&suffix.md +33 -0
  161. package/es/input/examples/size.md +21 -0
  162. package/es/input/examples/status.md +23 -0
  163. package/es/input/index.js +1 -1
  164. package/es/input/index.js.map +1 -1
  165. package/es/input-number/README.mdx +10 -0
  166. package/es/input-number/examples/basic.md +26 -0
  167. package/es/input-number/examples/formatter.md +36 -0
  168. package/es/input-number/examples/max-min.md +13 -0
  169. package/es/input-number/index.js.map +1 -1
  170. package/es/katex/README.mdx +42 -0
  171. package/es/katex/examples/block.md +25 -0
  172. package/es/katex/examples/inline.md +19 -0
  173. package/es/md/README.mdx +10 -0
  174. package/es/md/examples/in-children.md +23 -0
  175. package/es/md/examples/in-text.md +32 -0
  176. package/es/md/examples/math.md +36 -0
  177. package/es/md/index.js +1 -1
  178. package/es/md/index.js.map +1 -1
  179. package/es/menu/README.mdx +10 -0
  180. package/es/menu/examples/basic.md +17 -0
  181. package/es/menu/examples/field-names.md +42 -0
  182. package/es/menu/examples/icon.md +125 -0
  183. package/es/menu/examples/multiple.md +42 -0
  184. package/es/menu/index.js +1 -1
  185. package/es/menu/index.js.map +1 -1
  186. package/es/modal/README.mdx +10 -0
  187. package/es/modal/examples/basic.md +56 -0
  188. package/es/modal/examples/close-icon.md +57 -0
  189. package/es/modal/examples/esc-closable.md +64 -0
  190. package/es/modal/examples/mask-blur.md +56 -0
  191. package/es/modal/examples/mask-closable.md +64 -0
  192. package/es/modal/index.js +1 -1
  193. package/es/modal/index.js.map +1 -1
  194. package/es/notification/README.mdx +11 -0
  195. package/es/notification/examples/basic.md +35 -0
  196. package/es/notification/examples/close.md +35 -0
  197. package/es/notification/examples/type.md +84 -0
  198. package/es/notification/examples/update.md +52 -0
  199. package/es/notification/index.js.map +1 -1
  200. package/es/notification/notification.js +1 -1
  201. package/es/notification/notification.js.map +1 -1
  202. package/es/pagination/README.mdx +10 -0
  203. package/es/pagination/examples/basic.md +13 -0
  204. package/es/pagination/examples/onchange.md +29 -0
  205. package/es/pagination/examples/size.md +23 -0
  206. package/es/pagination/examples/total-text.md +42 -0
  207. package/es/pagination/index.js +1 -1
  208. package/es/pagination/index.js.map +1 -1
  209. package/es/popover/README.mdx +10 -0
  210. package/es/popover/examples/basic.md +35 -0
  211. package/es/popover/examples/click.md +15 -0
  212. package/es/popover/examples/context-menu.md +58 -0
  213. package/es/popover/examples/controlled.md +47 -0
  214. package/es/popover/index.js +1 -1
  215. package/es/popover/index.js.map +1 -1
  216. package/es/prism/css.js.map +1 -1
  217. package/es/prism/index.js.map +1 -1
  218. package/es/provider/README.mdx +10 -0
  219. package/es/provider/examples/scheme.md +14 -0
  220. package/es/provider/index.js.map +1 -1
  221. package/es/radio/README.mdx +10 -0
  222. package/es/radio/examples/basic.md +19 -0
  223. package/es/radio/examples/disabled-option.md +19 -0
  224. package/es/radio/examples/disabled.md +19 -0
  225. package/es/radio/examples/field-names.md +39 -0
  226. package/es/radio/examples/layout-vertical.md +19 -0
  227. package/es/radio/examples/status.md +31 -0
  228. package/es/radio/index.js +1 -1
  229. package/es/radio/index.js.map +1 -1
  230. package/es/segmented/README.mdx +10 -0
  231. package/es/segmented/examples/basic.md +18 -0
  232. package/es/segmented/examples/custom-field-names.md +43 -0
  233. package/es/segmented/examples/disabled-option.md +29 -0
  234. package/es/segmented/examples/disabled.md +18 -0
  235. package/es/segmented/examples/icon.md +28 -0
  236. package/es/segmented/examples/options.md +21 -0
  237. package/es/segmented/index.js +2 -2
  238. package/es/segmented/index.js.map +1 -1
  239. package/es/select/README.mdx +10 -0
  240. package/es/select/examples/basic.md +44 -0
  241. package/es/select/examples/disabled-option.md +21 -0
  242. package/es/select/examples/disabled.md +24 -0
  243. package/es/select/examples/field-names.md +40 -0
  244. package/es/select/examples/item-suffix.md +84 -0
  245. package/es/select/examples/multiple.md +61 -0
  246. package/es/select/examples/no-data.md +12 -0
  247. package/es/select/examples/prefix-icon.md +74 -0
  248. package/es/select/index.js +1 -1
  249. package/es/select/index.js.map +1 -1
  250. package/es/skeleton/README.mdx +10 -0
  251. package/es/skeleton/examples/animation.md +13 -0
  252. package/es/skeleton/examples/avatar.md +13 -0
  253. package/es/skeleton/examples/basic.md +12 -0
  254. package/es/skeleton/examples/rows.md +13 -0
  255. package/es/skeleton/examples/title.md +12 -0
  256. package/es/skeleton/index.js +3 -3
  257. package/es/skeleton/index.js.map +1 -1
  258. package/es/spin/README.mdx +10 -0
  259. package/es/spin/examples/basic.md +67 -0
  260. package/es/spin/index.js +4 -4
  261. package/es/spin/index.js.map +1 -1
  262. package/es/switch/README.mdx +10 -0
  263. package/es/switch/examples/basic.md +24 -0
  264. package/es/switch/examples/checked-text.md +17 -0
  265. package/es/switch/examples/disabled.md +15 -0
  266. package/es/switch/examples/loading.md +17 -0
  267. package/es/switch/index.js +1 -1
  268. package/es/switch/index.js.map +1 -1
  269. package/es/table/README.mdx +10 -0
  270. package/es/table/examples/basic.md +29 -0
  271. package/es/table/examples/key.md +29 -0
  272. package/es/table/examples/order.md +29 -0
  273. package/es/table/examples/pagination.md +67 -0
  274. package/es/table/examples/render.md +92 -0
  275. package/es/table/examples/size.md +52 -0
  276. package/es/table/examples/summary.md +40 -0
  277. package/es/table/index.js +1 -1
  278. package/es/table/index.js.map +1 -1
  279. package/es/tabs/README.mdx +10 -0
  280. package/es/tabs/examples/add-remove.md +115 -0
  281. package/es/tabs/examples/animated.md +33 -0
  282. package/es/tabs/examples/basic.md +32 -0
  283. package/es/tabs/examples/card.md +33 -0
  284. package/es/tabs/examples/center.md +33 -0
  285. package/es/tabs/examples/disabled-tab.md +34 -0
  286. package/es/tabs/examples/disabled.md +33 -0
  287. package/es/tabs/examples/extra.md +65 -0
  288. package/es/tabs/index.js +2 -2
  289. package/es/tabs/index.js.map +1 -1
  290. package/es/tag/README.mdx +10 -0
  291. package/es/tag/examples/basic.md +28 -0
  292. package/es/tag/examples/bordered.md +19 -0
  293. package/es/tag/examples/color.md +25 -0
  294. package/es/tag/examples/icon.md +21 -0
  295. package/es/tag/examples/type.md +19 -0
  296. package/es/tag/index.js +3 -3
  297. package/es/tag/index.js.map +1 -1
  298. package/es/theme/README.mdx +10 -0
  299. package/es/theme/examples/colors.md +123 -0
  300. package/es/theme/examples/theme.md +19 -0
  301. package/es/theme/index.js +1 -1
  302. package/es/theme/index.js.map +1 -1
  303. package/es/tree/README.mdx +10 -0
  304. package/es/tree/examples/basic.md +108 -0
  305. package/es/tree/examples/custom-render.md +115 -0
  306. package/es/tree/examples/direction.md +100 -0
  307. package/es/tree/examples/field-names.md +114 -0
  308. package/es/tree/examples/multiple.md +117 -0
  309. package/es/tree/examples/readonly.md +90 -0
  310. package/es/tree/examples/render-tree-string1.md +70 -0
  311. package/es/tree/examples/render-tree-string2.md +52 -0
  312. package/es/tree/examples/schema.md +130 -0
  313. package/es/tree/examples/size.md +125 -0
  314. package/es/tree/examples/toggle.md +71 -0
  315. package/es/tree/index.js +1 -1
  316. package/es/tree/index.js.map +1 -1
  317. package/es/tree/register.js.map +1 -1
  318. package/es/typography/README.mdx +10 -0
  319. package/es/typography/examples/basic.md +27 -0
  320. package/es/typography/examples/tag.md +25 -0
  321. package/es/typography/examples/truncated.md +17 -0
  322. package/es/typography/index.js +3 -3
  323. package/es/typography/index.js.map +1 -1
  324. package/eslint.config.mjs +9 -0
  325. package/lib/avatar/README.mdx +10 -0
  326. package/lib/avatar/examples/basic.md +14 -0
  327. package/lib/avatar/examples/group.md +57 -0
  328. package/lib/avatar/examples/size.md +21 -0
  329. package/lib/avatar/group.js.map +1 -1
  330. package/lib/avatar/index.js +2 -2
  331. package/lib/avatar/index.js.map +1 -1
  332. package/lib/avatar/style.js +2 -2
  333. package/lib/avatar/style.js.map +1 -1
  334. package/lib/back-top/README.mdx +10 -0
  335. package/lib/back-top/examples/basic.md +19 -0
  336. package/lib/back-top/examples/mount.md +36 -0
  337. package/lib/back-top/examples/target.md +46 -0
  338. package/lib/back-top/index.js +1 -1
  339. package/lib/back-top/index.js.map +1 -1
  340. package/lib/basic-config/README.mdx +11 -0
  341. package/lib/button/README.mdx +10 -0
  342. package/lib/button/examples/basic.md +21 -0
  343. package/lib/button/examples/block.md +33 -0
  344. package/lib/button/examples/circle.md +21 -0
  345. package/lib/button/examples/danger.md +23 -0
  346. package/lib/button/examples/dashed.md +21 -0
  347. package/lib/button/examples/disabled.md +35 -0
  348. package/lib/button/examples/fill.md +21 -0
  349. package/lib/button/examples/flat.md +21 -0
  350. package/lib/button/examples/ghost.md +21 -0
  351. package/lib/button/examples/icon.md +30 -0
  352. package/lib/button/examples/link.md +21 -0
  353. package/lib/button/examples/size.md +23 -0
  354. package/lib/button/index.js +1 -1
  355. package/lib/button/index.js.map +1 -1
  356. package/lib/button/style.js +1 -0
  357. package/lib/button/style.js.map +1 -1
  358. package/lib/capture-screen/README.mdx +10 -0
  359. package/lib/capture-screen/examples/basic.md +13 -0
  360. package/lib/capture-screen/examples/custom-save.md +30 -0
  361. package/lib/capture-screen/examples/preview.md +13 -0
  362. package/lib/capture-screen/examples/recorder-save.md +13 -0
  363. package/lib/capture-screen/index.js +1 -1
  364. package/lib/capture-screen/index.js.map +1 -1
  365. package/lib/carousel/README.mdx +10 -0
  366. package/lib/carousel/examples/autoplay.md +21 -0
  367. package/lib/carousel/examples/basic.md +23 -0
  368. package/lib/carousel/examples/dots.md +23 -0
  369. package/lib/carousel/examples/header.md +38 -0
  370. package/lib/carousel/index.js +1 -1
  371. package/lib/carousel/index.js.map +1 -1
  372. package/lib/checkbox/README.mdx +10 -0
  373. package/lib/checkbox/examples/basic.md +31 -0
  374. package/lib/checkbox/examples/check-all.md +37 -0
  375. package/lib/checkbox/examples/disabled-all.md +28 -0
  376. package/lib/checkbox/examples/disabled-option.md +35 -0
  377. package/lib/checkbox/examples/field-names.md +40 -0
  378. package/lib/checkbox/examples/status.md +37 -0
  379. package/lib/checkbox/examples/vertical.md +36 -0
  380. package/lib/checkbox/index.js +1 -1
  381. package/lib/checkbox/index.js.map +1 -1
  382. package/lib/code/README.mdx +10 -0
  383. package/lib/code/examples/basic.md +19 -0
  384. package/lib/code/examples/diff.md +45 -0
  385. package/lib/code/examples/line-number.md +18 -0
  386. package/lib/code/examples/live-edit.md +20 -0
  387. package/lib/code/examples/toolbar.md +18 -0
  388. package/lib/code/index.js +2 -2
  389. package/lib/code/index.js.map +1 -1
  390. package/lib/code/worker.js.map +1 -1
  391. package/lib/color-palette/README.mdx +10 -0
  392. package/lib/color-palette/examples/default-value.md +25 -0
  393. package/lib/color-palette/examples/hexa.md +13 -0
  394. package/lib/color-palette/examples/hsla.md +13 -0
  395. package/lib/color-palette/examples/rgba.md +13 -0
  396. package/lib/color-palette/index.js +1 -1
  397. package/lib/color-palette/index.js.map +1 -1
  398. package/lib/color-picker/README.mdx +10 -0
  399. package/lib/color-picker/examples/basic.md +12 -0
  400. package/lib/color-picker/examples/default-value.md +20 -0
  401. package/lib/color-picker/examples/size.md +17 -0
  402. package/lib/color-picker/index.js +1 -1
  403. package/lib/color-picker/index.js.map +1 -1
  404. package/lib/cron/README.mdx +10 -0
  405. package/lib/cron/begin-interval.js.map +1 -1
  406. package/lib/cron/day.js.map +1 -1
  407. package/lib/cron/examples/basic.md +19 -0
  408. package/lib/cron/examples/card.md +12 -0
  409. package/lib/cron/examples/show-cron.md +12 -0
  410. package/lib/cron/hour.js +1 -1
  411. package/lib/cron/hour.js.map +1 -1
  412. package/lib/cron/index.js.map +1 -1
  413. package/lib/cron/item.js.map +1 -1
  414. package/lib/cron/minute.js +1 -1
  415. package/lib/cron/minute.js.map +1 -1
  416. package/lib/cron/month.js +1 -1
  417. package/lib/cron/month.js.map +1 -1
  418. package/lib/cron/period.js.map +1 -1
  419. package/lib/cron/second.js +1 -1
  420. package/lib/cron/second.js.map +1 -1
  421. package/lib/cron/some.js.map +1 -1
  422. package/lib/date-picker/README.mdx +10 -0
  423. package/lib/date-picker/date.js.map +1 -1
  424. package/lib/date-picker/dayjs.js +1 -1
  425. package/lib/date-picker/dayjs.js.map +1 -1
  426. package/lib/date-picker/examples/basic.md +24 -0
  427. package/lib/date-picker/examples/date.md +13 -0
  428. package/lib/date-picker/examples/disbaled.md +13 -0
  429. package/lib/date-picker/examples/header.md +13 -0
  430. package/lib/date-picker/examples/month.md +13 -0
  431. package/lib/date-picker/examples/time.md +15 -0
  432. package/lib/date-picker/examples/today.md +13 -0
  433. package/lib/date-picker/examples/year.md +13 -0
  434. package/lib/date-picker/index.js +1 -1
  435. package/lib/date-picker/index.js.map +1 -1
  436. package/lib/date-picker/month.js.map +1 -1
  437. package/lib/date-picker/panel.js +1 -1
  438. package/lib/date-picker/panel.js.map +1 -1
  439. package/lib/date-picker/time.js.map +1 -1
  440. package/lib/date-picker/year.js.map +1 -1
  441. package/lib/dropdown/README.mdx +10 -0
  442. package/lib/dropdown/examples/arrow.md +59 -0
  443. package/lib/dropdown/examples/basic.md +17 -0
  444. package/lib/dropdown/examples/click.md +45 -0
  445. package/lib/dropdown/examples/context-menu.md +66 -0
  446. package/lib/dropdown/examples/field-names.md +44 -0
  447. package/lib/dropdown/examples/icon.md +30 -0
  448. package/lib/dropdown/examples/multiple.md +45 -0
  449. package/lib/dropdown/examples/no-data.md +16 -0
  450. package/lib/dropdown/examples/placement.md +59 -0
  451. package/lib/dropdown/examples/toggle.md +36 -0
  452. package/lib/dropdown/index.js +1 -1
  453. package/lib/dropdown/index.js.map +1 -1
  454. package/lib/empty/index.js.map +1 -1
  455. package/lib/from-schema/index.js +1 -1
  456. package/lib/from-schema/index.js.map +1 -1
  457. package/lib/highlight-text/README.mdx +10 -0
  458. package/lib/highlight-text/examples/basic.md +19 -0
  459. package/lib/highlight-text/examples/mut.md +47 -0
  460. package/lib/highlight-text/examples/not-hightlight.md +19 -0
  461. package/lib/highlight-text/index.js.map +1 -1
  462. package/lib/img/README.mdx +10 -0
  463. package/lib/img/examples/basic.md +17 -0
  464. package/lib/img/examples/close-mask.md +21 -0
  465. package/lib/img/examples/disabled.md +16 -0
  466. package/lib/img/examples/error.md +13 -0
  467. package/lib/img/examples/esc.md +21 -0
  468. package/lib/img/examples/open-change.md +25 -0
  469. package/lib/img/index.js +1 -1
  470. package/lib/img/index.js.map +1 -1
  471. package/lib/img/lazy.js +1 -1
  472. package/lib/img/lazy.js.map +1 -1
  473. package/lib/index.js +1 -1
  474. package/lib/index.js.map +1 -1
  475. package/lib/input/README.mdx +10 -0
  476. package/lib/input/examples/basic.md +31 -0
  477. package/lib/input/examples/prefix&suffix.md +33 -0
  478. package/lib/input/examples/size.md +21 -0
  479. package/lib/input/examples/status.md +23 -0
  480. package/lib/input/index.js +1 -1
  481. package/lib/input/index.js.map +1 -1
  482. package/lib/input-number/README.mdx +10 -0
  483. package/lib/input-number/examples/basic.md +26 -0
  484. package/lib/input-number/examples/formatter.md +36 -0
  485. package/lib/input-number/examples/max-min.md +13 -0
  486. package/lib/input-number/index.js.map +1 -1
  487. package/lib/katex/README.mdx +42 -0
  488. package/lib/katex/examples/block.md +25 -0
  489. package/lib/katex/examples/inline.md +19 -0
  490. package/lib/md/README.mdx +10 -0
  491. package/lib/md/examples/in-children.md +23 -0
  492. package/lib/md/examples/in-text.md +32 -0
  493. package/lib/md/examples/math.md +36 -0
  494. package/lib/md/index.js +1 -1
  495. package/lib/md/index.js.map +1 -1
  496. package/lib/menu/README.mdx +10 -0
  497. package/lib/menu/examples/basic.md +17 -0
  498. package/lib/menu/examples/field-names.md +42 -0
  499. package/lib/menu/examples/icon.md +125 -0
  500. package/lib/menu/examples/multiple.md +42 -0
  501. package/lib/menu/index.js +1 -1
  502. package/lib/menu/index.js.map +1 -1
  503. package/lib/modal/README.mdx +10 -0
  504. package/lib/modal/examples/basic.md +56 -0
  505. package/lib/modal/examples/close-icon.md +57 -0
  506. package/lib/modal/examples/esc-closable.md +64 -0
  507. package/lib/modal/examples/mask-blur.md +56 -0
  508. package/lib/modal/examples/mask-closable.md +64 -0
  509. package/lib/modal/index.js.map +1 -1
  510. package/lib/notification/README.mdx +11 -0
  511. package/lib/notification/examples/basic.md +35 -0
  512. package/lib/notification/examples/close.md +35 -0
  513. package/lib/notification/examples/type.md +84 -0
  514. package/lib/notification/examples/update.md +52 -0
  515. package/lib/notification/index.js.map +1 -1
  516. package/lib/notification/notification.js +1 -1
  517. package/lib/notification/notification.js.map +1 -1
  518. package/lib/pagination/README.mdx +10 -0
  519. package/lib/pagination/examples/basic.md +13 -0
  520. package/lib/pagination/examples/onchange.md +29 -0
  521. package/lib/pagination/examples/size.md +23 -0
  522. package/lib/pagination/examples/total-text.md +42 -0
  523. package/lib/pagination/index.js +1 -1
  524. package/lib/pagination/index.js.map +1 -1
  525. package/lib/popover/README.mdx +10 -0
  526. package/lib/popover/examples/basic.md +35 -0
  527. package/lib/popover/examples/click.md +15 -0
  528. package/lib/popover/examples/context-menu.md +58 -0
  529. package/lib/popover/examples/controlled.md +47 -0
  530. package/lib/popover/index.js +1 -1
  531. package/lib/popover/index.js.map +1 -1
  532. package/lib/prism/css.js.map +1 -1
  533. package/lib/prism/index.js.map +1 -1
  534. package/lib/provider/README.mdx +10 -0
  535. package/lib/provider/examples/scheme.md +14 -0
  536. package/lib/provider/index.js.map +1 -1
  537. package/lib/radio/README.mdx +10 -0
  538. package/lib/radio/examples/basic.md +19 -0
  539. package/lib/radio/examples/disabled-option.md +19 -0
  540. package/lib/radio/examples/disabled.md +19 -0
  541. package/lib/radio/examples/field-names.md +39 -0
  542. package/lib/radio/examples/layout-vertical.md +19 -0
  543. package/lib/radio/examples/status.md +31 -0
  544. package/lib/radio/index.js +1 -1
  545. package/lib/radio/index.js.map +1 -1
  546. package/lib/segmented/README.mdx +10 -0
  547. package/lib/segmented/examples/basic.md +18 -0
  548. package/lib/segmented/examples/custom-field-names.md +43 -0
  549. package/lib/segmented/examples/disabled-option.md +29 -0
  550. package/lib/segmented/examples/disabled.md +18 -0
  551. package/lib/segmented/examples/icon.md +28 -0
  552. package/lib/segmented/examples/options.md +21 -0
  553. package/lib/segmented/index.js +2 -2
  554. package/lib/segmented/index.js.map +1 -1
  555. package/lib/select/README.mdx +10 -0
  556. package/lib/select/examples/basic.md +44 -0
  557. package/lib/select/examples/disabled-option.md +21 -0
  558. package/lib/select/examples/disabled.md +24 -0
  559. package/lib/select/examples/field-names.md +40 -0
  560. package/lib/select/examples/item-suffix.md +84 -0
  561. package/lib/select/examples/multiple.md +61 -0
  562. package/lib/select/examples/no-data.md +12 -0
  563. package/lib/select/examples/prefix-icon.md +74 -0
  564. package/lib/select/index.js +1 -1
  565. package/lib/select/index.js.map +1 -1
  566. package/lib/skeleton/README.mdx +10 -0
  567. package/lib/skeleton/examples/animation.md +13 -0
  568. package/lib/skeleton/examples/avatar.md +13 -0
  569. package/lib/skeleton/examples/basic.md +12 -0
  570. package/lib/skeleton/examples/rows.md +13 -0
  571. package/lib/skeleton/examples/title.md +12 -0
  572. package/lib/skeleton/index.js.map +1 -1
  573. package/lib/spin/README.mdx +10 -0
  574. package/lib/spin/examples/basic.md +67 -0
  575. package/lib/spin/index.js +3 -3
  576. package/lib/spin/index.js.map +1 -1
  577. package/lib/switch/README.mdx +10 -0
  578. package/lib/switch/examples/basic.md +24 -0
  579. package/lib/switch/examples/checked-text.md +17 -0
  580. package/lib/switch/examples/disabled.md +15 -0
  581. package/lib/switch/examples/loading.md +17 -0
  582. package/lib/switch/index.js +1 -1
  583. package/lib/switch/index.js.map +1 -1
  584. package/lib/table/README.mdx +10 -0
  585. package/lib/table/examples/basic.md +29 -0
  586. package/lib/table/examples/key.md +29 -0
  587. package/lib/table/examples/order.md +29 -0
  588. package/lib/table/examples/pagination.md +67 -0
  589. package/lib/table/examples/render.md +92 -0
  590. package/lib/table/examples/size.md +52 -0
  591. package/lib/table/examples/summary.md +40 -0
  592. package/lib/table/index.js +1 -1
  593. package/lib/table/index.js.map +1 -1
  594. package/lib/tabs/README.mdx +10 -0
  595. package/lib/tabs/examples/add-remove.md +115 -0
  596. package/lib/tabs/examples/animated.md +33 -0
  597. package/lib/tabs/examples/basic.md +32 -0
  598. package/lib/tabs/examples/card.md +33 -0
  599. package/lib/tabs/examples/center.md +33 -0
  600. package/lib/tabs/examples/disabled-tab.md +34 -0
  601. package/lib/tabs/examples/disabled.md +33 -0
  602. package/lib/tabs/examples/extra.md +65 -0
  603. package/lib/tabs/index.js +2 -2
  604. package/lib/tabs/index.js.map +1 -1
  605. package/lib/tag/README.mdx +10 -0
  606. package/lib/tag/examples/basic.md +28 -0
  607. package/lib/tag/examples/bordered.md +19 -0
  608. package/lib/tag/examples/color.md +25 -0
  609. package/lib/tag/examples/icon.md +21 -0
  610. package/lib/tag/examples/type.md +19 -0
  611. package/lib/tag/index.js +3 -3
  612. package/lib/tag/index.js.map +1 -1
  613. package/lib/theme/README.mdx +10 -0
  614. package/lib/theme/examples/colors.md +123 -0
  615. package/lib/theme/examples/theme.md +19 -0
  616. package/lib/theme/index.js +1 -1
  617. package/lib/theme/index.js.map +1 -1
  618. package/lib/tree/README.mdx +10 -0
  619. package/lib/tree/examples/basic.md +108 -0
  620. package/lib/tree/examples/custom-render.md +115 -0
  621. package/lib/tree/examples/direction.md +100 -0
  622. package/lib/tree/examples/field-names.md +114 -0
  623. package/lib/tree/examples/multiple.md +117 -0
  624. package/lib/tree/examples/readonly.md +90 -0
  625. package/lib/tree/examples/render-tree-string1.md +70 -0
  626. package/lib/tree/examples/render-tree-string2.md +52 -0
  627. package/lib/tree/examples/schema.md +130 -0
  628. package/lib/tree/examples/size.md +125 -0
  629. package/lib/tree/examples/toggle.md +71 -0
  630. package/lib/tree/index.js +1 -1
  631. package/lib/tree/index.js.map +1 -1
  632. package/lib/tree/register.js.map +1 -1
  633. package/lib/typography/README.mdx +10 -0
  634. package/lib/typography/examples/basic.md +27 -0
  635. package/lib/typography/examples/tag.md +25 -0
  636. package/lib/typography/examples/truncated.md +17 -0
  637. package/lib/typography/index.js.map +1 -1
  638. package/package.json +18 -18
  639. package/types/avatar/group.d.ts +1 -1
  640. package/types/back-top/index.d.ts +1 -1
  641. package/types/capture-screen/index.d.ts +1 -1
  642. package/types/color-palette/index.d.ts +1 -1
  643. package/types/color-picker/index.d.ts +1 -1
  644. package/types/cron/begin-interval.d.ts +3 -3
  645. package/types/cron/index.d.ts +5 -5
  646. package/types/cron/item.d.ts +4 -4
  647. package/types/cron/period.d.ts +3 -3
  648. package/types/cron/some.d.ts +3 -3
  649. package/types/date-picker/date.d.ts +2 -2
  650. package/types/date-picker/index.d.ts +2 -2
  651. package/types/date-picker/month.d.ts +2 -2
  652. package/types/date-picker/panel.d.ts +3 -3
  653. package/types/date-picker/time.d.ts +2 -2
  654. package/types/date-picker/year.d.ts +2 -2
  655. package/types/dropdown/index.d.ts +1 -1
  656. package/types/empty/index.d.ts +1 -1
  657. package/types/from-schema/index.d.ts +4 -4
  658. package/types/index.d.ts +12 -12
  659. package/types/md/index.d.ts +1 -1
  660. package/types/modal/index.d.ts +1 -1
  661. package/types/notification/index.d.ts +1 -1
  662. package/types/pagination/index.d.ts +1 -1
  663. package/types/provider/index.d.ts +1 -1
  664. package/types/segmented/index.d.ts +1 -1
  665. package/types/select/index.d.ts +1 -1
  666. package/types/table/index.d.ts +1 -1
  667. package/types/tabs/index.d.ts +1 -1
  668. package/types/tree/index.d.ts +1 -1
  669. package/umd/assets/svg/favicon.svg +1 -0
  670. package/umd/index.js +2 -2
  671. package/umd/js/46e8f96158e59015.js +1 -0
@@ -0,0 +1,90 @@
1
+ ---
2
+ title: 只读模式
3
+ description: 通过设置 `readonly` 属性来开启只读模式, 不会触发 `onchange` 事件
4
+ order: 7
5
+ ---
6
+
7
+ ```html
8
+ <n-tree readonly="true" value="fileName.code"></n-tree>
9
+ <script>
10
+ const el = container.querySelector('n-tree');
11
+
12
+ el.onchange = function (e) {
13
+ // 不会触发
14
+ console.log(e);
15
+ };
16
+ el.data = [
17
+ {
18
+ title: '文件地址',
19
+ subTitle: 'fileAddr',
20
+ key: 'fileAddr',
21
+ },
22
+ {
23
+ subTitle: 'fileName',
24
+ title: '文件名称',
25
+ key: 'fileName',
26
+ children: [
27
+ {
28
+ title: '编号',
29
+ subTitle: 'fileName.code',
30
+ key: 'fileName.code',
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ title: '编号',
36
+ subTitle: 'code',
37
+ key: 'code',
38
+ children: [
39
+ {
40
+ title: '是否有效',
41
+ subTitle: 'valid',
42
+ key: 'valid',
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+ </script>
48
+ ```
49
+
50
+ ```jsx
51
+ <n-tree
52
+ data={[
53
+ {
54
+ title: '文件地址',
55
+ subTitle: 'fileAddr',
56
+ key: 'fileAddr',
57
+ },
58
+ {
59
+ subTitle: 'fileName',
60
+ title: '文件名称',
61
+ key: 'fileName',
62
+ children: [
63
+ {
64
+ title: '编号',
65
+ subTitle: 'fileName.code',
66
+ key: 'fileName.code',
67
+ },
68
+ ],
69
+ },
70
+ {
71
+ title: '编号',
72
+ subTitle: 'code',
73
+ key: 'code',
74
+ children: [
75
+ {
76
+ title: '是否有效',
77
+ subTitle: 'valid',
78
+ key: 'valid',
79
+ },
80
+ ],
81
+ },
82
+ ]}
83
+ value="fileName.code"
84
+ readonly
85
+ onChange={(e) => {
86
+ // 不会触发
87
+ console.log(e);
88
+ }}
89
+ />
90
+ ```
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: 渲染树状字符串
3
+ description: 渲染 tree 命令输出的树状字符串
4
+ order: 9
5
+ ---
6
+
7
+ ```html
8
+ <n-tree></n-tree>
9
+ <script>
10
+ const el = container.querySelector('n-tree');
11
+
12
+ el.data = `.
13
+ |-- components
14
+ | |-- index.ts
15
+ | \`-- wave-circle
16
+ | |-- examples
17
+ | | |-- api.md
18
+ | | \`-- demo.mdx
19
+ | |-- index.tsx
20
+ | \`-- README.mdx
21
+ |-- config
22
+ | |-- index.ts
23
+ | \`-- prod.ts
24
+ |-- docs
25
+ | |-- index.js
26
+ | \`-- index.html
27
+ |-- es
28
+ | |-- index.js
29
+ | \`-- wave-circle
30
+ | \`-- index.js
31
+ |-- .eslintrc.yaml
32
+ |-- .gitattributes
33
+ |-- .prettierrc.yaml
34
+ |-- .stylelintrc.yaml
35
+ |-- package.json
36
+ |-- README.md
37
+ \`-- tsconfig.json`;
38
+ </script>
39
+ ```
40
+
41
+ ```jsx
42
+ <n-tree
43
+ data={`.
44
+ |-- components
45
+ | |-- index.ts
46
+ | \`-- wave-circle
47
+ | |-- examples
48
+ | | |-- api.md
49
+ | | \`-- demo.mdx
50
+ | |-- index.tsx
51
+ | \`-- README.mdx
52
+ |-- config
53
+ | |-- index.ts
54
+ | \`-- prod.ts
55
+ |-- docs
56
+ | |-- index.js
57
+ | \`-- index.html
58
+ |-- es
59
+ | |-- index.js
60
+ | \`-- wave-circle
61
+ | \`-- index.js
62
+ |-- .eslintrc.yaml
63
+ |-- .gitattributes
64
+ |-- .prettierrc.yaml
65
+ |-- .stylelintrc.yaml
66
+ |-- package.json
67
+ |-- README.md
68
+ \`-- tsconfig.json`}
69
+ />
70
+ ```
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: 渲染 tree 命令输出的树状字符串
3
+ description: 渲染另一种格式的树状字符串
4
+ order: 10
5
+ ---
6
+
7
+ ```html
8
+ <n-tree></n-tree>
9
+ <script>
10
+ const el = container.querySelector('n-tree');
11
+
12
+ el.data = `.
13
+ ├── components
14
+ │ ├── @moneko
15
+ │ │ ├── README.mdx
16
+ │ │ └── 🕸sso
17
+ │ │ ├── README.mdx
18
+ │ │ └── examples
19
+ │ │ └── readme.md
20
+ │ └── index.ts
21
+ ├── config
22
+ │ ├── deploy.ts
23
+ │ └── index.ts
24
+ ├── jest.config.ts
25
+ ├── package.json
26
+ ├── tsconfig.json
27
+ └── typings
28
+ └── typings.d.ts`;
29
+ </script>
30
+ ```
31
+
32
+ ```jsx
33
+ <n-tree
34
+ data={`.
35
+ ├── components
36
+ │ ├── @moneko
37
+ │ │ ├── README.mdx
38
+ │ │ └── 🕸sso
39
+ │ │ ├── README.mdx
40
+ │ │ └── examples
41
+ │ │ └── readme.md
42
+ │ └── index.ts
43
+ ├── config
44
+ │ ├── deploy.ts
45
+ │ └── index.ts
46
+ ├── jest.config.ts
47
+ ├── package.json
48
+ ├── tsconfig.json
49
+ └── typings
50
+ └── typings.d.ts`}
51
+ />
52
+ ```
@@ -0,0 +1,130 @@
1
+ ---
2
+ title: 渲染JSON Schema结构
3
+ description: 通过设置 `fromSchema` 属性渲染来支持 `JSONSchema` 的数据源。
4
+ order: 5
5
+ ---
6
+
7
+ ```html
8
+ <n-tree from-schema="true"></n-tree>
9
+ <script>
10
+ const el = container.querySelector('n-tree');
11
+ el.onchange = function (e) {
12
+ const [key, item] = e.detail;
13
+
14
+ el.value = key;
15
+ console.log(item);
16
+ };
17
+ el.data = {
18
+ $schema: 'http://json-schema.org/draft-07/schema',
19
+ $id: 'http://example.com/example.json',
20
+ type: 'object',
21
+ additionalProperties: true,
22
+ properties: {
23
+ user: {
24
+ type: 'object',
25
+ title: '用户信息',
26
+ propertyOrder: 12,
27
+ required: ['name', 'email'],
28
+ properties: {
29
+ name: {
30
+ type: 'string',
31
+ title: '姓名',
32
+ description: '',
33
+ default: '',
34
+ },
35
+ works: {
36
+ type: 'object',
37
+ title: '履历',
38
+ description: '',
39
+ required: ['desgin'],
40
+ properties: {
41
+ desgin: {
42
+ type: 'string',
43
+ title: '设计',
44
+ description: '',
45
+ },
46
+ },
47
+ },
48
+ },
49
+ },
50
+ tags: {
51
+ type: 'array',
52
+ title: '标签',
53
+ description: '',
54
+ items: {
55
+ type: 'object',
56
+ title: 'items',
57
+ description: '',
58
+ additionalProperties: true,
59
+ properties: {
60
+ s: {
61
+ type: 'string',
62
+ title: 's',
63
+ description: '',
64
+ },
65
+ },
66
+ },
67
+ },
68
+ },
69
+ };
70
+ </script>
71
+ ```
72
+
73
+ ```jsx
74
+ <n-tree
75
+ data={{
76
+ $schema: 'http://json-schema.org/draft-07/schema',
77
+ $id: 'http://example.com/example.json',
78
+ type: 'object',
79
+ additionalProperties: true,
80
+ properties: {
81
+ user: {
82
+ type: 'object',
83
+ title: '用户信息',
84
+ propertyOrder: 12,
85
+ required: ['name', 'email'],
86
+ properties: {
87
+ name: {
88
+ type: 'string',
89
+ title: '姓名',
90
+ description: '',
91
+ default: '',
92
+ },
93
+ works: {
94
+ type: 'object',
95
+ title: '履历',
96
+ description: '',
97
+ required: ['desgin'],
98
+ properties: {
99
+ desgin: {
100
+ type: 'string',
101
+ title: '设计',
102
+ description: '',
103
+ },
104
+ },
105
+ },
106
+ },
107
+ },
108
+ tags: {
109
+ type: 'array',
110
+ title: '标签',
111
+ description: '',
112
+ items: {
113
+ type: 'object',
114
+ title: 'items',
115
+ description: '',
116
+ additionalProperties: true,
117
+ properties: {
118
+ s: {
119
+ type: 'string',
120
+ title: 's',
121
+ description: '',
122
+ },
123
+ },
124
+ },
125
+ },
126
+ },
127
+ }}
128
+ from-schema
129
+ />
130
+ ```
@@ -0,0 +1,125 @@
1
+ ---
2
+ title: 不同的尺寸
3
+ description: Tree 内置有大、中、小三种尺寸。通过 `size` 设置尺寸; 默认为 'normal'。
4
+ order: 7
5
+ ---
6
+
7
+ ```html
8
+ <n-segmented default-value="normal"></n-segmented>
9
+ <n-tree></n-tree>
10
+ <script>
11
+ const segmented = container.querySelector('n-segmented');
12
+ const tree = container.querySelector('n-tree');
13
+
14
+ segmented.options = [
15
+ { label: '小', value: 'small' },
16
+ { label: '默认:中', value: 'normal' },
17
+ { label: '大', value: 'large' },
18
+ ];
19
+ segmented.onchange = function (e) {
20
+ tree.size = e.detail;
21
+ };
22
+ tree.data = [
23
+ {
24
+ title: '文件名称',
25
+ subTitle: 'object',
26
+ key: 'a',
27
+ children: [
28
+ {
29
+ title: '备注',
30
+ subTitle: 'object',
31
+ key: 'a.b',
32
+ children: [
33
+ {
34
+ title: '备注',
35
+ subTitle: 'string',
36
+ key: 'a.b.x',
37
+ },
38
+ ],
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ title: '编号',
44
+ subTitle: 'object',
45
+ key: 'b',
46
+ children: [
47
+ {
48
+ title: '备注',
49
+ subTitle: 'string',
50
+ key: 'b2',
51
+ },
52
+ {
53
+ title: '是否有效',
54
+ subTitle: 'boolean',
55
+ key: 'c2',
56
+ },
57
+ ],
58
+ },
59
+ ];
60
+ </script>
61
+ ```
62
+
63
+ ```jsx
64
+ function Demo() {
65
+ let el;
66
+
67
+ return (
68
+ <>
69
+ <n-segmented
70
+ default-value="normal"
71
+ options={[
72
+ { label: '小', value: 'small' },
73
+ { label: '默认:中', value: 'normal' },
74
+ { label: '大', value: 'large' },
75
+ ]}
76
+ onChange={(e) => {
77
+ el.size = e.detail;
78
+ }}
79
+ />
80
+ <n-tree
81
+ ref={(e) => (el = e)}
82
+ size="normal"
83
+ data={[
84
+ {
85
+ title: '文件名称',
86
+ subTitle: 'object',
87
+ key: 'a',
88
+ children: [
89
+ {
90
+ title: '备注',
91
+ subTitle: 'object',
92
+ key: 'a.b',
93
+ children: [
94
+ {
95
+ title: '备注',
96
+ subTitle: 'string',
97
+ key: 'a.b.x',
98
+ },
99
+ ],
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ title: '编号',
105
+ subTitle: 'object',
106
+ key: 'b',
107
+ children: [
108
+ {
109
+ title: '备注',
110
+ subTitle: 'string',
111
+ key: 'b2',
112
+ },
113
+ {
114
+ title: '是否有效',
115
+ subTitle: 'boolean',
116
+ key: 'c2',
117
+ },
118
+ ],
119
+ },
120
+ ]}
121
+ />
122
+ </>
123
+ );
124
+ }
125
+ ```
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: 重复点击取消选中
3
+ description: 通过设置`toggle`属性来开启取消选中, 仅支持单选模式; 重复点击同一项时,如果已选中则取消选中。
4
+ order: 6
5
+ ---
6
+
7
+ ```html
8
+ <n-tree toggle="true"></n-tree>
9
+ <script>
10
+ const el = container.querySelector('n-tree');
11
+
12
+ el.onchange = function (e) {
13
+ const [key, item] = e.detail;
14
+
15
+ el.value = key;
16
+ console.log(item);
17
+ };
18
+ el.data = [
19
+ {
20
+ title: '文件地址',
21
+ subTitle: 'fileAddr',
22
+ key: 'fileAddr',
23
+ },
24
+ {
25
+ title: '编号',
26
+ subTitle: 'channelCustNum',
27
+ key: 'channelCustNum',
28
+ },
29
+ {
30
+ title: '编号2',
31
+ subTitle: 'string',
32
+ key: 'string',
33
+ },
34
+ ];
35
+ </script>
36
+ ```
37
+
38
+ ```jsx
39
+ function Demo() {
40
+ let el;
41
+ return (
42
+ <n-tree
43
+ ref={(e) => (el = e)}
44
+ toggle
45
+ onChange={(e) => {
46
+ const [key, item] = e.detail;
47
+
48
+ el.value = key;
49
+ console.log(item);
50
+ }}
51
+ data={[
52
+ {
53
+ title: '文件地址',
54
+ subTitle: 'fileAddr',
55
+ key: 'fileAddr',
56
+ },
57
+ {
58
+ title: '编号',
59
+ subTitle: 'channelCustNum',
60
+ key: 'channelCustNum',
61
+ },
62
+ {
63
+ title: '编号2',
64
+ subTitle: 'string',
65
+ key: 'string',
66
+ },
67
+ ]}
68
+ />
69
+ );
70
+ }
71
+ ```
package/lib/tree/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return g}});const e=require("solid-js/web"),t=require("solid-js"),l=c(require("@moneko/common/lib/frameCallback")),n=c(require("@moneko/common/lib/isFunction")),r=c(require("@moneko/common/lib/isString")),i=require("@moneko/css");require("./register");const o=require("./style"),a=c(require("../from-schema")),s=c(require("../theme"));function c(e){return e&&e.__esModule?e:{default:e}}!function(e,t){Object.keys(e).forEach(function(l){"default"===l||Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[l]}})})}(require("./type"),exports);const u=(0,e.template)('<li class="row">'),d=(0,e.template)('<span class="title">'),f=(0,e.template)('<span class="sub-title">'),h=(0,e.template)("<style> "),p=(0,e.template)("<style>"),m=(0,e.template)('<ul class="tree">'),g=function(c){let g;let y={small:6,normal:8,large:10},{baseStyle:v}=s.default,[$,b]=(0,t.createSignal)([]),[k,_]=(0,t.createSignal)([]),C={key:"key",name:"name",title:"title",subTitle:"subTitle",children:"children",description:"description"},w=(0,t.createMemo)(()=>Object.assign(C,c.fieldNames)),q=(0,t.createMemo)(()=>"rtl"===c.direction),S=(0,t.createMemo)(()=>void 0!==c.value&&null!==c.value?Array.isArray(c.value)?c.value:[c.value]:[]),j=Symbol("path"),O=Symbol("path-end");return(0,t.createEffect)(()=>{let e=c.fromSchema?(0,a.default)(c.data):(0,r.default)(c.data)?function(e){let t=w(),l=t.key,n=t.title,r=t.children,i=/[^\s|`│├└]/,o=e.trim().split("\n"),a=[{[n]:o[0],[l]:o[0]}];for(let e=1;e<o.length;e++){let t=o[e].search(i);if(-1===t)continue;let s={[n]:o[e].slice(t+3),depth:t};for(;a.length&&t<=(a[a.length-1].depth||0);)a.pop();if(!a.length)return[];let c=a[a.length-1];c[r]||(c[r]=[]),s[l]=`${c[l]}-${s[n]}-${t}-${e}`,c[r].push(s),a.push(s)}return[a[0]]}(c.data):c.data;b([...new Set(function e(t,l=0){let n=t.length-1,r=t[n],i=t[0],o=[],a=w(),s=a.key,c=a.children;for(let a=0,u=t.length;a<u;a++){let u=t[a],d=a===n;delete u[j],delete u[O],(0===a||d)&&(u[j]=i[s]+(1===t.length?"":`>${r[s]}`),d&&(u[O]=""),o.push(u[j])),u[c]&&(o=o.concat(e(u[c],l+1)))}return o}(e))]),_(e)}),(0,t.createEffect)(()=>{let e=$(),t=c.size||"normal";(0,l.default)(()=>{let l=e.length;if(g&&l){let n=y[t];for(let t=0;t<l;t++){let l=g.querySelectorAll(`li[data-path="${e[t]}"]`);if(l.length){let e=l[0].getBoundingClientRect(),r=e.height/2+n;if(l.length>1){let{bottom:i,height:o,top:a}=l[1].getBoundingClientRect();r=0===t?a-e.top:i-e.top-o/2+n,l[1].style.setProperty("--c","none")}else 0===t&&l[0].style.setProperty("--c","none");(1!==l.length||0!==t)&&l[0].style.setProperty("--line",`${Math.abs(r)}px`)}}}})}),[(()=>{let t=h(),l=t.firstChild;return(0,e.effect)(()=>l.data=v()),t})(),(()=>{let e=p();return e.textContent=o.style,e})(),(0,e.createComponent)(t.Show,{get when(){return c.css},get children(){let t=h(),l=t.firstChild;return(0,e.effect)(()=>l.data=(0,i.css)(c.css)),t}}),(()=>{let l=m(),r=g;return"function"==typeof r?(0,e.use)(r,l):g=l,(0,e.insert)(l,()=>(function l(r,i=0){return(0,e.createComponent)(t.For,{each:r,children:r=>{let o=w(),a=r[o.title],s=r[o.key],h=r[o.name],p=r[o.subTitle],m=r[o.children],g=h!==a&&h?[h,a]:[a];return[(()=>{let l=u();return l.$$dblclick=e=>c.onRowDoubleClick?.(e,s,r),l.$$click=e=>(function(e,t){let l=w();(function(e,t){if(!c.readonly&&(0,n.default)(c.onChange)){let l=[...S()];if(c.multiple){let t=l.indexOf(e);-1===t?l.push(e):l.splice(t,1)}else l=c.toggle&&l[0]===e?[]:[e];c.onChange(c.multiple?l:l[0],t)}})(t[l.key],t),c.onRowClick?.(e,t[l.key],t)})(e,r),(0,e.insert)(l,()=>(function(e,t,l){let n=c.renderRow?.(e,t,l)||[t,l];return q()?n.reverse():n})(r,(()=>{let t=d();return(0,e.insert)(t,()=>(q()?g.reverse():g).join(": ")),t})(),(0,e.createComponent)(t.Show,{when:p,get children(){let t=f();return(0,e.insert)(t,p),t}}))),(0,e.effect)(t=>{let o=!!S().includes(s),a=!!(c.readonly||!(0,n.default)(c.onChange)),u=i?{"--depth":`${2*i}em`}:void 0,d=r[O],f=r[j];return o!==t._v$&&l.classList.toggle("active",t._v$=o),a!==t._v$2&&l.classList.toggle("non",t._v$2=a),t._v$3=(0,e.style)(l,u,t._v$3),d!==t._v$4&&(0,e.setAttribute)(l,"data-path-end",t._v$4=d),f!==t._v$5&&(0,e.setAttribute)(l,"data-path",t._v$5=f),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),l})(),(0,e.createComponent)(t.Show,{when:m,get children(){return l(m,i+1)}})]}})})(k())),(0,e.effect)(t=>(0,e.classList)(l,{[c.size||"normal"]:!0,[c.class]:!!c.class,rtl:q()},t)),l})()]};(0,e.delegateEvents)(["click","dblclick"]);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return g}});const e=require("solid-js/web"),t=require("solid-js"),l=c(require("@moneko/common/lib/frameCallback")),n=c(require("@moneko/common/lib/isFunction")),r=c(require("@moneko/common/lib/isString")),i=require("@moneko/css"),o=c(require("../from-schema")),a=c(require("../theme")),s=require("./style");function c(e){return e&&e.__esModule?e:{default:e}}require("./register"),function(e,t){Object.keys(e).forEach(function(l){"default"===l||Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[l]}})})}(require("./type"),exports);const u=(0,e.template)('<li class="row">'),d=(0,e.template)('<span class="title">'),f=(0,e.template)('<span class="sub-title">'),h=(0,e.template)("<style> "),p=(0,e.template)("<style>"),m=(0,e.template)('<ul class="tree">'),g=function(c){let g;let y={small:6,normal:8,large:10},{baseStyle:v}=a.default,[$,b]=(0,t.createSignal)([]),[k,_]=(0,t.createSignal)([]),C={key:"key",name:"name",title:"title",subTitle:"subTitle",children:"children",description:"description"},w=(0,t.createMemo)(()=>Object.assign(C,c.fieldNames)),q=(0,t.createMemo)(()=>"rtl"===c.direction),S=(0,t.createMemo)(()=>void 0!==c.value&&null!==c.value?Array.isArray(c.value)?c.value:[c.value]:[]),j=Symbol("path"),O=Symbol("path-end");return(0,t.createEffect)(()=>{let e=c.fromSchema?(0,o.default)(c.data):(0,r.default)(c.data)?function(e){let t=w(),l=t.key,n=t.title,r=t.children,i=/[^\s|`│├└]/,o=e.trim().split("\n"),a=[{[n]:o[0],[l]:o[0]}];for(let e=1;e<o.length;e++){let t=o[e].search(i);if(-1===t)continue;let s={[n]:o[e].slice(t+3),depth:t};for(;a.length&&t<=(a[a.length-1].depth||0);)a.pop();if(!a.length)return[];let c=a[a.length-1];c[r]||(c[r]=[]),s[l]=`${c[l]}-${s[n]}-${t}-${e}`,c[r].push(s),a.push(s)}return[a[0]]}(c.data):c.data;b([...new Set(function e(t,l=0){let n=t.length-1,r=t[n],i=t[0],o=[],a=w(),s=a.key,c=a.children;for(let a=0,u=t.length;a<u;a++){let u=t[a],d=a===n;delete u[j],delete u[O],(0===a||d)&&(u[j]=i[s]+(1===t.length?"":`>${r[s]}`),d&&(u[O]=""),o.push(u[j])),u[c]&&(o=o.concat(e(u[c],l+1)))}return o}(e))]),_(e)}),(0,t.createEffect)(()=>{let e=$(),t=c.size||"normal";(0,l.default)(()=>{let l=e.length;if(g&&l){let n=y[t];for(let t=0;t<l;t++){let l=g.querySelectorAll(`li[data-path="${e[t]}"]`);if(l.length){let e=l[0].getBoundingClientRect(),r=e.height/2+n;if(l.length>1){let{bottom:i,height:o,top:a}=l[1].getBoundingClientRect();r=0===t?a-e.top:i-e.top-o/2+n,l[1].style.setProperty("--c","none")}else 0===t&&l[0].style.setProperty("--c","none");(1!==l.length||0!==t)&&l[0].style.setProperty("--line",`${Math.abs(r)}px`)}}}})}),[(()=>{let t=h(),l=t.firstChild;return(0,e.effect)(()=>l.data=v()),t})(),(()=>{let e=p();return e.textContent=s.style,e})(),(0,e.createComponent)(t.Show,{get when(){return c.css},get children(){let t=h(),l=t.firstChild;return(0,e.effect)(()=>l.data=(0,i.css)(c.css)),t}}),(()=>{let l=m(),r=g;return"function"==typeof r?(0,e.use)(r,l):g=l,(0,e.insert)(l,()=>(function l(r,i=0){return(0,e.createComponent)(t.For,{each:r,children:r=>{let o=w(),a=r[o.title],s=r[o.key],h=r[o.name],p=r[o.subTitle],m=r[o.children],g=h!==a&&h?[h,a]:[a];return[(()=>{let l=u();return l.$$dblclick=e=>c.onRowDoubleClick?.(e,s,r),l.$$click=e=>{!function(e,t){let l=w();(function(e,t){if(!c.readonly&&(0,n.default)(c.onChange)){let l=[...S()];if(c.multiple){let t=l.indexOf(e);-1===t?l.push(e):l.splice(t,1)}else l=c.toggle&&l[0]===e?[]:[e];c.onChange(c.multiple?l:l[0],t)}})(t[l.key],t),c.onRowClick?.(e,t[l.key],t)}(e,r)},(0,e.insert)(l,()=>(function(e,t,l){let n=c.renderRow?.(e,t,l)||[t,l];return q()?n.reverse():n})(r,(()=>{let t=d();return(0,e.insert)(t,()=>(q()?g.reverse():g).join(": ")),t})(),(0,e.createComponent)(t.Show,{when:p,get children(){let t=f();return(0,e.insert)(t,p),t}}))),(0,e.effect)(t=>{let o=!!S().includes(s),a=!!(c.readonly||!(0,n.default)(c.onChange)),u=i?{"--depth":`${2*i}em`}:void 0,d=r[O],f=r[j];return o!==t._v$&&l.classList.toggle("active",t._v$=o),a!==t._v$2&&l.classList.toggle("non",t._v$2=a),t._v$3=(0,e.style)(l,u,t._v$3),d!==t._v$4&&(0,e.setAttribute)(l,"data-path-end",t._v$4=d),f!==t._v$5&&(0,e.setAttribute)(l,"data-path",t._v$5=f),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),l})(),(0,e.createComponent)(t.Show,{when:m,get children(){return l(m,i+1)}})]}})})(k())),(0,e.effect)(t=>(0,e.classList)(l,{[c.size||"normal"]:!0,[c.class]:!!c.class,rtl:q()},t)),l})()]};(0,e.delegateEvents)(["click","dblclick"]);
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/tree/index.tsx"],"sourcesContent":["import { For, Show, createEffect, createMemo, createSignal } from 'solid-js';\nimport { frameCallback, isFunction, isString } from '@moneko/common';\nimport { css } from '@moneko/css';\nimport './register';\nimport { style } from './style';\nimport schema from '../from-schema';\nimport theme from '../theme';\nimport type {\n TreeData,\n TreeMultipleProps,\n TreeMultipleSchemaProps,\n TreeMultipleStringProps,\n TreeProps,\n TreeSchemaProps,\n TreeStack,\n TreeStringProps,\n} from './type';\n\nfunction Tree(\n _:\n | TreeProps\n | TreeMultipleProps\n | TreeMultipleSchemaProps\n | TreeSchemaProps\n | TreeMultipleStringProps\n | TreeStringProps,\n) {\n const sizeCnt = {\n small: 6,\n normal: 8,\n large: 10,\n };\n const { baseStyle } = theme;\n let el: HTMLUListElement | undefined;\n const [lines, setLines] = createSignal<string[]>([]);\n const [treeData, setTreeData] = createSignal<TreeData[]>([]);\n const normalFieldNames = {\n key: 'key' as const,\n name: 'name' as const,\n title: 'title' as const,\n subTitle: 'subTitle' as const,\n children: 'children' as const,\n description: 'description' as const,\n };\n const fieldNames = createMemo(() => Object.assign(normalFieldNames, _.fieldNames));\n const rtl = createMemo(() => _.direction === 'rtl');\n const current = createMemo(() => {\n if (_.value !== void 0 && _.value !== null) {\n return Array.isArray(_.value) ? _.value : [_.value];\n }\n return [];\n });\n const path = Symbol('path');\n const pathEnd = Symbol('path-end');\n\n function countLineLen(tree: TreeData[], depth = 0) {\n const lastIdx = tree.length - 1;\n const last = tree[lastIdx];\n const frist = tree[0];\n let line: string[] = [];\n const fields = fieldNames();\n const key = fields.key;\n const children = fields.children;\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const item = tree[i],\n isLast = i === lastIdx;\n\n delete item[path];\n delete item[pathEnd];\n if (i === 0 || isLast) {\n item[path] = frist[key] + (tree.length === 1 ? '' : `>${last[key]}`);\n if (isLast) {\n item[pathEnd] = '';\n }\n line.push(item[path]);\n }\n if (item[children]) {\n line = line.concat(countLineLen(item[children]!, depth + 1));\n }\n }\n return line;\n }\n\n function parseTree(str: string): TreeData[] {\n const fields = fieldNames();\n const key = fields.key;\n const title = fields.title;\n const children = fields.children;\n const depthRegex = /[^\\s|`│├└]/;\n const rows = str.trim().split('\\n');\n const stack: TreeStack[] = [{ [title]: rows[0], [key]: rows[0] }];\n\n for (let i = 1; i < rows.length; i++) {\n const depth = rows[i].search(depthRegex);\n\n if (depth === -1) {\n continue;\n }\n const node: Partial<TreeData> = {\n [title]: rows[i].slice(depth + 3),\n depth,\n };\n\n while (stack.length && depth <= (stack[stack.length - 1].depth || 0)) {\n stack.pop();\n }\n if (!stack.length) {\n return [];\n }\n const parent = stack[stack.length - 1];\n\n if (!parent[children]) {\n parent[children] = [];\n }\n node[key] = `${parent[key]}-${node[title]}-${depth}-${i}`;\n parent[children].push(node as TreeData);\n stack.push(node as TreeData);\n }\n\n return [stack[0]];\n }\n\n function handleChange(key: string, item: TreeData) {\n if (!_.readonly && isFunction(_.onChange)) {\n let _current = [...current()];\n\n if (_.multiple) {\n const idx = _current.indexOf(key);\n\n if (idx === -1) {\n _current.push(key);\n } else {\n _current.splice(idx, 1);\n }\n } else if (_.toggle && _current[0] === key) {\n _current = [];\n } else {\n _current = [key];\n }\n _.onChange(_.multiple ? _current : _current[0], item);\n }\n }\n function handleClick(e: MouseEvent, item: TreeData) {\n const fields = fieldNames();\n\n handleChange(item[fields.key], item);\n _.onRowClick?.(e, item[fields.key] as never, item as TreeData<never>);\n }\n function renderItem(item: TreeData, title: JSX.Element, subTitle?: JSX.Element): JSX.Element[] {\n const row = _.renderRow?.(item, title, subTitle) || [title, subTitle];\n\n return rtl() ? row.reverse() : row;\n }\n\n function renderTreeRow(list: TreeData[], depth = 0): JSX.Element {\n return (\n <For each={list}>\n {(item) => {\n const fields = fieldNames();\n const title = item[fields.title];\n const key = item[fields.key];\n const name = item[fields.name];\n const subTitle = item[fields.subTitle];\n const children = item[fields.children];\n const _title = name === title || !name ? [title] : [name, title];\n\n return (\n <>\n <li\n class=\"row\"\n classList={{\n active: current().includes(key),\n non: _.readonly || !isFunction(_.onChange),\n }}\n onClick={(e) => handleClick(e, item)}\n onDblClick={(e) => _.onRowDoubleClick?.(e, key, item)}\n style={depth ? { '--depth': `${depth * 2}em` } : void 0}\n data-path-end={item[pathEnd]}\n data-path={item[path]}\n >\n {renderItem(\n item,\n <span class=\"title\">{(rtl() ? _title.reverse() : _title).join(': ')}</span>,\n <Show when={subTitle}>\n <span class=\"sub-title\">{subTitle}</span>\n </Show>,\n )}\n </li>\n <Show when={children}>{renderTreeRow(children!, depth + 1)}</Show>\n </>\n );\n }}\n </For>\n );\n }\n createEffect(() => {\n const data = _.fromSchema ? schema(_.data) : isString(_.data) ? parseTree(_.data) : _.data;\n\n setLines([...new Set(countLineLen(data))]);\n setTreeData(data);\n });\n\n createEffect(() => {\n const list = lines();\n const size = _.size || 'normal';\n\n frameCallback(() => {\n const len = list.length;\n\n if (el && len) {\n const prefixSize = sizeCnt[size];\n\n for (let i = 0; i < len; i++) {\n const al: NodeListOf<HTMLLIElement> = el.querySelectorAll(`li[data-path=\"${list[i]}\"]`);\n\n if (al.length) {\n const rect1 = al[0].getBoundingClientRect();\n let sideLen = rect1.height / 2 + prefixSize;\n\n if (al.length > 1) {\n const { bottom, height, top } = al[1].getBoundingClientRect();\n\n sideLen = i === 0 ? top - rect1.top : bottom - rect1.top - height / 2 + prefixSize;\n al[1].style.setProperty('--c', 'none');\n } else if (i === 0) {\n al[0].style.setProperty('--c', 'none');\n }\n if (al.length !== 1 || i !== 0) {\n al[0].style.setProperty('--line', `${Math.abs(sideLen)}px`);\n }\n }\n }\n }\n });\n });\n\n return (\n <>\n <style textContent={baseStyle()} />\n <style textContent={style} />\n <Show when={_.css}>\n <style textContent={css(_.css)} />\n </Show>\n <ul\n ref={el}\n class=\"tree\"\n classList={{\n [_.size || 'normal']: true,\n [_.class as string]: !!_.class,\n rtl: rtl(),\n }}\n >\n {renderTreeRow(treeData())}\n </ul>\n </>\n );\n}\n\nexport * from './type';\nexport default Tree;\n"],"names":["_","el","sizeCnt","small","normal","large","baseStyle","theme","lines","setLines","createSignal","treeData","setTreeData","normalFieldNames","key","name","title","subTitle","children","description","fieldNames","createMemo","Object","assign","rtl","direction","current","value","Array","isArray","path","Symbol","pathEnd","createEffect","data","fromSchema","schema","isString","parseTree","str","fields","depthRegex","rows","trim","split","stack","i","length","depth","search","node","slice","pop","parent","push","Set","countLineLen","tree","lastIdx","last","frist","line","len","item","isLast","concat","list","size","frameCallback","prefixSize","al","querySelectorAll","rect1","getBoundingClientRect","sideLen","height","bottom","top","style","setProperty","Math","abs","Show","css","renderTreeRow","For","_title","e","onRowDoubleClick","handleClick","handleChange","readonly","isFunction","onChange","_current","multiple","idx","indexOf","splice","toggle","onRowClick","renderItem","row","renderRow","reverse","join","includes","class"],"mappings":"kGAoQA,+CAAA,+CApQkE,wBACd,iDAAA,8CAAA,0CAChC,uBACb,8BACe,uBACH,+BACD,8PA6PJ,mPACd,EAlPA,SACEA,CAMmB,MAQfC,EANJ,IAAMC,EAAU,CACdC,MAAO,EACPC,OAAQ,EACRC,MAAO,EACT,EACM,CAAEC,UAAAA,CAAS,CAAE,CAAGC,SAAK,CAErB,CAACC,EAAOC,EAAS,CAAGC,GAAAA,cAAY,EAAW,EAAE,EAC7C,CAACC,EAAUC,EAAY,CAAGF,GAAAA,cAAY,EAAa,EAAE,EACrDG,EAAmB,CACvBC,IAAK,M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,CACT,CAACX,EAAEmE,IAAI,EAAI,SAAS,CAAE,CAAA,EACtB,CAACnE,EAAE2G,KAAK,CAAW,CAAE,CAAC,CAAC3G,EAAE2G,KAAK,CAC9BnF,IAAKA,GACP,YAMR"}
1
+ {"version":3,"sources":["../../components/tree/index.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, Show } from 'solid-js';\nimport { frameCallback, isFunction, isString } from '@moneko/common';\nimport { css } from '@moneko/css';\n\nimport schema from '../from-schema';\nimport theme from '../theme';\n\nimport { style } from './style';\nimport type {\n TreeData,\n TreeMultipleProps,\n TreeMultipleSchemaProps,\n TreeMultipleStringProps,\n TreeProps,\n TreeSchemaProps,\n TreeStack,\n TreeStringProps,\n} from './type';\n\nimport './register';\n\nfunction Tree(\n _:\n | TreeProps\n | TreeMultipleProps\n | TreeMultipleSchemaProps\n | TreeSchemaProps\n | TreeMultipleStringProps\n | TreeStringProps,\n) {\n const sizeCnt = {\n small: 6,\n normal: 8,\n large: 10,\n };\n const { baseStyle } = theme;\n let el: HTMLUListElement | undefined;\n const [lines, setLines] = createSignal<string[]>([]);\n const [treeData, setTreeData] = createSignal<TreeData[]>([]);\n const normalFieldNames = {\n key: 'key' as const,\n name: 'name' as const,\n title: 'title' as const,\n subTitle: 'subTitle' as const,\n children: 'children' as const,\n description: 'description' as const,\n };\n const fieldNames = createMemo(() => Object.assign(normalFieldNames, _.fieldNames));\n const rtl = createMemo(() => _.direction === 'rtl');\n const current = createMemo(() => {\n if (_.value !== void 0 && _.value !== null) {\n return Array.isArray(_.value) ? _.value : [_.value];\n }\n return [];\n });\n const path = Symbol('path');\n const pathEnd = Symbol('path-end');\n\n function countLineLen(tree: TreeData[], depth = 0) {\n const lastIdx = tree.length - 1;\n const last = tree[lastIdx];\n const frist = tree[0];\n let line: string[] = [];\n const fields = fieldNames();\n const key = fields.key;\n const children = fields.children;\n\n for (let i = 0, len = tree.length; i < len; i++) {\n const item = tree[i],\n isLast = i === lastIdx;\n\n delete item[path];\n delete item[pathEnd];\n if (i === 0 || isLast) {\n item[path] = frist[key] + (tree.length === 1 ? '' : `>${last[key]}`);\n if (isLast) {\n item[pathEnd] = '';\n }\n line.push(item[path]);\n }\n if (item[children]) {\n line = line.concat(countLineLen(item[children], depth + 1));\n }\n }\n return line;\n }\n\n function parseTree(str: string): TreeData[] {\n const fields = fieldNames();\n const key = fields.key;\n const title = fields.title;\n const children = fields.children;\n const depthRegex = /[^\\s|`│├└]/;\n const rows = str.trim().split('\\n');\n const stack: TreeStack[] = [{ [title]: rows[0], [key]: rows[0] }];\n\n for (let i = 1; i < rows.length; i++) {\n const depth = rows[i].search(depthRegex);\n\n if (depth === -1) {\n continue;\n }\n const node: Partial<TreeData> = {\n [title]: rows[i].slice(depth + 3),\n depth,\n };\n\n while (stack.length && depth <= (stack[stack.length - 1].depth || 0)) {\n stack.pop();\n }\n if (!stack.length) {\n return [];\n }\n const parent = stack[stack.length - 1];\n\n if (!parent[children]) {\n parent[children] = [];\n }\n node[key] = `${parent[key]}-${node[title]}-${depth}-${i}`;\n parent[children].push(node as TreeData);\n stack.push(node as TreeData);\n }\n\n return [stack[0]];\n }\n\n function handleChange(key: string, item: TreeData) {\n if (!_.readonly && isFunction(_.onChange)) {\n let _current = [...current()];\n\n if (_.multiple) {\n const idx = _current.indexOf(key);\n\n if (idx === -1) {\n _current.push(key);\n } else {\n _current.splice(idx, 1);\n }\n } else if (_.toggle && _current[0] === key) {\n _current = [];\n } else {\n _current = [key];\n }\n _.onChange(_.multiple ? _current : _current[0], item);\n }\n }\n function handleClick(e: MouseEvent, item: TreeData) {\n const fields = fieldNames();\n\n handleChange(item[fields.key], item);\n _.onRowClick?.(e, item[fields.key] as never, item as TreeData<never>);\n }\n function renderItem(item: TreeData, title: JSX.Element, subTitle?: JSX.Element): JSX.Element[] {\n const row = _.renderRow?.(item, title, subTitle) || [title, subTitle];\n\n return rtl() ? row.reverse() : row;\n }\n\n function renderTreeRow(list: TreeData[], depth = 0): JSX.Element {\n return (\n <For each={list}>\n {(item) => {\n const fields = fieldNames();\n const title = item[fields.title];\n const key = item[fields.key];\n const name = item[fields.name];\n const subTitle = item[fields.subTitle];\n const children = item[fields.children];\n const _title = name === title || !name ? [title] : [name, title];\n\n return (\n <>\n <li\n class=\"row\"\n classList={{\n active: current().includes(key),\n non: _.readonly || !isFunction(_.onChange),\n }}\n onClick={(e) => {\n handleClick(e, item);\n }}\n onDblClick={(e) => _.onRowDoubleClick?.(e, key, item)}\n style={depth ? { '--depth': `${depth * 2}em` } : void 0}\n data-path-end={item[pathEnd]}\n data-path={item[path]}\n >\n {renderItem(\n item,\n <span class=\"title\">{(rtl() ? _title.reverse() : _title).join(': ')}</span>,\n <Show when={subTitle}>\n <span class=\"sub-title\">{subTitle}</span>\n </Show>,\n )}\n </li>\n <Show when={children}>{renderTreeRow(children!, depth + 1)}</Show>\n </>\n );\n }}\n </For>\n );\n }\n createEffect(() => {\n const data = _.fromSchema ? schema(_.data) : isString(_.data) ? parseTree(_.data) : _.data;\n\n setLines([...new Set(countLineLen(data))]);\n setTreeData(data);\n });\n\n createEffect(() => {\n const list = lines();\n const size = _.size || 'normal';\n\n frameCallback(() => {\n const len = list.length;\n\n if (el && len) {\n const prefixSize = sizeCnt[size];\n\n for (let i = 0; i < len; i++) {\n const al: NodeListOf<HTMLLIElement> = el.querySelectorAll(`li[data-path=\"${list[i]}\"]`);\n\n if (al.length) {\n const rect1 = al[0].getBoundingClientRect();\n let sideLen = rect1.height / 2 + prefixSize;\n\n if (al.length > 1) {\n const { bottom, height, top } = al[1].getBoundingClientRect();\n\n sideLen = i === 0 ? top - rect1.top : bottom - rect1.top - height / 2 + prefixSize;\n al[1].style.setProperty('--c', 'none');\n } else if (i === 0) {\n al[0].style.setProperty('--c', 'none');\n }\n if (al.length !== 1 || i !== 0) {\n al[0].style.setProperty('--line', `${Math.abs(sideLen)}px`);\n }\n }\n }\n }\n });\n });\n\n return (\n <>\n <style textContent={baseStyle()} />\n <style textContent={style} />\n <Show when={_.css}>\n <style textContent={css(_.css)} />\n </Show>\n <ul\n ref={el}\n class=\"tree\"\n classList={{\n [_.size || 'normal']: true,\n [_.class!]: !!_.class,\n rtl: rtl(),\n }}\n >\n {renderTreeRow(treeData())}\n </ul>\n </>\n );\n}\n\nexport * from './type';\nexport default Tree;\n"],"names":["_","el","sizeCnt","small","normal","large","baseStyle","theme","lines","setLines","createSignal","treeData","setTreeData","normalFieldNames","key","name","title","subTitle","children","description","fieldNames","createMemo","Object","assign","rtl","direction","current","value","Array","isArray","path","Symbol","pathEnd","createEffect","data","fromSchema","schema","isString","parseTree","str","fields","depthRegex","rows","trim","split","stack","i","length","depth","search","node","slice","pop","parent","push","Set","countLineLen","tree","lastIdx","last","frist","line","len","item","isLast","concat","list","size","frameCallback","prefixSize","al","querySelectorAll","rect1","getBoundingClientRect","sideLen","height","bottom","top","style","setProperty","Math","abs","Show","css","renderTreeRow","For","_title","e","onRowDoubleClick","handleClick","handleChange","readonly","isFunction","onChange","_current","multiple","idx","indexOf","splice","toggle","onRowClick","renderItem","row","renderRow","reverse","join","includes","class"],"mappings":"kGAyQA,+CAAA,+CAzQkE,wBACd,iDAAA,8CAAA,0CAChC,2BAED,+BACD,uBAEI,sEAYf,2MAqPO,mPACd,EApPA,SACEA,CAMmB,MAQfC,EANJ,IAAMC,EAAU,CACdC,MAAO,EACPC,OAAQ,EACRC,MAAO,EACT,EACM,CAAEC,UAAAA,CAAS,CAAE,CAAGC,SAAK,CAErB,CAACC,EAAOC,EAAS,CAAGC,GAAAA,cAAY,EAAW,EAAE,EAC7C,CAACC,EAAUC,EAAY,CAAGF,GAAAA,cAAY,EAAa,EAAE,EACrDG,EAAmB,CACvBC,IAAK,MACLC,KAAM,OACNC,MAAO,QACPC,SAAU,WACVC,SAAU,WACVC,YAAa,aACf,EACMC,EAAaC,GAAAA,YAAU,EAAC,IAAMC,OAAOC,MAAM,CAACV,EAAkBb,EAAEoB,UAAU,GAC1EI,EAAMH,GAAAA,YAAU,EAAC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/register.tsx"],"sourcesContent":["import { createEffect, mergeProps } from 'solid-js';\nimport { customElement } from 'solid-element';\nimport Tree from './index';\nimport type { TreeData, TreeProps } from './type';\n\ncustomElement<TreeProps>(\n 'n-tree',\n {\n fieldNames: {},\n fromSchema: void 0,\n size: void 0,\n data: [],\n multiple: void 0,\n value: void 0,\n onChange: void 0,\n class: void 0,\n css: void 0,\n readonly: void 0,\n toggle: void 0,\n direction: void 0,\n onRowClick: void 0,\n onRowDoubleClick: void 0,\n renderRow: void 0,\n },\n (_, opt) => {\n const el = opt.element;\n const props = mergeProps(\n {\n data: el.data,\n value: el.value,\n multiple: el.multiple,\n fromSchema: el.fromSchema,\n size: el.size,\n css: el.css,\n readonly: el.readonly,\n toggle: el.toggle,\n direction: el.direction,\n onChange(key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('change', {\n detail: [key, item],\n }),\n );\n },\n onRowClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowclick', {\n detail: [e, key, item],\n }),\n );\n },\n onRowDoubleClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowdoubleclick', {\n detail: [e, key, item],\n }),\n );\n },\n },\n _,\n );\n\n createEffect(() => {\n el.removeAttribute('css');\n el.removeAttribute('field-names');\n el.removeAttribute('data');\n });\n return <Tree {...props} />;\n },\n);\n"],"names":["customElement","fieldNames","fromSchema","size","data","multiple","value","onChange","class","css","readonly","toggle","direction","onRowClick","onRowDoubleClick","renderRow","_","opt","el","element","props","mergeProps","key","item","dispatchEvent","CustomEvent","detail","e","createEffect","removeAttribute","Tree"],"mappings":"oHAAyC,sBACX,8BACb,wCAGjBA,GAAAA,eAAa,EACX,SACA,CACEC,WAAY,CAAC,EACbC,WAAY,KAAK,EACjBC,KAAM,KAAK,EACXC,KAAM,EAAE,CACRC,SAAU,KAAK,EACfC,MAAO,KAAK,EACZC,SAAU,KAAK,EACfC,MAAO,KAAK,EACZC,IAAK,KAAK,EACVC,SAAU,KAAK,EACfC,OAAQ,KAAK,EACbC,UAAW,KAAK,EAChBC,WAAY,KAAK,EACjBC,iBAAkB,KAAK,EACvBC,UAAW,KAAK,CAClB,EACA,CAACC,EAAGC,KACF,IAAMC,EAAKD,EAAIE,OAAO,CAChBC,EAAQC,GAAAA,YAAU,EACtB,CACEjB,KAAMc,EAAGd,IAAI,CACbE,MAAOY,EAAGZ,KAAK,CACfD,SAAUa,EAAGb,QAAQ,CACrBH,WAAYgB,EAAGhB,UAAU,CACzBC,KAAMe,EAAGf,IAAI,CACbM,IAAKS,EAAGT,GAAG,CACXC,SAAUQ,EAAGR,QAAQ,CACrBC,OAAQO,EAAGP,MAAM,CACjBC,UAAWM,EAAGN,SAAS,CACvBL,SAASe,CAAW,CAAEC,CAAc,EAClCL,EAAGM,aAAa,CACd,IAAIC,YAAY,SAAU,CACxBC,OAAQ,CAACJ,EAAKC,EAAK,AACrB,GAEJ,EACAV,WAAWc,CAAa,CAAEL,CAAW,CAAEC,CAAc,EACnDL,EAAGM,aAAa,CACd,IAAIC,YAAY,WAAY,CAC1BC,OAAQ,CAACC,EAAGL,EAAKC,EAAK,AACxB,GAEJ,EACAT,iBAAiBa,CAAa,CAAEL,CAAW,CAAEC,CAAc,EACzDL,EAAGM,aAAa,CACd,IAAIC,YAAY,iBAAkB,CAChCC,OAAQ,CAACC,EAAGL,EAAKC,EAAK,AACxB,GAEJ,CACF,EACAP,GAQF,MALAY,GAAAA,cAAY,EAAC,KACXV,EAAGW,eAAe,CAAC,OACnBX,EAAGW,eAAe,CAAC,eACnBX,EAAGW,eAAe,CAAC,OACrB,yBACQC,SAAI,CAAKV,EACnB"}
1
+ {"version":3,"sources":["../../components/tree/register.tsx"],"sourcesContent":["import { createEffect, mergeProps } from 'solid-js';\nimport { customElement } from 'solid-element';\n\nimport Tree from './index';\nimport type { TreeData, TreeProps } from './type';\n\ncustomElement<TreeProps>(\n 'n-tree',\n {\n fieldNames: {},\n fromSchema: void 0,\n size: void 0,\n data: [],\n multiple: void 0,\n value: void 0,\n onChange: void 0,\n class: void 0,\n css: void 0,\n readonly: void 0,\n toggle: void 0,\n direction: void 0,\n onRowClick: void 0,\n onRowDoubleClick: void 0,\n renderRow: void 0,\n },\n (_, opt) => {\n const el = opt.element;\n const props = mergeProps(\n {\n data: el.data,\n value: el.value,\n multiple: el.multiple,\n fromSchema: el.fromSchema,\n size: el.size,\n css: el.css,\n readonly: el.readonly,\n toggle: el.toggle,\n direction: el.direction,\n onChange(key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('change', {\n detail: [key, item],\n }),\n );\n },\n onRowClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowclick', {\n detail: [e, key, item],\n }),\n );\n },\n onRowDoubleClick(e: MouseEvent, key: string, item: TreeData) {\n el.dispatchEvent(\n new CustomEvent('rowdoubleclick', {\n detail: [e, key, item],\n }),\n );\n },\n },\n _,\n );\n\n createEffect(() => {\n el.removeAttribute('css');\n el.removeAttribute('field-names');\n el.removeAttribute('data');\n });\n return <Tree {...props} />;\n },\n);\n"],"names":["customElement","fieldNames","fromSchema","size","data","multiple","value","onChange","class","css","readonly","toggle","direction","onRowClick","onRowDoubleClick","renderRow","_","opt","el","element","props","mergeProps","key","item","dispatchEvent","CustomEvent","detail","e","createEffect","removeAttribute","Tree"],"mappings":"oHAAyC,sBACX,8BAEb,wCAGjBA,GAAAA,eAAa,EACX,SACA,CACEC,WAAY,CAAC,EACbC,WAAY,KAAK,EACjBC,KAAM,KAAK,EACXC,KAAM,EAAE,CACRC,SAAU,KAAK,EACfC,MAAO,KAAK,EACZC,SAAU,KAAK,EACfC,MAAO,KAAK,EACZC,IAAK,KAAK,EACVC,SAAU,KAAK,EACfC,OAAQ,KAAK,EACbC,UAAW,KAAK,EAChBC,WAAY,KAAK,EACjBC,iBAAkB,KAAK,EACvBC,UAAW,KAAK,CAClB,EACA,CAACC,EAAGC,KACF,IAAMC,EAAKD,EAAIE,OAAO,CAChBC,EAAQC,GAAAA,YAAU,EACtB,CACEjB,KAAMc,EAAGd,IAAI,CACbE,MAAOY,EAAGZ,KAAK,CACfD,SAAUa,EAAGb,QAAQ,CACrBH,WAAYgB,EAAGhB,UAAU,CACzBC,KAAMe,EAAGf,IAAI,CACbM,IAAKS,EAAGT,GAAG,CACXC,SAAUQ,EAAGR,QAAQ,CACrBC,OAAQO,EAAGP,MAAM,CACjBC,UAAWM,EAAGN,SAAS,CACvBL,SAASe,CAAW,CAAEC,CAAc,EAClCL,EAAGM,aAAa,CACd,IAAIC,YAAY,SAAU,CACxBC,OAAQ,CAACJ,EAAKC,EAAK,AACrB,GAEJ,EACAV,WAAWc,CAAa,CAAEL,CAAW,CAAEC,CAAc,EACnDL,EAAGM,aAAa,CACd,IAAIC,YAAY,WAAY,CAC1BC,OAAQ,CAACC,EAAGL,EAAKC,EAAK,AACxB,GAEJ,EACAT,iBAAiBa,CAAa,CAAEL,CAAW,CAAEC,CAAc,EACzDL,EAAGM,aAAa,CACd,IAAIC,YAAY,iBAAkB,CAChCC,OAAQ,CAACC,EAAGL,EAAKC,EAAK,AACxB,GAEJ,CACF,EACAP,GAQF,MALAY,GAAAA,cAAY,EAAC,KACXV,EAAGW,eAAe,CAAC,OACnBX,EAAGW,eAAe,CAAC,eACnBX,EAAGW,eAAe,CAAC,OACrB,yBACQC,SAAI,CAAKV,EACnB"}
@@ -0,0 +1,10 @@
1
+ ---
2
+ type: 通用
3
+ title: 文字排版
4
+ subtitle: n-typography
5
+ icon: 🦟
6
+ ---
7
+
8
+ # Typography 排版
9
+
10
+ > 文本的基本格式