@ulb-darmstadt/shacl-form 2.0.0-rc14 → 2.0.0-rc15

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/index.js CHANGED
@@ -65,7 +65,7 @@ a, a:visited { color: inherit; }
65
65
  .property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
66
66
  .property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
67
67
  .mode-edit .property-instance label { width: var(--label-width); }
68
- `;class Ye extends Qe{constructor(e){super(e||Je),this.idCtr=0}createDefaultTemplate(e,t,i,n,o){if(n.id=`e${this.idCtr++}`,n.classList.add("editor"),o?.datatype?n.shaclDatatype=o.datatype:t instanceof S&&(n.shaclDatatype=t.datatype),o?.minCount!==void 0&&(n.dataset.minCount=String(o.minCount)),o?.class&&(n.dataset.class=o.class.value),o?.nodeKind)n.dataset.nodeKind=o.nodeKind.value;else if(t&&(t instanceof I||o?.nodeKind?.equals(ue))&&(n.dataset.nodeKind=d+"IRI",o)){const c=T(o.config.store.getQuads(t,null,null,null),o.config.languages);c&&(n.dataset.value="<"+t.value+">",t=f.literal(c))}(o?.hasValue&&t||o?.readonly)&&(n.disabled=!0),n.value=t?.value||o?.defaultValue?.value||"";const a=document.createElement("label");a.htmlFor=n.id,a.innerText=e,o?.description&&a.setAttribute("title",o.description.value);const r=o?.description?o.description.value:o?.pattern?o.pattern:null;r&&n.setAttribute("placeholder",r),i&&(n.setAttribute("required","true"),a.classList.add("required"));const l=document.createElement("div");return l.appendChild(a),l.appendChild(n),l}createDateEditor(e,t,i,n){const o=new k;n.datatype?.value===E+"dateTime"?(o.type="datetime-local",o.setAttribute("step","1")):o.type="date",o.clearable=!0,o.dense=this.dense,o.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,i,o,n);if(t)try{let r=new Date(t.value).toISOString();n.datatype?.value===E+"dateTime"?r=r.slice(0,19):r=r.slice(0,10),o.value=r}catch(r){console.error(r,t)}return a}createTextEditor(e,t,i,n){let o;return n.singleLine===!1?(o=new xe,o.resize="auto"):o=new k,o.dense=this.dense,n.pattern&&(o.pattern=n.pattern),n.minLength&&(o.minLength=n.minLength),n.maxLength&&(o.maxLength=n.maxLength),this.createDefaultTemplate(e,t,i,o,n)}createLangStringEditor(e,t,i,n){const o=this.createTextEditor(e,t,i,n),a=o.querySelector(":scope .editor");let r;if(n.languageIn?.length){r=document.createElement("select");for(const l of n.languageIn){const c=document.createElement("option");c.innerText=l.value,r.appendChild(c)}}else r=document.createElement("input"),r.maxLength=5,r.size=5,r.placeholder="lang?";return r.title="Language of the text",r.classList.add("lang-chooser"),r.slot="suffix",r.addEventListener("change",l=>{l.stopPropagation(),a&&(a.dataset.lang=r.value,a.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof S&&(r.value=t.language),a.dataset.lang=r.value,a.appendChild(r),o}createBooleanEditor(e,t,i,n){const o=document.createElement("input");o.type="checkbox",o.classList.add("ml-0");const a=this.createDefaultTemplate(e,null,i,o,n);return o.removeAttribute("required"),a.querySelector(":scope label")?.classList.remove("required"),t instanceof S&&(o.checked=t.value==="true"),a}createFileEditor(e,t,i,n){const o=document.createElement("input");return o.type="file",o.addEventListener("change",a=>{if(o.files?.length){a.stopPropagation();const r=new FileReader;r.readAsDataURL(o.files[0]),r.onload=()=>{o.binaryData=btoa(r.result),o.parentElement?.dispatchEvent(new Event("change",{bubbles:!0}))}}else o.binaryData=void 0}),this.createDefaultTemplate(e,t,i,o,n)}createNumberEditor(e,t,i,n){const o=new k;o.type="number",o.clearable=!0,o.dense=this.dense,o.classList.add("pr-0");const a=n.minInclusive!==void 0?n.minInclusive:n.minExclusive!==void 0?n.minExclusive+1:void 0,r=n.maxInclusive!==void 0?n.maxInclusive:n.maxExclusive!==void 0?n.maxExclusive-1:void 0;return a!==void 0&&(o.min=String(a)),r!==void 0&&(o.max=String(r)),n.datatype?.value!==E+"integer"&&(o.step="0.1"),this.createDefaultTemplate(e,t,i,o,n)}createListEditor(e,t,i,n,o){const a=new de;a.clearable=!0,a.dense=this.dense;const r=this.createDefaultTemplate(e,null,i,a,o),l=document.createElement("ul");let c=!0;const u=(h,g)=>{const p=document.createElement("li");if(typeof h.value=="string"?(p.dataset.value=h.value,p.innerText=h.label?h.label:h.value):(p.dataset.value=h.value.id,h.value instanceof I&&(p.dataset.value="<"+p.dataset.value+">"),p.innerText=h.label?h.label:h.value.value),g.appendChild(p),h.children?.length){c=!1;const w=document.createElement("ul");p.appendChild(w);for(const x of h.children)u(x,w)}};for(const h of n)u(h,l);return c||(a.collapse=!0),a.appendChild(l),t&&(a.value=t.id,t instanceof I&&(a.value="<"+a.value+">")),r}createButton(e,t){const i=document.createElement("rokit-button");return i.innerHTML=e,i}}const Ze={[`${d}node`]:(s,e)=>{s.extendedShapes.add(new O(e,s.config,s))},[`${d}and`]:(s,e)=>{for(const t of s.config.lists[e.value])s.extendedShapes.add(new O(t,s.config,s))},[`${d}property`]:(s,e)=>{const t=s.config.getPropertyTemplate(e,s);if(t.path){let i=s.properties[t.path];if(i||(i=[],s.properties[t.path]=i),t.qualifiedValueShape)i.push(t);else{let n;for(let o=0;o<s.properties[t.path].length&&!n;o++)s.properties[t.path][o].qualifiedValueShape||(n=s.properties[t.path][o]);n?me(n,t):i.push(t)}}},[`${d}nodeKind`]:(s,e)=>{s.nodeKind=e},[`${d}targetClass`]:(s,e)=>{s.targetClass=e},[`${d}or`]:(s,e)=>{s.or=s.config.lists[e.value]},[`${d}xone`]:(s,e)=>{s.xone=s.config.lists[e.value]},[J.id]:(s,e)=>{s.owlImports.add(e)}};class O{constructor(e,t,i){this.extendedShapes=new Set,this.properties={},this.owlImports=new Set,this.id=e,this.config=t,this.parent=i,t.registerNodeTemplate(this),et(this,this.config.store.getQuads(e,null,null,null))}}function et(s,e){for(const t of e)Ze[t.predicate.id]?.call(s,s,t.object);return s}function tt(s){for(const e of Object.values(s.properties))for(const t of e){const[i,n]=U(s,t.path);if(i.length>1&&n){const o=i[i.length-1];for(let a=i.length-2;a>=0;a--){const r=i[a];delete r.parent.properties[r.path],me(o,r)}}}}function U(s,e,t=new Set,i=[],n=!1){if(!t.has(s.id.value)){t.add(s.id.value);const o=s.properties[e];if(o?.length===1){i.push(o[0]),n=n||o[0].maxCount===1;for(const a of o[0].nodeShapes){const[r,l]=U(a,e,t,i,n);n=n||l}}for(const a of s.extendedShapes){const[r,l]=U(a,e,t,i,n);n=n||l}}return[i,n]}class Q{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null,this.dense="true"}}const st="#003273, #4c93d7, #f85e9a, #87001f";class ce{constructor(e){this.attributes=new Q,this.loader=new Xe(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new H,this._nodeTemplates={},this._propertyTemplates={},this.validator=new ne(this._store,{details:!0,factory:f}),this.form=e,this._theme=new Ye,this.languages=[...new Set(navigator.languages.flatMap(t=>t.length>2?[t.toLocaleLowerCase(),t.substring(0,2)]:t)),""]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){const t=new Q;if(Object.keys(t).forEach(i=>{const n=e.dataset[i];n!==void 0&&(t[i]=n)}),this.editMode=t.view===null,this.theme.setDense(t.dense==="true"),this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const i=this.languages.indexOf(t.language);i>-1&&this.languages.splice(i,1),this.languages.unshift(t.language)}if(t.valuesGraph&&(this.valuesGraphId=f.namedNode(t.valuesGraph)),t.hierarchyColors!=null){const i=t.hierarchyColors.length?t.hierarchyColors:st;let n=`:host { --hierarchy-colors: ${i}; --hierarchy-colors-length: ${i.split(",").length}; --hierarchy-color-width: 3px }`;for(let o=8;o>=0;o--){let a=`shacl-property { --hierarchy-level: ${o} }`;for(let r=0;r<o;r++)a="shacl-property "+a;n=n+`
68
+ `;class Ye extends Qe{constructor(e){super(e||Je),this.idCtr=0}createDefaultTemplate(e,t,i,n,o){if(n.id=`e${this.idCtr++}`,n.classList.add("editor"),o?.datatype?n.shaclDatatype=o.datatype:t instanceof S&&(n.shaclDatatype=t.datatype),o?.minCount!==void 0&&(n.dataset.minCount=String(o.minCount)),o?.class&&(n.dataset.class=o.class.value),o?.nodeKind)n.dataset.nodeKind=o.nodeKind.value;else if(t&&(t instanceof I||o?.nodeKind?.equals(ue))&&(n.dataset.nodeKind=d+"IRI",o)){const c=T(o.config.store.getQuads(t,null,null,null),o.config.languages);c&&(n.dataset.value="<"+t.value+">",t=f.literal(c))}(o?.hasValue&&t||o?.readonly)&&(n.disabled=!0),n.value=t?.value||o?.defaultValue?.value||"";const a=document.createElement("label");a.htmlFor=n.id,a.innerText=e,o?.description&&a.setAttribute("title",o.description.value);const r=o?.description?o.description.value:o?.pattern?o.pattern:null;r&&n.setAttribute("placeholder",r),i&&(n.setAttribute("required","true"),a.classList.add("required"));const l=document.createElement("div");return l.appendChild(a),l.appendChild(n),l}createDateEditor(e,t,i,n){const o=new k;n.datatype?.value===E+"dateTime"?(o.type="datetime-local",o.setAttribute("step","1")):o.type="date",o.clearable=!0,o.dense=this.dense,o.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,i,o,n);if(t)try{let r=new Date(t.value).toISOString();n.datatype?.value===E+"dateTime"?r=r.slice(0,19):r=r.slice(0,10),o.value=r}catch(r){console.error(r,t)}return a}createTextEditor(e,t,i,n){let o;return n.singleLine===!1?(o=new xe,o.resize="auto"):o=new k,o.dense=this.dense,n.pattern&&(o.pattern=n.pattern),n.minLength&&(o.minLength=n.minLength),n.maxLength&&(o.maxLength=n.maxLength),this.createDefaultTemplate(e,t,i,o,n)}createLangStringEditor(e,t,i,n){const o=this.createTextEditor(e,t,i,n),a=o.querySelector(":scope .editor");let r;if(n.languageIn?.length){r=document.createElement("select");for(const l of n.languageIn){const c=document.createElement("option");c.innerText=l.value,r.appendChild(c)}}else r=document.createElement("input"),r.maxLength=5,r.size=5,r.placeholder="lang?";return r.title="Language of the text",r.classList.add("lang-chooser"),r.slot="suffix",r.addEventListener("change",l=>{l.stopPropagation(),a&&(a.dataset.lang=r.value,a.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof S&&(r.value=t.language),a.dataset.lang=r.value,a.appendChild(r),o}createBooleanEditor(e,t,i,n){const o=document.createElement("input");o.type="checkbox",o.classList.add("ml-0");const a=this.createDefaultTemplate(e,null,i,o,n);return o.removeAttribute("required"),a.querySelector(":scope label")?.classList.remove("required"),t instanceof S&&(o.checked=t.value==="true"),a}createFileEditor(e,t,i,n){const o=document.createElement("input");return o.type="file",o.addEventListener("change",a=>{if(o.files?.length){a.stopPropagation();const r=new FileReader;r.readAsDataURL(o.files[0]),r.onload=()=>{o.binaryData=btoa(r.result),o.parentElement?.dispatchEvent(new Event("change",{bubbles:!0}))}}else o.binaryData=void 0}),this.createDefaultTemplate(e,t,i,o,n)}createNumberEditor(e,t,i,n){const o=new k;o.type="number",o.clearable=!0,o.dense=this.dense,o.classList.add("pr-0");const a=n.minInclusive!==void 0?n.minInclusive:n.minExclusive!==void 0?n.minExclusive+1:void 0,r=n.maxInclusive!==void 0?n.maxInclusive:n.maxExclusive!==void 0?n.maxExclusive-1:void 0;return a!==void 0&&(o.min=String(a)),r!==void 0&&(o.max=String(r)),n.datatype?.value!==E+"integer"&&(o.step="0.1"),this.createDefaultTemplate(e,t,i,o,n)}createListEditor(e,t,i,n,o){const a=new de;a.clearable=!0,a.dense=this.dense;const r=this.createDefaultTemplate(e,null,i,a,o),l=document.createElement("ul");let c=!0;const u=(h,g)=>{const p=document.createElement("li");if(typeof h.value=="string"?(p.dataset.value=h.value,p.innerText=h.label?h.label:h.value):(p.dataset.value=h.value.id,h.value instanceof I&&(p.dataset.value="<"+p.dataset.value+">"),p.innerText=h.label?h.label:h.value.value),g.appendChild(p),h.children?.length){c=!1;const w=document.createElement("ul");p.appendChild(w);for(const x of h.children)u(x,w)}};for(const h of n)u(h,l);return c||(a.collapse=!0),a.appendChild(l),t&&(a.value=t.id,t instanceof I&&(a.value="<"+a.value+">")),r}createButton(e,t){const i=document.createElement("rokit-button");return i.innerHTML=e,i}}const Ze={[`${d}node`]:(s,e)=>{s.extendedShapes.add(new O(e,s.config,s))},[`${d}and`]:(s,e)=>{for(const t of s.config.lists[e.value])s.extendedShapes.add(new O(t,s.config,s))},[`${d}property`]:(s,e)=>{const t=s.config.getPropertyTemplate(e,s);if(t.path){let i=s.properties[t.path];if(i||(i=[],s.properties[t.path]=i),t.qualifiedValueShape)i.push(t);else{let n;for(let o=0;o<s.properties[t.path].length&&!n;o++)s.properties[t.path][o].qualifiedValueShape||(n=s.properties[t.path][o]);n?me(n,t):i.push(t)}}},[`${d}nodeKind`]:(s,e)=>{s.nodeKind=e},[`${d}targetClass`]:(s,e)=>{s.targetClass=e},[`${d}or`]:(s,e)=>{s.or=s.config.lists[e.value]},[`${d}xone`]:(s,e)=>{s.xone=s.config.lists[e.value]},[J.id]:(s,e)=>{s.owlImports.add(e)}};class O{constructor(e,t,i){this.extendedShapes=new Set,this.properties={},this.owlImports=new Set,this.id=e,this.config=t,this.parent=i,t.registerNodeTemplate(this),et(this,this.config.store.getQuads(e,null,null,null))}}function et(s,e){for(const t of e)Ze[t.predicate.id]?.call(s,s,t.object);return s}function tt(s){for(const e of Object.values(s.properties))for(const t of e){const[i,n]=U(s,t.path);if(i.length>1&&n){const o=i[i.length-1];for(let a=i.length-2;a>=0;a--){const r=i[a];delete r.parent.properties[r.path],me(o,r)}}}}function U(s,e,t=new Set,i=[],n=!1){if(!t.has(s.id.value)){t.add(s.id.value);const o=s.properties[e];if(o?.length===1){i.push(o[0]),n=n||o[0].maxCount===1;for(const a of o[0].nodeShapes){const[r,l]=U(a,e,t,i,n);n=n||l}}for(const a of s.extendedShapes){const[r,l]=U(a,e,t,i,n);n=n||l}}return[i,n]}class Q{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.hierarchyColors=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null,this.dense="true"}}const st="#4c93d785, #f85e9a85, #00327385, #87001f85";class ce{constructor(e){this.attributes=new Q,this.loader=new Xe(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new H,this._nodeTemplates={},this._propertyTemplates={},this.validator=new ne(this._store,{details:!0,factory:f}),this.form=e,this._theme=new Ye,this.languages=[...new Set(navigator.languages.flatMap(t=>t.length>2?[t.toLocaleLowerCase(),t.substring(0,2)]:t)),""]}reset(){this.lists={},this.groups=[],this.renderedNodes.clear(),this._nodeTemplates={},this._propertyTemplates={}}updateAttributes(e){const t=new Q;if(Object.keys(t).forEach(i=>{const n=e.dataset[i];n!==void 0&&(t[i]=n)}),this.editMode=t.view===null,this.theme.setDense(t.dense==="true"),this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const i=this.languages.indexOf(t.language);i>-1&&this.languages.splice(i,1),this.languages.unshift(t.language)}if(t.valuesGraph&&(this.valuesGraphId=f.namedNode(t.valuesGraph)),t.hierarchyColors!=null){const i=t.hierarchyColors.length?t.hierarchyColors:st;let n=`:host { --hierarchy-colors: ${i}; --hierarchy-colors-length: ${i.split(",").length}; --hierarchy-color-width: 3px }`;for(let o=8;o>=0;o--){let a=`shacl-property { --hierarchy-level: ${o} }`;for(let r=0;r<o;r++)a="shacl-property "+a;n=n+`
69
69
  `+a}this.hierarchyColorsStyleSheet=new CSSStyleSheet,this.hierarchyColorsStyleSheet.replaceSync(n)}}static dataAttributes(){const e=new Q;return Object.keys(e).map(t=>(t=t.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),"data-"+t))}buildTemplateKey(e,t){let i=e.value;return t&&(t instanceof re?i+="*"+t.id.value:i+="*"+this.buildTemplateKey(t.id,t.parent)),i}registerNodeTemplate(e){this._nodeTemplates[this.buildTemplateKey(e.id,e.parent)]=e}registerPropertyTemplate(e){this._propertyTemplates[this.buildTemplateKey(e.id,e.parent)]=e}getNodeTemplate(e,t){const i=this.buildTemplateKey(e,t);let n=this._nodeTemplates[i];return n||(n=new O(e,this,t)),n}getPropertyTemplate(e,t){const i=this.buildTemplateKey(e,t);let n=this._propertyTemplates[i];return n||(n=new re(e,t)),n}get nodeTemplates(){return Object.values(this._nodeTemplates)}get theme(){return this._theme}set theme(e){this._theme=e,e.setDense(this.attributes.dense==="true")}get store(){return this._store}set store(e){this._store=e,this.lists=_e(e,{ignoreErrors:!0}),this.groups=[],e.forSubjects(t=>{this.groups.push(t.id)},m,`${d}PropertyGroup`,null),this.validator=new ne(e,{details:!0,factory:f})}}const nt=50;class it extends HTMLElement{constructor(){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new ce(this.form),this.form.addEventListener("change",e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then(t=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:t.conforms,report:t}}))}).catch(t=>{console.warn(t)})})}static get observedAttributes(){return ce.dataAttributes()}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.setAttribute("loading",""),this.form.replaceChildren(document.createTextNode(this.config.attributes.loading)),this.initDebounceTimeout=setTimeout(async()=>{try{this.config.reset(),await this.config.loader.loadGraphs(),this.form.replaceChildren();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(n=>{this.form.classList.remove(n)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];this.config.hierarchyColorsStyleSheet&&t.push(this.config.hierarchyColorsStyleSheet);for(const n of He())n.stylesheet&&t.push(n.stylesheet);this.shadowRoot.adoptedStyleSheets=t;const i=new O(e,this.config);for(const n of this.config.nodeTemplates)tt(n);if(this.shape=new L(i,this.config.attributes.valuesSubject?f.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const n=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);n.addEventListener("click",o=>{o.preventDefault(),this.form.reportValidity()&&this.validate().then(a=>{if(a?.conforms)this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}));else{let r=this.form.querySelector(":scope .invalid > .editor");r?r.focus():this.form.querySelector(":scope .invalid")?.scrollIntoView()}})}),this.form.appendChild(n)}setTimeout(()=>{this.config.attributes.valuesSubject&&this.removeFromDataGraph(f.namedNode(this.config.attributes.valuesSubject)),this.validate(!0)})}}else if(this.config.store.countQuads(null,null,null,j)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}this.removeAttribute("loading")},nt)}serialize(e="text/turtle",t=this.toRDF()){const i=t.getQuads(null,null,null,null);return ze(i,e,this.config.prefixes)}toRDF(e=new H){return this.shape?.toRDF(e,void 0,this.config.attributes.generateNodeShapeReference),e}registerPlugin(e){Ue(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){for(const t of this.form.querySelectorAll(":scope .validation-error"))t.remove();for(const t of this.form.querySelectorAll(":scope .property-instance"))t.classList.remove("invalid"),t.querySelector(":scope > .editor")?.value?t.classList.add("valid"):t.classList.remove("valid");if(this.config.store.deleteGraph(this.config.valuesGraphId||""),!this.shape)return{conforms:!0};this.shape.toRDF(this.config.store,void 0,this.config.attributes.generateNodeShapeReference);try{const t=await this.config.validator.validate({dataset:this.config.store,terms:[this.shape.nodeId]},[{terms:[this.shape.template.id]}]);for(const i of t.results)if(i.focusNode?.ptrs?.length)for(const n of i.focusNode.ptrs){const o=n._term;if(i.path?.length){const a=i.path[0].predicates[0];let r=this.form.querySelectorAll(`
70
70
  :scope shacl-node[data-node-id='${o.id}'] > shacl-property > .property-instance[data-path='${a.id}'] > .editor,
71
71
  :scope shacl-node[data-node-id='${o.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${a.id}'] > .editor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulb-darmstadt/shacl-form",
3
- "version": "2.0.0-rc14",
3
+ "version": "2.0.0-rc15",
4
4
  "description": "SHACL form generator",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -44,29 +44,28 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@open-wc/testing": "^4.0.0",
47
- "@remcovaes/web-test-runner-vite-plugin": "^1.3.0",
47
+ "@remcovaes/web-test-runner-vite-plugin": "^1.4.0",
48
48
  "@types/jsonld": "^1.5.15",
49
49
  "@types/leaflet": "^1.9.21",
50
50
  "@types/leaflet-editable": "^1.2.7",
51
51
  "@types/leaflet.fullscreen": "^3.0.3",
52
52
  "@types/mapbox__mapbox-gl-draw": "^1.4.9",
53
53
  "@types/mocha": "^10.0.10",
54
- "@types/n3": "^1.26.0",
54
+ "@types/n3": "^1.26.1",
55
55
  "@web/test-runner": "^0.20.2",
56
56
  "@web/test-runner-chrome": "^0.18.1",
57
57
  "rdf-isomorphic": "^2.0.1",
58
58
  "rimraf": "^6.0.1",
59
59
  "rollup-plugin-peer-deps-external": "^2.2.4",
60
60
  "typescript": "^5.9.3",
61
- "vite": "^7.1.9"
61
+ "vite": "^7.1.12"
62
62
  },
63
63
  "peerDependencies": {
64
- "@ro-kit/ui-widgets": "^1.0.9",
64
+ "@ro-kit/ui-widgets": "^1.0.16",
65
65
  "jsonld": "^8.3.3",
66
66
  "leaflet": "^1.9.4",
67
67
  "leaflet-editable": "^1.3.2",
68
68
  "leaflet.fullscreen": "^4.0.0",
69
- "lit": "^3.3.1",
70
69
  "n3": "^1.26.0",
71
70
  "rdfxml-streaming-parser": "^3.1.0",
72
71
  "shacl-engine": "^1.0.2",