website-utilities 1.0.368 → 1.0.370
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/index.js +1 -1
- package/package.json +28 -28
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],e);else{var n="object"==typeof exports?e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):e(t["@babel/runtime/helpers/asyncToGenerator"],t["@babel/runtime/helpers/extends"],t["@babel/runtime/helpers/inheritsLoose"],t["@babel/runtime/regenerator"],t.clientnode);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(this,(function(t,e,n,o,i){return function(){var r=[,,,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=o},function(t){t.exports=i}],a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return r[t](n,n.exports,s),n.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var l={};return function(){s.r(l),s.d(l,{WebsiteUtilities:function(){return b},default:function(){return y}});var t=s(3),e=s.n(t),n=s(4),o=s.n(n),i=s(5),r=s.n(i),a=s(6),d=s.n(a),c=s(7),u=function(){return u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},p={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},h=function(){function t(t){void 0===t&&(t={}),this.opts=u(u({},p),t)}return t.prototype.spin=function(t){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),t&&t.insertBefore(this.el,t.firstChild||null),function(t,e){var n=Math.round(e.corners*e.width*500)/1e3+"px",o="none";!0===e.shadow?o="0 2px 4px #000":"string"==typeof e.shadow&&(o=e.shadow);for(var i=function(t){for(var e=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,n=[],o=0,i=t.split(",");o<i.length;o++){var r=i[o].match(e);if(null!==r){var a=+r[2],s=+r[5],l=r[4],d=r[7];0!==a||l||(l=d),0!==s||d||(d=l),l===d&&n.push({prefix:r[1]||"",x:a,y:s,xUnits:l,yUnits:d,end:r[8]})}}return n}(o),r=0;r<e.lines;r++){var a=~~(360/e.lines*r+e.rotate),s=document.createElement("div");s.style.position="absolute",s.style.top="".concat(-e.width/2,"px"),s.style.width=e.length+e.width+"px",s.style.height=e.width+"px",s.style.background=m(e.fadeColor,r),s.style.borderRadius=n,s.style.transformOrigin="left",s.style.transform="rotate(".concat(a,"deg) translateX(").concat(e.radius,"px)");var l=r*e.direction/e.lines/e.speed;l-=1/e.speed;var d=document.createElement("div");d.style.width="100%",d.style.height="100%",d.style.background=m(e.color,r),d.style.borderRadius=n,d.style.boxShadow=f(i,a),d.style.animation="".concat(1/e.speed,"s linear ").concat(l,"s infinite ").concat(e.animation),s.appendChild(d),t.appendChild(s)}}(this.el,this.opts),this},t.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},t}();function m(t,e){return"string"==typeof t?t:t[e%t.length]}function f(t,e){for(var n=[],o=0,i=t;o<i.length;o++){var r=i[o],a=g(r.x,r.y,e);n.push(r.prefix+a[0]+r.xUnits+" "+a[1]+r.yUnits+r.end)}return n.join(", ")}function g(t,e,n){var o=n*Math.PI/180,i=Math.sin(o),r=Math.cos(o);return[Math.round(1e3*(t*r+e*i))/1e3,Math.round(1e3*(-t*i+e*r))/1e3]}function w(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return v(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var b=function(t){function n(){for(var e,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).options=null,e.$domNodes=null,e.currentMediaQueryMode="",e.currentSectionName="home",e.languageHandler=null,e.startUpAnimationIsComplete=!1,e.viewportIsOnTop=!1,e.windowLoaded=!1,e.windowLoadingSpinner=null,e._onViewportMovesToTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",0):(e.options.scrollToTop.button.hideAnimationOptions.always=function(){return e.$domNodes.scrollToTopButton.css({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"none"})},e.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),opacity:0},e.options.scrollToTop.button.hideAnimationOptions))})),e._onViewportMovesAwayFromTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",1):e.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},e.options.scrollToTop.button.showAnimationOptions)})),e}r()(n,t);var i=n.prototype;return i.initialize=function(e){var o=this;return void 0===e&&(e={}),t.prototype.initialize.call(this,(0,c.extend)(!0,{},n._defaultOptions,e)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(t){var e;o.$domNodes.windowLoadingSpinner.length&&(o.windowLoadingSpinner=new h(o.options.windowLoadingSpinner),o.windowLoadingSpinner.spin(o.$domNodes.windowLoadingSpinner[0])),o._bindScrollEvents(),null==(e=o.$domNodes.parent)||e.show();var n=function(){o.windowLoaded||(o.windowLoaded=!0,o._removeLoadingCover().then((function(){o._performStartUpEffects(),t(o)})))};(0,c.$)((function(){(0,c.timeout)(n,o.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),o.on(o.$domNodes.window,"load",n),o._bindClickTracking(),o.options.language.logging||(o.options.language.logging=o.options.logging),o.options.activateLanguageSupport&&!o.languageHandler&&(0,c.$)(o.$domNodes.parent).Internationalisation(o.options.language).then((function(t){o.languageHandler=t.data("Internationalisation")})),o._bindNavigationEvents(),o._bindMediaQueryChangeEvents(),o._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){var t;return null==(t=this.$domNodes.parent)||t.addClass("disable-scrolling").on("touchmove",(function(t){t.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent&&(this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent)),this},i.track=function(t){var e;if(null!=(e=c.globalContext.window)&&e.location&&this.options.tracking){var n=o()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},t);(isNaN(n.value)||"number"!=typeof n.value)&&(n.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(n);try{this.options.tracking.track(n)}catch(t){this.warn('Problem in tracking "'+(0,c.represent)(n)+'": '+(0,c.represent)(t))}}return this},i._onChangeMediaQueryMode=function(t,e){},i._onChangeToLargeMode=function(t,e){},i._onChangeToMediumMode=function(t,e){},i._onChangeToSmallMode=function(t,e){},i._onChangeToExtraSmallMode=function(t,e){},i._onSwitchSection=function(t){var e;if(Object.prototype.hasOwnProperty.call(c.globalContext.window,"location")&&null!=(e=this.options.tracking)&&e.sectionSwitch&&this.currentSectionName!==t){this.currentSectionName=t,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(t){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+(0,c.represent)(t))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var o,i=w(this.options.mediaQueryClassNameIndicator);!(o=i()).done;){var r=o.value;this.$domNodes.parent&&this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.fireEvent.apply(this,["changeTo"+(0,c.capitalize)(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var t,e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=(0,c.$)("body, html"),a=this.$domNodes.window?r.add(this.$domNodes.window):r;a.on(this.options.knownScrollEventNames.join(" "),(function(t){e.options.switchToManualScrollingIndicator(t)&&a.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){var t;null!=(t=e.$domNodes.window)&&t.scrollTop()?e.viewportIsOnTop&&(e.viewportIsOnTop=!1,e.fireEvent.apply(e,["viewportMovesAwayFromTop",!1,e].concat(o))):e.viewportIsOnTop||(e.viewportIsOnTop=!0,e.fireEvent.apply(e,["viewportMovesToTop",!1,e].concat(o)))})),null!=(t=this.$domNodes.window)&&t.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(o))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(o)))},i._removeLoadingCover=function(){var t=e()(d().mark((function t(){var e=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.timeout)(this.options.additionalPageLoadingTimeInMilliseconds);case 2:return(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substring(1))).css(this.options.startUpHide),t.next=5,new Promise((function(t){e.$domNodes.windowLoadingCover.length?(e.enableScrolling(),e.$domNodes.windowLoadingCover.animate(e.options.windowLoadingCoverHideAnimation,{always:function(){t()}})):t()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),i._performStartUpEffects=function(){var t=e()(d().mark((function t(e){var n,o=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substring(1))).length){t.next=17;break}return t.next=6,(0,c.timeout)(this.options.startUpAnimationElementDelayInMilliseconds);case 6:if(n=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+String(e)).animate(this.options.startUpShowAnimation,{always:function(){n&&o.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+String(e+1)).length){t.next=14;break}return t.next=12,this._performStartUpEffects(e+1);case 12:t.next=15;break;case 14:n=!0;case 15:t.next=18;break;case 17:this.fireEvent("startUpAnimationComplete");case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var t,e=this;null==(t=c.globalContext.window)||t.addEventListener("hashchange",(function(t){e.startUpAnimationIsComplete&&e.fireEvent("switchSection",!1,e,location.hash.substring(1),t)}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var t=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(e){e.preventDefault(),t.scrollToTop()}))},i._bindClickTracking=function(){var t,e,n=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(null==(t=this.$domNodes.parent)?void 0:t.find("a"),"click",(function(t){var e;null==(e=n.options.tracking)||null==(e=e.linkClick)||e.call(n,(0,c.$)(t.target),t)})),this.options.tracking.buttonClick&&this.on(null==(e=this.$domNodes.parent)?void 0:e.find("button"),"click",(function(t){var e;null==(e=n.options.tracking)||null==(e=e.buttonClick)||e.call(n,(0,c.$)(t.target),t)})))},n}(c.Tools);b._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:c.NOOP,onChangeToExtraSmallMode:c.NOOP,onChangeToLargeMode:c.NOOP,onChangeToMediumMode:c.NOOP,onChangeToSmallMode:c.NOOP,onViewportMovesAwayFromTop:c.NOOP,onViewportMovesToTop:c.NOOP,onSwitchSection:c.NOOP,onStartUpAnimationComplete:c.NOOP,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMilliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(t){return"number"==typeof t.which&&t.which>0||"mousedown"===t.type||"mousewheel"===t.type||"touchmove"===t.type},tracking:{buttonClick:function(t){this.track({event:"buttonClick",eventType:"click",label:t.text(),reference:t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"button",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(t){this.track({event:"linkClick",eventType:"click",label:t.text(),reference:t.attr("href")||t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"link",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(t){var e;null!=(e=c.globalContext.window)&&e.location&&this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:t,reference:c.globalContext.window.location.pathname+"#"+t,subject:"url",userInteraction:!1})},track:function(t){var e;null==(e=c.globalContext.dataLayer)||e.push(t)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var y=b;c.$.WebsiteUtilities=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c.Tools.controller(b,e)},c.$.WebsiteUtilities.class=b}(),l}()}));
|
|
1
|
+
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],e);else{var n="object"==typeof exports?e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):e(t["@babel/runtime/helpers/asyncToGenerator"],t["@babel/runtime/helpers/extends"],t["@babel/runtime/helpers/inheritsLoose"],t["@babel/runtime/regenerator"],t.clientnode);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(this,(function(t,e,n,o,i){return function(){var r=[,,,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=n},function(t){t.exports=o},function(t){t.exports=i}],a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return r[t](n,n.exports,s),n.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var l={};return function(){s.r(l),s.d(l,{WebsiteUtilities:function(){return b},default:function(){return y}});var t=s(3),e=s.n(t),n=s(4),o=s.n(n),i=s(5),r=s.n(i),a=s(6),d=s.n(a),c=s(7),u=function(){return u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},p={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},h=function(){function t(t){void 0===t&&(t={}),this.opts=u(u({},p),t)}return t.prototype.spin=function(t){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),t&&t.insertBefore(this.el,t.firstChild||null),function(t,e){var n=Math.round(e.corners*e.width*500)/1e3+"px",o="none";!0===e.shadow?o="0 2px 4px #000":"string"==typeof e.shadow&&(o=e.shadow);for(var i=function(t){for(var e=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,n=[],o=0,i=t.split(",");o<i.length;o++){var r=i[o].match(e);if(null!==r){var a=+r[2],s=+r[5],l=r[4],d=r[7];0!==a||l||(l=d),0!==s||d||(d=l),l===d&&n.push({prefix:r[1]||"",x:a,y:s,xUnits:l,yUnits:d,end:r[8]})}}return n}(o),r=0;r<e.lines;r++){var a=~~(360/e.lines*r+e.rotate),s=document.createElement("div");s.style.position="absolute",s.style.top="".concat(-e.width/2,"px"),s.style.width=e.length+e.width+"px",s.style.height=e.width+"px",s.style.background=m(e.fadeColor,r),s.style.borderRadius=n,s.style.transformOrigin="left",s.style.transform="rotate(".concat(a,"deg) translateX(").concat(e.radius,"px)");var l=r*e.direction/e.lines/e.speed;l-=1/e.speed;var d=document.createElement("div");d.style.width="100%",d.style.height="100%",d.style.background=m(e.color,r),d.style.borderRadius=n,d.style.boxShadow=f(i,a),d.style.animation="".concat(1/e.speed,"s linear ").concat(l,"s infinite ").concat(e.animation),s.appendChild(d),t.appendChild(s)}}(this.el,this.opts),this},t.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},t}();function m(t,e){return"string"==typeof t?t:t[e%t.length]}function f(t,e){for(var n=[],o=0,i=t;o<i.length;o++){var r=i[o],a=g(r.x,r.y,e);n.push(r.prefix+a[0]+r.xUnits+" "+a[1]+r.yUnits+r.end)}return n.join(", ")}function g(t,e,n){var o=n*Math.PI/180,i=Math.sin(o),r=Math.cos(o);return[Math.round(1e3*(t*r+e*i))/1e3,Math.round(1e3*(-t*i+e*r))/1e3]}function w(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return v(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}var b=function(t){function n(){for(var e,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).options=null,e.$domNodes=null,e.currentMediaQueryMode="",e.currentSectionName="home",e.languageHandler=null,e.startUpAnimationIsComplete=!1,e.viewportIsOnTop=!1,e.windowLoaded=!1,e.windowLoadingSpinner=null,e._onViewportMovesToTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",0):(e.options.scrollToTop.button.hideAnimationOptions.always=function(){return e.$domNodes.scrollToTopButton.css({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"none"})},e.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),opacity:0},e.options.scrollToTop.button.hideAnimationOptions))})),e._onViewportMovesAwayFromTop=(0,c.debounce)((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",1):e.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},e.options.scrollToTop.button.showAnimationOptions)})),e}r()(n,t);var i=n.prototype;return i.initialize=function(e){var o=this;return void 0===e&&(e={}),t.prototype.initialize.call(this,(0,c.extend)(!0,{},n._defaultOptions,e)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(t){var e;o.$domNodes.windowLoadingSpinner.length&&(o.windowLoadingSpinner=new h(o.options.windowLoadingSpinner),o.windowLoadingSpinner.spin(o.$domNodes.windowLoadingSpinner[0])),o._bindScrollEvents(),null==(e=o.$domNodes.parent)||e.show();var n=function(){o.windowLoaded||(o.windowLoaded=!0,o._removeLoadingCover().then((function(){o._performStartUpEffects(),t(o)})))};(0,c.$)((function(){(0,c.timeout)(n,o.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),o.on(o.$domNodes.window,"load",n),o._bindClickTracking(),o.options.language.logging||(o.options.language.logging=o.options.logging),o.options.activateLanguageSupport&&!o.languageHandler&&(0,c.$)(o.$domNodes.parent).Internationalisation(o.options.language).then((function(t){o.languageHandler=t.data("Internationalisation")})),o._bindNavigationEvents(),o._bindMediaQueryChangeEvents(),o._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){var t;return null==(t=this.$domNodes.parent)||t.addClass("disable-scrolling").on("touchmove",(function(t){t.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent&&(this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent)),this},i.track=function(t){var e;if(null!=(e=c.globalContext.window)&&e.location&&this.options.tracking){var n=o()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},t);(isNaN(n.value)||"number"!=typeof n.value)&&(n.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(n);try{this.options.tracking.track(n)}catch(t){this.warn('Problem in tracking "'+(0,c.represent)(n)+'": '+(0,c.represent)(t))}}return this},i._onChangeMediaQueryMode=function(t,e){},i._onChangeToLargeMode=function(t,e){},i._onChangeToMediumMode=function(t,e){},i._onChangeToSmallMode=function(t,e){},i._onChangeToExtraSmallMode=function(t,e){},i._onSwitchSection=function(t){var e;if(Object.prototype.hasOwnProperty.call(c.globalContext.window,"location")&&null!=(e=this.options.tracking)&&e.sectionSwitch&&this.currentSectionName!==t){this.currentSectionName=t,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(t){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+(0,c.represent)(t))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var o,i=w(this.options.mediaQueryClassNameIndicator);!(o=i()).done;){var r=o.value;this.$domNodes.parent&&this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.fireEvent.apply(this,["changeTo"+(0,c.capitalize)(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var t,e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=(0,c.$)("body, html"),a=this.$domNodes.window?r.add(this.$domNodes.window):r;a.on(this.options.knownScrollEventNames.join(" "),(function(t){e.options.switchToManualScrollingIndicator(t)&&a.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){var t;null!=(t=e.$domNodes.window)&&t.scrollTop()?e.viewportIsOnTop&&(e.viewportIsOnTop=!1,e.fireEvent.apply(e,["viewportMovesAwayFromTop",!1,e].concat(o))):e.viewportIsOnTop||(e.viewportIsOnTop=!0,e.fireEvent.apply(e,["viewportMovesToTop",!1,e].concat(o)))})),null!=(t=this.$domNodes.window)&&t.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(o))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(o)))},i._removeLoadingCover=function(){var t=e()(d().mark((function t(){var e=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,c.timeout)(this.options.additionalPageLoadingTimeInMilliseconds);case 1:return(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substring(1))).css(this.options.startUpHide),t.next=2,new Promise((function(t){e.$domNodes.windowLoadingCover.length?(e.enableScrolling(),e.$domNodes.windowLoadingCover.animate(e.options.windowLoadingCoverHideAnimation,{always:function(){t()}})):t()}));case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),i._performStartUpEffects=function(){var t=e()(d().mark((function t(e){var n,o=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)((0,c.format)('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substring(1))).length){t.next=5;break}return t.next=1,(0,c.timeout)(this.options.startUpAnimationElementDelayInMilliseconds);case 1:if(n=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+String(e)).animate(this.options.startUpShowAnimation,{always:function(){n&&o.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+String(e+1)).length){t.next=3;break}return t.next=2,this._performStartUpEffects(e+1);case 2:t.next=4;break;case 3:n=!0;case 4:t.next=6;break;case 5:this.fireEvent("startUpAnimationComplete");case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var t,e=this;null==(t=c.globalContext.window)||t.addEventListener("hashchange",(function(t){e.startUpAnimationIsComplete&&e.fireEvent("switchSection",!1,e,location.hash.substring(1),t)}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var t=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(e){e.preventDefault(),t.scrollToTop()}))},i._bindClickTracking=function(){var t,e,n=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(null==(t=this.$domNodes.parent)?void 0:t.find("a"),"click",(function(t){var e;null==(e=n.options.tracking)||null==(e=e.linkClick)||e.call(n,(0,c.$)(t.target),t)})),this.options.tracking.buttonClick&&this.on(null==(e=this.$domNodes.parent)?void 0:e.find("button"),"click",(function(t){var e;null==(e=n.options.tracking)||null==(e=e.buttonClick)||e.call(n,(0,c.$)(t.target),t)})))},n}(c.Tools);b._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:c.NOOP,onChangeToExtraSmallMode:c.NOOP,onChangeToLargeMode:c.NOOP,onChangeToMediumMode:c.NOOP,onChangeToSmallMode:c.NOOP,onViewportMovesAwayFromTop:c.NOOP,onViewportMovesToTop:c.NOOP,onSwitchSection:c.NOOP,onStartUpAnimationComplete:c.NOOP,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMilliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(t){return"number"==typeof t.which&&t.which>0||"mousedown"===t.type||"mousewheel"===t.type||"touchmove"===t.type},tracking:{buttonClick:function(t){this.track({event:"buttonClick",eventType:"click",label:t.text(),reference:t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"button",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(t){this.track({event:"linkClick",eventType:"click",label:t.text(),reference:t.attr("href")||t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"link",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(t){var e;null!=(e=c.globalContext.window)&&e.location&&this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:t,reference:c.globalContext.window.location.pathname+"#"+t,subject:"url",userInteraction:!1})},track:function(t){var e;null==(e=c.globalContext.dataLayer)||e.push(t)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var y=b;c.$.WebsiteUtilities=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c.Tools.controller(b,e)},c.$.WebsiteUtilities.class=b}(),l}()}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "website-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.370",
|
|
4
4
|
"description": "extend your web app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jquery",
|
|
@@ -61,45 +61,45 @@
|
|
|
61
61
|
"watch": "weboptimizer build --watch"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@babel/eslint-parser": "^7.
|
|
64
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
65
65
|
"@babel/plugin-transform-proto-to-assign": "^7.27.1",
|
|
66
|
-
"@babel/runtime": "^7.
|
|
67
|
-
"@stylistic/eslint-plugin": "^5.
|
|
66
|
+
"@babel/runtime": "^7.28.4",
|
|
67
|
+
"@stylistic/eslint-plugin": "^5.5.0",
|
|
68
68
|
"@types/ejs": "^3.1.5",
|
|
69
|
-
"@types/html-minifier": "^4.0.
|
|
70
|
-
"@types/jquery": "^3.5.
|
|
71
|
-
"@types/jsdom": "^
|
|
72
|
-
"@types/node": "^24.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
74
|
-
"@typescript-eslint/parser": "^8.
|
|
75
|
-
"clientnode": "^3.0.
|
|
69
|
+
"@types/html-minifier": "^4.0.6",
|
|
70
|
+
"@types/jquery": "^3.5.33",
|
|
71
|
+
"@types/jsdom": "^27.0.0",
|
|
72
|
+
"@types/node": "^24.9.2",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
74
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
75
|
+
"clientnode": "^3.0.1315",
|
|
76
76
|
"css-loader": "^7.1.2",
|
|
77
|
-
"cssnano": "^7.
|
|
78
|
-
"documentation-website": "^1.0.
|
|
79
|
-
"eslint": "^9.
|
|
77
|
+
"cssnano": "^7.1.1",
|
|
78
|
+
"documentation-website": "^1.0.394",
|
|
79
|
+
"eslint": "^9.38.0",
|
|
80
80
|
"eslint-config-google": "^0.14.0",
|
|
81
|
-
"eslint-plugin-jsdoc": "^
|
|
82
|
-
"internationalisation": "^1.0.
|
|
83
|
-
"jest": "^30.0
|
|
81
|
+
"eslint-plugin-jsdoc": "^61.1.10",
|
|
82
|
+
"internationalisation": "^1.0.341",
|
|
83
|
+
"jest": "^30.2.0",
|
|
84
84
|
"jquery": "^3.7.1",
|
|
85
|
-
"jsdoc": "^4.0.
|
|
86
|
-
"mini-css-extract-plugin": "^2.9.
|
|
85
|
+
"jsdoc": "^4.0.5",
|
|
86
|
+
"mini-css-extract-plugin": "^2.9.4",
|
|
87
87
|
"postcss": "^8.5.6",
|
|
88
88
|
"postcss-fontpath": "^1.0.0",
|
|
89
89
|
"postcss-import": "^16.1.1",
|
|
90
|
-
"postcss-loader": "^8.
|
|
91
|
-
"postcss-preset-env": "^10.
|
|
90
|
+
"postcss-loader": "^8.2.0",
|
|
91
|
+
"postcss-preset-env": "^10.4.0",
|
|
92
92
|
"postcss-scss": "^4.0.9",
|
|
93
93
|
"postcss-sprites": "^4.2.1",
|
|
94
94
|
"postcss-url": "^10.1.3",
|
|
95
|
-
"sass": "^1.
|
|
96
|
-
"sass-loader": "^16.0.
|
|
95
|
+
"sass": "^1.93.2",
|
|
96
|
+
"sass-loader": "^16.0.6",
|
|
97
97
|
"spin.js": "^4.1.2",
|
|
98
98
|
"style-loader": "^4.0.0",
|
|
99
|
-
"stylelint": "^16.
|
|
100
|
-
"stylelint-config-standard-scss": "^
|
|
101
|
-
"typescript-eslint": "^8.
|
|
102
|
-
"weboptimizer": "^2.0.
|
|
99
|
+
"stylelint": "^16.25.0",
|
|
100
|
+
"stylelint-config-standard-scss": "^16.0.0",
|
|
101
|
+
"typescript-eslint": "^8.46.2",
|
|
102
|
+
"weboptimizer": "^2.0.1620",
|
|
103
103
|
"webpack-dev-server": "^5.2.2"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
@@ -283,5 +283,5 @@
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
},
|
|
286
|
-
"packageManager": "yarn@4.
|
|
286
|
+
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
|
287
287
|
}
|