react-kui 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/AI.en-US.md +86 -1
  2. package/AI.md +68 -4
  3. package/ai/behaviors.json +114 -14
  4. package/ai/cli.mjs +180 -17
  5. package/ai/descriptions.json +446 -0
  6. package/ai/kui-components.json +778 -305
  7. package/ai/mcp.mjs +2 -189
  8. package/ai/query.mjs +195 -0
  9. package/ai/skills/react-kui/SKILL.md +41 -9
  10. package/ai/skills/react-kui/references/mcp.md +11 -1
  11. package/ai/skills/react-kui/references/react-to-vue.md +110 -0
  12. package/ai/skills/react-kui/references/vue-to-react.md +86 -0
  13. package/ai/validate.mjs +18 -0
  14. package/es/_virtual/_rolldown/runtime.js +1 -1
  15. package/es/affix/index.js +1 -1
  16. package/es/alert/index.js +1 -1
  17. package/es/anchor/anchor-context.js +1 -1
  18. package/es/anchor/anchor-link.js +1 -1
  19. package/es/anchor/anchor.js +1 -1
  20. package/es/auto-complete/index.js +1 -1
  21. package/es/avatar/avatar-group-context.js +1 -1
  22. package/es/avatar/avatar-group.js +1 -1
  23. package/es/avatar/avatar.js +1 -1
  24. package/es/back-top/index.js +1 -1
  25. package/es/badge/index.js +1 -1
  26. package/es/base/teleport.js +1 -1
  27. package/es/base/transition-props.js +1 -1
  28. package/es/base/transition.js +1 -1
  29. package/es/breadcrumb/breadcrumb-context.js +1 -1
  30. package/es/breadcrumb/breadcrumb-item.js +1 -1
  31. package/es/breadcrumb/breadcrumb.js +1 -1
  32. package/es/button/button-group-context.js +1 -1
  33. package/es/button/button-group.js +1 -1
  34. package/es/button/button.js +1 -1
  35. package/es/calendar/index.js +1 -1
  36. package/es/card/index.js +1 -1
  37. package/es/carousel/carousel-context.js +1 -1
  38. package/es/carousel/carousel-item.js +1 -1
  39. package/es/carousel/carousel.js +522 -274
  40. package/es/carousel/drag.js +169 -0
  41. package/es/cascader/index.js +1 -1
  42. package/es/check-card/check-card-group.js +1 -1
  43. package/es/check-card/check-card.js +1 -1
  44. package/es/check-card/context.js +1 -1
  45. package/es/checkbox/checkbox-group-context.js +1 -1
  46. package/es/checkbox/checkbox-group.js +1 -1
  47. package/es/checkbox/checkbox.js +1 -1
  48. package/es/checkbox/index.js +1 -1
  49. package/es/collapse/collapse-panel.js +1 -1
  50. package/es/collapse/collapse.js +1 -1
  51. package/es/color-picker/alpha.js +1 -1
  52. package/es/color-picker/hue.js +1 -1
  53. package/es/color-picker/index.js +1 -1
  54. package/es/color-picker/mode.js +1 -1
  55. package/es/color-picker/paint.js +1 -1
  56. package/es/color-picker/presets.js +1 -1
  57. package/es/components.js +1 -1
  58. package/es/config/config-context.js +1 -1
  59. package/es/config/context.js +1 -1
  60. package/es/config/index.js +1 -1
  61. package/es/config/size-context.js +1 -1
  62. package/es/config/use-config-appearance.js +1 -1
  63. package/es/const/var.js +1 -1
  64. package/es/date-picker/index.js +1 -1
  65. package/es/descriptions/descriptions-item.js +1 -1
  66. package/es/descriptions/descriptions.js +1 -1
  67. package/es/divider/index.js +1 -1
  68. package/es/drawer/index.js +1 -1
  69. package/es/dropdown/dropdown-button.js +1 -1
  70. package/es/dropdown/dropdown-context.js +1 -1
  71. package/es/dropdown/dropdown.js +1 -1
  72. package/es/dropdown/trigger.js +1 -1
  73. package/es/empty/index.js +1 -1
  74. package/es/feature-card/index.js +1 -1
  75. package/es/feedback-panel/index.js +1 -1
  76. package/es/flame-wrap/index.js +1 -1
  77. package/es/flame-wrap/types.js +1 -1
  78. package/es/flex/index.js +1 -1
  79. package/es/form/field-context.js +1 -1
  80. package/es/form/form-context.js +1 -1
  81. package/es/form/form-item.js +1 -1
  82. package/es/form/form.js +1 -1
  83. package/es/form/utils.js +1 -1
  84. package/es/grid/grid-item.js +1 -1
  85. package/es/grid/grid.js +1 -1
  86. package/es/grid/useBreakpoint.js +1 -1
  87. package/es/icon/index.js +1 -1
  88. package/es/image/group.js +1 -1
  89. package/es/image/image-group-context.js +1 -1
  90. package/es/image/image.js +1 -1
  91. package/es/image/instance.js +1 -1
  92. package/es/image/preview.js +1 -1
  93. package/es/image/utils.js +1 -1
  94. package/es/index.js +1 -1
  95. package/es/input/index.js +1 -1
  96. package/es/input/input-base.js +202 -0
  97. package/es/input/input-box.js +1 -1
  98. package/es/input/input-group.js +1 -1
  99. package/es/input/input.js +19 -188
  100. package/es/input/textarea.js +1 -1
  101. package/es/input-number/index.js +4 -4
  102. package/es/input-otp/index.js +1 -1
  103. package/es/input-tag/index.js +1 -1
  104. package/es/kanban/index.js +1 -1
  105. package/es/layout/index.js +1 -1
  106. package/es/layout/layout-context.js +1 -1
  107. package/es/list-panel/index.js +1 -1
  108. package/es/loading/index.js +1 -1
  109. package/es/loading/loading-bar.js +1 -1
  110. package/es/locale/de.js +1 -1
  111. package/es/locale/el.js +1 -1
  112. package/es/locale/en.js +1 -1
  113. package/es/locale/fr.js +1 -1
  114. package/es/locale/it.js +1 -1
  115. package/es/locale/ja.js +1 -1
  116. package/es/locale/ko.js +1 -1
  117. package/es/locale/ru.js +1 -1
  118. package/es/locale/th.js +1 -1
  119. package/es/locale/uk.js +1 -1
  120. package/es/locale/vi.js +1 -1
  121. package/es/locale/zh-CN.js +1 -1
  122. package/es/locale/zh-TW.js +1 -1
  123. package/es/mentions/index.js +1 -1
  124. package/es/menu/menu-context.js +1 -1
  125. package/es/menu/menu-divider.js +1 -1
  126. package/es/menu/menu-group.js +1 -1
  127. package/es/menu/menu-item.js +1 -1
  128. package/es/menu/menu-keyboard.js +1 -1
  129. package/es/menu/menu.js +1 -1
  130. package/es/menu/recursive-menu.js +1 -1
  131. package/es/menu/sub-menu.js +1 -1
  132. package/es/message/index.js +1 -1
  133. package/es/modal/api.js +1 -1
  134. package/es/modal/modal.js +1 -1
  135. package/es/modal/toast.js +1 -1
  136. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  137. package/es/notice/container.js +1 -1
  138. package/es/notice/content.js +1 -1
  139. package/es/notice/index.js +1 -1
  140. package/es/notice/instance.js +1 -1
  141. package/es/page/index.js +99 -76
  142. package/es/page/responsive.js +96 -0
  143. package/es/page-header/index.js +1 -1
  144. package/es/popconfirm/index.js +1 -1
  145. package/es/poptip/index.js +1 -1
  146. package/es/popup/index.js +1 -1
  147. package/es/popup/layers.js +1 -1
  148. package/es/progress/index.js +1 -1
  149. package/es/qrcode/index.js +1 -1
  150. package/es/radio/radio-button.js +1 -1
  151. package/es/radio/radio-group-context.js +1 -1
  152. package/es/radio/radio-group.js +1 -1
  153. package/es/radio/radio.js +1 -1
  154. package/es/rate/index.js +1 -1
  155. package/es/rate/star.js +1 -1
  156. package/es/result/index.js +1 -1
  157. package/es/ripple/index.js +1 -1
  158. package/es/ripple/types.js +1 -1
  159. package/es/row-col/col.js +1 -1
  160. package/es/row-col/row.js +1 -1
  161. package/es/segmented/index.js +1 -1
  162. package/es/select/option.js +1 -1
  163. package/es/select/select.js +1 -1
  164. package/es/skeleton/skeleton-avatar.js +1 -1
  165. package/es/skeleton/skeleton-button.js +1 -1
  166. package/es/skeleton/skeleton-image.js +1 -1
  167. package/es/skeleton/skeleton-text.js +1 -1
  168. package/es/skeleton/skeleton.js +1 -1
  169. package/es/skeleton/use-skeleton-loading.js +1 -1
  170. package/es/slider/index.js +1 -1
  171. package/es/slider/thumb.js +1 -1
  172. package/es/space/index.js +1 -1
  173. package/es/spin/index.js +1 -1
  174. package/es/splitter/splitter-panel.js +1 -1
  175. package/es/splitter/splitter.js +1 -1
  176. package/es/stat-card/countup.js +1 -1
  177. package/es/stat-card/rollup.js +1 -1
  178. package/es/stat-card/stat-card.js +1 -1
  179. package/es/stat-card/stat-number.js +1 -1
  180. package/es/stat-card/utils/countup.js +1 -1
  181. package/es/stat-card/utils/odometer.js +1 -1
  182. package/es/steps/index.js +1 -1
  183. package/es/switch/index.js +1 -1
  184. package/es/table/column-setting.js +1 -1
  185. package/es/table/index.js +1 -1
  186. package/es/table/utils.js +1 -1
  187. package/es/tabs/tab-panel.js +1 -1
  188. package/es/tabs/tabs.js +1 -1
  189. package/es/tag/index.js +1 -1
  190. package/es/time-line/timeline-item.js +1 -1
  191. package/es/time-line/timeline.js +1 -1
  192. package/es/tooltip/index.js +1 -1
  193. package/es/tour/index.js +1 -1
  194. package/es/transfer/index.js +1 -1
  195. package/es/tree/index.js +1 -1
  196. package/es/tree/utils.js +1 -1
  197. package/es/tree-select/index.js +1 -1
  198. package/es/typography/index.js +1 -1
  199. package/es/upload/file-list.js +1 -1
  200. package/es/upload/index.js +1 -1
  201. package/es/upload/picture-sort.js +1 -1
  202. package/es/upload/selector.js +1 -1
  203. package/es/utils/checked.js +1 -1
  204. package/es/utils/color.js +1 -1
  205. package/es/utils/number.js +1 -1
  206. package/es/utils/placement.js +1 -1
  207. package/es/utils/popup.js +1 -1
  208. package/es/utils/react-node.js +1 -1
  209. package/es/utils/selection-tags.js +1 -1
  210. package/es/utils/share.js +1 -1
  211. package/es/utils/theme.js +1 -1
  212. package/es/utils/transition.js +1 -1
  213. package/es/utils/use-value.js +1 -1
  214. package/es/virtual-list/index.js +1 -1
  215. package/es/virtual-list/range.js +1 -1
  216. package/es/watermark/index.js +1 -1
  217. package/lib/index.cjs +2 -2
  218. package/lib/locale/de.cjs +1 -1
  219. package/lib/locale/el.cjs +1 -1
  220. package/lib/locale/en.cjs +1 -1
  221. package/lib/locale/fr.cjs +1 -1
  222. package/lib/locale/it.cjs +1 -1
  223. package/lib/locale/ja.cjs +1 -1
  224. package/lib/locale/ko.cjs +1 -1
  225. package/lib/locale/ru.cjs +1 -1
  226. package/lib/locale/th.cjs +1 -1
  227. package/lib/locale/uk.cjs +1 -1
  228. package/lib/locale/vi.cjs +1 -1
  229. package/lib/locale/zh-CN.cjs +1 -1
  230. package/lib/locale/zh-TW.cjs +1 -1
  231. package/package.json +6 -3
  232. package/style/base.css +1 -1
  233. package/style/components.css +2 -2
  234. package/style/index.css +2 -2
  235. package/style/theme.css +1 -1
  236. package/types/carousel/carousel.d.cts +2 -1
  237. package/types/carousel/carousel.d.ts +2 -1
  238. package/types/carousel/drag.d.cts +19 -0
  239. package/types/carousel/drag.d.ts +19 -0
  240. package/types/input/input-base.d.cts +31 -0
  241. package/types/input/input-base.d.ts +31 -0
  242. package/types/input/input.d.cts +2 -25
  243. package/types/input/input.d.ts +2 -25
  244. package/types/page/index.d.cts +1 -0
  245. package/types/page/index.d.ts +1 -0
  246. package/types/page/responsive.d.cts +1 -0
  247. package/types/page/responsive.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/menu/menu.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/modal/api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/modal/modal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/modal/toast.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/page/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -13,17 +13,23 @@ import { ChevronUp, ChevronsLeft, ChevronsRight, Ellipsis } from "../node_module
13
13
  import Icon from "../icon/index.js";
14
14
  import input_number_default from "../input-number/index.js";
15
15
  import select_default from "../select/select.js";
16
+ import { bindResponsivePage } from "./responsive.js";
16
17
  import clsx from "clsx";
17
- import { useContext, useState } from "react";
18
+ import { useContext, useLayoutEffect, useRef, useState } from "react";
18
19
  import { jsx, jsxs } from "react/jsx-runtime";
19
20
  //#region components/page/index.tsx
20
- var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = true, showElevator = false, theme: themeProp, shape: shapeProp, sizeData = [
21
+ var Page = ({ simple = false, responsive = true, disabled = false, showSizer = false, showTotal = true, showElevator = false, theme: themeProp, shape: shapeProp, sizeData = [
21
22
  10,
22
23
  15,
23
24
  20,
24
25
  30,
25
26
  40
26
27
  ], size: sizeProp, total = 0, pageSize: pageSizeProp = 10, page: pageProp = 1, onChange, className = "", ...rest }) => {
28
+ const rootRef = useRef(null);
29
+ useLayoutEffect(() => {
30
+ if (!rootRef.current || !responsive || simple) return;
31
+ return bindResponsivePage(rootRef.current);
32
+ }, [responsive, simple]);
27
33
  const inheritedAppearance = useConfigAppearance();
28
34
  const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
29
35
  const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
@@ -76,7 +82,7 @@ var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = t
76
82
  event.preventDefault();
77
83
  action();
78
84
  };
79
- const renderPageItems = () => {
85
+ const renderPageItems = (compact = false) => {
80
86
  const groupCount = 7;
81
87
  const page = currentPage;
82
88
  const pCount = pageCount;
@@ -95,6 +101,13 @@ var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = t
95
101
  const offset = Math.floor(groupCount / 2) - 1;
96
102
  for (let i_1 = page - offset; i_1 <= page + offset; i_1++) array.push(i_1);
97
103
  } else for (let i_2 = 2; i_2 < pCount; i_2++) array.push(i_2);
104
+ if (compact && pCount > 5) {
105
+ array.length = 0;
106
+ const middle = Math.min(pCount - 1, Math.max(2, page));
107
+ array.push(middle);
108
+ showPrevMore = middle > 2;
109
+ showNextMore = middle < pCount - 1;
110
+ }
98
111
  const items = array.map((p_0) => /* @__PURE__ */ jsx("li", {
99
112
  className: clsx("k-pager-item", { "k-pager-item-active": page === p_0 }),
100
113
  role: "button",
@@ -136,16 +149,95 @@ var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = t
136
149
  "k-page-outline": theme === "outline",
137
150
  "k-page-disabled": disabled,
138
151
  "k-page-simple": simple,
152
+ "k-page-responsive": responsive && !simple,
139
153
  [`k-page-${shape}`]: shape
140
154
  }, className);
141
155
  const sizeOptions = sizeData.map((s) => ({
142
156
  value: s,
143
157
  label: `${s}${locale?.k?.page?.pageSize || " / page"}`
144
158
  }));
159
+ const renderPager = (layout) => {
160
+ const pagerSimple = simple || layout === "simple";
161
+ return /* @__PURE__ */ jsxs("ul", {
162
+ className: "k-pager",
163
+ "data-page-pager": layout,
164
+ hidden: layout !== "full",
165
+ children: [
166
+ /* @__PURE__ */ jsx("li", {
167
+ className: clsx("k-pager-item k-pager-prev", { "k-pager-item-disabled": currentPage === 1 }),
168
+ role: "button",
169
+ tabIndex: disabled || currentPage === 1 ? -1 : 0,
170
+ "aria-disabled": disabled || currentPage === 1,
171
+ "aria-label": "Previous page",
172
+ onClick: prePage,
173
+ onKeyDown: (event_3) => activateByKeyboard(event_3, prePage),
174
+ children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
175
+ }),
176
+ !pagerSimple && pageCount > 0 && /* @__PURE__ */ jsx("li", {
177
+ className: clsx("k-pager-item", { "k-pager-item-active": currentPage === 1 }),
178
+ role: "button",
179
+ tabIndex: disabled ? -1 : 0,
180
+ "aria-current": currentPage === 1 ? "page" : void 0,
181
+ "aria-label": "Page 1",
182
+ onClick: () => toPage(1),
183
+ onKeyDown: (event_4) => activateByKeyboard(event_4, () => toPage(1)),
184
+ children: /* @__PURE__ */ jsx("span", { children: "1" })
185
+ }),
186
+ !pagerSimple && renderPageItems(layout === "compact"),
187
+ !pagerSimple && pageCount > 1 && /* @__PURE__ */ jsx("li", {
188
+ className: clsx("k-pager-item", { "k-pager-item-active": currentPage === pageCount }),
189
+ role: "button",
190
+ tabIndex: disabled ? -1 : 0,
191
+ "aria-current": currentPage === pageCount ? "page" : void 0,
192
+ "aria-label": `Page ${pageCount}`,
193
+ onClick: () => toPage(pageCount),
194
+ onKeyDown: (event_5) => activateByKeyboard(event_5, () => toPage(pageCount)),
195
+ children: /* @__PURE__ */ jsx("span", { children: pageCount })
196
+ }),
197
+ pagerSimple && /* @__PURE__ */ jsxs("li", {
198
+ className: "k-page-simple-number",
199
+ "aria-current": "page",
200
+ children: [
201
+ showElevator ? /* @__PURE__ */ jsx("span", {
202
+ className: "k-page-simple-input",
203
+ children: /* @__PURE__ */ jsx(input_number_default, {
204
+ value: currentPage,
205
+ min: 1,
206
+ max: pageCount,
207
+ controls: false,
208
+ disabled,
209
+ size,
210
+ theme,
211
+ onChange: (nextPage_0) => {
212
+ if (nextPage_0 !== void 0) toPage(nextPage_0);
213
+ }
214
+ })
215
+ }) : /* @__PURE__ */ jsx("span", { children: currentPage }),
216
+ /* @__PURE__ */ jsx("span", {
217
+ "aria-hidden": "true",
218
+ children: "/"
219
+ }),
220
+ /* @__PURE__ */ jsx("span", { children: pageCount })
221
+ ]
222
+ }),
223
+ /* @__PURE__ */ jsx("li", {
224
+ className: clsx("k-pager-item k-pager-next", { "k-pager-item-disabled": currentPage === pageCount }),
225
+ role: "button",
226
+ tabIndex: disabled || currentPage === pageCount ? -1 : 0,
227
+ "aria-disabled": disabled || currentPage === pageCount,
228
+ "aria-label": "Next page",
229
+ onClick: goNextPage,
230
+ onKeyDown: (event_6) => activateByKeyboard(event_6, goNextPage),
231
+ children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
232
+ })
233
+ ]
234
+ });
235
+ };
145
236
  return /* @__PURE__ */ jsxs("nav", {
146
237
  className: classes,
147
238
  "aria-label": "Pagination",
148
239
  ...rest,
240
+ ref: rootRef,
149
241
  children: [
150
242
  showTotal && !simple ? /* @__PURE__ */ jsx("div", {
151
243
  className: "k-page-number",
@@ -157,78 +249,9 @@ var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = t
157
249
  locale?.k?.page?.items
158
250
  ] })
159
251
  }) : null,
160
- /* @__PURE__ */ jsxs("ul", {
161
- className: "k-pager",
162
- children: [
163
- /* @__PURE__ */ jsx("li", {
164
- className: clsx("k-pager-item k-pager-prev", { "k-pager-item-disabled": currentPage === 1 }),
165
- role: "button",
166
- tabIndex: disabled || currentPage === 1 ? -1 : 0,
167
- "aria-disabled": disabled || currentPage === 1,
168
- "aria-label": "Previous page",
169
- onClick: prePage,
170
- onKeyDown: (event_3) => activateByKeyboard(event_3, prePage),
171
- children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
172
- }),
173
- !simple && pageCount > 0 && /* @__PURE__ */ jsx("li", {
174
- className: clsx("k-pager-item", { "k-pager-item-active": currentPage === 1 }),
175
- role: "button",
176
- tabIndex: disabled ? -1 : 0,
177
- "aria-current": currentPage === 1 ? "page" : void 0,
178
- "aria-label": "Page 1",
179
- onClick: () => toPage(1),
180
- onKeyDown: (event_4) => activateByKeyboard(event_4, () => toPage(1)),
181
- children: /* @__PURE__ */ jsx("span", { children: "1" })
182
- }),
183
- !simple && renderPageItems(),
184
- !simple && pageCount > 1 && /* @__PURE__ */ jsx("li", {
185
- className: clsx("k-pager-item", { "k-pager-item-active": currentPage === pageCount }),
186
- role: "button",
187
- tabIndex: disabled ? -1 : 0,
188
- "aria-current": currentPage === pageCount ? "page" : void 0,
189
- "aria-label": `Page ${pageCount}`,
190
- onClick: () => toPage(pageCount),
191
- onKeyDown: (event_5) => activateByKeyboard(event_5, () => toPage(pageCount)),
192
- children: /* @__PURE__ */ jsx("span", { children: pageCount })
193
- }),
194
- simple && /* @__PURE__ */ jsxs("li", {
195
- className: "k-page-simple-number",
196
- "aria-current": "page",
197
- children: [
198
- showElevator ? /* @__PURE__ */ jsx("span", {
199
- className: "k-page-simple-input",
200
- children: /* @__PURE__ */ jsx(input_number_default, {
201
- value: currentPage,
202
- min: 1,
203
- max: pageCount,
204
- controls: false,
205
- disabled,
206
- size,
207
- theme,
208
- onChange: (nextPage_0) => {
209
- if (nextPage_0 !== void 0) toPage(nextPage_0);
210
- }
211
- })
212
- }) : /* @__PURE__ */ jsx("span", { children: currentPage }),
213
- /* @__PURE__ */ jsx("span", {
214
- "aria-hidden": "true",
215
- children: "/"
216
- }),
217
- /* @__PURE__ */ jsx("span", { children: pageCount })
218
- ]
219
- }),
220
- /* @__PURE__ */ jsx("li", {
221
- className: clsx("k-pager-item k-pager-next", { "k-pager-item-disabled": currentPage === pageCount }),
222
- role: "button",
223
- tabIndex: disabled || currentPage === pageCount ? -1 : 0,
224
- "aria-disabled": disabled || currentPage === pageCount,
225
- "aria-label": "Next page",
226
- onClick: goNextPage,
227
- onKeyDown: (event_6) => activateByKeyboard(event_6, goNextPage),
228
- children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
229
- })
230
- ]
231
- }),
252
+ renderPager("full"),
253
+ responsive && !simple && renderPager("compact"),
254
+ responsive && !simple && renderPager("simple"),
232
255
  !simple && showSizer && /* @__PURE__ */ jsxs("div", {
233
256
  className: "k-page-sizer",
234
257
  children: [/* @__PURE__ */ jsx(select_default, {
@@ -0,0 +1,96 @@
1
+ /*!
2
+ * react-kui v3.1.1
3
+ * Copyright 2017-present, kui-react.
4
+ * All rights reserved.
5
+ * Homepage: https://react.k-ui.cn
6
+ * Author: Qiu / https://chuchur.com
7
+ */
8
+
9
+ //#region components/page/responsive.ts
10
+ function showLayout(root, layout) {
11
+ root.dataset.pageLayout = layout;
12
+ root.querySelectorAll("[data-page-pager]").forEach((pager) => {
13
+ pager.hidden = pager.dataset.pagePager !== layout;
14
+ });
15
+ }
16
+ function bindResponsivePage(root) {
17
+ const view = root.ownerDocument.defaultView;
18
+ let layout = "full";
19
+ let frame = 0;
20
+ let disposed = false;
21
+ const measure = () => {
22
+ if (disposed) return;
23
+ const available = root.clientWidth;
24
+ if (!available) return;
25
+ const host = root.ownerDocument.createElement("div");
26
+ host.style.cssText = "position:fixed;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none";
27
+ host.setAttribute("aria-hidden", "true");
28
+ host.inert = true;
29
+ const copy = root.cloneNode(true);
30
+ copy.removeAttribute("id");
31
+ copy.querySelectorAll("[id]").forEach((node) => node.removeAttribute("id"));
32
+ copy.style.setProperty("width", "max-content", "important");
33
+ copy.style.setProperty("max-width", "none", "important");
34
+ copy.style.setProperty("min-width", "0", "important");
35
+ copy.style.setProperty("flex", "none", "important");
36
+ host.append(copy);
37
+ root.parentElement?.append(host);
38
+ const widths = {
39
+ full: 0,
40
+ compact: 0
41
+ };
42
+ try {
43
+ for (const candidate of ["full", "compact"]) {
44
+ showLayout(copy, candidate);
45
+ widths[candidate] = copy.clientWidth;
46
+ }
47
+ } finally {
48
+ host.remove();
49
+ }
50
+ if (!widths.full || !widths.compact) return;
51
+ const fullMargin = layout === "full" ? 0 : 16;
52
+ const compactMargin = layout === "simple" ? 16 : 0;
53
+ const next = widths.full + fullMargin <= available ? "full" : widths.compact + compactMargin <= available ? "compact" : "simple";
54
+ if (next !== layout) {
55
+ const focused = root.ownerDocument.activeElement;
56
+ const label = focused?.closest("[data-page-pager]") ? focused.getAttribute("aria-label") : null;
57
+ showLayout(root, next);
58
+ if (focused && root.contains(focused) && focused.closest("[hidden]")) {
59
+ const buttons = [...root.querySelector(`[data-page-pager="${next}"]`)?.querySelectorAll("[role=\"button\"]") || []];
60
+ (buttons.find((button) => button.getAttribute("aria-label") === label) || buttons.find((button) => button.tabIndex >= 0))?.focus();
61
+ }
62
+ layout = next;
63
+ } else showLayout(root, layout);
64
+ };
65
+ const schedule = () => {
66
+ if (!frame) frame = view.requestAnimationFrame(() => {
67
+ frame = 0;
68
+ measure();
69
+ });
70
+ };
71
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(schedule);
72
+ observer?.observe(root);
73
+ const mutations = new MutationObserver(schedule);
74
+ mutations.observe(root, {
75
+ subtree: true,
76
+ childList: true,
77
+ characterData: true,
78
+ attributes: true,
79
+ attributeFilter: ["class", "style"]
80
+ });
81
+ view.addEventListener("resize", schedule);
82
+ root.ownerDocument.fonts?.addEventListener("loadingdone", schedule);
83
+ measure();
84
+ return () => {
85
+ disposed = true;
86
+ observer?.disconnect();
87
+ mutations.disconnect();
88
+ view.removeEventListener("resize", schedule);
89
+ root.ownerDocument.fonts?.removeEventListener("loadingdone", schedule);
90
+ if (frame) view.cancelAnimationFrame(frame);
91
+ showLayout(root, "full");
92
+ delete root.dataset.pageLayout;
93
+ };
94
+ }
95
+ //#endregion
96
+ export { bindResponsivePage };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/popup/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/radio/radio.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/rate/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/rate/star.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/row-col/col.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
package/es/row-col/row.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * react-kui v3.1.0
2
+ * react-kui v3.1.1
3
3
  * Copyright 2017-present, kui-react.
4
4
  * All rights reserved.
5
5
  * Homepage: https://react.k-ui.cn