vizor_gui_tools 1.0.0 → 1.0.2
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/README.md +13 -12
- package/dist/vizor_gui_tools.min.js +1 -1
- package/package.json +33 -28
- package/vizor_gui_tools/src/index.js +0 -2
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# vizor_gui_tools
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
A series of GUI Tools to be used in the VIZOR ENGINE PLATFORM
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- windows
|
|
8
|
-
- menus
|
|
9
|
-
- toolboxes
|
|
10
|
-
- controls
|
|
11
|
-
- forms
|
|
12
|
-
|
|
1
|
+
# vizor_gui_tools
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
A series of GUI Tools to be used in the VIZOR ENGINE PLATFORM
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
- windows
|
|
8
|
+
- menus
|
|
9
|
+
- toolboxes
|
|
10
|
+
- controls
|
|
11
|
+
- forms
|
|
12
|
+
|
|
13
|
+
# vizor_gui_tools
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see vizor_gui_tools.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MyLibrary=e():t.MyLibrary=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}t.r(e),t.d(e,{init:()=>w,vi_WindowCreator:()=>d});var u=function(){return t=function t(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.div=document.createElement("div"),this.div.id=e,this.div.className=r,this.div.innerText=n,this.applyStyles(o)},e=[{key:"applyStyles",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var o=n(r[e],2),i=o[0],a=o[1];this.div.style[i]=a}}},{key:"appendTo",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body).appendChild(this.div)}}],e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}var f=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zIndexCounter=9999999},e=[{key:"positionDiv",value:function(t,e,r){var n=document.getElementById(t);n&&n.style&&(n.style.position="absolute",n.style.left=e+"px",n.style.top=r+"px")}},{key:"formatAsWindow",value:function(t,e,r,n){var o=this,i=t.div;$(i).html("");var a=n||"auto",u=!1,c=$(i).css("height");$(i).css({position:"fixed",border:"1px solid #6e647b",borderRadius:"7px",backgroundColor:"rgba(0, 0, 0, 0.85)",boxShadow:"rgba(0, 0, 0, .5) 19px 15px 24px",width:r+"px",height:a,minwidth:"400px",overflow:"hidden"}),$(i).addClass("hide-scrollbar-webkit"),$(i).addClass("hide-scrollbar-firefox"),$(i).addClass("hide-scrollbar-ie-edge"),$(i).on("mousedown",(function(){o.zIndexCounter++,$(i).css({zIndex:o.zIndexCounter})}));var l=$("<i>",{class:"fas fa-expand",css:{position:"absolute",bottom:"0",right:"0",cursor:"se-resize",padding:"5px",color:"#877575"}});$(i).append(l),$(i).resizable({handles:"se",minHeight:30,minWidth:400,maxHeight:"80%",maxWidth:"80%",start:function(t,e){u="30px"===$(i).css("height")},resize:function(t,e){u?$(this).resizable("option","minHeight",31):$(this).resizable("option","minHeight",c)}});var s=$("<div>",{class:"top-bar",css:{padding:"5px",backgroundColor:"#507D8C",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",cursor:"move",paddingRight:"20px"}}),f=$("<div>",{class:"top-bar-container"}),p=$("<div>",{class:"title-column",text:e}),y=$("<span>",{class:"drag-handle"});p.append(y);var h=$("<div>",{class:"icons-column",css:{"align-self":"flex-start","align-items":"flex-start"}}),d=$("<button>",{class:"collapse-button"}).append('<i class="fas fa-minus"></i>');h.append(d);var v=$("<button>",{class:"close-button"}).append('<i class="fas fa-times"></i>');h.append(v),f.append(p),f.append(h),s.append(f),$(i).prepend(s),v.on("click",(function(){$(i).css("visibility","hidden")})),d.on("click",(function(){u?($(i).css({height:c,maxHeight:"650px",visibility:"visible"}),d.find("i").removeClass("fa-plus").addClass("fa-minus"),u=!1):(c=$(i).css("height"),$(i).css({height:"55px",maxHeight:"650px",visibility:"visible"}),d.find("i").removeClass("fa-minus").addClass("fa-plus"),u=!0)}));var m,b,g=!1;s.on("mousedown",(function(t){g=!0;var e=$(i).offset();m=t.pageX-e.left,b=t.pageY-e.top})),$(document).on("mouseup",(function(){g=!1})),$(document).on("mousemove",(function(t){if(g){var e=t.pageY-b;e<0&&(e=0),$(i).css({left:t.pageX-m,top:e})}}))}},{key:"setWindowTitle",value:function(t,e){$(t).find(".title-column").text(e)}},{key:"insertHtmlContent",value:function(t,e){var r=document.getElementById(t);if(r){var n=r.querySelector(".top-bar-container");n&&n.insertAdjacentHTML("afterend",e)}}}],e&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}var d=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"create",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"Default Title",i=new u(t,"defaultClass",e,{backgroundColor:"lightblue",padding:"10px",border:"1px solid black"});return i.appendTo(),(new f).formatAsWindow(i,o,r,n),i}}],(e=null)&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function m(){m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:k(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",b={};function g(){}function w(){}function x(){}var j={};l(j,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(z([])));E&&E!==r&&n.call(E,a)&&(j=E);var L=x.prototype=g.prototype=Object.create(j);function $(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==v(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function z(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(v(e)+" is not iterable")}return w.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},$(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},$(L),l(L,c,"Generator"),l(L,a,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=z,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:z(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function b(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function g(t){return new Promise((function(e,r){var n=document.createElement("script");n.src=t,n.onload=function(){return e(t)},n.onerror=function(){return r(new Error("Failed to load script: ".concat(t)))},document.body.appendChild(n)}))}function w(){return x.apply(this,arguments)}function x(){var t;return t=m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing vizor_gui_tools"),t.prev=1,t.next=4,g("https://code.jquery.com/jquery-3.6.0.min.js");case 4:return t.next=6,g("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js");case 6:e="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",r=void 0,(r=document.createElement("link")).rel="stylesheet",r.href=e,document.head.appendChild(r),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error initializing vizor_gui_tools:",t.t0);case 12:case"end":return t.stop()}var e,r}),t,null,[[1,9]])})),x=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){b(i,n,o,a,u,"next",t)}function u(t){b(i,n,o,a,u,"throw",t)}a(void 0)}))},x.apply(this,arguments)}return e})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vizor_gui_tools=e():t.vizor_gui_tools=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}t.r(e),t.d(e,{init:()=>w,vi_WindowCreator:()=>d});var u=function(){return t=function t(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.div=document.createElement("div"),this.div.id=e,this.div.className=r,this.div.innerText=n,this.applyStyles(o)},e=[{key:"applyStyles",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var o=n(r[e],2),i=o[0],a=o[1];this.div.style[i]=a}}},{key:"appendTo",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body).appendChild(this.div)}}],e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}var f=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zIndexCounter=9999999},e=[{key:"positionDiv",value:function(t,e,r){var n=document.getElementById(t);n&&n.style&&(n.style.position="absolute",n.style.left=e+"px",n.style.top=r+"px")}},{key:"formatAsWindow",value:function(t,e,r,n){var o=this,i=t.div;$(i).html("");var a=n||"auto",u=!1,c=$(i).css("height");$(i).css({position:"fixed",border:"1px solid #6e647b",borderRadius:"15px",backgroundColor:"rgba(1, 1, 1,1)",boxShadow:"rgba(0, 0, 0, .5) 19px 15px 24px",width:r+"px",height:a,minwidth:"400px",overflow:"hidden"}),$(i).addClass("hide-scrollbar-webkit"),$(i).addClass("hide-scrollbar-firefox"),$(i).addClass("hide-scrollbar-ie-edge"),$(i).on("mousedown",(function(){o.zIndexCounter++,$(i).css({zIndex:o.zIndexCounter})}));var l=$("<i>",{class:"fas fa-expand",css:{position:"absolute",bottom:"0",right:"0",cursor:"se-resize",padding:"5px",color:"#877575"}});$(i).append(l),$(i).resizable({handles:"se",minHeight:30,minWidth:400,maxHeight:"80%",maxWidth:"80%",start:function(t,e){u="30px"===$(i).css("height")},resize:function(t,e){u?$(this).resizable("option","minHeight",31):$(this).resizable("option","minHeight",c)}});var s=$("<div>",{class:"top-bar",css:{padding:"5px",backgroundColor:"#FF00000",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",cursor:"move",paddingRight:"20px"}}),f=$("<div>",{class:"top-bar-container"}),p=$("<div>",{class:"title-column",text:e}),h=$("<span>",{class:"drag-handle"});p.append(h);var y=$("<div>",{class:"icons-column",css:{"align-self":"flex-start","align-items":"flex-start"}}),d=$("<button>",{class:"collapse-button"}).append('<i class="fas fa-minus"></i>');y.append(d);var v=$("<button>",{class:"close-button"}).append('<i class="fas fa-times"></i>');y.append(v),f.append(p),f.append(y),s.append(f),$(i).prepend(s),v.on("click",(function(){$(i).css("visibility","hidden")})),d.on("click",(function(){u?($(i).css({height:c,maxHeight:"650px",visibility:"visible"}),d.find("i").removeClass("fa-plus").addClass("fa-minus"),u=!1):(c=$(i).css("height"),$(i).css({height:"55px",maxHeight:"650px",visibility:"visible"}),d.find("i").removeClass("fa-minus").addClass("fa-plus"),u=!0)}));var m,b,g=!1;s.on("mousedown",(function(t){g=!0;var e=$(i).offset();m=t.pageX-e.left,b=t.pageY-e.top})),$(document).on("mouseup",(function(){g=!1})),$(document).on("mousemove",(function(t){if(g){var e=t.pageY-b;e<0&&(e=0),$(i).css({left:t.pageX-m,top:e})}}))}},{key:"setWindowTitle",value:function(t,e){$(t).find(".title-column").text(e)}},{key:"insertHtmlContent",value:function(t,e){var r=document.getElementById(t);if(r){var n=r.querySelector(".top-bar-container");n&&n.insertAdjacentHTML("afterend",e)}}}],e&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function y(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}var d=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"create",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"Default Title",i=new u(t,"defaultClass",e,{backgroundColor:"lightblue",padding:"10px",border:"1px solid black"});return i.appendTo(),(new f).formatAsWindow(i,o,r,n),i}}],(e=null)&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function m(){m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:k(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",b={};function g(){}function w(){}function x(){}var j={};l(j,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(z([])));E&&E!==r&&n.call(E,a)&&(j=E);var $=x.prototype=g.prototype=Object.create(j);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==v(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function z(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(v(e)+" is not iterable")}return w.prototype=x,o($,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,c,"GeneratorFunction")),t.prototype=Object.create($),t},e.awrap=function(t){return{__await:t}},L(O.prototype),l(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L($),l($,c,"Generator"),l($,a,(function(){return this})),l($,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=z,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:z(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function b(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function g(t){return new Promise((function(e,r){var n=document.createElement("script");n.src=t,n.onload=function(){return e(t)},n.onerror=function(){return r(new Error("Failed to load script: ".concat(t)))},document.body.appendChild(n)}))}function w(){return x.apply(this,arguments)}function x(){var t;return t=m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing vizor_gui_tools"),t.prev=1,t.next=4,g("https://code.jquery.com/jquery-3.6.0.min.js");case 4:return t.next=6,g("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js");case 6:e="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",r=void 0,(r=document.createElement("link")).rel="stylesheet",r.href=e,document.head.appendChild(r),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error initializing vizor_gui_tools:",t.t0);case 12:case"end":return t.stop()}var e,r}),t,null,[[1,9]])})),x=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){b(i,n,o,a,u,"next",t)}function u(t){b(i,n,o,a,u,"throw",t)}a(void 0)}))},x.apply(this,arguments)}return e})()));
|
package/package.json
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vizor_gui_tools",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "GUI tools for vizor engine",
|
|
5
|
-
"main": "vizor_gui_tools
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"dist"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vizor_gui_tools",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "GUI tools for vizor engine",
|
|
5
|
+
"main": "dist/vizor_gui_tools.min.js",
|
|
6
|
+
"module": "dist/vizor_gui_tools.min.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/vizor_gui_tools.min.js"
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
"files":[
|
|
12
|
+
"README.md",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "webpack --mode production",
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
18
|
+
},
|
|
19
|
+
"author": "Esteban Ortiz",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/core": "^7.25.2",
|
|
23
|
+
"@babel/preset-env": "^7.25.3",
|
|
24
|
+
"babel-loader": "^9.1.3",
|
|
25
|
+
"webpack": "^5.93.0",
|
|
26
|
+
"webpack-cli": "^5.1.4",
|
|
27
|
+
"webpack-dev-server": "^5.0.4"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"jquery": "^3.7.1",
|
|
31
|
+
"jquery-ui": "^1.13.3"
|
|
32
|
+
}
|
|
33
|
+
}
|