@cluadwong/form-designer 0.2.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/LICENSE +21 -0
- package/README.md +261 -0
- package/dist/chunks/designer-ui.js +3092 -0
- package/dist/chunks/renderer-core.js +2635 -0
- package/dist/components/designer/CanvasSurface.vue.d.ts +64 -0
- package/dist/components/designer/CanvasSurface.vue.d.ts.map +1 -0
- package/dist/components/designer/DesignerToolbar.vue.d.ts +49 -0
- package/dist/components/designer/DesignerToolbar.vue.d.ts.map +1 -0
- package/dist/components/designer/FormDesigner.vue.d.ts +25 -0
- package/dist/components/designer/FormDesigner.vue.d.ts.map +1 -0
- package/dist/components/designer/HelpPanel.vue.d.ts +10 -0
- package/dist/components/designer/HelpPanel.vue.d.ts.map +1 -0
- package/dist/components/designer/InspectorPanel.vue.d.ts +48 -0
- package/dist/components/designer/InspectorPanel.vue.d.ts.map +1 -0
- package/dist/components/designer/NodeTreeItem.vue.d.ts +18 -0
- package/dist/components/designer/NodeTreeItem.vue.d.ts.map +1 -0
- package/dist/components/designer/PaletteSidebar.vue.d.ts +29 -0
- package/dist/components/designer/PaletteSidebar.vue.d.ts.map +1 -0
- package/dist/components/designer/StatusBar.vue.d.ts +25 -0
- package/dist/components/designer/StatusBar.vue.d.ts.map +1 -0
- package/dist/components/designer/composables/treeControl.d.ts +65 -0
- package/dist/components/designer/composables/treeControl.d.ts.map +1 -0
- package/dist/components/designer/composables/useFillData.d.ts +34 -0
- package/dist/components/designer/composables/useFillData.d.ts.map +1 -0
- package/dist/components/designer/composables/useNodeSelection.d.ts +56 -0
- package/dist/components/designer/composables/useNodeSelection.d.ts.map +1 -0
- package/dist/components/designer/composables/useSchemaDocument.d.ts +44 -0
- package/dist/components/designer/composables/useSchemaDocument.d.ts.map +1 -0
- package/dist/components/designer/composables/useSchemaEdits.d.ts +111 -0
- package/dist/components/designer/composables/useSchemaEdits.d.ts.map +1 -0
- package/dist/components/designer/config.d.ts +40 -0
- package/dist/components/designer/config.d.ts.map +1 -0
- package/dist/components/designer/export-api.d.ts +81 -0
- package/dist/components/designer/export-api.d.ts.map +1 -0
- package/dist/components/designer/inspectors/CellInspector.vue.d.ts +20 -0
- package/dist/components/designer/inspectors/CellInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/FieldPInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/FieldPInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/GridInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/GridInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/HeaderFooterFields.vue.d.ts +14 -0
- package/dist/components/designer/inspectors/HeaderFooterFields.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/HtmlInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/HtmlInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/ImageInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/ImageInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/IssuesPanel.vue.d.ts +11 -0
- package/dist/components/designer/inspectors/IssuesPanel.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/PageInspector.vue.d.ts +27 -0
- package/dist/components/designer/inspectors/PageInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/TableInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/TableInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/TextInspector.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/TextInspector.vue.d.ts.map +1 -0
- package/dist/components/designer/inspectors/TextStyleFields.vue.d.ts +10 -0
- package/dist/components/designer/inspectors/TextStyleFields.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/FormRenderer.vue.d.ts +106 -0
- package/dist/components/renderer-v2/FormRenderer.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/GridFormRenderer.vue.d.ts +49 -0
- package/dist/components/renderer-v2/GridFormRenderer.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/GridSchemaNode.vue.d.ts +46 -0
- package/dist/components/renderer-v2/GridSchemaNode.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/HtmlBlock.vue.d.ts +16 -0
- package/dist/components/renderer-v2/HtmlBlock.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/PaperViewport.vue.d.ts +63 -0
- package/dist/components/renderer-v2/PaperViewport.vue.d.ts.map +1 -0
- package/dist/components/renderer-v2/collectFieldValues.d.ts +29 -0
- package/dist/components/renderer-v2/collectFieldValues.d.ts.map +1 -0
- package/dist/components/renderer-v2/index.d.ts +13 -0
- package/dist/components/renderer-v2/index.d.ts.map +1 -0
- package/dist/components/renderer-v2/measure-rows.d.ts +12 -0
- package/dist/components/renderer-v2/measure-rows.d.ts.map +1 -0
- package/dist/components/renderer-v2/page-size-style.d.ts +28 -0
- package/dist/components/renderer-v2/page-size-style.d.ts.map +1 -0
- package/dist/components/renderer-v2/print-form.d.ts +20 -0
- package/dist/components/renderer-v2/print-form.d.ts.map +1 -0
- package/dist/designer-ui.css +5 -0
- package/dist/designer.d.ts +16 -0
- package/dist/designer.d.ts.map +1 -0
- package/dist/designer.js +16 -0
- package/dist/engine-v2/derivation.d.ts +81 -0
- package/dist/engine-v2/derivation.d.ts.map +1 -0
- package/dist/engine-v2/index.d.ts +3 -0
- package/dist/engine-v2/index.d.ts.map +1 -0
- package/dist/engine-v2/node-address.d.ts +25 -0
- package/dist/engine-v2/node-address.d.ts.map +1 -0
- package/dist/engine-v2/pagination.d.ts +120 -0
- package/dist/engine-v2/pagination.d.ts.map +1 -0
- package/dist/i18n/en.d.ts +7 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/types.d.ts +5 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/zh-CN.d.ts +7 -0
- package/dist/i18n/zh-CN.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/renderer-core.css +1 -0
- package/dist/renderer.d.ts +22 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +93 -0
- package/dist/samples/types.d.ts +18 -0
- package/dist/samples/types.d.ts.map +1 -0
- package/dist/ticket-designer.css +5 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/schema-v2-index.d.ts +15 -0
- package/dist/types/schema-v2-index.d.ts.map +1 -0
- package/dist/types/schema-v2-operations.d.ts +124 -0
- package/dist/types/schema-v2-operations.d.ts.map +1 -0
- package/dist/types/schema-v2-serialization.d.ts +30 -0
- package/dist/types/schema-v2-serialization.d.ts.map +1 -0
- package/dist/types/schema-v2-table-rows.d.ts +17 -0
- package/dist/types/schema-v2-table-rows.d.ts.map +1 -0
- package/dist/types/schema-v2-validation.d.ts +10 -0
- package/dist/types/schema-v2-validation.d.ts.map +1 -0
- package/dist/types/schema-v2.d.ts +283 -0
- package/dist/types/schema-v2.d.ts.map +1 -0
- package/dist/utils/date-format.d.ts +34 -0
- package/dist/utils/date-format.d.ts.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,EAAE,EAAE,QA8BhB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Locale, Messages } from "./types";
|
|
2
|
+
export type { Locale, Messages };
|
|
3
|
+
export declare const SUPPORTED_LOCALES: Locale[];
|
|
4
|
+
export declare const DEFAULT_LOCALE: Locale;
|
|
5
|
+
export declare function getLocale(): Locale;
|
|
6
|
+
export declare function setLocale(locale: Locale): void;
|
|
7
|
+
/** 按指定语言取文案;缺失 key 回退默认语言,仍缺失回退 key 本身。纯函数,便于配置驱动与测试。 */
|
|
8
|
+
export declare function translate(locale: Locale, key: string, params?: Record<string, string | number>): string;
|
|
9
|
+
/**
|
|
10
|
+
* 取当前语言文案(默认读全局 `currentLocale`,可被 `setLocale` 改变,供未迁移组件/运行时切换)。
|
|
11
|
+
* 传入 `locale` 则按指定语言取——设计页已迁移组件应显式传 `cfg.locale`(配置驱动,确定性、可测)。
|
|
12
|
+
*/
|
|
13
|
+
export declare function t(key: string, params?: Record<string, string | number>, locale?: Locale): string;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIhD,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAEjC,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAAoB,CAAC;AAC3D,eAAO,MAAM,cAAc,EAAE,MAAgB,CAAC;AAS9C,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI9C;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACvC,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,CAAC,CACf,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACxC,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEpC,gEAAgE;AAChE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["../../src/i18n/zh-CN.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,QA6BlB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { D as s, V as r, G as o, W as d, a as l, X as i, Y as t, Z as V, $ as m, o as n, a0 as c, z as p, a1 as g, a2 as R, b as S, a3 as u, E as h, a4 as G, c as C, a5 as F, a6 as T, d as N, I as E, a7 as w, e as I, a8 as b, K as P, M as _, a9 as v, J as z, H as D, aa as y, ab as M, ac as f, ad as A, ae as B, af as H, ag as O, ah as x, ai as J, f as L, i as W, aj as X, C as k, ak as q, A as K, al as U, am as j, an as Q, ao as Y, R as Z, p as $, ap as aa, T as ea, aq as sa, ar as ra, F as oa, n as da, m as la, as as ia, at as ta, v as Va, r as ma, au as na, av as ca, aw as pa, ax as ga, s as Ra, k as Sa, ay as ua, az as ha, B as Ga, aA as Ca, aB as Fa, g as Ta, aC as Na, aD as Ea, aE as wa, aF as Ia, x as ba, j as Pa, h as _a, aG as va, u as za, y as Da, w as ya, l as Ma, q as fa, Q as Aa, aH as Ba } from "./chunks/renderer-core.js";
|
|
2
|
+
import { F as Oa, a as xa, J as Ja, S as La, b as Wa, c as Xa, d as ka, e as qa, f as Ka, n as Ua, r as ja, s as Qa, g as Ya } from "./chunks/designer-ui.js";
|
|
3
|
+
export {
|
|
4
|
+
s as DEFAULT_BAND_HEIGHT_MM,
|
|
5
|
+
Oa as FILL_DATA_EXPORT_PREFIX,
|
|
6
|
+
xa as FormDesigner,
|
|
7
|
+
r as FormRenderer,
|
|
8
|
+
o as GridFormRenderer,
|
|
9
|
+
d as GridSchemaNode,
|
|
10
|
+
Ja as JSON_INDENT,
|
|
11
|
+
l as NODE_MOVE_MIME,
|
|
12
|
+
i as PAPER_SIDE_MM,
|
|
13
|
+
t as PRINT_PAPER_SELECTOR,
|
|
14
|
+
V as PRINT_ROOT_SELECTOR,
|
|
15
|
+
La as SCHEMA_EXPORT_PREFIX,
|
|
16
|
+
m as SchemaV2SerializationError,
|
|
17
|
+
n as addTableColumnV2,
|
|
18
|
+
c as appendGridRowV2,
|
|
19
|
+
p as appendNodeToCellV2,
|
|
20
|
+
g as appendTableRowsV2,
|
|
21
|
+
R as bindTableRowCell,
|
|
22
|
+
Wa as buildBlankSchema,
|
|
23
|
+
S as buildEditorNodeIndexV2,
|
|
24
|
+
u as buildTableRowField,
|
|
25
|
+
h as cloneNodeWithFreshIdsV2,
|
|
26
|
+
G as collectFieldKeys,
|
|
27
|
+
C as collectFieldValues,
|
|
28
|
+
Xa as collectFormData,
|
|
29
|
+
F as collectSchemaFields,
|
|
30
|
+
T as copyGridRowV2,
|
|
31
|
+
N as createEmptyFormSchemaV2,
|
|
32
|
+
E as createFieldPNodeV2,
|
|
33
|
+
w as createGridBySizeV2,
|
|
34
|
+
I as createGridNodeV2,
|
|
35
|
+
b as createGridRowV2,
|
|
36
|
+
P as createHtmlNodeV2,
|
|
37
|
+
_ as createImageNodeV2,
|
|
38
|
+
v as createSchemaNodeIdV2,
|
|
39
|
+
z as createTableNodeV2,
|
|
40
|
+
D as createTextNodeV2,
|
|
41
|
+
y as currentPageSizeStyle,
|
|
42
|
+
ka as defaultDesignerUIConfig,
|
|
43
|
+
qa as downloadJsonFile,
|
|
44
|
+
Ka as exportFileName,
|
|
45
|
+
M as findEmptyRequiredFields,
|
|
46
|
+
f as getAncestorsV2,
|
|
47
|
+
A as getNodeByIdV2,
|
|
48
|
+
B as getNodeRefByIdV2,
|
|
49
|
+
H as getOwnerCellV2,
|
|
50
|
+
O as gridFragmentHeightMm,
|
|
51
|
+
x as gridRowHeightMm,
|
|
52
|
+
J as insertGridRowV2,
|
|
53
|
+
L as insertRootGridV2,
|
|
54
|
+
W as isSelectableSchemaNodeV2,
|
|
55
|
+
X as listDropTargetsV2,
|
|
56
|
+
k as mergeGridCellsV2,
|
|
57
|
+
q as moveGridRowV2,
|
|
58
|
+
K as moveNodeToIndexV2,
|
|
59
|
+
U as moveNodeV2,
|
|
60
|
+
j as moveNodeWithinParentV2,
|
|
61
|
+
Q as normalizeFormSchemaV2,
|
|
62
|
+
Ua as normalizeIncomingSchema,
|
|
63
|
+
Y as paginatePage,
|
|
64
|
+
Z as paginateSchema,
|
|
65
|
+
$ as parseFormSchemaV2,
|
|
66
|
+
aa as parseTolerantFormSchemaV2,
|
|
67
|
+
ea as printForm,
|
|
68
|
+
sa as registerPageSizeStyle,
|
|
69
|
+
ra as removeGridRowV2,
|
|
70
|
+
oa as removeNodeV2,
|
|
71
|
+
da as removeTableColumnV2,
|
|
72
|
+
la as renameTableColumnKeyV2,
|
|
73
|
+
ia as resizeGridCellLayoutV2,
|
|
74
|
+
ta as resizeGridRowV2,
|
|
75
|
+
Va as resizeGridV2,
|
|
76
|
+
ma as resolveCellBoxV2,
|
|
77
|
+
ja as resolveDesignerUIConfig,
|
|
78
|
+
na as resolveGridGapV2,
|
|
79
|
+
ca as resolveImageSourceV2,
|
|
80
|
+
pa as resolvePaperSizeV2,
|
|
81
|
+
ga as resolveTableRowCount,
|
|
82
|
+
Qa as serializeFormDataJson,
|
|
83
|
+
Ra as serializeFormSchemaV2,
|
|
84
|
+
Ya as serializeSchemaJson,
|
|
85
|
+
Sa as setGridColumnWidthV2,
|
|
86
|
+
ua as setPageSizeStyle,
|
|
87
|
+
ha as splitGridCellRowsV2,
|
|
88
|
+
Ga as splitGridCellV2,
|
|
89
|
+
Ca as splitGridRowV2,
|
|
90
|
+
Fa as tableHeightMm,
|
|
91
|
+
Ta as updateBaseRowHeightV2,
|
|
92
|
+
Na as updateCellAlignV2,
|
|
93
|
+
Ea as updateCellPaddingV2,
|
|
94
|
+
wa as updateCellVerticalAlignV2,
|
|
95
|
+
Ia as updateCellWidthV2,
|
|
96
|
+
ba as updateGridBorderV2,
|
|
97
|
+
Pa as updateGridCellDefaultsV2,
|
|
98
|
+
_a as updateGridGapV2,
|
|
99
|
+
va as updateGridRowHeightV2,
|
|
100
|
+
za as updatePaperConfigV2,
|
|
101
|
+
Da as updateSchemaNodeV2,
|
|
102
|
+
ya as updateTableBorderV2,
|
|
103
|
+
Ma as updateTableColumnV2,
|
|
104
|
+
fa as updateTableMinRowsV2,
|
|
105
|
+
Aa as validateFormSchemaV2,
|
|
106
|
+
Ba as wrapCellChildrenWithGridV2
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.layout-html[data-v-2c9190b4]{width:100%;min-width:0}.layout-grid[data-v-3f4d7b64]{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.layout-grid__cell--flex[data-v-3f4d7b64]{flex-wrap:wrap}.layout-grid__row[data-v-3f4d7b64]{display:grid;flex:0 0 auto;width:100%;min-width:0;box-sizing:border-box}.layout-grid__cell[data-v-3f4d7b64]{display:flex;min-width:0;min-height:0;box-sizing:border-box;overflow:hidden}.layout-grid__cell--flex>.layout-p[data-v-3f4d7b64],.layout-grid__cell--flex>.layout-text[data-v-3f4d7b64]{flex:0 1 auto;width:auto;min-width:0}.layout-grid--all[data-v-3f4d7b64],.layout-grid--outer[data-v-3f4d7b64]{border:1px solid #111827}.layout-grid--no-top[data-v-3f4d7b64]{border-top:none}.layout-grid--no-right[data-v-3f4d7b64]{border-right:none}.layout-grid--no-bottom[data-v-3f4d7b64]{border-bottom:none}.layout-grid--no-left[data-v-3f4d7b64]{border-left:none}.layout-grid--all>.layout-grid__row:not(:last-child)>.layout-grid__cell[data-v-3f4d7b64],.layout-grid--inner>.layout-grid__row:not(:last-child)>.layout-grid__cell[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-grid--all>.layout-grid__row>.layout-grid__cell[data-v-3f4d7b64]:not(:last-child),.layout-grid--inner>.layout-grid__row>.layout-grid__cell[data-v-3f4d7b64]:not(:last-child){border-right:1px solid #111827}.layout-p[data-v-3f4d7b64]{display:flex;flex-wrap:wrap;width:100%;min-width:0;min-height:0;align-self:center;margin:0 1mm;padding:0;align-items:center;box-sizing:border-box;color:#111827;font-size:13px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere;outline:none}.layout-p[data-v-3f4d7b64] div{flex:1 1 100%;width:100%;min-width:0}.layout-p--inner-border[data-v-3f4d7b64] div{border-bottom:1px solid #111827}.layout-text[data-v-3f4d7b64]{display:flex;width:100%;min-width:0;min-height:0;align-self:center;margin:0;padding:0 1mm;align-items:center;box-sizing:border-box;color:#111827;font-size:13px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere;outline:none}.layout-p--field[data-v-3f4d7b64]{cursor:text}.layout-p--composite[data-v-3f4d7b64]{gap:1mm}.layout-p__label[data-v-3f4d7b64]{flex:0 0 auto;white-space:nowrap}.layout-p__input[data-v-3f4d7b64]{display:inline-block;flex:1 1 auto;min-width:12mm;min-height:1.35em;outline:none}.layout-p__value[data-v-3f4d7b64]{flex:1 1 auto;min-width:0;min-height:1.35em;white-space:pre-wrap;overflow-wrap:anywhere}.layout-p__line[data-v-3f4d7b64]{min-height:1.35em;width:100%;text-align:inherit;white-space:pre-wrap;overflow-wrap:anywhere}.layout-p__lines[data-v-3f4d7b64]{display:block;width:100%;outline:none;min-height:1.35em}.layout-p--underline[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-table[data-v-3f4d7b64]{display:block;width:100%;min-width:0;box-sizing:border-box;border-collapse:collapse}.layout-table--all[data-v-3f4d7b64],.layout-table--outer[data-v-3f4d7b64]{border:1px solid #111827}.layout-table--all .layout-table__row[data-v-3f4d7b64]:not(:last-child),.layout-table--inner .layout-table__row[data-v-3f4d7b64]:not(:last-child){border-bottom:1px solid #111827}.layout-table--all .layout-table__cell[data-v-3f4d7b64]:not(:last-child),.layout-table--inner .layout-table__cell[data-v-3f4d7b64]:not(:last-child){border-right:1px solid #111827}.layout-table--all .layout-table__header[data-v-3f4d7b64],.layout-table--inner .layout-table__header[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-table>thead[data-v-3f4d7b64],.layout-table>tbody[data-v-3f4d7b64]{display:block;width:100%}.layout-table__row[data-v-3f4d7b64]{display:grid;width:100%;min-width:0;flex:0 0 auto}.layout-table__cell[data-v-3f4d7b64]{display:flex;min-width:0;min-height:0;margin:0;padding:0 1mm;align-items:stretch;justify-content:center;box-sizing:border-box}.layout-table__header[data-v-3f4d7b64]{align-items:center;font-weight:600;text-align:center;font-size:16px}.layout-image[data-v-3f4d7b64]{max-width:100%;object-position:center}@media print{.layout-image--blank[data-v-3f4d7b64]{display:none}.layout-p--underline[data-v-3f4d7b64]{border-bottom:none}}.grid-form-canvas[data-v-f3e7b908]{height:100%;overflow:auto;padding:24px;background:#e5e7eb;box-sizing:border-box}.grid-form-canvas--bare[data-v-f3e7b908]{height:auto;padding:0;background:transparent;overflow:visible}.grid-form-paper[data-v-f3e7b908]{margin:0 auto 24px;background:#fff;box-sizing:border-box;box-shadow:0 4px 12px #0f172a24}.grid-form-band[data-v-f3e7b908]{position:absolute;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;box-sizing:border-box;overflow:hidden;font-size:12px;line-height:1.4;color:#111827}.grid-form-band__zone[data-v-f3e7b908]{min-width:0;white-space:nowrap}.grid-form-band__zone--left[data-v-f3e7b908],.grid-form-band__zone--right[data-v-f3e7b908]{overflow:hidden;text-overflow:ellipsis}.grid-form-band__zone--center[data-v-f3e7b908]{text-align:center}.grid-form-band__zone--right[data-v-f3e7b908]{text-align:right}@media print{.grid-form-canvas[data-v-f3e7b908]{height:auto;padding:0;overflow:visible;background:#fff}.grid-form-paper[data-v-f3e7b908]{margin:0;box-shadow:none;break-after:page}.grid-form-paper[data-v-f3e7b908]:last-child{break-after:auto}}.paper-viewport[data-v-2b6e9ef6]{position:relative;width:100%;height:100%;background:#e5e7eb}.paper-viewport__scaler[data-v-2b6e9ef6]{transform-origin:50% 50%;will-change:transform}.paper-viewport.is-space-pan .paper-viewport__scaler[data-v-2b6e9ef6]>*{pointer-events:none}.paper-viewport.is-space-pan[data-v-2b6e9ef6],.paper-viewport.is-space-pan .paper-viewport__scaler[data-v-2b6e9ef6]>*{cursor:grab}.paper-viewport.is-space-pan[data-v-2b6e9ef6]:active{cursor:grabbing}.paper-viewport__bar[data-v-2b6e9ef6]{position:absolute;right:12px;bottom:12px;z-index:20;display:flex;align-items:center;gap:6px;padding:4px 6px;background:#ffffffeb;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 2px 8px #0f172a1f;font-size:13px;-webkit-user-select:none;user-select:none}.paper-viewport__btn[data-v-2b6e9ef6]{min-width:26px;height:26px;padding:0 6px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#0f172a;cursor:pointer;font-size:14px;line-height:1}.paper-viewport__btn[data-v-2b6e9ef6]:hover{background:#f1f5f9}.paper-viewport__btn--text[data-v-2b6e9ef6]{font-size:12px}.paper-viewport__scale[data-v-2b6e9ef6]{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:#334155}@media print{.paper-viewport[data-v-2b6e9ef6]{overflow:visible!important;height:auto!important;background:#fff!important}.paper-viewport__scaler[data-v-2b6e9ef6]{transform:none!important}.paper-viewport__bar[data-v-2b6e9ef6]{display:none!important}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 渲染 / 填写 / 打印入口(消费端入口)
|
|
3
|
+
*
|
|
4
|
+
* ERP 等宿主系统只需引用这个入口:`import { FormRenderer } from "@cluadwong/form-designer/renderer"`。
|
|
5
|
+
* 设计器(FormDesigner)及其 UI 资源不在本入口内,不会被打进消费端产物。
|
|
6
|
+
*
|
|
7
|
+
* 典型用法:设计器导出 Schema JSON → 服务端存储 → 宿主用 FormRenderer 加载 schema + data 渲染 / 填写 / 打印。
|
|
8
|
+
*
|
|
9
|
+
* 注意:入口文件一律用相对路径 import,不用 `@/` 别名 —— 生成的 .d.ts 会保留别名,
|
|
10
|
+
* 消费方 TS 无法解析。
|
|
11
|
+
*/
|
|
12
|
+
export { default as FormRenderer } from "./components/renderer-v2/FormRenderer.vue";
|
|
13
|
+
export { default as GridFormRenderer } from "./components/renderer-v2/GridFormRenderer.vue";
|
|
14
|
+
export { default as GridSchemaNode } from "./components/renderer-v2/GridSchemaNode.vue";
|
|
15
|
+
export type { FormRendererOptions } from "./components/renderer-v2/FormRenderer.vue";
|
|
16
|
+
export { collectFieldValues } from "./components/renderer-v2/collectFieldValues";
|
|
17
|
+
export { printForm, PRINT_PAPER_SELECTOR, PRINT_ROOT_SELECTOR } from "./components/renderer-v2/print-form";
|
|
18
|
+
export type { PrintFormOptions } from "./components/renderer-v2/print-form";
|
|
19
|
+
export { setPageSizeStyle, registerPageSizeStyle, currentPageSizeStyle, } from "./components/renderer-v2/page-size-style";
|
|
20
|
+
export * from "./types";
|
|
21
|
+
export * from "./engine-v2";
|
|
22
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACxF,YAAY,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAIjF,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC3G,YAAY,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAG5E,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,0CAA0C,CAAC;AAGlD,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC"}
|
package/dist/renderer.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { D as s, V as r, G as d, W as o, a as l, X as i, Y as t, Z as V, $ as m, o as p, a0 as n, z as c, a1 as u, a2 as G, b as R, a3 as g, E as h, a4 as S, c as C, a5 as T, a6 as N, d as w, I as F, a7 as b, e as E, a8 as v, K as P, M as y, a9 as I, J as z, H as M, aa as _, ab as B, ac as H, ad as A, ae as D, af as f, ag as x, ah as O, ai as W, f as L, i as q, aj as K, C as j, ak as k, A as J, al as Q, am as U, an as X, ao as Y, R as Z, p as $, ap as aa, T as ea, aq as sa, ar as ra, F as da, n as oa, m as la, as as ia, at as ta, v as Va, r as ma, au as pa, av as na, aw as ca, ax as ua, s as Ga, k as Ra, ay as ga, az as ha, B as Sa, aA as Ca, aB as Ta, g as Na, aC as wa, aD as Fa, aE as ba, aF as Ea, x as va, j as Pa, h as ya, aG as Ia, u as za, y as Ma, w as _a, l as Ba, q as Ha, Q as Aa, aH as Da } from "./chunks/renderer-core.js";
|
|
2
|
+
export {
|
|
3
|
+
s as DEFAULT_BAND_HEIGHT_MM,
|
|
4
|
+
r as FormRenderer,
|
|
5
|
+
d as GridFormRenderer,
|
|
6
|
+
o as GridSchemaNode,
|
|
7
|
+
l as NODE_MOVE_MIME,
|
|
8
|
+
i as PAPER_SIDE_MM,
|
|
9
|
+
t as PRINT_PAPER_SELECTOR,
|
|
10
|
+
V as PRINT_ROOT_SELECTOR,
|
|
11
|
+
m as SchemaV2SerializationError,
|
|
12
|
+
p as addTableColumnV2,
|
|
13
|
+
n as appendGridRowV2,
|
|
14
|
+
c as appendNodeToCellV2,
|
|
15
|
+
u as appendTableRowsV2,
|
|
16
|
+
G as bindTableRowCell,
|
|
17
|
+
R as buildEditorNodeIndexV2,
|
|
18
|
+
g as buildTableRowField,
|
|
19
|
+
h as cloneNodeWithFreshIdsV2,
|
|
20
|
+
S as collectFieldKeys,
|
|
21
|
+
C as collectFieldValues,
|
|
22
|
+
T as collectSchemaFields,
|
|
23
|
+
N as copyGridRowV2,
|
|
24
|
+
w as createEmptyFormSchemaV2,
|
|
25
|
+
F as createFieldPNodeV2,
|
|
26
|
+
b as createGridBySizeV2,
|
|
27
|
+
E as createGridNodeV2,
|
|
28
|
+
v as createGridRowV2,
|
|
29
|
+
P as createHtmlNodeV2,
|
|
30
|
+
y as createImageNodeV2,
|
|
31
|
+
I as createSchemaNodeIdV2,
|
|
32
|
+
z as createTableNodeV2,
|
|
33
|
+
M as createTextNodeV2,
|
|
34
|
+
_ as currentPageSizeStyle,
|
|
35
|
+
B as findEmptyRequiredFields,
|
|
36
|
+
H as getAncestorsV2,
|
|
37
|
+
A as getNodeByIdV2,
|
|
38
|
+
D as getNodeRefByIdV2,
|
|
39
|
+
f as getOwnerCellV2,
|
|
40
|
+
x as gridFragmentHeightMm,
|
|
41
|
+
O as gridRowHeightMm,
|
|
42
|
+
W as insertGridRowV2,
|
|
43
|
+
L as insertRootGridV2,
|
|
44
|
+
q as isSelectableSchemaNodeV2,
|
|
45
|
+
K as listDropTargetsV2,
|
|
46
|
+
j as mergeGridCellsV2,
|
|
47
|
+
k as moveGridRowV2,
|
|
48
|
+
J as moveNodeToIndexV2,
|
|
49
|
+
Q as moveNodeV2,
|
|
50
|
+
U as moveNodeWithinParentV2,
|
|
51
|
+
X as normalizeFormSchemaV2,
|
|
52
|
+
Y as paginatePage,
|
|
53
|
+
Z as paginateSchema,
|
|
54
|
+
$ as parseFormSchemaV2,
|
|
55
|
+
aa as parseTolerantFormSchemaV2,
|
|
56
|
+
ea as printForm,
|
|
57
|
+
sa as registerPageSizeStyle,
|
|
58
|
+
ra as removeGridRowV2,
|
|
59
|
+
da as removeNodeV2,
|
|
60
|
+
oa as removeTableColumnV2,
|
|
61
|
+
la as renameTableColumnKeyV2,
|
|
62
|
+
ia as resizeGridCellLayoutV2,
|
|
63
|
+
ta as resizeGridRowV2,
|
|
64
|
+
Va as resizeGridV2,
|
|
65
|
+
ma as resolveCellBoxV2,
|
|
66
|
+
pa as resolveGridGapV2,
|
|
67
|
+
na as resolveImageSourceV2,
|
|
68
|
+
ca as resolvePaperSizeV2,
|
|
69
|
+
ua as resolveTableRowCount,
|
|
70
|
+
Ga as serializeFormSchemaV2,
|
|
71
|
+
Ra as setGridColumnWidthV2,
|
|
72
|
+
ga as setPageSizeStyle,
|
|
73
|
+
ha as splitGridCellRowsV2,
|
|
74
|
+
Sa as splitGridCellV2,
|
|
75
|
+
Ca as splitGridRowV2,
|
|
76
|
+
Ta as tableHeightMm,
|
|
77
|
+
Na as updateBaseRowHeightV2,
|
|
78
|
+
wa as updateCellAlignV2,
|
|
79
|
+
Fa as updateCellPaddingV2,
|
|
80
|
+
ba as updateCellVerticalAlignV2,
|
|
81
|
+
Ea as updateCellWidthV2,
|
|
82
|
+
va as updateGridBorderV2,
|
|
83
|
+
Pa as updateGridCellDefaultsV2,
|
|
84
|
+
ya as updateGridGapV2,
|
|
85
|
+
Ia as updateGridRowHeightV2,
|
|
86
|
+
za as updatePaperConfigV2,
|
|
87
|
+
Ma as updateSchemaNodeV2,
|
|
88
|
+
_a as updateTableBorderV2,
|
|
89
|
+
Ba as updateTableColumnV2,
|
|
90
|
+
Ha as updateTableMinRowsV2,
|
|
91
|
+
Aa as validateFormSchemaV2,
|
|
92
|
+
Da as wrapCellChildrenWithGridV2
|
|
93
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FormSchemaV2 } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* 可由外层(dev 入口 / 测试)注入设计器的样例条目。
|
|
4
|
+
*
|
|
5
|
+
* 设计器核心不直接依赖 `dev` 样例目录(B3):样例统一通过 props 注入,
|
|
6
|
+
* 因此任何宿主都能传入自己的样例集,而无需改动 `FormDesigner`。
|
|
7
|
+
* 注:预览态不再注入预置种子数据(2026-09-08),样例只携带 schema;
|
|
8
|
+
* 原样例级 `previewData` 字段已随死代码清理移除(P12 二次盘点)。
|
|
9
|
+
*/
|
|
10
|
+
export interface SampleEntry {
|
|
11
|
+
/** 稳定标识,用于 key 与回溯。 */
|
|
12
|
+
id: string;
|
|
13
|
+
/** 工具栏按钮文案(渲染为「载入{label}」)。 */
|
|
14
|
+
label: string;
|
|
15
|
+
/** 惰性构造样例 schema(每次调用返回新实例,配合不可变操作)。 */
|
|
16
|
+
loadSchema: () => FormSchemaV2;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/samples/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,UAAU,EAAE,MAAM,YAAY,CAAC;CAChC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* 以下内容内联自 renderer-core.css:设计器复用渲染内核呈现纸张与版式,必须一并加载 */
|
|
2
|
+
.layout-html[data-v-2c9190b4]{width:100%;min-width:0}.layout-grid[data-v-3f4d7b64]{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.layout-grid__cell--flex[data-v-3f4d7b64]{flex-wrap:wrap}.layout-grid__row[data-v-3f4d7b64]{display:grid;flex:0 0 auto;width:100%;min-width:0;box-sizing:border-box}.layout-grid__cell[data-v-3f4d7b64]{display:flex;min-width:0;min-height:0;box-sizing:border-box;overflow:hidden}.layout-grid__cell--flex>.layout-p[data-v-3f4d7b64],.layout-grid__cell--flex>.layout-text[data-v-3f4d7b64]{flex:0 1 auto;width:auto;min-width:0}.layout-grid--all[data-v-3f4d7b64],.layout-grid--outer[data-v-3f4d7b64]{border:1px solid #111827}.layout-grid--no-top[data-v-3f4d7b64]{border-top:none}.layout-grid--no-right[data-v-3f4d7b64]{border-right:none}.layout-grid--no-bottom[data-v-3f4d7b64]{border-bottom:none}.layout-grid--no-left[data-v-3f4d7b64]{border-left:none}.layout-grid--all>.layout-grid__row:not(:last-child)>.layout-grid__cell[data-v-3f4d7b64],.layout-grid--inner>.layout-grid__row:not(:last-child)>.layout-grid__cell[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-grid--all>.layout-grid__row>.layout-grid__cell[data-v-3f4d7b64]:not(:last-child),.layout-grid--inner>.layout-grid__row>.layout-grid__cell[data-v-3f4d7b64]:not(:last-child){border-right:1px solid #111827}.layout-p[data-v-3f4d7b64]{display:flex;flex-wrap:wrap;width:100%;min-width:0;min-height:0;align-self:center;margin:0 1mm;padding:0;align-items:center;box-sizing:border-box;color:#111827;font-size:13px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere;outline:none}.layout-p[data-v-3f4d7b64] div{flex:1 1 100%;width:100%;min-width:0}.layout-p--inner-border[data-v-3f4d7b64] div{border-bottom:1px solid #111827}.layout-text[data-v-3f4d7b64]{display:flex;width:100%;min-width:0;min-height:0;align-self:center;margin:0;padding:0 1mm;align-items:center;box-sizing:border-box;color:#111827;font-size:13px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere;outline:none}.layout-p--field[data-v-3f4d7b64]{cursor:text}.layout-p--composite[data-v-3f4d7b64]{gap:1mm}.layout-p__label[data-v-3f4d7b64]{flex:0 0 auto;white-space:nowrap}.layout-p__input[data-v-3f4d7b64]{display:inline-block;flex:1 1 auto;min-width:12mm;min-height:1.35em;outline:none}.layout-p__value[data-v-3f4d7b64]{flex:1 1 auto;min-width:0;min-height:1.35em;white-space:pre-wrap;overflow-wrap:anywhere}.layout-p__line[data-v-3f4d7b64]{min-height:1.35em;width:100%;text-align:inherit;white-space:pre-wrap;overflow-wrap:anywhere}.layout-p__lines[data-v-3f4d7b64]{display:block;width:100%;outline:none;min-height:1.35em}.layout-p--underline[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-table[data-v-3f4d7b64]{display:block;width:100%;min-width:0;box-sizing:border-box;border-collapse:collapse}.layout-table--all[data-v-3f4d7b64],.layout-table--outer[data-v-3f4d7b64]{border:1px solid #111827}.layout-table--all .layout-table__row[data-v-3f4d7b64]:not(:last-child),.layout-table--inner .layout-table__row[data-v-3f4d7b64]:not(:last-child){border-bottom:1px solid #111827}.layout-table--all .layout-table__cell[data-v-3f4d7b64]:not(:last-child),.layout-table--inner .layout-table__cell[data-v-3f4d7b64]:not(:last-child){border-right:1px solid #111827}.layout-table--all .layout-table__header[data-v-3f4d7b64],.layout-table--inner .layout-table__header[data-v-3f4d7b64]{border-bottom:1px solid #111827}.layout-table>thead[data-v-3f4d7b64],.layout-table>tbody[data-v-3f4d7b64]{display:block;width:100%}.layout-table__row[data-v-3f4d7b64]{display:grid;width:100%;min-width:0;flex:0 0 auto}.layout-table__cell[data-v-3f4d7b64]{display:flex;min-width:0;min-height:0;margin:0;padding:0 1mm;align-items:stretch;justify-content:center;box-sizing:border-box}.layout-table__header[data-v-3f4d7b64]{align-items:center;font-weight:600;text-align:center;font-size:16px}.layout-image[data-v-3f4d7b64]{max-width:100%;object-position:center}@media print{.layout-image--blank[data-v-3f4d7b64]{display:none}.layout-p--underline[data-v-3f4d7b64]{border-bottom:none}}.grid-form-canvas[data-v-f3e7b908]{height:100%;overflow:auto;padding:24px;background:#e5e7eb;box-sizing:border-box}.grid-form-canvas--bare[data-v-f3e7b908]{height:auto;padding:0;background:transparent;overflow:visible}.grid-form-paper[data-v-f3e7b908]{margin:0 auto 24px;background:#fff;box-sizing:border-box;box-shadow:0 4px 12px #0f172a24}.grid-form-band[data-v-f3e7b908]{position:absolute;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;box-sizing:border-box;overflow:hidden;font-size:12px;line-height:1.4;color:#111827}.grid-form-band__zone[data-v-f3e7b908]{min-width:0;white-space:nowrap}.grid-form-band__zone--left[data-v-f3e7b908],.grid-form-band__zone--right[data-v-f3e7b908]{overflow:hidden;text-overflow:ellipsis}.grid-form-band__zone--center[data-v-f3e7b908]{text-align:center}.grid-form-band__zone--right[data-v-f3e7b908]{text-align:right}@media print{.grid-form-canvas[data-v-f3e7b908]{height:auto;padding:0;overflow:visible;background:#fff}.grid-form-paper[data-v-f3e7b908]{margin:0;box-shadow:none;break-after:page}.grid-form-paper[data-v-f3e7b908]:last-child{break-after:auto}}.paper-viewport[data-v-2b6e9ef6]{position:relative;width:100%;height:100%;background:#e5e7eb}.paper-viewport__scaler[data-v-2b6e9ef6]{transform-origin:50% 50%;will-change:transform}.paper-viewport.is-space-pan .paper-viewport__scaler[data-v-2b6e9ef6]>*{pointer-events:none}.paper-viewport.is-space-pan[data-v-2b6e9ef6],.paper-viewport.is-space-pan .paper-viewport__scaler[data-v-2b6e9ef6]>*{cursor:grab}.paper-viewport.is-space-pan[data-v-2b6e9ef6]:active{cursor:grabbing}.paper-viewport__bar[data-v-2b6e9ef6]{position:absolute;right:12px;bottom:12px;z-index:20;display:flex;align-items:center;gap:6px;padding:4px 6px;background:#ffffffeb;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 2px 8px #0f172a1f;font-size:13px;-webkit-user-select:none;user-select:none}.paper-viewport__btn[data-v-2b6e9ef6]{min-width:26px;height:26px;padding:0 6px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#0f172a;cursor:pointer;font-size:14px;line-height:1}.paper-viewport__btn[data-v-2b6e9ef6]:hover{background:#f1f5f9}.paper-viewport__btn--text[data-v-2b6e9ef6]{font-size:12px}.paper-viewport__scale[data-v-2b6e9ef6]{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;color:#334155}@media print{.paper-viewport[data-v-2b6e9ef6]{overflow:visible!important;height:auto!important;background:#fff!important}.paper-viewport__scaler[data-v-2b6e9ef6]{transform:none!important}.paper-viewport__bar[data-v-2b6e9ef6]{display:none!important}}
|
|
3
|
+
|
|
4
|
+
/* ===== 内联自 renderer-core.css 结束 ===== */
|
|
5
|
+
.v2-canvas-surface[data-v-deb3136c]{position:relative;width:100%;height:100%}.v2-canvas-surface--preview[data-v-deb3136c] .grid-form-canvas{padding:24px}.v2-canvas-surface[data-v-deb3136c] .is-design-selected{position:relative;z-index:2;background-color:#2563eb1f!important;box-shadow:inset 0 0 0 2px #2563eb!important}.v2-canvas-surface[data-v-deb3136c] .v2-drop-target{outline:2px dashed #2563eb;outline-offset:-2px;background:#eff6ff}.v2-insertion-line[data-v-deb3136c]{height:2px;background:#2563eb;box-shadow:0 0 0 1px #2563eb66;border-radius:1px;pointer-events:none;z-index:5}@media print{.v2-canvas-surface[data-v-deb3136c] .is-design-selected{background-color:transparent!important;box-shadow:none!important}.v2-canvas-surface[data-v-deb3136c] .v2-drop-target{outline:none!important;background:transparent!important}.v2-canvas-surface .v2-insertion-line[data-v-deb3136c]{display:none!important}}.status-bar[data-v-e5a749ea]{display:flex;align-items:center;justify-content:space-between;padding:0 16px;background:#1f2937;color:#d1d5db;font-size:12px;height:28px}.status-group[data-v-e5a749ea]{display:flex;align-items:center;gap:16px}.status-item[data-v-e5a749ea]{display:inline-flex;align-items:center;gap:4px}.status-item strong[data-v-e5a749ea]{color:#f9fafb}.warning-count.has-warning[data-v-e5a749ea]{color:#fbbf24}.warning-count.has-warning strong[data-v-e5a749ea]{color:#f59e0b}.muted[data-v-e5a749ea]{color:#6b7280}@media print{.status-bar[data-v-e5a749ea]{display:none!important}}.v2-toolbar__dirty[data-v-71ae7003]{padding:1px 8px;border-radius:10px;color:#94a3b8;background:#ffffff14;font-size:11px}.v2-toolbar__dirty--on[data-v-71ae7003]{color:#fde68a;background:#fde68a2e}.v2-toolbar__label[data-v-71ae7003]{align-self:center;margin-right:2px;font-size:12px;color:#9fb3c8}.v2-tree-row[data-v-10a2a207]{display:flex;align-items:center;gap:4px;padding:3px 6px;font-size:12px;line-height:1.5;color:#334155;cursor:pointer;border-radius:3px;-webkit-user-select:none;user-select:none}.v2-tree-row[data-v-10a2a207]:hover{background:#f1f5f9}.v2-tree-row--selected[data-v-10a2a207]{background:#dbeafe;color:#1d4ed8;font-weight:600}.v2-tree-toggle[data-v-10a2a207]{flex:0 0 auto;width:16px;height:16px;padding:0;border:none;background:transparent;color:#64748b;font-size:10px;line-height:16px;cursor:pointer}.v2-tree-dot[data-v-10a2a207]{flex:0 0 auto;width:16px;text-align:center;color:#cbd5e1}.v2-tree-label[data-v-10a2a207]{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v2-tree-type[data-v-10a2a207]{flex:0 0 auto;font-size:10px;color:#94a3b8;background:#f8fafc;border:1px solid #e2e8f0;border-radius:3px;padding:0 4px}.v2-sidebar__heading[data-v-91a9dac6]{margin-bottom:14px;color:#334155;font-size:13px;font-weight:700}.v2-sidebar__heading--tree[data-v-91a9dac6]{margin-top:16px;margin-bottom:8px;padding-top:12px;border-top:1px solid #e2e8f0}.v2-tree-head[data-v-91a9dac6]{display:flex;align-items:center;justify-content:space-between}.v2-tree__delete[data-v-91a9dac6]{padding:3px 8px;border:1px solid #fca5a5;border-radius:4px;color:#b91c1c;background:#fff7f7;font-size:12px;font-weight:500;cursor:pointer}.v2-tree__delete[data-v-91a9dac6]:hover:not(:disabled){background:#fee2e2}.v2-tree__delete[data-v-91a9dac6]:disabled{opacity:.45;cursor:not-allowed}.v2-tree__buttons[data-v-91a9dac6]{display:flex;gap:8px;margin-top:8px}.v2-tree__btn[data-v-91a9dac6]{flex:1 1 0;padding:5px 0;border:1px solid #cbd5e1;border-radius:4px;color:#334155;background:#f8fafc;font-size:12px;cursor:pointer}.v2-tree__btn[data-v-91a9dac6]:hover{background:#eef2f7}.v2-tree[data-v-91a9dac6]{max-height:42vh;overflow:auto;border:1px solid #e2e8f0;border-radius:4px;padding:4px 2px;background:#fcfdff}.v2-palette-item[data-v-91a9dac6]{display:block;width:100%;margin-bottom:8px;padding:9px 10px;border:1px solid #d8dee8;border-radius:4px;color:#334155;background:#f8fafc;font-size:12px}.v2-palette-item--button[data-v-91a9dac6]{text-align:left;cursor:pointer}.v2-palette-item--button[data-v-91a9dac6]:disabled{cursor:not-allowed;opacity:.45}.v2-sidebar__group-title[data-v-91a9dac6]{margin:16px 0 8px;padding-left:8px;border-left:3px solid #2563eb;color:#1e293b;font-size:12px;font-weight:700}.v2-sidebar__group-title[data-v-91a9dac6]:first-child{margin-top:0}.v2-col-table[data-v-6aacc8cd]{border:1px solid #e2e8f0;border-radius:6px;overflow:hidden}.v2-col-table__row[data-v-6aacc8cd]{display:grid;grid-template-columns:1fr 1fr 32px;align-items:center;gap:0;border-bottom:1px solid #f1f5f9}.v2-col-table__row[data-v-6aacc8cd]:last-child{border-bottom:none}.v2-col-table__head[data-v-6aacc8cd]{background:#f8fafc;border-bottom:1px solid #e2e8f0!important}.v2-col-table__th[data-v-6aacc8cd]{padding:6px 10px;font-size:11px;font-weight:700;color:#64748b;text-transform:none}.v2-col-table__th--action[data-v-6aacc8cd]{padding:6px 4px}.v2-col-table__input[data-v-6aacc8cd]{width:100%;min-height:32px;padding:4px 8px;border:none;border-right:1px solid #f1f5f9;background:#fff;font-size:12px;color:#1e293b;outline:none;box-sizing:border-box}.v2-col-table__input[data-v-6aacc8cd]:focus{background:#eff6ff;box-shadow:inset 0 0 0 1px #93c5fd}.v2-col-table__input--mono[data-v-6aacc8cd]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;color:#475569}.v2-inspector__delete[data-v-6aacc8cd]{margin-left:auto;padding:4px 8px;border:1px solid #fca5a5;border-radius:4px;color:#b91c1c;background:#fff7f7;font-size:12px;cursor:pointer}.v2-inspector__delete[data-v-6aacc8cd]:hover:not(:disabled){background:#fee2e2}.v2-inspector__delete[data-v-6aacc8cd]:disabled{opacity:.45;cursor:not-allowed}.v2-inspector__delete--small[data-v-6aacc8cd]{padding:2px 8px;font-size:11px}.v2-add-col[data-v-6aacc8cd]{width:100%;margin-top:8px;border-color:#93c5fd;color:#1d4ed8;background:#eff6ff}.v2-add-col[data-v-6aacc8cd]:hover{background:#dbeafe}.v2-issues[data-v-1f696812]{margin-top:18px;padding:10px;border:1px solid #f0b7b7;border-radius:4px;color:#991b1b;background:#fff5f5;font-size:12px}.v2-issues--ok[data-v-1f696812]{border-color:#b7dfc5;color:#166534;background:#f0fdf4}.v2-issue[data-v-1f696812]{margin-top:6px;line-height:1.45}.v2-issue--selectable[data-v-1f696812]{cursor:pointer}.v2-issue--selectable[data-v-1f696812]:hover{color:#1d4ed8;text-decoration:underline}.v2-sidebar--right[data-v-b0930d9c]{border-right:0;border-left:1px solid #d8dee8}.v2-inspector-row[data-v-b0930d9c]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;color:#64748b;font-size:12px}.v2-inspector-row--head[data-v-b0930d9c]{position:sticky;top:0;padding-bottom:10px;border-bottom:1px solid #e2e8f0;background:#fff}.v2-inspector-row code[data-v-b0930d9c]{max-width:150px;overflow:hidden;color:#334155;text-overflow:ellipsis;white-space:nowrap}.v2-help[data-v-3f47c5df]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:#0f172a73}.v2-help__panel[data-v-3f47c5df]{display:flex;flex-direction:column;width:min(760px,calc(100vw - 48px));max-height:min(86vh,900px);border-radius:8px;background:#fff;box-shadow:0 20px 60px #0f172a40;overflow:hidden}.v2-help__head[data-v-3f47c5df]{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:12px 18px;border-bottom:1px solid #e2e8f0}.v2-help__head h2[data-v-3f47c5df]{margin:0;color:#1e293b;font-size:15px;font-weight:700}.v2-help__close[data-v-3f47c5df]{padding:2px 8px;border:1px solid #cbd5e1;border-radius:4px;color:#475569;background:#f8fafc;font-size:13px;line-height:1.4;cursor:pointer}.v2-help__close[data-v-3f47c5df]:hover{background:#eef2f7}.v2-help__body[data-v-3f47c5df]{padding:6px 18px 18px;overflow-y:auto;color:#334155;font-size:13px;line-height:1.7}.v2-help__body h3[data-v-3f47c5df]{margin:16px 0 6px;padding-left:8px;border-left:3px solid #2563eb;color:#1e293b;font-size:13px;font-weight:700}.v2-help__body p[data-v-3f47c5df]{margin:4px 0}.v2-help__body ul[data-v-3f47c5df],.v2-help__body ol[data-v-3f47c5df]{margin:4px 0;padding-left:20px}.v2-help__body li[data-v-3f47c5df]{margin:2px 0}.v2-help__body table[data-v-3f47c5df]{width:100%;margin:6px 0;border:1px solid #e2e8f0;border-collapse:collapse}.v2-help__body th[data-v-3f47c5df],.v2-help__body td[data-v-3f47c5df]{padding:4px 8px;border:1px solid #e2e8f0;text-align:left;vertical-align:top;font-weight:400}.v2-help__body th[data-v-3f47c5df]{width:34%;color:#1e293b;background:#f8fafc;font-weight:600;white-space:nowrap}.v2-help__tip[data-v-3f47c5df]{margin-top:6px!important;padding:6px 10px;border-radius:4px;background:#eff6ff}@media print{.v2-help[data-v-3f47c5df]{display:none!important}}.v2-toolbar{display:flex;align-items:center;gap:18px;padding:0 18px;color:#f8fafc;background:#172033;overflow-x:auto}.v2-toolbar>*{flex-shrink:0}.v2-toolbar__group{display:flex;gap:6px}.v2-toolbar__group:last-of-type{margin-left:auto}.v2-toolbar__button{height:28px;padding:0 12px;border:1px solid #4c6484;border-radius:4px;color:#f8fafc;background:#263957;cursor:pointer;font-size:12px;white-space:nowrap}.v2-toolbar__button:disabled{cursor:not-allowed;opacity:.4}.v2-toolbar__button--active{border-color:#60a5fa;background:#1d4ed8}.v2-toolbar--row{background:#fff}.v2-sidebar{min-width:0;padding:16px;overflow:auto;background:#fff;border-right:1px solid #d8dee8}.v2-sidebar__subheading{margin:16px 0 8px;color:#64748b;font-size:11px;font-weight:700}.v2-sidebar__hint{margin:18px 2px 0;color:#64748b;font-size:11px;line-height:1.6}.v2-control{display:flex;flex-direction:column;gap:6px;margin:14px 0;color:#475569;font-size:12px}.v2-control input,.v2-control select{width:100%;min-height:30px;padding:0 8px;border:1px solid #cbd5e1;border-radius:4px;box-sizing:border-box;color:#1e293b;background:#fff;font-size:12px}.v2-control input[type=checkbox]{width:16px;min-height:16px;height:16px;margin:0;padding:0;border:none;background:transparent;align-self:flex-start;accent-color:#2563eb;cursor:pointer}.v2-control--inline{flex-direction:column;align-items:stretch;gap:6px;margin:0}.v2-control--toggle{flex-direction:row;align-items:center;gap:6px;margin:14px 0 0}.v2-control--toggle span{color:#475569;font-size:12px}.v2-control--full{grid-column:1 / -1}.v2-grid-dimensions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.v2-grid-dimensions .v2-control{margin:0}.v2-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-bottom:4px}.v2-style-grid .v2-control{margin-bottom:0}.v2-style-grid .v2-control--inline input[type=color]{width:100%;height:26px;padding:0;border:1px solid #cbd5e1;border-radius:3px;background:#fff}.v2-textarea{width:100%;min-height:30px;padding:6px 8px;border:1px solid #cbd5e1;border-radius:4px;box-sizing:border-box;color:#1e293b;background:#fff;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.v2-hint{margin:-6px 0 12px;color:#64748b;font-size:11px;line-height:1.6}.v2-hint code{padding:1px 4px;border-radius:3px;background:#f1f5f9;font-size:11px}@media print{.v2-toolbar,.v2-sidebar{display:none!important}}.v2-designer[data-v-c31c7c34]{display:grid;grid-template-rows:48px minmax(0,1fr) 28px;height:var(--v2-designer-height, 100%);min-height:0;overflow:hidden;background:#f3f4f6}.v2-toolbar__file[data-v-c31c7c34]{display:none}.v2-designer__body[data-v-c31c7c34]{display:grid;grid-template-columns:360px minmax(0,1fr) 360px;min-height:0}.v2-canvas[data-v-c31c7c34]{min-width:0;overflow:hidden}@media print{[data-v-c31c7c34] .status-bar{display:none!important}.v2-designer[data-v-c31c7c34],.v2-designer__body[data-v-c31c7c34],.v2-canvas[data-v-c31c7c34]{display:block;height:auto;overflow:visible}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** V2 Schema、索引、校验和结构操作的统一出口。 */
|
|
2
|
+
export * from "./schema-v2";
|
|
3
|
+
export * from "./schema-v2-index";
|
|
4
|
+
export * from "./schema-v2-validation";
|
|
5
|
+
export * from "./schema-v2-operations";
|
|
6
|
+
export * from "./schema-v2-serialization";
|
|
7
|
+
export * from "./schema-v2-table-rows";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FormSchemaV2, GridCellV2, EditorNodeV2, TableCellTemplateV2 } from "./schema-v2";
|
|
2
|
+
export interface EditorNodeRefV2 {
|
|
3
|
+
node: EditorNodeV2;
|
|
4
|
+
parent: EditorNodeV2 | null;
|
|
5
|
+
path: Array<string | number>;
|
|
6
|
+
ownerCell?: GridCellV2 | TableCellTemplateV2;
|
|
7
|
+
}
|
|
8
|
+
export type EditorNodeIndexV2 = Map<string, EditorNodeRefV2>;
|
|
9
|
+
export declare function getNodeRefByIdV2(schema: FormSchemaV2, nodeId: string): EditorNodeRefV2 | undefined;
|
|
10
|
+
export declare function getNodeByIdV2(schema: FormSchemaV2, nodeId: string): EditorNodeV2 | undefined;
|
|
11
|
+
export declare function getOwnerCellV2(schema: FormSchemaV2, nodeId: string): GridCellV2 | TableCellTemplateV2 | undefined;
|
|
12
|
+
/** Returns ancestors from the root Page down to the direct parent. */
|
|
13
|
+
export declare function getAncestorsV2(schema: FormSchemaV2, nodeId: string): EditorNodeV2[];
|
|
14
|
+
export declare function buildEditorNodeIndexV2(schema: FormSchemaV2): EditorNodeIndexV2;
|
|
15
|
+
//# sourceMappingURL=schema-v2-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-v2-index.d.ts","sourceRoot":"","sources":["../../src/types/schema-v2-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAIV,YAAY,EACZ,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAAC;CAC9C;AAED,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE7D,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,SAAS,CAE7B;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,YAAY,GAAG,SAAS,CAE1B;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,UAAU,GAAG,mBAAmB,GAAG,SAAS,CAE9C;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,YAAY,EAAE,CAYhB;AAqDD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,CAU9E"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { FormNodeV2, FormSchemaV2, GridCellV2, GridNodeV2, GridRowV2, GridTrackV2, EditorNodeV2, TableColumnV2, TableNodeV2, BorderModeV2, HtmlNodeV2, ImageNodeV2 } from "./schema-v2";
|
|
2
|
+
export declare function createSchemaNodeIdV2(prefix: string): string;
|
|
3
|
+
export declare function cloneNodeWithFreshIdsV2<T extends EditorNodeV2>(node: T): T;
|
|
4
|
+
type NodeUpdater = (node: EditorNodeV2) => EditorNodeV2;
|
|
5
|
+
export declare function updateSchemaNodeV2(schema: FormSchemaV2, id: string, updater: NodeUpdater): FormSchemaV2;
|
|
6
|
+
export declare function insertGridRowV2(schema: FormSchemaV2, gridId: string, row: GridRowV2, at?: number): FormSchemaV2;
|
|
7
|
+
export declare function appendTableRowsV2(schema: FormSchemaV2, tableId: string, count?: number): FormSchemaV2;
|
|
8
|
+
export declare function updateGridBorderV2(schema: FormSchemaV2, gridId: string, border: GridNodeV2["border"]): FormSchemaV2;
|
|
9
|
+
export declare function updateTableBorderV2(schema: FormSchemaV2, tableId: string, border: BorderModeV2): FormSchemaV2;
|
|
10
|
+
export declare function updateGridRowHeightV2(schema: FormSchemaV2, rowId: string, height: number): FormSchemaV2;
|
|
11
|
+
export declare function updateCellWidthV2(schema: FormSchemaV2, cellId: string, width: GridCellV2["width"]): FormSchemaV2;
|
|
12
|
+
/** 设置单元格内边距(mm,非负)。用于「单元格仅覆盖」模式。 */
|
|
13
|
+
export declare function updateCellPaddingV2(schema: FormSchemaV2, cellId: string, padding: number): FormSchemaV2;
|
|
14
|
+
/** 设置单元格水平对齐(或传 undefined 清除覆盖,回归 Grid 默认)。 */
|
|
15
|
+
export declare function updateCellAlignV2(schema: FormSchemaV2, cellId: string, align: "left" | "center" | "right" | undefined): FormSchemaV2;
|
|
16
|
+
/** 设置单元格垂直对齐(或传 undefined 清除覆盖,回归 Grid 默认)。 */
|
|
17
|
+
export declare function updateCellVerticalAlignV2(schema: FormSchemaV2, cellId: string, verticalAlign: "top" | "middle" | "bottom" | undefined): FormSchemaV2;
|
|
18
|
+
/** 设置 Grid 级单元格默认(padding / 对齐),供所有未单独覆盖的 cell 继承。 */
|
|
19
|
+
export declare function updateGridCellDefaultsV2(schema: FormSchemaV2, gridId: string, patch: Partial<Pick<GridNodeV2, "cellPadding" | "cellAlign" | "cellVerticalAlign">>): FormSchemaV2;
|
|
20
|
+
/**
|
|
21
|
+
* 单元格间距(mm)。同时作用于行间距与列间距,等价于 CSS `gap`;
|
|
22
|
+
* 传 0 / 负数 / 非数字均视为「无间距」(清除该字段)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function updateGridGapV2(schema: FormSchemaV2, gridId: string, gap: number | undefined): FormSchemaV2;
|
|
25
|
+
/**
|
|
26
|
+
* 解析 Grid 的单元格间距(mm)。渲染层与设计器共用,缺省 / 非法值返回 0
|
|
27
|
+
* (旧数据无 gap 字段时保持「单元格紧贴」的原始版式)。
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveGridGapV2(grid: GridNodeV2): number;
|
|
30
|
+
export declare function updateTableMinRowsV2(schema: FormSchemaV2, tableId: string, minRows: number): FormSchemaV2;
|
|
31
|
+
/**
|
|
32
|
+
* 新增一列:同时向 columns 追加列定义,并向 rowTemplate 追加一个对应的单元格模板
|
|
33
|
+
* (默认放入一个字段 P),保证渲染层 tableTemplate() 能按 columnKey 命中。
|
|
34
|
+
* 列 key 自动避免与现有 key 冲突。
|
|
35
|
+
*/
|
|
36
|
+
export declare function addTableColumnV2(schema: FormSchemaV2, tableId: string, column?: Partial<TableColumnV2>): FormSchemaV2;
|
|
37
|
+
/** 删除一列:同步移除 columns 定义与对应 rowTemplate。至少保留 1 列,避免退化表格。 */
|
|
38
|
+
export declare function removeTableColumnV2(schema: FormSchemaV2, tableId: string, columnKey: string): FormSchemaV2;
|
|
39
|
+
/** 重命名列 key(同步更新 columns 与 rowTemplate)。 */
|
|
40
|
+
export declare function renameTableColumnKeyV2(schema: FormSchemaV2, tableId: string, oldKey: string, newKey: string): FormSchemaV2;
|
|
41
|
+
/** 编辑列属性(标题 / 宽度 / 对齐)。 */
|
|
42
|
+
export declare function updateTableColumnV2(schema: FormSchemaV2, tableId: string, columnKey: string, patch: Partial<TableColumnV2>): FormSchemaV2;
|
|
43
|
+
/** Updates the global base row height (mm). Clamped to 1–99. */
|
|
44
|
+
export declare function updateBaseRowHeightV2(schema: FormSchemaV2, baseRowHeight: number): FormSchemaV2;
|
|
45
|
+
/** Updates the paper size (方向自 P11-3 起由纸张尺寸派生,不再单独维护 orientation). */
|
|
46
|
+
export declare function updatePaperConfigV2(schema: FormSchemaV2, paper: FormSchemaV2["paper"]): FormSchemaV2;
|
|
47
|
+
export declare function createEmptyFormSchemaV2(): FormSchemaV2;
|
|
48
|
+
export declare function createGridRowV2(cellCount?: number, height?: number): GridRowV2;
|
|
49
|
+
export declare function appendNodeToCellV2(schema: FormSchemaV2, cellId: string, child: FormNodeV2): FormSchemaV2;
|
|
50
|
+
export declare function mergeGridCellsV2(schema: FormSchemaV2, firstCellId: string, secondCellId: string): FormSchemaV2;
|
|
51
|
+
/** Splits a horizontally merged cell (colspan > 1) back into `colspan` cells.
|
|
52
|
+
* All original children are kept in the first split cell; the remaining cells
|
|
53
|
+
* are empty. Column alignment is preserved by the shared `grid.columns` track. */
|
|
54
|
+
export declare function splitGridCellV2(schema: FormSchemaV2, cellId: string): FormSchemaV2;
|
|
55
|
+
export declare function wrapCellChildrenWithGridV2(schema: FormSchemaV2, cellId: string): FormSchemaV2;
|
|
56
|
+
export declare function moveNodeV2(schema: FormSchemaV2, nodeId: string, targetCellId: string): FormSchemaV2;
|
|
57
|
+
/** 拖拽已有节点重排时写入 dataTransfer 的 MIME(与模板生成用的 DRAG_MIME 区分)。 */
|
|
58
|
+
export declare const NODE_MOVE_MIME = "application/x-ticket-node-move";
|
|
59
|
+
/**
|
|
60
|
+
* P9(拖拽重排)核心操作:把节点从当前位置拆下,插入到目标格(grid-cell / table-cell-template)
|
|
61
|
+
* 的任意下标 `atIndex`,同时覆盖「格内排序」与「跨格 / 跨 Grid 移动」两种场景。
|
|
62
|
+
*
|
|
63
|
+
* - `atIndex` 由 UI 按「可见 children + 指针命中」计算:同格时相对含该节点的当前数组,
|
|
64
|
+
* 跨格时相对目标格当前数组;函数内部对同格情形做偏移修正(拆下后下标 -1)。
|
|
65
|
+
* - 拒绝:目标非格/列模板、节点自身为非可选容器(page/row/cell/template)、目标位于节点自身或其内部。
|
|
66
|
+
* - 原位(同格且 atIndex === 原下标)或非法时返回原 schema 引用,避免产生无意义撤销记录。
|
|
67
|
+
* - `atIndex` 越界自动 clamp 到 [0, 目标格 children 长度]。
|
|
68
|
+
*/
|
|
69
|
+
export declare function moveNodeToIndexV2(schema: FormSchemaV2, nodeId: string, targetCellId: string, atIndex: number): FormSchemaV2;
|
|
70
|
+
/**
|
|
71
|
+
* P6.3b 格内排序:在同一父容器(grid-cell / table-cell-template / page)的子节点列表中
|
|
72
|
+
* 把节点上移或下移一位,用于替代「拖动调整子节点顺序」。
|
|
73
|
+
*
|
|
74
|
+
* 已在边界、或父容器不属于上述三类时原样返回 schema(不产生新对象),
|
|
75
|
+
* 便于 UI 侧据此判断按钮是否可点。
|
|
76
|
+
*/
|
|
77
|
+
export declare function moveNodeWithinParentV2(schema: FormSchemaV2, nodeId: string, direction: "up" | "down"): FormSchemaV2;
|
|
78
|
+
/**
|
|
79
|
+
* 列出可作为跨格移动目标的所有投放点(grid-cell / table-cell-template),供配置面板下拉选择。
|
|
80
|
+
*
|
|
81
|
+
* 传入 `moveNodeId` 时会过滤掉两类无意义/非法的目标:
|
|
82
|
+
* 1. **节点当前所在格** —— 移到自身格不产生位移,却会让节点被拆下再追加到同格末尾,
|
|
83
|
+
* 反复操作会在原格堆积空位(P6.3c 验收反馈);
|
|
84
|
+
* 2. **节点自身及其后代容器** —— `moveNodeV2` 本就拒绝移入自身后代,列出来只会静默失败。
|
|
85
|
+
*/
|
|
86
|
+
export declare function listDropTargetsV2(schema: FormSchemaV2, moveNodeId?: string): Array<{
|
|
87
|
+
id: string;
|
|
88
|
+
label: string;
|
|
89
|
+
}>;
|
|
90
|
+
export declare function insertRootGridV2(schema: FormSchemaV2, grid: GridNodeV2): FormSchemaV2;
|
|
91
|
+
export declare function appendGridRowV2(schema: FormSchemaV2, gridId: string, row: GridRowV2): FormSchemaV2;
|
|
92
|
+
export declare function copyGridRowV2(schema: FormSchemaV2, rowId: string, at?: number): FormSchemaV2;
|
|
93
|
+
export declare function removeGridRowV2(schema: FormSchemaV2, rowId: string): FormSchemaV2;
|
|
94
|
+
export declare function removeNodeV2(schema: FormSchemaV2, nodeId: string): FormSchemaV2;
|
|
95
|
+
export declare function moveGridRowV2(schema: FormSchemaV2, rowId: string, direction: "up" | "down"): FormSchemaV2;
|
|
96
|
+
export declare function splitGridRowV2(schema: FormSchemaV2, rowId: string, cellCount: number): FormSchemaV2;
|
|
97
|
+
export declare function resizeGridRowV2(row: GridRowV2, columnCount: number): GridRowV2;
|
|
98
|
+
export declare function resizeGridV2(schema: FormSchemaV2, gridId: string, rowCount: number, columnCount: number): FormSchemaV2;
|
|
99
|
+
/** Sets the track width for a column index across every row of a Grid.
|
|
100
|
+
* Maintains both the canonical `grid.columns` (source of truth for rendering,
|
|
101
|
+
* enables correct colspan alignment) and the legacy per-cell `cell.width`
|
|
102
|
+
* (kept in sync for backward compatibility). */
|
|
103
|
+
export declare function setGridColumnWidthV2(schema: FormSchemaV2, gridId: string, columnIndex: number, width: GridTrackV2): FormSchemaV2;
|
|
104
|
+
/** Configures a Cell's internal layout through a nested Grid. */
|
|
105
|
+
export declare function resizeGridCellLayoutV2(schema: FormSchemaV2, cellId: string, rowCount: number, columnCount: number): FormSchemaV2;
|
|
106
|
+
export declare function splitGridCellRowsV2(schema: FormSchemaV2, cellId: string, rowCount: number): FormSchemaV2;
|
|
107
|
+
export declare function createGridNodeV2(row?: GridRowV2, border?: GridNodeV2["border"]): GridNodeV2;
|
|
108
|
+
export declare function createGridNodeV2(options?: GridSizeOptionsV2): GridNodeV2;
|
|
109
|
+
export interface GridSizeOptionsV2 {
|
|
110
|
+
rows?: number;
|
|
111
|
+
columns?: number;
|
|
112
|
+
rowHeight?: number;
|
|
113
|
+
border?: GridNodeV2["border"];
|
|
114
|
+
cellWidth?: GridTrackV2;
|
|
115
|
+
}
|
|
116
|
+
/** Creates a regular grid for the editor; the persisted shape remains rows/cells/children. */
|
|
117
|
+
export declare function createGridBySizeV2(options?: GridSizeOptionsV2): GridNodeV2;
|
|
118
|
+
export declare function createTextNodeV2(text?: string): FormNodeV2;
|
|
119
|
+
export declare function createFieldPNodeV2(field?: string): FormNodeV2;
|
|
120
|
+
export declare function createTableNodeV2(): TableNodeV2;
|
|
121
|
+
export declare function createHtmlNodeV2(html?: string): HtmlNodeV2;
|
|
122
|
+
export declare function createImageNodeV2(): ImageNodeV2;
|
|
123
|
+
export {};
|
|
124
|
+
//# sourceMappingURL=schema-v2-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-v2-operations.d.ts","sourceRoot":"","sources":["../../src/types/schema-v2-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EAEX,YAAY,EAEZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACZ,MAAM,aAAa,CAAC;AAGrB,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAyDD,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,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
+
export declare class SchemaV2SerializationError extends Error {
|
|
4
|
+
readonly issues: SchemaIssueV2[];
|
|
5
|
+
constructor(message: string, issues?: SchemaIssueV2[]);
|
|
6
|
+
}
|
|
7
|
+
/** Adds defaults for optional V2 fields without changing stable IDs or user content. */
|
|
8
|
+
export declare function normalizeFormSchemaV2(input: unknown): FormSchemaV2;
|
|
9
|
+
export declare function serializeFormSchemaV2(schema: FormSchemaV2, pretty?: boolean): string;
|
|
10
|
+
export declare function parseFormSchemaV2(input: string | unknown): FormSchemaV2;
|
|
11
|
+
/**
|
|
12
|
+
* 容错解析结果:渲染端 / 消费页使用。
|
|
13
|
+
* - `schema`:能还原出 schema 则为非 null(即便含 error,也已尽力归一化);
|
|
14
|
+
* - `issues`:JSON 解析 / 结构 / 校验阶段收集的全部问题(含 error 与 warning);
|
|
15
|
+
* - `ok`:是否至少成功还原出一份 schema(JSON 非法或结构不可用则为 false)。
|
|
16
|
+
*/
|
|
17
|
+
export interface ParseResultV2 {
|
|
18
|
+
schema: FormSchemaV2 | null;
|
|
19
|
+
issues: SchemaIssueV2[];
|
|
20
|
+
ok: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 容错解析(渲染端 / 消费页使用,对照严格的 `parseFormSchemaV2`):
|
|
24
|
+
* JSON 解析失败、结构非法、或含校验 error 时**均不抛错**,而是返回 schema(能还原则非 null)
|
|
25
|
+
* 与收集到的 issues。坏节点(如未知类型,被校验标记为 `UNKNOWN_NODE_TYPE`)渲染端按未知类型跳过,
|
|
26
|
+
* 实现「局部降级」而非整张表单打不开——满足消费页容忍设计器导出小瑕疵 / 新版本模板的需求(G5)。
|
|
27
|
+
* 设计器保存 / 发布请继续使用严格的 `parseFormSchemaV2`(error 即抛)。
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseTolerantFormSchemaV2(input: string | unknown): ParseResultV2;
|
|
30
|
+
//# sourceMappingURL=schema-v2-serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-v2-serialization.d.ts","sourceRoot":"","sources":["../../src/types/schema-v2-serialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,aAAa,EAAO;CAK1D;AA4FD,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CA4ClE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,UAAQ,GAAG,MAAM,CAKlF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,CAcvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,EAAE,EAAE,OAAO,CAAC;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,CAwChF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormNodeV2 } from "./schema-v2";
|
|
2
|
+
/**
|
|
3
|
+
* 表格相关「类型层」辅助。
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ B4 解耦:表格字段派生(`buildTableRowField` / `bindTableRowCell`)、运行时行数
|
|
6
|
+
* (`resolveTableRowCount`)、字段清单枚举(`collectSchemaFields`)与单元格盒解析
|
|
7
|
+
* (`resolveCellBoxV2`)已迁至 `../engine-v2/derivation`(渲染期领域逻辑归 engine)。
|
|
8
|
+
* 本文件仅保留 schema 级的「手写 field 收集」工具。
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* 收集节点及其后代上出现过的所有 `field` 键(用于非表格字段清单)。
|
|
12
|
+
* 需下潜的容器只有 Grid(rows → cells → children)与 Table(rowTemplate → children)。
|
|
13
|
+
* 注意:table 行模板内字段 P 的 field 由列配置派生,此处收集的是 schema 中写的值,
|
|
14
|
+
* 仅用于非表格场景;推导表格实际字段请用 `buildTableRowField` + `columns`(见 engine-v2/derivation)。
|
|
15
|
+
*/
|
|
16
|
+
export declare function collectFieldKeys(node: FormNodeV2, out?: string[]): string[];
|
|
17
|
+
//# sourceMappingURL=schema-v2-table-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-v2-table-rows.d.ts","sourceRoot":"","sources":["../../src/types/schema-v2-table-rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAoB/E"}
|