react-kui 3.0.0 → 3.1.1

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 (481) hide show
  1. package/AI.en-US.md +86 -1
  2. package/AI.md +68 -4
  3. package/ai/behaviors.json +114 -14
  4. package/ai/cli.mjs +180 -17
  5. package/ai/descriptions.json +446 -0
  6. package/ai/kui-components.json +4591 -3846
  7. package/ai/mcp.mjs +2 -189
  8. package/ai/query.mjs +195 -0
  9. package/ai/skills/react-kui/SKILL.md +41 -9
  10. package/ai/skills/react-kui/references/mcp.md +11 -1
  11. package/ai/skills/react-kui/references/react-to-vue.md +110 -0
  12. package/ai/skills/react-kui/references/vue-to-react.md +86 -0
  13. package/ai/validate.mjs +18 -0
  14. package/es/_virtual/_rolldown/runtime.js +1 -1
  15. package/es/affix/index.js +1 -1
  16. package/es/alert/index.js +29 -15
  17. package/es/anchor/anchor-context.js +1 -1
  18. package/es/anchor/anchor-link.js +1 -1
  19. package/es/anchor/anchor.js +1 -1
  20. package/es/auto-complete/index.js +378 -437
  21. package/es/avatar/avatar-group-context.js +1 -1
  22. package/es/avatar/avatar-group.js +1 -1
  23. package/es/avatar/avatar.js +2 -2
  24. package/es/back-top/index.js +3 -3
  25. package/es/badge/index.js +6 -2
  26. package/es/base/teleport.js +19 -30
  27. package/es/base/transition-props.js +1 -1
  28. package/es/base/transition.js +3 -3
  29. package/es/breadcrumb/breadcrumb-context.js +1 -1
  30. package/es/breadcrumb/breadcrumb-item.js +1 -1
  31. package/es/breadcrumb/breadcrumb.js +1 -1
  32. package/es/button/button-group-context.js +1 -1
  33. package/es/button/button-group.js +1 -1
  34. package/es/button/button.js +2 -2
  35. package/es/calendar/index.js +1 -1
  36. package/es/card/index.js +1 -1
  37. package/es/carousel/carousel-context.js +1 -1
  38. package/es/carousel/carousel-item.js +1 -1
  39. package/es/carousel/carousel.js +522 -274
  40. package/es/carousel/drag.js +169 -0
  41. package/es/cascader/index.js +104 -170
  42. package/es/check-card/check-card-group.js +1 -1
  43. package/es/check-card/check-card.js +143 -143
  44. package/es/check-card/context.js +1 -1
  45. package/es/checkbox/checkbox-group-context.js +1 -1
  46. package/es/checkbox/checkbox-group.js +1 -1
  47. package/es/checkbox/checkbox.js +131 -112
  48. package/es/checkbox/index.js +1 -1
  49. package/es/collapse/collapse-panel.js +2 -2
  50. package/es/collapse/collapse.js +96 -103
  51. package/es/color-picker/alpha.js +81 -63
  52. package/es/color-picker/hue.js +69 -51
  53. package/es/color-picker/index.js +79 -128
  54. package/es/color-picker/mode.js +1 -1
  55. package/es/color-picker/paint.js +85 -67
  56. package/es/color-picker/presets.js +1 -1
  57. package/es/components.js +4 -2
  58. package/es/config/config-context.js +1 -1
  59. package/es/config/context.js +1 -1
  60. package/es/config/index.js +1 -1
  61. package/es/config/size-context.js +1 -1
  62. package/es/config/use-config-appearance.js +1 -1
  63. package/es/const/var.js +1 -1
  64. package/es/date-picker/index.js +591 -678
  65. package/es/descriptions/descriptions-item.js +1 -1
  66. package/es/descriptions/descriptions.js +2 -2
  67. package/es/divider/index.js +1 -1
  68. package/es/drawer/index.js +193 -190
  69. package/es/dropdown/dropdown-button.js +1 -1
  70. package/es/dropdown/dropdown-context.js +1 -1
  71. package/es/dropdown/dropdown.js +173 -331
  72. package/es/dropdown/trigger.js +1 -1
  73. package/es/empty/index.js +1 -1
  74. package/es/feature-card/index.js +1 -1
  75. package/es/feedback-panel/index.js +1 -1
  76. package/es/flame-wrap/index.js +1 -1
  77. package/es/flame-wrap/types.js +1 -1
  78. package/es/flex/index.js +1 -1
  79. package/es/form/field-context.js +1 -1
  80. package/es/form/form-context.js +1 -1
  81. package/es/form/form-item.js +2 -2
  82. package/es/form/form.js +1 -1
  83. package/es/form/utils.js +1 -1
  84. package/es/grid/grid-item.js +1 -1
  85. package/es/grid/grid.js +1 -1
  86. package/es/grid/useBreakpoint.js +1 -1
  87. package/es/icon/index.js +1 -1
  88. package/es/image/group.js +1 -1
  89. package/es/image/image-group-context.js +1 -1
  90. package/es/image/image.js +1 -1
  91. package/es/image/instance.js +1 -1
  92. package/es/image/preview.js +2 -2
  93. package/es/image/utils.js +1 -1
  94. package/es/index.js +3 -2
  95. package/es/input/index.js +1 -1
  96. package/es/input/input-base.js +202 -0
  97. package/es/input/input-box.js +1 -1
  98. package/es/input/input-group.js +2 -2
  99. package/es/input/input.js +19 -188
  100. package/es/input/textarea.js +1 -1
  101. package/es/input-number/index.js +4 -4
  102. package/es/input-otp/index.js +2 -1
  103. package/es/input-tag/index.js +13 -43
  104. package/es/kanban/index.js +1 -1
  105. package/es/layout/index.js +1 -1
  106. package/es/layout/layout-context.js +1 -1
  107. package/es/list-panel/index.js +1 -1
  108. package/es/loading/index.js +1 -1
  109. package/es/loading/loading-bar.js +1 -1
  110. package/es/locale/de.js +1 -1
  111. package/es/locale/el.js +1 -1
  112. package/es/locale/en.js +1 -1
  113. package/es/locale/fr.js +1 -1
  114. package/es/locale/it.js +1 -1
  115. package/es/locale/ja.js +1 -1
  116. package/es/locale/ko.js +1 -1
  117. package/es/locale/ru.js +1 -1
  118. package/es/locale/th.js +1 -1
  119. package/es/locale/uk.js +1 -1
  120. package/es/locale/vi.js +1 -1
  121. package/es/locale/zh-CN.js +1 -1
  122. package/es/locale/zh-TW.js +1 -1
  123. package/es/mentions/index.js +341 -387
  124. package/es/menu/menu-context.js +1 -1
  125. package/es/menu/menu-divider.js +1 -1
  126. package/es/menu/menu-group.js +1 -1
  127. package/es/menu/menu-item.js +3 -3
  128. package/es/menu/menu-keyboard.js +1 -1
  129. package/es/menu/menu.js +215 -220
  130. package/es/menu/recursive-menu.js +1 -1
  131. package/es/menu/sub-menu.js +3 -3
  132. package/es/message/index.js +1 -1
  133. package/es/modal/api.js +1 -1
  134. package/es/modal/modal.js +247 -244
  135. package/es/modal/toast.js +1 -1
  136. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  137. package/es/notice/container.js +1 -1
  138. package/es/notice/content.js +1 -1
  139. package/es/notice/index.js +1 -1
  140. package/es/notice/instance.js +1 -1
  141. package/es/page/index.js +101 -78
  142. package/es/page/responsive.js +96 -0
  143. package/es/page-header/index.js +1 -1
  144. package/es/popconfirm/index.js +89 -241
  145. package/es/poptip/index.js +83 -243
  146. package/es/popup/index.js +429 -0
  147. package/es/popup/layers.js +33 -0
  148. package/es/progress/index.js +1 -1
  149. package/es/qrcode/index.js +1 -1
  150. package/es/radio/radio-button.js +53 -53
  151. package/es/radio/radio-group-context.js +1 -1
  152. package/es/radio/radio-group.js +1 -1
  153. package/es/radio/radio.js +110 -91
  154. package/es/rate/index.js +58 -57
  155. package/es/rate/star.js +1 -1
  156. package/es/result/index.js +1 -1
  157. package/es/ripple/index.js +1 -1
  158. package/es/ripple/types.js +1 -1
  159. package/es/row-col/col.js +1 -1
  160. package/es/row-col/row.js +1 -1
  161. package/es/segmented/index.js +1 -1
  162. package/es/select/option.js +69 -61
  163. package/es/select/select.js +78 -213
  164. package/es/skeleton/skeleton-avatar.js +1 -1
  165. package/es/skeleton/skeleton-button.js +1 -1
  166. package/es/skeleton/skeleton-image.js +1 -1
  167. package/es/skeleton/skeleton-text.js +1 -1
  168. package/es/skeleton/skeleton.js +1 -1
  169. package/es/skeleton/use-skeleton-loading.js +1 -1
  170. package/es/slider/index.js +89 -55
  171. package/es/slider/thumb.js +2 -1
  172. package/es/space/index.js +2 -2
  173. package/es/spin/index.js +1 -1
  174. package/es/splitter/splitter-panel.js +1 -1
  175. package/es/splitter/splitter.js +1 -1
  176. package/es/stat-card/countup.js +8 -4
  177. package/es/stat-card/rollup.js +122 -0
  178. package/es/stat-card/stat-card.js +1 -1
  179. package/es/stat-card/stat-number.js +1 -1
  180. package/es/stat-card/utils/countup.js +2 -2
  181. package/es/stat-card/utils/odometer.js +104 -107
  182. package/es/steps/index.js +1 -1
  183. package/es/switch/index.js +7 -6
  184. package/es/table/column-setting.js +1 -1
  185. package/es/table/index.js +33 -29
  186. package/es/table/utils.js +1 -1
  187. package/es/tabs/tab-panel.js +1 -1
  188. package/es/tabs/tabs.js +15 -6
  189. package/es/tag/index.js +9 -5
  190. package/es/time-line/timeline-item.js +1 -1
  191. package/es/time-line/timeline.js +1 -1
  192. package/es/tooltip/index.js +127 -248
  193. package/es/tour/index.js +198 -193
  194. package/es/transfer/index.js +245 -246
  195. package/es/tree/index.js +72 -67
  196. package/es/tree/utils.js +1 -1
  197. package/es/tree-select/index.js +562 -655
  198. package/es/typography/index.js +1 -1
  199. package/es/upload/file-list.js +3 -1
  200. package/es/upload/index.js +8 -8
  201. package/es/upload/picture-sort.js +1 -1
  202. package/es/upload/selector.js +121 -116
  203. package/es/utils/checked.js +1 -1
  204. package/es/utils/color.js +1 -1
  205. package/es/utils/number.js +1 -1
  206. package/es/utils/placement.js +1 -1
  207. package/es/utils/popup.js +42 -0
  208. package/es/utils/react-node.js +1 -1
  209. package/es/utils/selection-tags.js +55 -0
  210. package/es/utils/share.js +1 -1
  211. package/es/utils/theme.js +1 -1
  212. package/es/utils/transition.js +1 -1
  213. package/es/utils/use-value.js +1 -1
  214. package/es/virtual-list/index.js +1 -1
  215. package/es/virtual-list/range.js +1 -1
  216. package/es/watermark/index.js +1 -1
  217. package/lib/index.cjs +2 -2
  218. package/lib/locale/de.cjs +1 -1
  219. package/lib/locale/el.cjs +1 -1
  220. package/lib/locale/en.cjs +1 -1
  221. package/lib/locale/fr.cjs +1 -1
  222. package/lib/locale/it.cjs +1 -1
  223. package/lib/locale/ja.cjs +1 -1
  224. package/lib/locale/ko.cjs +1 -1
  225. package/lib/locale/ru.cjs +1 -1
  226. package/lib/locale/th.cjs +1 -1
  227. package/lib/locale/uk.cjs +1 -1
  228. package/lib/locale/vi.cjs +1 -1
  229. package/lib/locale/zh-CN.cjs +1 -1
  230. package/lib/locale/zh-TW.cjs +1 -1
  231. package/package.json +35 -29
  232. package/style/base.css +1 -1
  233. package/style/components.css +2 -2
  234. package/style/index.css +2 -2
  235. package/style/theme.css +2 -2
  236. package/types/affix/index.d.cts +1 -1
  237. package/types/affix/index.d.ts +1 -1
  238. package/types/alert/index.d.cts +2 -1
  239. package/types/alert/index.d.ts +2 -1
  240. package/types/anchor/anchor-link.d.cts +1 -1
  241. package/types/anchor/anchor-link.d.ts +1 -1
  242. package/types/anchor/anchor.d.cts +1 -1
  243. package/types/anchor/anchor.d.ts +1 -1
  244. package/types/auto-complete/index.d.cts +1 -2
  245. package/types/auto-complete/index.d.ts +1 -2
  246. package/types/avatar/avatar-group.d.cts +1 -1
  247. package/types/avatar/avatar-group.d.ts +1 -1
  248. package/types/avatar/avatar.d.cts +1 -1
  249. package/types/avatar/avatar.d.ts +1 -1
  250. package/types/back-top/index.d.cts +1 -1
  251. package/types/back-top/index.d.ts +1 -1
  252. package/types/badge/index.d.cts +1 -1
  253. package/types/badge/index.d.ts +1 -1
  254. package/types/base/transition.d.cts +1 -0
  255. package/types/base/transition.d.ts +1 -0
  256. package/types/breadcrumb/breadcrumb-item.d.cts +1 -1
  257. package/types/breadcrumb/breadcrumb-item.d.ts +1 -1
  258. package/types/breadcrumb/breadcrumb.d.cts +1 -1
  259. package/types/breadcrumb/breadcrumb.d.ts +1 -1
  260. package/types/button/button-group.d.cts +1 -1
  261. package/types/button/button-group.d.ts +1 -1
  262. package/types/button/button.d.cts +1 -1
  263. package/types/button/button.d.ts +1 -1
  264. package/types/calendar/index.d.cts +1 -1
  265. package/types/calendar/index.d.ts +1 -1
  266. package/types/card/index.d.cts +2 -2
  267. package/types/card/index.d.ts +2 -2
  268. package/types/carousel/carousel-item.d.cts +1 -1
  269. package/types/carousel/carousel-item.d.ts +1 -1
  270. package/types/carousel/carousel.d.cts +2 -1
  271. package/types/carousel/carousel.d.ts +2 -1
  272. package/types/carousel/drag.d.cts +19 -0
  273. package/types/carousel/drag.d.ts +19 -0
  274. package/types/cascader/index.d.cts +1 -1
  275. package/types/cascader/index.d.ts +1 -1
  276. package/types/cascader/types.d.cts +1 -2
  277. package/types/cascader/types.d.ts +1 -2
  278. package/types/check-card/types.d.cts +2 -3
  279. package/types/check-card/types.d.ts +2 -3
  280. package/types/checkbox/checkbox-group.d.cts +1 -1
  281. package/types/checkbox/checkbox-group.d.ts +1 -1
  282. package/types/checkbox/checkbox.d.cts +1 -2
  283. package/types/checkbox/checkbox.d.ts +1 -2
  284. package/types/checkbox/index.d.cts +1 -1
  285. package/types/checkbox/index.d.ts +1 -1
  286. package/types/collapse/collapse-panel.d.cts +1 -1
  287. package/types/collapse/collapse-panel.d.ts +1 -1
  288. package/types/collapse/collapse.d.cts +1 -2
  289. package/types/collapse/collapse.d.ts +1 -2
  290. package/types/color-picker/alpha.d.cts +2 -1
  291. package/types/color-picker/alpha.d.ts +2 -1
  292. package/types/color-picker/hue.d.cts +2 -1
  293. package/types/color-picker/hue.d.ts +2 -1
  294. package/types/color-picker/index.d.cts +3 -4
  295. package/types/color-picker/index.d.ts +3 -4
  296. package/types/color-picker/paint.d.cts +2 -1
  297. package/types/color-picker/paint.d.ts +2 -1
  298. package/types/components.d.cts +17 -13
  299. package/types/components.d.ts +17 -13
  300. package/types/date-picker/index.d.cts +3 -4
  301. package/types/date-picker/index.d.ts +3 -4
  302. package/types/descriptions/descriptions.d.cts +1 -1
  303. package/types/descriptions/descriptions.d.ts +1 -1
  304. package/types/divider/index.d.cts +1 -1
  305. package/types/divider/index.d.ts +1 -1
  306. package/types/drawer/index.d.cts +0 -1
  307. package/types/drawer/index.d.ts +0 -1
  308. package/types/dropdown/dropdown-button.d.cts +1 -1
  309. package/types/dropdown/dropdown-button.d.ts +1 -1
  310. package/types/dropdown/dropdown.d.cts +1 -2
  311. package/types/dropdown/dropdown.d.ts +1 -2
  312. package/types/empty/index.d.cts +1 -1
  313. package/types/empty/index.d.ts +1 -1
  314. package/types/feature-card/index.d.cts +1 -1
  315. package/types/feature-card/index.d.ts +1 -1
  316. package/types/feedback-panel/index.d.cts +1 -1
  317. package/types/feedback-panel/index.d.ts +1 -1
  318. package/types/flex/index.d.cts +1 -1
  319. package/types/flex/index.d.ts +1 -1
  320. package/types/form/form.d.cts +1 -1
  321. package/types/form/form.d.ts +1 -1
  322. package/types/grid/grid-item.d.cts +1 -1
  323. package/types/grid/grid-item.d.ts +1 -1
  324. package/types/grid/grid.d.cts +1 -1
  325. package/types/grid/grid.d.ts +1 -1
  326. package/types/icon/index.d.cts +1 -1
  327. package/types/icon/index.d.ts +1 -1
  328. package/types/image/group.d.cts +1 -1
  329. package/types/image/group.d.ts +1 -1
  330. package/types/image/image.d.cts +1 -1
  331. package/types/image/image.d.ts +1 -1
  332. package/types/input/index.d.cts +1 -1
  333. package/types/input/index.d.ts +1 -1
  334. package/types/input/input-base.d.cts +31 -0
  335. package/types/input/input-base.d.ts +31 -0
  336. package/types/input/input-box.d.cts +1 -1
  337. package/types/input/input-box.d.ts +1 -1
  338. package/types/input/input-group.d.cts +1 -1
  339. package/types/input/input-group.d.ts +1 -1
  340. package/types/input/input.d.cts +2 -25
  341. package/types/input/input.d.ts +2 -25
  342. package/types/input/textarea.d.cts +1 -1
  343. package/types/input/textarea.d.ts +1 -1
  344. package/types/input-number/index.d.cts +1 -1
  345. package/types/input-number/index.d.ts +1 -1
  346. package/types/input-otp/index.d.cts +1 -1
  347. package/types/input-otp/index.d.ts +1 -1
  348. package/types/input-tag/index.d.cts +1 -1
  349. package/types/input-tag/index.d.ts +1 -1
  350. package/types/kanban/index.d.cts +1 -1
  351. package/types/kanban/index.d.ts +1 -1
  352. package/types/layout/index.d.cts +2 -2
  353. package/types/layout/index.d.ts +2 -2
  354. package/types/list-panel/index.d.cts +1 -1
  355. package/types/list-panel/index.d.ts +1 -1
  356. package/types/mentions/index.d.cts +1 -1
  357. package/types/mentions/index.d.ts +1 -1
  358. package/types/menu/menu.d.cts +1 -2
  359. package/types/menu/menu.d.ts +1 -2
  360. package/types/modal/modal.d.cts +1 -2
  361. package/types/modal/modal.d.ts +1 -2
  362. package/types/page/index.d.cts +2 -1
  363. package/types/page/index.d.ts +2 -1
  364. package/types/page/responsive.d.cts +1 -0
  365. package/types/page/responsive.d.ts +1 -0
  366. package/types/page-header/index.d.cts +1 -1
  367. package/types/page-header/index.d.ts +1 -1
  368. package/types/popconfirm/index.d.cts +1 -2
  369. package/types/popconfirm/index.d.ts +1 -2
  370. package/types/poptip/index.d.cts +1 -2
  371. package/types/poptip/index.d.ts +1 -2
  372. package/types/popup/index.d.cts +48 -0
  373. package/types/popup/index.d.ts +48 -0
  374. package/types/popup/layers.d.cts +9 -0
  375. package/types/popup/layers.d.ts +9 -0
  376. package/types/popup/types.d.cts +15 -0
  377. package/types/popup/types.d.ts +15 -0
  378. package/types/progress/index.d.cts +1 -1
  379. package/types/progress/index.d.ts +1 -1
  380. package/types/qrcode/index.d.cts +1 -1
  381. package/types/qrcode/index.d.ts +1 -1
  382. package/types/radio/index.d.cts +1 -0
  383. package/types/radio/index.d.ts +1 -0
  384. package/types/radio/radio-button.d.cts +1 -2
  385. package/types/radio/radio-button.d.ts +1 -2
  386. package/types/radio/radio-group.d.cts +1 -1
  387. package/types/radio/radio-group.d.ts +1 -1
  388. package/types/radio/radio.d.cts +1 -2
  389. package/types/radio/radio.d.ts +1 -2
  390. package/types/rate/index.d.cts +1 -1
  391. package/types/rate/index.d.ts +1 -1
  392. package/types/result/index.d.cts +1 -1
  393. package/types/result/index.d.ts +1 -1
  394. package/types/row-col/col.d.cts +1 -1
  395. package/types/row-col/col.d.ts +1 -1
  396. package/types/row-col/row.d.cts +1 -1
  397. package/types/row-col/row.d.ts +1 -1
  398. package/types/segmented/index.d.cts +1 -1
  399. package/types/segmented/index.d.ts +1 -1
  400. package/types/select/index.d.cts +2 -2
  401. package/types/select/index.d.ts +2 -2
  402. package/types/select/option.d.cts +1 -1
  403. package/types/select/option.d.ts +1 -1
  404. package/types/select/select.d.cts +1 -2
  405. package/types/select/select.d.ts +1 -2
  406. package/types/skeleton/skeleton-avatar.d.cts +1 -1
  407. package/types/skeleton/skeleton-avatar.d.ts +1 -1
  408. package/types/skeleton/skeleton-button.d.cts +1 -1
  409. package/types/skeleton/skeleton-button.d.ts +1 -1
  410. package/types/skeleton/skeleton-image.d.cts +1 -1
  411. package/types/skeleton/skeleton-image.d.ts +1 -1
  412. package/types/skeleton/skeleton-text.d.cts +1 -1
  413. package/types/skeleton/skeleton-text.d.ts +1 -1
  414. package/types/skeleton/skeleton.d.cts +1 -1
  415. package/types/skeleton/skeleton.d.ts +1 -1
  416. package/types/slider/index.d.cts +1 -1
  417. package/types/slider/index.d.ts +1 -1
  418. package/types/space/index.d.cts +1 -1
  419. package/types/space/index.d.ts +1 -1
  420. package/types/spin/index.d.cts +1 -1
  421. package/types/spin/index.d.ts +1 -1
  422. package/types/splitter/splitter-panel.d.cts +1 -1
  423. package/types/splitter/splitter-panel.d.ts +1 -1
  424. package/types/splitter/splitter.d.cts +1 -1
  425. package/types/splitter/splitter.d.ts +1 -1
  426. package/types/stat-card/countup.d.cts +1 -1
  427. package/types/stat-card/countup.d.ts +1 -1
  428. package/types/stat-card/rollup.d.cts +3 -2
  429. package/types/stat-card/rollup.d.ts +3 -2
  430. package/types/stat-card/stat-card.d.cts +1 -1
  431. package/types/stat-card/stat-card.d.ts +1 -1
  432. package/types/stat-card/stat-number.d.cts +1 -1
  433. package/types/stat-card/stat-number.d.ts +1 -1
  434. package/types/stat-card/utils/countup.d.cts +1 -1
  435. package/types/stat-card/utils/countup.d.ts +1 -1
  436. package/types/stat-card/utils/odometer.d.cts +7 -4
  437. package/types/stat-card/utils/odometer.d.ts +7 -4
  438. package/types/steps/index.d.cts +1 -1
  439. package/types/steps/index.d.ts +1 -1
  440. package/types/switch/index.d.cts +1 -2
  441. package/types/switch/index.d.ts +1 -2
  442. package/types/table/index.d.cts +1 -1
  443. package/types/table/index.d.ts +1 -1
  444. package/types/table/types.d.cts +2 -4
  445. package/types/table/types.d.ts +2 -4
  446. package/types/tabs/index.d.cts +1 -0
  447. package/types/tabs/index.d.ts +1 -0
  448. package/types/tabs/tab-panel.d.cts +1 -1
  449. package/types/tabs/tab-panel.d.ts +1 -1
  450. package/types/tabs/tabs.d.cts +1 -1
  451. package/types/tabs/tabs.d.ts +1 -1
  452. package/types/tag/index.d.cts +2 -1
  453. package/types/tag/index.d.ts +2 -1
  454. package/types/time-line/timeline-item.d.cts +1 -1
  455. package/types/time-line/timeline-item.d.ts +1 -1
  456. package/types/time-line/timeline.d.cts +1 -1
  457. package/types/time-line/timeline.d.ts +1 -1
  458. package/types/tooltip/index.d.cts +2 -2
  459. package/types/tooltip/index.d.ts +2 -2
  460. package/types/tour/index.d.cts +0 -2
  461. package/types/tour/index.d.ts +0 -2
  462. package/types/transfer/index.d.cts +2 -3
  463. package/types/transfer/index.d.ts +2 -3
  464. package/types/tree/index.d.cts +2 -4
  465. package/types/tree/index.d.ts +2 -4
  466. package/types/tree-select/index.d.cts +2 -3
  467. package/types/tree-select/index.d.ts +2 -3
  468. package/types/typography/index.d.cts +1 -1
  469. package/types/typography/index.d.ts +1 -1
  470. package/types/upload/index.d.cts +1 -2
  471. package/types/upload/index.d.ts +1 -2
  472. package/types/upload/selector.d.cts +1 -1
  473. package/types/upload/selector.d.ts +1 -1
  474. package/types/utils/popup.d.cts +11 -0
  475. package/types/utils/popup.d.ts +11 -0
  476. package/types/utils/selection-tags.d.cts +19 -0
  477. package/types/utils/selection-tags.d.ts +19 -0
  478. package/types/virtual-list/index.d.cts +1 -1
  479. package/types/virtual-list/index.d.ts +1 -1
  480. package/types/watermark/index.d.cts +1 -1
  481. package/types/watermark/index.d.ts +1 -1
@@ -1,24 +1,22 @@
1
1
  /*!
2
- * react-kui v3.0.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
6
6
  * Author: Qiu / https://chuchur.com
7
7
  */
8
8
 
9
+ import Popup from "../popup/index.js";
9
10
  import { useConfigAppearance } from "../config/use-config-appearance.js";
10
11
  import { CircleX, Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
11
12
  import Icon from "../icon/index.js";
12
13
  import { useValue } from "../utils/use-value.js";
13
14
  import Empty from "../empty/index.js";
14
15
  import { createFormFieldComponent } from "../form/field-context.js";
15
- import Teleport from "../base/teleport.js";
16
- import { Transition } from "../base/transition.js";
17
16
  import textarea_default from "../input/textarea.js";
18
- import { setPlacement } from "../utils/placement.js";
19
17
  import { c } from "react/compiler-runtime";
20
18
  import clsx from "clsx";
21
- import { useEffect, useEffectEvent, useId, useRef, useState } from "react";
19
+ import { useEffect, useId, useRef, useState } from "react";
22
20
  import { jsx, jsxs } from "react/jsx-runtime";
23
21
  //#region components/mentions/index.tsx
24
22
  var caretPosition = (element) => {
@@ -72,7 +70,7 @@ var caretPosition = (element) => {
72
70
  };
73
71
  var EMPTY_OPTIONS = [];
74
72
  var Mentions = (t0) => {
75
- const $ = c(141);
73
+ const $ = c(145);
76
74
  let className;
77
75
  let disabled;
78
76
  let emptyText;
@@ -172,7 +170,6 @@ var Mentions = (t0) => {
172
170
  } else t9 = $[25];
173
171
  const listboxId = `k-mentions-listbox-${t9}`;
174
172
  const [query, setQuery] = useState(null);
175
- const [rendered, setRendered] = useState(false);
176
173
  const [active, setActive] = useState(0);
177
174
  let t10;
178
175
  if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
@@ -180,117 +177,84 @@ var Mentions = (t0) => {
180
177
  $[27] = t10;
181
178
  } else t10 = $[27];
182
179
  const [shown, setShown] = useState(t10);
183
- const [positioned, setPositioned] = useState(false);
184
- let t11;
185
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
186
- t11 = {
187
- left: 0,
188
- top: 0,
189
- origin: "left top",
190
- width: 260
191
- };
192
- $[28] = t11;
193
- } else t11 = $[28];
194
- const [position, setPosition] = useState(t11);
180
+ const [popupWidth, setPopupWidth] = useState(260);
195
181
  const rootRef = useRef(null);
196
182
  const textareaRef = useRef(null);
197
183
  const dropdownRef = useRef(null);
198
- const placementRef = useRef(placement);
199
- const originRef = useRef("left top");
200
- const topRef = useRef(0);
201
- const leftRef = useRef(0);
202
184
  const composing = useRef(false);
203
185
  const current = inner;
186
+ let t11;
187
+ if ($[28] !== options) {
188
+ t11 = options.map(_temp2);
189
+ $[28] = options;
190
+ $[29] = t11;
191
+ } else t11 = $[29];
192
+ const normalized = t11;
204
193
  let t12;
205
- if ($[29] !== options) {
206
- t12 = options.map(_temp2);
207
- $[29] = options;
208
- $[30] = t12;
209
- } else t12 = $[30];
210
- const normalized = t12;
211
- let t13;
212
- if ($[31] !== triggers) {
213
- t13 = triggers.filter(Boolean);
214
- $[31] = triggers;
215
- $[32] = t13;
216
- } else t13 = $[32];
217
- const effectiveTriggers = t13;
194
+ if ($[30] !== triggers) {
195
+ t12 = triggers.filter(Boolean);
196
+ $[30] = triggers;
197
+ $[31] = t12;
198
+ } else t12 = $[31];
199
+ const effectiveTriggers = t12;
218
200
  const firstEnabled = _temp4;
219
- let t14;
220
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
221
- t14 = (items_0) => {
201
+ let t13;
202
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
203
+ t13 = (items_0) => {
222
204
  setShown(items_0);
223
205
  setActive(firstEnabled(items_0));
224
206
  };
225
- $[33] = t14;
226
- } else t14 = $[33];
227
- const setMatches = t14;
228
- let t15;
229
- if ($[34] !== active || $[35] !== shown) {
230
- t15 = (offset) => {
207
+ $[32] = t13;
208
+ } else t13 = $[32];
209
+ const setMatches = t13;
210
+ let t14;
211
+ if ($[33] !== active || $[34] !== shown) {
212
+ t14 = (offset) => {
231
213
  const enabled = shown.map(_temp5).filter(_temp6);
232
214
  if (!enabled.length) return;
233
215
  const currentIndex = enabled.indexOf(active);
234
216
  setActive(enabled[(Math.max(currentIndex, 0) + offset + enabled.length) % enabled.length]);
235
217
  };
236
- $[34] = active;
237
- $[35] = shown;
238
- $[36] = t15;
239
- } else t15 = $[36];
240
- const moveActive = t15;
241
- let t16;
242
- if ($[37] !== filterOption || $[38] !== normalized || $[39] !== onSearch) {
243
- t16 = (state) => {
218
+ $[33] = active;
219
+ $[34] = shown;
220
+ $[35] = t14;
221
+ } else t14 = $[35];
222
+ const moveActive = t14;
223
+ let t15;
224
+ if ($[36] !== filterOption || $[37] !== normalized || $[38] !== onSearch) {
225
+ t15 = (state) => {
244
226
  if (onSearch && !filterOption) return normalized;
245
227
  return normalized.filter((option_1) => filterOption ? filterOption(state.text, option_1) : option_1.value.toLocaleLowerCase().includes(state.text.toLocaleLowerCase()));
246
228
  };
247
- $[37] = filterOption;
248
- $[38] = normalized;
249
- $[39] = onSearch;
250
- $[40] = t16;
251
- } else t16 = $[40];
252
- const getMatches = t16;
229
+ $[36] = filterOption;
230
+ $[37] = normalized;
231
+ $[38] = onSearch;
232
+ $[39] = t15;
233
+ } else t15 = $[39];
234
+ const getMatches = t15;
253
235
  const [previousNormalized, setPreviousNormalized] = useState(normalized);
254
236
  if (previousNormalized !== normalized) {
255
237
  setPreviousNormalized(normalized);
256
238
  if (query) setMatches(getMatches(query));
257
239
  }
258
- let t17;
259
- if ($[41] !== placement || $[42] !== query) {
260
- t17 = () => {
261
- if (!query || !textareaRef.current || !dropdownRef.current) return;
240
+ let t16;
241
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
242
+ t16 = () => {
243
+ if (!textareaRef.current) return null;
262
244
  const rect = caretPosition(textareaRef.current);
263
- placementRef.current = placement;
264
- setPlacement({
265
- refSelection: rootRef,
266
- refPopper: dropdownRef,
267
- currentPlacement: placementRef,
268
- transOrigin: originRef,
269
- top: topRef,
270
- left: leftRef,
271
- position: {
272
- x: rect.left,
273
- y: rect.bottom
274
- },
275
- offset: 4
276
- });
277
- setPosition({
278
- left: leftRef.current,
279
- top: topRef.current,
280
- origin: originRef.current,
281
- width: Math.min(260, rootRef.current?.offsetWidth || 260)
282
- });
283
- setPositioned(true);
245
+ setPopupWidth(Math.min(260, rootRef.current?.offsetWidth || 260));
246
+ return {
247
+ x: rect.left,
248
+ y: rect.bottom
249
+ };
284
250
  };
285
- $[41] = placement;
286
- $[42] = query;
287
- $[43] = t17;
288
- } else t17 = $[43];
289
- const updatePosition = t17;
290
- let t18;
291
- if ($[44] !== effectiveTriggers || $[45] !== getMatches || $[46] !== onSearch || $[47] !== query || $[48] !== readOnly) {
292
- t18 = (text, caret, t19) => {
293
- const search = t19 === void 0 ? false : t19;
251
+ $[40] = t16;
252
+ } else t16 = $[40];
253
+ const getAnchorPosition = t16;
254
+ let t17;
255
+ if ($[41] !== effectiveTriggers || $[42] !== getMatches || $[43] !== onSearch || $[44] !== readOnly) {
256
+ t17 = (text, caret, t18) => {
257
+ const search = t18 === void 0 ? false : t18;
294
258
  if (readOnly) {
295
259
  setQuery(null);
296
260
  return;
@@ -307,117 +271,70 @@ var Mentions = (t0) => {
307
271
  });
308
272
  const nextQuery = found;
309
273
  setQuery(nextQuery);
310
- if (!query && nextQuery) setPositioned(false);
311
274
  if (nextQuery) {
312
- setRendered(true);
313
275
  setMatches(onSearch && search && nextQuery.text ? [] : getMatches(nextQuery));
314
276
  if (search && nextQuery.text) onSearch?.(nextQuery.text, nextQuery.trigger);
315
277
  } else setMatches([]);
316
278
  };
317
- $[44] = effectiveTriggers;
318
- $[45] = getMatches;
319
- $[46] = onSearch;
320
- $[47] = query;
321
- $[48] = readOnly;
322
- $[49] = t18;
323
- } else t18 = $[49];
324
- const updateQuery = t18;
325
- const positionDropdown = useEffectEvent(updatePosition);
279
+ $[41] = effectiveTriggers;
280
+ $[42] = getMatches;
281
+ $[43] = onSearch;
282
+ $[44] = readOnly;
283
+ $[45] = t17;
284
+ } else t17 = $[45];
285
+ const updateQuery = t17;
286
+ let t18;
326
287
  let t19;
327
- if ($[50] !== positionDropdown || $[51] !== query) {
328
- t19 = () => {
329
- if (!query) return;
330
- let frame = 0;
331
- const update = () => {
332
- cancelAnimationFrame(frame);
333
- frame = requestAnimationFrame(positionDropdown);
334
- };
335
- const closeOutside = (event) => {
336
- const target = event.target;
337
- if (!rootRef.current?.contains(target) && !dropdownRef.current?.contains(target)) setQuery(null);
338
- };
339
- const observer = new ResizeObserver(update);
340
- if (rootRef.current) observer.observe(rootRef.current);
341
- if (dropdownRef.current) observer.observe(dropdownRef.current);
342
- update();
343
- window.addEventListener("resize", update);
344
- window.addEventListener("scroll", update, true);
345
- document.addEventListener("mousedown", closeOutside);
346
- return () => {
347
- cancelAnimationFrame(frame);
348
- observer.disconnect();
349
- window.removeEventListener("resize", update);
350
- window.removeEventListener("scroll", update, true);
351
- document.removeEventListener("mousedown", closeOutside);
352
- };
353
- };
354
- $[50] = positionDropdown;
355
- $[51] = query;
356
- $[52] = t19;
357
- } else t19 = $[52];
358
- let t20;
359
- if ($[53] !== placement || $[54] !== query || $[55] !== shown) {
360
- t20 = [
361
- query,
362
- shown,
363
- placement
364
- ];
365
- $[53] = placement;
366
- $[54] = query;
367
- $[55] = shown;
368
- $[56] = t20;
369
- } else t20 = $[56];
370
- useEffect(t19, t20);
371
- let t21;
372
- let t22;
373
- if ($[57] !== active || $[58] !== listboxId) {
374
- t21 = () => {
288
+ if ($[46] !== active || $[47] !== listboxId) {
289
+ t18 = () => {
375
290
  dropdownRef.current?.querySelector(`#${listboxId}-option-${active}`)?.scrollIntoView({ block: "nearest" });
376
291
  };
377
- t22 = [active, listboxId];
378
- $[57] = active;
379
- $[58] = listboxId;
380
- $[59] = t21;
381
- $[60] = t22;
292
+ t19 = [active, listboxId];
293
+ $[46] = active;
294
+ $[47] = listboxId;
295
+ $[48] = t18;
296
+ $[49] = t19;
382
297
  } else {
383
- t21 = $[59];
384
- t22 = $[60];
298
+ t18 = $[48];
299
+ t19 = $[49];
385
300
  }
386
- useEffect(t21, t22);
387
- let t23;
388
- if ($[61] !== onChange || $[62] !== readOnly || $[63] !== setInner) {
389
- t23 = (next_0) => {
390
- if (readOnly) return;
301
+ useEffect(t18, t19);
302
+ let t20;
303
+ if ($[50] !== disabled || $[51] !== onChange || $[52] !== readOnly || $[53] !== setInner) {
304
+ t20 = (next_0) => {
305
+ if (disabled || readOnly) return;
391
306
  setInner(next_0);
392
307
  onChange?.(next_0);
393
308
  };
394
- $[61] = onChange;
395
- $[62] = readOnly;
396
- $[63] = setInner;
397
- $[64] = t23;
398
- } else t23 = $[64];
399
- const setValue = t23;
400
- let t24;
401
- if ($[65] !== onClear || $[66] !== readOnly || $[67] !== setValue) {
402
- t24 = (event_0) => {
403
- if (readOnly) return;
404
- event_0.stopPropagation();
309
+ $[50] = disabled;
310
+ $[51] = onChange;
311
+ $[52] = readOnly;
312
+ $[53] = setInner;
313
+ $[54] = t20;
314
+ } else t20 = $[54];
315
+ const setValue = t20;
316
+ let t21;
317
+ if ($[55] !== disabled || $[56] !== onClear || $[57] !== readOnly || $[58] !== setValue) {
318
+ t21 = (event) => {
319
+ if (disabled || readOnly) return;
320
+ event.stopPropagation();
405
321
  setValue("");
406
322
  setQuery(null);
407
323
  onClear?.();
408
324
  textareaRef.current?.focus();
409
325
  };
410
- $[65] = onClear;
411
- $[66] = readOnly;
412
- $[67] = setValue;
413
- $[68] = t24;
414
- } else t24 = $[68];
415
- const clear = t24;
416
- let t25;
417
- if ($[69] !== current || $[70] !== onSelect || $[71] !== query || $[72] !== readOnly || $[73] !== setValue) {
418
- t25 = (option_2) => {
326
+ $[55] = disabled;
327
+ $[56] = onClear;
328
+ $[57] = readOnly;
329
+ $[58] = setValue;
330
+ $[59] = t21;
331
+ } else t21 = $[59];
332
+ const clear = t21;
333
+ let t22;
334
+ if ($[60] !== current || $[61] !== disabled || $[62] !== onSelect || $[63] !== query || $[64] !== readOnly || $[65] !== setValue) {
335
+ t22 = (option_2) => {
419
336
  const textarea = textareaRef.current;
420
- if (readOnly || !query || option_2.disabled || !textarea) return;
337
+ if (disabled || readOnly || !query || option_2.disabled || !textarea) return;
421
338
  const state_0 = query;
422
339
  const caret_0 = textarea.selectionStart;
423
340
  setValue(`${current.slice(0, state_0.start)}${state_0.trigger}${option_2.value} ${current.slice(caret_0)}`);
@@ -429,114 +346,115 @@ var Mentions = (t0) => {
429
346
  textarea.setSelectionRange(at, at);
430
347
  });
431
348
  };
432
- $[69] = current;
433
- $[70] = onSelect;
434
- $[71] = query;
435
- $[72] = readOnly;
436
- $[73] = setValue;
437
- $[74] = t25;
438
- } else t25 = $[74];
439
- const choose = t25;
440
- const t26 = size === "small";
441
- const t27 = size === "large";
442
- const t28 = clearable && !!current && !disabled && !readOnly;
443
- let t29;
444
- if ($[75] !== className || $[76] !== disabled || $[77] !== readOnly || $[78] !== t26 || $[79] !== t27 || $[80] !== t28) {
445
- t29 = clsx("k-mentions", className, {
446
- "k-mentions-sm": t26,
447
- "k-mentions-lg": t27,
349
+ $[60] = current;
350
+ $[61] = disabled;
351
+ $[62] = onSelect;
352
+ $[63] = query;
353
+ $[64] = readOnly;
354
+ $[65] = setValue;
355
+ $[66] = t22;
356
+ } else t22 = $[66];
357
+ const choose = t22;
358
+ const t23 = size === "small";
359
+ const t24 = size === "large";
360
+ const t25 = clearable && !!current && !disabled && !readOnly;
361
+ let t26;
362
+ if ($[67] !== className || $[68] !== disabled || $[69] !== readOnly || $[70] !== t23 || $[71] !== t24 || $[72] !== t25) {
363
+ t26 = clsx("k-mentions", className, {
364
+ "k-mentions-sm": t23,
365
+ "k-mentions-lg": t24,
448
366
  "k-mentions-disabled": disabled,
449
367
  "k-mentions-readonly": readOnly,
450
- "k-mentions-has-clear": t28
368
+ "k-mentions-has-clear": t25
451
369
  });
452
- $[75] = className;
453
- $[76] = disabled;
454
- $[77] = readOnly;
455
- $[78] = t26;
456
- $[79] = t27;
457
- $[80] = t28;
458
- $[81] = t29;
459
- } else t29 = $[81];
460
- const t30 = Boolean(query);
461
- const t31 = query ? listboxId : void 0;
462
- const t32 = query && shown[active] ? `${listboxId}-option-${active}` : void 0;
463
- let t33;
464
- if ($[82] !== setValue || $[83] !== updateQuery) {
465
- t33 = (text_0) => {
370
+ $[67] = className;
371
+ $[68] = disabled;
372
+ $[69] = readOnly;
373
+ $[70] = t23;
374
+ $[71] = t24;
375
+ $[72] = t25;
376
+ $[73] = t26;
377
+ } else t26 = $[73];
378
+ const t27 = Boolean(query);
379
+ const t28 = query ? listboxId : void 0;
380
+ const t29 = query && shown[active] ? `${listboxId}-option-${active}` : void 0;
381
+ let t30;
382
+ if ($[74] !== setValue || $[75] !== updateQuery) {
383
+ t30 = (text_0) => {
466
384
  setValue(text_0);
467
385
  if (composing.current) return;
468
386
  if (textareaRef.current) updateQuery(text_0, textareaRef.current.selectionStart, true);
469
387
  };
470
- $[82] = setValue;
471
- $[83] = updateQuery;
472
- $[84] = t33;
473
- } else t33 = $[84];
474
- let t34;
475
- if ($[85] === Symbol.for("react.memo_cache_sentinel")) {
476
- t34 = () => {
388
+ $[74] = setValue;
389
+ $[75] = updateQuery;
390
+ $[76] = t30;
391
+ } else t30 = $[76];
392
+ let t31;
393
+ if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
394
+ t31 = () => {
477
395
  composing.current = true;
478
396
  };
479
- $[85] = t34;
480
- } else t34 = $[85];
481
- let t35;
482
- if ($[86] !== updateQuery) {
483
- t35 = (event_1) => {
397
+ $[77] = t31;
398
+ } else t31 = $[77];
399
+ let t32;
400
+ if ($[78] !== updateQuery) {
401
+ t32 = (event_0) => {
484
402
  composing.current = false;
485
- updateQuery(event_1.currentTarget.value, event_1.currentTarget.selectionStart, true);
403
+ updateQuery(event_0.currentTarget.value, event_0.currentTarget.selectionStart, true);
486
404
  };
487
- $[86] = updateQuery;
488
- $[87] = t35;
489
- } else t35 = $[87];
490
- let t36;
491
- let t37;
492
- let t38;
493
- if ($[88] !== current || $[89] !== updateQuery) {
494
- t36 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
495
- t37 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
496
- t38 = (event_2) => {
405
+ $[78] = updateQuery;
406
+ $[79] = t32;
407
+ } else t32 = $[79];
408
+ let t33;
409
+ let t34;
410
+ let t35;
411
+ if ($[80] !== current || $[81] !== updateQuery) {
412
+ t33 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
413
+ t34 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
414
+ t35 = (event_1) => {
497
415
  if ([
498
416
  "ArrowLeft",
499
417
  "ArrowRight",
500
418
  "Home",
501
419
  "End"
502
- ].includes(event_2.key) && textareaRef.current) updateQuery(current, textareaRef.current.selectionStart);
420
+ ].includes(event_1.key) && textareaRef.current) updateQuery(current, textareaRef.current.selectionStart);
503
421
  };
504
- $[88] = current;
505
- $[89] = updateQuery;
506
- $[90] = t36;
507
- $[91] = t37;
508
- $[92] = t38;
422
+ $[80] = current;
423
+ $[81] = updateQuery;
424
+ $[82] = t33;
425
+ $[83] = t34;
426
+ $[84] = t35;
509
427
  } else {
510
- t36 = $[90];
511
- t37 = $[91];
512
- t38 = $[92];
428
+ t33 = $[82];
429
+ t34 = $[83];
430
+ t35 = $[84];
513
431
  }
514
- let t39;
515
- if ($[93] !== active || $[94] !== choose || $[95] !== moveActive || $[96] !== query || $[97] !== shown) {
516
- t39 = (event_3) => {
432
+ let t36;
433
+ if ($[85] !== active || $[86] !== choose || $[87] !== moveActive || $[88] !== query || $[89] !== shown) {
434
+ t36 = (event_2) => {
517
435
  if (!query) return;
518
- if ((event_3.key === "ArrowDown" || event_3.key === "ArrowUp") && shown.length) {
519
- moveActive(event_3.key === "ArrowDown" ? 1 : -1);
520
- event_3.preventDefault();
521
- } else if (event_3.key === "Enter" && shown.length) {
436
+ if ((event_2.key === "ArrowDown" || event_2.key === "ArrowUp") && shown.length) {
437
+ moveActive(event_2.key === "ArrowDown" ? 1 : -1);
438
+ event_2.preventDefault();
439
+ } else if (event_2.key === "Enter" && shown.length) {
522
440
  choose(shown[active]);
523
- event_3.preventDefault();
524
- } else if (event_3.key === "Escape") {
525
- event_3.preventDefault();
526
- event_3.stopPropagation();
441
+ event_2.preventDefault();
442
+ } else if (event_2.key === "Escape") {
443
+ event_2.preventDefault();
444
+ event_2.stopPropagation();
527
445
  setQuery(null);
528
446
  }
529
447
  };
530
- $[93] = active;
531
- $[94] = choose;
532
- $[95] = moveActive;
533
- $[96] = query;
534
- $[97] = shown;
535
- $[98] = t39;
536
- } else t39 = $[98];
537
- let t40;
538
- if ($[99] !== current || $[100] !== disabled || $[101] !== readOnly || $[102] !== rest || $[103] !== rows || $[104] !== shape || $[105] !== size || $[106] !== t30 || $[107] !== t31 || $[108] !== t32 || $[109] !== t33 || $[110] !== t35 || $[111] !== t36 || $[112] !== t37 || $[113] !== t38 || $[114] !== t39 || $[115] !== theme) {
539
- t40 = /* @__PURE__ */ jsx(textarea_default, {
448
+ $[85] = active;
449
+ $[86] = choose;
450
+ $[87] = moveActive;
451
+ $[88] = query;
452
+ $[89] = shown;
453
+ $[90] = t36;
454
+ } else t36 = $[90];
455
+ let t37;
456
+ if ($[91] !== current || $[92] !== disabled || $[93] !== readOnly || $[94] !== rest || $[95] !== rows || $[96] !== shape || $[97] !== size || $[98] !== t27 || $[99] !== t28 || $[100] !== t29 || $[101] !== t30 || $[102] !== t32 || $[103] !== t33 || $[104] !== t34 || $[105] !== t35 || $[106] !== t36 || $[107] !== theme) {
457
+ t37 = /* @__PURE__ */ jsx(textarea_default, {
540
458
  ...rest,
541
459
  ref: textareaRef,
542
460
  value: current,
@@ -547,39 +465,39 @@ var Mentions = (t0) => {
547
465
  disabled,
548
466
  readOnly,
549
467
  "aria-haspopup": "listbox",
550
- "aria-expanded": t30,
551
- "aria-controls": t31,
552
- "aria-activedescendant": t32,
553
- onChange: t33,
554
- onCompositionStart: t34,
555
- onCompositionEnd: t35,
556
- onClick: t36,
557
- onSelect: t37,
558
- onKeyUp: t38,
559
- onKeyDown: t39
468
+ "aria-expanded": t27,
469
+ "aria-controls": t28,
470
+ "aria-activedescendant": t29,
471
+ onChange: t30,
472
+ onCompositionStart: t31,
473
+ onCompositionEnd: t32,
474
+ onClick: t33,
475
+ onSelect: t34,
476
+ onKeyUp: t35,
477
+ onKeyDown: t36
560
478
  });
561
- $[99] = current;
562
- $[100] = disabled;
563
- $[101] = readOnly;
564
- $[102] = rest;
565
- $[103] = rows;
566
- $[104] = shape;
567
- $[105] = size;
568
- $[106] = t30;
569
- $[107] = t31;
570
- $[108] = t32;
571
- $[109] = t33;
572
- $[110] = t35;
573
- $[111] = t36;
574
- $[112] = t37;
575
- $[113] = t38;
576
- $[114] = t39;
577
- $[115] = theme;
578
- $[116] = t40;
579
- } else t40 = $[116];
580
- let t41;
581
- if ($[117] !== clear || $[118] !== clearable || $[119] !== current || $[120] !== disabled || $[121] !== readOnly) {
582
- t41 = clearable && current && !disabled && !readOnly && /* @__PURE__ */ jsx(Icon, {
479
+ $[91] = current;
480
+ $[92] = disabled;
481
+ $[93] = readOnly;
482
+ $[94] = rest;
483
+ $[95] = rows;
484
+ $[96] = shape;
485
+ $[97] = size;
486
+ $[98] = t27;
487
+ $[99] = t28;
488
+ $[100] = t29;
489
+ $[101] = t30;
490
+ $[102] = t32;
491
+ $[103] = t33;
492
+ $[104] = t34;
493
+ $[105] = t35;
494
+ $[106] = t36;
495
+ $[107] = theme;
496
+ $[108] = t37;
497
+ } else t37 = $[108];
498
+ let t38;
499
+ if ($[109] !== clear || $[110] !== clearable || $[111] !== current || $[112] !== disabled || $[113] !== readOnly) {
500
+ t38 = clearable && current && !disabled && !readOnly && /* @__PURE__ */ jsx(Icon, {
583
501
  className: "k-mentions-clearable",
584
502
  type: CircleX,
585
503
  role: "button",
@@ -587,95 +505,131 @@ var Mentions = (t0) => {
587
505
  "aria-label": "Clear",
588
506
  onPointerDown: _temp7,
589
507
  onClick: clear,
590
- onKeyDown: (event_5) => {
591
- if (event_5.key === "Enter" || event_5.key === " ") clear(event_5);
508
+ onKeyDown: (event_4) => {
509
+ if (event_4.key === "Enter" || event_4.key === " ") clear(event_4);
592
510
  }
593
511
  });
594
- $[117] = clear;
595
- $[118] = clearable;
596
- $[119] = current;
597
- $[120] = disabled;
598
- $[121] = readOnly;
599
- $[122] = t41;
600
- } else t41 = $[122];
601
- let t42;
602
- if ($[123] !== active || $[124] !== choose || $[125] !== emptyText || $[126] !== listboxId || $[127] !== loading || $[128] !== loadingText || $[129] !== position || $[130] !== positioned || $[131] !== query || $[132] !== rendered || $[133] !== shown || $[134] !== size) {
603
- t42 = rendered && /* @__PURE__ */ jsx(Teleport, {
604
- to: "body",
605
- children: /* @__PURE__ */ jsx(Transition, {
606
- show: !!query,
607
- name: "k-select",
608
- nodeRef: dropdownRef,
609
- appear: true,
610
- children: /* @__PURE__ */ jsx("div", {
611
- ref: dropdownRef,
612
- id: listboxId,
613
- className: clsx("k-select-dropdown", "k-mentions-dropdown", {
614
- "k-select-dropdown-sm": size === "small",
615
- "k-select-dropdown-lg": size === "large"
616
- }),
617
- style: {
618
- left: position.left,
619
- top: position.top,
620
- width: position.width,
621
- visibility: positioned ? void 0 : "hidden",
622
- transformOrigin: position.origin
623
- },
624
- role: "listbox",
625
- children: loading ? /* @__PURE__ */ jsxs("div", {
626
- className: "k-select-loading k-mentions-loading",
627
- children: [/* @__PURE__ */ jsx(Icon, {
628
- type: Loading,
629
- spin: true
630
- }), loadingText && /* @__PURE__ */ jsx("span", { children: loadingText })]
631
- }) : shown.length ? /* @__PURE__ */ jsx("ul", { children: shown.map((option_3, index_2) => /* @__PURE__ */ jsx("li", {
632
- id: `${listboxId}-option-${index_2}`,
633
- role: "option",
634
- "aria-selected": active === index_2,
635
- className: clsx("k-select-item", {
636
- "k-select-item-active": active === index_2,
637
- "k-select-item-disabled": option_3.disabled
638
- }),
639
- onMouseDown: _temp8,
640
- onMouseEnter: () => !option_3.disabled && setActive(index_2),
641
- onClick: () => choose(option_3),
642
- children: option_3.label ?? option_3.value
643
- }, option_3.value)) }) : /* @__PURE__ */ jsx(Empty, { description: emptyText })
644
- })
645
- })
512
+ $[109] = clear;
513
+ $[110] = clearable;
514
+ $[111] = current;
515
+ $[112] = disabled;
516
+ $[113] = readOnly;
517
+ $[114] = t38;
518
+ } else t38 = $[114];
519
+ const t39 = !!query;
520
+ let t40;
521
+ if ($[115] !== popupWidth) {
522
+ t40 = { minWidth: popupWidth };
523
+ $[115] = popupWidth;
524
+ $[116] = t40;
525
+ } else t40 = $[116];
526
+ let t41;
527
+ if ($[117] === Symbol.for("react.memo_cache_sentinel")) {
528
+ t41 = (next_1) => {
529
+ if (!next_1) setQuery(null);
530
+ };
531
+ $[117] = t41;
532
+ } else t41 = $[117];
533
+ const t42 = size === "small";
534
+ const t43 = size === "large";
535
+ let t44;
536
+ if ($[118] !== t42 || $[119] !== t43) {
537
+ t44 = clsx("k-select-dropdown", "k-mentions-dropdown", {
538
+ "k-select-dropdown-sm": t42,
539
+ "k-select-dropdown-lg": t43
646
540
  });
647
- $[123] = active;
648
- $[124] = choose;
649
- $[125] = emptyText;
650
- $[126] = listboxId;
651
- $[127] = loading;
652
- $[128] = loadingText;
653
- $[129] = position;
654
- $[130] = positioned;
655
- $[131] = query;
656
- $[132] = rendered;
657
- $[133] = shown;
658
- $[134] = size;
659
- $[135] = t42;
660
- } else t42 = $[135];
661
- let t43;
662
- if ($[136] !== t29 || $[137] !== t40 || $[138] !== t41 || $[139] !== t42) {
663
- t43 = /* @__PURE__ */ jsxs("div", {
541
+ $[118] = t42;
542
+ $[119] = t43;
543
+ $[120] = t44;
544
+ } else t44 = $[120];
545
+ let t45;
546
+ if ($[121] !== active || $[122] !== choose || $[123] !== disabled || $[124] !== emptyText || $[125] !== listboxId || $[126] !== loading || $[127] !== loadingText || $[128] !== readOnly || $[129] !== shown) {
547
+ t45 = loading ? /* @__PURE__ */ jsxs("div", {
548
+ className: "k-select-loading k-mentions-loading",
549
+ children: [/* @__PURE__ */ jsx(Icon, {
550
+ type: Loading,
551
+ spin: true
552
+ }), loadingText && /* @__PURE__ */ jsx("span", { children: loadingText })]
553
+ }) : shown.length ? /* @__PURE__ */ jsx("ul", { children: shown.map((option_3, index_2) => /* @__PURE__ */ jsx("li", {
554
+ id: `${listboxId}-option-${index_2}`,
555
+ role: "option",
556
+ "aria-selected": active === index_2,
557
+ className: clsx("k-select-item", {
558
+ "k-select-item-active": active === index_2,
559
+ "k-select-item-disabled": option_3.disabled
560
+ }),
561
+ onMouseDown: _temp8,
562
+ onMouseEnter: () => !disabled && !readOnly && !option_3.disabled && setActive(index_2),
563
+ onClick: () => choose(option_3),
564
+ children: option_3.label ?? option_3.value
565
+ }, option_3.value)) }) : /* @__PURE__ */ jsx(Empty, { description: emptyText });
566
+ $[121] = active;
567
+ $[122] = choose;
568
+ $[123] = disabled;
569
+ $[124] = emptyText;
570
+ $[125] = listboxId;
571
+ $[126] = loading;
572
+ $[127] = loadingText;
573
+ $[128] = readOnly;
574
+ $[129] = shown;
575
+ $[130] = t45;
576
+ } else t45 = $[130];
577
+ let t46;
578
+ if ($[131] !== listboxId || $[132] !== t44 || $[133] !== t45) {
579
+ t46 = /* @__PURE__ */ jsx("div", {
580
+ ref: dropdownRef,
581
+ id: listboxId,
582
+ className: t44,
583
+ role: "listbox",
584
+ children: t45
585
+ });
586
+ $[131] = listboxId;
587
+ $[132] = t44;
588
+ $[133] = t45;
589
+ $[134] = t46;
590
+ } else t46 = $[134];
591
+ let t47;
592
+ if ($[135] !== placement || $[136] !== t39 || $[137] !== t40 || $[138] !== t46) {
593
+ t47 = /* @__PURE__ */ jsx(Popup, {
594
+ raw: true,
595
+ open: t39,
596
+ target: rootRef,
597
+ trigger: "manual",
598
+ placement,
599
+ prefixCls: "k-mentions-dropdown",
600
+ transitionName: "k-select",
601
+ offset: 4,
602
+ getAnchorPosition,
603
+ style: t40,
604
+ destroyOnClose: true,
605
+ outsideEvent: "mousedown",
606
+ onOpenChange: t41,
607
+ overlay: t46
608
+ });
609
+ $[135] = placement;
610
+ $[136] = t39;
611
+ $[137] = t40;
612
+ $[138] = t46;
613
+ $[139] = t47;
614
+ } else t47 = $[139];
615
+ let t48;
616
+ if ($[140] !== t26 || $[141] !== t37 || $[142] !== t38 || $[143] !== t47) {
617
+ t48 = /* @__PURE__ */ jsxs("div", {
664
618
  ref: rootRef,
665
- className: t29,
619
+ className: t26,
666
620
  children: [
667
- t40,
668
- t41,
669
- t42
621
+ t37,
622
+ t38,
623
+ t47
670
624
  ]
671
625
  });
672
- $[136] = t29;
673
- $[137] = t40;
674
- $[138] = t41;
675
- $[139] = t42;
676
- $[140] = t43;
677
- } else t43 = $[140];
678
- return t43;
626
+ $[140] = t26;
627
+ $[141] = t37;
628
+ $[142] = t38;
629
+ $[143] = t47;
630
+ $[144] = t48;
631
+ } else t48 = $[144];
632
+ return t48;
679
633
  };
680
634
  var mentions_default = createFormFieldComponent(Mentions);
681
635
  function _temp(next) {
@@ -700,11 +654,11 @@ function _temp5(option_0, index_0) {
700
654
  function _temp6(index_1) {
701
655
  return index_1 >= 0;
702
656
  }
703
- function _temp7(event_4) {
704
- return event_4.preventDefault();
657
+ function _temp7(event_3) {
658
+ return event_3.preventDefault();
705
659
  }
706
- function _temp8(event_6) {
707
- return event_6.preventDefault();
660
+ function _temp8(event_5) {
661
+ return event_5.preventDefault();
708
662
  }
709
663
  //#endregion
710
664
  export { mentions_default as default };