@done-coding/admin-core 0.12.0 → 0.12.2-alpha.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/README.md +1 -48
- package/es/bridge/index.mjs +75 -72
- package/es/bridge/layout.mjs +51 -0
- package/es/bridge/theme/index.mjs +1 -1
- package/es/bridge/theme/persist.mjs +1 -1
- package/es/components/app-layout/AppAside.vue.mjs +2 -2
- package/es/components/app-layout/AppAside.vue2.mjs +27 -10
- package/es/components/app-layout/AppCollapseToggle.vue.mjs +7 -0
- package/es/components/app-layout/AppCollapseToggle.vue2.mjs +54 -0
- package/es/components/app-layout/AppFooter.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue.mjs +3 -3
- package/es/components/app-layout/AppHeader.vue2.mjs +1 -1
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +3 -3
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +41 -61
- package/es/components/app-layout/AppTheme.vue.mjs +3 -3
- package/es/components/app-layout/viewport.mjs +3 -3
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/form/FormItemNestForm.vue.mjs +2 -2
- package/es/components/form/FormItemNestFormList.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue.mjs +1 -1
- package/es/components/form/FormVerifyImage.vue.mjs +1 -1
- package/es/components/table/TableToolbar.vue.mjs +3 -3
- package/es/hooks/use-theme-apply.mjs +255 -0
- package/es/hooks/use-viewport-apply.mjs +39 -0
- package/es/index.mjs +92 -91
- package/es/inject/key.mjs +13 -13
- package/es/store/app.mjs +69 -62
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +1 -0
- package/package.json +6 -8
- package/types/bridge/config-hook.d.ts +0 -68
- package/types/bridge/index.d.ts +18 -417
- package/types/bridge/layout.d.ts +25 -0
- package/types/bridge/plugin.d.ts +12 -30
- package/types/bridge/route.d.ts +1 -20
- package/types/bridge/state.d.ts +0 -14
- package/types/bridge/storage.d.ts +0 -9
- package/types/bridge/theme/index.d.ts +1 -8
- package/types/bridge/theme/persist.d.ts +3 -15
- package/types/bridge/theme/system-dark.d.ts +0 -12
- package/types/bridge/theme/types.d.ts +27 -265
- package/types/components/app-layout/AppAside.vue.d.ts +0 -1
- package/types/components/app-layout/AppCollapseToggle.vue.d.ts +11 -0
- package/types/components/app-layout/AppHeader.vue.d.ts +0 -3
- package/types/components/app-layout/AppLayout.vue.d.ts +0 -12
- package/types/components/app-layout/AppPage.vue.d.ts +0 -2
- package/types/components/app-layout/AppSidebar.vue.d.ts +0 -2
- package/types/components/app-layout/types.d.ts +2 -127
- package/types/components/app-layout/viewport.d.ts +2 -30
- package/types/components/data-view/DataListViewItem.vue.d.ts +0 -8
- package/types/components/data-view/index.d.ts +0 -4
- package/types/components/data-view/types.d.ts +0 -41
- package/types/components/data-view/utils.d.ts +0 -3
- package/types/components/display/TabsHeader.vue.d.ts +0 -2
- package/types/components/display/TabsMain.vue.d.ts +0 -2
- package/types/components/display/TabsRefineFlow.vue.d.ts +0 -1
- package/types/components/display/index.d.ts +1 -37
- package/types/components/display/types.d.ts +0 -131
- package/types/components/form/FormItemNestForm.vue.d.ts +0 -5
- package/types/components/form/FormItemNestFormList.vue.d.ts +0 -17
- package/types/components/form/FormVerifyCode.vue.d.ts +0 -9
- package/types/components/form/FormVerifyImage.vue.d.ts +0 -1
- package/types/components/form/form-search-utils.d.ts +0 -14
- package/types/components/form/nest-form-item-list.d.ts +0 -28
- package/types/components/form/nest-form-item.d.ts +0 -21
- package/types/components/form/nest-registry.d.ts +0 -14
- package/types/components/form/types.d.ts +8 -185
- package/types/components/form/use-form-submit.d.ts +0 -12
- package/types/components/form/use-nest-form-list.d.ts +0 -13
- package/types/components/form/use-nest-form.d.ts +0 -15
- package/types/components/form/use-nest-layout-scale.d.ts +0 -12
- package/types/components/form/utils.d.ts +1 -56
- package/types/components/list-page/ListPage.vue.d.ts +0 -6
- package/types/components/list-page/types.d.ts +2 -19
- package/types/components/misc/index.d.ts +1 -6
- package/types/components/misc/types.d.ts +0 -6
- package/types/components/modal/ConfirmModal.vue.d.ts +0 -10
- package/types/components/modal/modal-shelf-core.d.ts +0 -3
- package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -4
- package/types/components/modal/modal-shelf-types.d.ts +0 -34
- package/types/components/modal/types.d.ts +1 -20
- package/types/components/panel/PanelItemNestForm.vue.d.ts +0 -6
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +0 -5
- package/types/components/panel/nest-panel-form.d.ts +0 -21
- package/types/components/panel/nest-panel-item.d.ts +0 -14
- package/types/components/panel/types.d.ts +1 -49
- package/types/components/table/types.d.ts +9 -124
- package/types/config/list-model.d.ts +0 -29
- package/types/config/route.d.ts +0 -2
- package/types/helpers/form.d.ts +0 -5
- package/types/helpers/list-helper.d.ts +0 -26
- package/types/helpers/types.d.ts +0 -11
- package/types/hooks/activated.d.ts +0 -10
- package/types/hooks/feel-size.d.ts +0 -2
- package/types/hooks/index.d.ts +2 -2
- package/types/hooks/menus-dispatch.d.ts +0 -4
- package/types/hooks/timeout.d.ts +0 -4
- package/types/hooks/use-channel-viewport-height.d.ts +0 -14
- package/types/hooks/use-theme-apply.d.ts +11 -0
- package/types/hooks/use-viewport-apply.d.ts +8 -0
- package/types/inject/key.d.ts +2 -87
- package/types/router/guard/index.d.ts +0 -13
- package/types/router/guard/login.d.ts +0 -1
- package/types/router/guard/permission.d.ts +0 -1
- package/types/router/guard/types.d.ts +2 -5
- package/types/store/app.d.ts +10 -31
- package/types/store/router-permission.d.ts +2 -55
- package/types/store/user.d.ts +2 -26
- package/types/types/dot-path.d.ts +0 -8
- package/types/types/route.d.ts +0 -45
- package/types/types/utility-types.d.ts +0 -7
- package/types/utils/export.d.ts +1 -16
- package/types/utils/id.d.ts +0 -1
- package/types/utils/router.d.ts +0 -2
- package/types/utils/theme-scale.d.ts +1 -30
- package/types/utils/time.d.ts +0 -1
- package/docs/TECH_SNAPSHOT.md +0 -146
- package/docs/nested-config-paradigm.md +0 -80
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +0 -63
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +0 -575
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +0 -107
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +0 -58
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +0 -238
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +0 -290
- package/es/hooks/use-admin-theme-apply.mjs +0 -213
- package/es/hooks/use-admin-viewport-apply.mjs +0 -39
- package/types/hooks/use-admin-theme-apply.d.ts +0 -34
- package/types/hooks/use-admin-viewport-apply.d.ts +0 -20
|
@@ -1,87 +1,32 @@
|
|
|
1
1
|
import { DatePickerShortcut, FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
2
2
|
import { ColProps } from 'element-plus';
|
|
3
|
-
/**
|
|
4
|
-
* 嵌套布局 rebase 的栅格档集(P3)。
|
|
5
|
-
* ---
|
|
6
|
-
* FormMain/PanelMain 配置化 `span` 约定用 24 的约数 {6,8,12,24}(admin 常用档);
|
|
7
|
-
* 子层 rebase(×scale)后 ceil 到这组档,避免非约数(18/16/7)致行铺不满 ragged。
|
|
8
|
-
*/
|
|
9
3
|
export declare const NEST_LAYOUT_TIERS: readonly [6, 8, 12, 24];
|
|
10
|
-
/**
|
|
11
|
-
* 把数值 ceil 到档集中 ≥ value 的最近一档(偏宽取向)。
|
|
12
|
-
* ---
|
|
13
|
-
* - value ≤ 下限 → 取下限;value ≥ 上限 → 封顶上限。
|
|
14
|
-
* - 落档间 → 抬到上一档(如 16 → 24,非更近的 12),合「容器窄字段更宽」意图。
|
|
15
|
-
*/
|
|
16
4
|
export declare const ceilToTier: (value: number, tiers?: readonly number[]) => number;
|
|
17
|
-
/**
|
|
18
|
-
* 从 layout 解析父 item 实际分配的代表 span(P3 rebase 算因子用)。
|
|
19
|
-
* ---
|
|
20
|
-
* span 优先;无 span 时取 lg→md→sm→xl→xs 首个数值断点代表;都无 → 24(本层不缩)。
|
|
21
|
-
*/
|
|
22
5
|
export declare const resolveLayoutSpan: (layout?: Partial<ColProps>) => number;
|
|
23
|
-
/**
|
|
24
|
-
* 将 layout 解析为各屏幕尺寸的显式值:
|
|
25
|
-
* - 配置 span: xxx 时,xs/sm/md/lg/xl 默认全部视为 xxx
|
|
26
|
-
* - 单独设置某个尺寸则该尺寸覆盖 span 推导值
|
|
27
|
-
* ---
|
|
28
|
-
* **P3 嵌套 rebase**:可选第 2 参 `scale`(嵌套累乘因子,缺省 1)。
|
|
29
|
-
* - `scale === 1` → 现状行为不变(非档值原样透传,[MUST NOT] ceil,向后兼容关键)。
|
|
30
|
-
* - `scale !== 1` → span 及各断点数值 `× scale` 后经 `ceilToTier` 取整到档集,
|
|
31
|
-
* 维持子层字段绝对宽与顶级一致(容器变窄 → span 变大)。
|
|
32
|
-
*/
|
|
33
6
|
export declare const resolveFormLayout: (layout?: Partial<ColProps>, scale?: number) => Partial<ColProps>;
|
|
34
|
-
/**
|
|
35
|
-
* 生成 ElDatePicker 原生 `shortcuts` 的默认时间段快捷值:今日、昨日、近7日。
|
|
36
|
-
* 直接用于 `<ElDatePicker :shortcuts="getDatePickerShortcuts()">`——
|
|
37
|
-
* 由 ElDatePicker 自身 pick 管线按其 value-format 归一化输出,
|
|
38
|
-
* 与手动选日期完全同源,无需任何额外格式化依赖。
|
|
39
|
-
*/
|
|
40
7
|
export declare const getDatePickerShortcuts: () => DatePickerShortcut[];
|
|
41
|
-
/**
|
|
42
|
-
* 生成表单数据
|
|
43
|
-
*/
|
|
44
8
|
export declare const generateFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(list: FormItemConfigList<PO, SO>) => PO;
|
|
45
|
-
/**
|
|
46
|
-
* 解析表单数据
|
|
47
|
-
*/
|
|
48
9
|
export declare const parseFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(data: ExtractFormStringifyFromObject<PO, SO>, list: FormItemConfigList<PO, SO>) => PO;
|
|
49
|
-
/**
|
|
50
|
-
* 序列化表单数据
|
|
51
|
-
*/
|
|
52
10
|
export declare const stringifyFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(data: PO, list: FormItemConfigList<PO, SO>) => import('./types').ExcludeNeverProperties<import('./types').ExtractFormStringifyRawFromObject<PO, SO>>;
|
|
53
|
-
/**
|
|
54
|
-
* 获取v-model语法糖配置
|
|
55
|
-
*/
|
|
56
11
|
export declare const getVModelSugar: <PO extends Record<string, any>, SO extends Record<string, any>, PK extends Extract<keyof PO, string>, MK extends string>({ modelValueKey, config, data, updateData, }: {
|
|
57
12
|
modelValueKey?: MK;
|
|
58
13
|
config: FormItemConfig<PO, SO>;
|
|
59
14
|
data: PO;
|
|
60
15
|
updateData?: (val: PO[PK]) => void;
|
|
61
16
|
}) => { [P in MK]: PO[PK]; } & { [E in string as `onUpdate:${MK}`]: (val: PO[PK]) => void; };
|
|
62
|
-
/** 获取placeholder */
|
|
63
17
|
export declare const getPlaceholder: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>) => {
|
|
64
18
|
placeholder?: string;
|
|
65
19
|
};
|
|
66
|
-
/** 获取回车提交 */
|
|
67
20
|
export declare const getEnterSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
68
21
|
onKeyup: (e: KeyboardEvent) => void;
|
|
69
22
|
} | undefined;
|
|
70
|
-
/** 获取失去焦点提交 */
|
|
71
23
|
export declare const getBlurSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
72
24
|
onBlur: () => void;
|
|
73
25
|
} | undefined;
|
|
74
|
-
/** 获取变化提交 */
|
|
75
26
|
export declare const getChangeSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
76
27
|
onChange: () => void;
|
|
77
28
|
} | undefined;
|
|
78
|
-
/** form item 更改loading状态 */
|
|
79
29
|
export declare const FORM_ITEM_CHANGE_LOADING: unique symbol;
|
|
80
|
-
/** 设置输入类型组件 */
|
|
81
30
|
export declare const setInputComponent: (components: any[]) => void;
|
|
82
|
-
/** 设置选择类型组件 */
|
|
83
31
|
export declare const setSelectComponent: (components: any[]) => void;
|
|
84
|
-
|
|
85
|
-
export declare const swiftFormItemConfig: <PO extends Record<string, any>,
|
|
86
|
-
/** 需要格式化的模型 */
|
|
87
|
-
SO extends Record<string, any>>(options: FormItemConfigSwiftOptions<PO, SO>) => FormItemConfig<PO, SO>;
|
|
32
|
+
export declare const swiftFormItemConfig: <PO extends Record<string, any>, SO extends Record<string, any>>(options: FormItemConfigSwiftOptions<PO, SO>) => FormItemConfig<PO, SO>;
|
|
@@ -29,21 +29,15 @@ declare const _default: <T extends Record<string, any>, PO extends Record<string
|
|
|
29
29
|
expose(exposed: import('vue').ShallowUnwrapRef<ListPageInstance<PO, Record<string, any>>>): void;
|
|
30
30
|
attrs: any;
|
|
31
31
|
slots: Readonly<{
|
|
32
|
-
/** 头部插槽(无 scope) */
|
|
33
32
|
header?: () => VNode[];
|
|
34
|
-
/** 操作区插槽(无 scope) */
|
|
35
33
|
operation?: () => VNode[];
|
|
36
|
-
/** 自定义视图项插槽 */
|
|
37
34
|
"custom-view-item"?: (scope: DataListViewItemScope<T>) => VNode[];
|
|
38
35
|
} & { [K in `form-${Extract<keyof PO, string>}`]?: ((scope: FormScope<PO, SO, Extract<keyof PO, string>, any, any>) => VNode[]) | undefined; } & { [K_1 in `table-${Uppercase<string>}` | `table-${Exclude<Extract<keyof T, string>, "item" | "custom-view-item"> & {}}`]?: ((scope: TableColumnDefaultScope<T, ListPageInnerInjectInfo<PO, F>>) => VNode[]) | undefined; } & { [K_2 in `table-header-${Uppercase<string>}` | `table-header-${Exclude<Extract<keyof T, string>, "item" | "custom-view-item"> & {}}`]?: ((scope: TableColumnHeaderScope<T, ListPageInnerInjectInfo<PO, F>> & {
|
|
39
36
|
searchFormData: PO;
|
|
40
37
|
triggerSearch: (() => void) | undefined;
|
|
41
38
|
}) => VNode[]) | undefined; }> & {
|
|
42
|
-
/** 头部插槽(无 scope) */
|
|
43
39
|
header?: () => VNode[];
|
|
44
|
-
/** 操作区插槽(无 scope) */
|
|
45
40
|
operation?: () => VNode[];
|
|
46
|
-
/** 自定义视图项插槽 */
|
|
47
41
|
"custom-view-item"?: (scope: DataListViewItemScope<T>) => VNode[];
|
|
48
42
|
} & { [K in `form-${Extract<keyof PO, string>}`]?: ((scope: FormScope<PO, SO, Extract<keyof PO, string>, any, any>) => VNode[]) | undefined; } & { [K_1 in `table-${Uppercase<string>}` | `table-${Exclude<Extract<keyof T, string>, "item" | "custom-view-item"> & {}}`]?: ((scope: TableColumnDefaultScope<T, ListPageInnerInjectInfo<PO, F>>) => VNode[]) | undefined; } & { [K_2 in `table-header-${Uppercase<string>}` | `table-header-${Exclude<Extract<keyof T, string>, "item" | "custom-view-item"> & {}}`]?: ((scope: TableColumnHeaderScope<T, ListPageInnerInjectInfo<PO, F>> & {
|
|
49
43
|
searchFormData: PO;
|
|
@@ -5,37 +5,20 @@ export type FormSearchRewriteKey = "list";
|
|
|
5
5
|
export type TableMainOptionsKey = "refine" | "refineReduceHeight" | "viewportHeight" | "parentChannel" | "toolbar" | "showSwitchView";
|
|
6
6
|
export type TableMainRequiredKey = "columns" | "rowKey";
|
|
7
7
|
export type TableMainRewriteKey = "api" | "query" | "injectInfo";
|
|
8
|
-
export type ListPageInnerInjectInfo<PO extends Record<string, any>,
|
|
9
|
-
|
|
10
|
-
F extends Record<string, any>> = Pick<ListPageInstance<PO>, "triggerReset" | "triggerSearch" | "update"> & F;
|
|
11
|
-
export type ListPageProps<
|
|
12
|
-
/** 行数据结构 */
|
|
13
|
-
T extends Record<string, any>,
|
|
14
|
-
/** 表单标准结构模型 */
|
|
15
|
-
PO extends Record<string, any>,
|
|
16
|
-
/** 表单需转换的部分结构模型 */
|
|
17
|
-
SO extends Record<string, any>,
|
|
18
|
-
/** 静态参数 */
|
|
19
|
-
SQ extends Record<string, any>,
|
|
20
|
-
/** 期望注入到表格列插槽上的额外内容 */
|
|
21
|
-
F extends Record<string, any>> = Partial<Pick<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey>> & {
|
|
8
|
+
export type ListPageInnerInjectInfo<PO extends Record<string, any>, F extends Record<string, any>> = Pick<ListPageInstance<PO>, "triggerReset" | "triggerSearch" | "update"> & F;
|
|
9
|
+
export type ListPageProps<T extends Record<string, any>, PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>> = Partial<Pick<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey>> & {
|
|
22
10
|
formSearchProps?: Partial<Omit<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey | FormSearchRewriteKey>>;
|
|
23
11
|
} & Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainRequiredKey> & Partial<Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey>> & {
|
|
24
12
|
tableMainProps?: Partial<Omit<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey | TableMainOptionsKey | TableMainRewriteKey>>;
|
|
25
13
|
} & {
|
|
26
14
|
list?: FormItemConfigList<PO, SO>;
|
|
27
|
-
/** api */
|
|
28
15
|
api: (params: TableApiParams<ExtractFormStringifyFromObject<PO, SO> & SQ>) => Promise<TableApiResult<T>>;
|
|
29
|
-
/** 静态参数 */
|
|
30
16
|
query?: SQ;
|
|
31
17
|
injectInfo?: F;
|
|
32
|
-
/** 搜索前的回调[同步] */
|
|
33
18
|
beforeSearch?: (data: ExtractFormStringifyFromObject<PO, SO>, type: FormSearchSearchType) => ExtractFormStringifyFromObject<PO, SO>;
|
|
34
|
-
/** 在点击搜索重置按钮时,是否同时调用清空表格表头过滤 */
|
|
35
19
|
clearTableFilterOnReset?: boolean;
|
|
36
20
|
};
|
|
37
21
|
export interface ListPageInstance<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends FormSearchInstance<PO, SO>, TableMainInstance {
|
|
38
|
-
/** 更新表单数据 */
|
|
39
22
|
update: (key: Extract<keyof PO, string>, value: any) => void;
|
|
40
23
|
}
|
|
41
24
|
export type ListApiParams<L, SQ extends Record<string, any>> = TableApiParams<ExtractFormStringifyFromList<L> & SQ>;
|
|
@@ -3,9 +3,4 @@ import { default as AutoRefresh } from './AutoRefresh.vue';
|
|
|
3
3
|
import { default as AutoRefreshGroup } from './AutoRefreshGroup.vue';
|
|
4
4
|
import { default as SelectModule } from './SelectModule.vue';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export {
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated 全局样式引入后已无用——main.ts `import "element-plus/dist/index.css"`
|
|
9
|
-
* + ElementPlusResolver `importStyle: false` 即可,无需本组件触发按需样式。下个 MAJOR 删除。
|
|
10
|
-
*/
|
|
11
|
-
TriggerAutoImport, AutoRefresh, AutoRefreshGroup, SelectModule, };
|
|
6
|
+
export { TriggerAutoImport, AutoRefresh, AutoRefreshGroup, SelectModule, };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
/** AutoRefresh 组件 props */
|
|
2
1
|
export interface AutoRefreshProps {
|
|
3
|
-
/** 刷新方法,返回 Promise。失败不影响下轮定时 */
|
|
4
2
|
refreshFn: () => Promise<unknown>;
|
|
5
|
-
/** 是否不允许自动刷新。true 时清 timer 且不排下轮 */
|
|
6
3
|
disabled?: boolean;
|
|
7
4
|
}
|
|
8
5
|
export interface AutoRefreshGroupProps extends Omit<AutoRefreshProps, "disabled"> {
|
|
9
|
-
/** 是否显示自动刷新开关 */
|
|
10
6
|
showAutoRefresh?: boolean;
|
|
11
|
-
/** 是否显示刷新按钮 */
|
|
12
7
|
showRefresh?: boolean;
|
|
13
|
-
/** 加载是否正在进行中 */
|
|
14
8
|
loading?: boolean;
|
|
15
9
|
}
|
|
@@ -10,22 +10,12 @@ type __VLS_Props = {
|
|
|
10
10
|
content?: string | (() => VNode);
|
|
11
11
|
cancelText?: string | (() => VNode);
|
|
12
12
|
confirmText?: string | (() => VNode);
|
|
13
|
-
/** 是否隐藏取消按钮 */
|
|
14
13
|
hiddenCancel?: boolean;
|
|
15
14
|
width?: number | string;
|
|
16
|
-
/** 反转按钮位置 */
|
|
17
15
|
reverse?: boolean;
|
|
18
|
-
/** 按下 ESC 是否关闭 */
|
|
19
16
|
closeOnPressEscape?: boolean;
|
|
20
|
-
/** 点击遮罩是否关闭 */
|
|
21
17
|
closeOnClickModal?: boolean;
|
|
22
|
-
/** 是否使用确认按钮loading */
|
|
23
18
|
useLoading?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 确认按钮 type(对齐 element-plus ElButton type)。
|
|
26
|
-
* 默认 'primary';danger / warning / success / info 全枚举均支持,
|
|
27
|
-
* 与 ActionConfirm popconfirm 模式按钮颜色行为对齐。
|
|
28
|
-
*/
|
|
29
19
|
type?: ButtonProps["type"];
|
|
30
20
|
};
|
|
31
21
|
declare function __VLS_template(): {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ModalLevel, ShelfController, ShelfItem } from './modal-shelf-types';
|
|
3
|
-
/** ShelfController 内部扩展:额外暴露渲染用活跃实例列表 */
|
|
4
3
|
export interface ShelfControllerInternal extends ShelfController {
|
|
5
|
-
/** 渲染用:当前活跃实例列表(多例数组) */
|
|
6
4
|
items: Ref<ShelfItem[]>;
|
|
7
5
|
}
|
|
8
|
-
/** 创建一个架子逻辑控制器(纯逻辑,无 DOM 依赖,可单测) */
|
|
9
6
|
export declare function createShelfController(level: ModalLevel): ShelfControllerInternal;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import { ModalLevel } from './modal-shelf-types';
|
|
2
|
-
/**
|
|
3
|
-
* 层级合法性:app 必最顶层;page 祖先允许 app/page(父子页面嵌套场景),仅禁止 custom;custom 可嵌套任何(含 custom 套 custom)。
|
|
4
|
-
* 非法仅开发期 console.error,不抛、不静默。
|
|
5
|
-
*/
|
|
6
2
|
export declare function assertLevelHierarchy(level: ModalLevel, ancestorLevels: ModalLevel[]): void;
|
|
@@ -1,73 +1,39 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
/** 架子层级 */
|
|
3
2
|
export type ModalLevel = "app" | "page" | "custom";
|
|
4
|
-
/** 同 key 再 evoke 策略:recreate=关旧重建(默认);update=已开则整体替换 props 不 remount */
|
|
5
3
|
export type ModalSameKeyStrategy = "recreate" | "update";
|
|
6
|
-
/**
|
|
7
|
-
* 业务侧 declare merge 扩展此接口声明每个弹窗的业务 props 契约。
|
|
8
|
-
* 例:declare module "@done-coding/admin-core" {
|
|
9
|
-
* interface ModalShelfMap { detail: { id: string; onConfirm?: (r: unknown) => void } }
|
|
10
|
-
* }
|
|
11
|
-
*/
|
|
12
4
|
export interface ModalShelfMap {
|
|
13
5
|
}
|
|
14
|
-
/** 架子注入给弹窗组件的契约(业务 payload 经单 payload 对象传入) */
|
|
15
6
|
export interface ModalInjectedProps<P = Record<string, unknown>> {
|
|
16
|
-
/** v-model:show 受控可见性 */
|
|
17
7
|
show: boolean;
|
|
18
|
-
/** 优雅关闭(隐藏→等动画→移除),=== EvokeHandle.close */
|
|
19
8
|
closeFn: () => void;
|
|
20
|
-
/** 立即移除(无动画) */
|
|
21
9
|
removeFn: () => void;
|
|
22
|
-
/** 业务 payload(ModalShelfMap[key]) */
|
|
23
10
|
payload: P;
|
|
24
11
|
}
|
|
25
|
-
/** evoke 返回的命令式句柄;只绑稳定 nsKey,调用时现查当前实例(不闭包 id) */
|
|
26
12
|
export interface EvokeHandle {
|
|
27
|
-
/** 优雅关闭该 nsKey 当前实例;无则 no-op */
|
|
28
13
|
close: () => void;
|
|
29
|
-
/** 对该 nsKey 当前实例受控增量合并 payload(不 remount);无则 no-op */
|
|
30
14
|
update: (partialPayload: Record<string, unknown>) => void;
|
|
31
15
|
}
|
|
32
|
-
/** 注册项(扁平,无 options 包裹,无 isSingle——v1 仅多例) */
|
|
33
16
|
export interface RegisterEntry<K extends keyof ModalShelfMap = keyof ModalShelfMap> {
|
|
34
|
-
/** 弹窗逻辑 key */
|
|
35
17
|
key: K;
|
|
36
|
-
/** 组件或懒工厂(() => import()) */
|
|
37
18
|
component: Component | (() => Promise<Component>);
|
|
38
|
-
/** 目标架子:app/page 名称代指,或直接持 ShelfInstance */
|
|
39
19
|
shelf: "app" | "page" | ShelfInstance;
|
|
40
|
-
/** 同 key 再 evoke 策略,缺省 "recreate" */
|
|
41
20
|
sameKeyStrategy?: ModalSameKeyStrategy;
|
|
42
21
|
}
|
|
43
|
-
/** 架子内部一条活跃实例 */
|
|
44
22
|
export interface ShelfItem {
|
|
45
|
-
/** 架子内部自增唯一 id,用作渲染 :key */
|
|
46
23
|
id: number;
|
|
47
|
-
/** porter 命名空间后的注册键 p{porterUid}:{key} */
|
|
48
24
|
nsKey: string;
|
|
49
|
-
/** 组件或懒工厂 */
|
|
50
25
|
component: Component | (() => Promise<Component>);
|
|
51
|
-
/** 业务 payload */
|
|
52
26
|
payload: Record<string, unknown>;
|
|
53
|
-
/** v-model:show */
|
|
54
27
|
show: boolean;
|
|
55
|
-
/** close 排定的关闭动画定时器句柄;remove 立即移除前 [MUST] clearTimeout 它 */
|
|
56
28
|
timer?: ReturnType<typeof setTimeout>;
|
|
57
29
|
}
|
|
58
|
-
/** ModalShelf 实例 expose === 它 provide 的 controller */
|
|
59
30
|
export interface ShelfController {
|
|
60
|
-
/** 本架子层级 */
|
|
61
31
|
level: ModalLevel;
|
|
62
|
-
/** 唤起一条;同 nsKey 先 remove(立即) 旧再新建 */
|
|
63
32
|
evoke: (nsKey: string, component: Component | (() => Promise<Component>), options: {
|
|
64
33
|
payload: Record<string, unknown>;
|
|
65
34
|
sameKeyStrategy?: ModalSameKeyStrategy;
|
|
66
35
|
}) => EvokeHandle;
|
|
67
|
-
/** 立即移除(不等动画),支持单个或批量 */
|
|
68
36
|
remove: (nsKey: string | string[]) => void;
|
|
69
|
-
/** 优雅关闭某条(触发隐藏 → 动画结束 → 移除) */
|
|
70
37
|
close: (item: ShelfItem) => void;
|
|
71
38
|
}
|
|
72
|
-
/** ModalShelf 实例引用类型别名(用于 RegisterEntry.shelf 直接持实例定位 custom 架子) */
|
|
73
39
|
export type ShelfInstance = ShelfController;
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
import { ExtractFormStringifyFromObject, FormItemConfigList, FormMainProps } from '../form';
|
|
2
2
|
import { FormProps } from 'element-plus';
|
|
3
|
-
/** 详情页类型 */
|
|
4
3
|
export type DetailType = "add" | "edit" | "read";
|
|
5
|
-
export interface DetailModalProps<
|
|
6
|
-
/** 表单标准结构模型 */
|
|
7
|
-
PO extends Record<string, any>,
|
|
8
|
-
/** 表单需转换的部分结构模型 */
|
|
9
|
-
SO extends Record<string, any>> {
|
|
10
|
-
/** 表单数据 */
|
|
4
|
+
export interface DetailModalProps<PO extends Record<string, any>, SO extends Record<string, any>> {
|
|
11
5
|
data: PO;
|
|
12
|
-
/** 表单配置 */
|
|
13
6
|
list: FormItemConfigList<PO, SO>;
|
|
14
|
-
/** 表单类型 */
|
|
15
7
|
type: DetailType;
|
|
16
|
-
/**
|
|
17
|
-
* 标题
|
|
18
|
-
* 最终表现为:新增[标题]、编辑[标题]
|
|
19
|
-
*/
|
|
20
8
|
subTitle?: string;
|
|
21
9
|
show: boolean;
|
|
22
|
-
/** 新增api */
|
|
23
10
|
addApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
24
|
-
/** 编辑api */
|
|
25
11
|
editApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
26
|
-
/** 弹窗宽度 */
|
|
27
12
|
modalWidth?: number | string;
|
|
28
|
-
/** 表单整体布局 */
|
|
29
13
|
formLayout?: FormMainProps<PO, SO>["layout"];
|
|
30
|
-
/** elForm其他属性 */
|
|
31
14
|
formProps?: Partial<FormProps>;
|
|
32
|
-
/** 表单行 gutter,透传给 FormMain */
|
|
33
15
|
formRowGutter?: number;
|
|
34
|
-
/** 表单 label 宽度 */
|
|
35
16
|
labelWidth?: string;
|
|
36
17
|
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { ColProps } from 'element-plus';
|
|
2
2
|
import { FormItemConfigList } from '../form';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
/** 子 FormMain 数据(= 父 item 草稿的嵌套对象,子 in-place 改草稿) */
|
|
5
4
|
data: Record<string, any>;
|
|
6
|
-
/** 子表单配置列表 */
|
|
7
5
|
list: FormItemConfigList;
|
|
8
6
|
layout?: Partial<ColProps>;
|
|
9
7
|
rowGutter?: number;
|
|
10
8
|
submitText?: string;
|
|
11
9
|
cancelText?: string;
|
|
12
|
-
/** 校验通过后的业务提交(helper 内 wire submitFn(草稿) → closeEdit);返回 Promise 自动 loading */
|
|
13
10
|
submit?: () => Promise<unknown> | unknown;
|
|
14
|
-
/** 取消编辑(helper 内 wire closeEdit) */
|
|
15
11
|
cancel?: () => void;
|
|
16
|
-
/** 父 item 代表 span(P3 rebase 算因子用;helper 经 resolveLayoutSpan(layout) 传入) */
|
|
17
12
|
parentSpan?: number;
|
|
18
|
-
/** 是否叠本层嵌套布局 rebase(缺省 true;false = 逆向逃生口,layout 原样直透) */
|
|
19
13
|
rebase?: boolean;
|
|
20
14
|
};
|
|
21
15
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { PanelItemConfigList } from './types';
|
|
2
2
|
import { ColProps, CardProps } from 'element-plus';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
/** 子 PanelMain 数据(= 父 item value,嵌套对象) */
|
|
5
4
|
data: Record<string, any>;
|
|
6
|
-
/** 子 PanelMain 配置列表 */
|
|
7
5
|
list: PanelItemConfigList;
|
|
8
|
-
/** 子项是否包 Card,缺省继承 PanelMain 默认 */
|
|
9
6
|
itemCard?: boolean | Partial<CardProps & {
|
|
10
7
|
lastMarginBottom?: string;
|
|
11
8
|
}>;
|
|
12
9
|
layout?: Partial<ColProps>;
|
|
13
10
|
rowGutter?: number;
|
|
14
|
-
/** 父 item 代表 span(P3 rebase 算因子用;helper 经 resolveLayoutSpan(layout) 传入) */
|
|
15
11
|
parentSpan?: number;
|
|
16
|
-
/** 是否叠本层嵌套布局 rebase(缺省 true;false = 逆向逃生口,layout 原样直透) */
|
|
17
12
|
rebase?: boolean;
|
|
18
13
|
};
|
|
19
14
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -2,37 +2,16 @@ import { ColProps } from 'element-plus';
|
|
|
2
2
|
import { PanelItemConfig, PanelScopeBase } from './types';
|
|
3
3
|
import { FormItemConfigList } from '../form';
|
|
4
4
|
export interface NestPanelFormOptions {
|
|
5
|
-
/** 父 item key */
|
|
6
5
|
key: string;
|
|
7
|
-
/** 父 item label */
|
|
8
6
|
label?: string;
|
|
9
|
-
/** 子 FormMain 配置列表(吃嵌套子对象) */
|
|
10
7
|
list: FormItemConfigList;
|
|
11
|
-
/** 父 item 栅格布局 */
|
|
12
8
|
layout?: Partial<ColProps>;
|
|
13
|
-
/** 子表单行间距 */
|
|
14
9
|
rowGutter?: number;
|
|
15
|
-
/** 提交按钮文案 */
|
|
16
10
|
submitText?: string;
|
|
17
|
-
/** 取消按钮文案 */
|
|
18
11
|
cancelText?: string;
|
|
19
|
-
/** 是否可编辑,缺省 true */
|
|
20
12
|
editable?: boolean | ((scope: PanelScopeBase) => boolean);
|
|
21
|
-
/** 单字段提交:校验通过后回流草稿到父数据(panel 既有 submitFn 语义) */
|
|
22
13
|
submitFn: PanelItemConfig["submitFn"];
|
|
23
|
-
/** 只读态展示渲染;缺省走 PanelItem 默认(纯文本 data[key]) */
|
|
24
14
|
render?: PanelItemConfig["render"];
|
|
25
|
-
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
26
15
|
rebase?: boolean;
|
|
27
16
|
}
|
|
28
|
-
/**
|
|
29
|
-
* 生成「父 panel item 编辑态内嵌子 FormMain」的 PanelItemConfig(C3 配套 helper)
|
|
30
|
-
* ----
|
|
31
|
-
* 走 editorRender(优先级高于 editorConfig,panel/types.ts L65-77)挂 PanelItemNestForm:
|
|
32
|
-
* - 编辑态:PanelEditSwitch 进编辑时深克隆草稿(scope.data),子 FormMain 绑草稿嵌套对象
|
|
33
|
-
* in-place 编辑(不穿透真实 data,ADR-5 panel 分支);
|
|
34
|
-
* - 提交:组件内 validateChild 通过 → 本 helper wire 的 submit(`submitFn(草稿) → closeEdit`)回流;
|
|
35
|
-
* - 取消:closeEdit 关编辑态,草稿丢弃,下次进编辑重新克隆。
|
|
36
|
-
* editorConfig 与 editorRender 互斥——C3 用 editorRender,同一 item [MUST NOT] 再配 editorConfig。
|
|
37
|
-
*/
|
|
38
17
|
export declare function nestPanelForm(options: NestPanelFormOptions): PanelItemConfig;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import { ColProps, CardProps } from 'element-plus';
|
|
2
2
|
import { PanelItemConfig, PanelItemConfigList } from './types';
|
|
3
3
|
export interface NestPanelItemOptions {
|
|
4
|
-
/** 父 item key */
|
|
5
4
|
key: string;
|
|
6
|
-
/** 父 item label */
|
|
7
5
|
label?: string;
|
|
8
|
-
/** 子 PanelMain 配置列表(吃嵌套子对象) */
|
|
9
6
|
list: PanelItemConfigList;
|
|
10
|
-
/** 父 item 栅格布局 */
|
|
11
7
|
layout?: Partial<ColProps>;
|
|
12
|
-
/** 子 PanelMain 子项是否包 Card */
|
|
13
8
|
itemCard?: boolean | Partial<CardProps & {
|
|
14
9
|
lastMarginBottom?: string;
|
|
15
10
|
}>;
|
|
16
|
-
/** 子 PanelMain 行间距 */
|
|
17
11
|
rowGutter?: number;
|
|
18
|
-
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
19
12
|
rebase?: boolean;
|
|
20
13
|
}
|
|
21
|
-
/**
|
|
22
|
-
* 生成「父 panel item 内嵌子 PanelMain」的 PanelItemConfig(C2 配套 helper)
|
|
23
|
-
* ----
|
|
24
|
-
* 降低业务方手写 h(PanelItemNestPanel) 噪音:传 key/label/子 list 即得一个满足
|
|
25
|
-
* PanelItemConfig 的纯展示配置项,render 出口挂 PanelItemNestPanel(嵌套对象只读展示)。
|
|
26
|
-
* 值贯通:render scope.value(= data[key] 嵌套对象)作子 PanelMain.data。
|
|
27
|
-
*/
|
|
28
14
|
export declare function nestPanelItem(options: NestPanelItemOptions): PanelItemConfig;
|
|
@@ -1,96 +1,48 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import { ColProps, CardProps } from 'element-plus';
|
|
3
3
|
import { ExtractFormStringifyFromObject, FormDataInfo, FormItemConfig, FormSubmitPanelProps } from '../form';
|
|
4
|
-
/**
|
|
5
|
-
* 通用作用于
|
|
6
|
-
* -----
|
|
7
|
-
* 用于 render 、editorRender 及 判断
|
|
8
|
-
*/
|
|
9
4
|
export interface PanelScopeBase<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
10
|
-
/** 原始数据(只读消费,[MUST NOT] 在 render 内修改) */
|
|
11
5
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
12
|
-
/** data[config.key] */
|
|
13
6
|
value: any;
|
|
14
|
-
/** 配置项 */
|
|
15
7
|
config: PanelItemConfig<PO, SO>;
|
|
16
8
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Panel render 作用域
|
|
19
|
-
* -----
|
|
20
|
-
* 应用于 render \ editorRender
|
|
21
|
-
*/
|
|
22
9
|
export interface PanelRenderScope<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends PanelScopeBase<PO, SO> {
|
|
23
|
-
/** 是否编辑态 */
|
|
24
10
|
editing: boolean;
|
|
25
|
-
/** 请求 PanelMain 调用 refreshFn;仅用于 render/editorRender 自管刷新,不处理 editorConfig 提交成功 */
|
|
26
11
|
refresh?: () => Promise<unknown> | void;
|
|
27
|
-
/** 结束编辑态 */
|
|
28
12
|
closeEdit?: () => void;
|
|
29
13
|
}
|
|
30
|
-
/** Panel 配置项 */
|
|
31
14
|
export interface PanelItemConfig<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
32
|
-
/** 数据键 */
|
|
33
15
|
key: string;
|
|
34
|
-
/** 标签,非必填 */
|
|
35
16
|
label?: string;
|
|
36
|
-
/** 栅格布局,复用 resolveFormLayout 语义;缺省继承 PanelMain.layout */
|
|
37
17
|
layout?: Partial<ColProps>;
|
|
38
|
-
/** 隐藏 */
|
|
39
18
|
hide?: boolean | ((scope: PanelScopeBase<PO, SO>) => boolean);
|
|
40
|
-
/** 只读渲染;缺省=纯文本 data[key] */
|
|
41
19
|
render?: string | Record<string, any> | ((scope: PanelRenderScope<PO, SO>) => VNode[]);
|
|
42
|
-
/** 是否可就地编辑 */
|
|
43
20
|
editable?: boolean | ((scope: PanelScopeBase<PO, SO>) => boolean);
|
|
44
|
-
/** 编辑器渲染;仅 editable 时需要
|
|
45
|
-
* ----
|
|
46
|
-
* 使用优先级高于 editorConfig
|
|
47
|
-
*/
|
|
48
21
|
editorRender?: string | Record<string, any> | ((scope: PanelRenderScope<PO, SO>) => VNode[]);
|
|
49
|
-
/** 编辑器表单配置;仅 editable 时需要
|
|
50
|
-
* ----
|
|
51
|
-
* 使用优先级次于 editorRender
|
|
52
|
-
* 但是优先级高于 render 即编辑态时使用render
|
|
53
|
-
*/
|
|
54
22
|
editorConfig?: Omit<FormItemConfig<PO, SO>, "key" | "label" | "labelHide" | "layout">;
|
|
55
|
-
/** 单字段提交;仅 editable 时需要。draft = 深克隆副本 */
|
|
56
23
|
submitFn?: FormSubmitPanelProps<PO, SO>["submitFn"];
|
|
57
24
|
}
|
|
58
|
-
/** Panel 配置项列表 */
|
|
59
25
|
export type PanelItemConfigList<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> = PanelItemConfig<PO, SO>[];
|
|
60
|
-
/** PanelMain props */
|
|
61
26
|
export interface PanelMainProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
62
27
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
63
|
-
/** 行水平间距 */
|
|
64
28
|
rowGutter?: number;
|
|
65
29
|
layout?: Partial<ColProps>;
|
|
66
|
-
/** P3 嵌套 rebase 累乘因子(缺省 1 = 顶级行为不变,向后兼容)。由联结薄壳算出后传子 PanelMain */
|
|
67
30
|
layoutScale?: number;
|
|
68
31
|
list: PanelItemConfigList<PO, SO>;
|
|
69
|
-
/** item是否包括Card */
|
|
70
32
|
itemCard?: boolean | Partial<CardProps & {
|
|
71
|
-
/** 最后一个 margin bottom */
|
|
72
33
|
lastMarginBottom?: string;
|
|
73
34
|
}>;
|
|
74
|
-
|
|
75
|
-
refreshFn?: (currentStringifyData: any,
|
|
76
|
-
/** 当前的key */
|
|
77
|
-
key: string) => Promise<unknown> | void;
|
|
35
|
+
refreshFn?: (currentStringifyData: any, key: string) => Promise<unknown> | void;
|
|
78
36
|
}
|
|
79
|
-
/** PanelItem props */
|
|
80
37
|
export interface PanelItemProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
81
38
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
82
39
|
config: PanelItemConfig<PO, SO>;
|
|
83
|
-
/** render/editorRender 内 scope.refresh 的回调;不承接 submitSuccess */
|
|
84
40
|
refreshFn?: (currentStringifyData: FormDataInfo<PO, SO>["stringifyData"]) => Promise<unknown> | void;
|
|
85
41
|
}
|
|
86
|
-
/** PanelEditSwitch props */
|
|
87
42
|
export interface PanelEditSwitchProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends Partial<Pick<FormSubmitPanelProps<PO, SO>, "submitFn">> {
|
|
88
43
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
89
|
-
/** panel 配置项 */
|
|
90
44
|
config: Omit<PanelItemConfig<PO, SO>, "editorConfig"> & {
|
|
91
|
-
/** 缺失的key label 由 PanelItem补齐 */
|
|
92
45
|
editorConfig?: FormItemConfig<PO, SO>;
|
|
93
46
|
};
|
|
94
|
-
/** 是否可编辑 */
|
|
95
47
|
editable?: boolean;
|
|
96
48
|
}
|