react-kui 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.zh-CN.md +3 -1
  2. package/ai/kui-components.json +912 -318
  3. package/es/_virtual/_rolldown/runtime.js +1 -1
  4. package/es/affix/index.js +1 -1
  5. package/es/alert/index.js +11 -4
  6. package/es/anchor/anchor-context.js +1 -1
  7. package/es/anchor/anchor-link.js +1 -1
  8. package/es/anchor/anchor.js +1 -1
  9. package/es/auto-complete/index.js +371 -347
  10. package/es/avatar/avatar-group-context.js +1 -1
  11. package/es/avatar/avatar-group.js +1 -1
  12. package/es/avatar/avatar.js +1 -1
  13. package/es/back-top/index.js +1 -1
  14. package/es/badge/index.js +10 -8
  15. package/es/base/teleport.js +1 -1
  16. package/es/base/transition-props.js +1 -1
  17. package/es/base/transition.js +1 -1
  18. package/es/breadcrumb/breadcrumb-context.js +1 -1
  19. package/es/breadcrumb/breadcrumb-item.js +1 -1
  20. package/es/breadcrumb/breadcrumb.js +1 -1
  21. package/es/button/button-group-context.js +1 -1
  22. package/es/button/button-group.js +1 -1
  23. package/es/button/button.js +13 -6
  24. package/es/calendar/index.js +20 -6
  25. package/es/card/index.js +11 -4
  26. package/es/carousel/carousel-context.js +1 -1
  27. package/es/carousel/carousel-item.js +1 -1
  28. package/es/carousel/carousel.js +1 -1
  29. package/es/carousel/drag.js +1 -1
  30. package/es/cascader/index.js +13 -10
  31. package/es/check-card/check-card-group.js +3 -3
  32. package/es/check-card/check-card.js +155 -141
  33. package/es/check-card/context.js +1 -1
  34. package/es/checkbox/checkbox-group-context.js +1 -1
  35. package/es/checkbox/checkbox-group.js +3 -3
  36. package/es/checkbox/checkbox.js +64 -244
  37. package/es/checkbox/index.js +1 -1
  38. package/es/collapse/collapse-panel.js +1 -1
  39. package/es/collapse/collapse.js +96 -82
  40. package/es/color-picker/alpha.js +1 -1
  41. package/es/color-picker/hue.js +1 -1
  42. package/es/color-picker/index.js +7 -7
  43. package/es/color-picker/mode.js +2 -2
  44. package/es/color-picker/paint.js +1 -1
  45. package/es/color-picker/presets.js +1 -1
  46. package/es/components.js +4 -4
  47. package/es/config/config-context.js +16 -3
  48. package/es/config/context.js +29 -2
  49. package/es/config/index.js +31 -12
  50. package/es/config/popup-host.js +106 -0
  51. package/es/config/size-context.js +1 -1
  52. package/es/config/use-config-appearance.js +62 -2
  53. package/es/const/var.js +6 -2
  54. package/es/date-picker/index.js +404 -885
  55. package/es/descriptions/descriptions-item.js +1 -1
  56. package/es/descriptions/descriptions.js +1 -1
  57. package/es/divider/index.js +1 -1
  58. package/es/drawer/index.js +328 -240
  59. package/es/dropdown/dropdown-button.js +69 -51
  60. package/es/dropdown/dropdown-context.js +1 -1
  61. package/es/dropdown/dropdown.js +137 -93
  62. package/es/dropdown/trigger.js +85 -33
  63. package/es/empty/index.js +3 -4
  64. package/es/feature-card/index.js +15 -4
  65. package/es/feedback-panel/index.js +95 -81
  66. package/es/flame-wrap/index.js +116 -109
  67. package/es/flame-wrap/types.js +54 -6
  68. package/es/flex/index.js +1 -1
  69. package/es/form/field-context.js +16 -2
  70. package/es/form/form-context.js +1 -1
  71. package/es/form/form-item.js +7 -6
  72. package/es/form/form.js +1 -1
  73. package/es/form/utils.js +1 -1
  74. package/es/grid/grid-item.js +1 -1
  75. package/es/grid/grid.js +1 -1
  76. package/es/grid/useBreakpoint.js +1 -1
  77. package/es/icon/index.js +1 -1
  78. package/es/image/group.js +1 -1
  79. package/es/image/image-group-context.js +1 -1
  80. package/es/image/image.js +137 -123
  81. package/es/image/instance.js +1 -1
  82. package/es/image/preview.js +1 -1
  83. package/es/image/utils.js +1 -1
  84. package/es/index.js +3 -3
  85. package/es/input/index.js +3 -3
  86. package/es/input/input-base.js +7 -7
  87. package/es/input/input-box.js +2 -2
  88. package/es/input/input-group.js +43 -127
  89. package/es/input/input.js +1 -1
  90. package/es/input/textarea.js +28 -114
  91. package/es/input-number/index.js +7 -5
  92. package/es/input-otp/index.js +5 -5
  93. package/es/input-tag/index.js +5 -5
  94. package/es/kanban/index.js +79 -63
  95. package/es/layout/index.js +1 -1
  96. package/es/layout/layout-context.js +1 -1
  97. package/es/list-panel/index.js +96 -83
  98. package/es/loading/index.js +1 -1
  99. package/es/loading/loading-bar.js +1 -1
  100. package/es/locale/de.js +10 -2
  101. package/es/locale/el.js +10 -2
  102. package/es/locale/en.js +10 -2
  103. package/es/locale/fr.js +10 -2
  104. package/es/locale/it.js +10 -2
  105. package/es/locale/ja.js +10 -2
  106. package/es/locale/ko.js +10 -2
  107. package/es/locale/ru.js +10 -2
  108. package/es/locale/th.js +10 -2
  109. package/es/locale/uk.js +10 -2
  110. package/es/locale/vi.js +10 -2
  111. package/es/locale/zh-CN.js +10 -2
  112. package/es/locale/zh-TW.js +10 -2
  113. package/es/mentions/index.js +291 -286
  114. package/es/menu/menu-context.js +1 -1
  115. package/es/menu/menu-divider.js +1 -1
  116. package/es/menu/menu-group.js +1 -1
  117. package/es/menu/menu-item.js +1 -1
  118. package/es/menu/menu-keyboard.js +41 -2
  119. package/es/menu/menu.js +268 -222
  120. package/es/menu/recursive-menu.js +1 -1
  121. package/es/menu/sub-menu.js +81 -23
  122. package/es/message/index.js +1 -1
  123. package/es/modal/api.js +46 -12
  124. package/es/modal/modal.js +441 -345
  125. package/es/modal/toast.js +177 -64
  126. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  127. package/es/notice/container.js +1 -1
  128. package/es/notice/content.js +1 -1
  129. package/es/notice/index.js +1 -1
  130. package/es/notice/instance.js +1 -1
  131. package/es/page/index.js +13 -8
  132. package/es/page/responsive.js +1 -1
  133. package/es/page-header/index.js +1 -1
  134. package/es/popconfirm/index.js +36 -35
  135. package/es/poptip/index.js +47 -45
  136. package/es/popup/index.js +5 -2
  137. package/es/popup/layers.js +11 -2
  138. package/es/progress/index.js +1 -1
  139. package/es/qrcode/index.js +13 -7
  140. package/es/radio/radio-button.js +51 -44
  141. package/es/radio/radio-group-context.js +1 -1
  142. package/es/radio/radio-group.js +49 -52
  143. package/es/radio/radio.js +46 -197
  144. package/es/rate/index.js +1 -1
  145. package/es/rate/star.js +1 -1
  146. package/es/result/index.js +1 -1
  147. package/es/ripple/index.js +104 -97
  148. package/es/ripple/types.js +71 -18
  149. package/es/row-col/col.js +1 -1
  150. package/es/row-col/row.js +1 -1
  151. package/es/segmented/index.js +3 -3
  152. package/es/select/option.js +1 -1
  153. package/es/select/select.js +29 -29
  154. package/es/skeleton/skeleton-avatar.js +1 -1
  155. package/es/skeleton/skeleton-button.js +1 -1
  156. package/es/skeleton/skeleton-image.js +1 -1
  157. package/es/skeleton/skeleton-text.js +1 -1
  158. package/es/skeleton/skeleton.js +1 -1
  159. package/es/skeleton/use-skeleton-loading.js +1 -1
  160. package/es/slider/index.js +1 -1
  161. package/es/slider/thumb.js +1 -1
  162. package/es/space/index.js +1 -1
  163. package/es/spin/index.js +1 -1
  164. package/es/splitter/splitter-panel.js +1 -1
  165. package/es/splitter/splitter.js +1 -1
  166. package/es/stat-card/countup.js +2 -2
  167. package/es/stat-card/rollup.js +1 -1
  168. package/es/stat-card/stat-card.js +16 -7
  169. package/es/stat-card/stat-number.js +4 -3
  170. package/es/stat-card/utils/countup.js +1 -1
  171. package/es/stat-card/utils/odometer.js +1 -1
  172. package/es/stat-card/utils/stat-item-key.js +22 -0
  173. package/es/steps/index.js +1 -1
  174. package/es/switch/index.js +3 -3
  175. package/es/table/column-setting.js +104 -115
  176. package/es/table/index.js +544 -206
  177. package/es/table/utils.js +141 -3
  178. package/es/tabs/tab-panel.js +1 -1
  179. package/es/tabs/tabs.js +1 -1
  180. package/es/tag/index.js +12 -5
  181. package/es/time-line/timeline-item.js +1 -1
  182. package/es/time-line/timeline.js +1 -1
  183. package/es/tooltip/index.js +114 -94
  184. package/es/tour/index.js +1 -1
  185. package/es/transfer/index.js +190 -172
  186. package/es/tree/index.js +55 -44
  187. package/es/tree/utils.js +1 -1
  188. package/es/tree-select/index.js +259 -781
  189. package/es/typography/index.js +1 -1
  190. package/es/upload/file-list.js +1 -1
  191. package/es/upload/index.js +5 -6
  192. package/es/upload/picture-sort.js +1 -1
  193. package/es/upload/selector.js +1 -1
  194. package/es/utils/checked.js +1 -1
  195. package/es/utils/color.js +25 -2
  196. package/es/utils/css.js +19 -0
  197. package/es/utils/focus.js +63 -0
  198. package/es/utils/number.js +1 -1
  199. package/es/utils/overlay-order.js +18 -0
  200. package/es/utils/overlay-stack.js +33 -0
  201. package/es/utils/placement.js +1 -1
  202. package/es/utils/popup.js +1 -1
  203. package/es/utils/promise.js +18 -0
  204. package/es/utils/react-node.js +55 -30
  205. package/es/utils/selection-tags.js +6 -4
  206. package/es/utils/share.js +5 -2
  207. package/es/utils/theme.js +1 -1
  208. package/es/utils/transition.js +1 -1
  209. package/es/utils/use-value.js +1 -1
  210. package/es/virtual-list/index.js +1 -1
  211. package/es/virtual-list/range.js +3 -2
  212. package/es/watermark/index.js +1 -1
  213. package/lib/index.cjs +2 -2
  214. package/lib/locale/de.cjs +2 -2
  215. package/lib/locale/el.cjs +2 -2
  216. package/lib/locale/en.cjs +2 -2
  217. package/lib/locale/fr.cjs +2 -2
  218. package/lib/locale/it.cjs +2 -2
  219. package/lib/locale/ja.cjs +2 -2
  220. package/lib/locale/ko.cjs +2 -2
  221. package/lib/locale/ru.cjs +2 -2
  222. package/lib/locale/th.cjs +2 -2
  223. package/lib/locale/uk.cjs +2 -2
  224. package/lib/locale/vi.cjs +2 -2
  225. package/lib/locale/zh-CN.cjs +2 -2
  226. package/lib/locale/zh-TW.cjs +2 -2
  227. package/package.json +4 -3
  228. package/readme.md +3 -1
  229. package/style/base.css +2 -2
  230. package/style/components.css +2 -2
  231. package/style/index.css +2 -2
  232. package/style/theme.css +2 -2
  233. package/types/alert/index.d.cts +2 -2
  234. package/types/alert/index.d.ts +2 -2
  235. package/types/auto-complete/index.d.cts +7 -1
  236. package/types/auto-complete/index.d.ts +7 -1
  237. package/types/badge/index.d.cts +2 -1
  238. package/types/badge/index.d.ts +2 -1
  239. package/types/button/button.d.cts +2 -2
  240. package/types/button/button.d.ts +2 -2
  241. package/types/card/index.d.cts +3 -3
  242. package/types/card/index.d.ts +3 -3
  243. package/types/cascader/index.d.cts +1 -1
  244. package/types/cascader/index.d.ts +1 -1
  245. package/types/cascader/types.d.cts +2 -0
  246. package/types/cascader/types.d.ts +2 -0
  247. package/types/check-card/context.d.cts +4 -3
  248. package/types/check-card/context.d.ts +4 -3
  249. package/types/check-card/index.d.cts +1 -1
  250. package/types/check-card/index.d.ts +1 -1
  251. package/types/check-card/types.d.cts +3 -4
  252. package/types/check-card/types.d.ts +3 -4
  253. package/types/checkbox/checkbox-group.d.cts +2 -2
  254. package/types/checkbox/checkbox-group.d.ts +2 -2
  255. package/types/checkbox/checkbox.d.cts +2 -2
  256. package/types/checkbox/checkbox.d.ts +2 -2
  257. package/types/collapse/collapse.d.cts +3 -3
  258. package/types/collapse/collapse.d.ts +3 -3
  259. package/types/color-picker/index.d.cts +3 -1
  260. package/types/color-picker/index.d.ts +3 -1
  261. package/types/components.d.cts +2 -2
  262. package/types/components.d.ts +2 -2
  263. package/types/config/config-context.d.cts +15 -2
  264. package/types/config/config-context.d.ts +15 -2
  265. package/types/config/context.d.cts +6 -0
  266. package/types/config/context.d.ts +6 -0
  267. package/types/config/popup-host.d.cts +16 -0
  268. package/types/config/popup-host.d.ts +16 -0
  269. package/types/config/use-config-appearance.d.cts +41 -2
  270. package/types/config/use-config-appearance.d.ts +41 -2
  271. package/types/const/types.d.cts +30 -1
  272. package/types/const/types.d.ts +30 -1
  273. package/types/const/var.d.cts +6 -1
  274. package/types/const/var.d.ts +6 -1
  275. package/types/date-picker/index.d.cts +3 -1
  276. package/types/date-picker/index.d.ts +3 -1
  277. package/types/descriptions/descriptions.d.cts +2 -2
  278. package/types/descriptions/descriptions.d.ts +2 -2
  279. package/types/drawer/index.d.cts +1 -0
  280. package/types/drawer/index.d.ts +1 -0
  281. package/types/dropdown/dropdown-button.d.cts +5 -2
  282. package/types/dropdown/dropdown-button.d.ts +5 -2
  283. package/types/dropdown/dropdown-context.d.cts +6 -0
  284. package/types/dropdown/dropdown-context.d.ts +6 -0
  285. package/types/dropdown/dropdown.d.cts +2 -0
  286. package/types/dropdown/dropdown.d.ts +2 -0
  287. package/types/feature-card/index.d.cts +3 -3
  288. package/types/feature-card/index.d.ts +3 -3
  289. package/types/feedback-panel/index.d.cts +3 -3
  290. package/types/feedback-panel/index.d.ts +3 -3
  291. package/types/flame-wrap/types.d.cts +18 -0
  292. package/types/flame-wrap/types.d.ts +18 -0
  293. package/types/form/field-context.d.cts +2 -0
  294. package/types/form/field-context.d.ts +2 -0
  295. package/types/image/image.d.cts +2 -2
  296. package/types/image/image.d.ts +2 -2
  297. package/types/input/input-group.d.cts +2 -2
  298. package/types/input/input-group.d.ts +2 -2
  299. package/types/input-number/index.d.cts +2 -0
  300. package/types/input-number/index.d.ts +2 -0
  301. package/types/kanban/index.d.cts +3 -2
  302. package/types/kanban/index.d.ts +3 -2
  303. package/types/list-panel/index.d.cts +3 -3
  304. package/types/list-panel/index.d.ts +3 -3
  305. package/types/locale/de.d.cts +6 -0
  306. package/types/locale/de.d.ts +6 -0
  307. package/types/locale/el.d.cts +6 -0
  308. package/types/locale/el.d.ts +6 -0
  309. package/types/locale/en.d.cts +6 -0
  310. package/types/locale/en.d.ts +6 -0
  311. package/types/locale/fr.d.cts +6 -0
  312. package/types/locale/fr.d.ts +6 -0
  313. package/types/locale/it.d.cts +6 -0
  314. package/types/locale/it.d.ts +6 -0
  315. package/types/locale/ja.d.cts +6 -0
  316. package/types/locale/ja.d.ts +6 -0
  317. package/types/locale/ko.d.cts +6 -0
  318. package/types/locale/ko.d.ts +6 -0
  319. package/types/locale/ru.d.cts +6 -0
  320. package/types/locale/ru.d.ts +6 -0
  321. package/types/locale/th.d.cts +6 -0
  322. package/types/locale/th.d.ts +6 -0
  323. package/types/locale/uk.d.cts +6 -0
  324. package/types/locale/uk.d.ts +6 -0
  325. package/types/locale/vi.d.cts +6 -0
  326. package/types/locale/vi.d.ts +6 -0
  327. package/types/locale/zh-CN.d.cts +6 -0
  328. package/types/locale/zh-CN.d.ts +6 -0
  329. package/types/locale/zh-TW.d.cts +6 -0
  330. package/types/locale/zh-TW.d.ts +6 -0
  331. package/types/mentions/index.d.cts +2 -0
  332. package/types/mentions/index.d.ts +2 -0
  333. package/types/menu/menu-keyboard.d.cts +23 -0
  334. package/types/menu/menu-keyboard.d.ts +23 -0
  335. package/types/modal/api.d.cts +6 -1
  336. package/types/modal/api.d.ts +6 -1
  337. package/types/modal/modal.d.cts +1 -0
  338. package/types/modal/modal.d.ts +1 -0
  339. package/types/modal/toast.d.cts +8 -2
  340. package/types/modal/toast.d.ts +8 -2
  341. package/types/page/index.d.cts +2 -2
  342. package/types/page/index.d.ts +2 -2
  343. package/types/popconfirm/index.d.cts +2 -0
  344. package/types/popconfirm/index.d.ts +2 -0
  345. package/types/poptip/index.d.cts +2 -0
  346. package/types/poptip/index.d.ts +2 -0
  347. package/types/popup/layers.d.cts +2 -0
  348. package/types/popup/layers.d.ts +2 -0
  349. package/types/qrcode/index.d.cts +2 -2
  350. package/types/qrcode/index.d.ts +2 -2
  351. package/types/radio/radio-button.d.cts +2 -2
  352. package/types/radio/radio-button.d.ts +2 -2
  353. package/types/radio/radio-group.d.cts +2 -2
  354. package/types/radio/radio-group.d.ts +2 -2
  355. package/types/radio/radio.d.cts +2 -2
  356. package/types/radio/radio.d.ts +2 -2
  357. package/types/ripple/types.d.cts +18 -0
  358. package/types/ripple/types.d.ts +18 -0
  359. package/types/select/select.d.cts +2 -0
  360. package/types/select/select.d.ts +2 -0
  361. package/types/stat-card/stat-card.d.cts +3 -3
  362. package/types/stat-card/stat-card.d.ts +3 -3
  363. package/types/stat-card/utils/stat-item-key.d.cts +11 -0
  364. package/types/stat-card/utils/stat-item-key.d.ts +11 -0
  365. package/types/table/column-setting.d.cts +4 -4
  366. package/types/table/column-setting.d.ts +4 -4
  367. package/types/table/index.d.cts +2 -2
  368. package/types/table/index.d.ts +2 -2
  369. package/types/table/types.d.cts +21 -2
  370. package/types/table/types.d.ts +21 -2
  371. package/types/table/utils.d.cts +75 -0
  372. package/types/table/utils.d.ts +75 -0
  373. package/types/tag/index.d.cts +2 -2
  374. package/types/tag/index.d.ts +2 -2
  375. package/types/tooltip/index.d.cts +2 -0
  376. package/types/tooltip/index.d.ts +2 -0
  377. package/types/transfer/index.d.cts +3 -2
  378. package/types/transfer/index.d.ts +3 -2
  379. package/types/tree-select/index.d.cts +3 -1
  380. package/types/tree-select/index.d.ts +3 -1
  381. package/types/utils/checked.d.cts +1 -1
  382. package/types/utils/checked.d.ts +1 -1
  383. package/types/utils/color.d.cts +13 -0
  384. package/types/utils/color.d.ts +13 -0
  385. package/types/utils/css.d.cts +2 -0
  386. package/types/utils/css.d.ts +2 -0
  387. package/types/utils/focus.d.cts +5 -0
  388. package/types/utils/focus.d.ts +5 -0
  389. package/types/utils/overlay-order.d.cts +6 -0
  390. package/types/utils/overlay-order.d.ts +6 -0
  391. package/types/utils/overlay-stack.d.cts +13 -0
  392. package/types/utils/overlay-stack.d.ts +13 -0
  393. package/types/utils/promise.d.cts +5 -0
  394. package/types/utils/promise.d.ts +5 -0
  395. package/types/utils/react-node.d.cts +10 -0
  396. package/types/utils/react-node.d.ts +10 -0
@@ -1,8 +1,52 @@
1
1
  import { Column, TableKey, TableTreeRow } from './types.js';
2
2
  export declare const flattenColumns: <T>(columns: Column<T>[]) => Column<T>[];
3
3
  export declare const countColumnLeaves: <T>(column: Column<T>) => number;
4
+ /**
5
+ * 分组表头父列上的 `fixed` 向下继承给整棵子树。kui-react 与 kui-vue 的
6
+ * `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边,
7
+ * 否则同一份列配置在两个框架里会固定出不同的列。
8
+ *
9
+ * `colgroup` 与 sticky 偏移都只按叶子列累加,所以父列上写的 `fixed` 必须落到它的每个叶子列上,
10
+ * 「固定整组」这种配置才不会整体失效。叶子自己显式写的 `fixed` 优先,只在没写时补继承值;
11
+ * 一个方向都没继承到的列返回原来的对象引用,整棵子树都没变时连数组都复用同一个引用,
12
+ * 免得每次渲染都给列树新建对象,把 `visibleColumns → leaves → headerInfo` 的 memo 打回原形。
13
+ */
14
+ export declare const inheritColumnFixed: <C extends {
15
+ fixed?: "left" | "right";
16
+ children?: C[];
17
+ }>(columns: C[], inherited?: "left" | "right") => C[];
18
+ /**
19
+ * 按列 `key` 从记录里取单元格值,`rowKey` 与 `childrenColumnName` 的字段名也走这同一个读取器。
20
+ * kui-react 与 kui-vue 的 `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边,
21
+ * 否则同一份数据在两个框架里会渲染出不同内容、排出不同顺序。
22
+ *
23
+ * 取值规则:
24
+ * - 整名优先:`key` 本身就是记录上的属性时直接取它,所以字段名自带点号(`{ "a.b": 1 }`)不会被误当成路径;
25
+ * - 整名没命中且 `key` 含点号时按 `.` 逐段下钻,任意一段走到非对象(含 `null`)就返回 `undefined`,
26
+ * 所以 `{ user: null }` 配 `key="user.name"` 渲染成空而不是抛错;数字段天然能取数组元素(`"tags.0"`);
27
+ * - `__proto__`/`constructor`/`prototype` 这三段一律取不到值,避免列名顺着原型链摸到全局对象。
28
+ */
4
29
  export declare const getRecordValue: <T extends object>(record: T, key: string) => unknown;
5
30
  export declare const getTreeChildren: <T extends object>(record: T, childrenColumnName: string) => T[];
31
+ /**
32
+ * 表头排序的共享比较器。kui-react 与 kui-vue 的 `components/table/utils.ts` 里是逐字节相同的副本,
33
+ * 改一边必须同步另一边,否则同一份数据在两个框架下会排出不同顺序。
34
+ *
35
+ * 规则:
36
+ * - 两侧都是 number(含 `Date` 之外的数值)时按数值比较,`NaN` 排在最前;
37
+ * - 其余情况(字符串、数字与字符串混排、布尔、`null`/`undefined`)统一转成字符串,
38
+ * 用带数字感知的字典序比较,所以 `"9"` 排在 `"10"` 前面,`null`/`undefined` 视作空串。
39
+ */
40
+ export declare const compareSortValues: (first: unknown, second: unknown) => number;
41
+ export declare const getSyntheticRowKey: (record: object) => string;
42
+ /**
43
+ * 解析一行的 key,kui-react 与 kui-vue 行为一致:`rowKey` 可以是字段名,也可以是取值函数;
44
+ * 两者都拿不到 `string`/`number` 时回退到 `getSyntheticRowKey` 生成的兜底 key。
45
+ *
46
+ * 字段名走 `getRecordValue`,所以和列 `key` 一样支持 `"user.uid"` 这种点路径。
47
+ * 本函数与上面的 `getSyntheticRowKey` 在两个仓库里是逐字节相同的副本,改一边必须同步另一边。
48
+ */
49
+ export declare const resolveRowKey: <T extends object>(record: T, rowKey: string | ((record: T) => TableKey)) => TableKey;
6
50
  interface FlattenTreeOptions<T extends object> {
7
51
  data: T[];
8
52
  childrenColumnName: string;
@@ -11,4 +55,35 @@ interface FlattenTreeOptions<T extends object> {
11
55
  sortRecords?: (records: T[]) => T[];
12
56
  }
13
57
  export declare const flattenTreeData: <T extends object>({ data, childrenColumnName, expandedKeys, getKey, sortRecords, }: FlattenTreeOptions<T>) => TableTreeRow<T>[];
58
+ /**
59
+ * `expandAllRows` 期间 `data` 异步变化时,把“数据里新出现的父行”补进展开集合,
60
+ * 已经在数据里的行保持用户手动展开或折叠的结果。kui-react 与 kui-vue 的
61
+ * `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边。
62
+ *
63
+ * `knownParentKeys` 是上一次看到的数据里的父行 key 集合,`nextParentKeys` 是本次的,
64
+ * 所以从数据里消失又回来的父行算“新出现”、会被重新展开,两仓都不记住它曾被折叠。
65
+ * `changed` 只回答“展开集合要不要加新 key”:调用方每轮都要把 `nextParentKeys` 记回去,
66
+ * 但不能无条件写回展开状态,否则 `data` 每轮都是新数组,渲染期同步状态会直接死循环。
67
+ */
68
+ export declare const mergeExpandAllRows: (knownParentKeys: Set<TableKey>, nextParentKeys: Set<TableKey>, expandedKeys: Set<TableKey>) => {
69
+ keys: Set<TableKey>;
70
+ changed: boolean;
71
+ };
72
+ /**
73
+ * 单元格省略号配置的归一:列上写了 `ellipsis` 就以列为准,没写才跟着表格级的 `ellipsis` 走,
74
+ * 所以表格级全开时某一列还能用 `ellipsis: false` 单独关掉。`true` 是单行,数字是行数,
75
+ * 对象可以另给 `rows` 与 `tooltip`。返回 `null` 表示这一列不截断。
76
+ * `tooltip` 在这里只当不透明值传下去,节点类型由各自的框架决定,因此两仓的
77
+ * `components/table/utils.ts` 里这一段是逐字节相同的副本,改一边必须同步另一边。
78
+ */
79
+ export declare const resolveCellEllipsis: <TooltipValue>(columnValue: boolean | number | {
80
+ rows?: number;
81
+ tooltip?: TooltipValue | false;
82
+ } | undefined, tableValue: boolean | number | {
83
+ rows?: number;
84
+ tooltip?: TooltipValue | false;
85
+ } | undefined) => {
86
+ rows: number;
87
+ tooltip?: TooltipValue | false;
88
+ } | null;
14
89
  export {};
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ColorType, ShapeType, SizeType, ThemeType } from '../const/types.cjs';
2
+ import { ColorType, ShapeType, SizeType, SurfaceThemeType } from '../const/types.cjs';
3
3
  import { IconType } from '../icon/index.cjs';
4
4
  export interface TagProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "defaultChecked"> {
5
5
  closeable?: boolean;
@@ -8,7 +8,7 @@ export interface TagProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "de
8
8
  shape?: ShapeType;
9
9
  icon?: IconType[];
10
10
  size?: SizeType;
11
- theme?: ThemeType;
11
+ theme?: SurfaceThemeType;
12
12
  onClose?: () => void;
13
13
  onAfterClose?: () => void;
14
14
  children?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ColorType, ShapeType, SizeType, ThemeType } from '../const/types.js';
2
+ import { ColorType, ShapeType, SizeType, SurfaceThemeType } from '../const/types.js';
3
3
  import { IconType } from '../icon/index.js';
4
4
  export interface TagProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "defaultChecked"> {
5
5
  closeable?: boolean;
@@ -8,7 +8,7 @@ export interface TagProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "de
8
8
  shape?: ShapeType;
9
9
  icon?: IconType[];
10
10
  size?: SizeType;
11
- theme?: ThemeType;
11
+ theme?: SurfaceThemeType;
12
12
  onClose?: () => void;
13
13
  onAfterClose?: () => void;
14
14
  children?: React.ReactNode;
@@ -10,6 +10,8 @@ export interface TooltipProps {
10
10
  disabled?: boolean;
11
11
  width?: number | string;
12
12
  placement?: PlacementsType;
13
+ /** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
14
+ destroyOnClose?: boolean;
13
15
  /** 只渲染浮层本身,不包含触发元素、定位与动画,与 kui-vue 一致 */
14
16
  panelOnly?: boolean;
15
17
  onOpenChange?: (open: boolean) => void;
@@ -10,6 +10,8 @@ export interface TooltipProps {
10
10
  disabled?: boolean;
11
11
  width?: number | string;
12
12
  placement?: PlacementsType;
13
+ /** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
14
+ destroyOnClose?: boolean;
13
15
  /** 只渲染浮层本身,不包含触发元素、定位与动画,与 kui-vue 一致 */
14
16
  panelOnly?: boolean;
15
17
  onOpenChange?: (open: boolean) => void;
@@ -1,3 +1,4 @@
1
+ import { SurfaceThemeType } from '../const/types.cjs';
1
2
  export type TransferKey = string | number;
2
3
  export interface TransferItem {
3
4
  key: TransferKey;
@@ -19,7 +20,7 @@ export interface TransferProps extends Omit<React.HTMLAttributes<HTMLDivElement>
19
20
  searchable?: boolean;
20
21
  disabled?: boolean;
21
22
  readOnly?: boolean;
22
- theme?: "outline" | "fill";
23
+ theme?: SurfaceThemeType;
23
24
  filterOption?: (keyword: string, item: TransferItem) => boolean;
24
25
  item?: (item: TransferItem) => React.ReactNode;
25
26
  footer?: (direction: "left" | "right") => React.ReactNode;
@@ -27,6 +28,6 @@ export interface TransferProps extends Omit<React.HTMLAttributes<HTMLDivElement>
27
28
  onSelectChange?: (sourceKeys: TransferKey[], targetKeys: TransferKey[]) => void;
28
29
  onSearch?: (direction: "left" | "right", value: string) => void;
29
30
  }
30
- declare function Transfer({ dataSource, targetKeys, titles, operations, searchable, disabled, readOnly, theme, filterOption, item: renderItem, footer, onChange, onSelectChange, onSearch, className, ...rest }: TransferProps): import("react").JSX.Element;
31
+ declare function Transfer({ dataSource, targetKeys, titles, operations, searchable, disabled, readOnly, theme: themeProp, filterOption, item: renderItem, footer, onChange, onSelectChange, onSearch, className, ...rest }: TransferProps): import("react").JSX.Element;
31
32
  declare const _default: typeof Transfer;
32
33
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { SurfaceThemeType } from '../const/types.js';
1
2
  export type TransferKey = string | number;
2
3
  export interface TransferItem {
3
4
  key: TransferKey;
@@ -19,7 +20,7 @@ export interface TransferProps extends Omit<React.HTMLAttributes<HTMLDivElement>
19
20
  searchable?: boolean;
20
21
  disabled?: boolean;
21
22
  readOnly?: boolean;
22
- theme?: "outline" | "fill";
23
+ theme?: SurfaceThemeType;
23
24
  filterOption?: (keyword: string, item: TransferItem) => boolean;
24
25
  item?: (item: TransferItem) => React.ReactNode;
25
26
  footer?: (direction: "left" | "right") => React.ReactNode;
@@ -27,6 +28,6 @@ export interface TransferProps extends Omit<React.HTMLAttributes<HTMLDivElement>
27
28
  onSelectChange?: (sourceKeys: TransferKey[], targetKeys: TransferKey[]) => void;
28
29
  onSearch?: (direction: "left" | "right", value: string) => void;
29
30
  }
30
- declare function Transfer({ dataSource, targetKeys, titles, operations, searchable, disabled, readOnly, theme, filterOption, item: renderItem, footer, onChange, onSelectChange, onSearch, className, ...rest }: TransferProps): import("react").JSX.Element;
31
+ declare function Transfer({ dataSource, targetKeys, titles, operations, searchable, disabled, readOnly, theme: themeProp, filterOption, item: renderItem, footer, onChange, onSelectChange, onSearch, className, ...rest }: TransferProps): import("react").JSX.Element;
31
32
  declare const _default: typeof Transfer;
32
33
  export default _default;
@@ -7,6 +7,8 @@ export interface TreeSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
7
7
  placeholder?: string;
8
8
  size?: SizeType;
9
9
  placement?: DropPlacementsType;
10
+ /** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
11
+ destroyOnClose?: boolean;
10
12
  width?: number;
11
13
  maxTagCount?: number;
12
14
  value?: TreeSelectValue;
@@ -54,6 +56,6 @@ export interface TreeSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
54
56
  onOpenChange?: (open: boolean) => void;
55
57
  onClear?: () => void;
56
58
  }
57
- declare function TreeSelect({ placeholder, size: sizeProp, placement, width, maxTagCount, value, open: openProp, clearable, filterable, block, disabled, readOnly, multiple, loading, bordered, showArrow, options, theme: themeProp, emptyText, icon, shape: shapeProp, arrowIcon, treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys, treeDefaultExpandedKeys, treeCheckedKeys, treeSelectedKeys, treeExpandedAll, treeLoadData, virtual, virtualHeight, itemHeight, overscan, onChange, onTreeSelect, onSearch, onTreeExpand, onTreeExpandedKeysChange, onTreeCheckedKeysChange, onOpenChange, onClear, className, style, ...rest }: TreeSelectProps): import("react").JSX.Element;
59
+ declare function TreeSelect({ placeholder, size: sizeProp, placement, destroyOnClose, width, maxTagCount, value, open: openProp, clearable, filterable, block, disabled, readOnly, multiple, loading, bordered, showArrow, options, theme: themeProp, emptyText, icon, shape: shapeProp, arrowIcon, treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys, treeDefaultExpandedKeys, treeCheckedKeys, treeSelectedKeys, treeExpandedAll, treeLoadData, virtual, virtualHeight, itemHeight, overscan, onChange, onTreeSelect, onSearch, onTreeExpand, onTreeExpandedKeysChange, onTreeCheckedKeysChange, onOpenChange, onClear, className, style, ...rest }: TreeSelectProps): import("react").JSX.Element;
58
60
  declare const _default: typeof TreeSelect;
59
61
  export default _default;
@@ -7,6 +7,8 @@ export interface TreeSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
7
7
  placeholder?: string;
8
8
  size?: SizeType;
9
9
  placement?: DropPlacementsType;
10
+ /** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
11
+ destroyOnClose?: boolean;
10
12
  width?: number;
11
13
  maxTagCount?: number;
12
14
  value?: TreeSelectValue;
@@ -54,6 +56,6 @@ export interface TreeSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
54
56
  onOpenChange?: (open: boolean) => void;
55
57
  onClear?: () => void;
56
58
  }
57
- declare function TreeSelect({ placeholder, size: sizeProp, placement, width, maxTagCount, value, open: openProp, clearable, filterable, block, disabled, readOnly, multiple, loading, bordered, showArrow, options, theme: themeProp, emptyText, icon, shape: shapeProp, arrowIcon, treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys, treeDefaultExpandedKeys, treeCheckedKeys, treeSelectedKeys, treeExpandedAll, treeLoadData, virtual, virtualHeight, itemHeight, overscan, onChange, onTreeSelect, onSearch, onTreeExpand, onTreeExpandedKeysChange, onTreeCheckedKeysChange, onOpenChange, onClear, className, style, ...rest }: TreeSelectProps): import("react").JSX.Element;
59
+ declare function TreeSelect({ placeholder, size: sizeProp, placement, destroyOnClose, width, maxTagCount, value, open: openProp, clearable, filterable, block, disabled, readOnly, multiple, loading, bordered, showArrow, options, theme: themeProp, emptyText, icon, shape: shapeProp, arrowIcon, treeData, treeCheckable, treeShowLine, treeShowIcon, treeCheckStrictly, treeExpandedKeys, treeDefaultExpandedKeys, treeCheckedKeys, treeSelectedKeys, treeExpandedAll, treeLoadData, virtual, virtualHeight, itemHeight, overscan, onChange, onTreeSelect, onSearch, onTreeExpand, onTreeExpandedKeysChange, onTreeCheckedKeysChange, onOpenChange, onClear, className, style, ...rest }: TreeSelectProps): import("react").JSX.Element;
58
60
  declare const _default: typeof TreeSelect;
59
61
  export default _default;
@@ -1,2 +1,2 @@
1
1
  import { ValueType } from '../const/types.cjs';
2
- export declare const getValueWithType: (checked: boolean, vType: ValueType) => boolean | number | string;
2
+ export declare const getValueWithType: (checked: boolean, vType: ValueType) => string | number | boolean;
@@ -1,2 +1,2 @@
1
1
  import { ValueType } from '../const/types.js';
2
- export declare const getValueWithType: (checked: boolean, vType: ValueType) => boolean | number | string;
2
+ export declare const getValueWithType: (checked: boolean, vType: ValueType) => string | number | boolean;
@@ -1 +1,14 @@
1
1
  export declare function isColor(value?: string): boolean;
2
+ /**
3
+ * `color-mix(in srgb, <colour> <share>%, transparent)` written out as a plain colour.
4
+ *
5
+ * Mixing with `transparent` in srgb only scales the colour's own alpha, so the result is the same
6
+ * rgb triple at `share × alpha` — a value every engine can paint, including the Electron build on
7
+ * Windows 7, where `color-mix()` needs Chrome 111 and a declaration that uses it simply gets no
8
+ * value at all.
9
+ *
10
+ * `share` is the percentage the stylesheet would have written. Colours that only resolve in the
11
+ * browser (`currentColor`, `var(--token)`) and anything unparseable return `undefined`, so callers
12
+ * keep the shade their stylesheet baked instead of shipping a broken declaration.
13
+ */
14
+ export declare function wash(value: string | undefined, share: number): string | undefined;
@@ -1 +1,14 @@
1
1
  export declare function isColor(value?: string): boolean;
2
+ /**
3
+ * `color-mix(in srgb, <colour> <share>%, transparent)` written out as a plain colour.
4
+ *
5
+ * Mixing with `transparent` in srgb only scales the colour's own alpha, so the result is the same
6
+ * rgb triple at `share × alpha` — a value every engine can paint, including the Electron build on
7
+ * Windows 7, where `color-mix()` needs Chrome 111 and a declaration that uses it simply gets no
8
+ * value at all.
9
+ *
10
+ * `share` is the percentage the stylesheet would have written. Colours that only resolve in the
11
+ * browser (`currentColor`, `var(--token)`) and anything unparseable return `undefined`, so callers
12
+ * keep the shade their stylesheet baked instead of shipping a broken declaration.
13
+ */
14
+ export declare function wash(value: string | undefined, share: number): string | undefined;
@@ -0,0 +1,2 @@
1
+ export type CssLength = number | string | null | undefined;
2
+ export declare const toCssLength: (value: CssLength) => string | undefined;
@@ -0,0 +1,2 @@
1
+ export type CssLength = number | string | null | undefined;
2
+ export declare const toCssLength: (value: CssLength) => string | undefined;
@@ -0,0 +1,5 @@
1
+ export declare const createFocusTrap: (getContainer: () => HTMLElement | null | undefined) => {
2
+ activate: () => void;
3
+ deactivate: () => void;
4
+ handleKeydown: (event: KeyboardEvent) => void;
5
+ };
@@ -0,0 +1,5 @@
1
+ export declare const createFocusTrap: (getContainer: () => HTMLElement | null | undefined) => {
2
+ activate: () => void;
3
+ deactivate: () => void;
4
+ handleKeydown: (event: KeyboardEvent) => void;
5
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 遮罩层(Modal / Drawer)与弹层(Popup)共用一个"打开顺序"时钟:数值越大越晚打开,也就越靠上。
3
+ * 两边各自有注册表(弹层要算子孙,语义不一样),但必须用同一个时钟才能互相比较谁压在上面。
4
+ * 两个仓库这份实现逐字符相同。
5
+ */
6
+ export declare const nextOverlayOrder: () => number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 遮罩层(Modal / Drawer)与弹层(Popup)共用一个"打开顺序"时钟:数值越大越晚打开,也就越靠上。
3
+ * 两边各自有注册表(弹层要算子孙,语义不一样),但必须用同一个时钟才能互相比较谁压在上面。
4
+ * 两个仓库这份实现逐字符相同。
5
+ */
6
+ export declare const nextOverlayOrder: () => number;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 遮罩层(Modal / Drawer)的打开顺序栈:Escape 只该关掉最上面那一层,
3
+ * 叠着开三个窗口时一次按键不能把它们全收掉。弹层(Popup)有自己的注册表,
4
+ * 但两边共用同一个顺序时钟,所以"我上面还有个下拉没关"也能判出来。
5
+ * 两个仓库这两个文件逐字符相同。
6
+ */
7
+ export interface OverlayHandle {
8
+ /** 我是不是最上面那层:没有更晚打开的遮罩层,也没有更晚打开的弹层压着我 */
9
+ isTop: () => boolean;
10
+ /** 出栈;组件关闭或卸载时必须调,否则会一直挡住下面那层的 Escape */
11
+ release: () => void;
12
+ }
13
+ export declare function pushOverlay(): OverlayHandle;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 遮罩层(Modal / Drawer)的打开顺序栈:Escape 只该关掉最上面那一层,
3
+ * 叠着开三个窗口时一次按键不能把它们全收掉。弹层(Popup)有自己的注册表,
4
+ * 但两边共用同一个顺序时钟,所以"我上面还有个下拉没关"也能判出来。
5
+ * 两个仓库这两个文件逐字符相同。
6
+ */
7
+ export interface OverlayHandle {
8
+ /** 我是不是最上面那层:没有更晚打开的遮罩层,也没有更晚打开的弹层压着我 */
9
+ isTop: () => boolean;
10
+ /** 出栈;组件关闭或卸载时必须调,否则会一直挡住下面那层的 Escape */
11
+ release: () => void;
12
+ }
13
+ export declare function pushOverlay(): OverlayHandle;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * onOk / validate 这类回调允许返回 Promise,组件得先认出 thenable 才决定要不要挂 loading。
3
+ * 两个仓库这份实现逐字符相同。
4
+ */
5
+ export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * onOk / validate 这类回调允许返回 Promise,组件得先认出 thenable 才决定要不要挂 loading。
3
+ * 两个仓库这份实现逐字符相同。
4
+ */
5
+ export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
@@ -2,4 +2,14 @@ import { default as React } from 'react';
2
2
  export declare function setRef<T>(ref: React.Ref<T> | undefined, node: T | null): void;
3
3
  export declare function cloneNodes(vnode: React.ReactNode, props: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
4
4
  export declare function getChildren(children?: React.ReactNode): React.ReactNode[];
5
+ /**
6
+ * Whether an optional content prop deserves its wrapper element.
7
+ *
8
+ * `null` and `undefined` are the documented way to omit a slot, but callers also
9
+ * pass `false` (a conditional like `isAdmin && <Icon />`) or an empty string, and
10
+ * the framework renders `false` as nothing while still mounting the wrapper —
11
+ * which keeps its padding, border and flex gap in the layout with nothing inside
12
+ * it. Numbers count as content, including `0`.
13
+ */
14
+ export declare function hasRenderableContent(value: unknown): boolean;
5
15
  export declare const toggleContainerScroll: (target: HTMLElement | null, lock: boolean) => void;
@@ -2,4 +2,14 @@ import { default as React } from 'react';
2
2
  export declare function setRef<T>(ref: React.Ref<T> | undefined, node: T | null): void;
3
3
  export declare function cloneNodes(vnode: React.ReactNode, props: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
4
4
  export declare function getChildren(children?: React.ReactNode): React.ReactNode[];
5
+ /**
6
+ * Whether an optional content prop deserves its wrapper element.
7
+ *
8
+ * `null` and `undefined` are the documented way to omit a slot, but callers also
9
+ * pass `false` (a conditional like `isAdmin && <Icon />`) or an empty string, and
10
+ * the framework renders `false` as nothing while still mounting the wrapper —
11
+ * which keeps its padding, border and flex gap in the layout with nothing inside
12
+ * it. Numbers count as content, including `0`.
13
+ */
14
+ export declare function hasRenderableContent(value: unknown): boolean;
5
15
  export declare const toggleContainerScroll: (target: HTMLElement | null, lock: boolean) => void;