@gct-paas/word 1.0.3-beta.0 → 1.0.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/browser.js +1 -1
- package/dist/chunks/QuickFillPanel-BNZwXlnL.js +336 -0
- package/dist/chunks/QuickFillPanel-BNZwXlnL.js.map +1 -0
- package/dist/chunks/{browser-OAJIVM8O.js → browser-DkEIriBA.js} +1124 -661
- package/dist/chunks/browser-DkEIriBA.js.map +1 -0
- package/dist/chunks/{sdk-BmwE5mZn.js → sdk-DaWE1Ttf.js} +242 -63
- package/dist/chunks/sdk-DaWE1Ttf.js.map +1 -0
- package/dist/chunks/{types-CMkQ6Lvg.js → types-CzOaf1gP.js} +67 -149
- package/dist/chunks/types-CzOaf1gP.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/style.css +348 -241
- package/dist/types/adapters/browser/index.d.ts +1 -0
- package/dist/types/adapters/browser/input/CanvasFieldBrackets.d.ts +10 -0
- package/dist/types/adapters/browser/input/CanvasTextInput.d.ts +5 -2
- package/dist/types/adapters/browser/input/ChoiceFieldInput.d.ts +7 -2
- package/dist/types/adapters/browser/input/FieldInputValidation.d.ts +1 -1
- package/dist/types/adapters/browser/input/InlineFieldInput.d.ts +1 -1
- package/dist/types/adapters/browser/input/business/FieldPopover.d.ts +6 -0
- package/dist/types/adapters/browser/input/business/materials/CanvasMaterialTableActions.d.ts +3 -0
- package/dist/types/adapters/browser/input/business/materials/attach-canvas-materials.d.ts +3 -1
- package/dist/types/adapters/browser/input/business/tables/CanvasBusinessTableActions.d.ts +3 -0
- package/dist/types/adapters/browser/input/business/tables/CanvasBusinessTablePanel.d.ts +4 -0
- package/dist/types/adapters/browser/input/business/tables/CanvasQuickFillDialog.d.ts +9 -8
- package/dist/types/adapters/browser/input/business/tables/attach-canvas-business-table.d.ts +4 -1
- package/dist/types/adapters/browser/input/business/tables/quick-fill-panel.d.ts +22 -0
- package/dist/types/adapters/browser/input/business/tables/table-action-anchors.d.ts +3 -3
- package/dist/types/adapters/browser/input/business/tables/table-action-pages.d.ts +26 -0
- package/dist/types/adapters/browser/input/business/tables/table-actions-renderer.d.ts +4 -0
- package/dist/types/adapters/browser/input/field-panel-geometry.d.ts +12 -0
- package/dist/types/adapters/browser/input/types.d.ts +4 -4
- package/dist/types/adapters/browser/input/validation/CanvasValidationComments.d.ts +19 -0
- package/dist/types/adapters/browser/input/validation/CanvasValidationPanel.d.ts +11 -7
- package/dist/types/adapters/browser/input/validation/validation-issue-key.d.ts +3 -0
- package/dist/types/adapters/browser/input/word-error-text.d.ts +4 -0
- package/dist/types/adapters/document/types.d.ts +2 -1
- package/dist/types/adapters/platform/field-catalog/field-business-rules.d.ts +1 -1
- package/dist/types/adapters/platform/reference-policies.d.ts +3 -1
- package/dist/types/adapters/platform/template-reference-migration.d.ts +6 -0
- package/dist/types/adapters/platform/templates.d.ts +2 -0
- package/dist/types/adapters/vue/QuickFillPanel.vue.d.ts +12 -0
- package/dist/types/adapters/vue/SignatureFieldPanel.vue.d.ts +0 -1
- package/dist/types/adapters/vue/SignatureVisual.vue.d.ts +2 -0
- package/dist/types/adapters/vue/index.d.ts +1 -0
- package/dist/types/adapters/vue/quick-fill-container.d.ts +2 -0
- package/dist/types/adapters/vue/quick-fill-data.d.ts +8 -0
- package/dist/types/adapters/vue/quick-fill-merge.d.ts +49 -0
- package/dist/types/adapters/vue/quick-fill-panel.d.ts +4 -0
- package/dist/types/layout/engine/atoms/field-control.d.ts +2 -0
- package/dist/types/layout/engine/atoms/fit-atomic.d.ts +1 -1
- package/dist/types/runtime/form/fields/core/declaration-changes.d.ts +2 -2
- package/dist/types/runtime/form/validation/NativeFieldValidation.d.ts +2 -0
- package/dist/types/runtime/form/validation/description.d.ts +8 -4
- package/dist/types/runtime/interaction/EditorController.d.ts +3 -1
- package/dist/types/runtime/interaction/browse/types.d.ts +1 -6
- package/dist/types/runtime/interaction/design/tables/regions/EditorTableRegions.d.ts +3 -1
- package/dist/types/runtime/interaction/field-text.d.ts +5 -5
- package/dist/types/runtime/interaction/validation/types.d.ts +2 -0
- package/dist/types/shared/text/word-navigation.d.ts +1 -0
- package/dist/types/shared/word-shortcuts.d.ts +28 -0
- package/dist/vue.js +858 -571
- package/dist/vue.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/browser-OAJIVM8O.js.map +0 -1
- package/dist/chunks/sdk-BmwE5mZn.js.map +0 -1
- package/dist/chunks/types-CMkQ6Lvg.js.map +0 -1
- package/dist/types/adapters/browser/input/business/tables/fixed-quick-fill-grid.d.ts +0 -19
- package/dist/types/adapters/browser/input/validation/CanvasValidationMarks.d.ts +0 -15
|
@@ -3,13 +3,13 @@ import { B as number, U as optional, V as object, Y as positive, f as repeatingT
|
|
|
3
3
|
import { a as readFactoryOptions, i as checkFactoryValue, n as commonFieldWidgets } from "./NodeFactory-DzFnWaWf.js";
|
|
4
4
|
import { uniq } from "es-toolkit/array";
|
|
5
5
|
import { isEqual, isPlainObject } from "es-toolkit/predicate";
|
|
6
|
-
import dayjs from "dayjs";
|
|
7
6
|
import { isPlainObject as isPlainObject$1 } from "es-toolkit";
|
|
8
7
|
import BigNumber from "bignumber.js";
|
|
9
8
|
import { pick } from "es-toolkit/object";
|
|
10
9
|
import sortedIndex from "es-toolkit/compat/sortedIndex";
|
|
11
10
|
import { clamp } from "es-toolkit/math";
|
|
12
11
|
import sortedIndexBy from "es-toolkit/compat/sortedIndexBy";
|
|
12
|
+
import dayjs from "dayjs";
|
|
13
13
|
// src/layout/guards.ts
|
|
14
14
|
/** 错误只保留固定说明,不携带原文、业务记录或模型快照。 */
|
|
15
15
|
var LayoutContractError = class extends Error {
|
|
@@ -569,39 +569,6 @@ function resourceUrl(value, base) {
|
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
// src/runtime/form/business/signatures/values.ts
|
|
573
|
-
/** @file 签名值解析与展示,不在打开模板时修复或覆盖历史业务数据。 */
|
|
574
|
-
/** 沿用 JSON 数组字符串协议;异常值显式报告,不把它当成空值重新保存。 */
|
|
575
|
-
function signatureValues(value) {
|
|
576
|
-
if (value === void 0 || value === null || value === "") return [];
|
|
577
|
-
const parsed = typeof value === "string" ? JSON.parse(value) : value;
|
|
578
|
-
if (!Array.isArray(parsed) || parsed.some((item) => !isPlainObject(item) || item.username !== void 0 && typeof item.username !== "string" || item.url !== void 0 && typeof item.url !== "string" || item.userId !== void 0 && typeof item.userId !== "string" || item.time !== void 0 && (typeof item.time !== "number" || !Number.isFinite(item.time)) || !item.username && !item.url)) throw new Error("签名值不是有效的签署记录数组");
|
|
579
|
-
return parsed;
|
|
580
|
-
}
|
|
581
|
-
/** 认证结果只保留持久化白名单,宿主意外带回的凭据或预览字段不会写入业务值。 */
|
|
582
|
-
function authenticatedSignature(value) {
|
|
583
|
-
if (!value || ![
|
|
584
|
-
"userId",
|
|
585
|
-
"username",
|
|
586
|
-
"historyId"
|
|
587
|
-
].every((key) => typeof value[key] === "string" && String(value[key]).trim()) || typeof value.url !== "string" || /^(?:blob:|data:)/i.test(value.url) || typeof value.time !== "number" || !Number.isFinite(value.time) || value.signatureImageDirection !== void 0 && !["horizontal", "vertical"].includes(value.signatureImageDirection)) throw new Error("签署服务没有返回完整、可保存的认证记录");
|
|
588
|
-
return Object.freeze(pick(value, [
|
|
589
|
-
"url",
|
|
590
|
-
"time",
|
|
591
|
-
"historyId",
|
|
592
|
-
"username",
|
|
593
|
-
"userId",
|
|
594
|
-
"signatureImageDirection"
|
|
595
|
-
]));
|
|
596
|
-
}
|
|
597
|
-
/** 纯文字摘要用于只读和异常展示,不把 JSON 原文绘制到画布。 */
|
|
598
|
-
function signatureText(value) {
|
|
599
|
-
try {
|
|
600
|
-
return signatureValues(value).map((item) => item.username || "签名").join("、");
|
|
601
|
-
} catch {
|
|
602
|
-
return "签名值格式异常";
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
572
|
// src/runtime/form/business/references/lot-values.ts
|
|
606
573
|
/** @file 批次业务值保存名称,实际选择身份使用独立 ID,不能按普通关联值解释。 */
|
|
607
574
|
/** 这些专用批次业务保存真实名称,选择身份使用独立 ID。 */
|
|
@@ -913,101 +880,6 @@ function sameTextSource(left, right) {
|
|
|
913
880
|
if (left.kind !== right.kind || textSourceId(left) !== textSourceId(right)) return false;
|
|
914
881
|
return left.kind === "modelText" || right.kind !== "modelText" && left.displayKey === right.displayKey;
|
|
915
882
|
}
|
|
916
|
-
// src/shared/signature-graphic.ts
|
|
917
|
-
/** 与旧版 68b981c 的姓名字号、两行拆分、8px 留白和日期栏保持一致。 */
|
|
918
|
-
function signatureGraphic(name, date, appearance, measure) {
|
|
919
|
-
const fontSize = Array.from(name).length >= 6 ? 16 : 26;
|
|
920
|
-
const height = appearance.vertical ? appearance.width ?? 120 : appearance.height ?? 68;
|
|
921
|
-
const texts = [];
|
|
922
|
-
const add = (text, x, y, size, weight, max = Infinity) => {
|
|
923
|
-
const naturalWidth = measure(text, size, weight);
|
|
924
|
-
texts.push({
|
|
925
|
-
text,
|
|
926
|
-
x,
|
|
927
|
-
y,
|
|
928
|
-
fontSize: size,
|
|
929
|
-
fontWeight: weight,
|
|
930
|
-
naturalWidth,
|
|
931
|
-
width: Math.min(max, naturalWidth)
|
|
932
|
-
});
|
|
933
|
-
};
|
|
934
|
-
if (appearance.vertical) {
|
|
935
|
-
const width = appearance.height ?? 68;
|
|
936
|
-
const characters = Array.from(name), rowHeight = fontSize * 1.15;
|
|
937
|
-
const rows = Math.max(1, Math.floor(height * .84 / rowHeight));
|
|
938
|
-
const columns = Math.max(1, Math.ceil(characters.length / rows));
|
|
939
|
-
const columnWidth = Math.min(fontSize * 1.15, width * .8 / columns);
|
|
940
|
-
const left = (width - columns * columnWidth) / 2;
|
|
941
|
-
for (let column = 0; column < columns; column++) {
|
|
942
|
-
const charactersInColumn = characters.slice(column * rows, (column + 1) * rows);
|
|
943
|
-
const top = (height - charactersInColumn.length * rowHeight) / 2;
|
|
944
|
-
for (const [row, character] of charactersInColumn.entries()) {
|
|
945
|
-
const actualWidth = Math.min(columnWidth, measure(character, fontSize, 600));
|
|
946
|
-
add(character, left + (columns - column - .5) * columnWidth - actualWidth / 2, top + (row + .5) * rowHeight, fontSize, 600, columnWidth);
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return {
|
|
950
|
-
width,
|
|
951
|
-
height,
|
|
952
|
-
texts
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
const nameWidth = (text) => measure(text, fontSize, 600);
|
|
956
|
-
const ellipsis = (text, max, size, weight) => {
|
|
957
|
-
if (measure(text, size, weight) <= max) return text;
|
|
958
|
-
let result = "";
|
|
959
|
-
for (const character of Array.from(text)) {
|
|
960
|
-
if (measure(result + character + "…", size, weight) > max) break;
|
|
961
|
-
result += character;
|
|
962
|
-
}
|
|
963
|
-
return result + "…";
|
|
964
|
-
};
|
|
965
|
-
let lines, metaLines = [];
|
|
966
|
-
if (appearance.fallback === "name-and-date") {
|
|
967
|
-
const max = fontSize === 16 ? Math.min(nameWidth(name), 120) : nameWidth(name);
|
|
968
|
-
const remaining = Array.from(name);
|
|
969
|
-
lines = [];
|
|
970
|
-
for (let index = 0; index < 2 && remaining.length; index++) {
|
|
971
|
-
let line = "";
|
|
972
|
-
while (remaining.length && nameWidth(line + remaining[0]) <= max) line += remaining.shift();
|
|
973
|
-
if (!line) line = remaining.shift();
|
|
974
|
-
if (index === 1 && remaining.length) line = ellipsis(line + remaining.join(""), max, fontSize, 600);
|
|
975
|
-
lines.push(line);
|
|
976
|
-
}
|
|
977
|
-
metaLines = [`电子签名:${name}`, ...date ? [`日期:${date}`] : []];
|
|
978
|
-
} else {
|
|
979
|
-
const characters = Array.from(name);
|
|
980
|
-
let split = Math.ceil(characters.length / 2);
|
|
981
|
-
while (split > 1 && nameWidth(characters.slice(0, split).join("")) > 344) split--;
|
|
982
|
-
lines = characters.length < 6 ? [name] : [characters.slice(0, split).join(""), ellipsis(characters.slice(split).join(""), 344, fontSize, 600)];
|
|
983
|
-
}
|
|
984
|
-
const nameMax = Math.max(0, ...lines.map(nameWidth));
|
|
985
|
-
const metaNatural = Math.max(0, ...metaLines.map((line) => measure(line, 12, 400)));
|
|
986
|
-
const metaMax = Math.min(360, Math.ceil(16 + nameMax + 8 + metaNatural)) - 16 - nameMax - 8;
|
|
987
|
-
metaLines = metaLines.map((line) => ellipsis(line, metaMax, 12, 400));
|
|
988
|
-
const metaWidth = Math.max(0, ...metaLines.map((line) => measure(line, 12, 400)));
|
|
989
|
-
const width = Math.min(360, Math.ceil(16 + nameMax + (metaLines.length ? 8 + metaWidth : 0)));
|
|
990
|
-
const nameLineHeight = fontSize * 1.2;
|
|
991
|
-
lines.forEach((line, index) => add(line, 8, (height - lines.length * nameLineHeight) / 2 + (index + .5) * nameLineHeight, fontSize, 600));
|
|
992
|
-
metaLines.forEach((line, index) => add(line, 8 + nameMax + 8, (height - metaLines.length * 16.2) / 2 + (index + .5) * 16.2, 12, 400));
|
|
993
|
-
return {
|
|
994
|
-
width,
|
|
995
|
-
height,
|
|
996
|
-
texts
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
/** 被动 SVG 来源可供预览和第三方消费者使用;正式画布直接绘制同一份几何。 */
|
|
1000
|
-
function signatureGraphicUrl(graphic) {
|
|
1001
|
-
const escape = (value) => value.replace(/[&<>"']/g, (character) => ({
|
|
1002
|
-
"&": "&",
|
|
1003
|
-
"<": "<",
|
|
1004
|
-
">": ">",
|
|
1005
|
-
"\"": """,
|
|
1006
|
-
"'": "'"
|
|
1007
|
-
})[character]);
|
|
1008
|
-
const texts = graphic.texts.map((text) => `<text x="${text.x}" y="${text.y}" font-size="${text.fontSize}" font-weight="${text.fontWeight}"${text.width < text.naturalWidth ? ` textLength="${text.width}" lengthAdjust="spacingAndGlyphs"` : ""}>${escape(text.text)}</text>`).join("");
|
|
1009
|
-
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${graphic.width}" height="${graphic.height}" viewBox="0 0 ${graphic.width} ${graphic.height}"><rect width="100%" height="100%" fill="white"/><g fill="black" font-family="Arial, sans-serif" dominant-baseline="central">${texts}</g></svg>`)}`;
|
|
1010
|
-
}
|
|
1011
883
|
// src/layout/geometry/text.ts
|
|
1012
884
|
/** @file 精确文字映射与页面内几何,支持单向 LTR/RTL 片段。 */
|
|
1013
885
|
/** 求点到占位矩形的平方距离;矩形内部及边界为零。 */
|
|
@@ -1095,12 +967,30 @@ function sourceBoundaryIndex(fragment, offset) {
|
|
|
1095
967
|
const index = sortedIndex(fragment.caretMap.offsets, offset);
|
|
1096
968
|
return fragment.caretMap.offsets[index] === offset ? index : void 0;
|
|
1097
969
|
}
|
|
970
|
+
// src/shared/text/word-navigation.ts
|
|
971
|
+
/** @file 正文与原位字段共用的按词偏移,不读取文档、浏览器或改写文字。 */
|
|
972
|
+
var words = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
973
|
+
function wordNavigationOffset(text, offset, direction) {
|
|
974
|
+
if (!text.length || direction === -1 && offset <= 0) return 0;
|
|
975
|
+
if (direction === 1 && offset >= text.length) return text.length;
|
|
976
|
+
const segments = words.segment(text);
|
|
977
|
+
let segment = segments.containing(direction === 1 ? offset : offset - 1);
|
|
978
|
+
if (direction === -1) {
|
|
979
|
+
while (/^\s+$/.test(segment.segment) && segment.index > 0) segment = segments.containing(segment.index - 1);
|
|
980
|
+
return segment.index;
|
|
981
|
+
}
|
|
982
|
+
let next = segment.index + segment.segment.length;
|
|
983
|
+
while (next < text.length) {
|
|
984
|
+
segment = segments.containing(next);
|
|
985
|
+
if (!/^\s+$/.test(segment.segment)) break;
|
|
986
|
+
next = segment.index + segment.segment.length;
|
|
987
|
+
}
|
|
988
|
+
return next;
|
|
989
|
+
}
|
|
1098
990
|
// src/runtime/interaction/text/TextFlow.ts
|
|
1099
991
|
/** @file 逻辑文字流:按当前 model 解释位置与选区,不保存分页路径或逐字对象。 */
|
|
1100
992
|
/** 字素分割算法可共享,不保存任何文档或分割结果。 */
|
|
1101
993
|
var segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1102
|
-
/** 词边界只在按词导航/删除时读取,不创建持久的单词节点。 */
|
|
1103
|
-
var words = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
1104
994
|
/** 无法将当前位置解释成普通文档文字时的明确交互错误。 */
|
|
1105
995
|
var TextFlowError = class extends Error {
|
|
1106
996
|
/** 稳定错误代码,方便宿主区分交互边界与内部故障。 */
|
|
@@ -1402,19 +1292,7 @@ var TextFlow = class {
|
|
|
1402
1292
|
units += node.kind === "text" ? node.text.length : 1;
|
|
1403
1293
|
}
|
|
1404
1294
|
if (direction === -1 && units === 0 || direction === 1 && units === text.length) return this.step(endpoint, direction);
|
|
1405
|
-
|
|
1406
|
-
let segment = segments.containing(direction === 1 ? units : units - 1);
|
|
1407
|
-
if (direction === -1) {
|
|
1408
|
-
while (/^\s+$/.test(segment.segment) && segment.index > 0) segment = segments.containing(segment.index - 1);
|
|
1409
|
-
units = segment.index;
|
|
1410
|
-
} else {
|
|
1411
|
-
units = segment.index + segment.segment.length;
|
|
1412
|
-
while (units < text.length) {
|
|
1413
|
-
segment = segments.containing(units);
|
|
1414
|
-
if (!/^\s+$/.test(segment.segment)) break;
|
|
1415
|
-
units = segment.index + segment.segment.length;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1295
|
+
units = wordNavigationOffset(text, units, direction);
|
|
1418
1296
|
for (const [index, node] of at.paragraph.content.entries()) {
|
|
1419
1297
|
const length = node.kind === "text" ? node.text.length : 1;
|
|
1420
1298
|
if (units <= length) return this.endpoint({
|
|
@@ -2925,6 +2803,39 @@ function toggledFieldOptionIds(expected, id) {
|
|
|
2925
2803
|
if (!option?.visible) throw new TextFlowError("当前选项不可选");
|
|
2926
2804
|
return expected.multiple ? expected.options.filter((item) => item.id === id ? !item.selected : item.selected).map((item) => item.id) : option.selected ? [] : [id];
|
|
2927
2805
|
}
|
|
2806
|
+
// src/runtime/form/business/signatures/values.ts
|
|
2807
|
+
/** @file 签名值解析与展示,不在打开模板时修复或覆盖历史业务数据。 */
|
|
2808
|
+
/** 沿用 JSON 数组字符串协议;异常值显式报告,不把它当成空值重新保存。 */
|
|
2809
|
+
function signatureValues(value) {
|
|
2810
|
+
if (value === void 0 || value === null || value === "") return [];
|
|
2811
|
+
const parsed = typeof value === "string" ? JSON.parse(value) : value;
|
|
2812
|
+
if (!Array.isArray(parsed) || parsed.some((item) => !isPlainObject(item) || item.username !== void 0 && typeof item.username !== "string" || item.url !== void 0 && typeof item.url !== "string" || item.userId !== void 0 && typeof item.userId !== "string" || item.time !== void 0 && (typeof item.time !== "number" || !Number.isFinite(item.time)) || !item.username && !item.url)) throw new Error("签名值不是有效的签署记录数组");
|
|
2813
|
+
return parsed;
|
|
2814
|
+
}
|
|
2815
|
+
/** 认证结果只保留持久化白名单,宿主意外带回的凭据或预览字段不会写入业务值。 */
|
|
2816
|
+
function authenticatedSignature(value) {
|
|
2817
|
+
if (!value || ![
|
|
2818
|
+
"userId",
|
|
2819
|
+
"username",
|
|
2820
|
+
"historyId"
|
|
2821
|
+
].every((key) => typeof value[key] === "string" && String(value[key]).trim()) || typeof value.url !== "string" || /^(?:blob:|data:)/i.test(value.url) || typeof value.time !== "number" || !Number.isFinite(value.time) || value.signatureImageDirection !== void 0 && !["horizontal", "vertical"].includes(value.signatureImageDirection)) throw new Error("签署服务没有返回完整、可保存的认证记录");
|
|
2822
|
+
return Object.freeze(pick(value, [
|
|
2823
|
+
"url",
|
|
2824
|
+
"time",
|
|
2825
|
+
"historyId",
|
|
2826
|
+
"username",
|
|
2827
|
+
"userId",
|
|
2828
|
+
"signatureImageDirection"
|
|
2829
|
+
]));
|
|
2830
|
+
}
|
|
2831
|
+
/** 纯文字摘要用于只读和异常展示,不把 JSON 原文绘制到画布。 */
|
|
2832
|
+
function signatureText(value) {
|
|
2833
|
+
try {
|
|
2834
|
+
return signatureValues(value).map((item) => item.username || "签名").join("、");
|
|
2835
|
+
} catch {
|
|
2836
|
+
return "签名值格式异常";
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2928
2839
|
// src/runtime/interaction/field-signature.ts
|
|
2929
2840
|
/** @file 签名交互只投影当前记录并复核目标;认证、互斥和回填由原签名服务负责。 */
|
|
2930
2841
|
/** 从稳定发生解析当前签名,不加载素材、不认证、不改变原值或排版。 */
|
|
@@ -3079,7 +2990,9 @@ function fieldValidationDescription(declaration, path, modelName) {
|
|
|
3079
2990
|
const location = name ? `${model} · ${name}` : model;
|
|
3080
2991
|
return {
|
|
3081
2992
|
label,
|
|
3082
|
-
context: rows.length ? `${location} · 第 ${rows.join(" / ")} 项` : location
|
|
2993
|
+
context: rows.length ? `${location} · 第 ${rows.join(" / ")} 项` : location,
|
|
2994
|
+
modelName: modelName?.trim() || source.modelLink,
|
|
2995
|
+
modelKind: source.isLinkedModelField ? "linked" : source.subFieldKey ? "sub" : "main"
|
|
3083
2996
|
};
|
|
3084
2997
|
}
|
|
3085
2998
|
// src/runtime/interaction/field-text.ts
|
|
@@ -3099,6 +3012,7 @@ function readFieldTextInput(handle, options, selection) {
|
|
|
3099
3012
|
if (behavior.widget === "number" && typeof value === "number") try {
|
|
3100
3013
|
text = fieldNumberEditText(value, fieldNumberSettings(behavior.valueType ?? target.declaration.binding.source.fieldType, behavior.config));
|
|
3101
3014
|
} catch {}
|
|
3015
|
+
const validationMessages = target.valuePath ? options.form.services.fieldValidation.messages(selection.fieldId, target.valuePath) : void 0;
|
|
3102
3016
|
return Object.freeze({
|
|
3103
3017
|
selection,
|
|
3104
3018
|
modelRevision: handle.getModelRevision(),
|
|
@@ -3112,7 +3026,8 @@ function readFieldTextInput(handle, options, selection) {
|
|
|
3112
3026
|
...target.valuePath ? {
|
|
3113
3027
|
validationPath: target.valuePath,
|
|
3114
3028
|
validationDescription: fieldValidationDescription(target.declaration, target.valuePath, options.validationModelName?.(target.declaration.binding)),
|
|
3115
|
-
validationMessage:
|
|
3029
|
+
validationMessage: validationMessages?.join(";") || void 0,
|
|
3030
|
+
validationMessages
|
|
3116
3031
|
} : {}
|
|
3117
3032
|
});
|
|
3118
3033
|
}
|
|
@@ -3151,12 +3066,15 @@ async function validateFieldTextDraft(handle, options, selection, expected, text
|
|
|
3151
3066
|
}
|
|
3152
3067
|
});
|
|
3153
3068
|
if (!current()) return;
|
|
3154
|
-
if (result.status !== "stale")
|
|
3069
|
+
if (result.status !== "stale") {
|
|
3070
|
+
const messages = result.issues.map((issue) => issue.message);
|
|
3071
|
+
return messages.length ? messages : void 0;
|
|
3072
|
+
}
|
|
3155
3073
|
}
|
|
3156
3074
|
}
|
|
3157
3075
|
// src/runtime/form/business/tables/types.ts
|
|
3158
3076
|
/** 一次明确操作的数量上限,批量复制和插行使用同一门禁。 */
|
|
3159
3077
|
var nativeTableRowBatchLimit = 1e3;
|
|
3160
|
-
export {
|
|
3078
|
+
export { TextFlow as $, isFieldTextInput as $t, snapshotPageWidgetDragDefinition as A, parseTsv as An, referenceOptions as At, designRegionTypes as B, assertLayoutTextMeasurement as Bn, nativeSelectedReferenceValue as Bt, toggledFieldOptionIds as C, isEmptyDataValue as Cn, isSealPosition as Ct, designFieldDefaults as D, readDataValueInput as Dn, referenceBehavior as Dt, snapshotSealDefinition as E, isUninitializedDataValue as En, recordReference as Et, assertAdaptiveImageCellWritable as F, layoutImageSourceKey as Fn, nativeObjectKey as Ft, resolveBooleanOptionLabel as G, resourceLimits as Gt, choiceSelection as H, normalizeResourceValue as Ht, hasAdaptiveImageCell as I, LayoutContractError as In, nativeObjectRootField as It, sameBusinessField as J, resourceValues as Jt, systemDate as K, resourceName as Kt, assertOwnedEditingAllowed as L, assertFiniteLayoutNumber as Ln, isMaterialLotBinding as Lt, mapSelection as M, sameLayoutIdentity as Mn, isReferenceScanField as Mt, selectionFallbacks as N, sameLayoutVersion as Nn, referenceScanPaths as Nt, resolveFieldDrop as O, wordClipboardType as On, referenceContext as Ot, adaptiveImageCellMessage as P, snapshotLayoutVersion as Pn, referenceScanUpdates as Pt, writeFieldValue as Q, isCommonField as Qt, editingAllowed as R, assertLayoutSize as Rn, isNamedLotBinding as Rt, sameFieldOptionInput as S, isClosedDataContainer as Sn, sealStampKeys as St, EditorObjects as T, isRequiredDataValueMissing as Tn, normalizeReferenceValue as Tt, fieldBehaviorDefault as U, resourceBehavior as Ut, designRegionVariants as V, referenceInputIdentity as Vt, fieldBehaviorLabel as W, resourceContext as Wt, readFieldTarget as X, commonFieldDeclaration as Xt, afterFieldSettlement as Y, validateResourceFiles as Yt, resolveFieldTarget as Z, fieldBehavior as Zt, signatureText as _, dataValueIssuesFromError as _n, millimetersToLayoutPx as _t, writeGuardedFieldText as a, normalizeDataBoolean as an, sourceBoundaryIndex as at, readFieldOptionInput as b, classifyDataValue as bn, nativeSealText as bt, fieldNumberSettings as c, encodeDataCollection as cn, sameDomain as ct, isIncompleteFieldNumber as d, resolveDataDefaultFrom as dn, textSourceId as dt, nativeFieldBehavior as en, TextFlowError as et, validateFieldNumber as f, resolveDataDisplay as fn, LAYOUT_MILLIMETERS_PER_INCH as ft, authenticatedSignature as g, assertValidDataValue as gn, layoutPxToPoints as gt, sameFieldSignatureInput as h, DataValueError as hn, layoutPxToMillimeters as ht, validateFieldTextDraft as i, encodeDataFieldValue as in, rectDistance as it, freezeSelection as j, tsvClipboardLimits as jn, referenceValueIds as jt, snapshotFieldDragDefinition as k, formatTsv as kn, referenceIds as kt, fieldNumberText as l, emptyDataValue as ln, samePosition as lt, readFieldSignatureInput as m, shouldInitializeDataValue as mn, LAYOUT_POINTS_PER_INCH as mt, readFieldTextInput as n, dataParameterNumberKind as nn, hitPosition as nt, fieldValidationDescription as o, normalizeDataParameterNumber as on, visualAffinity as ot, assertFieldSignatureInput as p, resolveDataValueUpdate as pn, LAYOUT_PIXELS_PER_INCH as pt, readBusinessField as q, resourceUrl as qt, sameFieldTextInput as r, encodeDataChoice as rn, positionX as rt, FieldNumberError as s, readDataBoolean as sn, positionSourceId as st, nativeTableRowBatchLimit as t, assertDataNumberPrecision as tn, wordNavigationOffset as tt, fieldNumberValue as u, resolveDataDefault as un, sameTextSource as ut, signatureValues as v, findInvalidDataNumbers as vn, pointsToLayoutPx as vt, writeGuardedFieldChoice as w, isInvalidDataNumber as wn, parseSealValue as wt, sameFieldChoiceInput as x, dataValueState as xn, nativeSealValueKind as xt, readFieldChoiceInput as y, invalidDataNumberText as yn, authenticatedSeal as yt, designRegionLabel as z, assertLayoutTextMeasureRequest as zn, lotReference as zt };
|
|
3161
3079
|
|
|
3162
|
-
//# sourceMappingURL=types-
|
|
3080
|
+
//# sourceMappingURL=types-CzOaf1gP.js.map
|