@earthranger/react-native-jsonforms-formatter 2.0.0-beta.19 → 2.0.0-beta.20
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/bundle.js +1 -1
- package/dist/v2/conditions.d.ts +11 -1
- package/dist/v2/conditions.d.ts.map +1 -1
- package/dist/v2/conditions.js +25 -17
- package/dist/v2/conditions.js.map +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{void 0!==d&&d.toStringTag&&Object.defineProperty(e,d.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{detectSchemaVersion:()=>Tt,generateUISchema:()=>ze,processSchema:()=>wt,v1:()=>r,v2:()=>n,validateJSONSchema:()=>pt});var r={};e.r(r),e.d(r,{generateUISchema:()=>ze,validateJSONSchema:()=>pt});var n={};e.r(n),e.d(n,{buildConditionSchema:()=>ft,buildSchemaBasedCondition:()=>dt,createSectionRule:()=>mt,extractConditionalProperties:()=>gt,generateUISchema:()=>Et,validateConditions:()=>ht});var i=Object.prototype;const o=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)},a=(c=Object.keys,s=Object,function(e){return c(s(e))});var c,s,u=Object.prototype.hasOwnProperty;const p="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const f=p||l||Function("return this")();var d=f.Symbol;const m=d;var h=Object.prototype,y=h.hasOwnProperty,v=h.toString,b=m?m.toStringTag:void 0;var g=Object.prototype.toString;var O=m?m.toStringTag:void 0;const j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?function(e){var t=y.call(e,b),r=e[b];try{e[b]=void 0;var n=!0}catch(e){}var i=v.call(e);return n&&(t?e[b]=r:delete e[b]),i}(e):function(e){return g.call(e)}(e)},E=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},T=function(e){if(!E(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},w=f["__core-js_shared__"];var S,I=(S=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var A=Function.prototype.toString;const C=function(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var N=/^\[object .+?Constructor\]$/,k=Function.prototype,_=Object.prototype,x=k.toString,P=_.hasOwnProperty,L=RegExp("^"+x.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const M=function(e){return!(!E(e)||function(e){return!!I&&I in e}(e))&&(T(e)?L:N).test(C(e))},q=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return M(r)?r:void 0},D=q(f,"DataView"),U=q(f,"Map"),F=q(f,"Promise"),H=q(f,"Set"),R=q(f,"WeakMap");var V="[object Map]",$="[object Promise]",X="[object Set]",B="[object WeakMap]",J="[object DataView]",W=C(D),Y=C(U),z=C(F),G=C(H),K=C(R),Q=j;(D&&Q(new D(new ArrayBuffer(1)))!=J||U&&Q(new U)!=V||F&&Q(F.resolve())!=$||H&&Q(new H)!=X||R&&Q(new R)!=B)&&(Q=function(e){var t=j(e),r="[object Object]"==t?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case W:return J;case Y:return V;case z:return $;case G:return X;case K:return B}return t});const Z=Q,ee=function(e){return null!=e&&"object"==typeof e},te=function(e){return ee(e)&&"[object Arguments]"==j(e)};var re=Object.prototype,ne=re.hasOwnProperty,ie=re.propertyIsEnumerable;const oe=te(function(){return arguments}())?te:function(e){return ee(e)&&ne.call(e,"callee")&&!ie.call(e,"callee")},ae=Array.isArray,ce=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var se="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=se&&"object"==typeof module&&module&&!module.nodeType&&module,pe=ue&&ue.exports===se?f.Buffer:void 0;const le=(pe?pe.isBuffer:void 0)||function(){return!1};var fe={};fe["[object Float32Array]"]=fe["[object Float64Array]"]=fe["[object Int8Array]"]=fe["[object Int16Array]"]=fe["[object Int32Array]"]=fe["[object Uint8Array]"]=fe["[object Uint8ClampedArray]"]=fe["[object Uint16Array]"]=fe["[object Uint32Array]"]=!0,fe["[object Arguments]"]=fe["[object Array]"]=fe["[object ArrayBuffer]"]=fe["[object Boolean]"]=fe["[object DataView]"]=fe["[object Date]"]=fe["[object Error]"]=fe["[object Function]"]=fe["[object Map]"]=fe["[object Number]"]=fe["[object Object]"]=fe["[object RegExp]"]=fe["[object Set]"]=fe["[object String]"]=fe["[object WeakMap]"]=!1;var de="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=de&&"object"==typeof module&&module&&!module.nodeType&&module,he=me&&me.exports===de&&p.process,ye=function(){try{return me&&me.require&&me.require("util").types||he&&he.binding&&he.binding("util")}catch(e){}}(),ve=ye&&ye.isTypedArray;const be=ve?function(e){return function(t){return e(t)}}(ve):function(e){return ee(e)&&ce(e.length)&&!!fe[j(e)]};var ge=Object.prototype.hasOwnProperty;const Oe=function(e){if(null==e)return!0;if(function(e){return null!=e&&ce(e.length)&&!T(e)}(e)&&(ae(e)||"string"==typeof e||"function"==typeof e.splice||le(e)||be(e)||oe(e)))return!e.length;var t=Z(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(o(e))return!function(e){if(!o(e))return a(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e).length;for(var r in e)if(ge.call(e,r))return!1;return!0};var je,Ee,Te,we=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Se="fieldset",Ie="checkboxes",Ae="string";!function(e){e.DateTime="date-time",e.Date="date"}(je||(je={})),function(e){e.DateTime="date-time",e.MultiSelect="multiselect",e.RepeatableField="repeatable-field",e.FormLabel="form-label"}(Ee||(Ee={})),function(e){e.Header="header"}(Te||(Te={}));var Ce,Ne=function(e){var t=e.toLowerCase().replace(/[\s\\/\\%]/gi,"_");return"fieldset__title_".concat(t)},ke=function(e){return new Set(e).size!==e.length},_e=function(e){return qe(e)&&e.type===Ie},xe=function(e){return null==e||0===e.trim().length},Pe=function(e){return qe(e)&&e.type===Se&&!Oe(e.title)},Le=function(e){return qe(e)&&e.type===Se&&e.items.length>0},Me=function(e){var t,r;return e.type===Ae&&(null===(t=e.enum)||void 0===t?void 0:t.length)>0&&(null===(r=e.inactive_enum)||void 0===r?void 0:r.length)>0},qe=function(e){return e instanceof Object},De=function(e){return!Oe(e.key)},Ue=function(e){return 0!==e.length&&void 0!==e.find((function(e){return qe(e)&&e&&(e.type||"")===Se}))},Fe=function(e){return typeof e===Ae},He=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return e;var t=e.trim();if(""===t)return e;if(/^-?\d+,\d+$/.test(t)){var r=t.replace(",","."),n=parseFloat(r);if(!isNaN(n))return r}return e},Re=function(e,t,r){void 0===r&&(r=[]),"object"==typeof e&&null!==e&&(t(e,r),Array.isArray(e)?e.forEach((function(e,n){return Re(e,t,we(we([],r,!0),[n.toString()],!1))})):Object.entries(e).forEach((function(e){var n=e[0],i=e[1];return Re(i,t,we(we([],r,!0),[n],!1))})))},Ve=function(e){return e.includes(Ie)},$e=function(e){return e.includes("inactive_enum")},Xe=function(e){return e.includes("inactive_titleMap")},Be=function(e){return e.includes("enum")},Je=function(){return Je=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Je.apply(this,arguments)};!function(e){e.Number="number",e.String="string",e.Array="array"}(Ce||(Ce={}));var We=function(e,t,r){return void 0===r&&(r={}),Je({type:"Control",scope:"#/properties/".concat(e),label:t},r&&{options:r})},Ye=function(e,t,r){void 0===r&&(r=void 0);try{var n=r||t.definition.find((function(t){return t.key===e}));if("date-time-picker json-schema"===n.fieldHtmlClass||n&&"datetime"===(n.type||""))return"date"===t.schema.properties[e].format?je.Date:je.DateTime;if("date-picker json-schema"===n.fieldHtmlClass||"date"===t.schema.properties[e].format)return je.Date}catch(e){return}},ze=function(e){var t=[];return Ue(e.definition)?t.push.apply(t,Ge(e)):Object.keys(e.schema.properties).forEach((function(r){var n=Qe(r,e);Oe(n)||t.push(n)})),{type:"Category",elements:t}},Ge=function(e){var t=[];return e.definition.forEach((function(r){if("string"==typeof r)t.push(We(r,e.schema.properties[r].title||""));else if(r instanceof Object)switch(!0){case function(e){return qe(e)&&e.type===Se&&0===e.items.length&&!Oe(e.title)}(r):t.push(We(Ne(r.title),r.title,Ke(Ee.FormLabel)));break;case Le(r):r.title&&t.push(We(Ne(r.title),r.title,Ke(Ee.FormLabel))),r.items.forEach((function(r){if(r instanceof Object){var n=Qe(r.key||"",e,r);n&&t.push(n)}else if("string"==typeof r){var i=Qe(r,e);i&&t.push(i)}}));break;case De(r):var n=Qe(r.key,e);n&&t.push(n)}})),t},Ke=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),Oe(e))return{};var r={format:e};return Oe(t)||(r.display=t),r},Qe=function(e,t,r){void 0===r&&(r=void 0);var n={};switch(t.schema.properties[e].type){case Ce.Number:return We(e,t.schema.properties[e].title||"");case Ce.String:var i=Ye(e,t,r);return xe(i)?t.schema.properties[e].display&&t.schema.properties[e].display===Te.Header&&(n=Ke(Ee.FormLabel)):n=Ke(Ee.DateTime,i),We(e,t.schema.properties[e].title||"",n);case Ce.Array:return t.schema.properties[e].items.enum&&t.schema.properties[e].items.enumNames?n=Ke(Ee.MultiSelect):t.schema.properties[e].items&&(n=Ke(Ee.RepeatableField)),We(e,t.schema.properties[e].title||"",n);case void 0:var o=function(e,t){try{var r=t.definition.find((function(t){return t.key===e}));return"json-schema-checkbox-wrapper"===r.fieldHtmlClass||"checkboxes"===r.type?r:void 0}catch(e){return}}(e,t);return o?(n=Ke(Ee.MultiSelect),We(e,o.title||"",n)):(i=Ye(e,t,r),xe(i)?void 0:(n=Ke(Ee.DateTime,i),We(e,t.schema.properties[e].title||"",n)))}},Ze=function(){return Ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ze.apply(this,arguments)},et=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},tt=/[^\w\n\s_"](?=[^:\n\s{}[]]*:[\t\n\s]*(\{|\[)+)/g,rt=/"minimum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,nt=/"maximum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,it=/"(?=[^"]*(?:"[^"]*)?$)/g,ot=function(e){return{type:"string",readOnly:!0,isHidden:!1,display:Te.Header,title:e}},at=function(e){return(null==e?void 0:e.isHidden)||!1},ct=function(e){return e.enum.filter((function(t){return!e.inactive_enum.includes(t)}))},st=function(e){return e.titleMap.filter((function(t){return!e.inactive_titleMap.includes(t.value)}))},ut=function(e,t,r,n){var i,o,a,c,s=e.hasCheckboxes,u=e.hasDisabledChoices;if(Fe(t)&&r.schema.properties[t])r.schema.properties[t].isHidden=at(r.schema.properties[t]);else{if((qe(t)||De(t))&&t.key&&r.schema.properties[t.key]&&(r.schema.properties[t.key].isHidden=at(r.schema.properties[t.key])),u&&function(e){var t,r;return qe(e)&&e.type===Ie&&(null===(t=e.inactive_titleMap)||void 0===t?void 0:t.length)>0&&(null===(r=e.titleMap)||void 0===r?void 0:r.length)>0}(t))if(n){var p=r.definition.indexOf(n),l=r.definition[p].items.indexOf(t);r.definition[p].items[l].titleMap=st(t)}else r.definition[r.definition.indexOf(t)].titleMap=st(t);s&&_e(t)&&(r.schema.properties[t.key]=(i=t,o=r.schema.properties[t.key].title||"",a=r.schema.properties[t.key].required||!1,c=r.schema.properties[t.key].default||!1,Ze(Ze(Ze({type:"array",uniqueItems:!0,isHidden:!1},a&&{required:a}),{title:o||i.title,items:{enum:i.titleMap.map((function(e){return e.value})),enumNames:i.titleMap.map((function(e){return e.name}))}}),c&&{default:c})))}},pt=function(e){var t;e=function(e){if(null!==e.match(tt))throw Error("Special characters not supported in JSON Schema");return(e=(e=(e=(e=(e=e.replace(/([“”])/g,'"')).replace(new RegExp('\\"enum\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"enum": ["0"]')).replace(new RegExp('\\"enumNames\\"\\n*\\s*\\:\\n*\\s*\\{\\n*\\s*\\}',"g"),'"enumNames": {"0":"No Options"}')).replace(new RegExp('\\"titleMap\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"titleMap": [{"value":"no_option", "name":"No Option"}]')).replace(rt,(function(e){return e.replace(it,"")}))).replace(nt,(function(e){return e.replace(it,"")}))}(e);var r=JSON.parse(e);delete r.schema.$schema,delete r.schema.id,function(e){if(e.schema.definition){var t=e.schema.definition;delete e.schema.definition,e.definition=t}}(r);var n=function(e){return{hasCheckboxes:Ve(e),hasInactiveChoices:$e(e),hasDisabledChoices:Xe(e),hasEnums:Be(e)}}(e);if(function(e){Re(e,(function(e){"object"===e.type&&e.properties&&Object.entries(e.properties).forEach((function(e){var t=e[1];"number"===t.type&&(void 0!==t.default&&(t.default=He(t.default)),void 0!==t.minimum&&(t.minimum=He(t.minimum)),void 0!==t.maximum&&(t.maximum=He(t.maximum)))}))}))}(r.schema),function(e,t){var r=e.hasInactiveChoices,n=e.hasEnums;if(r)for(var i=0,o=Object.keys(t.schema.properties);i<o.length;i++){var a=o[i],c=t.schema.properties[a];Me(c)&&(t.schema.properties[a].enum=ct(c),Oe(t.schema.properties[a].enum)&&(t.schema.properties[a].enum=["0"],t.schema.properties[a].enumNames={0:"No Options"}))}if(n)for(var s=0,u=Object.keys(t.schema.properties);s<u.length;s++)if(a=u[s],!Oe(t.schema.properties[a].enum)&&ke(t.schema.properties[a].enum))throw new Error("Duplicated enum items")}(n,r),function(e,t){var r;if(Ue(t.definition))!function(e,t){for(var r=0,n=t.definition;r<n.length;r++){var i=n[r];switch(!0){case Fe(i):break;case Pe(i):var o=Ne(i.title);t.schema.properties[o]=ot(i.title);break;case Le(i):for(var a=0,c=i.items;a<c.length;a++){var s=c[a];ut(e,s,t,i)}break;case _e(i):ut(e,i,t)}}}(e,t);else if((null===(r=t.definition)||void 0===r?void 0:r.length)>0)for(var n=0,i=t.definition;n<i.length;n++){var o=i[n];ut(e,o,t)}}(n,r),e.includes("helpvalue")&&function(e){for(var t={},r=0,n=0,i=e.definition;n<i.length;n++){var o=i[n];if(Fe(o))t[o]=e.schema.properties[o],delete e.schema.properties[o];else if(qe(o))if(o.helpvalue){var a="help_value_".concat(r);r+=1,t[a]=ot((o.helpvalue||"").replace(/(<.+?>)/g,""))}else o.key&&(t[o.key]=e.schema.properties[o.key],delete e.schema.properties[o.key])}e.schema.properties=Object.assign(t,e.schema.properties)}(r),e.includes("required")){if((null===(t=r.schema.required)||void 0===t?void 0:t.length)>0&&ke(r.schema.required))throw new Error("Duplicated required properties");r.schema=function(e){var t=Array.isArray(e.required)?et([],e.required,!0):null;return Re(e,(function(e,r){if("object"===e.type&&e.properties){var n=[];if(Object.entries(e.properties).forEach((function(e){var t=e[0],r=e[1];(function(e){return"true"===e.required||e.required>0})(r)&&(n.push(t),delete r.required)})),Oe(n))r.length>0&&e.required&&delete e.required;else if(0===r.length&&t){var i=et(et([],t,!0),n,!0);e.required=Array.from(new Set(i))}else e.required=n}})),e}(r.schema)}return r},lt=["CONTAINS","DOES_NOT_HAVE_INPUT","HAS_INPUT","INPUT_IS_EXACTLY"],ft=function(e){var t,r;switch(e.operator){case"CONTAINS":if(void 0===e.value||null===e.value)throw new Error("CONTAINS operator requires a value for condition '".concat(e.id,"'"));r={pattern:String(e.value),type:"string"};break;case"DOES_NOT_HAVE_INPUT":r={anyOf:[{not:{}},{type:"array",maxItems:0},{type:"object",maxProperties:0},{type:"string",maxLength:0},{type:"null"}]};break;case"HAS_INPUT":r={allOf:[{not:{type:"null"}},{anyOf:[{type:"array",minItems:1},{type:"boolean"},{type:"number"},{type:"object",minProperties:1},{type:"string",minLength:1}]}]};break;case"INPUT_IS_EXACTLY":if(void 0===e.value)throw new Error("INPUT_IS_EXACTLY operator requires a value for condition '".concat(e.id,"'"));r=function(e){if("boolean"==typeof e)return{const:e,type:"boolean"};if("number"==typeof e)return{anyOf:[{const:e,type:"number"},{const:String(e),type:"string"}]};if(null===e)return{type:"null"};var t=Number(e);return isNaN(t)||""===e?{const:e,type:"string"}:{anyOf:[{const:t,type:"number"},{const:e,type:"string"}]}}(e.value);break;default:throw new Error("Unknown operator '".concat(e.operator,"' in condition '").concat(e.id,"'"))}return{properties:(t={},t[e.field]=r,t),required:[e.field]}},dt=function(e){if(0===e.length)throw new Error("At least one condition is required");if(1===e.length){var t=e[0];return{scope:"#",schema:ft(t)}}var r=e.map((function(e){return ft(e)}));return{scope:"#",schema:{allOf:r}}},mt=function(e){return{effect:"SHOW",condition:dt(e)}},ht=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!lt.includes(i.operator))throw new Error("Invalid operator '".concat(i.operator,"'"));if(!t.includes(i.field))throw new Error("Unknown field '".concat(i.field,"'"));if("CONTAINS"===i.operator&&(void 0===i.value||null===i.value))throw new Error("CONTAINS operator requires a value");if("INPUT_IS_EXACTLY"===i.operator&&void 0===i.value)throw new Error("INPUT_IS_EXACTLY operator requires a value")}},yt=function(e){return!e.deprecated},vt=function(e,t,r,n){var i,o={type:"Control",scope:"#/properties/".concat(e),label:t.title,options:{}};switch(r.type){case"TEXT":"LONG_TEXT"===r.inputType&&(o.options.multi=!0),r.placeholder&&(o.options.placeholder=r.placeholder);break;case"NUMERIC":o.options.format="number",r.placeholder&&(o.options.placeholder=r.placeholder);break;case"DATE_TIME":o.options.format=t.format||"date-time",o.options.display=t.format||"date-time";break;case"CHOICE_LIST":"array"===t.type?(o.options.multi=!0,"DROPDOWN"===r.inputType?o.options.format="dropdown":"LIST"===r.inputType&&(o.options.format="checkbox")):"DROPDOWN"===r.inputType?o.options.format="dropdown":"LIST"===r.inputType&&(o.options.format="radio"),r.placeholder&&(o.options.placeholder=r.placeholder);break;case"LOCATION":o.options.format="location",o.options.display="map";break;case"COLLECTION":o.options.format="array",o.options.addButtonText=r.buttonText||"Add Item",r.itemIdentifier&&(o.options.itemIdentifier=r.itemIdentifier),void 0!==t.maxItems&&(o.options.maxItems=t.maxItems),void 0!==t.minItems&&(o.options.minItems=t.minItems),"array"===t.type&&(null===(i=t.items)||void 0===i?void 0:i.properties)&&n&&(o.options.detail=Ot(t,r,n));break;case"ATTACHMENT":o.options.format="file",r.allowableFileTypes&&(o.options.accept=r.allowableFileTypes.join(","))}return t.description&&(o.options.description=t.description),o},bt=function(e,t){return{type:"Label",text:t.label,options:{size:t.size}}},gt=function(e){var t={},r=e.json.allOf;return Array.isArray(r)?(r.forEach((function(r){var n;(null===(n=r.then)||void 0===n?void 0:n.properties)&&Object.entries(r.then.properties).forEach((function(r){var n=r[0],i=r[1];e.json.properties[n]||(t[n]=i)}))})),t):t},Ot=function(e,t,r){var n;if("array"!==e.type||!(null===(n=e.items)||void 0===n?void 0:n.properties))throw new Error("Collection property must be an array with item properties");var i=e.items.properties,o=[],a=function(e,t){var n=r.ui.fields[e];if(n)return vt(e,t,n,r);var i={type:"Control",scope:"#/properties/".concat(e),label:t.title||e,options:{}};switch(t.type){case"string":"uri"===t.format&&(i.options.format="file",i.options.accept="image/*");break;case"number":i.options.format="number"}return t.description&&(i.options.description=t.description),i};return t&&(t.leftColumn||t.rightColumn)?(t.leftColumn&&t.leftColumn.forEach((function(e){i[e]&&o.push(a(e,i[e]))})),t.rightColumn&&t.rightColumn.forEach((function(e){i[e]&&o.push(a(e,i[e]))}))):Object.entries(i).forEach((function(e){var t=e[0],r=e[1];o.push(a(t,r))})),{type:"VerticalLayout",elements:o}},jt=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Et=function(e){!function(e){var t=[],r=["TEXT","NUMERIC","DATE_TIME","CHOICE_LIST","LOCATION","COLLECTION","ATTACHMENT"];Object.entries(e.json.properties).forEach((function(n){var i,o=n[0],a=n[1],c=e.ui.fields[o];if(c||!a.deprecated)if(c)if(r.includes(c.type)){if("CHOICE_LIST"===c.type){var s=!1;"array"===a.type&&(null===(i=a.items)||void 0===i?void 0:i.anyOf)?s=a.items.anyOf.some((function(e){return e.oneOf&&Array.isArray(e.oneOf)})):a.anyOf&&(s=a.anyOf.some((function(e){return e.oneOf&&Array.isArray(e.oneOf)}))),s||t.push("".concat(o,": CHOICE_LIST field requires embedded oneOf arrays - $ref not supported"))}}else t.push("".concat(o,": unsupported field type '").concat(c.type,"'"));else t.push("".concat(o,": missing UI field definition"))}));var n=gt(e),i=jt(jt([],Object.keys(e.json.properties),!0),Object.keys(n),!0);if(Object.entries(e.ui.sections).forEach((function(e){var r=e[0],n=e[1];if(n.conditions&&n.conditions.length>0)try{ht(n.conditions,i)}catch(e){t.push("Section '".concat(r,"': ").concat(e.message))}})),t.length>0)throw new Error("Invalid V2 schema structure: ".concat(t.join(", ")))}(e);var t,r,n,i=function(e){var t=[];Object.entries(e.json.properties).forEach((function(r){var n=r[0],i=r[1],o=e.ui.fields[n];yt(i)&&o&&t.push({name:n,property:i,uiField:o})}));var r=gt(e);return Object.entries(r).forEach((function(r){var n=r[0],i=r[1],o=e.ui.fields[n];yt(i)&&o&&t.push({name:n,property:i,uiField:o})})),t}(e),o=(t=i,r=e.ui.sections,n={},t.forEach((function(e){var t=e.uiField.parent;r[t]&&(n[t]||(n[t]=[]),n[t].push(e))})),n),a=[];return e.ui.order.forEach((function(t){var r=e.ui.sections[t],n=o[t]||[],i=n.length>0,c=jt(jt([],r.leftColumn,!0),r.rightColumn,!0).some((function(t){return"header"===t.type&&e.ui.headers[t.name]}));if((null==r?void 0:r.isActive)&&(i||c)){var s=function(e,t,r,n){var i={type:"VerticalLayout",label:t.label,elements:[]},o=[];return t.leftColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=bt(e.name,i);o.push(a)}}})),t.rightColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=bt(e.name,i);o.push(a)}}})),i.elements=o,t.conditions&&t.conditions.length>0&&(i.rule=mt(t.conditions)),i}(0,r,n.map((function(t){var r=t.name,n=t.property,i=t.uiField;return vt(r,n,i,e)})),e.ui.headers);a.push(s)}})),{type:"VerticalLayout",elements:a}},Tt=function(e){try{var t=JSON.parse(e),r=t.data||t;return r.json&&r.ui?{version:"v2",data:r}:(r.schema&&r.definition||r.schema&&r.ui,{version:"v1",data:r})}catch(e){throw new Error("Invalid JSON schema: ".concat(e instanceof Error?e.message:"Unknown error"))}},wt=function(e){var t=Tt(e),r=t.version,n=t.data;return{version:r,processedData:JSON.stringify(n)}};module.exports=t})();
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{void 0!==d&&d.toStringTag&&Object.defineProperty(e,d.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{detectSchemaVersion:()=>wt,generateUISchema:()=>ze,processSchema:()=>St,v1:()=>r,v2:()=>n,validateJSONSchema:()=>pt});var r={};e.r(r),e.d(r,{generateUISchema:()=>ze,validateJSONSchema:()=>pt});var n={};e.r(n),e.d(n,{buildConditionSchema:()=>dt,buildSchemaBasedCondition:()=>mt,createSectionRule:()=>ht,extractConditionalProperties:()=>Ot,generateUISchema:()=>Tt,validateConditions:()=>yt});var i=Object.prototype;const o=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)},a=(c=Object.keys,s=Object,function(e){return c(s(e))});var c,s,u=Object.prototype.hasOwnProperty;const p="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const f=p||l||Function("return this")();var d=f.Symbol;const m=d;var h=Object.prototype,y=h.hasOwnProperty,v=h.toString,b=m?m.toStringTag:void 0;var g=Object.prototype.toString;var O=m?m.toStringTag:void 0;const j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?function(e){var t=y.call(e,b),r=e[b];try{e[b]=void 0;var n=!0}catch(e){}var i=v.call(e);return n&&(t?e[b]=r:delete e[b]),i}(e):function(e){return g.call(e)}(e)},E=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},T=function(e){if(!E(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},w=f["__core-js_shared__"];var S,I=(S=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var A=Function.prototype.toString;const C=function(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var N=/^\[object .+?Constructor\]$/,k=Function.prototype,_=Object.prototype,x=k.toString,P=_.hasOwnProperty,L=RegExp("^"+x.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const M=function(e){return!(!E(e)||function(e){return!!I&&I in e}(e))&&(T(e)?L:N).test(C(e))},q=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return M(r)?r:void 0},D=q(f,"DataView"),U=q(f,"Map"),F=q(f,"Promise"),H=q(f,"Set"),R=q(f,"WeakMap");var V="[object Map]",$="[object Promise]",X="[object Set]",B="[object WeakMap]",J="[object DataView]",W=C(D),Y=C(U),z=C(F),G=C(H),K=C(R),Q=j;(D&&Q(new D(new ArrayBuffer(1)))!=J||U&&Q(new U)!=V||F&&Q(F.resolve())!=$||H&&Q(new H)!=X||R&&Q(new R)!=B)&&(Q=function(e){var t=j(e),r="[object Object]"==t?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case W:return J;case Y:return V;case z:return $;case G:return X;case K:return B}return t});const Z=Q,ee=function(e){return null!=e&&"object"==typeof e},te=function(e){return ee(e)&&"[object Arguments]"==j(e)};var re=Object.prototype,ne=re.hasOwnProperty,ie=re.propertyIsEnumerable;const oe=te(function(){return arguments}())?te:function(e){return ee(e)&&ne.call(e,"callee")&&!ie.call(e,"callee")},ae=Array.isArray,ce=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var se="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=se&&"object"==typeof module&&module&&!module.nodeType&&module,pe=ue&&ue.exports===se?f.Buffer:void 0;const le=(pe?pe.isBuffer:void 0)||function(){return!1};var fe={};fe["[object Float32Array]"]=fe["[object Float64Array]"]=fe["[object Int8Array]"]=fe["[object Int16Array]"]=fe["[object Int32Array]"]=fe["[object Uint8Array]"]=fe["[object Uint8ClampedArray]"]=fe["[object Uint16Array]"]=fe["[object Uint32Array]"]=!0,fe["[object Arguments]"]=fe["[object Array]"]=fe["[object ArrayBuffer]"]=fe["[object Boolean]"]=fe["[object DataView]"]=fe["[object Date]"]=fe["[object Error]"]=fe["[object Function]"]=fe["[object Map]"]=fe["[object Number]"]=fe["[object Object]"]=fe["[object RegExp]"]=fe["[object Set]"]=fe["[object String]"]=fe["[object WeakMap]"]=!1;var de="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=de&&"object"==typeof module&&module&&!module.nodeType&&module,he=me&&me.exports===de&&p.process,ye=function(){try{return me&&me.require&&me.require("util").types||he&&he.binding&&he.binding("util")}catch(e){}}(),ve=ye&&ye.isTypedArray;const be=ve?function(e){return function(t){return e(t)}}(ve):function(e){return ee(e)&&ce(e.length)&&!!fe[j(e)]};var ge=Object.prototype.hasOwnProperty;const Oe=function(e){if(null==e)return!0;if(function(e){return null!=e&&ce(e.length)&&!T(e)}(e)&&(ae(e)||"string"==typeof e||"function"==typeof e.splice||le(e)||be(e)||oe(e)))return!e.length;var t=Z(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(o(e))return!function(e){if(!o(e))return a(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e).length;for(var r in e)if(ge.call(e,r))return!1;return!0};var je,Ee,Te,we=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Se="fieldset",Ie="checkboxes",Ae="string";!function(e){e.DateTime="date-time",e.Date="date"}(je||(je={})),function(e){e.DateTime="date-time",e.MultiSelect="multiselect",e.RepeatableField="repeatable-field",e.FormLabel="form-label"}(Ee||(Ee={})),function(e){e.Header="header"}(Te||(Te={}));var Ce,Ne=function(e){var t=e.toLowerCase().replace(/[\s\\/\\%]/gi,"_");return"fieldset__title_".concat(t)},ke=function(e){return new Set(e).size!==e.length},_e=function(e){return qe(e)&&e.type===Ie},xe=function(e){return null==e||0===e.trim().length},Pe=function(e){return qe(e)&&e.type===Se&&!Oe(e.title)},Le=function(e){return qe(e)&&e.type===Se&&e.items.length>0},Me=function(e){var t,r;return e.type===Ae&&(null===(t=e.enum)||void 0===t?void 0:t.length)>0&&(null===(r=e.inactive_enum)||void 0===r?void 0:r.length)>0},qe=function(e){return e instanceof Object},De=function(e){return!Oe(e.key)},Ue=function(e){return 0!==e.length&&void 0!==e.find((function(e){return qe(e)&&e&&(e.type||"")===Se}))},Fe=function(e){return typeof e===Ae},He=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return e;var t=e.trim();if(""===t)return e;if(/^-?\d+,\d+$/.test(t)){var r=t.replace(",","."),n=parseFloat(r);if(!isNaN(n))return r}return e},Re=function(e,t,r){void 0===r&&(r=[]),"object"==typeof e&&null!==e&&(t(e,r),Array.isArray(e)?e.forEach((function(e,n){return Re(e,t,we(we([],r,!0),[n.toString()],!1))})):Object.entries(e).forEach((function(e){var n=e[0],i=e[1];return Re(i,t,we(we([],r,!0),[n],!1))})))},Ve=function(e){return e.includes(Ie)},$e=function(e){return e.includes("inactive_enum")},Xe=function(e){return e.includes("inactive_titleMap")},Be=function(e){return e.includes("enum")},Je=function(){return Je=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Je.apply(this,arguments)};!function(e){e.Number="number",e.String="string",e.Array="array"}(Ce||(Ce={}));var We=function(e,t,r){return void 0===r&&(r={}),Je({type:"Control",scope:"#/properties/".concat(e),label:t},r&&{options:r})},Ye=function(e,t,r){void 0===r&&(r=void 0);try{var n=r||t.definition.find((function(t){return t.key===e}));if("date-time-picker json-schema"===n.fieldHtmlClass||n&&"datetime"===(n.type||""))return"date"===t.schema.properties[e].format?je.Date:je.DateTime;if("date-picker json-schema"===n.fieldHtmlClass||"date"===t.schema.properties[e].format)return je.Date}catch(e){return}},ze=function(e){var t=[];return Ue(e.definition)?t.push.apply(t,Ge(e)):Object.keys(e.schema.properties).forEach((function(r){var n=Qe(r,e);Oe(n)||t.push(n)})),{type:"Category",elements:t}},Ge=function(e){var t=[];return e.definition.forEach((function(r){if("string"==typeof r)t.push(We(r,e.schema.properties[r].title||""));else if(r instanceof Object)switch(!0){case function(e){return qe(e)&&e.type===Se&&0===e.items.length&&!Oe(e.title)}(r):t.push(We(Ne(r.title),r.title,Ke(Ee.FormLabel)));break;case Le(r):r.title&&t.push(We(Ne(r.title),r.title,Ke(Ee.FormLabel))),r.items.forEach((function(r){if(r instanceof Object){var n=Qe(r.key||"",e,r);n&&t.push(n)}else if("string"==typeof r){var i=Qe(r,e);i&&t.push(i)}}));break;case De(r):var n=Qe(r.key,e);n&&t.push(n)}})),t},Ke=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),Oe(e))return{};var r={format:e};return Oe(t)||(r.display=t),r},Qe=function(e,t,r){void 0===r&&(r=void 0);var n={};switch(t.schema.properties[e].type){case Ce.Number:return We(e,t.schema.properties[e].title||"");case Ce.String:var i=Ye(e,t,r);return xe(i)?t.schema.properties[e].display&&t.schema.properties[e].display===Te.Header&&(n=Ke(Ee.FormLabel)):n=Ke(Ee.DateTime,i),We(e,t.schema.properties[e].title||"",n);case Ce.Array:return t.schema.properties[e].items.enum&&t.schema.properties[e].items.enumNames?n=Ke(Ee.MultiSelect):t.schema.properties[e].items&&(n=Ke(Ee.RepeatableField)),We(e,t.schema.properties[e].title||"",n);case void 0:var o=function(e,t){try{var r=t.definition.find((function(t){return t.key===e}));return"json-schema-checkbox-wrapper"===r.fieldHtmlClass||"checkboxes"===r.type?r:void 0}catch(e){return}}(e,t);return o?(n=Ke(Ee.MultiSelect),We(e,o.title||"",n)):(i=Ye(e,t,r),xe(i)?void 0:(n=Ke(Ee.DateTime,i),We(e,t.schema.properties[e].title||"",n)))}},Ze=function(){return Ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ze.apply(this,arguments)},et=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},tt=/[^\w\n\s_"](?=[^:\n\s{}[]]*:[\t\n\s]*(\{|\[)+)/g,rt=/"minimum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,nt=/"maximum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,it=/"(?=[^"]*(?:"[^"]*)?$)/g,ot=function(e){return{type:"string",readOnly:!0,isHidden:!1,display:Te.Header,title:e}},at=function(e){return(null==e?void 0:e.isHidden)||!1},ct=function(e){return e.enum.filter((function(t){return!e.inactive_enum.includes(t)}))},st=function(e){return e.titleMap.filter((function(t){return!e.inactive_titleMap.includes(t.value)}))},ut=function(e,t,r,n){var i,o,a,c,s=e.hasCheckboxes,u=e.hasDisabledChoices;if(Fe(t)&&r.schema.properties[t])r.schema.properties[t].isHidden=at(r.schema.properties[t]);else{if((qe(t)||De(t))&&t.key&&r.schema.properties[t.key]&&(r.schema.properties[t.key].isHidden=at(r.schema.properties[t.key])),u&&function(e){var t,r;return qe(e)&&e.type===Ie&&(null===(t=e.inactive_titleMap)||void 0===t?void 0:t.length)>0&&(null===(r=e.titleMap)||void 0===r?void 0:r.length)>0}(t))if(n){var p=r.definition.indexOf(n),l=r.definition[p].items.indexOf(t);r.definition[p].items[l].titleMap=st(t)}else r.definition[r.definition.indexOf(t)].titleMap=st(t);s&&_e(t)&&(r.schema.properties[t.key]=(i=t,o=r.schema.properties[t.key].title||"",a=r.schema.properties[t.key].required||!1,c=r.schema.properties[t.key].default||!1,Ze(Ze(Ze({type:"array",uniqueItems:!0,isHidden:!1},a&&{required:a}),{title:o||i.title,items:{enum:i.titleMap.map((function(e){return e.value})),enumNames:i.titleMap.map((function(e){return e.name}))}}),c&&{default:c})))}},pt=function(e){var t;e=function(e){if(null!==e.match(tt))throw Error("Special characters not supported in JSON Schema");return(e=(e=(e=(e=(e=e.replace(/([“”])/g,'"')).replace(new RegExp('\\"enum\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"enum": ["0"]')).replace(new RegExp('\\"enumNames\\"\\n*\\s*\\:\\n*\\s*\\{\\n*\\s*\\}',"g"),'"enumNames": {"0":"No Options"}')).replace(new RegExp('\\"titleMap\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"titleMap": [{"value":"no_option", "name":"No Option"}]')).replace(rt,(function(e){return e.replace(it,"")}))).replace(nt,(function(e){return e.replace(it,"")}))}(e);var r=JSON.parse(e);delete r.schema.$schema,delete r.schema.id,function(e){if(e.schema.definition){var t=e.schema.definition;delete e.schema.definition,e.definition=t}}(r);var n=function(e){return{hasCheckboxes:Ve(e),hasInactiveChoices:$e(e),hasDisabledChoices:Xe(e),hasEnums:Be(e)}}(e);if(function(e){Re(e,(function(e){"object"===e.type&&e.properties&&Object.entries(e.properties).forEach((function(e){var t=e[1];"number"===t.type&&(void 0!==t.default&&(t.default=He(t.default)),void 0!==t.minimum&&(t.minimum=He(t.minimum)),void 0!==t.maximum&&(t.maximum=He(t.maximum)))}))}))}(r.schema),function(e,t){var r=e.hasInactiveChoices,n=e.hasEnums;if(r)for(var i=0,o=Object.keys(t.schema.properties);i<o.length;i++){var a=o[i],c=t.schema.properties[a];Me(c)&&(t.schema.properties[a].enum=ct(c),Oe(t.schema.properties[a].enum)&&(t.schema.properties[a].enum=["0"],t.schema.properties[a].enumNames={0:"No Options"}))}if(n)for(var s=0,u=Object.keys(t.schema.properties);s<u.length;s++)if(a=u[s],!Oe(t.schema.properties[a].enum)&&ke(t.schema.properties[a].enum))throw new Error("Duplicated enum items")}(n,r),function(e,t){var r;if(Ue(t.definition))!function(e,t){for(var r=0,n=t.definition;r<n.length;r++){var i=n[r];switch(!0){case Fe(i):break;case Pe(i):var o=Ne(i.title);t.schema.properties[o]=ot(i.title);break;case Le(i):for(var a=0,c=i.items;a<c.length;a++){var s=c[a];ut(e,s,t,i)}break;case _e(i):ut(e,i,t)}}}(e,t);else if((null===(r=t.definition)||void 0===r?void 0:r.length)>0)for(var n=0,i=t.definition;n<i.length;n++){var o=i[n];ut(e,o,t)}}(n,r),e.includes("helpvalue")&&function(e){for(var t={},r=0,n=0,i=e.definition;n<i.length;n++){var o=i[n];if(Fe(o))t[o]=e.schema.properties[o],delete e.schema.properties[o];else if(qe(o))if(o.helpvalue){var a="help_value_".concat(r);r+=1,t[a]=ot((o.helpvalue||"").replace(/(<.+?>)/g,""))}else o.key&&(t[o.key]=e.schema.properties[o.key],delete e.schema.properties[o.key])}e.schema.properties=Object.assign(t,e.schema.properties)}(r),e.includes("required")){if((null===(t=r.schema.required)||void 0===t?void 0:t.length)>0&&ke(r.schema.required))throw new Error("Duplicated required properties");r.schema=function(e){var t=Array.isArray(e.required)?et([],e.required,!0):null;return Re(e,(function(e,r){if("object"===e.type&&e.properties){var n=[];if(Object.entries(e.properties).forEach((function(e){var t=e[0],r=e[1];(function(e){return"true"===e.required||e.required>0})(r)&&(n.push(t),delete r.required)})),Oe(n))r.length>0&&e.required&&delete e.required;else if(0===r.length&&t){var i=et(et([],t,!0),n,!0);e.required=Array.from(new Set(i))}else e.required=n}})),e}(r.schema)}return r},lt=["CONTAINS","DOES_NOT_HAVE_INPUT","HAS_INPUT","INPUT_IS_EXACTLY"],ft=function(e){switch(e.operator){case"CONTAINS":if(void 0===e.value||null===e.value)throw new Error("CONTAINS operator requires a value for condition '".concat(e.id,"'"));return{pattern:String(e.value),type:"string"};case"DOES_NOT_HAVE_INPUT":return{anyOf:[{not:{}},{type:"array",maxItems:0},{type:"object",maxProperties:0},{type:"string",maxLength:0},{type:"null"}]};case"HAS_INPUT":return{allOf:[{not:{type:"null"}},{anyOf:[{type:"array",minItems:1},{type:"boolean"},{type:"number"},{type:"object",minProperties:1},{type:"string",minLength:1}]}]};case"INPUT_IS_EXACTLY":if(void 0===e.value)throw new Error("INPUT_IS_EXACTLY operator requires a value for condition '".concat(e.id,"'"));return function(e){if("boolean"==typeof e)return{const:e,type:"boolean"};if("number"==typeof e)return{anyOf:[{const:e,type:"number"},{const:String(e),type:"string"}]};if(null===e)return{type:"null"};var t=Number(e);return isNaN(t)||""===e?{const:e,type:"string"}:{anyOf:[{const:t,type:"number"},{const:e,type:"string"}]}}(e.value);default:throw new Error("Unknown operator '".concat(e.operator,"' in condition '").concat(e.id,"'"))}},dt=function(e){var t,r=ft(e);return{properties:(t={},t[e.field]=r,t),required:[e.field]}},mt=function(e){if(0===e.length)throw new Error("At least one condition is required");if(1===e.length){var t=e[0];return{scope:"#/properties/".concat(t.field),schema:ft(t)}}var r=e.map((function(e){return dt(e)}));return{scope:"#",schema:{allOf:r}}},ht=function(e){return{effect:"SHOW",condition:mt(e)}},yt=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!lt.includes(i.operator))throw new Error("Invalid operator '".concat(i.operator,"'"));if(!t.includes(i.field))throw new Error("Unknown field '".concat(i.field,"'"));if("CONTAINS"===i.operator&&(void 0===i.value||null===i.value))throw new Error("CONTAINS operator requires a value");if("INPUT_IS_EXACTLY"===i.operator&&void 0===i.value)throw new Error("INPUT_IS_EXACTLY operator requires a value")}},vt=function(e){return!e.deprecated},bt=function(e,t,r,n){var i,o={type:"Control",scope:"#/properties/".concat(e),label:t.title,options:{}};switch(r.type){case"TEXT":"LONG_TEXT"===r.inputType&&(o.options.multi=!0),r.placeholder&&(o.options.placeholder=r.placeholder);break;case"NUMERIC":o.options.format="number",r.placeholder&&(o.options.placeholder=r.placeholder);break;case"DATE_TIME":o.options.format=t.format||"date-time",o.options.display=t.format||"date-time";break;case"CHOICE_LIST":"array"===t.type?(o.options.multi=!0,"DROPDOWN"===r.inputType?o.options.format="dropdown":"LIST"===r.inputType&&(o.options.format="checkbox")):"DROPDOWN"===r.inputType?o.options.format="dropdown":"LIST"===r.inputType&&(o.options.format="radio"),r.placeholder&&(o.options.placeholder=r.placeholder);break;case"LOCATION":o.options.format="location",o.options.display="map";break;case"COLLECTION":o.options.format="array",o.options.addButtonText=r.buttonText||"Add Item",r.itemIdentifier&&(o.options.itemIdentifier=r.itemIdentifier),void 0!==t.maxItems&&(o.options.maxItems=t.maxItems),void 0!==t.minItems&&(o.options.minItems=t.minItems),"array"===t.type&&(null===(i=t.items)||void 0===i?void 0:i.properties)&&n&&(o.options.detail=jt(t,r,n));break;case"ATTACHMENT":o.options.format="file",r.allowableFileTypes&&(o.options.accept=r.allowableFileTypes.join(","))}return t.description&&(o.options.description=t.description),o},gt=function(e,t){return{type:"Label",text:t.label,options:{size:t.size}}},Ot=function(e){var t={},r=e.json.allOf;return Array.isArray(r)?(r.forEach((function(r){var n;(null===(n=r.then)||void 0===n?void 0:n.properties)&&Object.entries(r.then.properties).forEach((function(r){var n=r[0],i=r[1];e.json.properties[n]||(t[n]=i)}))})),t):t},jt=function(e,t,r){var n;if("array"!==e.type||!(null===(n=e.items)||void 0===n?void 0:n.properties))throw new Error("Collection property must be an array with item properties");var i=e.items.properties,o=[],a=function(e,t){var n=r.ui.fields[e];if(n)return bt(e,t,n,r);var i={type:"Control",scope:"#/properties/".concat(e),label:t.title||e,options:{}};switch(t.type){case"string":"uri"===t.format&&(i.options.format="file",i.options.accept="image/*");break;case"number":i.options.format="number"}return t.description&&(i.options.description=t.description),i};return t&&(t.leftColumn||t.rightColumn)?(t.leftColumn&&t.leftColumn.forEach((function(e){i[e]&&o.push(a(e,i[e]))})),t.rightColumn&&t.rightColumn.forEach((function(e){i[e]&&o.push(a(e,i[e]))}))):Object.entries(i).forEach((function(e){var t=e[0],r=e[1];o.push(a(t,r))})),{type:"VerticalLayout",elements:o}},Et=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Tt=function(e){!function(e){var t=[],r=["TEXT","NUMERIC","DATE_TIME","CHOICE_LIST","LOCATION","COLLECTION","ATTACHMENT"];Object.entries(e.json.properties).forEach((function(n){var i,o=n[0],a=n[1],c=e.ui.fields[o];if(c||!a.deprecated)if(c)if(r.includes(c.type)){if("CHOICE_LIST"===c.type){var s=!1;"array"===a.type&&(null===(i=a.items)||void 0===i?void 0:i.anyOf)?s=a.items.anyOf.some((function(e){return e.oneOf&&Array.isArray(e.oneOf)})):a.anyOf&&(s=a.anyOf.some((function(e){return e.oneOf&&Array.isArray(e.oneOf)}))),s||t.push("".concat(o,": CHOICE_LIST field requires embedded oneOf arrays - $ref not supported"))}}else t.push("".concat(o,": unsupported field type '").concat(c.type,"'"));else t.push("".concat(o,": missing UI field definition"))}));var n=Ot(e),i=Et(Et([],Object.keys(e.json.properties),!0),Object.keys(n),!0);if(Object.entries(e.ui.sections).forEach((function(e){var r=e[0],n=e[1];if(n.conditions&&n.conditions.length>0)try{yt(n.conditions,i)}catch(e){t.push("Section '".concat(r,"': ").concat(e.message))}})),t.length>0)throw new Error("Invalid V2 schema structure: ".concat(t.join(", ")))}(e);var t,r,n,i=function(e){var t=[];Object.entries(e.json.properties).forEach((function(r){var n=r[0],i=r[1],o=e.ui.fields[n];vt(i)&&o&&t.push({name:n,property:i,uiField:o})}));var r=Ot(e);return Object.entries(r).forEach((function(r){var n=r[0],i=r[1],o=e.ui.fields[n];vt(i)&&o&&t.push({name:n,property:i,uiField:o})})),t}(e),o=(t=i,r=e.ui.sections,n={},t.forEach((function(e){var t=e.uiField.parent;r[t]&&(n[t]||(n[t]=[]),n[t].push(e))})),n),a=[];return e.ui.order.forEach((function(t){var r=e.ui.sections[t],n=o[t]||[],i=n.length>0,c=Et(Et([],r.leftColumn,!0),r.rightColumn,!0).some((function(t){return"header"===t.type&&e.ui.headers[t.name]}));if((null==r?void 0:r.isActive)&&(i||c)){var s=function(e,t,r,n){var i={type:"VerticalLayout",label:t.label,elements:[]},o=[];return t.leftColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=gt(e.name,i);o.push(a)}}})),t.rightColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=gt(e.name,i);o.push(a)}}})),i.elements=o,t.conditions&&t.conditions.length>0&&(i.rule=ht(t.conditions)),i}(0,r,n.map((function(t){var r=t.name,n=t.property,i=t.uiField;return bt(r,n,i,e)})),e.ui.headers);a.push(s)}})),{type:"VerticalLayout",elements:a}},wt=function(e){try{var t=JSON.parse(e),r=t.data||t;return r.json&&r.ui?{version:"v2",data:r}:(r.schema&&r.definition||r.schema&&r.ui,{version:"v1",data:r})}catch(e){throw new Error("Invalid JSON schema: ".concat(e instanceof Error?e.message:"Unknown error"))}},St=function(e){var t=wt(e),r=t.version,n=t.data;return{version:r,processedData:JSON.stringify(n)}};module.exports=t})();
|
package/dist/v2/conditions.d.ts
CHANGED
|
@@ -19,13 +19,23 @@ export declare const buildHasInputSchema: () => Record<string, unknown>;
|
|
|
19
19
|
* Matches when the field value equals the specified value exactly.
|
|
20
20
|
*/
|
|
21
21
|
export declare const buildInputIsExactlySchema: (value: string | number | boolean | null) => Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the operator schema for a condition (without field wrapper).
|
|
24
|
+
* Used internally by buildConditionSchema and buildSchemaBasedCondition.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getOperatorSchema: (condition: V2Condition) => Record<string, unknown>;
|
|
22
27
|
/**
|
|
23
28
|
* Builds a JSON Schema for a single condition based on its operator.
|
|
29
|
+
* Wraps the operator schema in a properties structure for root scope validation.
|
|
24
30
|
*/
|
|
25
31
|
export declare const buildConditionSchema: (condition: V2Condition) => Record<string, unknown>;
|
|
26
32
|
/**
|
|
27
33
|
* Builds a JSONForms schema-based condition from one or more V2 conditions.
|
|
28
|
-
*
|
|
34
|
+
*
|
|
35
|
+
* For single conditions: Uses field-specific scope (e.g., "#/properties/fieldName")
|
|
36
|
+
* which is the standard JSONForms pattern and most reliable across implementations.
|
|
37
|
+
*
|
|
38
|
+
* For multiple conditions: Uses root scope "#" with allOf combining property schemas.
|
|
29
39
|
*/
|
|
30
40
|
export declare const buildSchemaBasedCondition: (conditions: V2Condition[]) => JSONFormsSchemaBasedCondition;
|
|
31
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/v2/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,aAAa,EACb,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,OAAO,MAAM,EAAE,OAAO,CAKzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAO,OAAO,MAAM,EAAE,OAAO,CAUpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,OAAO,MAAM,EAAE,OAAO,CAe5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,UAC7B,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,KACtC,OAAO,MAAM,EAAE,OAAO,CA2BxB,CAAC;AASF
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/v2/conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,aAAa,EACb,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,OAAO,MAAM,EAAE,OAAO,CAKzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAO,OAAO,MAAM,EAAE,OAAO,CAUpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,OAAO,MAAM,EAAE,OAAO,CAe5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,UAC7B,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,KACtC,OAAO,MAAM,EAAE,OAAO,CA2BxB,CAAC;AASF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,cACjB,WAAW,KACrB,OAAO,MAAM,EAAE,OAAO,CA6BxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,cACpB,WAAW,KACrB,OAAO,MAAM,EAAE,OAAO,CAUxB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,eACxB,WAAW,EAAE,KACxB,6BAyBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,eAAgB,WAAW,EAAE,KAAG,aAK7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eACjB,WAAW,EAAE,cACb,MAAM,EAAE,KACnB,IA2BF,CAAC"}
|
package/dist/v2/conditions.js
CHANGED
|
@@ -82,34 +82,37 @@ var VALID_OPERATORS = [
|
|
|
82
82
|
'INPUT_IS_EXACTLY',
|
|
83
83
|
];
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Gets the operator schema for a condition (without field wrapper).
|
|
86
|
+
* Used internally by buildConditionSchema and buildSchemaBasedCondition.
|
|
86
87
|
*/
|
|
87
|
-
export var
|
|
88
|
-
var _a;
|
|
89
|
-
var operatorSchema;
|
|
88
|
+
export var getOperatorSchema = function (condition) {
|
|
90
89
|
switch (condition.operator) {
|
|
91
90
|
case 'CONTAINS':
|
|
92
91
|
if (condition.value === undefined || condition.value === null) {
|
|
93
92
|
throw new Error("CONTAINS operator requires a value for condition '".concat(condition.id, "'"));
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
break;
|
|
94
|
+
return buildContainsSchema(String(condition.value));
|
|
97
95
|
case 'DOES_NOT_HAVE_INPUT':
|
|
98
|
-
|
|
99
|
-
break;
|
|
96
|
+
return buildDoesNotHaveInputSchema();
|
|
100
97
|
case 'HAS_INPUT':
|
|
101
|
-
|
|
102
|
-
break;
|
|
98
|
+
return buildHasInputSchema();
|
|
103
99
|
case 'INPUT_IS_EXACTLY':
|
|
104
100
|
if (condition.value === undefined) {
|
|
105
101
|
throw new Error("INPUT_IS_EXACTLY operator requires a value for condition '".concat(condition.id, "'"));
|
|
106
102
|
}
|
|
107
|
-
|
|
108
|
-
break;
|
|
103
|
+
return buildInputIsExactlySchema(condition.value);
|
|
109
104
|
default:
|
|
110
105
|
throw new Error("Unknown operator '".concat(condition.operator, "' in condition '").concat(condition.id, "'"));
|
|
111
106
|
}
|
|
112
|
-
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Builds a JSON Schema for a single condition based on its operator.
|
|
110
|
+
* Wraps the operator schema in a properties structure for root scope validation.
|
|
111
|
+
*/
|
|
112
|
+
export var buildConditionSchema = function (condition) {
|
|
113
|
+
var _a;
|
|
114
|
+
var operatorSchema = getOperatorSchema(condition);
|
|
115
|
+
// Wrap in properties structure for the field (used with scope: "#")
|
|
113
116
|
return {
|
|
114
117
|
properties: (_a = {},
|
|
115
118
|
_a[condition.field] = operatorSchema,
|
|
@@ -119,20 +122,25 @@ export var buildConditionSchema = function (condition) {
|
|
|
119
122
|
};
|
|
120
123
|
/**
|
|
121
124
|
* Builds a JSONForms schema-based condition from one or more V2 conditions.
|
|
122
|
-
*
|
|
125
|
+
*
|
|
126
|
+
* For single conditions: Uses field-specific scope (e.g., "#/properties/fieldName")
|
|
127
|
+
* which is the standard JSONForms pattern and most reliable across implementations.
|
|
128
|
+
*
|
|
129
|
+
* For multiple conditions: Uses root scope "#" with allOf combining property schemas.
|
|
123
130
|
*/
|
|
124
131
|
export var buildSchemaBasedCondition = function (conditions) {
|
|
125
132
|
if (conditions.length === 0) {
|
|
126
133
|
throw new Error('At least one condition is required');
|
|
127
134
|
}
|
|
128
135
|
if (conditions.length === 1) {
|
|
136
|
+
// Single condition: use field-specific scope for better compatibility
|
|
129
137
|
var condition = conditions[0];
|
|
130
138
|
return {
|
|
131
|
-
scope:
|
|
132
|
-
schema:
|
|
139
|
+
scope: "#/properties/".concat(condition.field),
|
|
140
|
+
schema: getOperatorSchema(condition),
|
|
133
141
|
};
|
|
134
142
|
}
|
|
135
|
-
// Multiple conditions:
|
|
143
|
+
// Multiple conditions: use root scope with allOf
|
|
136
144
|
var allOfSchemas = conditions.map(function (condition) {
|
|
137
145
|
return buildConditionSchema(condition);
|
|
138
146
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/v2/conditions.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,KAAa;IAC/C,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,IAAM,2BAA2B,GAAG;IACzC,OAAO;QACL,KAAK,EAAE;YACL,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,yBAAyB;YACtC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,cAAc;YAC9C,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,eAAe;YACrD,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,eAAe;YACjD,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa;SAChC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,OAAO;QACL,KAAK,EAAE;YACL,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;YACzB;gBACE,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;oBAC9B,EAAE,IAAI,EAAE,SAAS,EAAE;oBACnB,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAClB,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