@olenbetong/appframe-core 1.3.2 → 1.3.3
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/esm/af.common.js
CHANGED
|
@@ -44,5 +44,5 @@ return s;
|
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
-
`;let o=af.userSession.login?S.messages.relog:S.messages.login,s=n.querySelector(".message"),a=n.querySelector(".alert-warning"),i=n.querySelector("input[type=text]"),d=n.querySelector(".sign-in"),l=n.querySelector("input[type=password]");if(s!==null&&i!==null&&a!==null&&i!==null&&d!==null&&l!==null){s.innerText=y(o),i.value=af.userSession.login||"",i.disabled=!!af.userSession.login,i.readOnly=!!af.userSession.login,document.body.appendChild(n);let u=async()=>{l.disabled=!0;let c=new Request("/login",{body:JSON.stringify({username:i.value,password:l.value,remember:!1}),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"});try{let g=await(await fetch(c)).json();if(g.success)document.body.removeChild(n),this.showingDialog=!1,this.eventHandler.emit("onAuthenticated"),a.parentNode&&(a.parentNode.style.display="none");else throw new Error(g.error)}catch(f){if(f&&typeof f=="object"){let g=f;l.disabled=!1,l.classList.toggle("invalid",!0),l.value="",l.focus(),a.innerText=g.message?g.message:String(g),a.parentNode&&(a.parentNode.style.display="initial")}}};d.addEventListener("click",u),l.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),l.addEventListener("change",c=>{c.key==="Enter"&&u()}),i.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),i.addEventListener("change",c=>{c.key==="Enter"&&u()}),l.focus()}}}attachEvent(t,r){return this.eventHandler.on(t,r)}detachEvent(t,r){return this.eventHandler.off(t,r)}},p=S;p.messages={login:"Log in",relog:"Session expired - log in"};var x=class extends p{constructor(r){super();this.decimalSeparator=".";this.groupSeparator=null;this.shortDateFormat="dd.MM.yyyy";this.login=null;this.isDeveloper=!1;this.formats={},Object.assign(this,r)}};function U(e,t){if(e==="")return null;if(t==="number"){let r=Number(e);return isNaN(r)?void 0:r}else if(["date","datetime","time"].includes(t)){let r=new Date(e);return isNaN(r.getTime())?void 0:r}else{if(t==="boolean")return e.toLowerCase()==="true";if(t==="bigint")return BigInt(e)}return e}function L(e,t={}){let r=new FormData(e),n={};for(let o of r.entries()){let s=o[0],a=t?.[s]??"string",i=U(o[1],a);n.hasOwnProperty(s)?Array.isArray(n[s])?n[s].push(i):n[s]=[n[s],i]:n[s]=i}return n}function K(e,t){let r=t.getFields(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return L(e,n)}function J(e,t){let r=t.getParameters(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return L(e,n)}function z(e){return`${e||af.article.id}.${af.userSession.login}`}function xe(e,t){if(!af?.userSession)return null;let r=z(t),n=JSON.parse(localStorage.getItem(r)||"{}");return e?n[e]||null:n}function ve(e,t,r){if(!af?.userSession)return;let n=z(r),o=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?o[e]=t:o=e,localStorage.setItem(n,JSON.stringify(o))}var Te="1.3.
|
|
47
|
+
`;let o=af.userSession.login?S.messages.relog:S.messages.login,s=n.querySelector(".message"),a=n.querySelector(".alert-warning"),i=n.querySelector("input[type=text]"),d=n.querySelector(".sign-in"),l=n.querySelector("input[type=password]");if(s!==null&&i!==null&&a!==null&&i!==null&&d!==null&&l!==null){s.innerText=y(o),i.value=af.userSession.login||"",i.disabled=!!af.userSession.login,i.readOnly=!!af.userSession.login,document.body.appendChild(n);let u=async()=>{l.disabled=!0;let c=new Request("/login",{body:JSON.stringify({username:i.value,password:l.value,remember:!1}),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"});try{let g=await(await fetch(c)).json();if(g.success)document.body.removeChild(n),this.showingDialog=!1,this.eventHandler.emit("onAuthenticated"),a.parentNode&&(a.parentNode.style.display="none");else throw new Error(g.error)}catch(f){if(f&&typeof f=="object"){let g=f;l.disabled=!1,l.classList.toggle("invalid",!0),l.value="",l.focus(),a.innerText=g.message?g.message:String(g),a.parentNode&&(a.parentNode.style.display="initial")}}};d.addEventListener("click",u),l.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),l.addEventListener("change",c=>{c.key==="Enter"&&u()}),i.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),i.addEventListener("change",c=>{c.key==="Enter"&&u()}),l.focus()}}}attachEvent(t,r){return this.eventHandler.on(t,r)}detachEvent(t,r){return this.eventHandler.off(t,r)}},p=S;p.messages={login:"Log in",relog:"Session expired - log in"};var x=class extends p{constructor(r){super();this.decimalSeparator=".";this.groupSeparator=null;this.shortDateFormat="dd.MM.yyyy";this.login=null;this.isDeveloper=!1;this.formats={},Object.assign(this,r)}};function U(e,t){if(e==="")return null;if(t==="number"){let r=Number(e);return isNaN(r)?void 0:r}else if(["date","datetime","time"].includes(t)){let r=new Date(e);return isNaN(r.getTime())?void 0:r}else{if(t==="boolean")return e.toLowerCase()==="true";if(t==="bigint")return BigInt(e)}return e}function L(e,t={}){let r=new FormData(e),n={};for(let o of r.entries()){let s=o[0],a=t?.[s]??"string",i=U(o[1],a);n.hasOwnProperty(s)?Array.isArray(n[s])?n[s].push(i):n[s]=[n[s],i]:n[s]=i}return n}function K(e,t){let r=t.getFields(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return L(e,n)}function J(e,t){let r=t.getParameters(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return L(e,n)}function z(e){return`${e||af.article.id}.${af.userSession.login}`}function xe(e,t){if(!af?.userSession)return null;let r=z(t),n=JSON.parse(localStorage.getItem(r)||"{}");return e?n[e]||null:n}function ve(e,t,r){if(!af?.userSession)return;let n=z(r),o=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?o[e]=t:o=e,localStorage.setItem(n,JSON.stringify(o))}var Te="1.3.3";export{p as SessionHandler,x as UserSession,E as downloadBlob,R as downloadRequest,V as exportOptionsFromDataObject,T as expose,K as formDataToDataObjectRecord,L as formDataToObject,J as formDataToProcedureParameters,$ as getDataObjectReportRequest,y as getLocalizedString,xe as getSettings,N as has,M as localStorage,v as mitt,Q as openDataObjectReport,ve as saveSettings,Te as version};
|
|
48
48
|
//# sourceMappingURL=af.common.min.js.map
|
package/dist/iife/af.common.js
CHANGED
|
@@ -44,5 +44,5 @@ return s;
|
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
-
`;let o=af.userSession.login?O.messages.relog:O.messages.login,s=n.querySelector(".message"),a=n.querySelector(".alert-warning"),i=n.querySelector("input[type=text]"),d=n.querySelector(".sign-in"),l=n.querySelector("input[type=password]");if(s!==null&&i!==null&&a!==null&&i!==null&&d!==null&&l!==null){s.innerText=g(o),i.value=af.userSession.login||"",i.disabled=!!af.userSession.login,i.readOnly=!!af.userSession.login,document.body.appendChild(n);let u=async()=>{l.disabled=!0;let c=new Request("/login",{body:JSON.stringify({username:i.value,password:l.value,remember:!1}),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"});try{let m=await(await fetch(c)).json();if(m.success)document.body.removeChild(n),this.showingDialog=!1,this.eventHandler.emit("onAuthenticated"),a.parentNode&&(a.parentNode.style.display="none");else throw new Error(m.error)}catch(f){if(f&&typeof f=="object"){let m=f;l.disabled=!1,l.classList.toggle("invalid",!0),l.value="",l.focus(),a.innerText=m.message?m.message:String(m),a.parentNode&&(a.parentNode.style.display="initial")}}};d.addEventListener("click",u),l.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),l.addEventListener("change",c=>{c.key==="Enter"&&u()}),i.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),i.addEventListener("change",c=>{c.key==="Enter"&&u()}),l.focus()}}}attachEvent(t,r){return this.eventHandler.on(t,r)}detachEvent(t,r){return this.eventHandler.off(t,r)}},p=O;p.messages={login:"Log in",relog:"Session expired - log in"};var b=class extends p{constructor(r){super();this.decimalSeparator=".";this.groupSeparator=null;this.shortDateFormat="dd.MM.yyyy";this.login=null;this.isDeveloper=!1;this.formats={},Object.assign(this,r)}};function ee(e,t){if(e==="")return null;if(t==="number"){let r=Number(e);return isNaN(r)?void 0:r}else if(["date","datetime","time"].includes(t)){let r=new Date(e);return isNaN(r.getTime())?void 0:r}else{if(t==="boolean")return e.toLowerCase()==="true";if(t==="bigint")return BigInt(e)}return e}function T(e,t={}){let r=new FormData(e),n={};for(let o of r.entries()){let s=o[0],a=t?.[s]??"string",i=ee(o[1],a);n.hasOwnProperty(s)?Array.isArray(n[s])?n[s].push(i):n[s]=[n[s],i]:n[s]=i}return n}function C(e,t){let r=t.getFields(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return T(e,n)}function F(e,t){let r=t.getParameters(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return T(e,n)}function M(e){return`${e||af.article.id}.${af.userSession.login}`}function te(e,t){if(!af?.userSession)return null;let r=M(t),n=JSON.parse(localStorage.getItem(r)||"{}");return e?n[e]||null:n}function re(e,t,r){if(!af?.userSession)return;let n=M(r),o=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?o[e]=t:o=e,localStorage.setItem(n,JSON.stringify(o))}var ne="1.3.
|
|
47
|
+
`;let o=af.userSession.login?O.messages.relog:O.messages.login,s=n.querySelector(".message"),a=n.querySelector(".alert-warning"),i=n.querySelector("input[type=text]"),d=n.querySelector(".sign-in"),l=n.querySelector("input[type=password]");if(s!==null&&i!==null&&a!==null&&i!==null&&d!==null&&l!==null){s.innerText=g(o),i.value=af.userSession.login||"",i.disabled=!!af.userSession.login,i.readOnly=!!af.userSession.login,document.body.appendChild(n);let u=async()=>{l.disabled=!0;let c=new Request("/login",{body:JSON.stringify({username:i.value,password:l.value,remember:!1}),headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest"},method:"POST"});try{let m=await(await fetch(c)).json();if(m.success)document.body.removeChild(n),this.showingDialog=!1,this.eventHandler.emit("onAuthenticated"),a.parentNode&&(a.parentNode.style.display="none");else throw new Error(m.error)}catch(f){if(f&&typeof f=="object"){let m=f;l.disabled=!1,l.classList.toggle("invalid",!0),l.value="",l.focus(),a.innerText=m.message?m.message:String(m),a.parentNode&&(a.parentNode.style.display="initial")}}};d.addEventListener("click",u),l.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),l.addEventListener("change",c=>{c.key==="Enter"&&u()}),i.addEventListener("keyup",c=>{c.key==="Enter"&&u()}),i.addEventListener("change",c=>{c.key==="Enter"&&u()}),l.focus()}}}attachEvent(t,r){return this.eventHandler.on(t,r)}detachEvent(t,r){return this.eventHandler.off(t,r)}},p=O;p.messages={login:"Log in",relog:"Session expired - log in"};var b=class extends p{constructor(r){super();this.decimalSeparator=".";this.groupSeparator=null;this.shortDateFormat="dd.MM.yyyy";this.login=null;this.isDeveloper=!1;this.formats={},Object.assign(this,r)}};function ee(e,t){if(e==="")return null;if(t==="number"){let r=Number(e);return isNaN(r)?void 0:r}else if(["date","datetime","time"].includes(t)){let r=new Date(e);return isNaN(r.getTime())?void 0:r}else{if(t==="boolean")return e.toLowerCase()==="true";if(t==="bigint")return BigInt(e)}return e}function T(e,t={}){let r=new FormData(e),n={};for(let o of r.entries()){let s=o[0],a=t?.[s]??"string",i=ee(o[1],a);n.hasOwnProperty(s)?Array.isArray(n[s])?n[s].push(i):n[s]=[n[s],i]:n[s]=i}return n}function C(e,t){let r=t.getFields(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return T(e,n)}function F(e,t){let r=t.getParameters(),n=Object.fromEntries(r.map(o=>[o.name,o.type]));return T(e,n)}function M(e){return`${e||af.article.id}.${af.userSession.login}`}function te(e,t){if(!af?.userSession)return null;let r=M(t),n=JSON.parse(localStorage.getItem(r)||"{}");return e?n[e]||null:n}function re(e,t,r){if(!af?.userSession)return;let n=M(r),o=JSON.parse(localStorage.getItem(n)||"{}");typeof t<"u"?o[e]=t:o=e,localStorage.setItem(n,JSON.stringify(o))}var ne="1.3.3";return B(oe);})();
|
|
48
48
|
//# sourceMappingURL=af.common.min.js.map
|
package/es/index.js
CHANGED
|
@@ -11,4 +11,4 @@ export { default as SessionHandler } from "./SessionHandler.js";
|
|
|
11
11
|
export { default as UserSession } from "./UserSession.js";
|
|
12
12
|
export { formDataToDataObjectRecord, formDataToObject, formDataToProcedureParameters } from "./formDataToObject.js";
|
|
13
13
|
export * from "./settings.js";
|
|
14
|
-
export const version = "1.3.
|
|
14
|
+
export const version = "1.3.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olenbetong/appframe-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Javascript libraries to utilize the Appframe framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"chalk": "^5.0.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "31c866b5ce8b1491cccdd3484bb63644ef50c162"
|
|
47
47
|
}
|