@qin-ui/antd-vue-pro 2.5.2 → 2.6.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-CONTEXT.md +30 -10
- package/api.json +24 -4
- package/es/antd-vue-pro.css +6 -6
- package/es/components/component-provider/types/index.d.ts +1 -1
- package/es/components/component-provider/types/index.d.ts.map +1 -1
- package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -1
- package/es/components/form/components/BaseFormItem/index.vue.d.ts +59 -11
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -1
- package/es/components/form/components/BaseFormItems/index.vue.d.ts +16 -0
- package/es/components/form/components/BaseFormItems/index.vue.d.ts.map +1 -0
- package/es/components/form/components/index.d.ts +6 -6
- package/es/components/form/components/index.d.ts.map +1 -1
- package/es/components/form/hooks/useGroupFieldAttrs.d.ts +13 -3
- package/es/components/form/hooks/useGroupFieldAttrs.d.ts.map +1 -1
- package/es/components/form/utils/fieldKey.d.ts +12 -0
- package/es/components/form/utils/fieldKey.d.ts.map +1 -1
- package/es/components/table/components/ProTable.vue.d.ts +3 -1
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -1
- package/es/components/table/components/TableEllipsisTooltip.vue.d.ts +19 -0
- package/es/components/table/components/TableEllipsisTooltip.vue.d.ts.map +1 -0
- package/es/components/table/hooks/useEllipsisTooltip.d.ts +45 -0
- package/es/components/table/hooks/useEllipsisTooltip.d.ts.map +1 -0
- package/es/components/table/hooks/useEllipsisTooltipColumns.d.ts +19 -0
- package/es/components/table/hooks/useEllipsisTooltipColumns.d.ts.map +1 -0
- package/es/components/table/index.d.ts +1 -1
- package/es/components/table/index.d.ts.map +1 -1
- package/es/components/table/types/index.d.ts +46 -2
- package/es/components/table/types/index.d.ts.map +1 -1
- package/es/index.js +718 -228
- package/es/index.js.map +1 -1
- package/es/shared/ui/index.d.ts +2 -1
- package/es/shared/ui/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/component-provider/types/index.ts +1 -0
- package/src/components/form/components/BaseField/index.vue +30 -9
- package/src/components/form/components/BaseFormItem/index.vue +153 -186
- package/src/components/form/components/BaseFormItems/index.vue +186 -0
- package/src/components/form/components/ProForm/index.vue +5 -5
- package/src/components/form/components/index.ts +6 -6
- package/src/components/form/hooks/useGroupFieldAttrs.ts +114 -88
- package/src/components/form/utils/fieldKey.ts +63 -0
- package/src/components/table/components/ProTable.vue +128 -56
- package/src/components/table/components/TableEllipsisTooltip.vue +90 -0
- package/src/components/table/hooks/useEllipsisTooltip.ts +244 -0
- package/src/components/table/hooks/useEllipsisTooltipColumns.ts +139 -0
- package/src/components/table/index.ts +7 -1
- package/src/components/table/types/index.ts +62 -2
- package/src/shared/ui/index.ts +2 -0
package/AI-CONTEXT.md
CHANGED
|
@@ -125,14 +125,14 @@ useTable({ columns, dataSource, pageParam, searchParam, searchFields });
|
|
|
125
125
|
|
|
126
126
|
返回 `Table` 实例:
|
|
127
127
|
|
|
128
|
-
| 成员 | 说明
|
|
129
|
-
| :-------------------------------------------------------------------- |
|
|
130
|
-
| `table.columns` / `table.dataSource` | 列配置 / 数据源(Ref)
|
|
131
|
-
| `table.pageParam` | 分页参数(reactive):`current` / `pageSize` / `total`
|
|
132
|
-
| `table.searchForm` | 搜索表单实例(Form 类型,所有 useForm 方法可用)
|
|
133
|
-
| `table.setColumn` / `deleteColumn` / `appendColumn` / `prependColumn` | 列增删改查(用法同 setField
|
|
134
|
-
| `table.setPageParam(patch)` | 设置分页参数
|
|
135
|
-
| `table.resetQueryParams()` | 恢复分页与搜索条件到初始化快照
|
|
128
|
+
| 成员 | 说明 |
|
|
129
|
+
| :-------------------------------------------------------------------- | :---------------------------------------------------------- |
|
|
130
|
+
| `table.columns` / `table.dataSource` | 列配置 / 数据源(Ref) |
|
|
131
|
+
| `table.pageParam` | 分页参数(reactive):`current` / `pageSize` / `total` |
|
|
132
|
+
| `table.searchForm` | 搜索表单实例(Form 类型,所有 useForm 方法可用) |
|
|
133
|
+
| `table.setColumn` / `deleteColumn` / `appendColumn` / `prependColumn` | 列增删改查(用法同 setField,支持函数 key 与 `{all:true}`) |
|
|
134
|
+
| `table.setPageParam(patch)` | 设置分页参数 |
|
|
135
|
+
| `table.resetQueryParams()` | 恢复分页与搜索条件到初始化快照 |
|
|
136
136
|
|
|
137
137
|
## 关键约定
|
|
138
138
|
|
|
@@ -168,7 +168,7 @@ useTable({ columns, dataSource, pageParam, searchParam, searchFields });
|
|
|
168
168
|
|
|
169
169
|
关键 prop:`table`(useTable 实例)、`search`(数据查询方法 `() => Promise`,ProTable 内部调用,非自动触发)、`addIndexColumn`、`immediateSearch`、`control`、`searchFormConfig`(含 `hidden`/`container`/`layout`/`expand`)、`tableContainer`。
|
|
170
170
|
|
|
171
|
-
Provider 注入面:`columns` / `dataSource` / `loading` 不可经 `componentVars['pro-table']` 配置(分别由 `:table` 实例与组件自身查询状态驱动),`form` 不可经 `componentVars['pro-form']` 配置(由显式 `:form` 实例驱动);传入不可注入键时在注入层静默忽略(类型面已限制,不输出告警)。`searchFormConfig` 的 `container` / `hidden` 由 ProTable 消费,不下发 `SearchForm
|
|
171
|
+
Provider 注入面:`columns` / `dataSource` / `loading` 不可经 `componentVars['pro-table']` 配置(分别由 `:table` 实例与组件自身查询状态驱动),`form` 不可经 `componentVars['pro-form']` 配置(由显式 `:form` 实例驱动);传入不可注入键时在注入层静默忽略(类型面已限制,不输出告警)。`searchFormConfig` 的 `container` / `hidden` 由 ProTable 消费,不下发 `SearchForm`。`ellipsisTooltip` 可经 `componentVars['pro-table']` 配置。
|
|
172
172
|
|
|
173
173
|
**列控制(control)**:`control` 支持布尔值或 `{ sizeControl, columnControl }` 对象;`columnControl` 可为布尔值或 `ColumnControlConfig`:`labels`(列在下拉中的显示名映射,title 为 vnode 时必用)、`excludedKeys`(不在下拉出现、始终展示)、`disabledKeys`(显示但不可取消勾选)、`disableCheckAll`(禁用全选/取消全选)。列 key 取 `dataIndex` 路径或自定义 `key`。
|
|
174
174
|
|
|
@@ -176,7 +176,27 @@ Provider 注入面:`columns` / `dataSource` / `loading` 不可经 `componentVa
|
|
|
176
176
|
|
|
177
177
|
### Column -- 列配置
|
|
178
178
|
|
|
179
|
-
继承 ant-design-vue `ColumnType`,所有原生列属性可用。新增:`dataIndex`(列数据路径,主用,支持 `'name'` / `'address.city'` / `['address','city']`)、`key`(辅助标识,优先级更低)、`hidden`(隐藏该列,配合列控制;支持 `boolean` / `Ref` / `ComputedRef
|
|
179
|
+
继承 ant-design-vue `ColumnType`,所有原生列属性可用。新增:`dataIndex`(列数据路径,主用,支持 `'name'` / `'address.city'` / `['address','city']`)、`key`(辅助标识,优先级更低)、`hidden`(隐藏该列,配合列控制;支持 `boolean` / `Ref` / `ComputedRef`,分组列子列递归生效)。扩展 `ellipsis`:对象形态支持 `showTooltip`(文本溢出时使用表格级共享 Tooltip,body 单元格关闭宿主原生 title);新增 `ColumnEllipsis` 类型导出。ProTable 级 `ellipsisTooltip` 为 truthy 时全局启用所有列(列上 `showTooltip: false` 或 `ellipsis: false` 可退出),对象同时复用 TooltipProps:`getPopupContainer`(收到 ProTable 根节点,稳定节点)、`mouseEnterDelay` / `mouseLeaveDelay`(秒,默认 0.2 / 0.1)、`placement` / `arrow` / `autoAdjustOverflow` / `color`,以及 `overlayClassName` / `overlayStyle` / `overlayInnerStyle`;类型 `EllipsisTooltipConfig`。相邻单元格切换按 `mouseEnterDelay` 重新展示,不沿用 `mouseLeaveDelay`。
|
|
180
|
+
|
|
181
|
+
### 全列省略 Tooltip(ellipsisTooltip)
|
|
182
|
+
|
|
183
|
+
ProTable 设置 truthy 的 `ellipsisTooltip` 即可为所有可转换列启用单元格溢出省略 + 共享 Tooltip:
|
|
184
|
+
|
|
185
|
+
```vue
|
|
186
|
+
<ProTable :table="table" :ellipsis-tooltip="true" />
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
- `true` 或对象均为 truthy;对象同时作为 Tooltip 配置。
|
|
190
|
+
- 列上 `ellipsis: { showTooltip: false }` 或 `ellipsis: false` 可单列退出。
|
|
191
|
+
- 仅影响渲染,不改写 `table.columns`。
|
|
192
|
+
- 仅文本横向溢出时展示;body 关闭原生 `title`,表头保留。
|
|
193
|
+
- 需要把配置写入 `table.columns`(如持久化)时,再用:
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
table.setColumn(() => true, {
|
|
197
|
+
ellipsis: { showTooltip: true },
|
|
198
|
+
});
|
|
199
|
+
```
|
|
180
200
|
|
|
181
201
|
## 反模式
|
|
182
202
|
|
package/api.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-
|
|
2
|
+
"generatedAt": "2026-11-02T04:00:47.131Z",
|
|
3
3
|
"name": "@qin-ui/antd-vue-pro",
|
|
4
4
|
"api": [
|
|
5
5
|
{
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"type": "component",
|
|
52
52
|
"package": "@qin-ui/antd-vue-pro",
|
|
53
53
|
"signature": "<ProForm>",
|
|
54
|
-
"description": "配置驱动表单组件\n架构设计说明 (Architecture Overview)\n[ 数据层 (Core) ] => [ 绑定层 (ProForm) ] => [ 渲染层 (BaseFormItem / BaseField) ]\n1. 数据隔离:ProForm 本身不负责存储和管理表单状态,所有核心状态(formData, fields, 校验规则)\n均交由底层的 `useForm`(@qin-ui/pro-components-core)驱动。\n2. 上下文透传:通过 `provide` 将核心状态下发给子组件。\n3. 递归渲染:网格布局和具体字段的解析交由 `<
|
|
54
|
+
"description": "配置驱动表单组件\n架构设计说明 (Architecture Overview)\n[ 数据层 (Core) ] => [ 绑定层 (ProForm) ] => [ 渲染层 (BaseFormItems / BaseFormItem / BaseField) ]\n1. 数据隔离:ProForm 本身不负责存储和管理表单状态,所有核心状态(formData, fields, 校验规则)\n均交由底层的 `useForm`(@qin-ui/pro-components-core)驱动。\n2. 上下文透传:通过 `provide` 将核心状态下发给子组件。\n3. 递归渲染:网格布局和具体字段的解析交由 `<BaseFormItems>` 递归完成。\n通过配置驱动的方式快速构建表单,支持:\n- 字段联动(通过 setField、watch 等实现)\n- 嵌套字段(通过 fields 递归配置)\n- 自定义组件(通过 component 属性和 custom 类型)\n- 网格布局(通过 grid 属性)\n- 动态插槽(以字段 path 命名的插槽)\n- 全局配置注入(通过 ProComponentProvider)",
|
|
55
55
|
"params": [
|
|
56
56
|
{
|
|
57
57
|
"name": "form",
|
|
@@ -303,12 +303,32 @@
|
|
|
303
303
|
"```ts\ninterface SearchParams { keyword: string; status: string }\ninterface User { name: string; age: number; email: string }\n\nconst table = useTable<SearchParams, User>({\ncolumns: [\n{ dataIndex: 'name', title: '姓名', width: 120 },\n{ dataIndex: 'age', title: '年龄', width: 80 },\n],\ndataSource: [],\npageParam: { current: 1, pageSize: 20, total: 0 },\nsearchParam: { keyword: '', status: '' },\nsearchFields: [\n{ path: 'keyword', label: '关键词', component: 'input' },\n{ path: 'status', label: '状态', component: 'select' },\n],\n})\n\n// 查询\nconst handleSearch = async () => {\nconst res = await fetchUserList({\n...table.searchForm.formData,\n...table.pageParam,\n})\ntable.dataSource.value = res.data\ntable.setPageParam({ total: res.total })\n}\n\n// 重置\nconst handleReset = () => {\ntable.resetQueryParams()\nhandleSearch()\n}\n```"
|
|
304
304
|
]
|
|
305
305
|
},
|
|
306
|
+
{
|
|
307
|
+
"name": "ColumnEllipsis",
|
|
308
|
+
"type": "type",
|
|
309
|
+
"package": "@qin-ui/antd-vue-pro",
|
|
310
|
+
"signature": "export type ColumnEllipsis = NonNullable<\n Exclude<ColumnType['ellipsis'], boolean>\n> &",
|
|
311
|
+
"description": "列内容省略配置\n在宿主 `ellipsis` 基础上增加 `showTooltip`:单元格文本横向溢出时,\n悬停由表格级共享的同一个 Tooltip 展示完整文本。`showTooltip` 为 `true` 时不输出宿主原生 `title`。",
|
|
312
|
+
"examples": [
|
|
313
|
+
"```ts\nconst column: Column<User> = {\ndataIndex: 'name',\nellipsis: { showTooltip: true },\n}\n```"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "EllipsisTooltipConfig",
|
|
318
|
+
"type": "type",
|
|
319
|
+
"package": "@qin-ui/antd-vue-pro",
|
|
320
|
+
"signature": "export type EllipsisTooltipConfig = Pick<\n TooltipProps,\n | 'getPopupContainer'\n | 'mouseEnterDelay'\n | 'mouseLeaveDelay'\n | 'placement'\n | 'arrow'\n | 'autoAdjustOverflow'\n | 'color'",
|
|
321
|
+
"description": "ProTable 共享省略 Tooltip 配置\n复用宿主 Tooltip 的容器、延迟、方位与浮层样式字段,控制表格级单例 Tooltip。\nProTable 侧另接受 `true` 作为全局启用简写;列上 `showTooltip: false` 或 `ellipsis: false` 可退出。",
|
|
322
|
+
"examples": [
|
|
323
|
+
"```ts\nconst config: EllipsisTooltipConfig = {\ngetPopupContainer: () => document.body,\nmouseEnterDelay: 0.2,\nmouseLeaveDelay: 0.1,\nplacement: 'top',\n}\n```"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
306
326
|
{
|
|
307
327
|
"name": "Column",
|
|
308
328
|
"type": "type",
|
|
309
329
|
"package": "@qin-ui/antd-vue-pro",
|
|
310
|
-
"signature": "export type Column<D extends Data = Data> = Omit<\n ColumnType,\n 'dataIndex' | 'key'\n> &",
|
|
311
|
-
"description": "表格列配置类型\n继承 Ant Design Vue 的 ColumnType 列类型,并添加:\n- 类型安全的 dataIndex(基于泛型 D 推导路径),优先使用\n- key 作为辅助标识,当 dataIndex 不满足需求时使用\n- hidden 属性用于控制列显隐\n- 所有 Ant Design Vue 原生的列属性依然可用(title、width、fixed、align 等)",
|
|
330
|
+
"signature": "export type Column<D extends Data = Data> = Omit<\n ColumnType,\n 'dataIndex' | 'key' | 'ellipsis'\n> &",
|
|
331
|
+
"description": "表格列配置类型\n继承 Ant Design Vue 的 ColumnType 列类型,并添加:\n- 类型安全的 dataIndex(基于泛型 D 推导路径),优先使用\n- key 作为辅助标识,当 dataIndex 不满足需求时使用\n- hidden 属性用于控制列显隐\n- ellipsis 支持 `{ showTooltip: boolean }` 的表格级共享 Tooltip\n- 所有 Ant Design Vue 原生的列属性依然可用(title、width、fixed、align 等)",
|
|
312
332
|
"typeParams": [
|
|
313
333
|
{
|
|
314
334
|
"name": "D"
|
package/es/antd-vue-pro.css
CHANGED
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
.pro-table_column-control_button[data-v-58650608] svg {
|
|
37
37
|
transform: scale(1.2, 1.4);
|
|
38
38
|
}
|
|
39
|
-
.pro-table_header[data-v-
|
|
39
|
+
.pro-table_header[data-v-35945e54] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-table_header[data-v-
|
|
44
|
+
.pro-table_header[data-v-35945e54]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
47
|
+
.pro-table_header + .pro-table_header_content[data-v-35945e54] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-table_header_button-bar[data-v-
|
|
50
|
+
.pro-table_header_button-bar[data-v-35945e54] {
|
|
51
51
|
flex: 1;
|
|
52
52
|
}
|
|
53
|
-
.pro-table_header_toolbar[data-v-
|
|
53
|
+
.pro-table_header_toolbar[data-v-35945e54] {
|
|
54
54
|
margin-left: 12px;
|
|
55
55
|
}
|
|
56
|
-
.pro-table[data-v-
|
|
56
|
+
.pro-table[data-v-35945e54] [class*='-pagination'] [class*='-pagination-total-text'] {
|
|
57
57
|
flex: 1;
|
|
58
58
|
}
|
|
@@ -37,7 +37,7 @@ export type RequiredComponentVars = {
|
|
|
37
37
|
*
|
|
38
38
|
* @description `columns` / `dataSource` / `loading` 不参与全局注入:三者分别由 `:table` 实例(`useTable`)与组件自身查询状态驱动。
|
|
39
39
|
*/
|
|
40
|
-
'pro-table': PP<Omit<TableProps, 'loading' | 'columns' | 'dataSource'> & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer'>>;
|
|
40
|
+
'pro-table': PP<Omit<TableProps, 'loading' | 'columns' | 'dataSource'> & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer' | 'ellipsisTooltip'>>;
|
|
41
41
|
/** ProForm 全局默认属性,grid 必须为 GridProps 对象而非 boolean */
|
|
42
42
|
'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
|
|
43
43
|
grid: Exclude<Grid, undefined | boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC;AAE5E,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAC9C,CAAC,GACC,IAAI,CAAC,IAAI,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,GACjE,qBAAqB,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;OAIG;IACH,WAAW,EAAE,EAAE,CACb,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC,GACpD,IAAI,CACF,aAAa,EACX,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC;AAE5E,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAC9C,CAAC,GACC,IAAI,CAAC,IAAI,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,GACjE,qBAAqB,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;OAIG;IACH,WAAW,EAAE,EAAE,CACb,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC,GACpD,IAAI,CACF,aAAa,EACX,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,CACpB,CACJ,CAAC;IACF,qDAAqD;IACrD,UAAU,EAAE,EAAE,CACZ,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;KAC1C,CACF,CAAC;IACF,yBAAyB;IACzB,eAAe,EAAE,EAAE,CACjB,aAAa,GACX,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC,GACtE,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAClC,CAAC;IAEF,+BAA+B;IAC/B,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,+BAA+B;IAC/B,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,gCAAgC;IAChC,mBAAmB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACzE,+BAA+B;IAC/B,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,kCAAkC;IAClC,qBAAqB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC5E,GAAG;KAED,CAAC,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE,CACzC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CACpC;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"AA6RA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,KAAK,CAAC;AAiCb,KAAK,KAAK,GAAG;IACX,eAAe;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;;qCAsL6D,GAAG;;;;;;UAvLzD,MAAM;eAFD,MAAM,GAAG,SAAS;;;;AAqShC,wBAUG"}
|
|
@@ -1,16 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { PropType, VNode } from 'vue';
|
|
2
|
+
import { Field, Grid } from '../../types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
/** 字段配置 */
|
|
5
|
+
field: {
|
|
6
|
+
type: PropType<Field>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
3
9
|
/** 是否启用网格布局 */
|
|
4
|
-
grid
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
grid: {
|
|
11
|
+
type: PropType<Grid>;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
/** 上层下发的禁用状态 */
|
|
15
|
+
disabled: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
/** FormItem 实例登记回调 */
|
|
20
|
+
setFormItemRef: {
|
|
21
|
+
type: PropType<(field: Field, el: any, getFormItemProps: () => any) => void>;
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
/** 控件实例登记回调 */
|
|
25
|
+
setComponentRef: {
|
|
26
|
+
type: PropType<(field: Field, el: any) => void>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
}>, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
32
|
+
/** 字段配置 */
|
|
33
|
+
field: {
|
|
34
|
+
type: PropType<Field>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
/** 是否启用网格布局 */
|
|
38
|
+
grid: {
|
|
39
|
+
type: PropType<Grid>;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
/** 上层下发的禁用状态 */
|
|
43
|
+
disabled: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: undefined;
|
|
46
|
+
};
|
|
47
|
+
/** FormItem 实例登记回调 */
|
|
48
|
+
setFormItemRef: {
|
|
49
|
+
type: PropType<(field: Field, el: any, getFormItemProps: () => any) => void>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
/** 控件实例登记回调 */
|
|
53
|
+
setComponentRef: {
|
|
54
|
+
type: PropType<(field: Field, el: any) => void>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
}>> & Readonly<{}>, {
|
|
11
58
|
disabled: boolean;
|
|
12
|
-
fields: Fields;
|
|
13
59
|
grid: Grid;
|
|
14
|
-
|
|
60
|
+
setFormItemRef: (field: Field, el: any, getFormItemProps: () => any) => void;
|
|
61
|
+
setComponentRef: (field: Field, el: any) => void;
|
|
62
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
15
63
|
export default _default;
|
|
16
64
|
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"AAoLA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,KAAK,EACX,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;;IAa3C,WAAW;;cACc,QAAQ,CAAC,KAAK,CAAC;;;IACxC,eAAe;;cAEc,QAAQ,CAAC,IAAI,CAAC;;;IAG3C,gBAAgB;;;;;IAEhB,sBAAsB;;cAEF,QAAQ,CACxB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,GAAG,KAAK,IAAI,CAC7D;;;IAGH,eAAe;;cAEK,QAAQ,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;;;;;;IAlB7D,WAAW;;cACc,QAAQ,CAAC,KAAK,CAAC;;;IACxC,eAAe;;cAEc,QAAQ,CAAC,IAAI,CAAC;;;IAG3C,gBAAgB;;;;;IAEhB,sBAAsB;;cAEF,QAAQ,CACxB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,GAAG,KAAK,IAAI,CAC7D;;;IAGH,eAAe;;cAEK,QAAQ,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;;;;;;4BANjD,KAAK,MAAM,GAAG,oBAAoB,MAAM,GAAG,KAAK,IAAI;6BAM3B,KAAK,MAAM,GAAG,KAAK,IAAI;;AAtBhE,wBAyIG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Fields, Grid } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** 是否启用网格布局 */
|
|
4
|
+
grid?: Grid;
|
|
5
|
+
/** 字段配置数组 */
|
|
6
|
+
fields?: Fields;
|
|
7
|
+
/** 是否禁用所有子字段 */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
fields: Fields;
|
|
13
|
+
grid: Grid;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItems/index.vue"],"names":[],"mappings":"AA6NA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAOhD,KAAK,KAAK,GAAG;IACX,eAAe;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;cADW,OAAO;YAFT,MAAM;UAFR,IAAI;;AA8Nb,wBAOG"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ComponentProps, ComponentExposed } from 'vue-component-type-helpers';
|
|
2
2
|
import { default as ProForm } from './ProForm/index.vue';
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as BaseFormItems } from './BaseFormItems/index.vue';
|
|
4
4
|
export { default as BaseField } from './BaseField/index.vue';
|
|
5
5
|
export { default as ContainerFragment } from './ContainerFragment/index.vue';
|
|
6
6
|
export { default as SlotComponent } from './SlotComponent/index.vue';
|
|
7
|
-
export { ProForm,
|
|
7
|
+
export { ProForm, BaseFormItems };
|
|
8
8
|
/** ProForm 的组件实例类型,用于 `ref` 标注与 `defineExpose` 访问 */
|
|
9
9
|
export type ProFormInstance = ComponentExposed<typeof ProForm>;
|
|
10
10
|
/** ProForm 的组件属性类型 */
|
|
11
11
|
export type ProFormProps = ComponentProps<typeof ProForm>;
|
|
12
|
-
/**
|
|
13
|
-
export type
|
|
14
|
-
/**
|
|
15
|
-
export type
|
|
12
|
+
/** BaseFormItems 的组件实例类型 */
|
|
13
|
+
export type ProFormItemsInstance = ComponentExposed<typeof BaseFormItems>;
|
|
14
|
+
/** BaseFormItems 的组件属性类型 */
|
|
15
|
+
export type ProFormItemsProps = ComponentProps<typeof BaseFormItems>;
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAGlC,qDAAqD;AACrD,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,OAAO,CAAC,CAAC;AAC/D,sBAAsB;AACtB,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;AAE1D,4BAA4B;AAC5B,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1E,4BAA4B;AAC5B,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import { FormItemProps, GridItemProps } from '../../../shared/ui';
|
|
3
3
|
import { FORM_ITEM_SLOT_KEYS } from '../constants';
|
|
4
4
|
import { Base, Field } from '../types';
|
|
@@ -18,8 +18,6 @@ export interface GroupedField {
|
|
|
18
18
|
formItemContainer?: Base['formItemContainer'];
|
|
19
19
|
/** 字段原始对象,供实例登记与访问器挂载使用 */
|
|
20
20
|
rawField: Field;
|
|
21
|
-
/** 渲染 key,取自字段对象身份 */
|
|
22
|
-
renderKey: string | number;
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* 将 fields 配置数组逐个拆分为 grid / formItem / component / slots 分组。
|
|
@@ -27,6 +25,18 @@ export interface GroupedField {
|
|
|
27
25
|
* @description
|
|
28
26
|
* 1. 响应式集成 ProComponentProvider 的 `pro-form-item` 全局变量配置;
|
|
29
27
|
* 2. 剥离 `extraProps`(用户自定义字段标识袋):保留在字段原始对象上供业务层存取,渲染层经解构剥离,不落入 componentProps 透传。
|
|
28
|
+
*
|
|
29
|
+
* @param {ComputedRef<Field[]>} validFields - 已过滤隐藏字段的字段配置数组
|
|
30
|
+
* @returns 字段渲染分组数组
|
|
30
31
|
*/
|
|
31
32
|
export declare function useGroupFieldAttrs(validFields: ComputedRef<Field[]>): ComputedRef<GroupedField[]>;
|
|
33
|
+
/**
|
|
34
|
+
* 将单个字段配置拆分为 grid / formItem / component / slots 分组
|
|
35
|
+
*
|
|
36
|
+
* @description 拆分规则与 `useGroupFieldAttrs` 一致,结果依赖该字段自身配置与 Provider 的 `pro-form-item` 默认值。
|
|
37
|
+
*
|
|
38
|
+
* @param {MaybeRefOrGetter<Field>} field - 待拆分的字段配置
|
|
39
|
+
* @returns {ComputedRef<GroupedField>} 单字段渲染分组
|
|
40
|
+
*/
|
|
41
|
+
export declare function useGroupedField(field: MaybeRefOrGetter<Field>): ComputedRef<GroupedField>;
|
|
32
42
|
//# sourceMappingURL=useGroupFieldAttrs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGroupFieldAttrs.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useGroupFieldAttrs.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useGroupFieldAttrs.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useGroupFieldAttrs.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAC;AACb,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAU5C,mBAAmB;AACnB,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,uBAAuB;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB;IACtB,aAAa,EAAE,MAAM,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IACjE,wBAAwB;IACxB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,iBAAiB;IACjB,iBAAiB,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC9C,2BAA2B;IAC3B,QAAQ,EAAE,KAAK,CAAC;CACjB;AAuFD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC,+BAQnE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,6BAO7D"}
|
|
@@ -10,4 +10,16 @@
|
|
|
10
10
|
* @returns 字段渲染 key
|
|
11
11
|
*/
|
|
12
12
|
export declare const getFieldKey: (field: unknown) => string | number;
|
|
13
|
+
/**
|
|
14
|
+
* 字段的数据行渲染 key
|
|
15
|
+
*
|
|
16
|
+
* @description 沿字段路径逐段解析原始表单数据,取路径经过的对象数组行元素身份与行内剩余路径组成 key;
|
|
17
|
+
* 同一数据行对象在数组增删 / 重排后恒得同一 key。路径不经过对象数组行、行元素为原始值或数据缺失时,
|
|
18
|
+
* 回退到 {@link getFieldKey} 的字段对象身份。同 key 的去重由调用方按兄弟列表收敛。
|
|
19
|
+
*
|
|
20
|
+
* @param field - 字段配置项
|
|
21
|
+
* @param rawFormData - 原始表单数据(非响应式对象)
|
|
22
|
+
* @returns 数据行 key;无法定位数据行时返回字段对象身份 key
|
|
23
|
+
*/
|
|
24
|
+
export declare const getFieldDataKey: (field: unknown, rawFormData: unknown) => string | number;
|
|
13
25
|
//# sourceMappingURL=fieldKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldKey.d.ts","sourceRoot":"","sources":["../../../../src/components/form/utils/fieldKey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fieldKey.d.ts","sourceRoot":"","sources":["../../../../src/components/form/utils/fieldKey.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,MAUrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,EACd,aAAa,OAAO,KACnB,MAAM,GAAG,MA6BX,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { ContainerComponent } from '../../form/types';
|
|
|
4
4
|
import { SearchFormProps } from './SearchForm.vue';
|
|
5
5
|
import { Table } from '../hooks/useTable';
|
|
6
6
|
import { Path } from '../../../shared/core';
|
|
7
|
-
import { Column, ColumnControlConfig } from '../types';
|
|
7
|
+
import { Column, ColumnControlConfig, EllipsisTooltipConfig } from '../types';
|
|
8
8
|
declare const _default: <T extends Table<any> = Table>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
9
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
10
10
|
readonly "onUpdate:size"?: ((value: import('ant-design-vue/es/button').ButtonSize) => any) | undefined;
|
|
@@ -33,6 +33,8 @@ declare const _default: <T extends Table<any> = Table>(__VLS_props: NonNullable<
|
|
|
33
33
|
};
|
|
34
34
|
/** 表格区域包裹容器 */
|
|
35
35
|
tableContainer?: ContainerComponent | false;
|
|
36
|
+
/** 表格级省略 Tooltip 配置;truthy 时全局启用 */
|
|
37
|
+
ellipsisTooltip?: boolean | EllipsisTooltipConfig;
|
|
36
38
|
} & TableProps) & Partial<{}>> & import('vue').PublicProps;
|
|
37
39
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
38
40
|
/** 手动触发一次查询(与内部搜索共用 loading 竞态守卫),便于外部刷新列表 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ProTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/ProTable.vue"],"names":[],"mappings":"AA0tBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,KAAK,EAEV,UAAU,EACV,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EASL,KAAK,IAAI,EACV,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAmBjD,OAAO,KAAK,EACV,MAAM,EAEN,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,UAAU,CAAC;yBAED,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,EAC5C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA8wBO,mBAAmB,CAAC;;;;eA1QnB,UAAU,CAAC,MAAM,CAAC;kBACf,OAAO;;QAnfjB,2BAA2B;gBACnB,CAAC;QACT,eAAe;iBACN,MAAM,OAAO,CAAC,OAAO,CAAC;QAC/B,iBAAiB;yBACA,OAAO;QACxB,oBAAoB;0BACF,OAAO;QACzB,yCAAyC;kBAC/B,OAAO,GAAG,OAAO;yBArBd,OAAO;2BACL,OAAO,GAAG,mBAAmB,CAAC,IAAI,4BAyOc,CAAC,iEAzOH,CAAC;UAoB1B;QACpC,kBAAkB;;qBAhBT,OAAO;wBAEJ,kBAAkB,GAAG,KAAK;;QAgBtC,eAAe;yBACE,kBAAkB,GAAG,KAAK;QAC3C,oCAAoC;0BAClB,OAAO,GAAG,qBAAqB;iCA6uB2C,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;QAvS7C,8CAA8C;;MAuSqB,GAAG,IAAI;WACpE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;mBA/nBI,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,MAAM,6BA6FqD,CAAC,iEA7FzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BA2F6C,CAAC,iEA3FlC,CAAC;SAC5B,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;mBALC,CAAC,KAAK,EAAE;YACjB,IAAI,EAAE,GAAG,CAAC;YACV,MAAM,6BA6FqD,CAAC,iEA7FzC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,4BA2F6C,CAAC,iEA3FlC,CAAC;SAC5B,KAAK,IAAI;;;EA8nBV,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAzxBzE,wBAyxB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EllipsisTooltipAnchorStyle } from '../hooks/useEllipsisTooltip';
|
|
2
|
+
import { EllipsisTooltipConfig } from '../types';
|
|
3
|
+
type HostTooltipProps = Omit<EllipsisTooltipConfig, 'getPopupContainer' | 'mouseEnterDelay' | 'mouseLeaveDelay'>;
|
|
4
|
+
type Props = {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
content?: string;
|
|
7
|
+
anchorStyle?: EllipsisTooltipAnchorStyle;
|
|
8
|
+
container?: () => HTMLElement | null | undefined;
|
|
9
|
+
} & /* @vue-ignore */ HostTooltipProps;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
|
+
open: boolean;
|
|
12
|
+
content: string;
|
|
13
|
+
anchorStyle: EllipsisTooltipAnchorStyle;
|
|
14
|
+
container: () => HTMLElement | null | undefined;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
tooltipRef: unknown;
|
|
17
|
+
}, any>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=TableEllipsisTooltip.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableEllipsisTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableEllipsisTooltip.vue"],"names":[],"mappings":"AAqGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAItD,KAAK,gBAAgB,GAAG,IAAI,CAC1B,qBAAqB,EACrB,mBAAmB,GAAG,iBAAiB,GAAG,iBAAiB,CAC5D,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,0BAA0B,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;CAClD,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;;UAJ9B,OAAO;aACJ,MAAM;iBACF,0BAA0B;eAC5B,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS;;;;AA2IlD,wBAQG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/** 省略单元格标记属性,由列转换写入 body 单元格 */
|
|
3
|
+
export declare const ELLIPSIS_TOOLTIP_CELL_ATTR = "data-pro-table-ellipsis";
|
|
4
|
+
/** ProTable 根节点归属标记 */
|
|
5
|
+
export declare const PRO_TABLE_ROOT_ATTR = "data-pro-table-root";
|
|
6
|
+
/** 共享 Tooltip 锚点样式 */
|
|
7
|
+
export type EllipsisTooltipAnchorStyle = {
|
|
8
|
+
position: 'fixed';
|
|
9
|
+
pointerEvents: 'none';
|
|
10
|
+
opacity: number;
|
|
11
|
+
left?: string;
|
|
12
|
+
top?: string;
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
};
|
|
16
|
+
/** 共享 Tooltip 状态与事件处理器 */
|
|
17
|
+
export type EllipsisTooltipState = {
|
|
18
|
+
/** Tooltip 是否展示 */
|
|
19
|
+
open: Ref<boolean>;
|
|
20
|
+
/** Tooltip 文本 */
|
|
21
|
+
content: Ref<string>;
|
|
22
|
+
/** 固定定位锚点样式 */
|
|
23
|
+
anchorStyle: Ref<EllipsisTooltipAnchorStyle>;
|
|
24
|
+
/** 根节点 mouseover 处理器 */
|
|
25
|
+
onMouseOver: (event: MouseEvent) => void;
|
|
26
|
+
/** 根节点 mouseout 处理器 */
|
|
27
|
+
onMouseOut: (event: MouseEvent) => void;
|
|
28
|
+
/** 关闭 Tooltip */
|
|
29
|
+
close: () => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 表格级共享省略 Tooltip
|
|
33
|
+
*
|
|
34
|
+
* @description
|
|
35
|
+
* 在 ProTable 根节点上以事件委托识别带标记的 body 单元格,维护单个 Tooltip 的显隐、文本与固定定位锚点;
|
|
36
|
+
* 仅在单元格文本横向溢出时触发;表格滚动、窗口尺寸变化、KeepAlive 停用时关闭,卸载时移除监听。
|
|
37
|
+
*
|
|
38
|
+
* @param rootRef - ProTable 根节点引用
|
|
39
|
+
* @param enabled - 是否启用共享 Tooltip;为 false 时不注册全局监听
|
|
40
|
+
* @param delay - 悬停延迟(ms),0 表示立即展示
|
|
41
|
+
* @param leaveDelay - 移出延迟(ms),0 表示立即关闭
|
|
42
|
+
* @returns Tooltip 状态与根节点事件处理器
|
|
43
|
+
*/
|
|
44
|
+
export declare function useEllipsisTooltip(rootRef: Ref<HTMLElement | null | undefined>, enabled: Ref<boolean>, delay: Ref<number>, leaveDelay: Ref<number>): EllipsisTooltipState;
|
|
45
|
+
//# sourceMappingURL=useEllipsisTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEllipsisTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/table/hooks/useEllipsisTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,KAAK,CAAC;AAEb,gCAAgC;AAChC,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AAEpE,uBAAuB;AACvB,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,sBAAsB;AACtB,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB;IACnB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACnB,iBAAiB;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,eAAe;IACf,WAAW,EAAE,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAC7C,wBAAwB;IACxB,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,uBAAuB;IACvB,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,iBAAiB;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AA8BF;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,EAC5C,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,EACrB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GACtB,oBAAoB,CA2JtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 省略 Tooltip 列转换
|
|
4
|
+
*
|
|
5
|
+
* @description 一次遍历完成 hidden 过滤、分组子列递归与 showTooltip 列标记;
|
|
6
|
+
* 仅对发生变化的列生成克隆并登记原始列,供宿主回传列对象时还原。
|
|
7
|
+
* 列还原最多回溯两跳(宿主克隆 → 转换克隆 → 原始列),依赖单遍转换每列最多产生一层克隆。
|
|
8
|
+
*
|
|
9
|
+
* @param getColumns - 读取原始列配置
|
|
10
|
+
* @param globalEnabled - 是否全局启用列 Tooltip
|
|
11
|
+
* @returns 可见列、是否含 Tooltip 列与列还原函数
|
|
12
|
+
*/
|
|
13
|
+
export declare function useEllipsisTooltipColumns(getColumns: () => any[], globalEnabled?: () => boolean): {
|
|
14
|
+
columns: ComputedRef<any[]>;
|
|
15
|
+
hasTooltip: ComputedRef<boolean>;
|
|
16
|
+
resolveOriginalColumn: (column: any) => any;
|
|
17
|
+
resolveSorterColumn: (sorter: any) => any;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useEllipsisTooltipColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEllipsisTooltipColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/table/hooks/useEllipsisTooltipColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAUjE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GAAG,EAAE,EACvB,aAAa,GAAE,MAAM,OAAqB,GACzC;IACD,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,qBAAqB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAC5C,mBAAmB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;CAC3C,CA6GA"}
|
|
@@ -4,7 +4,7 @@ import { default as ProTable } from './components/ProTable.vue';
|
|
|
4
4
|
export type ProTableProps = ComponentProps<typeof ProTable>;
|
|
5
5
|
/** ProTable 的组件实例类型,用于 `ref` 标注与 `defineExpose` 访问 */
|
|
6
6
|
export type ProTableInstance = ComponentExposed<typeof ProTable>;
|
|
7
|
-
export { type Column, type ColumnControlConfig, type Columns } from './types';
|
|
7
|
+
export { type Column, type ColumnControlConfig, type ColumnEllipsis, type Columns, type EllipsisTooltipConfig, } from './types';
|
|
8
8
|
export { useTable, type Table } from './hooks';
|
|
9
9
|
export { type PageParam } from '../../shared/core';
|
|
10
10
|
export default ProTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAEjD,uBAAuB;AACvB,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGjE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAEjD,uBAAuB;AACvB,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGjE,OAAO,EACL,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,46 @@
|
|
|
1
|
-
import { ColumnType } from '../../../shared/ui';
|
|
1
|
+
import { ColumnType, TooltipProps } from '../../../shared/ui';
|
|
2
2
|
import { Data, KeyExpandString, Paths, Path } from '../../../shared/core';
|
|
3
3
|
import { ComputedRef, MaybeRef } from 'vue';
|
|
4
4
|
type MaybeRefOrComputedRef<T = any> = MaybeRef<T> | ComputedRef<T>;
|
|
5
|
+
/**
|
|
6
|
+
* 列内容省略配置
|
|
7
|
+
*
|
|
8
|
+
* @description 在宿主 `ellipsis` 基础上增加 `showTooltip`:单元格文本横向溢出时,
|
|
9
|
+
* 悬停由表格级共享的同一个 Tooltip 展示完整文本。`showTooltip` 为 `true` 时不输出宿主原生 `title`。
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const column: Column<User> = {
|
|
14
|
+
* dataIndex: 'name',
|
|
15
|
+
* ellipsis: { showTooltip: true },
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type ColumnEllipsis = NonNullable<Exclude<ColumnType['ellipsis'], boolean>> & {
|
|
22
|
+
/** 文本溢出时是否显示表格级共享 Tooltip */
|
|
23
|
+
showTooltip?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* ProTable 共享省略 Tooltip 配置
|
|
27
|
+
*
|
|
28
|
+
* @description 复用宿主 Tooltip 的容器、延迟、方位与浮层样式字段,控制表格级单例 Tooltip。
|
|
29
|
+
* ProTable 侧另接受 `true` 作为全局启用简写;列上 `showTooltip: false` 或 `ellipsis: false` 可退出。
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const config: EllipsisTooltipConfig = {
|
|
34
|
+
* getPopupContainer: () => document.body,
|
|
35
|
+
* mouseEnterDelay: 0.2,
|
|
36
|
+
* mouseLeaveDelay: 0.1,
|
|
37
|
+
* placement: 'top',
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export type EllipsisTooltipConfig = Pick<TooltipProps, 'getPopupContainer' | 'mouseEnterDelay' | 'mouseLeaveDelay' | 'placement' | 'arrow' | 'autoAdjustOverflow' | 'color' | 'overlayClassName' | 'overlayStyle' | 'overlayInnerStyle'>;
|
|
5
44
|
/**
|
|
6
45
|
* 表格列配置类型
|
|
7
46
|
*
|
|
@@ -9,6 +48,7 @@ type MaybeRefOrComputedRef<T = any> = MaybeRef<T> | ComputedRef<T>;
|
|
|
9
48
|
* - 类型安全的 dataIndex(基于泛型 D 推导路径),优先使用
|
|
10
49
|
* - key 作为辅助标识,当 dataIndex 不满足需求时使用
|
|
11
50
|
* - hidden 属性用于控制列显隐
|
|
51
|
+
* - ellipsis 支持 `{ showTooltip: boolean }` 的表格级共享 Tooltip
|
|
12
52
|
* - 所有 Ant Design Vue 原生的列属性依然可用(title、width、fixed、align 等)
|
|
13
53
|
*
|
|
14
54
|
* @template D - 表格行数据类型
|
|
@@ -33,7 +73,7 @@ type MaybeRefOrComputedRef<T = any> = MaybeRef<T> | ComputedRef<T>;
|
|
|
33
73
|
* ]
|
|
34
74
|
* ```
|
|
35
75
|
*/
|
|
36
|
-
export type Column<D extends Data = Data> = Omit<ColumnType, 'dataIndex' | 'key'> & {
|
|
76
|
+
export type Column<D extends Data = Data> = Omit<ColumnType, 'dataIndex' | 'key' | 'ellipsis'> & {
|
|
37
77
|
/**
|
|
38
78
|
* 列数据路径(主要字段)
|
|
39
79
|
* 关联数据源中对应字段的路径,支持点号分隔的深层路径和数组路径。
|
|
@@ -54,6 +94,10 @@ export type Column<D extends Data = Data> = Omit<ColumnType, 'dataIndex' | 'key'
|
|
|
54
94
|
* @default false
|
|
55
95
|
*/
|
|
56
96
|
hidden?: MaybeRefOrComputedRef<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* 列内容省略配置;`true` 等价于宿主默认省略,对象形态额外支持表格级共享 Tooltip
|
|
99
|
+
*/
|
|
100
|
+
ellipsis?: boolean | ColumnEllipsis;
|
|
57
101
|
/**
|
|
58
102
|
* 分组子列;提供时该列作为分组表头渲染,子列沿用同一配置类型
|
|
59
103
|
*/
|