@shwfed/config 2.12.14 → 2.12.16
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/dist/module.json +1 -1
- package/dist/runtime/components/actions/components/group.vue +1 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
- package/dist/runtime/components/config/use-editor.js +16 -0
- package/dist/runtime/components/config/utils/linkage.d.ts +29 -0
- package/dist/runtime/components/config/utils/linkage.js +57 -0
- package/dist/runtime/components/config/utils/validation-error.d.ts +1 -0
- package/dist/runtime/components/config/utils/validation-error.js +1 -1
- package/dist/runtime/components/form/FormUnitRenderer.vue +6 -1
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
- package/dist/runtime/components/sidebar/use-editor.js +13 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/config.vue +10 -4
- package/dist/runtime/components/table/index.vue +6 -1
- package/dist/runtime/components/table/schema.d.ts +68 -68
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +21 -3
- package/dist/runtime/components/ui/expression-editor/index.d.ts +1 -0
- package/dist/runtime/components/ui/expression-editor/index.js +5 -0
- package/dist/runtime/components/ui/expression-editor/validity.d.ts +12 -0
- package/dist/runtime/components/ui/expression-editor/validity.js +27 -0
- package/dist/runtime/share/layout.js +2 -2
- package/dist/runtime/share/slot-renderer.vue +6 -1
- package/dist/runtime/share/viewport.d.ts +16 -0
- package/dist/runtime/share/viewport.js +11 -0
- package/dist/runtime/utils/cel-context.d.ts +15 -0
- package/dist/runtime/utils/cel-context.js +18 -1
- package/dist/runtime/utils/cel.js +6 -1
- package/dist/runtime/vendor/cel-js/CLAUDE.md +1 -1
- package/dist/runtime/vendor/cel-js/PROMPT.md +15 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +28 -0
- package/package.json +1 -1
|
@@ -47,40 +47,6 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
|
|
|
47
47
|
readonly message: string;
|
|
48
48
|
}[]] | undefined;
|
|
49
49
|
}[];
|
|
50
|
-
readonly query?: {
|
|
51
|
-
readonly style?: string | undefined;
|
|
52
|
-
readonly id?: string | undefined;
|
|
53
|
-
readonly initial?: {
|
|
54
|
-
readonly data: string;
|
|
55
|
-
readonly request?: string | undefined;
|
|
56
|
-
} | undefined;
|
|
57
|
-
readonly displayName?: string | undefined;
|
|
58
|
-
readonly kind: "shwfed.component.form";
|
|
59
|
-
readonly fields: readonly any[];
|
|
60
|
-
readonly layouts: readonly {
|
|
61
|
-
readonly name: string;
|
|
62
|
-
readonly layout: {
|
|
63
|
-
readonly style?: string | undefined;
|
|
64
|
-
readonly columns: number;
|
|
65
|
-
readonly gap?: number | undefined;
|
|
66
|
-
readonly rows?: number | undefined;
|
|
67
|
-
readonly placements: {
|
|
68
|
-
readonly [x: string]: {
|
|
69
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
70
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
71
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
readonly media?: string | undefined;
|
|
76
|
-
}[];
|
|
77
|
-
readonly readonly?: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
readonly dataSource?: {
|
|
80
|
-
readonly data: string;
|
|
81
|
-
readonly total?: string | undefined;
|
|
82
|
-
readonly request?: string | undefined;
|
|
83
|
-
} | undefined;
|
|
84
50
|
readonly actions?: {
|
|
85
51
|
readonly size: "default" | "sm" | "xs";
|
|
86
52
|
readonly style?: string | undefined;
|
|
@@ -148,6 +114,40 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
|
|
|
148
114
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
149
115
|
}[];
|
|
150
116
|
} | undefined;
|
|
117
|
+
readonly query?: {
|
|
118
|
+
readonly style?: string | undefined;
|
|
119
|
+
readonly id?: string | undefined;
|
|
120
|
+
readonly initial?: {
|
|
121
|
+
readonly data: string;
|
|
122
|
+
readonly request?: string | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
readonly displayName?: string | undefined;
|
|
125
|
+
readonly kind: "shwfed.component.form";
|
|
126
|
+
readonly fields: readonly any[];
|
|
127
|
+
readonly layouts: readonly {
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly layout: {
|
|
130
|
+
readonly style?: string | undefined;
|
|
131
|
+
readonly columns: number;
|
|
132
|
+
readonly gap?: number | undefined;
|
|
133
|
+
readonly rows?: number | undefined;
|
|
134
|
+
readonly placements: {
|
|
135
|
+
readonly [x: string]: {
|
|
136
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
137
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
138
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
readonly media?: string | undefined;
|
|
143
|
+
}[];
|
|
144
|
+
readonly readonly?: string | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
readonly dataSource?: {
|
|
147
|
+
readonly data: string;
|
|
148
|
+
readonly total?: string | undefined;
|
|
149
|
+
readonly request?: string | undefined;
|
|
150
|
+
} | undefined;
|
|
151
151
|
readonly bottomActions?: {
|
|
152
152
|
readonly size: "default" | "sm" | "xs";
|
|
153
153
|
readonly style?: string | undefined;
|
|
@@ -6,6 +6,8 @@ import { readClip, reidFragment, writeClip } from "../../share/clipboard.js";
|
|
|
6
6
|
import { PageConfig } from "./schema.js";
|
|
7
7
|
import { BLOCKS, findBlock } from "./utils/resolve.js";
|
|
8
8
|
import { formatValidationError } from "./utils/validation-error.js";
|
|
9
|
+
import { findDanglingLinkages, formatDanglingLinkages } from "./utils/linkage.js";
|
|
10
|
+
import { createExpressionValidityRegistry, provideExpressionValidity } from "../ui/expression-editor/index.js";
|
|
9
11
|
function deepClone(value) {
|
|
10
12
|
return JSON.parse(JSON.stringify(value));
|
|
11
13
|
}
|
|
@@ -373,10 +375,24 @@ export function useConfigEditor(model, options = {}) {
|
|
|
373
375
|
pushBlock(blockId);
|
|
374
376
|
}
|
|
375
377
|
const validationError = ref(null);
|
|
378
|
+
const validityRegistry = createExpressionValidityRegistry();
|
|
379
|
+
provideExpressionValidity(validityRegistry);
|
|
376
380
|
function confirm() {
|
|
377
381
|
const schema = PageConfig(configure);
|
|
378
382
|
try {
|
|
379
383
|
const decoded = Schema.decodeUnknownSync(schema)(draft.value);
|
|
384
|
+
if (!validityRegistry.allValid()) {
|
|
385
|
+
validationError.value = "\u5B58\u5728\u65E0\u6548\u7684\u8DE8\u5C42\u4F5C\u7528\u57DF\u5F15\u7528\uFF0C\u8BF7\u4FEE\u6B63\u6807\u7EA2\u7684\u8868\u8FBE\u5F0F\u540E\u518D\u4FDD\u5B58";
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
const dangling = findDanglingLinkages(decoded);
|
|
389
|
+
if (dangling.length > 0) {
|
|
390
|
+
validationError.value = formatDanglingLinkages(dangling, decoded, (i) => {
|
|
391
|
+
const b = topSlotEditor.blocks.value[i];
|
|
392
|
+
return b ? topSlotEditor.getBlockLabel(b) : void 0;
|
|
393
|
+
});
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
380
396
|
validationError.value = null;
|
|
381
397
|
model.value = decoded;
|
|
382
398
|
baseline.value = deepClone(decoded);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type LinkageKind = 'operation' | 'step' | 'scope';
|
|
2
|
+
export type DanglingLinkage = Readonly<{
|
|
3
|
+
kind: LinkageKind;
|
|
4
|
+
/** The referenced uuid that is not defined anywhere in the tree. */
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Property path from the config root to the offending reference
|
|
8
|
+
* (`['slot','blocks',0,'actions','buttons',1,'params','rows',2,'value']`).
|
|
9
|
+
* Fed to `describePath` for the breadcrumb — the same one the schema decoder
|
|
10
|
+
* renders — so the message pins the exact field, not just the top block.
|
|
11
|
+
*/
|
|
12
|
+
path: ReadonlyArray<PropertyKey>;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Find every linkage in `config` whose target uuid is not defined anywhere in
|
|
16
|
+
* the tree. `PAGE_TARGET_ID` (the singleton page target sentinel) is always
|
|
17
|
+
* valid — it names the outermost page, which carries no stored id. Each result
|
|
18
|
+
* carries the property path from the config root to the offending reference, so
|
|
19
|
+
* the caller can render a field-level breadcrumb (see `describePath`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function findDanglingLinkages(config: unknown): DanglingLinkage[];
|
|
22
|
+
/**
|
|
23
|
+
* One-line save-footer message for a non-empty dangling list. Renders the
|
|
24
|
+
* breadcrumb to the first offending reference (`「表单 › 确定 › value」`) via the
|
|
25
|
+
* shared `describePath`, tagged with its kind, with a trailing count when more
|
|
26
|
+
* remain. `rootData` is the decoded config the paths index into; `blockLabelAt`
|
|
27
|
+
* gives the nicest label for a top-level block (the host's `getBlockLabel`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatDanglingLinkages(dangling: ReadonlyArray<DanglingLinkage>, rootData: unknown, blockLabelAt: (index: number) => string | undefined): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PAGE_TARGET_ID } from "../../../share/page-target.js";
|
|
2
|
+
import { scanScopeRefs } from "../../ui/expression-editor/scope-refs.js";
|
|
3
|
+
import { scanStepRefs } from "../../ui/expression-editor/step-refs.js";
|
|
4
|
+
import { describePath } from "./validation-error.js";
|
|
5
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
6
|
+
function isObject(v) {
|
|
7
|
+
return v !== null && typeof v === "object" && !Array.isArray(v);
|
|
8
|
+
}
|
|
9
|
+
function collectDefinedIds(node, into) {
|
|
10
|
+
if (Array.isArray(node)) {
|
|
11
|
+
for (const v of node) collectDefinedIds(v, into);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!isObject(node)) return;
|
|
15
|
+
for (const [k, v] of Object.entries(node)) {
|
|
16
|
+
if (k === "id" && typeof v === "string" && UUID_RE.test(v)) into.add(v);
|
|
17
|
+
collectDefinedIds(v, into);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function collectRefs(node, path, into) {
|
|
21
|
+
if (Array.isArray(node)) {
|
|
22
|
+
node.forEach((v, i) => collectRefs(v, [...path, i], into));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!isObject(node)) {
|
|
26
|
+
if (typeof node === "string") {
|
|
27
|
+
for (const r of scanStepRefs(node)) into.push({ kind: "step", id: r.id, path });
|
|
28
|
+
for (const r of scanScopeRefs(node)) into.push({ kind: "scope", id: r.id, path });
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (typeof node.target === "string" && typeof node.operation === "string" && UUID_RE.test(node.target)) {
|
|
33
|
+
into.push({ kind: "operation", id: node.target, path: [...path, "target"] });
|
|
34
|
+
}
|
|
35
|
+
for (const [k, v] of Object.entries(node)) collectRefs(v, [...path, k], into);
|
|
36
|
+
}
|
|
37
|
+
export function findDanglingLinkages(config) {
|
|
38
|
+
const defined = /* @__PURE__ */ new Set();
|
|
39
|
+
collectDefinedIds(config, defined);
|
|
40
|
+
const refs = [];
|
|
41
|
+
collectRefs(config, [], refs);
|
|
42
|
+
return refs.filter((r) => r.id !== PAGE_TARGET_ID && !defined.has(r.id));
|
|
43
|
+
}
|
|
44
|
+
const KIND_LABEL = {
|
|
45
|
+
operation: "\u89E6\u53D1\u64CD\u4F5C",
|
|
46
|
+
step: "\u6B65\u9AA4\u5F15\u7528",
|
|
47
|
+
scope: "\u8DE8\u5C42\u4F5C\u7528\u57DF\u5F15\u7528"
|
|
48
|
+
};
|
|
49
|
+
export function formatDanglingLinkages(dangling, rootData, blockLabelAt) {
|
|
50
|
+
const first = dangling[0];
|
|
51
|
+
if (!first) return "";
|
|
52
|
+
const kind = KIND_LABEL[first.kind];
|
|
53
|
+
const segs = describePath(first.path, rootData, blockLabelAt);
|
|
54
|
+
const where = segs.length > 0 ? `\u300C${segs.join(" \u203A ")}\u300D\u7684${kind}` : kind;
|
|
55
|
+
const suffix = dangling.length > 1 ? `\uFF08\u8FD8\u6709 ${dangling.length - 1} \u4E2A\uFF09` : "";
|
|
56
|
+
return `${where}\u5F15\u7528\u4E86\u5DF2\u5931\u6548\u7684\u8D44\u6E90\uFF08\u6765\u6E90\u4E0D\u5B58\u5728\u4E8E\u5F53\u524D\u914D\u7F6E\u4E2D\uFF09\uFF0C\u8BF7\u4FEE\u6B63\u540E\u518D\u4FDD\u5B58${suffix}`;
|
|
57
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
export declare function describePath(path: ReadonlyArray<PropertyKey>, rootData: unknown, blockLabelAt: (index: number) => string | undefined): string[];
|
|
1
2
|
export declare function formatValidationError(err: unknown, blockLabelAt: (index: number) => string | undefined, rootData?: unknown): string;
|
|
@@ -19,7 +19,7 @@ function nodeLabel(node) {
|
|
|
19
19
|
if (!isObject(node)) return void 0;
|
|
20
20
|
return localeText(node.label) ?? localeText(node.title) ?? (typeof node.displayName === "string" && node.displayName.trim() ? node.displayName.trim() : void 0) ?? (typeof node.type === "string" ? node.type : void 0);
|
|
21
21
|
}
|
|
22
|
-
function describePath(path, rootData, blockLabelAt) {
|
|
22
|
+
export function describePath(path, rootData, blockLabelAt) {
|
|
23
23
|
const segs = [];
|
|
24
24
|
let node = rootData;
|
|
25
25
|
let labeledTopBlock = false;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { DEFAULT_GAP } from "./schema";
|
|
4
4
|
import { findField } from "./utils/resolve";
|
|
5
|
+
import { useViewportRevision } from "../../share/viewport";
|
|
5
6
|
defineOptions({ name: "ShwfedFormUnitRenderer" });
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
unit: { type: Object, required: true },
|
|
@@ -19,7 +20,11 @@ function pickLayout(sets) {
|
|
|
19
20
|
}
|
|
20
21
|
return sets[sets.length - 1];
|
|
21
22
|
}
|
|
22
|
-
const
|
|
23
|
+
const viewportRevision = useViewportRevision();
|
|
24
|
+
const activeLayout = computed(() => {
|
|
25
|
+
void viewportRevision.value;
|
|
26
|
+
return pickLayout(props.unit.layouts);
|
|
27
|
+
});
|
|
23
28
|
const warnedMissing = /* @__PURE__ */ new Set();
|
|
24
29
|
const placedFields = computed(() => {
|
|
25
30
|
const layout = activeLayout.value?.layout;
|
|
@@ -39,7 +39,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
-
readonly maxLength?: number | undefined;
|
|
43
42
|
readonly validations?: readonly {
|
|
44
43
|
readonly message: readonly [{
|
|
45
44
|
readonly locale: "zh";
|
|
@@ -51,6 +50,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
51
50
|
readonly warning?: boolean | undefined;
|
|
52
51
|
readonly when: string;
|
|
53
52
|
}[] | undefined;
|
|
53
|
+
readonly maxLength?: number | undefined;
|
|
54
54
|
}) => any;
|
|
55
55
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
56
56
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,7 +89,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly mode: "formula" | "prefill";
|
|
90
90
|
readonly expression: string;
|
|
91
91
|
} | undefined;
|
|
92
|
-
readonly maxLength?: number | undefined;
|
|
93
92
|
readonly validations?: readonly {
|
|
94
93
|
readonly message: readonly [{
|
|
95
94
|
readonly locale: "zh";
|
|
@@ -101,6 +100,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
101
100
|
readonly warning?: boolean | undefined;
|
|
102
101
|
readonly when: string;
|
|
103
102
|
}[] | undefined;
|
|
103
|
+
readonly maxLength?: number | undefined;
|
|
104
104
|
}) => any) | undefined;
|
|
105
105
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
106
106
|
declare const _default: typeof __VLS_export;
|
|
@@ -39,7 +39,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
-
readonly maxLength?: number | undefined;
|
|
43
42
|
readonly validations?: readonly {
|
|
44
43
|
readonly message: readonly [{
|
|
45
44
|
readonly locale: "zh";
|
|
@@ -51,6 +50,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
51
50
|
readonly warning?: boolean | undefined;
|
|
52
51
|
readonly when: string;
|
|
53
52
|
}[] | undefined;
|
|
53
|
+
readonly maxLength?: number | undefined;
|
|
54
54
|
}) => any;
|
|
55
55
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
56
56
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,7 +89,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly mode: "formula" | "prefill";
|
|
90
90
|
readonly expression: string;
|
|
91
91
|
} | undefined;
|
|
92
|
-
readonly maxLength?: number | undefined;
|
|
93
92
|
readonly validations?: readonly {
|
|
94
93
|
readonly message: readonly [{
|
|
95
94
|
readonly locale: "zh";
|
|
@@ -101,6 +100,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
101
100
|
readonly warning?: boolean | undefined;
|
|
102
101
|
readonly when: string;
|
|
103
102
|
}[] | undefined;
|
|
103
|
+
readonly maxLength?: number | undefined;
|
|
104
104
|
}) => any) | undefined;
|
|
105
105
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
106
106
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { formatValidationError } from "../config/utils/validation-error.js";
|
|
4
|
+
import { findDanglingLinkages, formatDanglingLinkages } from "../config/utils/linkage.js";
|
|
5
|
+
import { createExpressionValidityRegistry, provideExpressionValidity } from "../ui/expression-editor/index.js";
|
|
4
6
|
import { SidebarConfig } from "./schema.js";
|
|
5
7
|
function deepClone(value) {
|
|
6
8
|
return JSON.parse(JSON.stringify(value));
|
|
@@ -14,10 +16,21 @@ export function useSidebarEditor(model, options = {}) {
|
|
|
14
16
|
() => JSON.stringify(draft.value) !== JSON.stringify(baseline.value)
|
|
15
17
|
);
|
|
16
18
|
const validationError = ref(null);
|
|
19
|
+
const validityRegistry = createExpressionValidityRegistry();
|
|
20
|
+
provideExpressionValidity(validityRegistry);
|
|
17
21
|
function confirm() {
|
|
18
22
|
const schema = SidebarConfig(configure);
|
|
19
23
|
try {
|
|
20
24
|
const decoded = Schema.decodeUnknownSync(schema)(draft.value);
|
|
25
|
+
if (!validityRegistry.allValid()) {
|
|
26
|
+
validationError.value = "\u5B58\u5728\u65E0\u6548\u7684\u8DE8\u5C42\u4F5C\u7528\u57DF\u5F15\u7528\uFF0C\u8BF7\u4FEE\u6B63\u6807\u7EA2\u7684\u8868\u8FBE\u5F0F\u540E\u518D\u4FDD\u5B58";
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const dangling = findDanglingLinkages(decoded);
|
|
30
|
+
if (dangling.length > 0) {
|
|
31
|
+
validationError.value = formatDanglingLinkages(dangling, decoded, () => void 0);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
21
34
|
validationError.value = null;
|
|
22
35
|
model.value = decoded;
|
|
23
36
|
baseline.value = deepClone(decoded);
|
|
@@ -43,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
43
43
|
readonly data: string;
|
|
44
44
|
readonly request?: string | undefined;
|
|
45
45
|
};
|
|
46
|
+
readonly enableSorting?: boolean | undefined;
|
|
46
47
|
readonly nodeKey: string;
|
|
47
48
|
readonly nodeChildren: string;
|
|
48
49
|
readonly nodeLabel: readonly [{
|
|
@@ -52,7 +53,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
53
|
readonly locale: "en" | "ja" | "ko";
|
|
53
54
|
readonly message: string;
|
|
54
55
|
}[]];
|
|
55
|
-
readonly enableSorting?: boolean | undefined;
|
|
56
56
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
57
57
|
readonly nodeTooltip?: readonly [{
|
|
58
58
|
readonly locale: "zh";
|
|
@@ -106,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
106
106
|
readonly data: string;
|
|
107
107
|
readonly request?: string | undefined;
|
|
108
108
|
};
|
|
109
|
+
readonly enableSorting?: boolean | undefined;
|
|
109
110
|
readonly nodeKey: string;
|
|
110
111
|
readonly nodeChildren: string;
|
|
111
112
|
readonly nodeLabel: readonly [{
|
|
@@ -115,7 +116,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
115
116
|
readonly locale: "en" | "ja" | "ko";
|
|
116
117
|
readonly message: string;
|
|
117
118
|
}[]];
|
|
118
|
-
readonly enableSorting?: boolean | undefined;
|
|
119
119
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
120
120
|
readonly nodeTooltip?: readonly [{
|
|
121
121
|
readonly locale: "zh";
|
|
@@ -43,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
43
43
|
readonly data: string;
|
|
44
44
|
readonly request?: string | undefined;
|
|
45
45
|
};
|
|
46
|
+
readonly enableSorting?: boolean | undefined;
|
|
46
47
|
readonly nodeKey: string;
|
|
47
48
|
readonly nodeChildren: string;
|
|
48
49
|
readonly nodeLabel: readonly [{
|
|
@@ -52,7 +53,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
53
|
readonly locale: "en" | "ja" | "ko";
|
|
53
54
|
readonly message: string;
|
|
54
55
|
}[]];
|
|
55
|
-
readonly enableSorting?: boolean | undefined;
|
|
56
56
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
57
57
|
readonly nodeTooltip?: readonly [{
|
|
58
58
|
readonly locale: "zh";
|
|
@@ -106,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
106
106
|
readonly data: string;
|
|
107
107
|
readonly request?: string | undefined;
|
|
108
108
|
};
|
|
109
|
+
readonly enableSorting?: boolean | undefined;
|
|
109
110
|
readonly nodeKey: string;
|
|
110
111
|
readonly nodeChildren: string;
|
|
111
112
|
readonly nodeLabel: readonly [{
|
|
@@ -115,7 +116,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
115
116
|
readonly locale: "en" | "ja" | "ko";
|
|
116
117
|
readonly message: string;
|
|
117
118
|
}[]];
|
|
118
|
-
readonly enableSorting?: boolean | undefined;
|
|
119
119
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
120
120
|
readonly nodeTooltip?: readonly [{
|
|
121
121
|
readonly locale: "zh";
|
|
@@ -43,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
43
43
|
readonly data: string;
|
|
44
44
|
readonly request?: string | undefined;
|
|
45
45
|
};
|
|
46
|
+
readonly enableSorting?: boolean | undefined;
|
|
46
47
|
readonly nodeKey: string;
|
|
47
48
|
readonly nodeChildren: string;
|
|
48
49
|
readonly nodeLabel: readonly [{
|
|
@@ -52,7 +53,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
53
|
readonly locale: "en" | "ja" | "ko";
|
|
53
54
|
readonly message: string;
|
|
54
55
|
}[]];
|
|
55
|
-
readonly enableSorting?: boolean | undefined;
|
|
56
56
|
readonly nodeTooltip?: readonly [{
|
|
57
57
|
readonly locale: "zh";
|
|
58
58
|
readonly message: string;
|
|
@@ -105,6 +105,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
105
105
|
readonly data: string;
|
|
106
106
|
readonly request?: string | undefined;
|
|
107
107
|
};
|
|
108
|
+
readonly enableSorting?: boolean | undefined;
|
|
108
109
|
readonly nodeKey: string;
|
|
109
110
|
readonly nodeChildren: string;
|
|
110
111
|
readonly nodeLabel: readonly [{
|
|
@@ -114,7 +115,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
114
115
|
readonly locale: "en" | "ja" | "ko";
|
|
115
116
|
readonly message: string;
|
|
116
117
|
}[]];
|
|
117
|
-
readonly enableSorting?: boolean | undefined;
|
|
118
118
|
readonly nodeTooltip?: readonly [{
|
|
119
119
|
readonly locale: "zh";
|
|
120
120
|
readonly message: string;
|
|
@@ -43,6 +43,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
43
43
|
readonly data: string;
|
|
44
44
|
readonly request?: string | undefined;
|
|
45
45
|
};
|
|
46
|
+
readonly enableSorting?: boolean | undefined;
|
|
46
47
|
readonly nodeKey: string;
|
|
47
48
|
readonly nodeChildren: string;
|
|
48
49
|
readonly nodeLabel: readonly [{
|
|
@@ -52,7 +53,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
53
|
readonly locale: "en" | "ja" | "ko";
|
|
53
54
|
readonly message: string;
|
|
54
55
|
}[]];
|
|
55
|
-
readonly enableSorting?: boolean | undefined;
|
|
56
56
|
readonly nodeTooltip?: readonly [{
|
|
57
57
|
readonly locale: "zh";
|
|
58
58
|
readonly message: string;
|
|
@@ -105,6 +105,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
105
105
|
readonly data: string;
|
|
106
106
|
readonly request?: string | undefined;
|
|
107
107
|
};
|
|
108
|
+
readonly enableSorting?: boolean | undefined;
|
|
108
109
|
readonly nodeKey: string;
|
|
109
110
|
readonly nodeChildren: string;
|
|
110
111
|
readonly nodeLabel: readonly [{
|
|
@@ -114,7 +115,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
114
115
|
readonly locale: "en" | "ja" | "ko";
|
|
115
116
|
readonly message: string;
|
|
116
117
|
}[]];
|
|
117
|
-
readonly enableSorting?: boolean | undefined;
|
|
118
118
|
readonly nodeTooltip?: readonly [{
|
|
119
119
|
readonly locale: "zh";
|
|
120
120
|
readonly message: string;
|
|
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
44
|
readonly data: string;
|
|
45
45
|
readonly request?: string | undefined;
|
|
46
46
|
};
|
|
47
|
+
readonly enableSorting?: boolean | undefined;
|
|
47
48
|
readonly nodeKey: string;
|
|
48
49
|
readonly nodeChildren: string;
|
|
49
50
|
readonly nodeLabel: readonly [{
|
|
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
54
|
readonly locale: "en" | "ja" | "ko";
|
|
54
55
|
readonly message: string;
|
|
55
56
|
}[]];
|
|
56
|
-
readonly enableSorting?: boolean | undefined;
|
|
57
57
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
58
58
|
readonly nodeTooltip?: readonly [{
|
|
59
59
|
readonly locale: "zh";
|
|
@@ -108,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly data: string;
|
|
109
109
|
readonly request?: string | undefined;
|
|
110
110
|
};
|
|
111
|
+
readonly enableSorting?: boolean | undefined;
|
|
111
112
|
readonly nodeKey: string;
|
|
112
113
|
readonly nodeChildren: string;
|
|
113
114
|
readonly nodeLabel: readonly [{
|
|
@@ -117,7 +118,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
118
|
readonly locale: "en" | "ja" | "ko";
|
|
118
119
|
readonly message: string;
|
|
119
120
|
}[]];
|
|
120
|
-
readonly enableSorting?: boolean | undefined;
|
|
121
121
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
122
122
|
readonly nodeTooltip?: readonly [{
|
|
123
123
|
readonly locale: "zh";
|
|
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
44
|
readonly data: string;
|
|
45
45
|
readonly request?: string | undefined;
|
|
46
46
|
};
|
|
47
|
+
readonly enableSorting?: boolean | undefined;
|
|
47
48
|
readonly nodeKey: string;
|
|
48
49
|
readonly nodeChildren: string;
|
|
49
50
|
readonly nodeLabel: readonly [{
|
|
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
54
|
readonly locale: "en" | "ja" | "ko";
|
|
54
55
|
readonly message: string;
|
|
55
56
|
}[]];
|
|
56
|
-
readonly enableSorting?: boolean | undefined;
|
|
57
57
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
58
58
|
readonly nodeTooltip?: readonly [{
|
|
59
59
|
readonly locale: "zh";
|
|
@@ -108,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly data: string;
|
|
109
109
|
readonly request?: string | undefined;
|
|
110
110
|
};
|
|
111
|
+
readonly enableSorting?: boolean | undefined;
|
|
111
112
|
readonly nodeKey: string;
|
|
112
113
|
readonly nodeChildren: string;
|
|
113
114
|
readonly nodeLabel: readonly [{
|
|
@@ -117,7 +118,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
118
|
readonly locale: "en" | "ja" | "ko";
|
|
118
119
|
readonly message: string;
|
|
119
120
|
}[]];
|
|
120
|
-
readonly enableSorting?: boolean | undefined;
|
|
121
121
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
122
122
|
readonly nodeTooltip?: readonly [{
|
|
123
123
|
readonly locale: "zh";
|
|
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
44
|
readonly data: string;
|
|
45
45
|
readonly request?: string | undefined;
|
|
46
46
|
};
|
|
47
|
+
readonly enableSorting?: boolean | undefined;
|
|
47
48
|
readonly nodeKey: string;
|
|
48
49
|
readonly nodeChildren: string;
|
|
49
50
|
readonly nodeLabel: readonly [{
|
|
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
54
|
readonly locale: "en" | "ja" | "ko";
|
|
54
55
|
readonly message: string;
|
|
55
56
|
}[]];
|
|
56
|
-
readonly enableSorting?: boolean | undefined;
|
|
57
57
|
readonly nodeTooltip?: readonly [{
|
|
58
58
|
readonly locale: "zh";
|
|
59
59
|
readonly message: string;
|
|
@@ -107,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
107
107
|
readonly data: string;
|
|
108
108
|
readonly request?: string | undefined;
|
|
109
109
|
};
|
|
110
|
+
readonly enableSorting?: boolean | undefined;
|
|
110
111
|
readonly nodeKey: string;
|
|
111
112
|
readonly nodeChildren: string;
|
|
112
113
|
readonly nodeLabel: readonly [{
|
|
@@ -116,7 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
116
117
|
readonly locale: "en" | "ja" | "ko";
|
|
117
118
|
readonly message: string;
|
|
118
119
|
}[]];
|
|
119
|
-
readonly enableSorting?: boolean | undefined;
|
|
120
120
|
readonly nodeTooltip?: readonly [{
|
|
121
121
|
readonly locale: "zh";
|
|
122
122
|
readonly message: string;
|
|
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
44
|
readonly data: string;
|
|
45
45
|
readonly request?: string | undefined;
|
|
46
46
|
};
|
|
47
|
+
readonly enableSorting?: boolean | undefined;
|
|
47
48
|
readonly nodeKey: string;
|
|
48
49
|
readonly nodeChildren: string;
|
|
49
50
|
readonly nodeLabel: readonly [{
|
|
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
54
|
readonly locale: "en" | "ja" | "ko";
|
|
54
55
|
readonly message: string;
|
|
55
56
|
}[]];
|
|
56
|
-
readonly enableSorting?: boolean | undefined;
|
|
57
57
|
readonly nodeTooltip?: readonly [{
|
|
58
58
|
readonly locale: "zh";
|
|
59
59
|
readonly message: string;
|
|
@@ -107,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
107
107
|
readonly data: string;
|
|
108
108
|
readonly request?: string | undefined;
|
|
109
109
|
};
|
|
110
|
+
readonly enableSorting?: boolean | undefined;
|
|
110
111
|
readonly nodeKey: string;
|
|
111
112
|
readonly nodeChildren: string;
|
|
112
113
|
readonly nodeLabel: readonly [{
|
|
@@ -116,7 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
116
117
|
readonly locale: "en" | "ja" | "ko";
|
|
117
118
|
readonly message: string;
|
|
118
119
|
}[]];
|
|
119
|
-
readonly enableSorting?: boolean | undefined;
|
|
120
120
|
readonly nodeTooltip?: readonly [{
|
|
121
121
|
readonly locale: "zh";
|
|
122
122
|
readonly message: string;
|
|
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
45
45
|
readonly data: string;
|
|
46
46
|
readonly request?: string | undefined;
|
|
47
47
|
};
|
|
48
|
+
readonly enableSorting?: boolean | undefined;
|
|
48
49
|
readonly nodeKey: string;
|
|
49
50
|
readonly nodeChildren: string;
|
|
50
51
|
readonly nodeLabel: string;
|
|
51
|
-
readonly enableSorting?: boolean | undefined;
|
|
52
52
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
53
53
|
readonly nodeTooltip?: readonly [{
|
|
54
54
|
readonly locale: "zh";
|
|
@@ -104,10 +104,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
104
104
|
readonly data: string;
|
|
105
105
|
readonly request?: string | undefined;
|
|
106
106
|
};
|
|
107
|
+
readonly enableSorting?: boolean | undefined;
|
|
107
108
|
readonly nodeKey: string;
|
|
108
109
|
readonly nodeChildren: string;
|
|
109
110
|
readonly nodeLabel: string;
|
|
110
|
-
readonly enableSorting?: boolean | undefined;
|
|
111
111
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
112
112
|
readonly nodeTooltip?: readonly [{
|
|
113
113
|
readonly locale: "zh";
|
|
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
45
45
|
readonly data: string;
|
|
46
46
|
readonly request?: string | undefined;
|
|
47
47
|
};
|
|
48
|
+
readonly enableSorting?: boolean | undefined;
|
|
48
49
|
readonly nodeKey: string;
|
|
49
50
|
readonly nodeChildren: string;
|
|
50
51
|
readonly nodeLabel: string;
|
|
51
|
-
readonly enableSorting?: boolean | undefined;
|
|
52
52
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
53
53
|
readonly nodeTooltip?: readonly [{
|
|
54
54
|
readonly locale: "zh";
|
|
@@ -104,10 +104,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
104
104
|
readonly data: string;
|
|
105
105
|
readonly request?: string | undefined;
|
|
106
106
|
};
|
|
107
|
+
readonly enableSorting?: boolean | undefined;
|
|
107
108
|
readonly nodeKey: string;
|
|
108
109
|
readonly nodeChildren: string;
|
|
109
110
|
readonly nodeLabel: string;
|
|
110
|
-
readonly enableSorting?: boolean | undefined;
|
|
111
111
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
112
112
|
readonly nodeTooltip?: readonly [{
|
|
113
113
|
readonly locale: "zh";
|