x-next 1.13.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 (138) 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 +380 -3
  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 +33651 -5
  124. package/CHANGELOG.md +18 -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/es/_utils/inherit-component-type.js +6 -0
  131. package/dist/es/components/date-picker/index.js +18 -17
  132. package/dist/es/components/form-input/index.js +12 -11
  133. package/dist/es/components/layout/index.js +10 -9
  134. package/dist/es/components/menu/hooks/use-level.js +5 -5
  135. package/dist/es/components/menu/index.js +13 -10
  136. package/dist/index.cjs +3 -3
  137. package/dist/index.umd.js +3 -3
  138. package/package.json +10 -5
@@ -0,0 +1,197 @@
1
+ <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
+ # Link AI 使用
3
+
4
+ 适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
5
+
6
+ 先读 [通用接入](../core.md)。公开导出:`Link`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./link-api.md),包含本组件族全部子组件和别名。
7
+
8
+ 按需样式:`x-next/style/link`(包含 base.css、link.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
9
+
10
+ ## 场景用法
11
+
12
+ 以下示例从本地 `src/docs/components/link.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./link-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
13
+
14
+ ### 用途与选型
15
+
16
+ 用于页面跳转或轻量动作,适合在正文、列表和操作区中承载低重量入口。
17
+
18
+
19
+ ### 何时使用
20
+
21
+ - 在正文、详情页或表格操作区放置低强调的跳转入口。
22
+ - 用状态色表达成功、警告、危险等轻量动作。
23
+ - 需要在链接前展示默认图标、业务图标或加载反馈。
24
+
25
+
26
+ ### 基础用法
27
+
28
+ ```vue
29
+ <script setup lang="ts">
30
+ import 'x-next/style.css';
31
+ import { Link } from 'x-next';
32
+
33
+ </script>
34
+ <template>
35
+ <Link href="https://example.com">文本链接</Link>
36
+ <Link href="https://example.com/docs" strong>强调链接</Link>
37
+ <Link disabled>禁用链接</Link>
38
+ </template>
39
+ ```
40
+
41
+ ### 链接状态
42
+
43
+ `status` 与品牌状态族一一对应:`normal` 即主色,另有 `success`、`warning`、`strong`、`danger`。
44
+
45
+ > 注意区分两个 `strong`:`status="strong"` 是**颜色**(品牌强调色),无值的 `strong` 属性是**字重加粗**(见上方示例)。
46
+
47
+ ```vue
48
+ <script setup lang="ts">
49
+ import 'x-next/style.css';
50
+ import { Link } from 'x-next';
51
+
52
+ </script>
53
+ <template>
54
+ <Link href="https://example.com">普通链接</Link>
55
+ <Link status="success" href="https://example.com">成功链接</Link>
56
+ <Link status="warning" href="https://example.com">警告链接</Link>
57
+ <Link status="strong" href="https://example.com">强调链接</Link>
58
+ <Link status="danger" href="https://example.com">危险链接</Link>
59
+ </template>
60
+ ```
61
+
62
+ ### 悬浮底色
63
+
64
+ ```vue
65
+ <script setup lang="ts">
66
+ import 'x-next/style.css';
67
+ import { Link } from 'x-next';
68
+
69
+ </script>
70
+ <template>
71
+ <Link href="https://example.com">默认悬浮底色</Link>
72
+ <Link href="https://example.com" :hoverable="false">无悬浮底色</Link>
73
+ <Link status="danger" href="https://example.com" :hoverable="false">危险无底色</Link>
74
+ </template>
75
+ ```
76
+
77
+ ### 图标与插槽
78
+
79
+ ```vue
80
+ <script setup lang="ts">
81
+ import 'x-next/style.css';
82
+ import { Link } from 'x-next';
83
+
84
+ </script>
85
+ <template>
86
+ <Link icon href="https://example.com">默认图标</Link>
87
+ <Link href="https://example.com">
88
+ <template #icon>
89
+ <span aria-hidden="true">#</span>
90
+ </template>
91
+ 自定义图标
92
+ </Link>
93
+ <Link icon disabled>禁用图标</Link>
94
+ </template>
95
+ ```
96
+
97
+ ### 加载与事件
98
+
99
+ 没有传入 `href` 时,Link 会作为轻量动作入口处理,可通过键盘聚焦并使用 Enter 或 Space 触发点击事件。
100
+
101
+ ```vue
102
+ <script setup lang="ts">
103
+ import 'x-next/style.css';
104
+ import { Link } from 'x-next';
105
+ import { ref } from 'vue';
106
+
107
+ const loading = ref(false);
108
+ const logs = ref<string[]>([]);
109
+
110
+ const runLoading = () => {
111
+ loading.value = true;
112
+ logs.value = ['loading link clicked', ...logs.value];
113
+ window.setTimeout(() => {
114
+ loading.value = false;
115
+ }, 1600);
116
+ };
117
+
118
+ const pushLog = (label: string) => {
119
+ logs.value = [`${label} clicked`, ...logs.value];
120
+ };
121
+ </script>
122
+ <template>
123
+ <Link :loading="loading" @click="runLoading">异步加载</Link>
124
+ <Link @click="pushLog('normal')">点击计数</Link>
125
+ <Link disabled @click="pushLog('disabled')">禁用不触发</Link>
126
+ </template>
127
+ ```
128
+
129
+ ### 原生链接属性
130
+
131
+ `target`、`rel`、`download`、`aria-*`、`id`、`class`、`style` 等原生 `<a>` 属性会透传到根节点。使用 `target="_blank"` 时建议同时设置 `rel="noopener noreferrer"`。
132
+
133
+ ```vue
134
+ <script setup lang="ts">
135
+ import 'x-next/style.css';
136
+ import { Link } from 'x-next';
137
+
138
+ import type { AnchorHTMLAttributes } from 'vue';
139
+ const nativeAttrs1 = { "target": "_blank", "rel": "noopener noreferrer", "aria-label": "在新窗口打开示例站点" } satisfies AnchorHTMLAttributes;
140
+ const nativeAttrs2 = { "download": true } satisfies AnchorHTMLAttributes;
141
+ </script>
142
+ <template>
143
+ <Link v-bind="nativeAttrs1"
144
+ href="https://example.com"
145
+
146
+
147
+
148
+ >
149
+ 新窗口外链
150
+ </Link>
151
+ <Link v-bind="nativeAttrs2" href="/files/report.pdf" >下载链接</Link>
152
+ </template>
153
+ ```
154
+
155
+ ### 亮暗颜色与交互状态
156
+
157
+ 文字使用独立的状态文字色;悬浮与按下只改变可用链接的背景。`hoverable=false`、禁用和加载态保持透明背景。用 Tab 聚焦动作链接,再用 Enter 或 Space 观察计数和焦点轮廓。
158
+
159
+ 页面本身为暗色时,请先切回亮色观察局部对照;`dark=false` 不会重置暗色祖先。任意品牌色仍需重新检查对比度。可通过 `--x-link-color-text`、`--x-link-color-text-success/warning/danger` 分别覆盖文字,通过既有 `--x-link-*-background-color` 覆盖悬浮背景。
160
+
161
+ ```vue
162
+ <script setup lang="ts">
163
+ const loading = ref(false);
164
+
165
+ import { ref } from 'vue';
166
+ import { Button as XButton, ConfigProvider as XConfigProvider, Link as XLink, Switch as XSwitch } from 'x-next';
167
+ import 'x-next/style.css';
168
+
169
+ const dark = ref(false);
170
+ const brand = ref('#1c61ff');
171
+ const statuses = ['normal', 'success', 'warning', 'danger'] as const;
172
+ const clicks = ref(0);
173
+ </script>
174
+ <template>
175
+ <label><XSwitch v-model="dark" />切换链接暗色</label>
176
+ <XButton @click="brand = brand === '#1c61ff' ? '#0f766e' : '#1c61ff'">切换品牌色</XButton>
177
+ <XConfigProvider :dark="dark" :theme-color="brand" class="color-scope">
178
+ <div v-for="status in statuses" :key="status">
179
+ <XLink :status="status" @click="clicks++">{{ status }}</XLink>
180
+ <XLink :status="status" :hoverable="false" @click="clicks++">无底色</XLink>
181
+ <XLink :status="status" loading @click="clicks++">加载中</XLink>
182
+ <XLink :status="status" disabled @click="clicks++">禁用</XLink>
183
+ </div>
184
+ <p aria-live="polite">点击:{{ clicks }}</p>
185
+ </XConfigProvider>
186
+ </template>
187
+ <style scoped>
188
+ .color-scope {
189
+ padding: 16px;
190
+ color: var(--x-color-text-primary);
191
+ background: var(--x-color-bg-surface);
192
+ }
193
+ </style>
194
+ ```
195
+
196
+
197
+ 返回 [AI 索引](../index.md)。先查本页与 [本地 API](./link-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。