@done-coding/admin-core 0.1.1-alpha.8 → 0.1.2
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/es/components/data-view/DataListView.vue.mjs +7 -0
- package/es/components/data-view/DataListView.vue2.mjs +116 -0
- package/es/components/data-view/DataListViewItem.vue.mjs +7 -0
- package/es/components/data-view/DataListViewItem.vue2.mjs +17 -0
- package/es/components/display/HeightProvider.vue.mjs +38 -0
- package/es/components/display/HeightProvider.vue2.mjs +4 -0
- package/es/components/display/TabsMain.vue.mjs +5 -59
- package/es/components/display/TabsMain.vue2.mjs +95 -2
- package/es/components/display/index.mjs +11 -9
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +72 -67
- package/es/components/table/TableMain.vue.mjs +4 -4
- package/es/components/table/TableMain.vue2.mjs +183 -160
- package/es/index.mjs +80 -77
- package/es/inject/key.mjs +5 -2
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/data-view/DataListView.vue.d.ts +26 -0
- package/types/components/data-view/DataListViewItem.vue.d.ts +26 -0
- package/types/components/data-view/index.d.ts +9 -0
- package/types/components/data-view/types.d.ts +71 -0
- package/types/components/display/HeightProvider.vue.d.ts +39 -0
- package/types/components/display/TabsMain.vue.d.ts +22 -32
- package/types/components/display/index.d.ts +22 -1
- package/types/components/display/types.d.ts +46 -0
- package/types/components/form/FormItem.vue.d.ts +1 -1
- package/types/components/form/FormRadioGroup.vue.d.ts +13 -13
- package/types/components/form/FormSearch.vue.d.ts +1 -1
- package/types/components/list-page/ListPage.vue.d.ts +7 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +9 -1
- package/types/components/table/types.d.ts +6 -0
- package/types/inject/key.d.ts +11 -0
package/es/inject/key.mjs
CHANGED
package/es/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table-main-table[data-v-
|
|
1
|
+
.form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.tabs-main-bar[data-v-c9b7515f]{position:relative;display:flex;align-items:center}.tabs-main-bar-item[data-v-c9b7515f]{padding:8px 16px;border:none;background:transparent;font-size:14px;color:var(--el-text-color-regular);cursor:pointer}.tabs-main-bar-item_active[data-v-c9b7515f]{color:var(--el-color-primary)}.tabs-main-bar-indicator[data-v-c9b7515f]{position:absolute;bottom:0;left:0;height:2px;background:var(--el-color-primary);transition:transform .2s,width .2s}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.data-list-view[data-v-4c7d7547]{width:100%}.table-main-table[data-v-4a2a0938]{--el-table-header-bg-color: var(--v1b467e54)}.table-main-pagination[data-v-4a2a0938]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-6b075cdc]{min-height:var(--v111f9ca3)}.list-page-header[data-v-6b075cdc],.list-page-operation[data-v-6b075cdc]{margin-bottom:10px}.list-page[data-v-6b075cdc] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/admin-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "后台管理核心",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"node": ">=18.0.0",
|
|
78
78
|
"pnpm": ">=9.0.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "0de1a92c049b97d88c763479a05a9c9331d7b0e3"
|
|
81
81
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { DataListViewProps, DataListViewInstance } from './types';
|
|
3
|
+
|
|
4
|
+
declare const _default: <T extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
6
|
+
readonly onSelectionChange?: ((rows: T[]) => any) | undefined;
|
|
7
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & DataListViewProps<T>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
8
|
+
expose(exposed: import('vue').ShallowUnwrapRef<DataListViewInstance<T>>): void;
|
|
9
|
+
attrs: any;
|
|
10
|
+
slots: ReturnType<() => {
|
|
11
|
+
item?(_: {
|
|
12
|
+
fieldComponentMap: Record<string, Component>;
|
|
13
|
+
row: T;
|
|
14
|
+
index: number;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
toggleSelect: () => void;
|
|
17
|
+
}): any;
|
|
18
|
+
}>;
|
|
19
|
+
emit: (e: "selectionChange", rows: T[]) => void;
|
|
20
|
+
}>) => import('vue').VNode & {
|
|
21
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_Prettify<T> = {
|
|
25
|
+
[K in keyof T]: T[K];
|
|
26
|
+
} & {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
/** 当前项是否选中(由 DataListView 传入) */
|
|
6
|
+
selected: boolean;
|
|
7
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
/** 当前项是否选中(由 DataListView 传入) */
|
|
9
|
+
selected: boolean;
|
|
10
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as DataListView } from './DataListView.vue';
|
|
2
|
+
import { default as DataListViewItem } from './DataListViewItem.vue';
|
|
3
|
+
|
|
4
|
+
export * from './types';
|
|
5
|
+
/**
|
|
6
|
+
* data-view 是 table 的内部衍生品:仅供 TableMain 内部 import,
|
|
7
|
+
* [MUST NOT] 对外导出 / 全局注册 / 提供 install 插件(不进 core 顶层 export)。
|
|
8
|
+
*/
|
|
9
|
+
export { DataListView, DataListViewItem };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { ElTableColumnProps } from '../table';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DataListView 字段渲染作用域
|
|
6
|
+
* ---
|
|
7
|
+
* 喂给 FieldColumn.render 的作用域;布局无关,仅含行数据与索引。
|
|
8
|
+
*/
|
|
9
|
+
export interface DataListViewRenderScope<T extends Record<string, any> = Record<string, any>> {
|
|
10
|
+
/** 当前行数据 */
|
|
11
|
+
row: T;
|
|
12
|
+
/** 当前行索引 */
|
|
13
|
+
index: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DataListView 列配置(table 的内部衍生品:从 ElTableColumnProps Pick 复用子集,
|
|
17
|
+
* ElTableColumnProps 零触碰;本类型不对外导出,仅 table 内部消费)
|
|
18
|
+
*/
|
|
19
|
+
export type DataViewColumn = Partial<Pick<ElTableColumnProps<any, any>, "prop" | "label" | "type" | "render">>;
|
|
20
|
+
/**
|
|
21
|
+
* DataListView props
|
|
22
|
+
* ---
|
|
23
|
+
* 布局无关的数据项容器:分页数据由外部传入,一行几个由消费方在 #item
|
|
24
|
+
* 外层用 CSS 决定,本组件不内置任何列数 / 布局。
|
|
25
|
+
*/
|
|
26
|
+
export interface DataListViewProps<T extends Record<string, any> = Record<string, any>> {
|
|
27
|
+
/** 当前页数据(外部传入,组件不持有请求 / 分页逻辑) */
|
|
28
|
+
data: T[];
|
|
29
|
+
/** 行唯一键:行数据键名 或 取键函数(内部统一 String 化) */
|
|
30
|
+
rowKey: string | ((row: T) => string);
|
|
31
|
+
/** 列配置,内部归一为 fieldComponentMap 喂 #item */
|
|
32
|
+
columns: DataViewColumn[];
|
|
33
|
+
/** 最大高度;传入时容器超出内容出现垂直滚动条,缺省不限高 */
|
|
34
|
+
maxHeight?: number;
|
|
35
|
+
/** 是否启用选中能力,缺省关闭 */
|
|
36
|
+
selectable?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* DataListView 对外实例方法
|
|
40
|
+
* ---
|
|
41
|
+
* 形状镜像 TableMain 的 ELTable 选中导出(selectedList / clearSelection),
|
|
42
|
+
* 便于 phase 2 TableMain 接线做薄 adapter。
|
|
43
|
+
*/
|
|
44
|
+
export interface DataListViewInstance<T extends Record<string, any> = Record<string, any>> {
|
|
45
|
+
/** 获取当前选中行 */
|
|
46
|
+
getSelected: () => T[];
|
|
47
|
+
/** 清空选中 */
|
|
48
|
+
clearSelection: () => void;
|
|
49
|
+
/** 全选 / 全不选 */
|
|
50
|
+
toggleAll: (checked: boolean) => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* #item 作用域插槽 props
|
|
54
|
+
* ---
|
|
55
|
+
* fieldComponentMap:列 key(prop / $type_index / $type_selection)→ 稳定字段组件
|
|
56
|
+
* (标识跨渲染稳定,对齐 FormItem 范式)。消费方:
|
|
57
|
+
* `<component :is="fieldComponentMap['x']" :row="row" :index="index"
|
|
58
|
+
* :selected="selected" :toggle-select="toggleSelect" />`(数据走 props)。
|
|
59
|
+
*/
|
|
60
|
+
export interface DataListViewItemScope<T extends Record<string, any> = Record<string, any>> {
|
|
61
|
+
/** 列 key → 稳定字段组件(props: row/index/selected/toggleSelect) */
|
|
62
|
+
fieldComponentMap: Record<string, Component>;
|
|
63
|
+
/** 当前行数据 */
|
|
64
|
+
row: T;
|
|
65
|
+
/** 当前行索引 */
|
|
66
|
+
index: number;
|
|
67
|
+
/** 当前行是否选中 */
|
|
68
|
+
selected: boolean;
|
|
69
|
+
/** 翻转当前行选中态 */
|
|
70
|
+
toggleSelect: () => void;
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HeightProviderProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
header?(_: {}): any;
|
|
5
|
+
default?(_: {
|
|
6
|
+
height: number;
|
|
7
|
+
}): any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<HeightProviderProps>, {
|
|
10
|
+
channel: symbol;
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<HeightProviderProps>, {
|
|
12
|
+
channel: symbol;
|
|
13
|
+
}>>> & Readonly<{}>, {
|
|
14
|
+
channel: symbol;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -1,47 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
currentValue: string | undefined;
|
|
1
|
+
import { TabsMainItem } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): Partial<Record<`header-${string}`, (_: {
|
|
4
|
+
tab: TabsMainItem;
|
|
5
|
+
active: boolean;
|
|
7
6
|
}) => any>>;
|
|
8
7
|
declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
9
8
|
modelValue: import('vue').PropType<string>;
|
|
10
|
-
|
|
11
|
-
type: globalThis.PropType<
|
|
12
|
-
value: string;
|
|
13
|
-
title: string;
|
|
14
|
-
}[]>;
|
|
15
|
-
required: true;
|
|
9
|
+
height: {
|
|
10
|
+
type: globalThis.PropType<number>;
|
|
16
11
|
};
|
|
17
|
-
|
|
18
|
-
type: globalThis.PropType<
|
|
19
|
-
default:
|
|
12
|
+
channel: {
|
|
13
|
+
type: globalThis.PropType<symbol>;
|
|
14
|
+
default: symbol;
|
|
20
15
|
};
|
|
21
|
-
|
|
22
|
-
type: globalThis.PropType<
|
|
23
|
-
|
|
16
|
+
tabs: {
|
|
17
|
+
type: globalThis.PropType<TabsMainItem[]>;
|
|
18
|
+
required: true;
|
|
24
19
|
};
|
|
25
20
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
26
21
|
modelValue: import('vue').PropType<string>;
|
|
27
|
-
|
|
28
|
-
type: globalThis.PropType<
|
|
29
|
-
value: string;
|
|
30
|
-
title: string;
|
|
31
|
-
}[]>;
|
|
32
|
-
required: true;
|
|
22
|
+
height: {
|
|
23
|
+
type: globalThis.PropType<number>;
|
|
33
24
|
};
|
|
34
|
-
|
|
35
|
-
type: globalThis.PropType<
|
|
36
|
-
default:
|
|
25
|
+
channel: {
|
|
26
|
+
type: globalThis.PropType<symbol>;
|
|
27
|
+
default: symbol;
|
|
37
28
|
};
|
|
38
|
-
|
|
39
|
-
type: globalThis.PropType<
|
|
40
|
-
|
|
29
|
+
tabs: {
|
|
30
|
+
type: globalThis.PropType<TabsMainItem[]>;
|
|
31
|
+
required: true;
|
|
41
32
|
};
|
|
42
33
|
}>> & Readonly<{}>, {
|
|
43
|
-
|
|
44
|
-
notNull: boolean;
|
|
34
|
+
channel: symbol;
|
|
45
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
36
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
47
37
|
export default _default;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
2
|
import { default as WatchSize } from './WatchSize.vue';
|
|
3
3
|
import { default as TabsMain } from './TabsMain.vue';
|
|
4
|
+
import { default as HeightProvider } from './HeightProvider.vue';
|
|
4
5
|
|
|
5
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
/**
|
|
8
|
+
* 尺寸监听容器:debounce 测量默认槽内容的宽 / 高,
|
|
9
|
+
* 通过 `@height-change` / `@size-change` 上报,供高度预算等场景复用。
|
|
10
|
+
*/
|
|
11
|
+
WatchSize,
|
|
12
|
+
/**
|
|
13
|
+
* Tab 容器组件:手写 tab-bar + 滑动下划线,内部组合 HeightProvider
|
|
14
|
+
* 做高度预算。激活 tab 经 `v-model<string>` 双向绑定并自动归一;
|
|
15
|
+
* 内容懒渲染(首次激活前不实例化)+ KeepAlive(切走保活、切回复用,
|
|
16
|
+
* 状态保留)。内容槽 `#{key}` > `tabs[].component`,
|
|
17
|
+
* 标题槽 `#header-{key}` > `tabs[].title`,两类槽作用域均 `{ tab, active }`。
|
|
18
|
+
*/
|
|
19
|
+
TabsMain,
|
|
20
|
+
/**
|
|
21
|
+
* 递归高度预算节点:按 `height` → 祖先同 channel inject → `0` 优先级
|
|
22
|
+
* 取得预算,扣除 `#header` 槽实测高度后将剩余可用高度沿同 channel
|
|
23
|
+
* provide 给后代。默认槽作用域 `{ height }` 提供当前可用高度数值。
|
|
24
|
+
*/
|
|
25
|
+
HeightProvider, };
|
|
6
26
|
export declare const displayInstall: Plugin;
|
|
27
|
+
export * from './types';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `HeightProvider` 组件 props。
|
|
5
|
+
*
|
|
6
|
+
* 单组件即一个高度预算节点:预算优先级严格为
|
|
7
|
+
* `height`(显式传入)→ 同 channel 最近祖先 HeightProvider 经 inject 下分的
|
|
8
|
+
* 剩余高度 → 兜底 `0`。节点扣除自身 `#header` 槽实测高度后,
|
|
9
|
+
* 将剩余可用高度沿同 channel `provide` 给后代,形成递归预算链。
|
|
10
|
+
*/
|
|
11
|
+
export interface HeightProviderProps {
|
|
12
|
+
/** px,预算最高优先级来源(非空时无视祖先 inject;height=0 视为显式 0) */
|
|
13
|
+
height?: number;
|
|
14
|
+
/** 预算 channel,默认 FULLSCREEN_HEIGHT_CHANNEL */
|
|
15
|
+
channel?: symbol;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `TabsMain` 单个 tab 项配置。
|
|
19
|
+
*
|
|
20
|
+
* 内容渲染优先级:`#{key}` 内容槽 > `component` > 空。
|
|
21
|
+
* 标题渲染优先级:`#header-{key}` 标题槽 > `title` 文本。
|
|
22
|
+
*/
|
|
23
|
+
export interface TabsMainItem {
|
|
24
|
+
/** tab 唯一标识,v-model 值与槽名(#{key} / #header-{key})均以此为准 */
|
|
25
|
+
key: string;
|
|
26
|
+
/** tab 标题文本,#header-{key} 槽缺省时回退此文本 */
|
|
27
|
+
title: string;
|
|
28
|
+
/** tab 内容组件,#{key} 槽缺省时回退渲染此组件 */
|
|
29
|
+
component?: Component;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `TabsMain` 组件 props。
|
|
33
|
+
*
|
|
34
|
+
* `channel` / `height` 原样透传内部组合的 HeightProvider,
|
|
35
|
+
* tab-bar 占用 HeightProvider 的 `#header` 槽并计入 reserve,
|
|
36
|
+
* 内容区消费剩余可用高度。激活 tab 由 `v-model<string>` 双向绑定,
|
|
37
|
+
* 非法或空值自动归一到首个 tab。
|
|
38
|
+
*/
|
|
39
|
+
export interface TabsMainProps {
|
|
40
|
+
/** tab 配置列表 */
|
|
41
|
+
tabs: TabsMainItem[];
|
|
42
|
+
/** 预算 channel,默认 FULLSCREEN_HEIGHT_CHANNEL,透传内部 HeightProvider */
|
|
43
|
+
channel?: symbol;
|
|
44
|
+
/** px,透传 HeightProvider 供顶层使用 */
|
|
45
|
+
height?: number;
|
|
46
|
+
}
|
|
@@ -26,11 +26,11 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
|
|
|
26
26
|
}) => void;
|
|
27
27
|
submit: (type: FormItemSubmitType) => void;
|
|
28
28
|
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FormMainItemProps>>> & Readonly<{
|
|
29
|
-
onSubmit?: ((type: FormItemSubmitType) => any) | undefined;
|
|
30
29
|
onViewHideChange?: ((info: {
|
|
31
30
|
config: FormMainItemProps["config"];
|
|
32
31
|
status: boolean;
|
|
33
32
|
}) => any) | undefined;
|
|
33
|
+
onSubmit?: ((type: FormItemSubmitType) => any) | undefined;
|
|
34
34
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
35
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
36
36
|
export default _default;
|
|
@@ -2,34 +2,34 @@ import { OptionItem } from './types';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
4
|
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
5
|
-
|
|
6
|
-
type: globalThis.PropType<
|
|
7
|
-
|
|
5
|
+
options: {
|
|
6
|
+
type: globalThis.PropType<OptionItem[]>;
|
|
7
|
+
required: true;
|
|
8
8
|
};
|
|
9
9
|
mode: {
|
|
10
10
|
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
|
-
options: {
|
|
14
|
-
type: globalThis.PropType<OptionItem[]>;
|
|
15
|
-
required: true;
|
|
16
|
-
};
|
|
17
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
|
-
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
19
13
|
notNull: {
|
|
20
14
|
type: globalThis.PropType<boolean>;
|
|
21
15
|
default: boolean;
|
|
22
16
|
};
|
|
17
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
|
+
modelValue: import('vue').PropType<OptionItem["value"]>;
|
|
19
|
+
options: {
|
|
20
|
+
type: globalThis.PropType<OptionItem[]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
23
|
mode: {
|
|
24
24
|
type: globalThis.PropType<"radio" | "buttonGroup">;
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
type: globalThis.PropType<
|
|
29
|
-
|
|
27
|
+
notNull: {
|
|
28
|
+
type: globalThis.PropType<boolean>;
|
|
29
|
+
default: boolean;
|
|
30
30
|
};
|
|
31
31
|
}>> & Readonly<{}>, {
|
|
32
|
-
notNull: boolean;
|
|
33
32
|
mode: "radio" | "buttonGroup";
|
|
33
|
+
notNull: boolean;
|
|
34
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
35
|
export default _default;
|
|
@@ -3,8 +3,8 @@ import { FormSearchInstance, FormSearchProps, FormSearchSearchType } from './typ
|
|
|
3
3
|
declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
5
5
|
readonly onSearch?: ((data: import('./types').ExcludeNeverProperties<import('./types').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, type: FormSearchSearchType) => any) | undefined;
|
|
6
|
-
readonly onHeightChange?: ((height: number) => any) | undefined;
|
|
7
6
|
readonly onVisibleChange?: ((status: boolean) => any) | undefined;
|
|
7
|
+
readonly onHeightChange?: ((height: number) => any) | undefined;
|
|
8
8
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & FormSearchProps<PO, SO, SQ>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
9
9
|
expose(exposed: import('vue').ShallowUnwrapRef<FormSearchInstance>): void;
|
|
10
10
|
attrs: any;
|
|
@@ -42,6 +42,13 @@ declare const _default: <T extends Record<string, any>, PO extends Record<string
|
|
|
42
42
|
}) => any>> & {
|
|
43
43
|
header?(_: {}): any;
|
|
44
44
|
operation?(_: {}): any;
|
|
45
|
+
"custom-view-item"?(_: {
|
|
46
|
+
fieldComponentMap: Record<string, globalThis.Component>;
|
|
47
|
+
row: T;
|
|
48
|
+
index: number;
|
|
49
|
+
selected: boolean;
|
|
50
|
+
toggleSelect: () => void;
|
|
51
|
+
}): any;
|
|
45
52
|
}>;
|
|
46
53
|
emit: {
|
|
47
54
|
(e: "dataChange", data: T[]): void;
|
|
@@ -72,8 +72,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
|
|
|
72
72
|
}>>> & Readonly<{
|
|
73
73
|
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
74
74
|
}>, {
|
|
75
|
-
reverse: boolean;
|
|
76
75
|
width: number | string;
|
|
76
|
+
reverse: boolean;
|
|
77
77
|
showClose: boolean;
|
|
78
78
|
cancelText: string | (() => VNode);
|
|
79
79
|
confirmText: string | (() => VNode);
|
|
@@ -27,7 +27,15 @@ declare const _default: <T extends Record<string, any>, SQ extends Record<string
|
|
|
27
27
|
$index: number;
|
|
28
28
|
injectInfo: F;
|
|
29
29
|
exposeInfo: TableMainInstance;
|
|
30
|
-
}) => any
|
|
30
|
+
}) => any>> & {
|
|
31
|
+
"custom-view-item"?(_: {
|
|
32
|
+
fieldComponentMap: Record<string, globalThis.Component>;
|
|
33
|
+
row: T;
|
|
34
|
+
index: number;
|
|
35
|
+
selected: boolean;
|
|
36
|
+
toggleSelect: () => void;
|
|
37
|
+
}): any;
|
|
38
|
+
}>;
|
|
31
39
|
emit: {
|
|
32
40
|
(e: "pageChange" | "pageSizeChange", value: number): void;
|
|
33
41
|
(e: "dataChange", data: T[]): void;
|
|
@@ -140,6 +140,12 @@ SQ extends Record<string, any>,
|
|
|
140
140
|
F extends Record<string, any>> {
|
|
141
141
|
/** 展示分页器 */
|
|
142
142
|
showPager?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* 显式开启自定义视图(DataListView 替代 ElTable,分页/取数仍由 TableMain 持有)。
|
|
145
|
+
* 缺省 false——为 false 时渲染/选中与原 ElTable 逐行为等价(零回归)。
|
|
146
|
+
* 需配合 #custom-view-item 作用域插槽定义单项。
|
|
147
|
+
*/
|
|
148
|
+
customView?: boolean;
|
|
143
149
|
/** 是否显示 toolbar(顶层开关,默认 true,优先级高于 toolbar.leftFeatures / rightFeatures) */
|
|
144
150
|
showToolbar?: boolean;
|
|
145
151
|
/** toolbar 配置 */
|
package/types/inject/key.d.ts
CHANGED
|
@@ -9,3 +9,14 @@
|
|
|
9
9
|
* 产生多个 Symbol → inject/provide 失配 → 列表精细化高度计算塌陷至 fallback。
|
|
10
10
|
*/
|
|
11
11
|
export declare const BODY_CONTENT_VIEWPORT_HEIGHT: unique symbol;
|
|
12
|
+
/**
|
|
13
|
+
* 全屏高度预算 channel
|
|
14
|
+
* ---
|
|
15
|
+
* HeightProvider 沿此 channel 向后代 provide「扣除自身 chrome 后剩余可用高度」,
|
|
16
|
+
* 形成与 BODY_CONTENT_VIEWPORT_HEIGHT 完全独立、并存的递归高度预算链。
|
|
17
|
+
* ---
|
|
18
|
+
* 同样使用 `Symbol.for` 全局注册表保证跨包 / 跨 chunk / 跨 ESM 实例的 Symbol 唯一性
|
|
19
|
+
* (dev 走 src、prod 走 es 双 module instance,`Symbol(key)` 会产生两个不同 Symbol
|
|
20
|
+
* 导致 provide/inject 失配 → 预算链断裂)。
|
|
21
|
+
*/
|
|
22
|
+
export declare const FULLSCREEN_HEIGHT_CHANNEL: unique symbol;
|