form-design-v3 1.0.6 → 1.1.8
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 +67 -1
- package/dist-lib/{CodeEditor-LYxKHZlN.js → CodeEditor-C8Hh8Y2_.js} +1 -1
- package/dist-lib/form-design-v3.css +1 -1
- package/dist-lib/form-design-v3.es.js +15 -9
- package/dist-lib/form-design-v3.umd.cjs +2 -2
- package/dist-lib/{index-CQD0PeFm.js → index-AVoRu-VQ.js} +919 -828
- package/dist-lib/index.d.ts +96 -3
- package/package.json +2 -2
- package/dist-lib/package.json +0 -12
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,10 +1,70 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { Component, App } from 'vue';
|
|
3
3
|
|
|
4
|
-
type __VLS_Props$
|
|
4
|
+
type __VLS_Props$3 = {
|
|
5
5
|
formId?: string;
|
|
6
6
|
};
|
|
7
|
-
declare const _default$
|
|
7
|
+
declare const _default$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 对外静态卡片容器(供宿主使用,非设计器控件)。
|
|
11
|
+
*
|
|
12
|
+
* 用途:宿主通过 `<slot>` 插槽给表单注入自定义内容时,往往没有现成的卡片外壳,
|
|
13
|
+
* 直接写业务 DOM 会和设计器渲染出的卡片(CardRender)样式不一致。
|
|
14
|
+
* 这个组件只做「外壳」——标题 + 可选图标 + 折叠 + 内容插槽,
|
|
15
|
+
* 视觉、类名(.fd-card-render / .fd-card-head ...)与设计器卡片完全一致,
|
|
16
|
+
* 配色走 --fd-color-* 主题变量,因此暗色主题、宿主全局样式都能自动跟随。
|
|
17
|
+
*
|
|
18
|
+
* 与 widgets/card/CardRender.vue 的区别:那里吃的是设计器 schema 节点(node),
|
|
19
|
+
* 这里是普通的 props + 默认插槽,宿主不需要构造节点结构。
|
|
20
|
+
*/
|
|
21
|
+
type __VLS_Props$2 = {
|
|
22
|
+
/** 卡片标题 */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** lucide 图标名(PascalCase,如 FileText / Store;为空则不显示图标) */
|
|
25
|
+
icon?: string;
|
|
26
|
+
/** 图标底色(CSS 颜色;为空则用主题默认浅色) */
|
|
27
|
+
iconBgColor?: string;
|
|
28
|
+
/** 初始是否展开 */
|
|
29
|
+
expanded?: boolean;
|
|
30
|
+
/** 卡片宽度(任意 CSS 宽度值;为空则自适应父容器) */
|
|
31
|
+
width?: string;
|
|
32
|
+
};
|
|
33
|
+
declare var __VLS_4: {};
|
|
34
|
+
type __VLS_Slots$1 = {} & {
|
|
35
|
+
default?: (props: typeof __VLS_4) => any;
|
|
36
|
+
};
|
|
37
|
+
declare const __VLS_component$1: vue.DefineComponent<__VLS_Props$2, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{}>, {
|
|
38
|
+
label: string;
|
|
39
|
+
icon: string;
|
|
40
|
+
iconBgColor: string;
|
|
41
|
+
expanded: boolean;
|
|
42
|
+
width: string;
|
|
43
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default$2: __VLS_WithSlots$1<typeof __VLS_component$1, __VLS_Slots$1>;
|
|
45
|
+
|
|
46
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 通用 lucide 图标组件:按名称动态渲染 lucide-vue-next 图标。
|
|
54
|
+
* 继承父元素 color(lucide 默认 stroke=currentColor)。
|
|
55
|
+
*/
|
|
56
|
+
type __VLS_Props$1 = {
|
|
57
|
+
/** 图标名(PascalCase,如 ScanSearch / Download) */
|
|
58
|
+
name: string;
|
|
59
|
+
/** 图标尺寸(px 或任意 CSS 尺寸) */
|
|
60
|
+
size?: number | string;
|
|
61
|
+
/** 描边宽度 */
|
|
62
|
+
strokeWidth?: number;
|
|
63
|
+
};
|
|
64
|
+
declare const _default$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{}>, {
|
|
65
|
+
size: number | string;
|
|
66
|
+
strokeWidth: number;
|
|
67
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
8
68
|
|
|
9
69
|
type WidgetType = 'card' | 'label' | 'subtable' | 'slot' | 'grid' | 'text';
|
|
10
70
|
type RenderMode = 'design' | 'render';
|
|
@@ -353,20 +413,53 @@ declare function registerComponent(def: WidgetDefinition): void;
|
|
|
353
413
|
interface ApiConfig {
|
|
354
414
|
/** 网关前缀(含环境),如 /bpmapi-uat;经 dev-server 代理时用相对路径 */
|
|
355
415
|
baseUrl: string;
|
|
416
|
+
/**
|
|
417
|
+
* 统一登录站点地址(末尾带 /)。
|
|
418
|
+
*
|
|
419
|
+
* 库里不读自己的构建期 env(库产物里 `import.meta.env.*` 会被静态化,读不到宿主环境),
|
|
420
|
+
* 也不写死地址:按「宿主注入 > window 全局 > 空」的顺序取,
|
|
421
|
+
* 取到就会在 401 时自动跳转登录页。
|
|
422
|
+
*/
|
|
423
|
+
loginSite?: string;
|
|
424
|
+
/**
|
|
425
|
+
* 登录态失效(HTTP 401)完整接管回调。
|
|
426
|
+
*
|
|
427
|
+
* 设了就完全交给它处理(不再走库内的 loginSite 跳转),
|
|
428
|
+
* 适合宿主已有自己的登录跳转实现(如 renderer 的全局 fetch 拦截)。
|
|
429
|
+
*/
|
|
430
|
+
onUnauthorized?: () => void;
|
|
356
431
|
}
|
|
357
432
|
declare function configureApi(options: Partial<ApiConfig>): void;
|
|
358
433
|
/** @deprecated 兼容旧名:baseModule 即网关前缀(不带前导斜杠也可) */
|
|
359
434
|
declare function setBaseModule(module: string): void;
|
|
360
435
|
/** @deprecated 兼容旧名:后端模块已固定为 formdesigner/v1,无需配置 */
|
|
361
436
|
declare function setApiModule(_module: string): void;
|
|
437
|
+
/** 设置 401(登录态失效)回调;传 undefined 取消。宿主已自己接管跳转时使用 */
|
|
438
|
+
declare function setUnauthorizedHandler(handler?: () => void): void;
|
|
439
|
+
/**
|
|
440
|
+
* 设置统一登录站点地址(末尾带 /)。
|
|
441
|
+
* 宿主按自己的环境变量注入(如 renderer 的 VITE_APP_LOGIN_SITE),库不写死。
|
|
442
|
+
*/
|
|
443
|
+
declare function setLoginSite(loginSite?: string): void;
|
|
444
|
+
/**
|
|
445
|
+
* 解析登录站点,优先级:setApiProps > setLoginSite > configureApi > window 全局。
|
|
446
|
+
* window 兜底让宿主无需改组件调用,只要在入口把环境变量挂到全局即可。
|
|
447
|
+
*/
|
|
448
|
+
declare function resolveLoginSite(): string;
|
|
449
|
+
/** 跳转统一登录页:带上当前地址,登录后回到原页面;未配置站点时返回 false */
|
|
450
|
+
declare function redirectToLogin(): boolean;
|
|
362
451
|
|
|
363
452
|
interface InstallOptions {
|
|
364
453
|
/** 网关前缀(含环境),如 /bpmapi-uat;对应后端 api/formdesigner/v1 之前的部分 */
|
|
365
454
|
baseUrl?: string;
|
|
455
|
+
/** 统一登录站点地址(跟随宿主环境变量,如 renderer 的 VITE_APP_LOGIN_SITE) */
|
|
456
|
+
loginSite?: string;
|
|
457
|
+
/** 完全接管 401 处理(设了就不再走库内 loginSite 跳转) */
|
|
458
|
+
onUnauthorized?: () => void;
|
|
366
459
|
}
|
|
367
460
|
declare const DesignerPlugin: {
|
|
368
461
|
install(app: App, options?: InstallOptions): void;
|
|
369
462
|
};
|
|
370
463
|
|
|
371
|
-
export { _default$
|
|
464
|
+
export { _default$3 as Designer, _default$1 as FdLucideIcon, _default$2 as FormCard, LIFECYCLE_HOOKS, _default as Renderer, configureApi, DesignerPlugin as default, loadFormFromLocal, redirectToLogin, registerComponent, renderForm, resolveLoginSite, setApiModule, setBaseModule, setLoginSite, setUnauthorizedHandler };
|
|
372
465
|
export type { BaseWidgetProps, CardWidgetProps, ColumnConfig, ColumnEditMode, CustomEvent, EditMode, EnumItem, FieldMeta, FormEvents, FormLifecycleEvents, FormMode, FormSchema, GridWidgetProps, HiddenMode, InstallOptions, LabelWidgetProps, LifecycleHook, RenderFormHandle, RenderFormOptions, RenderMode, SlotWidgetProps, SubtableDef, SubtableField, SubtableWidgetProps, TextWidgetProps, WidgetNode, WidgetProps, WidgetType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "form-design-v3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "流程表单设计器 / 渲染器 (Vue3 + TS)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist-lib/form-design-v3.umd.cjs",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"author": "mt",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
|
-
"url": "
|
|
50
|
+
"url": "https://code.xincheng.com/oa/bpm_2.0.git",
|
|
51
51
|
"directory": "designer"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
package/dist-lib/package.json
DELETED