@tomaso909/jsguitools 1.0.3 → 1.0.5

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.
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jsguitools=t():e.jsguitools=t()}(this,(()=>(()=>{"use strict";var e={56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},72:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},r=[],l=0;l<e.length;l++){var a=e[l],u=o.base?a[0]+o.base:a[0],c=s[u]||0,d="".concat(u," ").concat(c);s[u]=c+1;var p=n(d),f={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==p)t[p].references++,t[p].updater(f);else{var h=i(f,o);o.byIndex=l,t.splice(l,0,{identifier:d,updater:h,references:1})}r.push(d)}return r}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=o(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var l=n(s[r]);t[l].references--}for(var a=o(e,i),u=0;u<s.length;u++){var c=n(s[u]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}s=a}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(r[a]=!0)}for(var u=0;u<e.length;u++){var c=[].concat(e[u]);o&&r[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},555:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([e.id,"@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100);"]),r.push([e.id," /* The side navigation menu */\n.sideMenu {\n height: 100%; /* 100% Full-height */\n width: 0; /* 0 width - change this with JavaScript */\n position: fixed; /* Stay in place */\n z-index: 1; /* Stay on top */\n top: 0;\n left: 0;\n background-color: #111; /* Black*/\n overflow-x: hidden; /* Disable horizontal scroll */\n padding-top: 60px; /* Place content 60px from the top */\n transition: 0.5s; /* 0.5 second transition effect to slide in the sideMenu */\n}\n\n/* The navigation menu links */\n.sideMenu a {\n padding: 8px 8px 8px 32px;\n text-decoration: none;\n font-size: 15px;\n color: #818181;\n display: block;\n transition: 0.3s;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n}\n\n/* When you mouse over the navigation links, change their color */\n.sideMenu a:hover, .offcanvas a:focus{\n color: #f1f1f1;\n}\n\n/* Avoid dotted border on click */\n.sideMenu a:hover,a:active,a:link,a:focus{\n outline: 0px none;\n}\n\n/* Position and style of the close button (top right corner) */\n.sideMenu .sideMenuCloseButton {\n position: absolute;\n top: 0;\n right: 25px;\n font-size: 20px;\n margin-left: 50px;\n}\n\n/* Style page content - Push the page content to the right when side menu opens */\n.sideMenuTransition {\n transition: margin-left .5s;\n}\n\n/* On smaller screens, where height is less than 450px, change the style of the sideMenu (less padding and a smaller font size) */\n@media screen and (max-height: 450px) {\n .sideMenu {padding-top: 15px;}\n .sideMenu a {font-size: 18px;}\n}\n\n/* end table styles */\n",""]);const l=r},601:e=>{e.exports=function(e){return e[1]}},659:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},725:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([e.id,"\n.coolButton {\n\tposition: absolute;\n margin: 0;\n border: 0;\n padding: 0;\n font-size: 13px;\n position: absolute;\n width: 5%;\n height: 30px;\n text-align: center;\n box-sizing: border-box;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-user-select: none;\n cursor: default;\n opacity: 0.25;\n}\n\n.coolButton:hover {\n cursor: pointer;\n opacity: 0.75;\n\n}\n\n.coolButton3 {\n overflow: hidden;\n border: #000000 solid 1px; \n}\n\n.coolButton3 div {\n position: absolute;\n text-align: center;\n width: 100%;\n height: 30px;\n box-sizing: border-box;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n padding: 5px;\n}\n\n.coolButton3 div:nth-child(1) {\n color: #000000;\n background-color: #ffffff;\n}\n\n.coolButton3 div:nth-child(2) {\n background-color: #000000;\n width: 130px;\n transition: all 0.2s ease;\n -webkit-transition: all 0.2s ease;\n -moz-transition: all 0.2s ease;\n transform: translate(-150px, 0px) skewX(-30deg);\n -webkit-transform: translate(-150px, 0px) skewX(-30deg);\n -moz-transform: translate(-150px, 0px) skewX(-30deg);\n}\n\n.coolButton3 div:nth-child(3) {\n color: #ffffff;\n left: -150px;\n transition: left 0.2s ease;\n -webkit-transition: left 0.2s ease;\n -moz-transition: left 0.2s ease;\n}\n\n.coolButton3:hover div:nth-child(2) {\n transition: all 0.3s ease;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transform: translate(-15px, 0px) skewX(-30deg);\n -webkit-transform: translate(-15px, 0px) skewX(-30deg);\n -moz-transform: translate(-15px, 0px) skewX(-30deg);\n}\n\n.coolButton3:hover div:nth-child(3) {\n left: 0px;\n transition: left 0.2s ease;\n -webkit-transition: left 0.2s ease;\n -moz-transition: left 0.2s ease;\n}",""]);const l=r},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var o={};n.r(o),n.d(o,{AUTOFORMS:()=>l,COOLBUTTONS:()=>i,POPUPS:()=>r,SIDEMENU:()=>s});const i={button:function(e,t,n){let o=document.createElement("div");return null!=t&&o.setAttribute("id",t),null!=n&&(o.style.cssText=n),o.classList.add("coolButton","coolButton3"),o.innerHTML="<div>"+e+"</div><div></div><div>"+e+"</div>",o},verticalButtons:function(e,t){let n=document.createElement("div");null==t&&(t=5);let o=0;for(const i in e){const s=e[i];let r=o*t+t;n.appendChild(button(s.caption,s.id,"width:100%; top:"+r+"px")),o+=1}return n},horizontalButtons:function(e,t){let n=document.createElement("div");null==t&&(t=100);let o=0;for(const i in e){const s=e[i];let r=o*t+5;n.appendChild(button(s,void 0,"width:10%; left:"+r+"px")),o+=1}return n}},s=function(e,t,n,o){null==o&&(o="#"),this.containerId=e,console.log("++>",e,document.getElementById(this.containerId));let s=['<div id="sideMenu" class="sideMenu">','<a href="javascript:void(0)" id="sideMenu_button_close" class="sideMenuCloseButton">&times;</a>'];for(let e=0;e<t.length;e++){const n=t[e];"sep"==n?s.push("<hr width=100>"):s.push('<a href="javascript:void(0)" id="sideMenu_button_'+n.name+'">'+n.name+"</a>")}null!=n&&(s+='\n <div style="position: absolute; bottom:100px">\n <a style="color:goldenrod">'+n+'</a>\n <a href="'+o+'">Log Out</a>\n </div>\n ');let r=document.getElementById(e);r.appendChild(i.button("Menu","sideMenu_button_open","top:10px; left:10px; position: absolute; z-index: 100")),document.body.innerHTML+=s,r.style.transition="margin-left 0.5s",document.getElementById("sideMenu_button_open").onclick=this.open,document.getElementById("sideMenu_button_close").onclick=this.close;for(let e=0;e<t.length;e++){const n=t[e];"sep"!=n&&null!=n.onclick&&(document.getElementById("sideMenu_button_"+n.name).onclick=n.onclick)}};s.prototype.updateTransition=function(){document.getElementById(this.containerId).style.transition="margin-left 0.5s"},s.prototype.open=function(){document.getElementById("sideMenu_button_open").style.display="none",document.getElementById("sideMenu").style.width="150px",console.log("------\x3e",this.containerId),document.getElementById(this.containerId).style.marginLeft="150px"},s.prototype.close=function(){document.getElementById("sideMenu").style.width="0",document.getElementById(this.containerId).style.marginLeft="0",document.getElementById("sideMenu_button_open").style.display="block"};const r={message:function(e,t,n=!1){let o='<div class="w2ui-centered">';for(let e=0;e<t.length;e++)o+=t[e]+"<br>";w2popup.open({title:e,body:o,modal:n,showClose:n})},errorWithInfo:function(e){popups.message("Error",["There was a problem "+e+".","Please refresh the website and contact support if the problem persists."])},error:function(e,t){let n='<div class="w2ui-centered">';n+=e,n+="<br>",n+="To get support from D3 staff, please submit the following error log along a short description of what you were doing to tomasruiz@d3atech.com<br>",n+=t+"</div>",w2popup.open({title:"Error",body:n})},notImplementedWarning:function(){w2popup.open({title:"Warning",body:'<div class="w2ui-centered">This feature is not yet available in the Beta.</div>'})},form:function(e,t,n,o=void 0){w2ui[e.name]?(w2ui[e.name].destroy(),$().w2form(e)):$().w2form(e),$().w2popup("open",{title:t,body:'<div id="popup_'+e.name+'" style="width: 100%; height: 100%; padding:5px"></div>',style:"padding: 10px 0px 0px 0px; background-color: transparent; border:0px;",width:n[0],height:n[1],showMax:!1,onToggle:function(e){$(form.box).hide(),e.onComplete=function(){$(form.box).show(),form.resize()}},onOpen:function(t){t.onComplete=function(){$("#w2ui-popup #popup_"+e.name).w2render(e.name),null!=o&&o()}}})},html:function(e,t,n,o,i=!0,s=!0,r=void 0){w2popup.open({title:n,body:e,buttons:t,width:o[0],height:o[1],color:"#333",modal:!1,showClose:i,showMax:s,onOpen:function(e){e.onComplete=function(){null!=r&&r()}},onClose:function(e){console.log("close")},onMax:function(e){console.log("max")},onMin:function(e){console.log("min")},onKeydown:function(e){console.log("keydown")}})}},l={templateFields:function(e,t=!0){let n=null;n=t?Object.keys(e):[null];let o=[];for(let i=0;i<n.length;i++){let s=null;s=t?e[n[i]]:e;const r=Object.keys(s);for(let e=0;e<r.length;e++){const t=s[r[e]];let n="text",i={},l=!0,a={};null!=t.type&&(n=t.type),null!=t.options&&(i=t.options),null!=t.required&&(l=t.required),null!=t.html&&(a=t.html),o.push({field:r[e],type:n,required:l,options:i,html:a})}}return o},templateTabs:function(e){const t=Object.keys(e);let n=[];for(let e=0;e<t.length;e++)n.push({id:"tab"+e,text:t[e][0].toUpperCase()+t[e].slice(1)});return n},templateSize:function(e){const t=Object.keys(e);let n=[];for(let o=0;o<t.length;o++)n.push(Object.keys(e[t[o]]).length);return Math.max(...n)},html:function(e,t=!0,n=null){function o(e,t,n,o,i,s,r){null==i&&(i=""),"color"==t&&(t="text");let l=null;return l="textarea"==t?null!=s?'<div class="tooltip" style="'+n+';height:200px"><textarea name="'+e+'" type="text" style="width:100%;height:200px" '+i+'></textarea><span class="tooltiptext">'+s+"</span></div>":'<textarea name="'+e+'" type="text" style="'+n+';height:200px" '+i+"></textarea>":null!=s?'<div class="tooltip" style="'+n+'"><input name="'+e+'" style="width:100%" type="'+t+'" '+i+'/><span class="tooltiptext">'+s+"</span></div>":'<input name="'+e+'" type="'+t+'" style="'+n+'" '+i+"/>",null!=r&&!r||null==s||(o+='<p style="display:inline-block; color:red"><sup>*</sup></p>'),['<div class="w2ui-field">',"<label>"+o+"</label>","<div>",l,"</div>","</div>\n"].join("\n")}function i(e){let t=e[0].toUpperCase();for(let n=1;n<e.length;n++)e[n]==e[n].toUpperCase()&&n>0&&e[n-1]==e[n-1].toLowerCase()?t+=" "+e[n]:t+=e[n];return t}let s=null;s=t?Object.keys(e):[null];let r="";for(let n=0;n<s.length;n++){let l=null;l=t?e[s[n]]:e;const a=Object.keys(l);r+='<div class="w2ui-page page-'+n+'"> \n';for(let e=0;e<a.length;e++){const t=a[e],n=l[t];null==n.caption&&(n.caption=i(t)),r+=o(t,n.type,"width:80%",n.caption,n.attr,n.tooltip,n.required)}r+="</div> \n"}return r+=null==n?['<div class="w2ui-buttons">','<button class="w2ui-btn w2ui-btn-blue" name="save">Save</button>',"</div>"].join("\n"):"string"==typeof n?n:l.buttons(n),r},buttons:function(e,t=""){let n='<div class="w2ui-buttons" '+t+">";for(let t=0;t<e.length;t++){const o=e[t];null==o.attributes&&(o.attributes=""),n+='<button class="w2ui-btn w2ui-btn-'+o.color+'" name="'+o.name+'" '+o.attributes,null!=o.onClick&&(n+=' onClick="'+o.onClick+'"'),n+=">"+o.caption+"</button>"}return n+="</div>",n},form:function(e,t,n,o,i=null,s="autoForm",r=!0){let a=l.templateFields(n,r);return{name:s,style:"border: 0px; padding 0px; height:100%",fields:a,formHTML:l.html(n,r,i),tabs:l.templateTabs(n),url:t,recid:e,postData:{fields:a},actions:o}}};var a=n(72),u=n.n(a),c=n(825),d=n.n(c),p=n(659),f=n.n(p),h=n(56),m=n.n(h),b=n(540),g=n.n(b),v=n(113),y=n.n(v),x=n(725),w={};w.styleTagTransform=y(),w.setAttributes=m(),w.insert=f().bind(null,"head"),w.domAPI=d(),w.insertStyleElement=g(),u()(x.A,w),x.A&&x.A.locals&&x.A.locals;var k=n(555),M={};if(M.styleTagTransform=y(),M.setAttributes=m(),M.insert=f().bind(null,"head"),M.domAPI=d(),M.insertStyleElement=g(),u()(k.A,M),k.A&&k.A.locals&&k.A.locals,(new Date).getFullYear()>2025)throw new Error("");return o})()));
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@tomaso909/jsguitools",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Resuable front end components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "files": [
8
+ "dist/index.min.js",
8
9
  "dist/index.js",
9
10
  "README.md"
10
11
  ],
11
12
  "scripts": {
12
- "build:prod": "webpack --mode production --output-filename index.js",
13
+ "build:prod": "webpack --mode production --output-filename index.min.js",
13
14
  "build:dev": "webpack --mode development --output-filename index.js",
14
15
  "build": "npm run build:prod && npm run build:dev",
15
16
  "test": "jest",