x-next 1.9.0 → 1.10.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.
- package/AI_USAGE.md +69 -7
- package/CHANGELOG.md +36 -0
- package/dist/_utils/chart/scale.d.ts +1 -1
- package/dist/components/_components/chart/axis-labels.d.ts +8 -0
- package/dist/components/_components/select-view/select-view.d.ts +9 -0
- package/dist/components/form-select/Select.d.ts +18 -5
- package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
- package/dist/components/form-select/hooks/use-options.d.ts +1 -1
- package/dist/components/form-select/hooks/use-select.d.ts +1 -1
- package/dist/components/form-select/index.d.ts +42 -11
- package/dist/components/form-select/interface.d.ts +8 -0
- package/dist/components/link/Link.vue.d.ts +1 -1
- package/dist/components/link/index.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +60 -32
- package/dist/components/trigger/interface.d.ts +2 -0
- package/dist/components/virtual-list-v2/interface.d.ts +3 -0
- package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +336 -1
- package/dist/es/_hooks/use-component-ref.js +9 -9
- package/dist/es/_utils/chart/scale.js +44 -39
- package/dist/es/components/_components/chart/ChartAxis.js +61 -36
- package/dist/es/components/_components/chart/axis-labels.js +26 -0
- package/dist/es/components/_components/select-view/select-view.js +89 -78
- package/dist/es/components/button/Button.js +23 -23
- package/dist/es/components/form-input-tag/InputTag.js +1 -1
- package/dist/es/components/form-select/Select.js +367 -318
- package/dist/es/components/form-select/SelectOption.vue.js +5 -3
- package/dist/es/components/form-select/SelectOption.vue2.js +54 -49
- package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
- package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
- package/dist/es/components/form-select/hooks/use-options.js +40 -40
- package/dist/es/components/form-select/hooks/use-select.js +76 -71
- package/dist/es/components/trigger/Trigger.js +174 -183
- package/dist/es/components/virtual-list-v2/virtual-list.vue.js +22 -23
- package/dist/es/components/virtual-list-v2/virtual-list.vue2.js +67 -53
- package/dist/es/icons/icon.js +37 -36
- package/dist/es/icons/index.js +6 -8
- package/dist/es/icons/public/lucide-names.js +167 -0
- package/dist/es/icons/public/lucide.js +75 -188
- package/dist/es/index.js +152 -148
- package/dist/es/style.css +1 -1
- package/dist/icons/index.d.ts +3 -3
- package/dist/icons/names.d.ts +2 -2
- package/dist/icons/public/lucide-names.d.ts +32 -0
- package/dist/icons/public/lucide.d.ts +2 -2
- package/dist/index.cjs +3 -62
- package/dist/index.umd.js +3 -62
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/form-select.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/AI_USAGE.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!-- Generated by pnpm generate:ai-usage. Edit src/docs/guide/ai-usage.md and script/ai-usage/manifest.js. -->
|
|
2
2
|
# x-next AI 使用手册
|
|
3
3
|
|
|
4
|
-
适用版本:**x-next@1.
|
|
4
|
+
适用版本:**x-next@1.10.1**。Vue:`^3.5.0`;Node:`>=20.19.0`。
|
|
5
5
|
|
|
6
|
-
来源指纹(精选示例、映射、版本与公开类型声明):`
|
|
6
|
+
来源指纹(精选示例、映射、版本与公开类型声明):`c37fbf755e64965a7c5f31201af1884cbf1bf81fedb0a8210ed326b16e14709c`。
|
|
7
7
|
|
|
8
|
-
本手册覆盖
|
|
8
|
+
本手册覆盖 27 个常用组件与服务;包内还有更多导出可用,只是未在此逐个展开。按业务需要选择即可,不必全部使用。
|
|
9
9
|
|
|
10
10
|
读取入口:`node_modules/x-next/AI_USAGE.md`;可用 `require.resolve('x-next/AI_USAGE.md')` 定位。这个文件名不会自动让所有 AI 工具加载,消费项目应在自己的指令中明确引用。
|
|
11
11
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
| 组件/服务 | 公共导出 | 全局标签/形式 | 受控模型 | 详细文档 |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
|
+
| ConfigProvider | `ConfigProvider` | `<x-config-provider>` | 无 | [组件文档](https://x-next.yjmf.com/components/config-provider) |
|
|
16
17
|
| Button | `Button` | `<x-button>` | 无 | [组件文档](https://x-next.yjmf.com/components/button) |
|
|
17
18
|
| Checkbox | `Checkbox` | `<x-checkbox>` | `v-model` | [组件文档](https://x-next.yjmf.com/components/checkbox) |
|
|
18
19
|
| Radio | `Radio` | `<x-radio>` | `v-model` | [组件文档](https://x-next.yjmf.com/components/radio) |
|
|
@@ -49,18 +50,17 @@
|
|
|
49
50
|
npm install x-next
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
应用需已有 Vue 3、TypeScript 和 Vue SFC
|
|
53
|
+
应用需已有 Vue 3、TypeScript 和 Vue SFC 构建支持。按需具名导入无需安装全局插件;在 `main.ts` 引入一次样式:
|
|
53
54
|
|
|
54
55
|
```ts
|
|
55
56
|
import { createApp } from 'vue';
|
|
56
|
-
import XNext from 'x-next';
|
|
57
57
|
import App from './App.vue';
|
|
58
58
|
import 'x-next/dist/style.css';
|
|
59
59
|
|
|
60
|
-
createApp(App).
|
|
60
|
+
createApp(App).mount('#app');
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
`app.use(XNext)
|
|
63
|
+
下方各节使用局部具名导入。需要全局注册时可另用 `app.use(XNext)`(默认导出),它会注册全部组件。根入口的 `Dialog` 是命令式服务,模板组件是 `DialogComponent`;MessageBox 使用服务函数。
|
|
64
64
|
|
|
65
65
|
接入时遵循这些约定:
|
|
66
66
|
|
|
@@ -71,6 +71,66 @@ createApp(App).use(XNext).mount('#app');
|
|
|
71
71
|
- **约束业务全局 CSS**:reset 用 `:where(...)` 降低优先级并限定作用域;宽泛的原生元素选择器可能覆盖组件样式。自定义内容用插槽和公开属性,不依赖内部结构类名。
|
|
72
72
|
- **清理页面创建的服务**:保留句柄,在路由页面卸载时调用 `close()`;KeepAlive 页面可在停用时清理。Dialog / MessageBox 的命令式关闭不触发确认、取消回调,业务取消逻辑需自行调用;Message / Notification 的关闭会触发各自的 `onClose`。
|
|
73
73
|
|
|
74
|
+
## ConfigProvider
|
|
75
|
+
|
|
76
|
+
局部品牌色用 `themeColor`,它一次生成色阶并重绑定组件别名;不必逐个覆盖 Button、Switch 的颜色。将弹层宿主放在同一主题子树内,Teleport 后仍能继承。Select 默认跟随祖先滚动;要滚动关闭可传 `triggerProps.scrollToClose`。
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<script setup lang="ts">
|
|
80
|
+
import { ref } from 'vue';
|
|
81
|
+
import { Button, ConfigProvider, Select, Switch } from 'x-next';
|
|
82
|
+
|
|
83
|
+
const brand = ref('#2f6feb');
|
|
84
|
+
const dark = ref(false);
|
|
85
|
+
const value = ref('day');
|
|
86
|
+
const overlayHost = ref<HTMLElement>();
|
|
87
|
+
const switchAttrs = { 'aria-label': '局部暗色' };
|
|
88
|
+
const selectAttrs = { 'aria-label': '统计粒度' };
|
|
89
|
+
const options = [
|
|
90
|
+
{ label: '按天', value: 'day' },
|
|
91
|
+
{ label: '按周', value: 'week' },
|
|
92
|
+
];
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<template>
|
|
96
|
+
<ConfigProvider :theme-color="brand" :dark="dark" class="brand-scope">
|
|
97
|
+
<Button type="primary" @click="brand = brand === '#2f6feb' ? '#0f766e' : '#2f6feb'">
|
|
98
|
+
切换品牌色
|
|
99
|
+
</Button>
|
|
100
|
+
<Switch v-model="dark" v-bind="switchAttrs" />
|
|
101
|
+
<Select
|
|
102
|
+
v-if="overlayHost"
|
|
103
|
+
v-model="value"
|
|
104
|
+
:options="options"
|
|
105
|
+
:popup-container="overlayHost"
|
|
106
|
+
v-bind="selectAttrs"
|
|
107
|
+
style="width: 160px"
|
|
108
|
+
/>
|
|
109
|
+
<div ref="overlayHost" class="brand-overlay" />
|
|
110
|
+
</ConfigProvider>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<style scoped>
|
|
114
|
+
.brand-scope {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-wrap: wrap;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 12px;
|
|
119
|
+
padding: 16px;
|
|
120
|
+
color: var(--x-color-text-primary);
|
|
121
|
+
background: var(--x-color-bg-surface);
|
|
122
|
+
}
|
|
123
|
+
.brand-overlay {
|
|
124
|
+
position: fixed;
|
|
125
|
+
inset: 0;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
z-index: 2000;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
已有主题容器时,也可调用公开 `applyThemeColor(seed, { target, dark })`;切换暗色后需重新调用。只改后代的几条 semantic CSS 变量不会重算祖先 alias;`:tag="null"` 的 ConfigProvider 没有承载局部主题的 DOM。
|
|
133
|
+
|
|
74
134
|
## Button
|
|
75
135
|
|
|
76
136
|
[组件文档与 live demo](https://x-next.yjmf.com/components/button)。`type` 默认 `'default'`,视觉主按钮用 `'primary'`;`htmlType` 默认 `'button'`,原生提交用 `'submit'`。独立使用时尺寸回退为 `'medium'`,`disabled` / `loading` 默认关闭。
|
|
@@ -157,6 +217,8 @@ function changed(value: string | number | boolean, _event: Event) {
|
|
|
157
217
|
|
|
158
218
|
`change(value)` 返回新值,`clear(event)` 返回 `Event`;单选清空通常为 `''`,多选为 `[]`,已选禁用项可能保留。`v-model:popup-visible` 控制弹层,`option` / `empty` / `header` / `footer` 等插槽见组件文档。
|
|
159
219
|
|
|
220
|
+
有值且可清空时,右侧 × 与箭头共用位置,点击 × 不切换面板。`v-model:input-value` 控制搜索输入;远程搜索设置 `filterOption=false`,用 `@search` 请求数据并由业务取消旧请求。对象值用 `valueKey` 标识,`fallbackOption` 处理暂时缺失的候选项。默认触发器 ref 类型为 `SelectInstance`,提供 `focus()` / `blur()`;自定义 `trigger` 插槽将 `onKeydown` 绑定到自己的可聚焦节点。
|
|
221
|
+
|
|
160
222
|
```vue
|
|
161
223
|
<script setup lang="ts">
|
|
162
224
|
import { ref } from 'vue';
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.10.1] - 2026-10-06
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- Button `loadingFill` 的覆盖层样式改为匹配实际结构,加载图标在按钮内居中,不再与内容挤占宽度;保留原尺寸与圆角,加载期间视觉隐藏文字及前后缀,结束后恢复,并补充可交互文档示例和编译样式回归测试。
|
|
10
|
+
- Select 的清空与展开图标共用末尾位置,可清空时始终显示 ×;清空保留面板状态并恢复焦点,不隐藏 Form 反馈。
|
|
11
|
+
- Select 统一拦截禁用 / 加载中的选择和删除,清理过期搜索任务;修复动态字段映射、缺失多选值保留、同键对象兜底更新、异步选项默认激活和分组虚拟化;插槽选项与虚拟配置并用时保留普通列表。
|
|
12
|
+
- 多选选项复选框统一由选项处理点击,不再参与外层 Form 注册或 Tab 顺序;原生输入属性落到真实输入,输入法 Backspace 不误删标签。
|
|
13
|
+
- Select 按实际已选值保留最新远程标签,缺失标签仍可清空且保留禁用项;清理卸载的虚拟行引用,加载期间不引用隐藏活动选项,并补齐 Trigger 滚动关闭配置类型。
|
|
14
|
+
|
|
15
|
+
### 新增
|
|
16
|
+
|
|
17
|
+
- Select 公开 `focus()` / `blur()`、明确 `focus` / `blur` 事件,自定义 trigger 提供 `onKeydown`;展开时支持 Home / End 定位首末启用项,补齐 Props 类型与对象值、远程搜索、自定义触发器及图标的可交互文档示例。
|
|
18
|
+
|
|
19
|
+
## [1.10.0] - 2026-10-05
|
|
20
|
+
|
|
21
|
+
### 新增
|
|
22
|
+
|
|
23
|
+
- 公共图标补齐四向箭头、双向翻页、问号帮助、纵向更多与顺时针旋转,共 9 种新图形;图标墙展示 59 种推荐图形,保留旧名称与 22 个兼容别名,搜索旧名可定位推荐名称。
|
|
24
|
+
- 新增 `check:icons` 门禁,检查图标生成结果与源码、文档中的静态名称和导入引用,接入完整检查流程。
|
|
25
|
+
|
|
26
|
+
### 修复
|
|
27
|
+
|
|
28
|
+
- 公共线性图标统一描边风格,`strokeWidth` 实际生效;内部图标工厂不再覆盖已经注册的公共图标。减少动效模式下,加载图标的外层旋转与内部圆弧动画均停止。
|
|
29
|
+
- 修复图标墙加载圆环被裁切、默认颜色不随暗色主题切换,以及 Clipboard API 不可用时误报复制成功的问题。
|
|
30
|
+
- Select 默认跟随滚动祖先,仍可通过 `triggerProps.updateAtScroll=false` 关闭;Trigger 的滚动关闭支持局部与嵌套容器,按打开时的位置计算阈值,并在关闭/卸载时清理监听。
|
|
31
|
+
- Select 虚拟列表恢复 `dropdown-scroll` / `dropdown-reach-bottom` 事件,复用 `scrollbar` 配置;搜索过滤复位虚拟窗口,尾部追加保持位置,兼容 Table 滚动节点引用。
|
|
32
|
+
- Button 非加载时不再运行隐藏加载动画,保留加载禁用状态和宽度过渡,尊重减少动画偏好。
|
|
33
|
+
- BarChart、LineChart 的末位标签按实际间距避让,首末标签收边;超长文字省略并保留完整提示,避免窄画布叠字或越界。
|
|
34
|
+
|
|
35
|
+
### 文档
|
|
36
|
+
|
|
37
|
+
- 图标页新增别名搜索、推荐名称复制和可交互描边示例。
|
|
38
|
+
- AI 使用手册新增 ConfigProvider 局部品牌色与浮层宿主配方,以具名导入作为默认接入方式。
|
|
39
|
+
- 增加 Select 局部滚动、图表完整日期与窄容器的可交互示例。
|
|
40
|
+
|
|
5
41
|
## [1.9.0] - 2026-10-05
|
|
6
42
|
|
|
7
43
|
### 新增
|
|
@@ -50,6 +50,6 @@ export declare const formatPercent: (value: number, total: number, digits?: numb
|
|
|
50
50
|
export declare const estimateTextWidth: (text: string, fontSize: number) => number;
|
|
51
51
|
/**
|
|
52
52
|
* 类目标签抽稀:按柱间距与标签宽度算出步长,保证相邻标签间留有 gap。
|
|
53
|
-
*
|
|
53
|
+
* 优先保留末位(最新时间点),空间不足时移除冲突项,包括首位。
|
|
54
54
|
*/
|
|
55
55
|
export declare const pickLabelIndices: (count: number, band: number, maxLabelWidth: number, gap?: number) => number[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartAxisXLabel } from './interface';
|
|
2
|
+
export interface PositionedAxisLabel extends ChartAxisXLabel {
|
|
3
|
+
width: number;
|
|
4
|
+
/** 完整文案,仅在省略时提供原生 SVG 提示。 */
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
/** 收边后再次检查文字区间,优先保留最新类目;单个超长标签省略。 */
|
|
8
|
+
export declare const layoutAxisLabels: (labels: ChartAxisXLabel[], left: number, right: number, gap: number, measure: (text: string) => number) => PositionedAxisLabel[];
|
|
@@ -40,6 +40,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
default: boolean;
|
|
42
42
|
};
|
|
43
|
+
clearable: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: undefined;
|
|
46
|
+
};
|
|
43
47
|
allowCreate: {
|
|
44
48
|
type: BooleanConstructor;
|
|
45
49
|
default: boolean;
|
|
@@ -114,6 +118,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
114
118
|
type: BooleanConstructor;
|
|
115
119
|
default: boolean;
|
|
116
120
|
};
|
|
121
|
+
clearable: {
|
|
122
|
+
type: BooleanConstructor;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
117
125
|
allowCreate: {
|
|
118
126
|
type: BooleanConstructor;
|
|
119
127
|
default: boolean;
|
|
@@ -153,6 +161,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
153
161
|
maxTagCount: number;
|
|
154
162
|
retainInputValue: boolean;
|
|
155
163
|
tagNowrap: boolean;
|
|
164
|
+
clearable: boolean;
|
|
156
165
|
allowCreate: boolean;
|
|
157
166
|
allowSearch: boolean;
|
|
158
167
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -297,15 +297,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
297
297
|
default: boolean;
|
|
298
298
|
};
|
|
299
299
|
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
300
|
-
|
|
300
|
+
focus: (ev: FocusEvent) => true;
|
|
301
|
+
blur: (ev: FocusEvent) => true;
|
|
302
|
+
'update:modelValue': (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
301
303
|
'update:inputValue': (inputValue: string) => true;
|
|
302
304
|
'update:popupVisible': (visible: boolean) => true;
|
|
303
305
|
/**
|
|
304
306
|
* @zh 值发生改变时触发
|
|
305
307
|
* @en Triggered when the value changes
|
|
306
|
-
* @param { string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] } value
|
|
308
|
+
* @param { string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined } value
|
|
307
309
|
*/
|
|
308
|
-
change: (value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
310
|
+
change: (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
309
311
|
/**
|
|
310
312
|
* @zh 输入框的值发生改变时触发
|
|
311
313
|
* @en Triggered when the value of the input changes
|
|
@@ -644,11 +646,13 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
644
646
|
default: boolean;
|
|
645
647
|
};
|
|
646
648
|
}>> & Readonly<{
|
|
649
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
647
650
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
648
651
|
onClear?: ((ev: Event) => any) | undefined;
|
|
649
652
|
onRemove?: ((removed: string | number | boolean | Record<string, any> | undefined) => any) | undefined;
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
654
|
+
onChange?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
655
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
652
656
|
"onUpdate:popupVisible"?: ((visible: boolean) => any) | undefined;
|
|
653
657
|
onPopupVisibleChange?: ((visible: boolean) => any) | undefined;
|
|
654
658
|
"onUpdate:inputValue"?: ((inputValue: string) => any) | undefined;
|
|
@@ -1292,6 +1296,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1292
1296
|
type: BooleanConstructor;
|
|
1293
1297
|
default: boolean;
|
|
1294
1298
|
};
|
|
1299
|
+
clearable: {
|
|
1300
|
+
type: BooleanConstructor;
|
|
1301
|
+
default: undefined;
|
|
1302
|
+
};
|
|
1295
1303
|
allowCreate: {
|
|
1296
1304
|
type: BooleanConstructor;
|
|
1297
1305
|
default: boolean;
|
|
@@ -1366,6 +1374,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1366
1374
|
type: BooleanConstructor;
|
|
1367
1375
|
default: boolean;
|
|
1368
1376
|
};
|
|
1377
|
+
clearable: {
|
|
1378
|
+
type: BooleanConstructor;
|
|
1379
|
+
default: undefined;
|
|
1380
|
+
};
|
|
1369
1381
|
allowCreate: {
|
|
1370
1382
|
type: BooleanConstructor;
|
|
1371
1383
|
default: boolean;
|
|
@@ -1405,6 +1417,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1405
1417
|
maxTagCount: number;
|
|
1406
1418
|
retainInputValue: boolean;
|
|
1407
1419
|
tagNowrap: boolean;
|
|
1420
|
+
clearable: boolean;
|
|
1408
1421
|
allowCreate: boolean;
|
|
1409
1422
|
allowSearch: boolean;
|
|
1410
1423
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -13,6 +13,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
13
13
|
modifier: (className: string) => string;
|
|
14
14
|
is: (className: string) => string;
|
|
15
15
|
};
|
|
16
|
+
component: import('vue').ComputedRef<string>;
|
|
16
17
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
18
|
/**
|
|
18
19
|
* @zh 选项组的标题
|
|
@@ -17,7 +17,7 @@ export declare const useOptions: ({ options, extraOptions, inputValue, filterOpt
|
|
|
17
17
|
key: string;
|
|
18
18
|
index?: number | undefined;
|
|
19
19
|
origin: "slot" | "options" | "extraOptions";
|
|
20
|
-
value: import('
|
|
20
|
+
value: import('..').SelectOptionValue;
|
|
21
21
|
label: string;
|
|
22
22
|
disabled?: boolean | undefined;
|
|
23
23
|
tagProps?: any;
|
|
@@ -32,7 +32,7 @@ export declare const useSelect: ({ multiple, options, extraOptions, inputValue,
|
|
|
32
32
|
key: string;
|
|
33
33
|
index?: number | undefined;
|
|
34
34
|
origin: "slot" | "options" | "extraOptions";
|
|
35
|
-
value: import('
|
|
35
|
+
value: import('..').SelectOptionValue;
|
|
36
36
|
label: string;
|
|
37
37
|
disabled?: boolean | undefined;
|
|
38
38
|
tagProps?: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { SelectProps } from './interface';
|
|
1
|
+
export type { SelectProps, SelectInstance, SelectOptionData, SelectOptionGroup as SelectOptionGroupData, SelectOptionValue, } from './interface';
|
|
2
2
|
export declare const Select: {
|
|
3
3
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
4
4
|
multiple: {
|
|
@@ -134,11 +134,13 @@ export declare const Select: {
|
|
|
134
134
|
default: boolean;
|
|
135
135
|
};
|
|
136
136
|
}>> & Readonly<{
|
|
137
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
137
138
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
138
139
|
onClear?: ((ev: Event) => any) | undefined;
|
|
139
140
|
onRemove?: ((removed: string | number | boolean | Record<string, any> | undefined) => any) | undefined;
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
142
|
+
onChange?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
143
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
142
144
|
"onUpdate:popupVisible"?: ((visible: boolean) => any) | undefined;
|
|
143
145
|
onPopupVisibleChange?: ((visible: boolean) => any) | undefined;
|
|
144
146
|
"onUpdate:inputValue"?: ((inputValue: string) => any) | undefined;
|
|
@@ -147,10 +149,12 @@ export declare const Select: {
|
|
|
147
149
|
onDropdownReachBottom?: ((ev: Event) => any) | undefined;
|
|
148
150
|
onExceedLimit?: ((value: string | number | boolean | Record<string, any> | undefined, ev: Event) => any) | undefined;
|
|
149
151
|
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
150
|
-
|
|
152
|
+
focus: (ev: FocusEvent) => true;
|
|
153
|
+
blur: (ev: FocusEvent) => true;
|
|
154
|
+
'update:modelValue': (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
151
155
|
'update:inputValue': (inputValue: string) => true;
|
|
152
156
|
'update:popupVisible': (visible: boolean) => true;
|
|
153
|
-
change: (value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
157
|
+
change: (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
154
158
|
inputValueChange: (inputValue: string) => true;
|
|
155
159
|
popupVisibleChange: (visible: boolean) => true;
|
|
156
160
|
clear: (ev: Event) => true;
|
|
@@ -795,6 +799,10 @@ export declare const Select: {
|
|
|
795
799
|
type: BooleanConstructor;
|
|
796
800
|
default: boolean;
|
|
797
801
|
};
|
|
802
|
+
clearable: {
|
|
803
|
+
type: BooleanConstructor;
|
|
804
|
+
default: undefined;
|
|
805
|
+
};
|
|
798
806
|
allowCreate: {
|
|
799
807
|
type: BooleanConstructor;
|
|
800
808
|
default: boolean;
|
|
@@ -869,6 +877,10 @@ export declare const Select: {
|
|
|
869
877
|
type: BooleanConstructor;
|
|
870
878
|
default: boolean;
|
|
871
879
|
};
|
|
880
|
+
clearable: {
|
|
881
|
+
type: BooleanConstructor;
|
|
882
|
+
default: undefined;
|
|
883
|
+
};
|
|
872
884
|
allowCreate: {
|
|
873
885
|
type: BooleanConstructor;
|
|
874
886
|
default: boolean;
|
|
@@ -908,6 +920,7 @@ export declare const Select: {
|
|
|
908
920
|
maxTagCount: number;
|
|
909
921
|
retainInputValue: boolean;
|
|
910
922
|
tagNowrap: boolean;
|
|
923
|
+
clearable: boolean;
|
|
911
924
|
allowCreate: boolean;
|
|
912
925
|
allowSearch: boolean;
|
|
913
926
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1052,11 +1065,13 @@ export declare const Select: {
|
|
|
1052
1065
|
default: boolean;
|
|
1053
1066
|
};
|
|
1054
1067
|
}>> & Readonly<{
|
|
1068
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
1055
1069
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
1056
1070
|
onClear?: ((ev: Event) => any) | undefined;
|
|
1057
1071
|
onRemove?: ((removed: string | number | boolean | Record<string, any> | undefined) => any) | undefined;
|
|
1058
|
-
|
|
1059
|
-
|
|
1072
|
+
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
1073
|
+
onChange?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
1074
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
1060
1075
|
"onUpdate:popupVisible"?: ((visible: boolean) => any) | undefined;
|
|
1061
1076
|
onPopupVisibleChange?: ((visible: boolean) => any) | undefined;
|
|
1062
1077
|
"onUpdate:inputValue"?: ((inputValue: string) => any) | undefined;
|
|
@@ -1232,11 +1247,13 @@ export declare const Select: {
|
|
|
1232
1247
|
default: boolean;
|
|
1233
1248
|
};
|
|
1234
1249
|
}>> & Readonly<{
|
|
1250
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
1235
1251
|
onSearch?: ((inputValue: string) => any) | undefined;
|
|
1236
1252
|
onClear?: ((ev: Event) => any) | undefined;
|
|
1237
1253
|
onRemove?: ((removed: string | number | boolean | Record<string, any> | undefined) => any) | undefined;
|
|
1238
|
-
|
|
1239
|
-
|
|
1254
|
+
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
1255
|
+
onChange?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
1256
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[] | undefined) => any) | undefined;
|
|
1240
1257
|
"onUpdate:popupVisible"?: ((visible: boolean) => any) | undefined;
|
|
1241
1258
|
onPopupVisibleChange?: ((visible: boolean) => any) | undefined;
|
|
1242
1259
|
"onUpdate:inputValue"?: ((inputValue: string) => any) | undefined;
|
|
@@ -1245,10 +1262,12 @@ export declare const Select: {
|
|
|
1245
1262
|
onDropdownReachBottom?: ((ev: Event) => any) | undefined;
|
|
1246
1263
|
onExceedLimit?: ((value: string | number | boolean | Record<string, any> | undefined, ev: Event) => any) | undefined;
|
|
1247
1264
|
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
1248
|
-
|
|
1265
|
+
focus: (ev: FocusEvent) => true;
|
|
1266
|
+
blur: (ev: FocusEvent) => true;
|
|
1267
|
+
'update:modelValue': (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
1249
1268
|
'update:inputValue': (inputValue: string) => true;
|
|
1250
1269
|
'update:popupVisible': (visible: boolean) => true;
|
|
1251
|
-
change: (value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
1270
|
+
change: (value: string | undefined | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]) => true;
|
|
1252
1271
|
inputValueChange: (inputValue: string) => true;
|
|
1253
1272
|
popupVisibleChange: (visible: boolean) => true;
|
|
1254
1273
|
clear: (ev: Event) => true;
|
|
@@ -1893,6 +1912,10 @@ export declare const Select: {
|
|
|
1893
1912
|
type: BooleanConstructor;
|
|
1894
1913
|
default: boolean;
|
|
1895
1914
|
};
|
|
1915
|
+
clearable: {
|
|
1916
|
+
type: BooleanConstructor;
|
|
1917
|
+
default: undefined;
|
|
1918
|
+
};
|
|
1896
1919
|
allowCreate: {
|
|
1897
1920
|
type: BooleanConstructor;
|
|
1898
1921
|
default: boolean;
|
|
@@ -1967,6 +1990,10 @@ export declare const Select: {
|
|
|
1967
1990
|
type: BooleanConstructor;
|
|
1968
1991
|
default: boolean;
|
|
1969
1992
|
};
|
|
1993
|
+
clearable: {
|
|
1994
|
+
type: BooleanConstructor;
|
|
1995
|
+
default: undefined;
|
|
1996
|
+
};
|
|
1970
1997
|
allowCreate: {
|
|
1971
1998
|
type: BooleanConstructor;
|
|
1972
1999
|
default: boolean;
|
|
@@ -2006,6 +2033,7 @@ export declare const Select: {
|
|
|
2006
2033
|
maxTagCount: number;
|
|
2007
2034
|
retainInputValue: boolean;
|
|
2008
2035
|
tagNowrap: boolean;
|
|
2036
|
+
clearable: boolean;
|
|
2009
2037
|
allowCreate: boolean;
|
|
2010
2038
|
allowSearch: boolean;
|
|
2011
2039
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -3559,6 +3587,7 @@ export declare const SelectOptionGroup: {
|
|
|
3559
3587
|
modifier: (className: string) => string;
|
|
3560
3588
|
is: (className: string) => string;
|
|
3561
3589
|
};
|
|
3590
|
+
component: import('vue').ComputedRef<string>;
|
|
3562
3591
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
3563
3592
|
P: {};
|
|
3564
3593
|
B: {};
|
|
@@ -3577,6 +3606,7 @@ export declare const SelectOptionGroup: {
|
|
|
3577
3606
|
modifier: (className: string) => string;
|
|
3578
3607
|
is: (className: string) => string;
|
|
3579
3608
|
};
|
|
3609
|
+
component: import('vue').ComputedRef<string>;
|
|
3580
3610
|
}, {}, {}, {}, {}>;
|
|
3581
3611
|
__isFragment?: never;
|
|
3582
3612
|
__isTeleport?: never;
|
|
@@ -3592,6 +3622,7 @@ export declare const SelectOptionGroup: {
|
|
|
3592
3622
|
modifier: (className: string) => string;
|
|
3593
3623
|
is: (className: string) => string;
|
|
3594
3624
|
};
|
|
3625
|
+
component: import('vue').ComputedRef<string>;
|
|
3595
3626
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
3596
3627
|
install(app: import('vue').App): void;
|
|
3597
3628
|
};
|
|
@@ -3,6 +3,11 @@ import { FieldString } from '../../_hooks/_types';
|
|
|
3
3
|
import { Size } from '../../_utils/constant';
|
|
4
4
|
import { VirtualListProps } from '../virtual-list-v2/interface';
|
|
5
5
|
import { TriggerProps } from '../trigger/interface';
|
|
6
|
+
import { ScrollbarProps } from '../scrollbar-v2';
|
|
7
|
+
export interface SelectInstance {
|
|
8
|
+
focus: () => void;
|
|
9
|
+
blur: () => void;
|
|
10
|
+
}
|
|
6
11
|
export interface SelectProps {
|
|
7
12
|
options?: (string | number | boolean | SelectOptionData | SelectOptionGroup)[];
|
|
8
13
|
multiple?: boolean;
|
|
@@ -25,6 +30,7 @@ export interface SelectProps {
|
|
|
25
30
|
bordered?: boolean;
|
|
26
31
|
popupVisible?: boolean;
|
|
27
32
|
defaultPopupVisible?: boolean;
|
|
33
|
+
defaultActiveFirstOption?: boolean;
|
|
28
34
|
unmountOnClose?: boolean;
|
|
29
35
|
filterOption?: boolean | ((inputValue: string, option: SelectOptionData) => boolean);
|
|
30
36
|
virtualListProps?: VirtualListProps;
|
|
@@ -38,6 +44,8 @@ export interface SelectProps {
|
|
|
38
44
|
fieldNames?: SelectFieldNames;
|
|
39
45
|
showHeaderOnEmpty?: boolean;
|
|
40
46
|
showFooterOnEmpty?: boolean;
|
|
47
|
+
scrollbar?: boolean | ScrollbarProps;
|
|
48
|
+
tagNowrap?: boolean;
|
|
41
49
|
}
|
|
42
50
|
export type SelectOptionValue = string | number | boolean | Record<string, unknown>;
|
|
43
51
|
export interface OptionValueWithKey {
|
|
@@ -121,8 +121,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
121
121
|
}>, {
|
|
122
122
|
strong: boolean;
|
|
123
123
|
disabled: boolean;
|
|
124
|
-
icon: boolean;
|
|
125
124
|
loading: boolean;
|
|
125
|
+
icon: boolean;
|
|
126
126
|
status: "normal" | "success" | "warning" | "strong" | "danger";
|
|
127
127
|
hoverable: boolean;
|
|
128
128
|
}, {}, {
|
|
@@ -37,8 +37,8 @@ export declare const Link: {
|
|
|
37
37
|
}, import('vue').PublicProps, {
|
|
38
38
|
strong: boolean;
|
|
39
39
|
disabled: boolean;
|
|
40
|
-
icon: boolean;
|
|
41
40
|
loading: boolean;
|
|
41
|
+
icon: boolean;
|
|
42
42
|
status: "normal" | "success" | "warning" | "strong" | "danger";
|
|
43
43
|
hoverable: boolean;
|
|
44
44
|
}, true, {}, {}, {
|
|
@@ -255,8 +255,8 @@ export declare const Link: {
|
|
|
255
255
|
}, {}, {}, {}, {
|
|
256
256
|
strong: boolean;
|
|
257
257
|
disabled: boolean;
|
|
258
|
-
icon: boolean;
|
|
259
258
|
loading: boolean;
|
|
259
|
+
icon: boolean;
|
|
260
260
|
status: "normal" | "success" | "warning" | "strong" | "danger";
|
|
261
261
|
hoverable: boolean;
|
|
262
262
|
}>;
|
|
@@ -301,8 +301,8 @@ export declare const Link: {
|
|
|
301
301
|
}, string, {
|
|
302
302
|
strong: boolean;
|
|
303
303
|
disabled: boolean;
|
|
304
|
-
icon: boolean;
|
|
305
304
|
loading: boolean;
|
|
305
|
+
icon: boolean;
|
|
306
306
|
status: "normal" | "success" | "warning" | "strong" | "danger";
|
|
307
307
|
hoverable: boolean;
|
|
308
308
|
}, {}, string, {}, {
|