| 1 |
"use strict";function _typeof(t){return(_typeof="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})(t)}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,_toPropertyKey(i.key),i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=_superPropBase(t,e);if(i)return(i=Object.getOwnPropertyDescriptor(i,e)).get?i.get.call(arguments.length<3?t:n):i.value}).apply(this,arguments)}function _superPropBase(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _createSuper(n){var i=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(n);return _possibleConstructorReturn(this,i?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _possibleConstructorReturn(t,e){if(e&&("object"===_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}window.addEventListener("DOMContentLoaded",function(){var e=function(){_inherits(e,elementorModules.frontend.handlers.Base);var t=_createSuper(e);function e(){return _classCallCheck(this,e),t.apply(this,arguments)}return _createClass(e,[{key:"getDefaultElements",value:function(){return{$wdigetContainer:this.findElement(".e-n-tabs"),$tabTitles:this.findElement(".e-n-tab-title"),$tabContents:this.findElement(".e-n-tabs-content > .e-con"),$headingContainer:this.findElement(".e-n-tabs-heading")}}},{key:"onInit",value:function(){_get(_getPrototypeOf(e.prototype),"onInit",this).apply(this,arguments),console.log("NestedCarouselFront"),console.log(this.elements),this.activateDefaultTab(),this.bindEvents()}},{key:"isActiveTab",value:function(t){return"true"===this.elements.$tabTitles.filter('[data-tab-index="'+t+'"]').attr("aria-selected")}},{key:"changeActiveTab",value:function(t){if(1<arguments.length&&void 0!==arguments[1]&&arguments[1]&&this.isEdit&&this.isElementInTheCurrentDocument())return window.top.$e.run("document/repeater/select",{container:elementor.getContainer(this.$element.attr("data-id")),index:parseInt(t)});var e=this.isActiveTab(t),n=this.getSettings();!n.toggleSelf&&e||!n.hidePrevious||this.deactivateActiveTab(t),!n.hidePrevious&&e&&this.deactivateActiveTab(t),e||this.activateTab(t)}},{key:"onHideTabContent",value:function(){}},{key:"deactivateActiveTab",value:function(t){var e=this,n="e-active",i=this.elements.$tabTitles.filter('[aria-selected="true"]'),r=this.elements.$tabContents.filter(".e-active");return this.setTabDeactivationAttributes(i,t),r.removeClass(n),r.hide(0,function(){return e.onHideTabContent(r)}),r}},{key:"setTabDeactivationAttributes",value:function(t){t.attr(_defineProperty({tabindex:"-1"},"aria-selected","false"))}},{key:"activateDefaultTab",value:function(){var t=this.getEditSettings("activeItemIndex")||1;this.setSettings({showTabFn:"show",hideTabFn:"hide"}),this.changeActiveTab(t),this.setSettings({showTabFn:"show",hideTabFn:"hide"}),this.elements.$wdigetContainer.addClass("e-activated")}},{key:"activateTab",value:function(t){var e=this,n=this.getSettings().classes.active,i=this.elements.$tabTitles.filter(this.getTabTitleFilterSelector(t)),r=this.elements.$tabContents.filter(this.getTabContentFilterSelector(t));i.length||(t=Math.max(t-1,1),i=this.elements.$tabTitles.filter(this.getTabTitleFilterSelector(t)),r=this.elements.$tabContents.filter(this.getTabContentFilterSelector(t))),i.attr(this.getTitleActivationAttributes()),r.addClass(n),r.show(0,function(){return e.onShowTabContent(r)})}},{key:"linkContainer",value:function(t){t.detail.container.model.get("id")===this.$element.data("id")&&(elementor.$preview[0].contentWindow.dispatchEvent(new CustomEvent("elementor/elements/link-data-bindings")),elementorFrontend.elementsHandler.runReadyTrigger(this.$element[0]),this.updateIndexValues($slides))}},{key:"updateIndexValues",value:function(){settings=this.getSettings(),itemIdBase=$tabTitles[0].getAttribute("id").slice(0,-1),containerIdBase=$tabContents[0].getAttribute("id").slice(0,-1),console.log(itemIdBase),console.log($tabTitles),$tabTitles.each(function(t,e){var n=t+1,i=itemIdBase+n,r=containerIdBase+n;e.setAttribute("id",i),e.setAttribute("style","--n-tabs-title-order: ".concat(n)),e.setAttribute("data-tab-index",n),e.querySelector(".e-n-tab-title-text").setAttribute("data-binding-index",n),e.querySelector(".e-n-tab-title-text").setAttribute("aria-controls",i),$tabContents[t].setAttribute("aria-labelledby",i),$tabContents[t].setAttribute("data-tab-index",i),$tabContents[t].setAttribute("id",r),$tabContents[t].setAttribute("style","--n-tabs-title-order: ".concat(n))})}},{key:"bindEvents",value:function(){elementorFrontend.elements.$window.on("elementor/nested-container/atomic-repeater",this.linkContainer.bind(this))}},{key:"unbindEvents",value:function(){this.elements.$tabTitles.off(),this.elements.$headingContainer.off(),this.elements.$tabContents.children().off(),elementorFrontend.elements.$window.off("resize"),elementorFrontend.elements.$window.off("elementor/uicore-tabs/activate")}}]),e}();jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/uicore-tabs.default",function(t){elementorFrontend.elementsHandler.addHandler(e,{$element:t})})})}); |