x-next 1.13.0 → 1.15.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.
- package/AI_CODING.md +6 -5
- package/AI_USAGE/catalog.md +108 -105
- package/AI_USAGE/components/alert-api.md +48 -0
- package/AI_USAGE/components/alert.md +222 -3
- package/AI_USAGE/components/bar-chart-api.md +177 -0
- package/AI_USAGE/components/bar-chart.md +297 -3
- package/AI_USAGE/components/boxicons.md +147 -0
- package/AI_USAGE/components/button-api.md +144 -0
- package/AI_USAGE/components/button.md +447 -3
- package/AI_USAGE/components/charts.md +81 -0
- package/AI_USAGE/components/checkbox-api.md +145 -0
- package/AI_USAGE/components/checkbox.md +365 -3
- package/AI_USAGE/components/color-picker-api.md +52 -0
- package/AI_USAGE/components/color-picker.md +211 -3
- package/AI_USAGE/components/config-provider-api.md +38 -0
- package/AI_USAGE/components/config-provider.md +250 -3
- package/AI_USAGE/components/date-picker-api.md +1114 -0
- package/AI_USAGE/components/date-picker.md +378 -3
- package/AI_USAGE/components/dialog-api.md +142 -0
- package/AI_USAGE/components/dialog.md +284 -3
- package/AI_USAGE/components/draggable-api.md +146 -0
- package/AI_USAGE/components/draggable.md +259 -0
- package/AI_USAGE/components/drawer-api.md +78 -0
- package/AI_USAGE/components/drawer.md +256 -0
- package/AI_USAGE/components/dropdown-api.md +529 -0
- package/AI_USAGE/components/dropdown.md +392 -3
- package/AI_USAGE/components/empty-api.md +36 -0
- package/AI_USAGE/components/empty.md +227 -3
- package/AI_USAGE/components/finicon.md +88 -0
- package/AI_USAGE/components/form-api.md +524 -0
- package/AI_USAGE/components/form.md +454 -0
- package/AI_USAGE/components/grid-api.md +527 -0
- package/AI_USAGE/components/grid.md +224 -0
- package/AI_USAGE/components/heatmap-api.md +122 -0
- package/AI_USAGE/components/heatmap.md +220 -0
- package/AI_USAGE/components/icon-api.md +4707 -0
- package/AI_USAGE/components/icon.md +257 -0
- package/AI_USAGE/components/image-api.md +440 -0
- package/AI_USAGE/components/image.md +465 -0
- package/AI_USAGE/components/input-api.md +184 -0
- package/AI_USAGE/components/input-number-api.md +66 -0
- package/AI_USAGE/components/input-number.md +294 -0
- package/AI_USAGE/components/input-tag-api.md +114 -0
- package/AI_USAGE/components/input-tag.md +482 -0
- package/AI_USAGE/components/input.md +293 -3
- package/AI_USAGE/components/layout-api.md +147 -0
- package/AI_USAGE/components/layout.md +230 -0
- package/AI_USAGE/components/line-chart-api.md +197 -0
- package/AI_USAGE/components/line-chart.md +306 -3
- package/AI_USAGE/components/link-api.md +42 -0
- package/AI_USAGE/components/link.md +197 -0
- package/AI_USAGE/components/menu-api.md +516 -0
- package/AI_USAGE/components/menu.md +268 -0
- package/AI_USAGE/components/message-api.md +215 -0
- package/AI_USAGE/components/message-box-api.md +108 -0
- package/AI_USAGE/components/message-box.md +268 -3
- package/AI_USAGE/components/message.md +231 -3
- package/AI_USAGE/components/network-api.md +91 -0
- package/AI_USAGE/components/network.md +378 -0
- package/AI_USAGE/components/notification-api.md +236 -0
- package/AI_USAGE/components/notification.md +275 -3
- package/AI_USAGE/components/pagination-api.md +62 -0
- package/AI_USAGE/components/pagination.md +380 -3
- package/AI_USAGE/components/pie-chart-api.md +109 -0
- package/AI_USAGE/components/pie-chart.md +245 -3
- package/AI_USAGE/components/popconfirm-api.md +75 -0
- package/AI_USAGE/components/popconfirm.md +231 -3
- package/AI_USAGE/components/popover-api.md +75 -0
- package/AI_USAGE/components/popover.md +208 -3
- package/AI_USAGE/components/popup-api.md +75 -0
- package/AI_USAGE/components/popup.md +52 -0
- package/AI_USAGE/components/progress-api.md +44 -0
- package/AI_USAGE/components/progress.md +248 -3
- package/AI_USAGE/components/radio-api.md +165 -0
- package/AI_USAGE/components/radio.md +259 -3
- package/AI_USAGE/components/rate-api.md +54 -0
- package/AI_USAGE/components/rate.md +233 -3
- package/AI_USAGE/components/resize-box-api.md +56 -0
- package/AI_USAGE/components/resize-box.md +231 -0
- package/AI_USAGE/components/scrollbar-api.md +77 -0
- package/AI_USAGE/components/scrollbar.md +218 -0
- package/AI_USAGE/components/select-api.md +758 -0
- package/AI_USAGE/components/select.md +640 -3
- package/AI_USAGE/components/skeleton-api.md +85 -0
- package/AI_USAGE/components/skeleton.md +150 -0
- package/AI_USAGE/components/slider-api.md +51 -0
- package/AI_USAGE/components/slider.md +233 -3
- package/AI_USAGE/components/space-api.md +38 -0
- package/AI_USAGE/components/space.md +145 -0
- package/AI_USAGE/components/spin-api.md +43 -0
- package/AI_USAGE/components/spin.md +205 -0
- package/AI_USAGE/components/steps-api.md +111 -0
- package/AI_USAGE/components/steps.md +201 -3
- package/AI_USAGE/components/switch-api.md +58 -0
- package/AI_USAGE/components/switch.md +290 -3
- package/AI_USAGE/components/table-api.md +2919 -0
- package/AI_USAGE/components/table.md +1457 -0
- package/AI_USAGE/components/tabs-api.md +135 -0
- package/AI_USAGE/components/tabs.md +308 -3
- package/AI_USAGE/components/tag-api.md +124 -0
- package/AI_USAGE/components/tag.md +292 -0
- package/AI_USAGE/components/textarea-api.md +55 -0
- package/AI_USAGE/components/textarea.md +326 -3
- package/AI_USAGE/components/time-picker-api.md +137 -0
- package/AI_USAGE/components/time-picker.md +271 -3
- package/AI_USAGE/components/time-range-selector-api.md +44 -0
- package/AI_USAGE/components/time-range-selector.md +355 -0
- package/AI_USAGE/components/timeline-api.md +93 -0
- package/AI_USAGE/components/timeline.md +312 -0
- package/AI_USAGE/components/tooltip-api.md +77 -0
- package/AI_USAGE/components/tooltip.md +182 -0
- package/AI_USAGE/components/tree-select-api.md +498 -0
- package/AI_USAGE/components/tree-select.md +744 -0
- package/AI_USAGE/components/trend-chart-api.md +119 -0
- package/AI_USAGE/components/trend-chart.md +335 -0
- package/AI_USAGE/components/trigger-api.md +124 -0
- package/AI_USAGE/components/trigger.md +185 -0
- package/AI_USAGE/components/upload-api.md +200 -0
- package/AI_USAGE/components/upload.md +711 -3
- package/AI_USAGE/components/watermark-api.md +87 -0
- package/AI_USAGE/components/watermark.md +200 -0
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +36 -7
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +34972 -5
- package/CHANGELOG.md +39 -0
- package/dist/_props/css.d.ts +2 -1
- package/dist/_utils/inherit-component-type.d.ts +11 -0
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +420 -5
- package/dist/components/form-input/index.d.ts +617 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts +689 -1
- package/dist/components/line-chart/LineChart.d.ts +1 -1
- package/dist/components/line-chart/index.d.ts +3 -3
- package/dist/components/line-chart/interface.d.ts +2 -2
- package/dist/components/menu/index.d.ts +786 -1
- package/dist/components/tree-select/TreeNode.vue.d.ts +478 -0
- package/dist/components/tree-select/TreeSelect.d.ts +1549 -0
- package/dist/components/tree-select/TreeSelectDropdown.vue.d.ts +569 -0
- package/dist/components/tree-select/hooks/use-tree-select.d.ts +92 -0
- package/dist/components/tree-select/index.d.ts +3321 -0
- package/dist/components/tree-select/interface.d.ts +203 -0
- package/dist/components/tree-select/utils.d.ts +64 -0
- package/dist/es/_styles/palette-aliases.js +3 -0
- package/dist/es/_utils/inherit-component-type.js +6 -0
- package/dist/es/components/_components/feedback-icon/index.vue2.js +10 -10
- package/dist/es/components/button/Button.js +9 -9
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/drawer/src/Drawer.vue.js +6 -6
- package/dist/es/components/form-input/index.js +12 -11
- package/dist/es/components/form-switch/Switch.vue2.js +18 -18
- package/dist/es/components/image/Image.vue2.js +13 -13
- package/dist/es/components/image/ImagePreview.vue2.js +33 -33
- package/dist/es/components/index.js +55 -52
- package/dist/es/components/layout/index.js +10 -9
- package/dist/es/components/link/Link.vue2.js +12 -12
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- package/dist/es/components/message/message.vue2.js +13 -13
- package/dist/es/components/spin/Spin.js +28 -28
- package/dist/es/components/tag/Tag.vue2.js +22 -22
- package/dist/es/components/timeline/src/Timeline.js +7 -7
- package/dist/es/components/tree-select/TreeNode.vue.js +91 -0
- package/dist/es/components/tree-select/TreeNode.vue2.js +162 -0
- package/dist/es/components/tree-select/TreeSelect.js +865 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue.js +57 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue2.js +79 -0
- package/dist/es/components/tree-select/hooks/use-tree-select.js +376 -0
- package/dist/es/components/tree-select/index.js +13 -0
- package/dist/es/components/tree-select/utils.js +181 -0
- package/dist/es/icons/animation/animation-loading.js +2 -2
- package/dist/es/index.js +71 -68
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/base.css +1 -1
- package/dist/style/dependencies.json +10 -0
- package/dist/style/drawer.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/tree-select.css +1 -0
- package/dist/style/tree-select.js +8 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +11 -5
- package/volar.d.ts +2 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Skeleton 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.15.0;来源指纹:`47ea153587c8d0b3bf318977b10bde9f8dd4acff90c5818541ba6513252ad362`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Skeleton API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/skeleton/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| loading | 是否展示骨架屏 | undefined | false | true | 否 | true |
|
|
17
|
+
| animation | 是否开启动画 | undefined | false | true | 否 | false |
|
|
18
|
+
|
|
19
|
+
### Events
|
|
20
|
+
|
|
21
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
| 名称 | 用途 | 公开类型 |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| default | 加载中展示的骨架内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
28
|
+
| content | 加载完成后展示的真实内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
29
|
+
|
|
30
|
+
### 实例方法
|
|
31
|
+
|
|
32
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## SkeletonLine API
|
|
36
|
+
|
|
37
|
+
公开声明:`dist/components/skeleton/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
38
|
+
|
|
39
|
+
### Props
|
|
40
|
+
|
|
41
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
42
|
+
| --- | --- | --- | --- | --- |
|
|
43
|
+
| rows | 行数 | undefined | number | 否 | 1 |
|
|
44
|
+
| widths | 每一行宽度 | undefined | (string | number)[] | 否 | [] |
|
|
45
|
+
| lineHeight | 行高 | undefined | number | 否 | 20 |
|
|
46
|
+
| lineSpacing | 行间距 | undefined | number | 否 | 15 |
|
|
47
|
+
|
|
48
|
+
### Events
|
|
49
|
+
|
|
50
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
51
|
+
|
|
52
|
+
### Slots
|
|
53
|
+
|
|
54
|
+
公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
|
|
55
|
+
|
|
56
|
+
### 实例方法
|
|
57
|
+
|
|
58
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## SkeletonShape API
|
|
62
|
+
|
|
63
|
+
公开声明:`dist/components/skeleton/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
64
|
+
|
|
65
|
+
### Props
|
|
66
|
+
|
|
67
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
68
|
+
| --- | --- | --- | --- | --- |
|
|
69
|
+
| shape | 图形形状 | undefined | "circle" | "square" | 否 | "square" |
|
|
70
|
+
| size | 图形尺寸 | undefined | "small" | "medium" | "large" | 否 | "medium" |
|
|
71
|
+
|
|
72
|
+
### Events
|
|
73
|
+
|
|
74
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
75
|
+
|
|
76
|
+
### Slots
|
|
77
|
+
|
|
78
|
+
公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
|
|
79
|
+
|
|
80
|
+
### 实例方法
|
|
81
|
+
|
|
82
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
返回 [Skeleton 用法](./skeleton.md)。
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Skeleton AI 使用
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.15.0;来源指纹:`47ea153587c8d0b3bf318977b10bde9f8dd4acff90c5818541ba6513252ad362`。
|
|
5
|
+
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`Skeleton, SkeletonLine, SkeletonShape`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./skeleton-api.md),包含本组件族全部子组件和别名。
|
|
7
|
+
|
|
8
|
+
按需样式:`x-next/style/skeleton`(包含 base.css、skeleton.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
|
+
|
|
10
|
+
## 场景用法
|
|
11
|
+
|
|
12
|
+
以下示例从本地 `src/docs/components/skeleton.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./skeleton-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
13
|
+
|
|
14
|
+
### 用途与选型
|
|
15
|
+
|
|
16
|
+
用于数据加载前占位,降低页面空白感。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 何时使用
|
|
20
|
+
|
|
21
|
+
- 页面局部内容正在加载,需要保留版式位置。
|
|
22
|
+
- 图文列表、详情卡片或表单区域预计很快返回真实内容。
|
|
23
|
+
- 首屏加载需要比 Spin 更接近最终结构的反馈。
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### 基础用法
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import 'x-next/style.css';
|
|
31
|
+
import { Skeleton, Space, SkeletonShape, SkeletonLine } from 'x-next';
|
|
32
|
+
import { computed, ref } from 'vue';
|
|
33
|
+
const rows = ref(3);
|
|
34
|
+
</script>
|
|
35
|
+
<template>
|
|
36
|
+
<Skeleton>
|
|
37
|
+
<Space size="large">
|
|
38
|
+
<SkeletonShape />
|
|
39
|
+
<SkeletonLine :rows="3" :widths="['56%', '100%', '72%']" />
|
|
40
|
+
</Space>
|
|
41
|
+
</Skeleton>
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 加载完成
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import 'x-next/style.css';
|
|
50
|
+
import { Button, Skeleton, SkeletonLine } from 'x-next';
|
|
51
|
+
const animation = ref(true);
|
|
52
|
+
const rows = ref(3);
|
|
53
|
+
|
|
54
|
+
import { ref } from 'vue';
|
|
55
|
+
|
|
56
|
+
const loading = ref(true);
|
|
57
|
+
</script>
|
|
58
|
+
<template>
|
|
59
|
+
<Button @click="loading = !loading">切换加载状态</Button>
|
|
60
|
+
<Skeleton :loading="loading" animation>
|
|
61
|
+
<SkeletonLine :rows="3" />
|
|
62
|
+
<template #content>
|
|
63
|
+
<div>真实内容</div>
|
|
64
|
+
</template>
|
|
65
|
+
</Skeleton>
|
|
66
|
+
</template>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 动画
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<script setup lang="ts">
|
|
73
|
+
import 'x-next/style.css';
|
|
74
|
+
import { Switch, Skeleton, SkeletonLine } from 'x-next';
|
|
75
|
+
const rows = ref(3);
|
|
76
|
+
|
|
77
|
+
import { ref } from 'vue';
|
|
78
|
+
|
|
79
|
+
const animation = ref(true);
|
|
80
|
+
</script>
|
|
81
|
+
<template>
|
|
82
|
+
<Switch v-model="animation" checked-text="动画" unchecked-text="静态" />
|
|
83
|
+
<Skeleton :animation="animation">
|
|
84
|
+
<SkeletonLine :rows="4" />
|
|
85
|
+
</Skeleton>
|
|
86
|
+
</template>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 图形骨架
|
|
90
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<script setup lang="ts">
|
|
93
|
+
import 'x-next/style.css';
|
|
94
|
+
import { Skeleton, SkeletonShape } from 'x-next';
|
|
95
|
+
|
|
96
|
+
</script>
|
|
97
|
+
<template>
|
|
98
|
+
<Skeleton>
|
|
99
|
+
<div class="demo-inline-group">
|
|
100
|
+
<SkeletonShape size="small" />
|
|
101
|
+
<SkeletonShape />
|
|
102
|
+
<SkeletonShape size="large" />
|
|
103
|
+
<SkeletonShape shape="circle" size="small" />
|
|
104
|
+
<SkeletonShape shape="circle" />
|
|
105
|
+
<SkeletonShape shape="circle" size="large" />
|
|
106
|
+
</div>
|
|
107
|
+
</Skeleton>
|
|
108
|
+
</template>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 行数与宽度
|
|
112
|
+
|
|
113
|
+
```vue
|
|
114
|
+
<script setup lang="ts">
|
|
115
|
+
import 'x-next/style.css';
|
|
116
|
+
import { Skeleton, SkeletonLine } from 'x-next';
|
|
117
|
+
const animation = ref(true);
|
|
118
|
+
|
|
119
|
+
import { ref } from 'vue';
|
|
120
|
+
|
|
121
|
+
const rows = ref(3);
|
|
122
|
+
const widths = ref(['72%', '100%', 180]);
|
|
123
|
+
</script>
|
|
124
|
+
<template>
|
|
125
|
+
<Skeleton animation>
|
|
126
|
+
<SkeletonLine
|
|
127
|
+
:rows="rows"
|
|
128
|
+
:widths="widths"
|
|
129
|
+
:line-height="20"
|
|
130
|
+
:line-spacing="15"
|
|
131
|
+
/>
|
|
132
|
+
</Skeleton>
|
|
133
|
+
</template>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 无障碍
|
|
137
|
+
|
|
138
|
+
- `loading` 时根节点带 `aria-busy="true"`,屏幕阅读器据此知道该区域正在加载。
|
|
139
|
+
- `SkeletonLine` 与 `SkeletonShape` 是纯装饰占位,内部带 `aria-hidden="true"`,避免空列表项被读出来。
|
|
140
|
+
- 开启系统「减弱动态效果」后,`animation` 的流光动画自动停止;占位轮廓与渐变保持不变,加载区域不会消失。
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### 已知限制
|
|
144
|
+
|
|
145
|
+
- 当前保持 Arco 风格的 `SkeletonLine` / `SkeletonShape` 组合式 API,不提供 AntDV 风格的 `avatar`、`title`、`paragraph` 快捷 props。
|
|
146
|
+
- 只有「流光」一种动画形态,没有 AntDV 的 `fade` 变体。
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./skeleton-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Slider 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.15.0;来源指纹:`47ea153587c8d0b3bf318977b10bde9f8dd4acff90c5818541ba6513252ad362`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Slider API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/form-slider/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| modelValue | 绑定值 | undefined | number | number[] | [number, number] | 否 | undefined |
|
|
17
|
+
| defaultValue | 默认值,非受控模式 | undefined | number | [number, number] | 否 | 0 |
|
|
18
|
+
| step | 步长 | undefined | number | 否 | 1 |
|
|
19
|
+
| min | 最小值 | undefined | number | 否 | 0 |
|
|
20
|
+
| marks | 刻度标签 | undefined | { [x: number]: string; } | 否 | 未声明 |
|
|
21
|
+
| max | 最大值 | undefined | number | 否 | 100 |
|
|
22
|
+
| direction | 滑动方向 | undefined | "horizontal" | "vertical" | 否 | "horizontal" |
|
|
23
|
+
| disabled | 是否禁用 | undefined | false | true | 否 | false |
|
|
24
|
+
| size | 组件尺寸 | undefined | "mini" | "small" | "medium" | "large" | 否 | 未声明 |
|
|
25
|
+
| showTicks | 是否显示刻度线 | undefined | false | true | 否 | false |
|
|
26
|
+
| showInput | 是否显示输入框 | undefined | false | true | 否 | false |
|
|
27
|
+
| range | 是否开启范围选择 | undefined | false | true | 否 | false |
|
|
28
|
+
| formatTooltip | 格式化 tooltip 内容 | undefined | (value: string | number | undefined) => string | 否 | 未声明 |
|
|
29
|
+
| showTooltip | 是否显示 tooltip | undefined | false | true | 否 | true |
|
|
30
|
+
| tooltipPosition | tooltip 展示位置 | undefined | "top" | "bottom" | "right" | "left" | "tl" | "tr" | "bl" | "br" | "lt" | "rt" | "lb" | "rb" | 否 | 未声明 |
|
|
31
|
+
|
|
32
|
+
### Events
|
|
33
|
+
|
|
34
|
+
| 事件 | 用途 | 监听器签名(即事件参数) |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| update:modelValue | 值更新时触发 | undefined | (value: number | [number, number]) => any |
|
|
37
|
+
| change | 值变化时触发,拖动过程中会连续触发 | undefined | (value: number | [number, number]) => any |
|
|
38
|
+
| changeEnd | 点击、输入、键盘调整或拖拽结束后触发 | undefined | (value: number | [number, number]) => any |
|
|
39
|
+
| focus | 见场景用法与类型 | undefined | (ev: FocusEvent) => any |
|
|
40
|
+
| blur | 见场景用法与类型 | undefined | (ev: FocusEvent) => any |
|
|
41
|
+
|
|
42
|
+
### Slots
|
|
43
|
+
|
|
44
|
+
公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
|
|
45
|
+
|
|
46
|
+
### 实例方法
|
|
47
|
+
|
|
48
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
返回 [Slider 用法](./slider.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
|
# Slider AI 使用
|
|
3
3
|
|
|
4
|
-
适用版本:x-next@1.
|
|
4
|
+
适用版本:x-next@1.15.0;来源指纹:`47ea153587c8d0b3bf318977b10bde9f8dd4acff90c5818541ba6513252ad362`。
|
|
5
5
|
|
|
6
|
-
先读 [通用接入](../core.md)。公开导出:`Slider
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`Slider`;主要模型:v-model。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./slider-api.md),包含本组件族全部子组件和别名。
|
|
7
7
|
|
|
8
8
|
按需样式:`x-next/style/form-slider`(包含 base.css、button.css、form-input.css、form-input-number.css、form-slider.css、trigger.css、tooltip.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
9
|
|
|
10
|
+
## 已核验行为与示例
|
|
11
|
+
|
|
10
12
|
[组件文档与 live demo](https://x-next.yjmf.com/components/slider)。普通模型为 `number`,`range` 模式为 `[number, number]`。默认 `min=0`、`max=100`、`step=1`、`range=false`、`disabled=false`、`showTooltip=true`;范围端点按大小排序并按步长归一化。
|
|
11
13
|
|
|
12
14
|
`change(value)` 表示值变化,`change-end(value)` 表示一次拖拽、点击、键盘或输入提交结束,载荷均为 `number | [number, number]`。`marks` 是数值键到文字的映射,`formatTooltip` 可格式化提示。
|
|
@@ -31,4 +33,232 @@ function finish(value: number | [number, number]) {
|
|
|
31
33
|
</template>
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
## 场景用法
|
|
37
|
+
|
|
38
|
+
以下示例从本地 `src/docs/components/slider.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./slider-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
39
|
+
|
|
40
|
+
### 用途与选型
|
|
41
|
+
|
|
42
|
+
用于在连续区间内选择数值,适合音量、比例、进度等场景。
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### 基础用法
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import 'x-next/style.css';
|
|
50
|
+
import { Slider } from 'x-next';
|
|
51
|
+
import { ref } from 'vue';
|
|
52
|
+
|
|
53
|
+
const value = ref(30);
|
|
54
|
+
</script>
|
|
55
|
+
<template>
|
|
56
|
+
<Slider v-model="value" :min="0" :max="100" />
|
|
57
|
+
</template>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 禁用状态
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import 'x-next/style.css';
|
|
65
|
+
import { Slider } from 'x-next';
|
|
66
|
+
import { ref } from 'vue';
|
|
67
|
+
|
|
68
|
+
const value = ref(50);
|
|
69
|
+
</script>
|
|
70
|
+
<template>
|
|
71
|
+
<Slider v-model="value" disabled show-ticks :step="10" />
|
|
72
|
+
</template>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 步长和刻度
|
|
76
|
+
|
|
77
|
+
```vue
|
|
78
|
+
<script setup lang="ts">
|
|
79
|
+
import 'x-next/style.css';
|
|
80
|
+
import { Slider } from 'x-next';
|
|
81
|
+
import { ref } from 'vue';
|
|
82
|
+
|
|
83
|
+
const value = ref(20);
|
|
84
|
+
const marks = {
|
|
85
|
+
0: '0%',
|
|
86
|
+
50: '50%',
|
|
87
|
+
100: '100%',
|
|
88
|
+
};
|
|
89
|
+
</script>
|
|
90
|
+
<template>
|
|
91
|
+
<Slider v-model="value" :step="10" show-ticks :marks="marks" />
|
|
92
|
+
</template>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 尺寸
|
|
96
|
+
|
|
97
|
+
尺寸会影响轨道厚度、滑块直径与刻度文字字号。
|
|
98
|
+
|
|
99
|
+
```vue
|
|
100
|
+
<script setup lang="ts">
|
|
101
|
+
import 'x-next/style.css';
|
|
102
|
+
import { Slider } from 'x-next';
|
|
103
|
+
import { ref } from 'vue';
|
|
104
|
+
|
|
105
|
+
const value = ref(40);
|
|
106
|
+
</script>
|
|
107
|
+
<template>
|
|
108
|
+
<Slider v-model="value" size="mini" />
|
|
109
|
+
<Slider v-model="value" size="small" />
|
|
110
|
+
<Slider v-model="value" size="medium" />
|
|
111
|
+
<Slider v-model="value" size="large" />
|
|
112
|
+
</template>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 范围选择
|
|
116
|
+
|
|
117
|
+
独立使用时可给手柄设置 `aria-label`。`id` 和 ARIA 属性会传到真实滑块,范围第二端使用 `ID-end`;放入 Form 后会自动关联字段标签和帮助说明。禁用手柄退出 Tab 序列。
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<script setup lang="ts">
|
|
121
|
+
import 'x-next/style.css';
|
|
122
|
+
import { Slider } from 'x-next';
|
|
123
|
+
import { ref } from 'vue';
|
|
124
|
+
|
|
125
|
+
const range = ref<[number, number]>([20, 80]);
|
|
126
|
+
import type { HTMLAttributes } from 'vue';
|
|
127
|
+
const nativeAttrs1 = { "aria-label": "价格范围" } satisfies HTMLAttributes;
|
|
128
|
+
</script>
|
|
129
|
+
<template>
|
|
130
|
+
<Slider v-bind="nativeAttrs1" v-model="range" range :min="0" :max="100" />
|
|
131
|
+
</template>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 显示输入框
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<script setup lang="ts">
|
|
138
|
+
import 'x-next/style.css';
|
|
139
|
+
import { Slider } from 'x-next';
|
|
140
|
+
import { ref } from 'vue';
|
|
141
|
+
|
|
142
|
+
const value = ref(36);
|
|
143
|
+
const range = ref<[number, number]>([15, 65]);
|
|
144
|
+
</script>
|
|
145
|
+
<template>
|
|
146
|
+
<Slider v-model="value" show-input />
|
|
147
|
+
<Slider v-model="range" range show-input />
|
|
148
|
+
</template>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 垂直方向
|
|
152
|
+
|
|
153
|
+
```vue
|
|
154
|
+
<script setup lang="ts">
|
|
155
|
+
import 'x-next/style.css';
|
|
156
|
+
import { Slider } from 'x-next';
|
|
157
|
+
const marks = {
|
|
158
|
+
0: '0%',
|
|
159
|
+
50: '50%',
|
|
160
|
+
100: '100%',
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
import { ref } from 'vue';
|
|
164
|
+
|
|
165
|
+
const value = ref(45);
|
|
166
|
+
const range = ref<[number, number]>([20, 70]);
|
|
167
|
+
</script>
|
|
168
|
+
<template>
|
|
169
|
+
<Slider
|
|
170
|
+
v-model="value"
|
|
171
|
+
direction="vertical"
|
|
172
|
+
:marks="{ 0: '0', 50: '50', 100: '100' }"
|
|
173
|
+
/>
|
|
174
|
+
<Slider v-model="range" direction="vertical" range show-input />
|
|
175
|
+
</template>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Tooltip
|
|
179
|
+
|
|
180
|
+
```vue
|
|
181
|
+
<script setup lang="ts">
|
|
182
|
+
import 'x-next/style.css';
|
|
183
|
+
import { Slider } from 'x-next';
|
|
184
|
+
import { ref } from 'vue';
|
|
185
|
+
|
|
186
|
+
const value = ref(25);
|
|
187
|
+
const formatTooltip = (val?: string | number) => `${val}%`;
|
|
188
|
+
</script>
|
|
189
|
+
<template>
|
|
190
|
+
<Slider v-model="value" :format-tooltip="formatTooltip" tooltip-position="top" />
|
|
191
|
+
<Slider v-model="value" :show-tooltip="false" />
|
|
192
|
+
</template>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 事件
|
|
196
|
+
|
|
197
|
+
```vue
|
|
198
|
+
<script setup lang="ts">
|
|
199
|
+
import 'x-next/style.css';
|
|
200
|
+
import { Slider } from 'x-next';
|
|
201
|
+
import { ref } from 'vue';
|
|
202
|
+
|
|
203
|
+
const value = ref(40);
|
|
204
|
+
const log = ref('等待操作');
|
|
205
|
+
</script>
|
|
206
|
+
<template>
|
|
207
|
+
<Slider
|
|
208
|
+
v-model="value"
|
|
209
|
+
@change="(val) => log = `change: ${JSON.stringify(val)}`"
|
|
210
|
+
@change-end="(val) => log = `change-end: ${JSON.stringify(val)}`"
|
|
211
|
+
/>
|
|
212
|
+
<p>{{ log }}</p>
|
|
213
|
+
</template>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 在 Form 中校验
|
|
217
|
+
|
|
218
|
+
组件放进 `x-form-item` 后会自动继承 Form 的尺寸与禁用状态,并按 FormItem 的校验规则展示错误。默认 `validateTrigger` 为 `change`,即值变化时触发校验。
|
|
219
|
+
|
|
220
|
+
```vue
|
|
221
|
+
<script setup lang="ts">
|
|
222
|
+
import 'x-next/style.css';
|
|
223
|
+
import { Form, FormItem, Slider, Space, Button } from 'x-next';
|
|
224
|
+
const value = ref(30);
|
|
225
|
+
|
|
226
|
+
import { reactive, ref } from 'vue';
|
|
227
|
+
import type { FormInstance, FieldRule } from 'x-next';
|
|
228
|
+
|
|
229
|
+
const formState = reactive({ threshold: 0 });
|
|
230
|
+
const formRules: Record<string, FieldRule[]> = {
|
|
231
|
+
threshold: [{ required: true, type: 'number', min: 1, message: '请设置阈值' }],
|
|
232
|
+
};
|
|
233
|
+
const formRef = ref<FormInstance>();
|
|
234
|
+
const validateResult = ref('');
|
|
235
|
+
|
|
236
|
+
const handleValidate = async () => {
|
|
237
|
+
const errors = await formRef.value!.validate();
|
|
238
|
+
validateResult.value = errors
|
|
239
|
+
? `校验失败:${Object.values(errors).map((error) => error.message).join(';')}`
|
|
240
|
+
: '校验通过';
|
|
241
|
+
};
|
|
242
|
+
const handleReset = () => {
|
|
243
|
+
formRef.value!.resetFields();
|
|
244
|
+
validateResult.value = '已重置';
|
|
245
|
+
};
|
|
246
|
+
</script>
|
|
247
|
+
<template>
|
|
248
|
+
<Form ref="formRef" :model="formState" :rules="formRules">
|
|
249
|
+
<FormItem field="threshold" label="阈值">
|
|
250
|
+
<Slider v-model="formState.threshold" :min="0" :max="100" show-input />
|
|
251
|
+
</FormItem>
|
|
252
|
+
<FormItem>
|
|
253
|
+
<Space>
|
|
254
|
+
<Button type="primary" @click="handleValidate">校验</Button>
|
|
255
|
+
<Button @click="handleReset">重置</Button>
|
|
256
|
+
</Space>
|
|
257
|
+
</FormItem>
|
|
258
|
+
</Form>
|
|
259
|
+
<p role="status">{{ validateResult }}</p>
|
|
260
|
+
</template>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./slider-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Space 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.15.0;来源指纹:`47ea153587c8d0b3bf318977b10bde9f8dd4acff90c5818541ba6513252ad362`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Space API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/space/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| direction | 排列方向 | undefined | "horizontal" | "vertical" | 否 | "horizontal" |
|
|
17
|
+
| size | 间距大小 | undefined | number | "mini" | "small" | "medium" | "large" | 否 | "small" |
|
|
18
|
+
| align | 对齐方式。space-between 用于主轴两端分布,通常配合 block 或宽度使用 | undefined | "center" | "start" | "end" | "space-between" | "baseline" | 否 | "center" |
|
|
19
|
+
| block | 是否让根节点以 flex 撑满父容器布局 | undefined | false | true | 否 | false |
|
|
20
|
+
| fill | 是否撑满父容器并让每个间距项等分可用空间 | undefined | false | true | 否 | false |
|
|
21
|
+
|
|
22
|
+
### Events
|
|
23
|
+
|
|
24
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
25
|
+
|
|
26
|
+
### Slots
|
|
27
|
+
|
|
28
|
+
| 名称 | 用途 | 公开类型 |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| default | 间距项 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
31
|
+
| split | 分隔内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
32
|
+
|
|
33
|
+
### 实例方法
|
|
34
|
+
|
|
35
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
返回 [Space 用法](./space.md)。
|