x-next 1.12.0 → 1.14.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 (226) hide show
  1. package/AI_CODING.md +6 -5
  2. package/AI_USAGE/catalog.md +106 -105
  3. package/AI_USAGE/components/alert-api.md +48 -0
  4. package/AI_USAGE/components/alert.md +222 -3
  5. package/AI_USAGE/components/bar-chart-api.md +177 -0
  6. package/AI_USAGE/components/bar-chart.md +297 -3
  7. package/AI_USAGE/components/boxicons.md +147 -0
  8. package/AI_USAGE/components/button-api.md +144 -0
  9. package/AI_USAGE/components/button.md +447 -3
  10. package/AI_USAGE/components/charts.md +81 -0
  11. package/AI_USAGE/components/checkbox-api.md +145 -0
  12. package/AI_USAGE/components/checkbox.md +365 -3
  13. package/AI_USAGE/components/color-picker-api.md +52 -0
  14. package/AI_USAGE/components/color-picker.md +211 -3
  15. package/AI_USAGE/components/config-provider-api.md +38 -0
  16. package/AI_USAGE/components/config-provider.md +250 -3
  17. package/AI_USAGE/components/date-picker-api.md +1114 -0
  18. package/AI_USAGE/components/date-picker.md +378 -3
  19. package/AI_USAGE/components/dialog-api.md +142 -0
  20. package/AI_USAGE/components/dialog.md +284 -3
  21. package/AI_USAGE/components/draggable-api.md +146 -0
  22. package/AI_USAGE/components/draggable.md +259 -0
  23. package/AI_USAGE/components/drawer-api.md +78 -0
  24. package/AI_USAGE/components/drawer.md +227 -0
  25. package/AI_USAGE/components/dropdown-api.md +529 -0
  26. package/AI_USAGE/components/dropdown.md +392 -3
  27. package/AI_USAGE/components/empty-api.md +36 -0
  28. package/AI_USAGE/components/empty.md +227 -3
  29. package/AI_USAGE/components/finicon.md +88 -0
  30. package/AI_USAGE/components/form-api.md +524 -0
  31. package/AI_USAGE/components/form.md +454 -0
  32. package/AI_USAGE/components/grid-api.md +527 -0
  33. package/AI_USAGE/components/grid.md +224 -0
  34. package/AI_USAGE/components/heatmap-api.md +122 -0
  35. package/AI_USAGE/components/heatmap.md +220 -0
  36. package/AI_USAGE/components/icon-api.md +4707 -0
  37. package/AI_USAGE/components/icon.md +257 -0
  38. package/AI_USAGE/components/image-api.md +440 -0
  39. package/AI_USAGE/components/image.md +465 -0
  40. package/AI_USAGE/components/input-api.md +184 -0
  41. package/AI_USAGE/components/input-number-api.md +66 -0
  42. package/AI_USAGE/components/input-number.md +294 -0
  43. package/AI_USAGE/components/input-tag-api.md +114 -0
  44. package/AI_USAGE/components/input-tag.md +482 -0
  45. package/AI_USAGE/components/input.md +293 -3
  46. package/AI_USAGE/components/layout-api.md +147 -0
  47. package/AI_USAGE/components/layout.md +230 -0
  48. package/AI_USAGE/components/line-chart-api.md +197 -0
  49. package/AI_USAGE/components/line-chart.md +279 -3
  50. package/AI_USAGE/components/link-api.md +42 -0
  51. package/AI_USAGE/components/link.md +197 -0
  52. package/AI_USAGE/components/menu-api.md +516 -0
  53. package/AI_USAGE/components/menu.md +268 -0
  54. package/AI_USAGE/components/message-api.md +215 -0
  55. package/AI_USAGE/components/message-box-api.md +108 -0
  56. package/AI_USAGE/components/message-box.md +268 -3
  57. package/AI_USAGE/components/message.md +231 -3
  58. package/AI_USAGE/components/network-api.md +91 -0
  59. package/AI_USAGE/components/network.md +378 -0
  60. package/AI_USAGE/components/notification-api.md +236 -0
  61. package/AI_USAGE/components/notification.md +275 -3
  62. package/AI_USAGE/components/pagination-api.md +62 -0
  63. package/AI_USAGE/components/pagination.md +386 -5
  64. package/AI_USAGE/components/pie-chart-api.md +109 -0
  65. package/AI_USAGE/components/pie-chart.md +245 -3
  66. package/AI_USAGE/components/popconfirm-api.md +75 -0
  67. package/AI_USAGE/components/popconfirm.md +231 -3
  68. package/AI_USAGE/components/popover-api.md +75 -0
  69. package/AI_USAGE/components/popover.md +208 -3
  70. package/AI_USAGE/components/popup-api.md +75 -0
  71. package/AI_USAGE/components/popup.md +52 -0
  72. package/AI_USAGE/components/progress-api.md +44 -0
  73. package/AI_USAGE/components/progress.md +248 -3
  74. package/AI_USAGE/components/radio-api.md +165 -0
  75. package/AI_USAGE/components/radio.md +259 -3
  76. package/AI_USAGE/components/rate-api.md +54 -0
  77. package/AI_USAGE/components/rate.md +233 -3
  78. package/AI_USAGE/components/resize-box-api.md +56 -0
  79. package/AI_USAGE/components/resize-box.md +231 -0
  80. package/AI_USAGE/components/scrollbar-api.md +77 -0
  81. package/AI_USAGE/components/scrollbar.md +218 -0
  82. package/AI_USAGE/components/select-api.md +758 -0
  83. package/AI_USAGE/components/select.md +640 -3
  84. package/AI_USAGE/components/skeleton-api.md +85 -0
  85. package/AI_USAGE/components/skeleton.md +150 -0
  86. package/AI_USAGE/components/slider-api.md +51 -0
  87. package/AI_USAGE/components/slider.md +233 -3
  88. package/AI_USAGE/components/space-api.md +38 -0
  89. package/AI_USAGE/components/space.md +145 -0
  90. package/AI_USAGE/components/spin-api.md +43 -0
  91. package/AI_USAGE/components/spin.md +205 -0
  92. package/AI_USAGE/components/steps-api.md +111 -0
  93. package/AI_USAGE/components/steps.md +201 -3
  94. package/AI_USAGE/components/switch-api.md +58 -0
  95. package/AI_USAGE/components/switch.md +290 -3
  96. package/AI_USAGE/components/table-api.md +2919 -0
  97. package/AI_USAGE/components/table.md +1414 -0
  98. package/AI_USAGE/components/tabs-api.md +135 -0
  99. package/AI_USAGE/components/tabs.md +308 -3
  100. package/AI_USAGE/components/tag-api.md +124 -0
  101. package/AI_USAGE/components/tag.md +292 -0
  102. package/AI_USAGE/components/textarea-api.md +55 -0
  103. package/AI_USAGE/components/textarea.md +326 -3
  104. package/AI_USAGE/components/time-picker-api.md +137 -0
  105. package/AI_USAGE/components/time-picker.md +271 -3
  106. package/AI_USAGE/components/time-range-selector-api.md +44 -0
  107. package/AI_USAGE/components/time-range-selector.md +355 -0
  108. package/AI_USAGE/components/timeline-api.md +93 -0
  109. package/AI_USAGE/components/timeline.md +312 -0
  110. package/AI_USAGE/components/tooltip-api.md +77 -0
  111. package/AI_USAGE/components/tooltip.md +182 -0
  112. package/AI_USAGE/components/trend-chart-api.md +119 -0
  113. package/AI_USAGE/components/trend-chart.md +335 -0
  114. package/AI_USAGE/components/trigger-api.md +124 -0
  115. package/AI_USAGE/components/trigger.md +185 -0
  116. package/AI_USAGE/components/upload-api.md +200 -0
  117. package/AI_USAGE/components/upload.md +711 -3
  118. package/AI_USAGE/components/watermark-api.md +87 -0
  119. package/AI_USAGE/components/watermark.md +200 -0
  120. package/AI_USAGE/core.md +1 -1
  121. package/AI_USAGE/index.md +35 -7
  122. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  123. package/AI_USAGE.md +33657 -7
  124. package/CHANGELOG.md +40 -0
  125. package/dist/_utils/inherit-component-type.d.ts +11 -0
  126. package/dist/components/date-picker/index.d.ts +420 -5
  127. package/dist/components/form-input/index.d.ts +617 -2
  128. package/dist/components/layout/index.d.ts +689 -1
  129. package/dist/components/menu/index.d.ts +786 -1
  130. package/dist/components/network/Network.vue.d.ts +7 -3
  131. package/dist/components/network/index.d.ts +10 -2
  132. package/dist/components/network/props.d.ts +5 -0
  133. package/dist/components/network/utils.d.ts +3 -3
  134. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +4 -1
  135. package/dist/components/pagination/page-item-step.vue.d.ts +101 -130
  136. package/dist/components/pagination/page-item.vue.d.ts +1 -0
  137. package/dist/components/pagination/page-jumper.vue.d.ts +1 -1
  138. package/dist/components/pagination/page-options.vue.d.ts +6 -4
  139. package/dist/components/pagination/utils.d.ts +3 -0
  140. package/dist/components/time-range-selector/index.d.ts +6 -6
  141. package/dist/es/_container/resize-observer-v2.js +1 -1
  142. package/dist/es/_container/resize-observer.js +1 -1
  143. package/dist/es/_hooks/use-resize-observer.js +1 -1
  144. package/dist/es/_styles/palette-aliases.js +4 -4
  145. package/dist/es/_utils/inherit-component-type.js +6 -0
  146. package/dist/es/_virtual/advancedFormat.js +1 -1
  147. package/dist/es/_virtual/customParseFormat.js +1 -1
  148. package/dist/es/_virtual/dayjs.min.js +1 -1
  149. package/dist/es/_virtual/isBetween.js +1 -1
  150. package/dist/es/_virtual/quarterOfYear.js +1 -1
  151. package/dist/es/_virtual/weekOfYear.js +1 -1
  152. package/dist/es/_virtual/weekYear.js +1 -1
  153. package/dist/es/_virtual/zh-cn.js +1 -1
  154. package/dist/es/components/button/Button.js +53 -42
  155. package/dist/es/components/date-picker/index.js +18 -17
  156. package/dist/es/components/draggable/useDraggable.js +1 -1
  157. package/dist/es/components/form/Form.vue2.js +1 -1
  158. package/dist/es/components/form/FormItem.vue2.js +1 -1
  159. package/dist/es/components/form-input/index.js +12 -11
  160. package/dist/es/components/form-input-number/InputNumber.js +1 -1
  161. package/dist/es/components/form-slider/Slider.vue2.js +1 -1
  162. package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
  163. package/dist/es/components/form-slider/utils.js +1 -1
  164. package/dist/es/components/layout/index.js +10 -9
  165. package/dist/es/components/menu/MenuItem.js +1 -1
  166. package/dist/es/components/menu/hooks/use-level.js +5 -5
  167. package/dist/es/components/menu/index.js +13 -10
  168. package/dist/es/components/menu/overflow-wrap.js +1 -1
  169. package/dist/es/components/network/Network.vue.js +17 -12
  170. package/dist/es/components/network/Network.vue2.js +78 -70
  171. package/dist/es/components/network/utils.js +112 -71
  172. package/dist/es/components/pagination/Pagination.js +132 -123
  173. package/dist/es/components/pagination/page-item-ellipsis.vue.js +10 -10
  174. package/dist/es/components/pagination/page-item-ellipsis.vue2.js +24 -19
  175. package/dist/es/components/pagination/page-item-step.vue.js +14 -11
  176. package/dist/es/components/pagination/page-item-step.vue2.js +20 -22
  177. package/dist/es/components/pagination/page-item.vue.js +10 -9
  178. package/dist/es/components/pagination/page-item.vue2.js +24 -19
  179. package/dist/es/components/pagination/page-jumper.vue2.js +23 -23
  180. package/dist/es/components/pagination/page-options.vue.js +15 -10
  181. package/dist/es/components/pagination/page-options.vue2.js +21 -17
  182. package/dist/es/components/pagination/utils.js +4 -2
  183. package/dist/es/components/progress/circle.vue2.js +1 -1
  184. package/dist/es/components/progress/line.vue2.js +1 -1
  185. package/dist/es/components/progress/steps.vue2.js +1 -1
  186. package/dist/es/components/rate/Rate.js +1 -1
  187. package/dist/es/components/virtual-list-v2/virtual-list-item.js +1 -1
  188. package/dist/es/locale/en-US.js +2 -0
  189. package/dist/es/locale/zh-CN.js +2 -0
  190. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
  191. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
  192. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
  193. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
  194. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
  195. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
  196. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
  197. package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
  198. package/dist/es/style.css +1 -1
  199. package/dist/index.cjs +3 -3
  200. package/dist/index.umd.js +3 -3
  201. package/dist/locale/interface.d.ts +3 -0
  202. package/dist/style/base.css +1 -1
  203. package/dist/style/button.css +1 -1
  204. package/dist/style/form-select.css +1 -1
  205. package/dist/style/network.css +1 -1
  206. package/dist/style/pagination.css +1 -1
  207. package/dist/style/table.css +1 -1
  208. package/dist/style.css +1 -1
  209. package/package.json +10 -5
  210. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
  211. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
  212. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
  213. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
  214. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
  215. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
  216. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
  217. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
  218. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
  219. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
  220. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
  221. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
  222. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
  223. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
  224. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
  225. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
  226. /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
@@ -0,0 +1,165 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Radio 完整公开 API
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
7
+
8
+ ## Radio API
9
+
10
+ 公开声明:`dist/components/form-radio/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
11
+
12
+ ### Props
13
+
14
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
15
+ | --- | --- | --- | --- | --- |
16
+ | modelValue | 绑定值 | undefined &#124; string &#124; number &#124; false &#124; true | 否 | undefined |
17
+ | defaultChecked | 默认是否选中,非受控模式 | undefined &#124; false &#124; true | 否 | false |
18
+ | value | 选项值 | undefined &#124; string &#124; number &#124; false &#124; true | 否 | true |
19
+ | name | 原生 input 的 name 属性,优先级高于 RadioGroup 的 name | undefined &#124; string | 否 | 未声明 |
20
+ | id | 原生 input 的 id 属性 | undefined &#124; string | 否 | 未声明 |
21
+ | type | 单选类型 | undefined &#124; "button" &#124; "radio" | 否 | "radio" |
22
+ | disabled | 是否禁用 | undefined &#124; false &#124; true | 否 | false |
23
+ | size | 组件尺寸 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 未声明 |
24
+ | uninjectGroupContext | 见场景用法与类型 | undefined &#124; false &#124; true | 否 | false |
25
+
26
+ ### Events
27
+
28
+ | 事件 | 用途 | 监听器签名(即事件参数) |
29
+ | --- | --- | --- |
30
+ | update:modelValue | 值更新时触发 | undefined &#124; (value: RadioValue) => any |
31
+ | change | 值变化时触发 | undefined &#124; (value: RadioValue, ev: Event) => any |
32
+
33
+ ### Slots
34
+
35
+ | 名称 | 用途 | 公开类型 |
36
+ | --- | --- | --- |
37
+ | default | 单选框文案 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
38
+ | radio | 自定义单选框图形 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
39
+
40
+ ### 实例方法
41
+
42
+ 没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
43
+
44
+ ### 关联类型定义
45
+
46
+ 以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
47
+
48
+ ```typescript-reference
49
+ type RadioValue = string | number | boolean;
50
+
51
+ interface RadioOption {
52
+ /**
53
+ * @zh 文案
54
+ * @en label content
55
+ */
56
+ label?: RenderContent;
57
+ /**
58
+ * @zh 选项的 `value`
59
+ * @en The `value` of the option
60
+ */
61
+ value: RadioValue;
62
+ /**
63
+ * @zh 是否禁用
64
+ * @en Whether to disable
65
+ */
66
+ disabled?: boolean;
67
+ }
68
+
69
+ declare const RADIO_TYPES: readonly ["radio", "button"];
70
+
71
+ type RadioType = (typeof RADIO_TYPES)[number];
72
+
73
+ interface RadioGroupContext {
74
+ name: 'XRadioGroup';
75
+ value: RadioValue;
76
+ size: Size;
77
+ type: RadioType;
78
+ disabled: boolean;
79
+ inputName?: string;
80
+ slots: Slots;
81
+ handleChange: (value: RadioValue, e: Event) => void;
82
+ }
83
+ ```
84
+
85
+
86
+ ## RadioGroup API
87
+
88
+ 公开声明:`dist/components/form-radio/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
89
+
90
+ ### Props
91
+
92
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
93
+ | --- | --- | --- | --- | --- |
94
+ | modelValue | 绑定值 | undefined &#124; string &#124; number &#124; false &#124; true | 否 | undefined |
95
+ | defaultValue | 默认值,非受控模式 | undefined &#124; string &#124; number &#124; false &#124; true | 否 | "" |
96
+ | type | 单选组类型 | undefined &#124; "button" &#124; "radio" | 否 | "radio" |
97
+ | size | 单选组尺寸 | undefined &#124; "mini" &#124; "small" &#124; "medium" &#124; "large" | 否 | 未声明 |
98
+ | options | 选项数据 | undefined &#124; (RadioValue &#124; RadioOption)[] | 否 | 未声明 |
99
+ | name | 传给组内原生 input 的 name 属性,运行时修改会同步 | undefined &#124; string | 否 | 未声明 |
100
+ | ariaLabel | 原生 radiogroup 的 aria-label 属性 | undefined &#124; string | 否 | 未声明 |
101
+ | direction | 排列方向 | undefined &#124; "horizontal" &#124; "vertical" | 否 | "horizontal" |
102
+ | disabled | 是否禁用 | undefined &#124; false &#124; true | 否 | false |
103
+
104
+ ### Events
105
+
106
+ | 事件 | 用途 | 监听器签名(即事件参数) |
107
+ | --- | --- | --- |
108
+ | update:modelValue | 值更新时触发 | undefined &#124; (value: RadioValue) => any |
109
+ | change | 值变化时触发 | undefined &#124; (value: RadioValue, ev: Event) => any |
110
+
111
+ ### Slots
112
+
113
+ | 名称 | 用途 | 公开类型 |
114
+ | --- | --- | --- |
115
+ | default | 自定义单选框列表 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
116
+ | label | 自定义 options 文案 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
117
+ | radio | 自定义单选框图形 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
118
+
119
+ ### 实例方法
120
+
121
+ 没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
122
+
123
+ ### 关联类型定义
124
+
125
+ 以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
126
+
127
+ ```typescript-reference
128
+ type RadioValue = string | number | boolean;
129
+
130
+ interface RadioOption {
131
+ /**
132
+ * @zh 文案
133
+ * @en label content
134
+ */
135
+ label?: RenderContent;
136
+ /**
137
+ * @zh 选项的 `value`
138
+ * @en The `value` of the option
139
+ */
140
+ value: RadioValue;
141
+ /**
142
+ * @zh 是否禁用
143
+ * @en Whether to disable
144
+ */
145
+ disabled?: boolean;
146
+ }
147
+
148
+ declare const RADIO_TYPES: readonly ["radio", "button"];
149
+
150
+ type RadioType = (typeof RADIO_TYPES)[number];
151
+
152
+ interface RadioGroupContext {
153
+ name: 'XRadioGroup';
154
+ value: RadioValue;
155
+ size: Size;
156
+ type: RadioType;
157
+ disabled: boolean;
158
+ inputName?: string;
159
+ slots: Slots;
160
+ handleChange: (value: RadioValue, e: Event) => void;
161
+ }
162
+ ```
163
+
164
+
165
+ 返回 [Radio 用法](./radio.md)。
@@ -1,12 +1,14 @@
1
1
  <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
2
  # Radio AI 使用
3
3
 
4
- 适用版本:x-next@1.12.0;来源指纹:`9f9adf42b42dc1e551f500aabdcb7fb07b69a93ea44ff3dc1d16dab1a4c85843`。
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
5
 
6
- 先读 [通用接入](../core.md)。公开导出:`Radio`;模型:v-model;已核对事件:change。
6
+ 先读 [通用接入](../core.md)。公开导出:`Radio, RadioGroup`;主要模型:v-model。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./radio-api.md),包含本组件族全部子组件和别名。
7
7
 
8
8
  按需样式:`x-next/style/form-radio`(包含 base.css、form-radio.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
9
 
10
+ ## 已核验行为与示例
11
+
10
12
  [组件文档与 live demo](https://x-next.yjmf.com/components/radio)。`Radio` / `RadioGroup` 的模型和选项值支持 `string | number | boolean`,保留值类型;布尔选项写 `:value="true"`。单个 Radio 的 `value` 默认 `true`,组的非受控默认值为 `''`。
11
13
 
12
14
  组默认 `type='radio'`、`direction='horizontal'`、`disabled=false`;`change(value, event)` 返回选项值和 `Event`。Radio 默认插槽是文案,组也支持 `options` 和 `label` / `radio` 插槽。
@@ -32,4 +34,258 @@ function changed(value: string | number | boolean, _event: Event) {
32
34
  </template>
33
35
  ```
34
36
 
35
- 返回 [AI 索引](../index.md)。精选示例不是完整 API 表,新能力先查同版本公开类型与组件文档。
37
+ ## 场景用法
38
+
39
+ 以下示例从本地 `src/docs/components/radio.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./radio-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
40
+
41
+ ### 用途与选型
42
+
43
+ 用于在一组互斥选项中选择一个结果,适合状态切换、筛选条件、配置项选择。
44
+
45
+
46
+ ### 何时使用
47
+
48
+ - 多个选项互斥,且用户必须或通常只选择一个。
49
+ - 选项数量较少,需要直接展示全部选项。
50
+ - 需要用按钮样式表达更强的分段控制感。
51
+
52
+
53
+ ### 基础用法
54
+
55
+ ```vue
56
+ <script setup lang="ts">
57
+ import 'x-next/style.css';
58
+ import { RadioGroup, Radio } from 'x-next';
59
+ import { ref } from 'vue';
60
+
61
+ const value = ref('a');
62
+ </script>
63
+ <template>
64
+ <RadioGroup v-model="value" name="basic-radio">
65
+ <Radio value="a">选项 A</Radio>
66
+ <Radio value="b">选项 B</Radio>
67
+ </RadioGroup>
68
+ </template>
69
+ ```
70
+
71
+ ### 选项配置
72
+
73
+ ```vue
74
+ <script setup lang="ts">
75
+ import 'x-next/style.css';
76
+ import { RadioGroup } from 'x-next';
77
+ import { ref } from 'vue';
78
+
79
+ const value = ref('day');
80
+ const options = [
81
+ { label: '今日', value: 'day' },
82
+ { label: '本周', value: 'week' },
83
+ { label: '本月', value: 'month' },
84
+ ];
85
+ </script>
86
+ <template>
87
+ <RadioGroup v-model="value" :options="options" name="time-radio" />
88
+ </template>
89
+ ```
90
+
91
+ ### 禁用状态
92
+
93
+ ```vue
94
+ <script setup lang="ts">
95
+ import 'x-next/style.css';
96
+ import { RadioGroup } from 'x-next';
97
+ import { ref } from 'vue';
98
+
99
+ const value = ref('enabled');
100
+ const options = [
101
+ { label: '启用', value: 'enabled' },
102
+ { label: '禁用项', value: 'disabled', disabled: true },
103
+ { label: '归档', value: 'archived' },
104
+ ];
105
+ </script>
106
+ <template>
107
+ <RadioGroup v-model="value" :options="options" />
108
+ <RadioGroup v-model="value" :options="options" disabled />
109
+ </template>
110
+ ```
111
+
112
+ ### 按钮样式
113
+
114
+ ```vue
115
+ <script setup lang="ts">
116
+ import 'x-next/style.css';
117
+ import { RadioGroup } from 'x-next';
118
+ import { ref } from 'vue';
119
+ const value = ref('design');
120
+ const options = [{ label: '设计', value: 'design' }, { label: '开发', value: 'dev' }, { label: '测试', value: 'test' }];
121
+ </script>
122
+ <template>
123
+ <RadioGroup v-model="value" type="button" :options="options" />
124
+ </template>
125
+ ```
126
+
127
+ ### 尺寸
128
+
129
+ ```vue
130
+ <script setup lang="ts">
131
+ import 'x-next/style.css';
132
+ import { RadioGroup } from 'x-next';
133
+ import { ref } from 'vue';
134
+ const value = ref('design');
135
+ const options = [{ label: '设计', value: 'design' }, { label: '开发', value: 'dev' }, { label: '测试', value: 'test' }];
136
+ </script>
137
+ <template>
138
+ <RadioGroup v-model="value" type="button" size="mini" :options="options" />
139
+ <RadioGroup v-model="value" type="button" size="small" :options="options" />
140
+ <RadioGroup v-model="value" type="button" size="medium" :options="options" />
141
+ <RadioGroup v-model="value" type="button" size="large" :options="options" />
142
+ </template>
143
+ ```
144
+
145
+ ### 纵向排列
146
+
147
+ ```vue
148
+ <script setup lang="ts">
149
+ import 'x-next/style.css';
150
+ import { RadioGroup } from 'x-next';
151
+ import { ref } from 'vue';
152
+ const value = ref('design');
153
+ const options = [{ label: '设计', value: 'design' }, { label: '开发', value: 'dev' }, { label: '测试', value: 'test' }];
154
+ </script>
155
+ <template>
156
+ <RadioGroup v-model="value" direction="vertical" :options="options" />
157
+ </template>
158
+ ```
159
+
160
+ ### 自定义文案
161
+
162
+ ```vue
163
+ <script setup lang="ts">
164
+ import 'x-next/style.css';
165
+ import { RadioGroup } from 'x-next';
166
+ import { ref } from 'vue';
167
+ const value = ref('design');
168
+ const options = [{ label: '设计', value: 'design' }, { label: '开发', value: 'dev' }, { label: '测试', value: 'test' }];
169
+ </script>
170
+ <template>
171
+ <RadioGroup v-model="value" :options="options">
172
+ <template #label="{ data }">
173
+ <span>{{ data.label }}角色</span>
174
+ </template>
175
+ </RadioGroup>
176
+ </template>
177
+ ```
178
+
179
+ ### 自定义单选框图形
180
+
181
+ ```vue
182
+ <script setup lang="ts">
183
+ import 'x-next/style.css';
184
+ import { RadioGroup } from 'x-next';
185
+ import { ref } from 'vue';
186
+ const value = ref('design');
187
+ const options = [{ label: '设计', value: 'design' }, { label: '开发', value: 'dev' }, { label: '测试', value: 'test' }];
188
+ </script>
189
+ <template>
190
+ <RadioGroup v-model="value" :options="options">
191
+ <template #radio="{ checked, disabled }">
192
+ <span :class="{ 'is-checked': checked, 'is-disabled': disabled }" />
193
+ </template>
194
+ </RadioGroup>
195
+ </template>
196
+ ```
197
+
198
+ ### 布尔值选项
199
+
200
+ ```vue
201
+ <script setup lang="ts">
202
+ import 'x-next/style.css';
203
+ import { RadioGroup } from 'x-next';
204
+ import { ref } from 'vue';
205
+
206
+ const value = ref(true);
207
+ const options = [
208
+ { label: '启用', value: true },
209
+ { label: '停用', value: false },
210
+ ];
211
+ </script>
212
+ <template>
213
+ <RadioGroup v-model="value" :options="options" />
214
+ </template>
215
+ ```
216
+
217
+ ### 事件
218
+
219
+ ```vue
220
+ <script setup lang="ts">
221
+ import 'x-next/style.css';
222
+ import { RadioGroup } from 'x-next';
223
+ const eventOptions = [
224
+ { label: '读取', value: 'read' },
225
+ { label: '写入', value: 'write' },
226
+ { label: '发布', value: 'publish' },
227
+ ];
228
+
229
+ import { ref } from 'vue';
230
+
231
+ const value = ref('read');
232
+ const handleChange = (value: string | number | boolean) => {
233
+ console.log(value);
234
+ };
235
+ const options = eventOptions;
236
+ </script>
237
+ <template>
238
+ <RadioGroup v-model="value" :options="options" @change="handleChange" />
239
+ </template>
240
+ ```
241
+
242
+ ### 在 Form 中校验
243
+
244
+ 组件放进 `x-form-item` 后会自动继承 Form 的尺寸与禁用状态,并按 FormItem 的校验规则展示错误。默认 `validateTrigger` 为 `change`,即值变化时触发校验。
245
+
246
+ ```vue
247
+ <script setup lang="ts">
248
+ import 'x-next/style.css';
249
+ import { Form, FormItem, RadioGroup, Radio, Space, Button } from 'x-next';
250
+ import { reactive, ref } from 'vue';
251
+ import type { FormInstance, FieldRule } from 'x-next';
252
+
253
+ const formState = reactive({ plan: undefined as string | undefined });
254
+ const formRules: Record<string, FieldRule[]> = {
255
+ plan: [{ required: true, message: '请选择套餐' }],
256
+ };
257
+ const formRef = ref<FormInstance>();
258
+ const validateResult = ref('');
259
+
260
+ const handleValidate = async () => {
261
+ const errors = await formRef.value!.validate();
262
+ validateResult.value = errors
263
+ ? `校验失败:${Object.values(errors).map((error) => error.message).join(';')}`
264
+ : '校验通过';
265
+ };
266
+ const handleReset = () => {
267
+ formRef.value!.resetFields();
268
+ validateResult.value = '已重置';
269
+ };
270
+ </script>
271
+ <template>
272
+ <Form ref="formRef" :model="formState" :rules="formRules">
273
+ <FormItem field="plan" label="套餐">
274
+ <RadioGroup v-model="formState.plan">
275
+ <Radio value="basic">基础版</Radio>
276
+ <Radio value="pro">专业版</Radio>
277
+ </RadioGroup>
278
+ </FormItem>
279
+ <FormItem>
280
+ <Space>
281
+ <Button type="primary" @click="handleValidate">校验</Button>
282
+ <Button @click="handleReset">重置</Button>
283
+ </Space>
284
+ </FormItem>
285
+ </Form>
286
+ <p role="status">{{ validateResult }}</p>
287
+ </template>
288
+ ```
289
+
290
+
291
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./radio-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
@@ -0,0 +1,54 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Rate 完整公开 API
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
7
+
8
+ ## Rate API
9
+
10
+ 公开声明:`dist/components/rate/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
11
+
12
+ ### Props
13
+
14
+ | 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
15
+ | --- | --- | --- | --- | --- |
16
+ | count | 评分总数,grading 开启时固定为 5 | undefined &#124; number | 否 | 5 |
17
+ | modelValue | 绑定值 | undefined &#124; number | 否 | undefined |
18
+ | defaultValue | 默认值,非受控模式 | undefined &#124; number | 否 | 0 |
19
+ | allowHalf | 是否允许半选 | undefined &#124; false &#124; true | 否 | false |
20
+ | allowClear | 是否允许再次点击清除 | undefined &#124; false &#124; true | 否 | false |
21
+ | grading | 是否开启笑脸分级 | undefined &#124; false &#124; true | 否 | false |
22
+ | readonly | 是否只读 | undefined &#124; false &#124; true | 否 | false |
23
+ | disabled | 是否禁用 | undefined &#124; false &#124; true | 否 | false |
24
+ | autofocus | 是否自动获取焦点 | undefined &#124; false &#124; true | 否 | false |
25
+ | tabindex | 根节点 tabindex | undefined &#124; string &#124; number | 否 | 0 |
26
+ | tooltips | 每项提示文本 | undefined &#124; string[] | 否 | 未声明 |
27
+ | color | 评分颜色,支持统一颜色或分段阈值颜色 | undefined &#124; string &#124; { [x: number]: string; } | 否 | 未声明 |
28
+
29
+ ### Events
30
+
31
+ | 事件 | 用途 | 监听器签名(即事件参数) |
32
+ | --- | --- | --- |
33
+ | update:modelValue | 绑定值更新时触发 | undefined &#124; (value: number) => any |
34
+ | change | 评分改变时触发 | undefined &#124; (value: number) => any |
35
+ | hoverChange | 鼠标移入评分项或移出组件时触发 | undefined &#124; (value: number &#124; undefined) => any |
36
+ | focus | 组件获得焦点时触发 | undefined &#124; (ev: FocusEvent) => any |
37
+ | blur | 组件失去焦点时触发 | undefined &#124; (ev: FocusEvent) => any |
38
+ | keydown | 键盘按下时触发 | undefined &#124; (ev: KeyboardEvent) => any |
39
+
40
+ ### Slots
41
+
42
+ | 名称 | 用途 | 公开类型 |
43
+ | --- | --- | --- |
44
+ | character | 自定义评分符号 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
45
+
46
+ ### 实例方法 / 暴露值
47
+
48
+ | 名称 | 公开类型 |
49
+ | --- | --- |
50
+ | focus | 公开声明未细化(用法和实现已显式暴露) |
51
+ | blur | 公开声明未细化(用法和实现已显式暴露) |
52
+
53
+
54
+ 返回 [Rate 用法](./rate.md)。