From 0e4e170ac281ad5b1f5d0cca8c7889e3dc75b62a Mon Sep 17 00:00:00 2001 From: carlosr Date: Tue, 26 Jan 2021 15:20:28 +0100 Subject: [PATCH] build --- dist/ds-browser.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/ds-browser.min.js b/dist/ds-browser.min.js index 3268733..3f79f8a 100644 --- a/dist/ds-browser.min.js +++ b/dist/ds-browser.min.js @@ -274,7 +274,7 @@ var nextTick=require("process/browser.js").nextTick,apply=Function.prototype.app "use strict";class NativeRenderer{constructor(e){this.browser=e,this.util=e.util,this.dsHandler=e.dsHandler,this.dsRenderer=e.dsRenderer}render(){this.dsNode=this.browser.dsNode,this.node=this.dsNode.node;var e=this.dsRenderer.createHeader()+this.dsRenderer.createViewModeSelectors(this.dsRenderer.MODES.native)+("Class"===this.dsNode.type?this.createClassPropertyTable():this.createEnumerationMembers());this.browser.elem.innerHTML=this.util.createMainContent("rdfs:Class",e)}createClassPropertyTable(){var e=(this.browser.path?this.node["sh:node"]["sh:property"].slice(0):this.node["sh:property"].slice(0)).map(e=>this.createClassProperty(e)).join("");return this.util.createDefinitionTable(["Property","Expected Type","Description","Cardinality"],e,{style:"margin-top: 0px; border-top: none;"})}createClassProperty(e){var r=e["sh:path"],t=this.browser.sdoAdapter.getProperty(r);return this.util.createTableRow("rdf:Property",t.getIRI(),"rdfs:label",this.util.createTermLink(r),this.createClassPropertySideCols(e),"prop-name")}createClassPropertySideCols(e){return''+this.createExpectedTypes(e)+''+this.createClassPropertyDescText(e)+''+this.dsHandler.createCardinality(e["sh:minCount"],e["sh:minCount"])+""}createClassPropertyDescText(e){var r=this.util.prettyPrintIri(e["sh:path"]),t="";try{t=this.browser.sdoAdapter.getProperty(r).getDescription()}catch(e){}var s=e["rdfs:comment"]?e["rdfs:comment"]:"",i="";return""!==t&&(""!==s&&(i+="From Vocabulary: "),i+=t),""!==s&&(""!==t&&(i+="
From Domain Specification: "),i+=s),this.util.repairLinksInHTMLCode(i)}createExpectedTypes(e){var r=this.browser.sdoAdapter.getProperty(e["sh:path"]),t=this.util.prettyPrintIri(r.getIRI(!0));return e["sh:or"].map(e=>{var r;e["sh:datatype"]?r=e["sh:datatype"]:e["sh:class"]&&(r=e["sh:class"]);var s=this.dsHandler.dataTypeMapperFromSHACL(r);if(null!==s)return this.util.createLink(s);if(r=this.dsHandler.rangesToString(r),e["sh:node"]&&0!==e["sh:node"]["sh:property"].length){var i=t+"-"+r;return this.util.createJSLink("path",i,r,null,"-")}return this.util.createTermLink(r)}).join("
")}createEnumerationMembers(){var e=this.browser.sdoAdapter.getTerm(this.node["sh:class"]).getEnumerationMembers();return 0!==e.length?'An Enumeration with:
Enumeration members
":""}}module.exports=NativeRenderer; },{}],89:[function(require,module,exports){ -"use strict";class TableRenderer{constructor(e){this.browser=e,this.util=e.util,this.dsHandler=e.dsHandler,this.dsRenderer=e.dsRenderer,this.clickHandler=null,this.changeInnerDSHandler=null}render(){var e=this.dsHandler.generateDsClass(this.browser.ds["@graph"][0],!1,!1),t=this.dsRenderer.createHeader()+this.dsRenderer.createViewModeSelectors(this.dsRenderer.MODES.table)+'
'+this.dsRenderer.createVisBtnRow()+'
'+this.createTableContent(e)+"
";this.browser.elem.innerHTML=this.util.createMainContent("rdfs:Class",t),this.addClickEvent(),this.addChangeInnerDSEventListener()}createTableContent(e){return'
'+e.text+'
'+e.data.dsDescription+"Cardinality"+this.processProperties(e.children,0)}processProperties(e,t,s,n){return e.map((r,a)=>r.children&&0!==r.children.length&&!r.isEnum?this.processPropertyWithChildren(r,t,s):this.processPropertyWithNoChildren(r,t,s,n,e.length===a+1)).join("")}processPropertyWithChildren(e,t){var s,n="";if(++t<4){s="depth"+t+" innerTable";var r=e.data.dsRange.split(" or "),a=this.hasMultipleClasses(r),i=this.createDSRange(e,t,r,a),d=e.children;n+=""+this.createTdProperty(e)+''+this.createInnerTableHeader(i,e)+d.map((e,s)=>this.processProperties(e.children,t,s,a)).join("")+'
'+this.dsHandler.createCardinality(e.data.minCount,e.data.maxCount)+""}else console.log("To many levels for table view. Level: "+t);return n}hasMultipleClasses(e){var t=0;for(var s of e)if(this.isClass(s)&&2===++t)return!0;return!1}isClass(e){var t=this.cleanTerm(e);return!["Text","Number","URL","Boolean"].includes(t)}createDSRange(e,t,s){var n=!1;return""+s.map((e,t)=>{var r=this.cleanTerm(e),a=this.isClass(r),i=t+1":"",d=n&&a?' class="change-to-class"':"";return a?(n=!0,''+r+""+i+""):r+i}).join("")}cleanTerm(e){return e.replace("","").replace("","").replace(/ /g,"")}createTdProperty(e){return"1&&void 0!==arguments[1]?arguments[1]:"")+'>
'+e.text+"
"}createInnerTableHeader(e,t){return''+e+''+t.data.dsDescription+"Cardinality"}processPropertyWithNoChildren(e,t,s,n,r){var a=this.dsHandler.createCardinality(e.data.minCount,e.data.maxCount),i=r?' style="border-bottom: none !important;"':"";return'"+this.createTdProperty(e,i)+(e.isEnum?this.createEnum(e,t,i):this.createSimpleType(e,i))+'"+a+""}createEnum(e,t,s){return'"+(e.data.enuMembers?this.genHTML_enuMembers(e.data.enuMembers):"")+"
'+e.data.dsRange+''+e.data.dsDescription+"
"}genHTML_enuMembers(e){return e.map(e=>''+e.name+''+e.description+"").join("")}createSimpleType(e,t){return""+e.data.dsRange+""+e.data.dsDescription+""}addClickEvent(){var e=document.getElementById("table-view").getElementsByClassName("btn-vis-shadow")[0];this.clickHandler=this.clickEvent.bind(this),e.addEventListener("click",this.clickHandler,!0)}clickEvent(e){var t,s,n=e.target;n.removeEventListener("click",this.clickHandler,!0),n.classList.remove("btn-vis-shadow"),"btn-opt"===n.id?(t=document.getElementById("btn-man"),s=!0):(t=document.getElementById("btn-opt"),s=!1),t.classList.add("btn-vis-shadow");var r=this.dsHandler.generateDsClass(this.browser.ds["@graph"][0],!1,s),a=document.getElementById("table-ds");a.innerHTML=this.createTableContent(r),this.util.fade(a),this.addClickEvent(),this.addChangeInnerDSEventListener()}addChangeInnerDSEventListener(){var e=document.getElementById("table-view").getElementsByClassName("change-to-class");for(var t of(this.changeInnerDSHandler=this.changeInnerDSEvent.bind(this),e))t.addEventListener("click",this.changeInnerDSHandler,!0)}changeInnerDSEvent(e){for(var t=e.target,s=t.closest("tr"),n=t.dataset.innerdsindex;s.nextSibling;)(s=s.nextSibling).dataset.innerdsindex===n?(s.style.display="table-row",this.util.fade(s)):s.style.display="none";var r=t.closest("td").querySelector("b:not(.change-to-class)");r.classList.add("change-to-class"),r.addEventListener("click",this.changeInnerDSHandler,!0),t.classList.remove("change-to-class"),t.removeEventListener("click",this.changeInnerDSHandler,!0)}}module.exports=TableRenderer; +"use strict";class TableRenderer{constructor(e){this.browser=e,this.util=e.util,this.dsHandler=e.dsHandler,this.dsRenderer=e.dsRenderer,this.clickHandler=null,this.changeInnerDSHandler=null}render(){var e=this.dsHandler.generateDsClass(this.browser.ds["@graph"][0],!1,!1),t=this.dsRenderer.createHeader()+this.dsRenderer.createViewModeSelectors(this.dsRenderer.MODES.table)+'
'+this.dsRenderer.createVisBtnRow()+'
'+this.createTableContent(e)+"
";this.browser.elem.innerHTML=this.util.createMainContent("rdfs:Class",t),this.addClickEvent(),this.addChangeInnerDSEventListener()}createTableContent(e){return'
'+e.text+'
'+e.data.dsDescription+"Cardinality"+this.processProperties(e.children,0)}processProperties(e,t,s,n){return e.map((a,r)=>a.children&&0!==a.children.length&&!a.isEnum?this.processPropertyWithChildren(a,t,s):this.processPropertyWithNoChildren(a,t,s,n,e.length===r+1)).join("")}processPropertyWithChildren(e,t){var s,n="";if(++t<4){s="depth"+t+" innerTable";var a=e.data.dsRange.split(" or "),r=this.hasMultipleClasses(a),i=this.createDSRange(e,t,a,r),d=e.children;n+=""+this.createTdProperty(e)+''+this.createInnerTableHeader(i,e)+d.map((e,s)=>this.processProperties(e.children,t,s,r)).join("")+'
'+this.dsHandler.createCardinality(e.data.minCount,e.data.maxCount)+""}else console.log("To many levels for table view. Level: "+t);return n}hasMultipleClasses(e){var t=0;for(var s of e)if(this.isClass(s)&&2===++t)return!0;return!1}isClass(e){var t=this.cleanTerm(e);return!["Text","Number","URL","Boolean"].includes(t)}createDSRange(e,t,s){var n=!1;return""+s.map((e,t)=>{var a=this.cleanTerm(e),r=this.isClass(a),i=t+1":"",d=n&&r?' class="change-to-class"':"";return r?(n=!0,''+a+""+i+""):a+i}).join("")}cleanTerm(e){return e.replace("","").replace("","").replace(/ /g,"")}createTdProperty(e){return"1&&void 0!==arguments[1]?arguments[1]:"")+'>
'+e.text+"
"}createInnerTableHeader(e,t){return''+e+''+t.data.dsDescription+"Cardinality"}processPropertyWithNoChildren(e,t,s,n,a){var r=this.dsHandler.createCardinality(e.data.minCount,e.data.maxCount),i=a?' style="border-bottom: none !important;"':"";return'"+this.createTdProperty(e,i)+(e.isEnum?this.createEnum(e,t,i):this.createSimpleType(e,i))+'"+r+""}createEnum(e,t,s){return'"+(e.data.enuMembers?this.genHTML_enuMembers(e.data.enuMembers):"")+"
'+e.data.dsRange+''+e.data.dsDescription+"
"}genHTML_enuMembers(e){return e.map(e=>''+e.name+''+e.description+"").join("")}createSimpleType(e,t){return""+e.data.dsRange+""+e.data.dsDescription+""}addClickEvent(){var e=document.getElementById("table-view").getElementsByClassName("btn-vis-shadow")[0];this.clickHandler=this.clickEvent.bind(this),e.addEventListener("click",this.clickHandler,!0)}clickEvent(e){var t,s,n=e.target;n.removeEventListener("click",this.clickHandler,!0),n.classList.remove("btn-vis-shadow"),"btn-opt"===n.id?(t=document.getElementById("btn-man"),s=!0):(t=document.getElementById("btn-opt"),s=!1),t.classList.add("btn-vis-shadow");var a=this.dsHandler.generateDsClass(this.browser.ds["@graph"][0],!1,s),r=document.getElementById("table-ds");r.innerHTML=this.createTableContent(a),this.util.fade(r),this.addClickEvent(),this.addChangeInnerDSEventListener()}addChangeInnerDSEventListener(){var e=document.getElementById("table-view").getElementsByClassName("change-to-class");for(var t of(this.changeInnerDSHandler=this.changeInnerDSEvent.bind(this),e))t.addEventListener("click",this.changeInnerDSHandler,!0)}changeInnerDSEvent(e){for(var t=e.target,s=t.closest("tr"),n=t.dataset.innerdsindex;s.nextSibling;)(s=s.nextSibling).dataset.innerdsindex===n?(s.style.display="table-row",this.util.fade(s)):s.style.display="none";var a=t.closest("td").querySelector("b:not(.change-to-class)");a.classList.add("change-to-class"),a.addEventListener("click",this.changeInnerDSHandler,!0),t.classList.remove("change-to-class"),t.removeEventListener("click",this.changeInnerDSHandler,!0)}}module.exports=TableRenderer; },{}],90:[function(require,module,exports){ "use strict";class TreeRenderer{constructor(e){this.browser=e,this.util=e.util,this.dsHandler=e.dsHandler,this.dsRenderer=e.dsRenderer}render(){var e=""+this.dsRenderer.createHeader()+this.dsRenderer.createViewModeSelectors(this.dsRenderer.MODES.tree)+'
';this.browser.elem.innerHTML=this.util.createMainContent("rdfs:Class",e),this.initIFrameForJSTree()}initIFrameForJSTree(){this.iFrame=document.getElementById("iframe-jsTree"),this.iFrameCW=this.iFrame.contentWindow;var e=this.iFrameCW.document,r=this.createJSTreeHTML();e.open(),e.write(r),e.close();var t=this.dsHandler.generateDsClass(this.browser.ds["@graph"][0],!1,!1);this.mapNodeForJSTree([t])}createJSTreeHTML(){return'