@vef-framework-react/approval-form-bridge 2.24.1 → 2.25.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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/project.cjs +1 -1
- package/dist/cjs/validate.cjs +1 -1
- package/dist/es/index.js +3 -3
- package/dist/es/issues.js +1 -1
- package/dist/es/project.js +52 -47
- package/dist/es/registry.js +1 -1
- package/dist/es/validate.js +5 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/validate.d.ts +9 -1
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./project.cjs"),t=require("./registry.cjs"),n=require("./validate.cjs");exports.APPROVAL_EXCLUDED_FIELD_TYPES=t.APPROVAL_EXCLUDED_FIELD_TYPES,exports.createApprovalRegistries=t.createApprovalRegistries,exports.projectFormSchema=e.projectFormSchema,exports.validateApprovalSchema=n.validateApprovalSchema;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./project.cjs"),t=require("./registry.cjs"),n=require("./validate.cjs");exports.APPROVAL_EXCLUDED_FIELD_TYPES=t.APPROVAL_EXCLUDED_FIELD_TYPES,exports.createApprovalRegistries=t.createApprovalRegistries,exports.projectFormSchema=e.projectFormSchema,exports.validateApprovalProjection=n.validateApprovalProjection,exports.validateApprovalSchema=n.validateApprovalSchema;
|
package/dist/cjs/project.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./issues.cjs");let t=require("@vef-framework-react/form-editor");var n={textfield:`input`,"code-editor":`textarea`,textarea:`textarea`,number:`number`,select:`select`,radio:`select`,"checkbox-group":`select`,date:`date`,datetime:`date`,upload:`upload`},r=new Set([`switch`,`daterange`]);function i(n){let r=[],i=[],u=[],d=new Map((n.dataSources??[]).map(e=>[e.id,e])),f=new Map;for(let p of[n.presentations.pc,n.presentations.mobile])p!==void 0&&(0,t.walkNodes)(p,(n,m)=>{if(m.length>0||!(0,t.isKeyedNode)(n))return;let g=f.get(n.key),_=a(n);if(_!==void 0){g!==null&&(r.push(_),f.set(n.key,null));return}if(g!==void 0){if(g!==null){let t=o(n);t!==null&&t!==g.kind?r.push(e.issueCrossDeviceKindMismatch(n.key,g.kind,t)):t===`table`&&g.tableSignature!==void 0&&s(n)!==g.tableSignature&&r.push(e.issueCrossDeviceTableMismatch(n.key))}return}let v=n.type===`subform`,y=v?l(n,d,r):c(n,n.key,d,r);f.set(n.key,y===void 0?null:{kind:y.approval.kind,...v&&{tableSignature:s(n)}}),y!==void 0&&(i.push({...y.approval,sortOrder:i.length}),u.push(h(p,n)?{...y.flow,hasConditionalVisibility:!0}:y.flow))});return{fields:i,formFields:u,issues:r,valid:r.every(e=>e.severity!==`error`)}}function a(t){if(!(t.type===`subform`||n[t.type]!==void 0))return r.has(t.type)?e.issueUnmappableFieldType(t.key,t.type):e.issueUnknownFieldType(t.key,t.type)}function o(e){return e.type===`subform`?`table`:n[e.type]??null}function s(e){let r=[],i=new Set;return(0,t.walkNodes)({children:e.template},(e,a)=>{a.length>0||!(0,t.isKeyedNode)(e)||i.has(e.key)||(i.add(e.key),r.push(`${e.key}:${e.type===`subform`?`table`:n[e.type]??`?`}`))}),r.join(`,`)}function c(t,i,a,o){let s=n[t.type];if(s===void 0){o.push(r.has(t.type)?e.issueUnmappableFieldType(i,t.type):e.issueUnknownFieldType(i,t.type));return}m(t,i,o);let c=t.label??t.key,{options:l,optionSource:h}=u(t,i,a,o),{isRequired:g,rule:_}=p(t),v=d(t),{precision:y}=t,{placeholder:b}=t,x=y!==void 0&&y>0;return _?.pattern!==void 0&&f(_.pattern)&&o.push(e.issuePatternUnsupported(i)),v===`decimal`&&!x&&o.push(e.issueDecimalScaleMissing(i)),{approval:{key:t.key,kind:s,label:c,...b!==void 0&&{placeholder:b},...g&&{isRequired:g},...l!==void 0&&{options:l},...h!==void 0&&{optionSource:h},..._!==void 0&&{validation:_},...v!==void 0&&{columnType:v},...v===`decimal`&&x&&{scale:y}},flow:{key:t.key,kind:s,label:c,...l!==void 0&&{options:l}}}}function l(n,r,i){let a=[],o=[],s=new Set,l=!1;if((0,t.walkNodes)({children:n.template},(u,d)=>{if(d.length>0||!(0,t.isKeyedNode)(u)||s.has(u.key))return;if(s.add(u.key),u.type===`subform`){l=!0,i.push(e.issueNestedSubform(`${n.key}.${u.key}`));return}let f=c(u,`${n.key}.${u.key}`,r,i);f!==void 0&&(a.push({...f.approval,sortOrder:a.length}),o.push(f.flow))}),a.length===0){l||i.push(e.issueTableColumnsEmpty(n.key));return}m(n,n.key,i);let u=n.label??n.key,d=(n.minRows??0)>=1,f={...n.minRows!==void 0&&n.minRows>0&&{minLength:n.minRows},...n.maxRows!==void 0&&{maxLength:n.maxRows}},p=f.minLength!==void 0||f.maxLength!==void 0;return{approval:{key:n.key,kind:`table`,label:u,...d&&{isRequired:d},...p&&{validation:f},columns:a},flow:{key:n.key,kind:`table`,label:u,columns:o}}}function u(
|
|
1
|
+
const e=require("./issues.cjs");let t=require("@vef-framework-react/form-editor");var n={textfield:`input`,"code-editor":`textarea`,textarea:`textarea`,number:`number`,select:`select`,radio:`select`,"checkbox-group":`select`,date:`date`,datetime:`date`,upload:`upload`},r=new Set([`switch`,`daterange`]);function i(n){let r=[],i=[],u=[],d=new Map((n.dataSources??[]).map(e=>[e.id,e])),f=new Map;for(let p of[n.presentations.pc,n.presentations.mobile])p!==void 0&&(0,t.walkNodes)(p,(n,m)=>{if(m.length>0||!(0,t.isKeyedNode)(n))return;let g=f.get(n.key),_=a(n);if(_!==void 0){g!==null&&(r.push(_),f.set(n.key,null));return}if(g!==void 0){if(g!==null){let t=o(n);t!==null&&t!==g.kind?r.push(e.issueCrossDeviceKindMismatch(n.key,g.kind,t)):t===`table`&&g.tableSignature!==void 0&&s(n)!==g.tableSignature&&r.push(e.issueCrossDeviceTableMismatch(n.key))}return}let v=n.type===`subform`,y=v?l(n,d,r):c(n,n.key,d,r);f.set(n.key,y===void 0?null:{kind:y.approval.kind,...v&&{tableSignature:s(n)}}),y!==void 0&&(i.push({...y.approval,sortOrder:i.length}),u.push(h(p,n)?{...y.flow,hasConditionalVisibility:!0}:y.flow))});return{fields:i,formFields:u,issues:r,valid:r.every(e=>e.severity!==`error`)}}function a(t){if(!(t.type===`subform`||n[t.type]!==void 0))return r.has(t.type)?e.issueUnmappableFieldType(t.key,t.type):e.issueUnknownFieldType(t.key,t.type)}function o(e){return e.type===`subform`?`table`:n[e.type]??null}function s(e){let r=[],i=new Set;return(0,t.walkNodes)({children:e.template},(e,a)=>{a.length>0||!(0,t.isKeyedNode)(e)||i.has(e.key)||(i.add(e.key),r.push(`${e.key}:${e.type===`subform`?`table`:n[e.type]??`?`}`))}),r.join(`,`)}function c(t,i,a,o){let s=n[t.type];if(s===void 0){o.push(r.has(t.type)?e.issueUnmappableFieldType(i,t.type):e.issueUnknownFieldType(i,t.type));return}m(t,i,o);let c=t.label??t.key,{options:l,optionSource:h}=u(t,i,a,o),{isRequired:g,rule:_}=p(t),v=d(t),{precision:y}=t,{placeholder:b}=t,x=y!==void 0&&y>0;return _?.pattern!==void 0&&f(_.pattern)&&o.push(e.issuePatternUnsupported(i)),v===`decimal`&&!x&&o.push(e.issueDecimalScaleMissing(i)),{approval:{key:t.key,kind:s,label:c,...b!==void 0&&{placeholder:b},...g&&{isRequired:g},...l!==void 0&&{options:l},...h!==void 0&&{optionSource:h},..._!==void 0&&{validation:_},...v!==void 0&&{columnType:v},...v===`decimal`&&x&&{scale:y}},flow:{key:t.key,kind:s,label:c,...l!==void 0&&{options:l}}}}function l(n,r,i){let a=[],o=[],s=new Set,l=!1;if((0,t.walkNodes)({children:n.template},(u,d)=>{if(d.length>0||!(0,t.isKeyedNode)(u)||s.has(u.key))return;if(s.add(u.key),u.type===`subform`){l=!0,i.push(e.issueNestedSubform(`${n.key}.${u.key}`));return}let f=c(u,`${n.key}.${u.key}`,r,i);f!==void 0&&(a.push({...f.approval,sortOrder:a.length}),o.push(f.flow))}),a.length===0){l||i.push(e.issueTableColumnsEmpty(n.key));return}m(n,n.key,i);let u=n.label??n.key,d=(n.minRows??0)>=1,f={...n.minRows!==void 0&&n.minRows>0&&{minLength:n.minRows},...n.maxRows!==void 0&&{maxLength:n.maxRows}},p=f.minLength!==void 0||f.maxLength!==void 0;return{approval:{key:n.key,kind:`table`,label:u,...d&&{isRequired:d},...p&&{validation:f},columns:a},flow:{key:n.key,kind:`table`,label:u,columns:o}}}function u(n,r,i,a){let o=n.dataSource;if(o===void 0)return{};let s=o.kind===`ref`?i.get(o.dataSourceId):o;if(s?.kind===`static`)return{options:s.options};if(a.push(e.issueOptionsNotStatic(r)),s?.kind===`remote`){let e=(0,t.normalizeOptionMapping)(s.mapping);return{optionSource:{kind:`remote`,...s.request!==void 0&&{request:s.request},...e!==void 0&&{mapping:e}}}}return{}}function d(e){if(e.columnType!==void 0)return e.columnType;let n=(0,t.inferColumnType)(e);return e.type===`number`&&n===`integer`?void 0:n}function f(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`\\`){let r=e[n+1];if(!t&&r!==void 0&&r>=`1`&&r<=`9`)return!0;n++;continue}if(r===`[`){t=!0;continue}if(r===`]`){t=!1;continue}if(!t&&r===`(`&&e[n+1]===`?`){let t=e.slice(n+2);if(t.startsWith(`=`)||t.startsWith(`!`)||t.startsWith(`<=`)||t.startsWith(`<!`))return!0}}return!1}function p(e){let{required:t,...n}=e.validate??{},r=Object.entries(n).filter(([,e])=>e!==void 0);return{isRequired:t===!0,...r.length>0&&{rule:Object.fromEntries(r)}}}function m(t,n,r){let{linkage:i}=t;i!==void 0&&(i.defaults!==void 0||(i.rules?.length??0)>0)&&r.push(e.issueLinkageNotProjected(n))}function h(e,n){if(g(n.linkage))return!0;for(let r=(0,t.findParentContainer)(e,n.id);r!==void 0;r=(0,t.findParentContainer)(e,r.id))if(g(r.linkage))return!0;return!1}function g(e){return e===void 0?!1:e.defaults?.hidden===!0?!0:(e.rules??[]).some(e=>e.actions.some(e=>e.type===`hide`||e.type===`show`||e.type===`script`))}exports.projectFormSchema=i;
|
package/dist/cjs/validate.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./project.cjs");let t=require("@vef-framework-react/form-editor");function n(n,r){let i=(0,t.validateSchema)(n,r);if(i.schema===void 0)return{valid:!1,issues:i.issues};let a=e.projectFormSchema(i.schema);return{valid:i.valid&&a.valid,issues:[...i.issues,...a.issues]}}exports.validateApprovalSchema=n;
|
|
1
|
+
const e=require("./project.cjs");let t=require("@vef-framework-react/form-editor");function n(n,r){let i=(0,t.validateSchema)(n,r);if(i.schema===void 0)return{valid:!1,issues:i.issues};let a=e.projectFormSchema(i.schema);return{valid:i.valid&&a.valid,issues:[...i.issues,...a.issues]}}function r(t){return e.projectFormSchema(t).issues}exports.validateApprovalProjection=r,exports.validateApprovalSchema=n;
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval-form-bridge v2.
|
|
1
|
+
/*! @vef-framework-react/approval-form-bridge v2.25.0 made by Venus | 2026-10-13T08:59:21.277Z */
|
|
2
2
|
import { projectFormSchema as e } from "./project.js";
|
|
3
3
|
import { APPROVAL_EXCLUDED_FIELD_TYPES as t, createApprovalRegistries as n } from "./registry.js";
|
|
4
|
-
import {
|
|
5
|
-
export { t as APPROVAL_EXCLUDED_FIELD_TYPES, n as createApprovalRegistries, e as projectFormSchema, r as validateApprovalSchema };
|
|
4
|
+
import { validateApprovalProjection as r, validateApprovalSchema as i } from "./validate.js";
|
|
5
|
+
export { t as APPROVAL_EXCLUDED_FIELD_TYPES, n as createApprovalRegistries, e as projectFormSchema, r as validateApprovalProjection, i as validateApprovalSchema };
|
package/dist/es/issues.js
CHANGED
package/dist/es/project.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval-form-bridge v2.
|
|
1
|
+
/*! @vef-framework-react/approval-form-bridge v2.25.0 made by Venus | 2026-10-13T08:59:21.277Z */
|
|
2
2
|
import { issueCrossDeviceKindMismatch as e, issueCrossDeviceTableMismatch as t, issueDecimalScaleMissing as n, issueLinkageNotProjected as r, issueNestedSubform as i, issueOptionsNotStatic as a, issuePatternUnsupported as o, issueTableColumnsEmpty as s, issueUnknownFieldType as c, issueUnmappableFieldType as l } from "./issues.js";
|
|
3
|
-
import { findParentContainer as u, inferColumnType as d, isKeyedNode as f,
|
|
3
|
+
import { findParentContainer as u, inferColumnType as d, isKeyedNode as f, normalizeOptionMapping as p, walkNodes as m } from "@vef-framework-react/form-editor";
|
|
4
4
|
//#region src/project.ts
|
|
5
|
-
var
|
|
5
|
+
var h = {
|
|
6
6
|
textfield: "input",
|
|
7
7
|
"code-editor": "textarea",
|
|
8
8
|
textarea: "textarea",
|
|
@@ -13,31 +13,31 @@ var m = {
|
|
|
13
13
|
date: "date",
|
|
14
14
|
datetime: "date",
|
|
15
15
|
upload: "upload"
|
|
16
|
-
},
|
|
17
|
-
function
|
|
16
|
+
}, g = /* @__PURE__ */ new Set(["switch", "daterange"]);
|
|
17
|
+
function _(n) {
|
|
18
18
|
let r = [], i = [], a = [], o = new Map((n.dataSources ?? []).map((e) => [e.id, e])), s = /* @__PURE__ */ new Map();
|
|
19
|
-
for (let c of [n.presentations.pc, n.presentations.mobile]) c !== void 0 &&
|
|
19
|
+
for (let c of [n.presentations.pc, n.presentations.mobile]) c !== void 0 && m(c, (n, l) => {
|
|
20
20
|
if (l.length > 0 || !f(n)) return;
|
|
21
|
-
let u = s.get(n.key), d =
|
|
21
|
+
let u = s.get(n.key), d = v(n);
|
|
22
22
|
if (d !== void 0) {
|
|
23
23
|
u !== null && (r.push(d), s.set(n.key, null));
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
if (u !== void 0) {
|
|
27
27
|
if (u !== null) {
|
|
28
|
-
let i =
|
|
29
|
-
i !== null && i !== u.kind ? r.push(e(n.key, u.kind, i)) : i === "table" && u.tableSignature !== void 0 &&
|
|
28
|
+
let i = y(n);
|
|
29
|
+
i !== null && i !== u.kind ? r.push(e(n.key, u.kind, i)) : i === "table" && u.tableSignature !== void 0 && b(n) !== u.tableSignature && r.push(t(n.key));
|
|
30
30
|
}
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
let p = n.type === "subform", m = p ?
|
|
33
|
+
let p = n.type === "subform", m = p ? S(n, o, r) : x(n, n.key, o, r);
|
|
34
34
|
s.set(n.key, m === void 0 ? null : {
|
|
35
35
|
kind: m.approval.kind,
|
|
36
|
-
...p && { tableSignature:
|
|
36
|
+
...p && { tableSignature: b(n) }
|
|
37
37
|
}), m !== void 0 && (i.push({
|
|
38
38
|
...m.approval,
|
|
39
39
|
sortOrder: i.length
|
|
40
|
-
}), a.push(
|
|
40
|
+
}), a.push(O(c, n) ? {
|
|
41
41
|
...m.flow,
|
|
42
42
|
hasConditionalVisibility: !0
|
|
43
43
|
} : m.flow));
|
|
@@ -49,27 +49,27 @@ function g(n) {
|
|
|
49
49
|
valid: r.every((e) => e.severity !== "error")
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function _(e) {
|
|
53
|
-
if (!(e.type === "subform" || m[e.type] !== void 0)) return h.has(e.type) ? l(e.key, e.type) : c(e.key, e.type);
|
|
54
|
-
}
|
|
55
52
|
function v(e) {
|
|
56
|
-
|
|
53
|
+
if (!(e.type === "subform" || h[e.type] !== void 0)) return g.has(e.type) ? l(e.key, e.type) : c(e.key, e.type);
|
|
57
54
|
}
|
|
58
55
|
function y(e) {
|
|
56
|
+
return e.type === "subform" ? "table" : h[e.type] ?? null;
|
|
57
|
+
}
|
|
58
|
+
function b(e) {
|
|
59
59
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
60
|
-
return
|
|
61
|
-
r.length > 0 || !f(e) || n.has(e.key) || (n.add(e.key), t.push(`${e.key}:${e.type === "subform" ? "table" :
|
|
60
|
+
return m({ children: e.template }, (e, r) => {
|
|
61
|
+
r.length > 0 || !f(e) || n.has(e.key) || (n.add(e.key), t.push(`${e.key}:${e.type === "subform" ? "table" : h[e.type] ?? "?"}`));
|
|
62
62
|
}), t.join(",");
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
let a =
|
|
64
|
+
function x(e, t, r, i) {
|
|
65
|
+
let a = h[e.type];
|
|
66
66
|
if (a === void 0) {
|
|
67
|
-
i.push(
|
|
67
|
+
i.push(g.has(e.type) ? l(t, e.type) : c(t, e.type));
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
let s = e.label ?? e.key, { options: u, optionSource: d } =
|
|
72
|
-
return p?.pattern !== void 0 &&
|
|
70
|
+
D(e, t, i);
|
|
71
|
+
let s = e.label ?? e.key, { options: u, optionSource: d } = C(e, t, r, i), { isRequired: f, rule: p } = E(e), m = w(e), { precision: _ } = e, { placeholder: v } = e, y = _ !== void 0 && _ > 0;
|
|
72
|
+
return p?.pattern !== void 0 && T(p.pattern) && i.push(o(t)), m === "decimal" && !y && i.push(n(t)), {
|
|
73
73
|
approval: {
|
|
74
74
|
key: e.key,
|
|
75
75
|
kind: a,
|
|
@@ -79,8 +79,8 @@ function b(e, t, r, i) {
|
|
|
79
79
|
...u !== void 0 && { options: u },
|
|
80
80
|
...d !== void 0 && { optionSource: d },
|
|
81
81
|
...p !== void 0 && { validation: p },
|
|
82
|
-
...
|
|
83
|
-
...
|
|
82
|
+
...m !== void 0 && { columnType: m },
|
|
83
|
+
...m === "decimal" && y && { scale: _ }
|
|
84
84
|
},
|
|
85
85
|
flow: {
|
|
86
86
|
key: e.key,
|
|
@@ -90,15 +90,15 @@ function b(e, t, r, i) {
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function S(e, t, n) {
|
|
94
94
|
let r = [], a = [], o = /* @__PURE__ */ new Set(), c = !1;
|
|
95
|
-
if (
|
|
95
|
+
if (m({ children: e.template }, (s, l) => {
|
|
96
96
|
if (l.length > 0 || !f(s) || o.has(s.key)) return;
|
|
97
97
|
if (o.add(s.key), s.type === "subform") {
|
|
98
98
|
c = !0, n.push(i(`${e.key}.${s.key}`));
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
let u =
|
|
101
|
+
let u = x(s, `${e.key}.${s.key}`, t, n);
|
|
102
102
|
u !== void 0 && (r.push({
|
|
103
103
|
...u.approval,
|
|
104
104
|
sortOrder: r.length
|
|
@@ -107,18 +107,18 @@ function x(e, t, n) {
|
|
|
107
107
|
c || n.push(s(e.key));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
D(e, e.key, n);
|
|
111
111
|
let l = e.label ?? e.key, u = (e.minRows ?? 0) >= 1, d = {
|
|
112
112
|
...e.minRows !== void 0 && e.minRows > 0 && { minLength: e.minRows },
|
|
113
113
|
...e.maxRows !== void 0 && { maxLength: e.maxRows }
|
|
114
|
-
},
|
|
114
|
+
}, p = d.minLength !== void 0 || d.maxLength !== void 0;
|
|
115
115
|
return {
|
|
116
116
|
approval: {
|
|
117
117
|
key: e.key,
|
|
118
118
|
kind: "table",
|
|
119
119
|
label: l,
|
|
120
120
|
...u && { isRequired: u },
|
|
121
|
-
...
|
|
121
|
+
...p && { validation: d },
|
|
122
122
|
columns: r
|
|
123
123
|
},
|
|
124
124
|
flow: {
|
|
@@ -129,22 +129,27 @@ function x(e, t, n) {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function C(e, t, n, r) {
|
|
133
133
|
let i = e.dataSource;
|
|
134
134
|
if (i === void 0) return {};
|
|
135
135
|
let o = i.kind === "ref" ? n.get(i.dataSourceId) : i;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
if (o?.kind === "static") return { options: o.options };
|
|
137
|
+
if (r.push(a(t)), o?.kind === "remote") {
|
|
138
|
+
let e = p(o.mapping);
|
|
139
|
+
return { optionSource: {
|
|
140
|
+
kind: "remote",
|
|
141
|
+
...o.request !== void 0 && { request: o.request },
|
|
142
|
+
...e !== void 0 && { mapping: e }
|
|
143
|
+
} };
|
|
144
|
+
}
|
|
145
|
+
return {};
|
|
141
146
|
}
|
|
142
|
-
function
|
|
147
|
+
function w(e) {
|
|
143
148
|
if (e.columnType !== void 0) return e.columnType;
|
|
144
149
|
let t = d(e);
|
|
145
150
|
return e.type === "number" && t === "integer" ? void 0 : t;
|
|
146
151
|
}
|
|
147
|
-
function
|
|
152
|
+
function T(e) {
|
|
148
153
|
let t = !1;
|
|
149
154
|
for (let n = 0; n < e.length; n++) {
|
|
150
155
|
let r = e[n];
|
|
@@ -169,24 +174,24 @@ function w(e) {
|
|
|
169
174
|
}
|
|
170
175
|
return !1;
|
|
171
176
|
}
|
|
172
|
-
function
|
|
177
|
+
function E(e) {
|
|
173
178
|
let { required: t, ...n } = e.validate ?? {}, r = Object.entries(n).filter(([, e]) => e !== void 0);
|
|
174
179
|
return {
|
|
175
180
|
isRequired: t === !0,
|
|
176
181
|
...r.length > 0 && { rule: Object.fromEntries(r) }
|
|
177
182
|
};
|
|
178
183
|
}
|
|
179
|
-
function
|
|
184
|
+
function D(e, t, n) {
|
|
180
185
|
let { linkage: i } = e;
|
|
181
186
|
i !== void 0 && (i.defaults !== void 0 || (i.rules?.length ?? 0) > 0) && n.push(r(t));
|
|
182
187
|
}
|
|
183
|
-
function
|
|
184
|
-
if (
|
|
185
|
-
for (let n = u(e, t.id); n !== void 0; n = u(e, n.id)) if (
|
|
188
|
+
function O(e, t) {
|
|
189
|
+
if (k(t.linkage)) return !0;
|
|
190
|
+
for (let n = u(e, t.id); n !== void 0; n = u(e, n.id)) if (k(n.linkage)) return !0;
|
|
186
191
|
return !1;
|
|
187
192
|
}
|
|
188
|
-
function
|
|
193
|
+
function k(e) {
|
|
189
194
|
return e === void 0 ? !1 : e.defaults?.hidden === !0 ? !0 : (e.rules ?? []).some((e) => e.actions.some((e) => e.type === "hide" || e.type === "show" || e.type === "script"));
|
|
190
195
|
}
|
|
191
196
|
//#endregion
|
|
192
|
-
export {
|
|
197
|
+
export { _ as projectFormSchema };
|
package/dist/es/registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval-form-bridge v2.
|
|
1
|
+
/*! @vef-framework-react/approval-form-bridge v2.25.0 made by Venus | 2026-10-13T08:59:21.277Z */
|
|
2
2
|
import { createDefaultMobileRegistry as e, createDefaultRegistry as t } from "@vef-framework-react/form-editor";
|
|
3
3
|
//#region src/registry.ts
|
|
4
4
|
var n = [
|
package/dist/es/validate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/approval-form-bridge v2.
|
|
1
|
+
/*! @vef-framework-react/approval-form-bridge v2.25.0 made by Venus | 2026-10-13T08:59:21.277Z */
|
|
2
2
|
import { projectFormSchema as e } from "./project.js";
|
|
3
3
|
import { validateSchema as t } from "@vef-framework-react/form-editor";
|
|
4
4
|
//#region src/validate.ts
|
|
@@ -14,5 +14,8 @@ function n(n, r) {
|
|
|
14
14
|
issues: [...i.issues, ...a.issues]
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
function r(t) {
|
|
18
|
+
return e(t).issues;
|
|
19
|
+
}
|
|
17
20
|
//#endregion
|
|
18
|
-
export { n as validateApprovalSchema };
|
|
21
|
+
export { r as validateApprovalProjection, n as validateApprovalSchema };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type ApprovalFieldKind, type ApprovalFieldOption, type ApprovalFormField, type ApprovalValidationRule } from './contract';
|
|
1
|
+
export { type ApprovalFieldKind, type ApprovalFieldOption, type ApprovalFieldOptionSource, type ApprovalFormField, type ApprovalOptionSourceKind, type ApprovalValidationRule } from './contract';
|
|
2
2
|
export { type ProjectionIssue, type ProjectionIssueCode } from './issues';
|
|
3
3
|
export { projectFormSchema, type ProjectionResult } from './project';
|
|
4
4
|
export { APPROVAL_EXCLUDED_FIELD_TYPES, createApprovalRegistries } from './registry';
|
|
5
|
-
export { validateApprovalSchema, type ApprovalSchemaIssue, type ApprovalSchemaValidationResult } from './validate';
|
|
5
|
+
export { validateApprovalProjection, validateApprovalSchema, type ApprovalSchemaIssue, type ApprovalSchemaValidationResult } from './validate';
|
package/dist/types/validate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceRegistries, ValidationIssue } from '@vef-framework-react/form-editor';
|
|
1
|
+
import { DeviceRegistries, FormSchema, ValidationIssue } from '@vef-framework-react/form-editor';
|
|
2
2
|
import { ProjectionIssue } from './issues';
|
|
3
3
|
/**
|
|
4
4
|
* A diagnostic from either layer of the save gate: form-editor's structural
|
|
@@ -25,3 +25,11 @@ export interface ApprovalSchemaValidationResult {
|
|
|
25
25
|
* the next pass.
|
|
26
26
|
*/
|
|
27
27
|
export declare function validateApprovalSchema(candidate: unknown, registries: DeviceRegistries): ApprovalSchemaValidationResult;
|
|
28
|
+
/**
|
|
29
|
+
* The approval layer of the save gate alone — the contract-fit issues of
|
|
30
|
+
* {@link projectFormSchema} — shaped for `FormEditor`'s `validate`. The editor
|
|
31
|
+
* runs its own structural pass and calls this only for a structurally sound
|
|
32
|
+
* schema, so a designer sees every issue of {@link validateApprovalSchema} in
|
|
33
|
+
* the editor's own diagnostics, each exactly once, and can jump to it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateApprovalProjection(schema: FormSchema): ProjectionIssue[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework-react/approval-form-bridge",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Projection bridge from form-editor schemas to the approval form contract",
|
|
6
6
|
"keywords": [
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@vef-framework-react/
|
|
44
|
-
"@vef-framework-react/
|
|
43
|
+
"@vef-framework-react/form-editor": "2.25.0",
|
|
44
|
+
"@vef-framework-react/approval-flow-editor": "2.25.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"react": "^19.2.7"
|