react-kui 3.2.1 → 3.3.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 (352) hide show
  1. package/ai/kui-components.json +819 -162
  2. package/es/_virtual/_rolldown/runtime.js +2 -3
  3. package/es/affix/index.js +73 -185
  4. package/es/alert/index.js +3 -4
  5. package/es/anchor/anchor-context.js +2 -3
  6. package/es/anchor/anchor-link.js +3 -4
  7. package/es/anchor/anchor.js +195 -398
  8. package/es/auto-complete/index.js +160 -561
  9. package/es/avatar/avatar-group-context.js +2 -3
  10. package/es/avatar/avatar-group.js +32 -124
  11. package/es/avatar/avatar.js +58 -159
  12. package/es/back-top/index.js +66 -201
  13. package/es/badge/index.js +4 -5
  14. package/es/base/teleport.js +22 -54
  15. package/es/base/transition-props.js +2 -3
  16. package/es/base/transition.js +2 -3
  17. package/es/breadcrumb/breadcrumb-context.js +2 -3
  18. package/es/breadcrumb/breadcrumb-item.js +19 -102
  19. package/es/breadcrumb/breadcrumb.js +10 -59
  20. package/es/button/button-group-context.js +2 -3
  21. package/es/button/button-group.js +15 -75
  22. package/es/button/button.js +4 -5
  23. package/es/calendar/index.js +4 -5
  24. package/es/card/index.js +4 -5
  25. package/es/carousel/carousel-context.js +2 -3
  26. package/es/carousel/carousel-item.js +3 -4
  27. package/es/carousel/carousel.js +281 -628
  28. package/es/carousel/drag.js +2 -3
  29. package/es/cascader/index.js +7 -8
  30. package/es/check-card/check-card-group.js +53 -179
  31. package/es/check-card/check-card.js +100 -293
  32. package/es/check-card/context.js +2 -3
  33. package/es/checkbox/checkbox-group-context.js +2 -3
  34. package/es/checkbox/checkbox-group.js +34 -138
  35. package/es/checkbox/checkbox.js +4 -5
  36. package/es/checkbox/index.js +2 -3
  37. package/es/collapse/collapse-panel.js +84 -206
  38. package/es/collapse/collapse.js +38 -170
  39. package/es/color-picker/alpha.js +44 -125
  40. package/es/color-picker/hue.js +39 -108
  41. package/es/color-picker/index.js +7 -6
  42. package/es/color-picker/mode.js +76 -159
  43. package/es/color-picker/paint.js +66 -163
  44. package/es/color-picker/presets.js +12 -44
  45. package/es/components.js +37 -32
  46. package/es/config/config-context.js +2 -3
  47. package/es/config/context.js +2 -3
  48. package/es/config/index.js +3 -4
  49. package/es/config/popup-host.js +3 -4
  50. package/es/config/size-context.js +2 -3
  51. package/es/config/use-config-appearance.js +3 -4
  52. package/es/const/var.js +2 -3
  53. package/es/date-picker/index.js +8 -9
  54. package/es/descriptions/descriptions-item.js +3 -4
  55. package/es/descriptions/descriptions.js +53 -144
  56. package/es/divider/index.js +2 -3
  57. package/es/drawer/index.js +171 -465
  58. package/es/dropdown/dropdown-button.js +25 -128
  59. package/es/dropdown/dropdown-context.js +2 -3
  60. package/es/dropdown/dropdown.js +56 -207
  61. package/es/dropdown/trigger.js +37 -125
  62. package/es/empty/index.js +34 -111
  63. package/es/feature-card/index.js +2 -3
  64. package/es/feedback-panel/index.js +30 -155
  65. package/es/flame-wrap/index.js +3 -4
  66. package/es/flame-wrap/types.js +2 -3
  67. package/es/flex/index.js +2 -3
  68. package/es/form/field-context.js +3 -4
  69. package/es/form/form-context.js +2 -3
  70. package/es/form/form-item.js +4 -5
  71. package/es/form/form.js +108 -279
  72. package/es/form/utils.js +2 -3
  73. package/es/gradient-picker/corners.js +55 -0
  74. package/es/gradient-picker/index.js +191 -0
  75. package/es/gradient-picker/stops.js +219 -0
  76. package/es/gradient-picker/types.js +147 -0
  77. package/es/grid/grid-item.js +25 -116
  78. package/es/grid/grid.js +40 -151
  79. package/es/grid/useBreakpoint.js +3 -4
  80. package/es/icon/index.js +24 -126
  81. package/es/image/group.js +3 -4
  82. package/es/image/image-group-context.js +2 -3
  83. package/es/image/image.js +5 -6
  84. package/es/image/instance.js +2 -3
  85. package/es/image/preview.js +4 -5
  86. package/es/image/utils.js +2 -3
  87. package/es/index.js +5 -4
  88. package/es/input/index.js +2 -3
  89. package/es/input/input-base.js +4 -5
  90. package/es/input/input-box.js +2 -3
  91. package/es/input/input-group.js +4 -5
  92. package/es/input/input.js +3 -4
  93. package/es/input/textarea.js +3 -4
  94. package/es/input-number/drag.js +63 -0
  95. package/es/input-number/index.js +41 -11
  96. package/es/input-otp/index.js +3 -4
  97. package/es/input-tag/index.js +5 -6
  98. package/es/kanban/index.js +31 -168
  99. package/es/layout/index.js +43 -215
  100. package/es/layout/layout-context.js +2 -3
  101. package/es/list-panel/index.js +47 -185
  102. package/es/loading/index.js +2 -3
  103. package/es/loading/loading-bar.js +54 -114
  104. package/es/locale/de.js +2 -3
  105. package/es/locale/el.js +2 -3
  106. package/es/locale/en.js +2 -3
  107. package/es/locale/fr.js +2 -3
  108. package/es/locale/it.js +2 -3
  109. package/es/locale/ja.js +2 -3
  110. package/es/locale/ko.js +2 -3
  111. package/es/locale/ru.js +2 -3
  112. package/es/locale/th.js +2 -3
  113. package/es/locale/uk.js +2 -3
  114. package/es/locale/vi.js +2 -3
  115. package/es/locale/zh-CN.js +2 -3
  116. package/es/locale/zh-TW.js +2 -3
  117. package/es/mentions/index.js +214 -581
  118. package/es/menu/menu-context.js +2 -3
  119. package/es/menu/menu-divider.js +3 -4
  120. package/es/menu/menu-group.js +3 -4
  121. package/es/menu/menu-item.js +2 -3
  122. package/es/menu/menu-keyboard.js +2 -3
  123. package/es/menu/menu.js +184 -442
  124. package/es/menu/recursive-menu.js +3 -4
  125. package/es/menu/sub-menu.js +5 -6
  126. package/es/message/index.js +2 -3
  127. package/es/modal/api.js +2 -3
  128. package/es/modal/modal.js +263 -599
  129. package/es/modal/toast.js +63 -179
  130. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +2 -3
  131. package/es/notice/container.js +2 -3
  132. package/es/notice/content.js +4 -5
  133. package/es/notice/index.js +2 -3
  134. package/es/notice/instance.js +2 -3
  135. package/es/page/index.js +4 -5
  136. package/es/page/responsive.js +2 -3
  137. package/es/page-header/index.js +3 -4
  138. package/es/popconfirm/index.js +24 -70
  139. package/es/poptip/index.js +29 -88
  140. package/es/popup/index.js +8 -6
  141. package/es/popup/layers.js +2 -3
  142. package/es/progress/index.js +95 -229
  143. package/es/qrcode/index.js +3 -4
  144. package/es/radio/radio-button.js +37 -131
  145. package/es/radio/radio-group-context.js +2 -3
  146. package/es/radio/radio-group.js +69 -223
  147. package/es/radio/radio.js +3 -4
  148. package/es/rate/index.js +68 -226
  149. package/es/rate/star.js +38 -129
  150. package/es/result/index.js +35 -127
  151. package/es/ripple/index.js +3 -4
  152. package/es/ripple/types.js +2 -3
  153. package/es/row-col/col.js +59 -149
  154. package/es/row-col/row.js +2 -3
  155. package/es/segmented/index.js +66 -210
  156. package/es/select/option.js +23 -116
  157. package/es/select/select.js +9 -10
  158. package/es/skeleton/skeleton-avatar.js +2 -3
  159. package/es/skeleton/skeleton-button.js +2 -3
  160. package/es/skeleton/skeleton-image.js +28 -108
  161. package/es/skeleton/skeleton-text.js +17 -93
  162. package/es/skeleton/skeleton.js +46 -133
  163. package/es/skeleton/use-skeleton-loading.js +3 -4
  164. package/es/slider/index.js +92 -286
  165. package/es/slider/thumb.js +43 -133
  166. package/es/space/index.js +3 -4
  167. package/es/spin/index.js +2 -3
  168. package/es/splitter/splitter-panel.js +3 -4
  169. package/es/splitter/splitter.js +77 -219
  170. package/es/stat-card/countup.js +46 -141
  171. package/es/stat-card/rollup.js +27 -105
  172. package/es/stat-card/stat-card.js +3 -4
  173. package/es/stat-card/stat-number.js +26 -113
  174. package/es/stat-card/utils/countup.js +2 -3
  175. package/es/stat-card/utils/odometer.js +2 -3
  176. package/es/stat-card/utils/stat-item-key.js +2 -3
  177. package/es/steps/index.js +45 -123
  178. package/es/switch/index.js +4 -5
  179. package/es/table/column-setting.js +43 -139
  180. package/es/table/index.js +8 -9
  181. package/es/table/utils.js +2 -3
  182. package/es/tabs/tab-panel.js +19 -71
  183. package/es/tabs/tabs.js +6 -7
  184. package/es/tag/index.js +4 -5
  185. package/es/time-line/timeline-item.js +3 -4
  186. package/es/time-line/timeline.js +8 -44
  187. package/es/tooltip/index.js +41 -142
  188. package/es/tour/index.js +138 -356
  189. package/es/transfer/index.js +184 -487
  190. package/es/tree/index.js +8 -9
  191. package/es/tree/utils.js +2 -3
  192. package/es/tree-select/index.js +8 -9
  193. package/es/typography/index.js +75 -306
  194. package/es/upload/file-list.js +95 -119
  195. package/es/upload/index.js +8 -9
  196. package/es/upload/picture-sort.js +2 -3
  197. package/es/upload/selector.js +63 -193
  198. package/es/utils/checked.js +2 -3
  199. package/es/utils/color.js +2 -3
  200. package/es/utils/css.js +2 -3
  201. package/es/utils/focus.js +2 -3
  202. package/es/utils/number.js +2 -3
  203. package/es/utils/overlay-order.js +2 -3
  204. package/es/utils/overlay-stack.js +3 -4
  205. package/es/utils/placement.js +16 -4
  206. package/es/utils/popup-arrow.js +45 -0
  207. package/es/utils/popup.js +2 -3
  208. package/es/utils/promise.js +2 -3
  209. package/es/utils/react-node.js +2 -3
  210. package/es/utils/selection-tags.js +2 -3
  211. package/es/utils/share.js +2 -3
  212. package/es/utils/theme.js +2 -3
  213. package/es/utils/transition.js +2 -3
  214. package/es/utils/use-value.js +3 -4
  215. package/es/virtual-list/index.js +49 -187
  216. package/es/virtual-list/range.js +2 -3
  217. package/es/watermark/index.js +149 -289
  218. package/lib/index.cjs +2 -2
  219. package/lib/locale/de.cjs +1 -1
  220. package/lib/locale/el.cjs +1 -1
  221. package/lib/locale/en.cjs +1 -1
  222. package/lib/locale/fr.cjs +1 -1
  223. package/lib/locale/it.cjs +1 -1
  224. package/lib/locale/ja.cjs +1 -1
  225. package/lib/locale/ko.cjs +1 -1
  226. package/lib/locale/ru.cjs +1 -1
  227. package/lib/locale/th.cjs +1 -1
  228. package/lib/locale/uk.cjs +1 -1
  229. package/lib/locale/vi.cjs +1 -1
  230. package/lib/locale/zh-CN.cjs +1 -1
  231. package/lib/locale/zh-TW.cjs +1 -1
  232. package/package.json +24 -24
  233. package/style/base.css +1 -1
  234. package/style/components.css +2 -2
  235. package/style/index.css +2 -2
  236. package/style/theme.css +1 -1
  237. package/types/affix/index.d.cts +1 -1
  238. package/types/affix/index.d.ts +1 -1
  239. package/types/anchor/anchor-link.d.cts +1 -1
  240. package/types/anchor/anchor-link.d.ts +1 -1
  241. package/types/anchor/anchor.d.cts +1 -1
  242. package/types/anchor/anchor.d.ts +1 -1
  243. package/types/back-top/index.d.cts +1 -1
  244. package/types/back-top/index.d.ts +1 -1
  245. package/types/carousel/carousel-item.d.cts +1 -1
  246. package/types/carousel/carousel-item.d.ts +1 -1
  247. package/types/cascader/index.d.cts +1 -1
  248. package/types/cascader/index.d.ts +1 -1
  249. package/types/color-picker/alpha.d.cts +1 -1
  250. package/types/color-picker/alpha.d.ts +1 -1
  251. package/types/color-picker/hue.d.cts +1 -1
  252. package/types/color-picker/hue.d.ts +1 -1
  253. package/types/color-picker/index.d.cts +3 -2
  254. package/types/color-picker/index.d.ts +3 -2
  255. package/types/color-picker/mode.d.cts +1 -1
  256. package/types/color-picker/mode.d.ts +1 -1
  257. package/types/color-picker/paint.d.cts +1 -1
  258. package/types/color-picker/paint.d.ts +1 -1
  259. package/types/color-picker/presets.d.cts +1 -1
  260. package/types/color-picker/presets.d.ts +1 -1
  261. package/types/components.d.cts +3 -0
  262. package/types/components.d.ts +3 -0
  263. package/types/date-picker/index.d.cts +2 -2
  264. package/types/date-picker/index.d.ts +2 -2
  265. package/types/feature-card/index.d.cts +1 -1
  266. package/types/feature-card/index.d.ts +1 -1
  267. package/types/feedback-panel/index.d.cts +1 -1
  268. package/types/feedback-panel/index.d.ts +1 -1
  269. package/types/flame-wrap/index.d.cts +1 -1
  270. package/types/flame-wrap/index.d.ts +1 -1
  271. package/types/form/form-item.d.cts +1 -1
  272. package/types/form/form-item.d.ts +1 -1
  273. package/types/gradient-picker/corners.d.cts +8 -0
  274. package/types/gradient-picker/corners.d.ts +8 -0
  275. package/types/gradient-picker/index.d.cts +25 -0
  276. package/types/gradient-picker/index.d.ts +25 -0
  277. package/types/gradient-picker/stops.d.cts +12 -0
  278. package/types/gradient-picker/stops.d.ts +12 -0
  279. package/types/gradient-picker/types.d.cts +34 -0
  280. package/types/gradient-picker/types.d.ts +34 -0
  281. package/types/grid/grid-item.d.cts +1 -1
  282. package/types/grid/grid-item.d.ts +1 -1
  283. package/types/grid/grid.d.cts +1 -1
  284. package/types/grid/grid.d.ts +1 -1
  285. package/types/image/group.d.cts +1 -1
  286. package/types/image/group.d.ts +1 -1
  287. package/types/input-number/drag.d.cts +9 -0
  288. package/types/input-number/drag.d.ts +9 -0
  289. package/types/input-number/index.d.cts +1 -0
  290. package/types/input-number/index.d.ts +1 -0
  291. package/types/kanban/index.d.cts +1 -1
  292. package/types/kanban/index.d.ts +1 -1
  293. package/types/list-panel/index.d.cts +1 -1
  294. package/types/list-panel/index.d.ts +1 -1
  295. package/types/loading/loading-bar.d.cts +1 -1
  296. package/types/loading/loading-bar.d.ts +1 -1
  297. package/types/modal/toast.d.cts +1 -1
  298. package/types/modal/toast.d.ts +1 -1
  299. package/types/notice/content.d.cts +2 -2
  300. package/types/notice/content.d.ts +2 -2
  301. package/types/page-header/index.d.cts +1 -1
  302. package/types/page-header/index.d.ts +1 -1
  303. package/types/popconfirm/index.d.cts +1 -0
  304. package/types/popconfirm/index.d.ts +1 -0
  305. package/types/poptip/index.d.cts +1 -0
  306. package/types/poptip/index.d.ts +1 -0
  307. package/types/popup/index.d.cts +1 -0
  308. package/types/popup/index.d.ts +1 -0
  309. package/types/result/index.d.cts +1 -1
  310. package/types/result/index.d.ts +1 -1
  311. package/types/ripple/index.d.cts +1 -1
  312. package/types/ripple/index.d.ts +1 -1
  313. package/types/slider/index.d.cts +1 -1
  314. package/types/slider/index.d.ts +1 -1
  315. package/types/splitter/splitter-panel.d.cts +1 -1
  316. package/types/splitter/splitter-panel.d.ts +1 -1
  317. package/types/splitter/splitter.d.cts +1 -1
  318. package/types/splitter/splitter.d.ts +1 -1
  319. package/types/stat-card/countup.d.cts +1 -1
  320. package/types/stat-card/countup.d.ts +1 -1
  321. package/types/stat-card/rollup.d.cts +1 -1
  322. package/types/stat-card/rollup.d.ts +1 -1
  323. package/types/stat-card/stat-card.d.cts +1 -1
  324. package/types/stat-card/stat-card.d.ts +1 -1
  325. package/types/stat-card/stat-number.d.cts +1 -1
  326. package/types/stat-card/stat-number.d.ts +1 -1
  327. package/types/table/column-setting.d.cts +1 -1
  328. package/types/table/column-setting.d.ts +1 -1
  329. package/types/table/index.d.cts +1 -1
  330. package/types/table/index.d.ts +1 -1
  331. package/types/time-line/timeline-item.d.cts +1 -1
  332. package/types/time-line/timeline-item.d.ts +1 -1
  333. package/types/time-line/timeline.d.cts +1 -1
  334. package/types/time-line/timeline.d.ts +1 -1
  335. package/types/tooltip/index.d.cts +1 -0
  336. package/types/tooltip/index.d.ts +1 -0
  337. package/types/transfer/index.d.cts +1 -1
  338. package/types/transfer/index.d.ts +1 -1
  339. package/types/tree-select/index.d.cts +1 -1
  340. package/types/tree-select/index.d.ts +1 -1
  341. package/types/upload/file-list.d.cts +1 -1
  342. package/types/upload/file-list.d.ts +1 -1
  343. package/types/upload/selector.d.cts +1 -1
  344. package/types/upload/selector.d.ts +1 -1
  345. package/types/utils/placement.d.cts +2 -1
  346. package/types/utils/placement.d.ts +2 -1
  347. package/types/utils/popup-arrow.d.cts +5 -0
  348. package/types/utils/popup-arrow.d.ts +5 -0
  349. package/types/utils/selection-tags.d.cts +1 -1
  350. package/types/utils/selection-tags.d.ts +1 -1
  351. package/types/watermark/index.d.cts +1 -1
  352. package/types/watermark/index.d.ts +1 -1
package/es/steps/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -8,132 +8,54 @@
8
8
 
9
9
  import { Check, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
10
10
  import Icon from "../icon/index.js";
11
- import { c } from "react/compiler-runtime";
12
11
  import clsx from "clsx";
13
12
  import React from "react";
14
13
  import { jsx, jsxs } from "react/jsx-runtime";
15
- //#region components/steps/index.tsx
14
+ // components/steps/index.tsx
16
15
  var Step = () => null;
17
- var Steps = (t0) => {
18
- const $ = c(28);
19
- let children;
20
- let className;
21
- let items;
22
- let onChange;
23
- let rest;
24
- let t1;
25
- let t2;
26
- let t3;
27
- if ($[0] !== t0) {
28
- ({current: t1, direction: t2, status: t3, items, onChange, children, className, ...rest} = t0);
29
- $[0] = t0;
30
- $[1] = children;
31
- $[2] = className;
32
- $[3] = items;
33
- $[4] = onChange;
34
- $[5] = rest;
35
- $[6] = t1;
36
- $[7] = t2;
37
- $[8] = t3;
38
- } else {
39
- children = $[1];
40
- className = $[2];
41
- items = $[3];
42
- onChange = $[4];
43
- rest = $[5];
44
- t1 = $[6];
45
- t2 = $[7];
46
- t3 = $[8];
47
- }
48
- const current = t1 === void 0 ? 0 : t1;
49
- const direction = t2 === void 0 ? "horizontal" : t2;
50
- const status = t3 === void 0 ? "process" : t3;
51
- let t4;
52
- if ($[9] !== children || $[10] !== items) {
53
- t4 = items ?? React.Children.toArray(children).flatMap(_temp);
54
- $[9] = children;
55
- $[10] = items;
56
- $[11] = t4;
57
- } else t4 = $[11];
58
- const data = t4;
59
- const t5 = `k-steps-${direction}`;
60
- let t6;
61
- if ($[12] !== className || $[13] !== t5) {
62
- t6 = clsx("k-steps", t5, className);
63
- $[12] = className;
64
- $[13] = t5;
65
- $[14] = t6;
66
- } else t6 = $[14];
67
- let t7;
68
- if ($[15] !== current || $[16] !== data || $[17] !== onChange || $[18] !== status) {
69
- let t8;
70
- if ($[20] !== current || $[21] !== onChange || $[22] !== status) {
71
- t8 = (item, index) => {
72
- const state = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
73
- return /* @__PURE__ */ jsxs("div", {
74
- className: clsx("k-step", `k-step-${state}`, {
75
- "k-step-clickable": !!onChange && !item.disabled,
76
- "k-step-disabled": item.disabled
77
- }),
78
- role: "listitem",
79
- children: [/* @__PURE__ */ jsxs("div", {
80
- className: "k-step-main",
81
- role: onChange ? "button" : void 0,
82
- tabIndex: onChange && !item.disabled ? 0 : void 0,
83
- "aria-current": index === current ? "step" : void 0,
84
- "aria-disabled": item.disabled || void 0,
85
- onClick: () => !item.disabled && onChange?.(index),
86
- onKeyDown: (event) => {
87
- if (!item.disabled && (event.key === "Enter" || event.key === " ")) {
88
- event.preventDefault();
89
- onChange?.(index);
90
- }
91
- },
92
- children: [/* @__PURE__ */ jsx("span", {
93
- className: "k-step-dot",
94
- children: item.icon ?? (state === "finish" ? /* @__PURE__ */ jsx(Icon, { type: Check }) : state === "error" ? /* @__PURE__ */ jsx(Icon, { type: X }) : index + 1)
95
- }), /* @__PURE__ */ jsxs("div", {
96
- className: "k-step-content",
97
- children: [/* @__PURE__ */ jsx("div", {
98
- className: "k-step-title",
99
- children: item.title
100
- }), item.description != null && /* @__PURE__ */ jsx("div", {
101
- className: "k-step-description",
102
- children: item.description
103
- })]
16
+ var Steps = ({ current = 0, direction = "horizontal", status = "process", items, onChange, children, className, ...rest }) => {
17
+ const data = items ?? React.Children.toArray(children).flatMap((child) => React.isValidElement(child) && child.type === Step ? [child.props] : []);
18
+ return /* @__PURE__ */ jsx("div", {
19
+ ...rest,
20
+ className: clsx("k-steps", `k-steps-${direction}`, className),
21
+ role: "list",
22
+ children: data.map((item, index) => {
23
+ const state = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
24
+ return /* @__PURE__ */ jsxs("div", {
25
+ className: clsx("k-step", `k-step-${state}`, {
26
+ "k-step-clickable": !!onChange && !item.disabled,
27
+ "k-step-disabled": item.disabled
28
+ }),
29
+ role: "listitem",
30
+ children: [/* @__PURE__ */ jsxs("div", {
31
+ className: "k-step-main",
32
+ role: onChange ? "button" : void 0,
33
+ tabIndex: onChange && !item.disabled ? 0 : void 0,
34
+ "aria-current": index === current ? "step" : void 0,
35
+ "aria-disabled": item.disabled || void 0,
36
+ onClick: () => !item.disabled && onChange?.(index),
37
+ onKeyDown: (event) => {
38
+ if (!item.disabled && (event.key === "Enter" || event.key === " ")) {
39
+ event.preventDefault();
40
+ onChange?.(index);
41
+ }
42
+ },
43
+ children: [/* @__PURE__ */ jsx("span", {
44
+ className: "k-step-dot",
45
+ children: item.icon ?? (state === "finish" ? /* @__PURE__ */ jsx(Icon, { type: Check }) : state === "error" ? /* @__PURE__ */ jsx(Icon, { type: X }) : index + 1)
46
+ }), /* @__PURE__ */ jsxs("div", {
47
+ className: "k-step-content",
48
+ children: [/* @__PURE__ */ jsx("div", {
49
+ className: "k-step-title",
50
+ children: item.title
51
+ }), item.description != null && /* @__PURE__ */ jsx("div", {
52
+ className: "k-step-description",
53
+ children: item.description
104
54
  })]
105
- }), /* @__PURE__ */ jsx("span", { className: "k-step-line" })]
106
- }, index);
107
- };
108
- $[20] = current;
109
- $[21] = onChange;
110
- $[22] = status;
111
- $[23] = t8;
112
- } else t8 = $[23];
113
- t7 = data.map(t8);
114
- $[15] = current;
115
- $[16] = data;
116
- $[17] = onChange;
117
- $[18] = status;
118
- $[19] = t7;
119
- } else t7 = $[19];
120
- let t8;
121
- if ($[24] !== rest || $[25] !== t6 || $[26] !== t7) {
122
- t8 = /* @__PURE__ */ jsx("div", {
123
- ...rest,
124
- className: t6,
125
- role: "list",
126
- children: t7
127
- });
128
- $[24] = rest;
129
- $[25] = t6;
130
- $[26] = t7;
131
- $[27] = t8;
132
- } else t8 = $[27];
133
- return t8;
55
+ })]
56
+ }), /* @__PURE__ */ jsx("span", { className: "k-step-line" })]
57
+ }, index);
58
+ })
59
+ });
134
60
  };
135
- function _temp(child) {
136
- return React.isValidElement(child) && child.type === Step ? [child.props] : [];
137
- }
138
- //#endregion
139
61
  export { Step, Steps as default };
@@ -1,21 +1,21 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { useValue } from "../utils/use-value.js";
9
10
  import { useFormAppearance } from "../config/use-config-appearance.js";
11
+ import { createFormFieldComponent } from "../form/field-context.js";
10
12
  import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
11
13
  import Icon from "../icon/index.js";
12
- import { useValue } from "../utils/use-value.js";
13
- import { createFormFieldComponent } from "../form/field-context.js";
14
14
  import { getValueWithType } from "../utils/checked.js";
15
15
  import clsx from "clsx";
16
16
  import "react";
17
17
  import { jsx, jsxs } from "react/jsx-runtime";
18
- //#region components/switch/index.tsx
18
+ // components/switch/index.tsx
19
19
  var Switch = ({ checked, valueType = "boolean", type, color, disabled = false, readOnly = false, loading = false, size: sizeProp, shape: shapeProp, trueText, falseText, checkedChildren, unCheckedChildren, onChange, className = "", style, onClick, ...rest }) => {
20
20
  const inheritedAppearance = useFormAppearance();
21
21
  const size = sizeProp ?? inheritedAppearance.size;
@@ -69,5 +69,4 @@ var switch_default = createFormFieldComponent(Switch, {
69
69
  valueProp: "checked",
70
70
  getFieldValue: (value) => value === true || value === 1 || value === "1"
71
71
  });
72
- //#endregion
73
72
  export { switch_default as default };
@@ -1,36 +1,23 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
10
9
  import Button from "../button/button.js";
11
10
  import checkbox_group_default from "../checkbox/checkbox-group.js";
11
+ import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
12
12
  import Poptip from "../poptip/index.js";
13
- import { c } from "react/compiler-runtime";
14
13
  import { useContext, useState } from "react";
15
14
  import { jsx, jsxs } from "react/jsx-runtime";
16
- //#region components/table/column-setting.tsx
15
+ // components/table/column-setting.tsx
17
16
  /**
18
17
  * 表格列设置组件,用于动态显示/隐藏列
19
18
  * 与 kui-vue 一致,使用 CheckboxGroup 简单列表
20
19
  */
21
- function TableColumnSetting(t0) {
22
- const $ = c(33);
23
- const { columns: t1, hiddenKeys: t2, onHiddenKeysChange, disabledKeys: t3, title: titleProp, resetText: resetTextProp, size, showReset: t4, children } = t0;
24
- const columns = t1 === void 0 ? [] : t1;
25
- let t5;
26
- if ($[0] !== t2) {
27
- t5 = t2 === void 0 ? [] : t2;
28
- $[0] = t2;
29
- $[1] = t5;
30
- } else t5 = $[1];
31
- const hiddenKeys = t5;
32
- const disabledKeys = t3 === void 0 ? [] : t3;
33
- const showReset = t4 === void 0 ? true : t4;
20
+ function TableColumnSetting({ columns = [], hiddenKeys = [], onHiddenKeysChange, disabledKeys = [], title: titleProp, resetText: resetTextProp, size, showReset = true, children }) {
34
21
  const [open, setOpen] = useState(false);
35
22
  const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
36
23
  const title = titleProp || locale?.k?.table?.columnSettings || "Column settings";
@@ -39,130 +26,47 @@ function TableColumnSetting(t0) {
39
26
  const collectLeaves = (items) => items.forEach((column) => column.children?.length ? collectLeaves(column.children) : leafColumns.push(column));
40
27
  collectLeaves(columns);
41
28
  const configurableColumns = leafColumns.filter((col) => !disabledKeys.includes(col.key));
42
- const visibleKeys = configurableColumns.map(_temp).filter((key) => !hiddenKeys.includes(key));
43
- let t6;
44
- if ($[2] !== configurableColumns) {
45
- t6 = configurableColumns.map(_temp2);
46
- $[2] = configurableColumns;
47
- $[3] = t6;
48
- } else t6 = $[3];
49
- const options = t6;
50
- let t7;
51
- if ($[4] !== configurableColumns || $[5] !== hiddenKeys || $[6] !== onHiddenKeysChange) {
52
- t7 = (values) => {
53
- const selected = new Set(values.map(String));
54
- const configurable = new Set(configurableColumns.map(_temp3));
55
- const next = [...hiddenKeys.filter((key_0) => !configurable.has(String(key_0))), ...configurableColumns.map(_temp4).filter((key_1) => !selected.has(String(key_1)))];
56
- onHiddenKeysChange?.(next);
57
- };
58
- $[4] = configurableColumns;
59
- $[5] = hiddenKeys;
60
- $[6] = onHiddenKeysChange;
61
- $[7] = t7;
62
- } else t7 = $[7];
63
- const handleUpdate = t7;
64
- let t8;
65
- if ($[8] !== configurableColumns || $[9] !== handleUpdate) {
66
- t8 = () => {
67
- handleUpdate(configurableColumns.map(_temp5));
68
- };
69
- $[8] = configurableColumns;
70
- $[9] = handleUpdate;
71
- $[10] = t8;
72
- } else t8 = $[10];
73
- const handleReset = t8;
74
- let t9;
75
- if ($[11] !== handleUpdate || $[12] !== options || $[13] !== size || $[14] !== visibleKeys) {
76
- t9 = /* @__PURE__ */ jsx(checkbox_group_default, {
77
- value: visibleKeys,
78
- options,
79
- direction: "vertical",
80
- size,
81
- onChange: handleUpdate
82
- });
83
- $[11] = handleUpdate;
84
- $[12] = options;
85
- $[13] = size;
86
- $[14] = visibleKeys;
87
- $[15] = t9;
88
- } else t9 = $[15];
89
- let t10;
90
- if ($[16] !== handleReset || $[17] !== resetText || $[18] !== showReset) {
91
- t10 = showReset && /* @__PURE__ */ jsx(Button, {
92
- className: "k-table-column-setting-reset",
93
- theme: "plain",
94
- size: "small",
95
- onClick: handleReset,
96
- children: resetText
97
- });
98
- $[16] = handleReset;
99
- $[17] = resetText;
100
- $[18] = showReset;
101
- $[19] = t10;
102
- } else t10 = $[19];
103
- let t11;
104
- if ($[20] !== t10 || $[21] !== t9) {
105
- t11 = /* @__PURE__ */ jsxs("div", {
106
- className: "k-table-column-setting",
107
- onClick: _temp6,
108
- children: [t9, t10]
109
- });
110
- $[20] = t10;
111
- $[21] = t9;
112
- $[22] = t11;
113
- } else t11 = $[22];
114
- const content = t11;
115
- let t12;
116
- if ($[23] !== children || $[24] !== size || $[25] !== title) {
117
- t12 = children ?? /* @__PURE__ */ jsx(Button, {
118
- size,
119
- children: title
120
- });
121
- $[23] = children;
122
- $[24] = size;
123
- $[25] = title;
124
- $[26] = t12;
125
- } else t12 = $[26];
126
- let t13;
127
- if ($[27] !== content || $[28] !== open || $[29] !== setOpen || $[30] !== t12 || $[31] !== title) {
128
- t13 = /* @__PURE__ */ jsx(Poptip, {
129
- trigger: "click",
130
- placement: "bottom-right",
131
- title,
132
- content,
133
- open,
134
- onOpenChange: setOpen,
135
- children: t12
136
- });
137
- $[27] = content;
138
- $[28] = open;
139
- $[29] = setOpen;
140
- $[30] = t12;
141
- $[31] = title;
142
- $[32] = t13;
143
- } else t13 = $[32];
144
- return t13;
145
- }
146
- function _temp6(e) {
147
- return e.stopPropagation();
148
- }
149
- function _temp5(col_4) {
150
- return col_4.key;
151
- }
152
- function _temp4(col_3) {
153
- return col_3.key;
154
- }
155
- function _temp3(col_2) {
156
- return String(col_2.key);
157
- }
158
- function _temp2(col_1) {
159
- return {
29
+ const visibleKeys = configurableColumns.map((col_0) => col_0.key).filter((key) => !hiddenKeys.includes(key));
30
+ const options = configurableColumns.map((col_1) => ({
160
31
  label: String(col_1.title),
161
32
  value: col_1.key
33
+ }));
34
+ const handleUpdate = (values) => {
35
+ const selected = new Set(values.map(String));
36
+ const configurable = new Set(configurableColumns.map((col_2) => String(col_2.key)));
37
+ const next = [...hiddenKeys.filter((key_0) => !configurable.has(String(key_0))), ...configurableColumns.map((col_3) => col_3.key).filter((key_1) => !selected.has(String(key_1)))];
38
+ onHiddenKeysChange?.(next);
162
39
  };
40
+ const handleReset = () => {
41
+ handleUpdate(configurableColumns.map((col_4) => col_4.key));
42
+ };
43
+ return /* @__PURE__ */ jsx(Poptip, {
44
+ trigger: "click",
45
+ placement: "bottom-right",
46
+ title,
47
+ content: /* @__PURE__ */ jsxs("div", {
48
+ className: "k-table-column-setting",
49
+ onClick: (e) => e.stopPropagation(),
50
+ children: [/* @__PURE__ */ jsx(checkbox_group_default, {
51
+ value: visibleKeys,
52
+ options,
53
+ direction: "vertical",
54
+ size,
55
+ onChange: handleUpdate
56
+ }), showReset && /* @__PURE__ */ jsx(Button, {
57
+ className: "k-table-column-setting-reset",
58
+ theme: "plain",
59
+ size: "small",
60
+ onClick: handleReset,
61
+ children: resetText
62
+ })]
63
+ }),
64
+ open,
65
+ onOpenChange: setOpen,
66
+ children: children ?? /* @__PURE__ */ jsx(Button, {
67
+ size,
68
+ children: title
69
+ })
70
+ });
163
71
  }
164
- function _temp(col_0) {
165
- return col_0.key;
166
- }
167
- //#endregion
168
72
  export { TableColumnSetting };
package/es/table/index.js CHANGED
@@ -1,29 +1,29 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
9
+ import { useValue } from "../utils/use-value.js";
10
10
  import { normalizeSurfaceShape, useConfigAppearance } from "../config/use-config-appearance.js";
11
11
  import { ChevronDown, ChevronRight, Triangle } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
12
- import Icon from "../icon/index.js";
13
- import { useValue } from "../utils/use-value.js";
14
- import Empty from "../empty/index.js";
15
12
  import checkbox_default from "../checkbox/checkbox.js";
13
+ import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
14
+ import Empty from "../empty/index.js";
15
+ import Icon from "../icon/index.js";
16
+ import Spin from "../spin/index.js";
16
17
  import Tooltip from "../tooltip/index.js";
17
18
  import { getVirtualRange } from "../virtual-list/range.js";
18
- import Spin from "../spin/index.js";
19
19
  import { compareSortValues, countColumnLeaves, flattenColumns, flattenTreeData, getRecordValue, inheritColumnFixed, mergeExpandAllRows, resolveCellEllipsis, resolveRowKey } from "./utils.js";
20
20
  import { TableColumnSetting } from "./column-setting.js";
21
- import { c } from "react/compiler-runtime";
22
21
  import clsx from "clsx";
23
22
  import { isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
24
23
  import { jsx, jsxs } from "react/jsx-runtime";
24
+ import { c } from "react/compiler-runtime";
25
25
  import { flushSync } from "react-dom";
26
- //#region components/table/index.tsx
26
+ // components/table/index.tsx
27
27
  /**
28
28
  * 默认值必须是稳定引用。每次渲染都新建的 `[]` / `{}` 会让
29
29
  * `visibleColumns → leaves → sortRecords → rows → matrix` 这条 memo 链整段失效,
@@ -855,5 +855,4 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
855
855
  ]
856
856
  });
857
857
  }
858
- //#endregion
859
858
  export { TableColumnSetting, Table as default };
package/es/table/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { assert } from "../utils/share.js";
10
- //#region components/table/utils.ts
10
+ // components/table/utils.ts
11
11
  var flattenColumns = (columns) => columns.flatMap((column) => column.children?.length ? flattenColumns(column.children) : column);
12
12
  var countColumnLeaves = (column) => column.children?.length ? column.children.reduce((sum, child) => sum + countColumnLeaves(child), 0) : 1;
13
13
  /**
@@ -167,5 +167,4 @@ var resolveCellEllipsis = (columnValue, tableValue) => {
167
167
  tooltip: options.tooltip
168
168
  };
169
169
  };
170
- //#endregion
171
170
  export { compareSortValues, countColumnLeaves, flattenColumns, flattenTreeData, getRecordValue, getSyntheticRowKey, getTreeChildren, inheritColumnFixed, mergeExpandAllRows, resolveCellEllipsis, resolveRowKey };
@@ -1,86 +1,34 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { c } from "react/compiler-runtime";
10
9
  import clsx from "clsx";
11
10
  import "react";
12
11
  import { jsx } from "react/jsx-runtime";
13
- //#region components/tabs/tab-panel.tsx
12
+ // components/tabs/tab-panel.tsx
14
13
  var TabPanel = (props) => {
15
- const $ = c(19);
16
- let activeKey;
17
- let children;
18
- let rest;
19
- let t0;
20
- let tabKey;
21
- let tabsId;
22
- if ($[0] !== props) {
23
- ({tabKey, activeKey, tabsId, children, className: t0, ...rest} = props);
24
- $[0] = props;
25
- $[1] = activeKey;
26
- $[2] = children;
27
- $[3] = rest;
28
- $[4] = t0;
29
- $[5] = tabKey;
30
- $[6] = tabsId;
31
- } else {
32
- activeKey = $[1];
33
- children = $[2];
34
- rest = $[3];
35
- t0 = $[4];
36
- tabKey = $[5];
37
- tabsId = $[6];
38
- }
39
- const className = t0 === void 0 ? "" : t0;
40
- let domProps;
41
- if ($[7] !== rest) {
42
- domProps = {
43
- ...rest,
44
- title: void 0
45
- };
46
- delete domProps.icon;
47
- delete domProps.disabled;
48
- delete domProps.closable;
49
- $[7] = rest;
50
- $[8] = domProps;
51
- } else domProps = $[8];
14
+ const { tabKey, activeKey, tabsId, children, className = "", ...rest } = props;
15
+ const domProps = {
16
+ ...rest,
17
+ title: void 0
18
+ };
19
+ delete domProps.icon;
20
+ delete domProps.disabled;
21
+ delete domProps.closable;
52
22
  const htmlProps = domProps;
53
23
  const isActive = tabKey !== void 0 && String(activeKey) === String(tabKey);
54
- let t1;
55
- if ($[9] !== className || $[10] !== isActive) {
56
- t1 = clsx("k-tabs-tabpanel", { "k-tabs-tabpanel-active": isActive }, className);
57
- $[9] = className;
58
- $[10] = isActive;
59
- $[11] = t1;
60
- } else t1 = $[11];
61
- const t2 = tabKey !== void 0 ? `${tabsId}-panel-${String(tabKey)}` : void 0;
62
- const t3 = tabKey !== void 0 ? `${tabsId}-tab-${String(tabKey)}` : void 0;
63
- const t4 = !isActive;
64
- let t5;
65
- if ($[12] !== children || $[13] !== htmlProps || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4) {
66
- t5 = /* @__PURE__ */ jsx("div", {
67
- className: t1,
68
- id: t2,
69
- role: "tabpanel",
70
- "aria-labelledby": t3,
71
- "aria-hidden": t4,
72
- ...htmlProps,
73
- children
74
- });
75
- $[12] = children;
76
- $[13] = htmlProps;
77
- $[14] = t1;
78
- $[15] = t2;
79
- $[16] = t3;
80
- $[17] = t4;
81
- $[18] = t5;
82
- } else t5 = $[18];
83
- return t5;
24
+ return /* @__PURE__ */ jsx("div", {
25
+ className: clsx("k-tabs-tabpanel", { "k-tabs-tabpanel-active": isActive }, className),
26
+ id: tabKey !== void 0 ? `${tabsId}-panel-${String(tabKey)}` : void 0,
27
+ role: "tabpanel",
28
+ "aria-labelledby": tabKey !== void 0 ? `${tabsId}-tab-${String(tabKey)}` : void 0,
29
+ "aria-hidden": !isActive,
30
+ ...htmlProps,
31
+ children
32
+ });
84
33
  };
85
- //#endregion
86
34
  export { TabPanel as default };
package/es/tabs/tabs.js CHANGED
@@ -1,23 +1,23 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { getChildren } from "../utils/react-node.js";
10
- import { ChevronDown, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
11
- import Icon from "../icon/index.js";
12
9
  import { useValue } from "../utils/use-value.js";
10
+ import { ChevronDown, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
13
11
  import Button from "../button/button.js";
14
12
  import Dropdown from "../dropdown/dropdown.js";
15
- import { MenuItem } from "../menu/menu-item.js";
13
+ import Icon from "../icon/index.js";
16
14
  import { Menu } from "../menu/menu.js";
15
+ import { MenuItem } from "../menu/menu-item.js";
16
+ import { getChildren } from "../utils/react-node.js";
17
17
  import clsx from "clsx";
18
18
  import React, { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
- //#region components/tabs/tabs.tsx
20
+ // components/tabs/tabs.tsx
21
21
  var Tabs = ({ value, variant, card = false, sample = false, centered = false, animated = true, extra, onTabClick, onChange, onRemove, children, className = "", ...rest }) => {
22
22
  const currentVariant = variant ?? (card ? "card" : sample ? "sample" : "line");
23
23
  const navRef = useRef(null);
@@ -268,5 +268,4 @@ var Tabs = ({ value, variant, card = false, sample = false, centered = false, an
268
268
  })]
269
269
  });
270
270
  };
271
- //#endregion
272
271
  export { Tabs as default };
package/es/tag/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  /*!
2
- * react-kui v3.2.1
2
+ * react-kui v3.3.0
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 { Transition } from "../base/transition.js";
10
9
  import { resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
11
10
  import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
11
+ import { Transition } from "../base/transition.js";
12
+ import { colors } from "../const/var.js";
12
13
  import Icon from "../icon/index.js";
13
14
  import { isColor } from "../utils/color.js";
14
- import { colors } from "../const/var.js";
15
15
  import clsx from "clsx";
16
16
  import { useRef, useState } from "react";
17
17
  import { jsx, jsxs } from "react/jsx-runtime";
18
- //#region components/tag/index.tsx
18
+ // components/tag/index.tsx
19
19
  var PAINTED_THEMES = [
20
20
  "fill",
21
21
  "outline",
@@ -81,5 +81,4 @@ var Tag = ({ closeable = false, compact = false, color, shape: shapeProp, icon,
81
81
  })
82
82
  });
83
83
  };
84
- //#endregion
85
84
  export { Tag as default };