react-kui 3.2.0 → 3.2.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 (232) hide show
  1. package/ai/kui-components.json +7 -7
  2. package/es/_virtual/_rolldown/runtime.js +1 -1
  3. package/es/affix/index.js +1 -1
  4. package/es/alert/index.js +1 -1
  5. package/es/anchor/anchor-context.js +1 -1
  6. package/es/anchor/anchor-link.js +1 -1
  7. package/es/anchor/anchor.js +1 -1
  8. package/es/auto-complete/index.js +1 -1
  9. package/es/avatar/avatar-group-context.js +1 -1
  10. package/es/avatar/avatar-group.js +1 -1
  11. package/es/avatar/avatar.js +1 -1
  12. package/es/back-top/index.js +1 -1
  13. package/es/badge/index.js +1 -1
  14. package/es/base/teleport.js +1 -1
  15. package/es/base/transition-props.js +1 -1
  16. package/es/base/transition.js +1 -1
  17. package/es/breadcrumb/breadcrumb-context.js +1 -1
  18. package/es/breadcrumb/breadcrumb-item.js +1 -1
  19. package/es/breadcrumb/breadcrumb.js +1 -1
  20. package/es/button/button-group-context.js +1 -1
  21. package/es/button/button-group.js +1 -1
  22. package/es/button/button.js +1 -1
  23. package/es/calendar/index.js +1 -1
  24. package/es/card/index.js +1 -1
  25. package/es/carousel/carousel-context.js +1 -1
  26. package/es/carousel/carousel-item.js +1 -1
  27. package/es/carousel/carousel.js +1 -1
  28. package/es/carousel/drag.js +1 -1
  29. package/es/cascader/index.js +1 -1
  30. package/es/check-card/check-card-group.js +1 -1
  31. package/es/check-card/check-card.js +1 -1
  32. package/es/check-card/context.js +1 -1
  33. package/es/checkbox/checkbox-group-context.js +1 -1
  34. package/es/checkbox/checkbox-group.js +1 -1
  35. package/es/checkbox/checkbox.js +1 -1
  36. package/es/checkbox/index.js +1 -1
  37. package/es/collapse/collapse-panel.js +1 -1
  38. package/es/collapse/collapse.js +1 -1
  39. package/es/color-picker/alpha.js +1 -1
  40. package/es/color-picker/hue.js +1 -1
  41. package/es/color-picker/index.js +1 -1
  42. package/es/color-picker/mode.js +1 -1
  43. package/es/color-picker/paint.js +1 -1
  44. package/es/color-picker/presets.js +1 -1
  45. package/es/components.js +1 -1
  46. package/es/config/config-context.js +1 -1
  47. package/es/config/context.js +1 -1
  48. package/es/config/index.js +1 -1
  49. package/es/config/popup-host.js +1 -1
  50. package/es/config/size-context.js +1 -1
  51. package/es/config/use-config-appearance.js +1 -1
  52. package/es/const/var.js +1 -1
  53. package/es/date-picker/index.js +1 -1
  54. package/es/descriptions/descriptions-item.js +1 -1
  55. package/es/descriptions/descriptions.js +1 -1
  56. package/es/divider/index.js +1 -1
  57. package/es/drawer/index.js +1 -1
  58. package/es/dropdown/dropdown-button.js +1 -1
  59. package/es/dropdown/dropdown-context.js +1 -1
  60. package/es/dropdown/dropdown.js +1 -1
  61. package/es/dropdown/trigger.js +1 -1
  62. package/es/empty/index.js +1 -1
  63. package/es/feature-card/index.js +1 -1
  64. package/es/feedback-panel/index.js +1 -1
  65. package/es/flame-wrap/index.js +1 -1
  66. package/es/flame-wrap/types.js +1 -1
  67. package/es/flex/index.js +1 -1
  68. package/es/form/field-context.js +1 -1
  69. package/es/form/form-context.js +1 -1
  70. package/es/form/form-item.js +1 -1
  71. package/es/form/form.js +1 -1
  72. package/es/form/utils.js +1 -1
  73. package/es/grid/grid-item.js +1 -1
  74. package/es/grid/grid.js +1 -1
  75. package/es/grid/useBreakpoint.js +1 -1
  76. package/es/icon/index.js +1 -1
  77. package/es/image/group.js +1 -1
  78. package/es/image/image-group-context.js +1 -1
  79. package/es/image/image.js +1 -1
  80. package/es/image/instance.js +1 -1
  81. package/es/image/preview.js +1 -1
  82. package/es/image/utils.js +1 -1
  83. package/es/index.js +1 -1
  84. package/es/input/index.js +1 -1
  85. package/es/input/input-base.js +1 -1
  86. package/es/input/input-box.js +1 -1
  87. package/es/input/input-group.js +1 -1
  88. package/es/input/input.js +1 -1
  89. package/es/input/textarea.js +1 -1
  90. package/es/input-number/index.js +1 -1
  91. package/es/input-otp/index.js +1 -1
  92. package/es/input-tag/index.js +1 -1
  93. package/es/kanban/index.js +1 -1
  94. package/es/layout/index.js +1 -1
  95. package/es/layout/layout-context.js +1 -1
  96. package/es/list-panel/index.js +1 -1
  97. package/es/loading/index.js +1 -1
  98. package/es/loading/loading-bar.js +1 -1
  99. package/es/locale/de.js +1 -1
  100. package/es/locale/el.js +1 -1
  101. package/es/locale/en.js +1 -1
  102. package/es/locale/fr.js +1 -1
  103. package/es/locale/it.js +1 -1
  104. package/es/locale/ja.js +1 -1
  105. package/es/locale/ko.js +1 -1
  106. package/es/locale/ru.js +1 -1
  107. package/es/locale/th.js +1 -1
  108. package/es/locale/uk.js +1 -1
  109. package/es/locale/vi.js +1 -1
  110. package/es/locale/zh-CN.js +1 -1
  111. package/es/locale/zh-TW.js +1 -1
  112. package/es/mentions/index.js +1 -1
  113. package/es/menu/menu-context.js +1 -1
  114. package/es/menu/menu-divider.js +1 -1
  115. package/es/menu/menu-group.js +1 -1
  116. package/es/menu/menu-item.js +1 -1
  117. package/es/menu/menu-keyboard.js +1 -1
  118. package/es/menu/menu.js +1 -1
  119. package/es/menu/recursive-menu.js +1 -1
  120. package/es/menu/sub-menu.js +1 -1
  121. package/es/message/index.js +1 -1
  122. package/es/modal/api.js +1 -1
  123. package/es/modal/modal.js +1 -1
  124. package/es/modal/toast.js +1 -1
  125. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  126. package/es/notice/container.js +1 -1
  127. package/es/notice/content.js +1 -1
  128. package/es/notice/index.js +1 -1
  129. package/es/notice/instance.js +1 -1
  130. package/es/page/index.js +1 -1
  131. package/es/page/responsive.js +1 -1
  132. package/es/page-header/index.js +1 -1
  133. package/es/popconfirm/index.js +1 -1
  134. package/es/poptip/index.js +1 -1
  135. package/es/popup/index.js +1 -1
  136. package/es/popup/layers.js +1 -1
  137. package/es/progress/index.js +1 -1
  138. package/es/qrcode/index.js +1 -1
  139. package/es/radio/radio-button.js +1 -1
  140. package/es/radio/radio-group-context.js +1 -1
  141. package/es/radio/radio-group.js +1 -1
  142. package/es/radio/radio.js +1 -1
  143. package/es/rate/index.js +1 -1
  144. package/es/rate/star.js +1 -1
  145. package/es/result/index.js +1 -1
  146. package/es/ripple/index.js +1 -1
  147. package/es/ripple/types.js +1 -1
  148. package/es/row-col/col.js +1 -1
  149. package/es/row-col/row.js +1 -1
  150. package/es/segmented/index.js +110 -90
  151. package/es/select/option.js +1 -1
  152. package/es/select/select.js +1 -1
  153. package/es/skeleton/skeleton-avatar.js +1 -1
  154. package/es/skeleton/skeleton-button.js +1 -1
  155. package/es/skeleton/skeleton-image.js +1 -1
  156. package/es/skeleton/skeleton-text.js +1 -1
  157. package/es/skeleton/skeleton.js +1 -1
  158. package/es/skeleton/use-skeleton-loading.js +1 -1
  159. package/es/slider/index.js +1 -1
  160. package/es/slider/thumb.js +1 -1
  161. package/es/space/index.js +1 -1
  162. package/es/spin/index.js +1 -1
  163. package/es/splitter/splitter-panel.js +1 -1
  164. package/es/splitter/splitter.js +1 -1
  165. package/es/stat-card/countup.js +1 -1
  166. package/es/stat-card/rollup.js +1 -1
  167. package/es/stat-card/stat-card.js +1 -1
  168. package/es/stat-card/stat-number.js +1 -1
  169. package/es/stat-card/utils/countup.js +1 -1
  170. package/es/stat-card/utils/odometer.js +1 -1
  171. package/es/stat-card/utils/stat-item-key.js +1 -1
  172. package/es/steps/index.js +1 -1
  173. package/es/switch/index.js +1 -1
  174. package/es/table/column-setting.js +1 -1
  175. package/es/table/index.js +18 -7
  176. package/es/table/utils.js +2 -3
  177. package/es/tabs/tab-panel.js +1 -1
  178. package/es/tabs/tabs.js +1 -1
  179. package/es/tag/index.js +1 -1
  180. package/es/time-line/timeline-item.js +1 -1
  181. package/es/time-line/timeline.js +1 -1
  182. package/es/tooltip/index.js +1 -1
  183. package/es/tour/index.js +1 -1
  184. package/es/transfer/index.js +1 -1
  185. package/es/tree/index.js +1 -1
  186. package/es/tree/utils.js +1 -1
  187. package/es/tree-select/index.js +1 -1
  188. package/es/typography/index.js +1 -1
  189. package/es/upload/file-list.js +1 -1
  190. package/es/upload/index.js +1 -1
  191. package/es/upload/picture-sort.js +1 -1
  192. package/es/upload/selector.js +1 -1
  193. package/es/utils/checked.js +1 -1
  194. package/es/utils/color.js +1 -1
  195. package/es/utils/css.js +1 -1
  196. package/es/utils/focus.js +1 -1
  197. package/es/utils/number.js +1 -1
  198. package/es/utils/overlay-order.js +1 -1
  199. package/es/utils/overlay-stack.js +1 -1
  200. package/es/utils/placement.js +1 -1
  201. package/es/utils/popup.js +1 -1
  202. package/es/utils/promise.js +1 -1
  203. package/es/utils/react-node.js +1 -1
  204. package/es/utils/selection-tags.js +1 -1
  205. package/es/utils/share.js +1 -1
  206. package/es/utils/theme.js +1 -1
  207. package/es/utils/transition.js +1 -1
  208. package/es/utils/use-value.js +1 -1
  209. package/es/virtual-list/index.js +1 -1
  210. package/es/virtual-list/range.js +1 -1
  211. package/es/watermark/index.js +1 -1
  212. package/lib/index.cjs +2 -2
  213. package/lib/locale/de.cjs +1 -1
  214. package/lib/locale/el.cjs +1 -1
  215. package/lib/locale/en.cjs +1 -1
  216. package/lib/locale/fr.cjs +1 -1
  217. package/lib/locale/it.cjs +1 -1
  218. package/lib/locale/ja.cjs +1 -1
  219. package/lib/locale/ko.cjs +1 -1
  220. package/lib/locale/ru.cjs +1 -1
  221. package/lib/locale/th.cjs +1 -1
  222. package/lib/locale/uk.cjs +1 -1
  223. package/lib/locale/vi.cjs +1 -1
  224. package/lib/locale/zh-CN.cjs +1 -1
  225. package/lib/locale/zh-TW.cjs +1 -1
  226. package/package.json +1 -1
  227. package/style/base.css +1 -1
  228. package/style/components.css +2 -2
  229. package/style/index.css +2 -2
  230. package/style/theme.css +1 -1
  231. package/types/segmented/index.d.cts +2 -1
  232. package/types/segmented/index.d.ts +2 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -15,8 +15,13 @@ import clsx from "clsx";
15
15
  import { useEffect, useRef, useState } from "react";
16
16
  import { jsx, jsxs } from "react/jsx-runtime";
17
17
  //#region components/segmented/index.tsx
18
+ var isOptionObject = (option) => typeof option === "object" && option !== null;
19
+ var normalizeOptions = (options) => options.map((option) => isOptionObject(option) ? option : {
20
+ label: option,
21
+ value: option
22
+ });
18
23
  var Segmented = (t0) => {
19
- const $ = c(47);
24
+ const $ = c(50);
20
25
  let className;
21
26
  let onChange;
22
27
  let onKeyDown;
@@ -78,64 +83,73 @@ var Segmented = (t0) => {
78
83
  const itemRefs = useRef(t6);
79
84
  const [innerValue, setInnerValue] = useValue(value, _temp);
80
85
  const currentValue = innerValue;
86
+ const items = normalizeOptions(options);
81
87
  let t7;
82
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
83
- t7 = {};
84
- $[15] = t7;
85
- } else t7 = $[15];
86
- const [indicatorStyle, setIndicatorStyle] = useState(t7);
88
+ if ($[15] !== currentValue) {
89
+ t7 = (item) => item.value === currentValue;
90
+ $[15] = currentValue;
91
+ $[16] = t7;
92
+ } else t7 = $[16];
93
+ const selectedItem = items.find(t7);
94
+ const focusValue = selectedItem && !selectedItem.disabled ? selectedItem.value : items.find(_temp2)?.value;
95
+ let t8;
96
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
97
+ t8 = {};
98
+ $[17] = t8;
99
+ } else t8 = $[17];
100
+ const [indicatorStyle, setIndicatorStyle] = useState(t8);
87
101
  const [ready, setReady] = useState(false);
88
102
  const vertical = direction === "vertical";
89
- let t8;
90
- if ($[16] !== currentValue || $[17] !== vertical) {
91
- t8 = () => {
92
- const item = currentValue === void 0 ? void 0 : itemRefs.current.get(currentValue);
93
- if (!item) {
103
+ let t9;
104
+ if ($[18] !== currentValue || $[19] !== vertical) {
105
+ t9 = () => {
106
+ const item_1 = currentValue === void 0 ? void 0 : itemRefs.current.get(currentValue);
107
+ if (!item_1) {
94
108
  setReady(false);
95
109
  setIndicatorStyle({});
96
110
  return;
97
111
  }
98
112
  setIndicatorStyle(vertical ? {
99
- height: item.offsetHeight,
100
- top: item.offsetTop
113
+ height: item_1.offsetHeight,
114
+ top: item_1.offsetTop
101
115
  } : {
102
- width: item.offsetWidth,
103
- left: item.offsetLeft
116
+ width: item_1.offsetWidth,
117
+ left: item_1.offsetLeft
104
118
  });
105
119
  requestAnimationFrame(() => setReady(true));
106
120
  };
107
- $[16] = currentValue;
108
- $[17] = vertical;
109
- $[18] = t8;
110
- } else t8 = $[18];
111
- const updateIndicator = t8;
112
- let t9;
113
- if ($[19] !== updateIndicator) {
114
- t9 = () => {
121
+ $[18] = currentValue;
122
+ $[19] = vertical;
123
+ $[20] = t9;
124
+ } else t9 = $[20];
125
+ const updateIndicator = t9;
126
+ let t10;
127
+ if ($[21] !== updateIndicator) {
128
+ t10 = () => {
115
129
  updateIndicator();
116
130
  const observer = new ResizeObserver(updateIndicator);
117
131
  if (rootRef.current) observer.observe(rootRef.current);
118
132
  return () => observer.disconnect();
119
133
  };
120
- $[19] = updateIndicator;
121
- $[20] = t9;
122
- } else t9 = $[20];
123
- useEffect(t9, [options, updateIndicator]);
124
- let t10;
125
- if ($[21] !== currentValue || $[22] !== disabled || $[23] !== onChange || $[24] !== readOnly || $[25] !== setInnerValue) {
126
- t10 = (option) => {
134
+ $[21] = updateIndicator;
135
+ $[22] = t10;
136
+ } else t10 = $[22];
137
+ useEffect(t10, [options, updateIndicator]);
138
+ let t11;
139
+ if ($[23] !== currentValue || $[24] !== disabled || $[25] !== onChange || $[26] !== readOnly || $[27] !== setInnerValue) {
140
+ t11 = (option) => {
127
141
  if (disabled || readOnly || option.disabled || option.value === currentValue) return;
128
142
  setInnerValue(option.value);
129
143
  onChange?.(option.value);
130
144
  };
131
- $[21] = currentValue;
132
- $[22] = disabled;
133
- $[23] = onChange;
134
- $[24] = readOnly;
135
- $[25] = setInnerValue;
136
- $[26] = t10;
137
- } else t10 = $[26];
138
- const select = t10;
145
+ $[23] = currentValue;
146
+ $[24] = disabled;
147
+ $[25] = onChange;
148
+ $[26] = readOnly;
149
+ $[27] = setInnerValue;
150
+ $[28] = t11;
151
+ } else t11 = $[28];
152
+ const select = t11;
139
153
  const move = (event) => {
140
154
  onKeyDown?.(event);
141
155
  if (event.defaultPrevented || ![
@@ -146,7 +160,7 @@ var Segmented = (t0) => {
146
160
  "Home",
147
161
  "End"
148
162
  ].includes(event.key)) return;
149
- const available = options.filter(_temp2);
163
+ const available = items.filter(_temp3);
150
164
  if (!available.length || disabled || readOnly) return;
151
165
  event.preventDefault();
152
166
  const current = available.findIndex((option_1) => option_1.value === currentValue);
@@ -156,27 +170,28 @@ var Segmented = (t0) => {
156
170
  requestAnimationFrame(() => itemRefs.current.get(next_0.value)?.focus());
157
171
  }
158
172
  };
159
- const t11 = `k-segmented-${size}`;
160
- const t12 = `k-segmented-${shape}`;
161
- let t13;
162
- if ($[27] !== block || $[28] !== className || $[29] !== disabled || $[30] !== t11 || $[31] !== t12 || $[32] !== vertical) {
163
- t13 = clsx("k-segmented", t11, t12, {
173
+ const t12 = `k-segmented-${size}`;
174
+ const t13 = `k-segmented-${shape}`;
175
+ let t14;
176
+ if ($[29] !== block || $[30] !== className || $[31] !== disabled || $[32] !== t12 || $[33] !== t13 || $[34] !== vertical) {
177
+ t14 = clsx("k-segmented", t12, t13, {
164
178
  "k-segmented-block": block,
165
179
  "k-segmented-vertical": vertical,
166
180
  "k-segmented-disabled": disabled
167
181
  }, className);
168
- $[27] = block;
169
- $[28] = className;
170
- $[29] = disabled;
171
- $[30] = t11;
172
- $[31] = t12;
173
- $[32] = vertical;
182
+ $[29] = block;
183
+ $[30] = className;
184
+ $[31] = disabled;
185
+ $[32] = t12;
174
186
  $[33] = t13;
175
- } else t13 = $[33];
176
- const t14 = "radiogroup";
177
- const t15 = disabled || void 0;
178
- const t16 = readOnly || void 0;
179
- const t17 = options.map((option_2) => /* @__PURE__ */ jsxs("button", {
187
+ $[34] = vertical;
188
+ $[35] = t14;
189
+ } else t14 = $[35];
190
+ const t15 = "radiogroup";
191
+ const t16 = vertical ? "vertical" : "horizontal";
192
+ const t17 = disabled || void 0;
193
+ const t18 = readOnly || void 0;
194
+ const t19 = items.map((option_2) => /* @__PURE__ */ jsxs("button", {
180
195
  ref: (node) => {
181
196
  if (node) itemRefs.current.set(option_2.value, node);
182
197
  else itemRefs.current.delete(option_2.value);
@@ -186,54 +201,59 @@ var Segmented = (t0) => {
186
201
  role: "radio",
187
202
  "aria-checked": option_2.value === currentValue,
188
203
  disabled: disabled || option_2.disabled,
189
- tabIndex: option_2.value === currentValue ? 0 : -1,
204
+ tabIndex: option_2.value === focusValue ? 0 : -1,
190
205
  onClick: () => select(option_2),
191
206
  children: [option_2.icon && /* @__PURE__ */ jsx(Icon, { type: option_2.icon }), /* @__PURE__ */ jsx("span", { children: renderLabel?.(option_2, option_2.value === currentValue) ?? option_2.label ?? option_2.value })]
192
207
  }, option_2.value));
193
- let t18;
194
- if ($[34] !== ready) {
195
- t18 = clsx("k-segmented-indicator", { "is-ready": ready });
196
- $[34] = ready;
197
- $[35] = t18;
198
- } else t18 = $[35];
199
- let t19;
200
- if ($[36] !== indicatorStyle || $[37] !== t18) {
201
- t19 = /* @__PURE__ */ jsx("span", {
202
- className: t18,
208
+ let t20;
209
+ if ($[36] !== ready) {
210
+ t20 = clsx("k-segmented-indicator", { "is-ready": ready });
211
+ $[36] = ready;
212
+ $[37] = t20;
213
+ } else t20 = $[37];
214
+ let t21;
215
+ if ($[38] !== indicatorStyle || $[39] !== t20) {
216
+ t21 = /* @__PURE__ */ jsx("span", {
217
+ className: t20,
203
218
  style: indicatorStyle
204
219
  });
205
- $[36] = indicatorStyle;
206
- $[37] = t18;
207
- $[38] = t19;
208
- } else t19 = $[38];
209
- let t20;
210
- if ($[39] !== move || $[40] !== rest || $[41] !== t13 || $[42] !== t15 || $[43] !== t16 || $[44] !== t17 || $[45] !== t19) {
211
- t20 = /* @__PURE__ */ jsxs("div", {
220
+ $[38] = indicatorStyle;
221
+ $[39] = t20;
222
+ $[40] = t21;
223
+ } else t21 = $[40];
224
+ let t22;
225
+ if ($[41] !== move || $[42] !== rest || $[43] !== t14 || $[44] !== t16 || $[45] !== t17 || $[46] !== t18 || $[47] !== t19 || $[48] !== t21) {
226
+ t22 = /* @__PURE__ */ jsxs("div", {
212
227
  ...rest,
213
228
  ref: rootRef,
214
- className: t13,
215
- role: t14,
216
- "aria-disabled": t15,
217
- "aria-readonly": t16,
229
+ className: t14,
230
+ role: t15,
231
+ "aria-orientation": t16,
232
+ "aria-disabled": t17,
233
+ "aria-readonly": t18,
218
234
  onKeyDown: move,
219
- children: [t17, t19]
235
+ children: [t19, t21]
220
236
  });
221
- $[39] = move;
222
- $[40] = rest;
223
- $[41] = t13;
224
- $[42] = t15;
225
- $[43] = t16;
226
- $[44] = t17;
227
- $[45] = t19;
228
- $[46] = t20;
229
- } else t20 = $[46];
230
- return t20;
237
+ $[41] = move;
238
+ $[42] = rest;
239
+ $[43] = t14;
240
+ $[44] = t16;
241
+ $[45] = t17;
242
+ $[46] = t18;
243
+ $[47] = t19;
244
+ $[48] = t21;
245
+ $[49] = t22;
246
+ } else t22 = $[49];
247
+ return t22;
231
248
  };
232
249
  var segmented_default = createFormFieldComponent(Segmented);
233
250
  function _temp(next) {
234
251
  return next;
235
252
  }
236
- function _temp2(option_0) {
253
+ function _temp2(item_0) {
254
+ return !item_0.disabled;
255
+ }
256
+ function _temp3(option_0) {
237
257
  return !option_0.disabled;
238
258
  }
239
259
  //#endregion
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/space/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/spin/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/steps/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/table/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -20,7 +20,7 @@ import { compareSortValues, countColumnLeaves, flattenColumns, flattenTreeData,
20
20
  import { TableColumnSetting } from "./column-setting.js";
21
21
  import { c } from "react/compiler-runtime";
22
22
  import clsx from "clsx";
23
- import { useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
23
+ import { isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
24
24
  import { jsx, jsxs } from "react/jsx-runtime";
25
25
  import { flushSync } from "react-dom";
26
26
  //#region components/table/index.tsx
@@ -155,6 +155,17 @@ var EllipsisCell = (t0) => {
155
155
  return t8;
156
156
  };
157
157
  /**
158
+ * 单元格原始值的渲染兜底,与 kui-vue 同口径(vue 的渲染器会把对象子节点转成文本:普通对象与
159
+ * `Date` 调 `String()`,数组逐项展开)。React 遇到同样的对象会直接抛
160
+ * "Objects are not valid as a React child" 把整张表打崩,所以先在这一层转掉。
161
+ * React 元素原样保留,数组继续按子节点序列交给 React(`[1, 2]` 两边都渲染成 "12")。
162
+ */
163
+ var renderRawValue = (value) => {
164
+ if (Array.isArray(value)) return value.map(renderRawValue);
165
+ if (value !== null && typeof value === "object" && !isValidElement(value)) return String(value);
166
+ return value;
167
+ };
168
+ /**
158
169
  * 行展开状态。`expandedKeys` 提供时完全受控;否则 `expandAllRows` 决定初始是否全部展开,
159
170
  * 并且此后 `data` 变化只补“新出现的父行”(见 `mergeExpandAllRows`),
160
171
  * 用户手动展开或折叠过的行不会被异步到达的数据覆盖。
@@ -414,7 +425,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
414
425
  ]);
415
426
  const fixedClass = (column_4, index_2, colSpan = 1) => clsx({
416
427
  "k-table-cell-fix-left": column_4.fixed === "left",
417
- "k-table-cell-fix-left-last": column_4.fixed === "left" && leaves[index_2 + 1]?.fixed !== "left",
428
+ "k-table-cell-fix-left-last": column_4.fixed === "left" && leaves[index_2 + colSpan]?.fixed !== "left",
418
429
  "k-table-cell-fix-right": column_4.fixed === "right",
419
430
  "k-table-cell-fix-right-first": column_4.fixed === "right" && leaves[index_2 - 1]?.fixed !== "right",
420
431
  "k-table-cell-sorter": column_4.sorter,
@@ -638,7 +649,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
638
649
  const thead = /* @__PURE__ */ jsx("thead", { children: headerInfo.rows.map((row_5, rowIndex) => /* @__PURE__ */ jsxs("tr", { children: [checkable && rowIndex === 0 && /* @__PURE__ */ jsx("th", {
639
650
  rowSpan: headerInfo.maxDepth,
640
651
  className: clsx("k-table-cell-fix-left", {
641
- "k-table-cell-fix-left-last": ping.left,
652
+ "k-table-cell-fix-left-last": ping.left && leaves[0]?.fixed !== "left",
642
653
  "k-table-cell-last-column": !leaves.length
643
654
  }),
644
655
  style: { left: 0 },
@@ -707,7 +718,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
707
718
  },
708
719
  children: [checkable && /* @__PURE__ */ jsx("td", {
709
720
  className: clsx("k-table-cell-fix-left", {
710
- "k-table-cell-fix-left-last": ping.left,
721
+ "k-table-cell-fix-left-last": ping.left && leaves[0]?.fixed !== "left",
711
722
  "k-table-cell-last-column": !leaves.length
712
723
  }),
713
724
  style: {
@@ -728,7 +739,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
728
739
  };
729
740
  if (!cell_2.show) return null;
730
741
  const value = getRecordValue(record_6, column_11.key);
731
- const content = column_11.render?.(value, record_6, rowIndex_0, column_11) ?? value;
742
+ const content = column_11.render?.(value, record_6, rowIndex_0, column_11) ?? renderRawValue(value);
732
743
  const ellipsis = cellEllipsis.get(column_11.key);
733
744
  return /* @__PURE__ */ jsx("td", {
734
745
  "aria-labelledby": splitHeader ? headCellIds.get(column_11.key) : void 0,
@@ -816,7 +827,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
816
827
  ref: bodyRef,
817
828
  style: {
818
829
  overflowY: scroll.y ? "scroll" : "auto",
819
- overflowX: data.length ? "auto" : "hidden",
830
+ overflowX: "auto",
820
831
  maxHeight: scroll.y
821
832
  },
822
833
  onScroll: handleScroll,
package/es/table/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -109,8 +109,7 @@ var getSyntheticRowKey = (record) => {
109
109
  * 本函数与上面的 `getSyntheticRowKey` 在两个仓库里是逐字节相同的副本,改一边必须同步另一边。
110
110
  */
111
111
  var resolveRowKey = (record, rowKey) => {
112
- if (typeof rowKey === "function") return rowKey(record);
113
- const value = getRecordValue(record, rowKey);
112
+ const value = typeof rowKey === "function" ? rowKey(record) : getRecordValue(record, rowKey);
114
113
  return typeof value === "string" || typeof value === "number" ? value : getSyntheticRowKey(record);
115
114
  };
116
115
  var flattenTreeData = ({ data, childrenColumnName, expandedKeys, getKey, sortRecords = (records) => records }) => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/tabs/tabs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/tag/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/tour/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/tree/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/tree/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.2.0
2
+ * react-kui v3.2.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn