@nrk/core-tabs
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -1,2 +0,2 @@ | ||
/*! @nrk/core-tabs v2.2.0 - Copyright (c) 2017-2021 NRK */ | ||
/*! @nrk/core-tabs v2.2.1 - Copyright (c) 2017-2022 NRK */ | ||
'use strict'; | ||
@@ -23,2 +23,5 @@ | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
Object.defineProperty(Constructor, "prototype", { | ||
writable: false | ||
}); | ||
return Constructor; | ||
@@ -39,2 +42,5 @@ } | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
@@ -44,3 +50,3 @@ } | ||
function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | ||
return o.__proto__ || Object.getPrototypeOf(o); | ||
@@ -52,7 +58,6 @@ }; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -76,3 +81,3 @@ } | ||
if (_isNativeReflectConstruct()) { | ||
_construct = Reflect.construct; | ||
_construct = Reflect.construct.bind(); | ||
} else { | ||
@@ -168,5 +173,6 @@ _construct = function _construct(Parent, args, Class) { | ||
var IS_BROWSER = typeof window !== 'undefined'; | ||
var IS_ANDROID = IS_BROWSER && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
var HAS_NAVIGATOR = IS_BROWSER && typeof window.navigator !== 'undefined'; | ||
var IS_ANDROID = HAS_NAVIGATOR && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
IS_BROWSER && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
HAS_NAVIGATOR && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
// Mock HTMLElement for Node | ||
@@ -180,3 +186,3 @@ | ||
return _class; | ||
return _createClass(_class); | ||
}(); | ||
@@ -210,6 +216,6 @@ } | ||
* dispatchEvent - with infinite loop prevention | ||
* @param {Element} elem The target object | ||
* @param {String} name The source object(s) | ||
* @param {Element} element The target object | ||
* @param {String} name The event name | ||
* @param {Object} detail Detail object (bubbles and cancelable is set to true) | ||
* @return {Boolean} Whether the event was canceled | ||
* @return {Boolean} Whether the event was canceled. Returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. | ||
*/ | ||
@@ -216,0 +222,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*! @nrk/core-tabs v2.2.0 - Copyright (c) 2017-2021 NRK */ | ||
/*! @nrk/core-tabs v2.2.1 - Copyright (c) 2017-2022 NRK */ | ||
(function (global, factory) { | ||
@@ -31,2 +31,5 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) : | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
Object.defineProperty(Constructor, "prototype", { | ||
writable: false | ||
}); | ||
return Constructor; | ||
@@ -47,2 +50,5 @@ } | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
@@ -52,3 +58,3 @@ } | ||
function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | ||
return o.__proto__ || Object.getPrototypeOf(o); | ||
@@ -60,7 +66,6 @@ }; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -84,3 +89,3 @@ } | ||
if (_isNativeReflectConstruct()) { | ||
_construct = Reflect.construct; | ||
_construct = Reflect.construct.bind(); | ||
} else { | ||
@@ -176,5 +181,6 @@ _construct = function _construct(Parent, args, Class) { | ||
var IS_BROWSER = typeof window !== 'undefined'; | ||
var IS_ANDROID = IS_BROWSER && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
var HAS_NAVIGATOR = IS_BROWSER && typeof window.navigator !== 'undefined'; | ||
var IS_ANDROID = HAS_NAVIGATOR && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
IS_BROWSER && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
HAS_NAVIGATOR && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
// Mock HTMLElement for Node | ||
@@ -188,3 +194,3 @@ | ||
return _class; | ||
return _createClass(_class); | ||
}(); | ||
@@ -218,6 +224,6 @@ } | ||
* dispatchEvent - with infinite loop prevention | ||
* @param {Element} elem The target object | ||
* @param {String} name The source object(s) | ||
* @param {Element} element The target object | ||
* @param {String} name The event name | ||
* @param {Object} detail Detail object (bubbles and cancelable is set to true) | ||
* @return {Boolean} Whether the event was canceled | ||
* @return {Boolean} Whether the event was canceled. Returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. | ||
*/ | ||
@@ -482,3 +488,3 @@ | ||
var version = "2.2.0"; | ||
var version = "2.2.1"; | ||
@@ -485,0 +491,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
/*! @nrk/core-tabs v2.2.0 - Copyright (c) 2017-2021 NRK */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).coreTabs=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){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 o(t,e,n){return(o=i()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,u)}function u(){return o(t,arguments,n(this).constructor)}return u.prototype=Object.create(t.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),r(u,t)})(t)}function c(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 function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}var a="undefined"!=typeof window,s=a&&/(android)/i.test(navigator.userAgent);a&&/iPad|iPhone|iPod/.test(String(navigator.platform)),a||global.HTMLElement||(global.HTMLElement=function(){return function e(){t(this,e)}}());var l,f,b=(l="undefined"==typeof window?{}:window.Element.prototype,f=l.matches||l.msMatchesSelector||l.webkitMatchesSelector,l.closest?function(t,e){return t.closest(e)}:function(t,e){for(t.correspondingUseElement&&(t=t.correspondingUseElement);t;t=t.parentElement)if(f.call(t,e))return t;return null});function d(){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}var h=s?"data-labelledby":"aria-labelledby",p=32,v=35,y=36,m=37,g=38,w=39,E=40;function O(t){return document.getElementById(t.getAttribute("data-for")||t.getAttribute("for")||t.getAttribute("aria-controls"))}function k(t){var e;t.parentNode&&(t.tabs.forEach((function(n){e=O(n)||(e||t).nextElementSibling||e,n.id=n.id||d(),n.setAttribute("role","tab"),e&&(n.setAttribute("aria-controls",e.id=e.id||d()),e.setAttribute("role","tabpanel"),e.setAttribute("tabindex","0"))})),t.tab=t.tab)}return function(o){!function(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}}),e&&r(t,e)}(A,o);var u,a,s,l,f,d=(u=A,a=i(),function(){var t,e=n(u);if(a){var r=n(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return c(this,t)});function A(){return t(this,A),d.apply(this,arguments)}return s=A,f=[{key:"observedAttributes",get:function(){return["tab"]}}],(l=[{key:"connectedCallback",value:function(){var t=this;this.setAttribute("role","tablist"),this.addEventListener("click",this),this.addEventListener("keydown",this),this._childObserver||(this._childObserver=window.MutationObserver&&new window.MutationObserver(k.bind(null,this))),this._childObserver&&this._childObserver.observe(this,{childList:!0}),setTimeout((function(){return k(t)}))}},{key:"disconnectedCallback",value:function(){this._childObserver&&this._childObserver.disconnect(),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this._childObserver=null}},{key:"attributeChangedCallback",value:function(t,e,n){"tab"===t&&e!==n&&(this.tab=n)}},{key:"handleEvent",value:function(t){if(!(t.defaultPrevented||t.ctrlKey||t.altKey||t.metaKey)&&("click"===t.type&&(this.tab=b(t.target,'[role="tab"]')),"keydown"===t.type)){var e=t.target,n=t.keyCode,r=this.tabs,i=r.indexOf(e);if(n===p)e.click();else if(n===E||n===w)e=r[i+1]||r[0];else if(n===g||n===m)e=r[i-1]||r.pop();else if(n===v)e=r.pop();else{if(n!==y)return;e=r[0]}t.preventDefault(),e.focus()}}},{key:"panels",get:function(){return this.tabs.map(O)}},{key:"panel",get:function(){return O(this.tab)}},{key:"tabs",get:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}("button,a",this)}},{key:"tab",get:function(){var t=this.getAttribute("tab"),e=this.tabs,n=e.filter((function(t){return"true"===t.getAttribute("aria-selected")}))[0];return n||(n=e[Number(t||NaN)]||document.getElementById(t)),n||(n=e.filter((function(t){var e=O(t);return e&&!e.hasAttribute("hidden")}))[0]),n||e[0]},set:function(t){if(t||0===t){var e=this.tabs,n=this.tab,r=e.filter((function(e,n){return n===Number(t)||e===t||e.id===t}))[0]||n,i=O(r);e.forEach((function(t){var e=O(t),n=t===r;t.setAttribute("aria-selected",n),t.setAttribute("tabindex",Number(n)-1),e&&(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!this.hasAttribute(e);!n===t.hasAttribute(e)&&t[n?"setAttribute":"removeAttribute"](e,"")}(e,"hidden",e!==i),n&&e.setAttribute(h,t.id))})),this.setAttribute("tab",e.indexOf(r)),n!==r&&function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="prevent_recursive_dispatch_maximum_callstack".concat(e);if(t[i])return!0;t[i]=!0,"function"==typeof window.CustomEvent?n=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r}):(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,r);t.dispatchEvent(n);t[i]=null}(this,"tabs.toggle")}}}])&&e(s.prototype,l),f&&e(s,f),A}(u(HTMLElement))})),window.customElements.define("core-tabs",coreTabs); | ||
/*! @nrk/core-tabs v2.2.1 - Copyright (c) 2017-2022 NRK */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).coreTabs=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(){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 u(t,e,n){return u=o()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o},u.apply(null,arguments)}function c(t){var e="function"==typeof Map?new Map:void 0;return c=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return u(t,arguments,r(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),i(o,t)},c(t)}function a(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 function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}var s="undefined"!=typeof window,l=s&&void 0!==window.navigator,f=l&&/(android)/i.test(navigator.userAgent);l&&/iPad|iPhone|iPod/.test(String(navigator.platform)),s||global.HTMLElement||(global.HTMLElement=function(){return n((function e(){t(this,e)}))}());var b,d,p=(b="undefined"==typeof window?{}:window.Element.prototype,d=b.matches||b.msMatchesSelector||b.webkitMatchesSelector,b.closest?function(t,e){return t.closest(e)}:function(t,e){for(t.correspondingUseElement&&(t=t.correspondingUseElement);t;t=t.parentElement)if(d.call(t,e))return t;return null});function h(){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}var v=f?"data-labelledby":"aria-labelledby",y=32,m=35,g=36,w=37,E=38,O=39,k=40,A=function(e){!function(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&&i(t,e)}(l,e);var u,c,s=(u=l,c=o(),function(){var t,e=r(u);if(c){var n=r(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return a(this,t)});function l(){return t(this,l),s.apply(this,arguments)}return n(l,[{key:"connectedCallback",value:function(){var t=this;this.setAttribute("role","tablist"),this.addEventListener("click",this),this.addEventListener("keydown",this),this._childObserver||(this._childObserver=window.MutationObserver&&new window.MutationObserver(j.bind(null,this))),this._childObserver&&this._childObserver.observe(this,{childList:!0}),setTimeout((function(){return j(t)}))}},{key:"disconnectedCallback",value:function(){this._childObserver&&this._childObserver.disconnect(),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this._childObserver=null}},{key:"attributeChangedCallback",value:function(t,e,n){"tab"===t&&e!==n&&(this.tab=n)}},{key:"handleEvent",value:function(t){if(!(t.defaultPrevented||t.ctrlKey||t.altKey||t.metaKey)&&("click"===t.type&&(this.tab=p(t.target,'[role="tab"]')),"keydown"===t.type)){var e=t.target,n=t.keyCode,r=this.tabs,i=r.indexOf(e);if(n===y)e.click();else if(n===k||n===O)e=r[i+1]||r[0];else if(n===E||n===w)e=r[i-1]||r.pop();else if(n===m)e=r.pop();else{if(n!==g)return;e=r[0]}t.preventDefault(),e.focus()}}},{key:"panels",get:function(){return this.tabs.map(_)}},{key:"panel",get:function(){return _(this.tab)}},{key:"tabs",get:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}("button,a",this)}},{key:"tab",get:function(){var t=this.getAttribute("tab"),e=this.tabs,n=e.filter((function(t){return"true"===t.getAttribute("aria-selected")}))[0];return n||(n=e[Number(t||NaN)]||document.getElementById(t)),n||(n=e.filter((function(t){var e=_(t);return e&&!e.hasAttribute("hidden")}))[0]),n||e[0]},set:function(t){if(t||0===t){var e=this.tabs,n=this.tab,r=e.filter((function(e,n){return n===Number(t)||e===t||e.id===t}))[0]||n,i=_(r);e.forEach((function(t){var e=_(t),n=t===r;t.setAttribute("aria-selected",n),t.setAttribute("tabindex",Number(n)-1),e&&(!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!this.hasAttribute(e);!n===t.hasAttribute(e)&&t[n?"setAttribute":"removeAttribute"](e,"")}(e,"hidden",e!==i),n&&e.setAttribute(v,t.id))})),this.setAttribute("tab",e.indexOf(r)),n!==r&&function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="prevent_recursive_dispatch_maximum_callstack".concat(e);if(t[i])return!0;t[i]=!0,"function"==typeof window.CustomEvent?n=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r}):(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,r);var o=t.dispatchEvent(n);t[i]=null}(this,"tabs.toggle")}}}],[{key:"observedAttributes",get:function(){return["tab"]}}]),l}(c(HTMLElement));function _(t){return document.getElementById(t.getAttribute("data-for")||t.getAttribute("for")||t.getAttribute("aria-controls"))}function j(t){var e;t.parentNode&&(t.tabs.forEach((function(n){e=_(n)||(e||t).nextElementSibling||e,n.id=n.id||h(),n.setAttribute("role","tab"),e&&(n.setAttribute("aria-controls",e.id=e.id||h()),e.setAttribute("role","tabpanel"),e.setAttribute("tabindex","0"))})),t.tab=t.tab)}return A})),window.customElements.define("core-tabs",coreTabs); | ||
//# sourceMappingURL=core-tabs.min.js.map |
@@ -1,2 +0,2 @@ | ||
/*! @nrk/core-tabs v2.2.0 - Copyright (c) 2017-2021 NRK */ | ||
/*! @nrk/core-tabs v2.2.1 - Copyright (c) 2017-2022 NRK */ | ||
'use strict'; | ||
@@ -12,2 +12,347 @@ | ||
function _regeneratorRuntime() { | ||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | ||
_regeneratorRuntime = function () { | ||
return exports; | ||
}; | ||
var exports = {}, | ||
Op = Object.prototype, | ||
hasOwn = Op.hasOwnProperty, | ||
$Symbol = "function" == typeof Symbol ? Symbol : {}, | ||
iteratorSymbol = $Symbol.iterator || "@@iterator", | ||
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", | ||
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | ||
function define(obj, key, value) { | ||
return Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}), obj[key]; | ||
} | ||
try { | ||
define({}, ""); | ||
} catch (err) { | ||
define = function (obj, key, value) { | ||
return obj[key] = value; | ||
}; | ||
} | ||
function wrap(innerFn, outerFn, self, tryLocsList) { | ||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, | ||
generator = Object.create(protoGenerator.prototype), | ||
context = new Context(tryLocsList || []); | ||
return generator._invoke = function (innerFn, self, context) { | ||
var state = "suspendedStart"; | ||
return function (method, arg) { | ||
if ("executing" === state) throw new Error("Generator is already running"); | ||
if ("completed" === state) { | ||
if ("throw" === method) throw arg; | ||
return doneResult(); | ||
} | ||
for (context.method = method, context.arg = arg;;) { | ||
var delegate = context.delegate; | ||
if (delegate) { | ||
var delegateResult = maybeInvokeDelegate(delegate, context); | ||
if (delegateResult) { | ||
if (delegateResult === ContinueSentinel) continue; | ||
return delegateResult; | ||
} | ||
} | ||
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { | ||
if ("suspendedStart" === state) throw state = "completed", context.arg; | ||
context.dispatchException(context.arg); | ||
} else "return" === context.method && context.abrupt("return", context.arg); | ||
state = "executing"; | ||
var record = tryCatch(innerFn, self, context); | ||
if ("normal" === record.type) { | ||
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; | ||
return { | ||
value: record.arg, | ||
done: context.done | ||
}; | ||
} | ||
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); | ||
} | ||
}; | ||
}(innerFn, self, context), generator; | ||
} | ||
function tryCatch(fn, obj, arg) { | ||
try { | ||
return { | ||
type: "normal", | ||
arg: fn.call(obj, arg) | ||
}; | ||
} catch (err) { | ||
return { | ||
type: "throw", | ||
arg: err | ||
}; | ||
} | ||
} | ||
exports.wrap = wrap; | ||
var ContinueSentinel = {}; | ||
function Generator() {} | ||
function GeneratorFunction() {} | ||
function GeneratorFunctionPrototype() {} | ||
var IteratorPrototype = {}; | ||
define(IteratorPrototype, iteratorSymbol, function () { | ||
return this; | ||
}); | ||
var getProto = Object.getPrototypeOf, | ||
NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | ||
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); | ||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | ||
function defineIteratorMethods(prototype) { | ||
["next", "throw", "return"].forEach(function (method) { | ||
define(prototype, method, function (arg) { | ||
return this._invoke(method, arg); | ||
}); | ||
}); | ||
} | ||
function AsyncIterator(generator, PromiseImpl) { | ||
function invoke(method, arg, resolve, reject) { | ||
var record = tryCatch(generator[method], generator, arg); | ||
if ("throw" !== record.type) { | ||
var result = record.arg, | ||
value = result.value; | ||
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { | ||
invoke("next", value, resolve, reject); | ||
}, function (err) { | ||
invoke("throw", err, resolve, reject); | ||
}) : PromiseImpl.resolve(value).then(function (unwrapped) { | ||
result.value = unwrapped, resolve(result); | ||
}, function (error) { | ||
return invoke("throw", error, resolve, reject); | ||
}); | ||
} | ||
reject(record.arg); | ||
} | ||
var previousPromise; | ||
this._invoke = function (method, arg) { | ||
function callInvokeWithMethodAndArg() { | ||
return new PromiseImpl(function (resolve, reject) { | ||
invoke(method, arg, resolve, reject); | ||
}); | ||
} | ||
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
}; | ||
} | ||
function maybeInvokeDelegate(delegate, context) { | ||
var method = delegate.iterator[context.method]; | ||
if (undefined === method) { | ||
if (context.delegate = null, "throw" === context.method) { | ||
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; | ||
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); | ||
} | ||
return ContinueSentinel; | ||
} | ||
var record = tryCatch(method, delegate.iterator, context.arg); | ||
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; | ||
var info = record.arg; | ||
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); | ||
} | ||
function pushTryEntry(locs) { | ||
var entry = { | ||
tryLoc: locs[0] | ||
}; | ||
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); | ||
} | ||
function resetTryEntry(entry) { | ||
var record = entry.completion || {}; | ||
record.type = "normal", delete record.arg, entry.completion = record; | ||
} | ||
function Context(tryLocsList) { | ||
this.tryEntries = [{ | ||
tryLoc: "root" | ||
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); | ||
} | ||
function values(iterable) { | ||
if (iterable) { | ||
var iteratorMethod = iterable[iteratorSymbol]; | ||
if (iteratorMethod) return iteratorMethod.call(iterable); | ||
if ("function" == typeof iterable.next) return iterable; | ||
if (!isNaN(iterable.length)) { | ||
var i = -1, | ||
next = function next() { | ||
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; | ||
return next.value = undefined, next.done = !0, next; | ||
}; | ||
return next.next = next; | ||
} | ||
} | ||
return { | ||
next: doneResult | ||
}; | ||
} | ||
function doneResult() { | ||
return { | ||
value: undefined, | ||
done: !0 | ||
}; | ||
} | ||
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { | ||
var ctor = "function" == typeof genFun && genFun.constructor; | ||
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); | ||
}, exports.mark = function (genFun) { | ||
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; | ||
}, exports.awrap = function (arg) { | ||
return { | ||
__await: arg | ||
}; | ||
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { | ||
return this; | ||
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { | ||
void 0 === PromiseImpl && (PromiseImpl = Promise); | ||
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); | ||
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { | ||
return result.done ? result.value : iter.next(); | ||
}); | ||
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { | ||
return this; | ||
}), define(Gp, "toString", function () { | ||
return "[object Generator]"; | ||
}), exports.keys = function (object) { | ||
var keys = []; | ||
for (var key in object) keys.push(key); | ||
return keys.reverse(), function next() { | ||
for (; keys.length;) { | ||
var key = keys.pop(); | ||
if (key in object) return next.value = key, next.done = !1, next; | ||
} | ||
return next.done = !0, next; | ||
}; | ||
}, exports.values = values, Context.prototype = { | ||
constructor: Context, | ||
reset: function (skipTempReset) { | ||
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); | ||
}, | ||
stop: function () { | ||
this.done = !0; | ||
var rootRecord = this.tryEntries[0].completion; | ||
if ("throw" === rootRecord.type) throw rootRecord.arg; | ||
return this.rval; | ||
}, | ||
dispatchException: function (exception) { | ||
if (this.done) throw exception; | ||
var context = this; | ||
function handle(loc, caught) { | ||
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; | ||
} | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i], | ||
record = entry.completion; | ||
if ("root" === entry.tryLoc) return handle("end"); | ||
if (entry.tryLoc <= this.prev) { | ||
var hasCatch = hasOwn.call(entry, "catchLoc"), | ||
hasFinally = hasOwn.call(entry, "finallyLoc"); | ||
if (hasCatch && hasFinally) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
} else if (hasCatch) { | ||
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | ||
} else { | ||
if (!hasFinally) throw new Error("try statement without catch or finally"); | ||
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | ||
} | ||
} | ||
} | ||
}, | ||
abrupt: function (type, arg) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | ||
var finallyEntry = entry; | ||
break; | ||
} | ||
} | ||
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); | ||
var record = finallyEntry ? finallyEntry.completion : {}; | ||
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); | ||
}, | ||
complete: function (record, afterLoc) { | ||
if ("throw" === record.type) throw record.arg; | ||
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; | ||
}, | ||
finish: function (finallyLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; | ||
} | ||
}, | ||
catch: function (tryLoc) { | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc === tryLoc) { | ||
var record = entry.completion; | ||
if ("throw" === record.type) { | ||
var thrown = record.arg; | ||
resetTryEntry(entry); | ||
} | ||
return thrown; | ||
} | ||
} | ||
throw new Error("illegal catch attempt"); | ||
}, | ||
delegateYield: function (iterable, resultName, nextLoc) { | ||
return this.delegate = { | ||
iterator: values(iterable), | ||
resultName: resultName, | ||
nextLoc: nextLoc | ||
}, "next" === this.method && (this.arg = undefined), ContinueSentinel; | ||
} | ||
}, exports; | ||
} | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | ||
@@ -63,4 +408,4 @@ try { | ||
describe('core-tabs', function () { | ||
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { | ||
return _regeneratorRuntime().wrap(function _callee$(_context) { | ||
while (1) { | ||
@@ -87,4 +432,4 @@ switch (_context.prev = _context.next) { | ||
}))); | ||
it('sets up all properties', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { | ||
return regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
it('sets up all properties', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { | ||
return _regeneratorRuntime().wrap(function _callee2$(_context2) { | ||
while (1) { | ||
@@ -177,4 +522,4 @@ switch (_context2.prev = _context2.next) { | ||
}))); | ||
it('selects tab by index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { | ||
return regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
it('selects tab by index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { | ||
return _regeneratorRuntime().wrap(function _callee3$(_context3) { | ||
while (1) { | ||
@@ -217,4 +562,4 @@ switch (_context3.prev = _context3.next) { | ||
}))); | ||
it('accepts 0 as valid value to select first tab by index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() { | ||
return regeneratorRuntime.wrap(function _callee4$(_context4) { | ||
it('accepts 0 as valid value to select first tab by index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() { | ||
return _regeneratorRuntime().wrap(function _callee4$(_context4) { | ||
while (1) { | ||
@@ -257,4 +602,4 @@ switch (_context4.prev = _context4.next) { | ||
}))); | ||
it('selects tab by id', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() { | ||
return regeneratorRuntime.wrap(function _callee5$(_context5) { | ||
it('selects tab by id', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() { | ||
return _regeneratorRuntime().wrap(function _callee5$(_context5) { | ||
while (1) { | ||
@@ -293,4 +638,4 @@ switch (_context5.prev = _context5.next) { | ||
}))); | ||
it('selects tab by element', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() { | ||
return regeneratorRuntime.wrap(function _callee6$(_context6) { | ||
it('selects tab by element', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() { | ||
return _regeneratorRuntime().wrap(function _callee6$(_context6) { | ||
while (1) { | ||
@@ -329,4 +674,4 @@ switch (_context6.prev = _context6.next) { | ||
}))); | ||
it('respects "data-for" on tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() { | ||
return regeneratorRuntime.wrap(function _callee7$(_context7) { | ||
it('respects "data-for" on tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { | ||
return _regeneratorRuntime().wrap(function _callee7$(_context7) { | ||
while (1) { | ||
@@ -375,4 +720,4 @@ switch (_context7.prev = _context7.next) { | ||
}))); | ||
it('respects deprecated "for" on tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() { | ||
return regeneratorRuntime.wrap(function _callee8$(_context8) { | ||
it('respects deprecated "for" on tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { | ||
return _regeneratorRuntime().wrap(function _callee8$(_context8) { | ||
while (1) { | ||
@@ -421,4 +766,4 @@ switch (_context8.prev = _context8.next) { | ||
}))); | ||
it('respects "data-for" for single panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() { | ||
return regeneratorRuntime.wrap(function _callee9$(_context9) { | ||
it('respects "data-for" for single panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() { | ||
return _regeneratorRuntime().wrap(function _callee9$(_context9) { | ||
while (1) { | ||
@@ -461,4 +806,4 @@ switch (_context9.prev = _context9.next) { | ||
}))); | ||
it('respects hidden panels as indication of active tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() { | ||
return regeneratorRuntime.wrap(function _callee10$(_context10) { | ||
it('respects hidden panels as indication of active tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() { | ||
return _regeneratorRuntime().wrap(function _callee10$(_context10) { | ||
while (1) { | ||
@@ -495,4 +840,4 @@ switch (_context10.prev = _context10.next) { | ||
}))); | ||
it('handles setup and interaction with dynamically added tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() { | ||
return regeneratorRuntime.wrap(function _callee11$(_context11) { | ||
it('handles setup and interaction with dynamically added tabs', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() { | ||
return _regeneratorRuntime().wrap(function _callee11$(_context11) { | ||
while (1) { | ||
@@ -550,4 +895,4 @@ switch (_context11.prev = _context11.next) { | ||
describe('dispatches toggle-event', function () { | ||
it('does not trigger toggle-event during setup', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() { | ||
return regeneratorRuntime.wrap(function _callee12$(_context12) { | ||
it('does not trigger toggle-event during setup', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() { | ||
return _regeneratorRuntime().wrap(function _callee12$(_context12) { | ||
while (1) { | ||
@@ -587,4 +932,4 @@ switch (_context12.prev = _context12.next) { | ||
}))); | ||
it('does not trigger toggle-event during setup with tab-attribute set using id', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() { | ||
return regeneratorRuntime.wrap(function _callee13$(_context13) { | ||
it('does not trigger toggle-event during setup with tab-attribute set using id', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() { | ||
return _regeneratorRuntime().wrap(function _callee13$(_context13) { | ||
while (1) { | ||
@@ -624,4 +969,4 @@ switch (_context13.prev = _context13.next) { | ||
}))); | ||
it('does not trigger toggle-event during setup with tab-attribute set using index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() { | ||
return regeneratorRuntime.wrap(function _callee14$(_context14) { | ||
it('does not trigger toggle-event during setup with tab-attribute set using index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() { | ||
return _regeneratorRuntime().wrap(function _callee14$(_context14) { | ||
while (1) { | ||
@@ -661,5 +1006,5 @@ switch (_context14.prev = _context14.next) { | ||
}))); | ||
it('triggers toggle event on tab change', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() { | ||
it('triggers toggle event on tab change', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() { | ||
var tabId; | ||
return regeneratorRuntime.wrap(function _callee15$(_context15) { | ||
return _regeneratorRuntime().wrap(function _callee15$(_context15) { | ||
while (1) { | ||
@@ -714,4 +1059,4 @@ switch (_context15.prev = _context15.next) { | ||
describe('supports optional attribute "tab"', function () { | ||
it('takes an integer-value as index of selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() { | ||
return regeneratorRuntime.wrap(function _callee16$(_context16) { | ||
it('takes an integer-value as index of selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() { | ||
return _regeneratorRuntime().wrap(function _callee16$(_context16) { | ||
while (1) { | ||
@@ -744,4 +1089,4 @@ switch (_context16.prev = _context16.next) { | ||
}))); | ||
it('takes an id of a tab as selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() { | ||
return regeneratorRuntime.wrap(function _callee17$(_context17) { | ||
it('takes an id of a tab as selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() { | ||
return _regeneratorRuntime().wrap(function _callee17$(_context17) { | ||
while (1) { | ||
@@ -774,4 +1119,4 @@ switch (_context17.prev = _context17.next) { | ||
}))); | ||
it('accepts id in tab-attribute and updates the value to corresponding index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() { | ||
return regeneratorRuntime.wrap(function _callee18$(_context18) { | ||
it('accepts id in tab-attribute and updates the value to corresponding index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() { | ||
return _regeneratorRuntime().wrap(function _callee18$(_context18) { | ||
while (1) { | ||
@@ -820,4 +1165,4 @@ switch (_context18.prev = _context18.next) { | ||
}))); | ||
it('updates the attribute value on change, respecting index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() { | ||
return regeneratorRuntime.wrap(function _callee19$(_context19) { | ||
it('updates the attribute value on change, respecting index', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() { | ||
return _regeneratorRuntime().wrap(function _callee19$(_context19) { | ||
while (1) { | ||
@@ -866,4 +1211,4 @@ switch (_context19.prev = _context19.next) { | ||
}))); | ||
it('sets/updates attribute value even when not set initially', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() { | ||
return regeneratorRuntime.wrap(function _callee20$(_context20) { | ||
it('sets/updates attribute value even when not set initially', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() { | ||
return _regeneratorRuntime().wrap(function _callee20$(_context20) { | ||
while (1) { | ||
@@ -912,4 +1257,4 @@ switch (_context20.prev = _context20.next) { | ||
}))); | ||
it('updates tab attribute to reflect index-change and keeps the correct active panel when preceding tabs are removed from the DOM', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() { | ||
return regeneratorRuntime.wrap(function _callee21$(_context21) { | ||
it('updates tab attribute to reflect index-change and keeps the correct active panel when preceding tabs are removed from the DOM', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() { | ||
return _regeneratorRuntime().wrap(function _callee21$(_context21) { | ||
while (1) { | ||
@@ -968,4 +1313,4 @@ switch (_context21.prev = _context21.next) { | ||
describe('supports fewer panels than tabs, e.g used with dynamic content', function () { | ||
it('gracefully works without panels', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() { | ||
return regeneratorRuntime.wrap(function _callee22$(_context22) { | ||
it('gracefully works without panels', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() { | ||
return _regeneratorRuntime().wrap(function _callee22$(_context22) { | ||
while (1) { | ||
@@ -1079,4 +1424,4 @@ switch (_context22.prev = _context22.next) { | ||
}))); | ||
it('defaults to aria-labelledBy to the first tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23() { | ||
return regeneratorRuntime.wrap(function _callee23$(_context23) { | ||
it('defaults to aria-labelledBy to the first tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() { | ||
return _regeneratorRuntime().wrap(function _callee23$(_context23) { | ||
while (1) { | ||
@@ -1101,4 +1446,4 @@ switch (_context23.prev = _context23.next) { | ||
}))); | ||
it('assigns aria-labelledBy to match the selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24() { | ||
return regeneratorRuntime.wrap(function _callee24$(_context24) { | ||
it('assigns aria-labelledBy to match the selected tab', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() { | ||
return _regeneratorRuntime().wrap(function _callee24$(_context24) { | ||
while (1) { | ||
@@ -1127,4 +1472,4 @@ switch (_context24.prev = _context24.next) { | ||
}))); | ||
it('updates aria-labelledBy on tab change', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25() { | ||
return regeneratorRuntime.wrap(function _callee25$(_context25) { | ||
it('updates aria-labelledBy on tab change', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() { | ||
return _regeneratorRuntime().wrap(function _callee25$(_context25) { | ||
while (1) { | ||
@@ -1131,0 +1476,0 @@ switch (_context25.prev = _context25.next) { |
30
jsx.js
@@ -1,2 +0,2 @@ | ||
/*! @nrk/core-tabs v2.2.0 - Copyright (c) 2017-2021 NRK */ | ||
/*! @nrk/core-tabs v2.2.1 - Copyright (c) 2017-2022 NRK */ | ||
'use strict'; | ||
@@ -29,2 +29,5 @@ | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
Object.defineProperty(Constructor, "prototype", { | ||
writable: false | ||
}); | ||
return Constructor; | ||
@@ -45,2 +48,5 @@ } | ||
}); | ||
Object.defineProperty(subClass, "prototype", { | ||
writable: false | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
@@ -50,3 +56,3 @@ } | ||
function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | ||
return o.__proto__ || Object.getPrototypeOf(o); | ||
@@ -58,7 +64,6 @@ }; | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
@@ -82,3 +87,3 @@ } | ||
if (_isNativeReflectConstruct()) { | ||
_construct = Reflect.construct; | ||
_construct = Reflect.construct.bind(); | ||
} else { | ||
@@ -174,5 +179,6 @@ _construct = function _construct(Parent, args, Class) { | ||
var IS_BROWSER = typeof window !== 'undefined'; | ||
var IS_ANDROID = IS_BROWSER && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
var HAS_NAVIGATOR = IS_BROWSER && typeof window.navigator !== 'undefined'; | ||
var IS_ANDROID = HAS_NAVIGATOR && /(android)/i.test(navigator.userAgent); // Bad, but needed | ||
IS_BROWSER && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
HAS_NAVIGATOR && /iPad|iPhone|iPod/.test(String(navigator.platform)); | ||
// Mock HTMLElement for Node | ||
@@ -186,3 +192,3 @@ | ||
return _class; | ||
return _createClass(_class); | ||
}(); | ||
@@ -216,6 +222,6 @@ } | ||
* dispatchEvent - with infinite loop prevention | ||
* @param {Element} elem The target object | ||
* @param {String} name The source object(s) | ||
* @param {Element} element The target object | ||
* @param {String} name The event name | ||
* @param {Object} detail Detail object (bubbles and cancelable is set to true) | ||
* @return {Boolean} Whether the event was canceled | ||
* @return {Boolean} Whether the event was canceled. Returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. | ||
*/ | ||
@@ -480,3 +486,3 @@ | ||
var version = "2.2.0"; | ||
var version = "2.2.1"; | ||
@@ -483,0 +489,0 @@ /** |
@@ -5,3 +5,3 @@ { | ||
"author": "NRK <opensource@nrk.no> (https://www.nrk.no/)", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "core-tabs.cjs.js", |
@@ -237,3 +237,3 @@ # Core Tabs | ||
```html | ||
<script src="https://static.nrk.no/core-components/major/9/core-tabs/core-tabs.min.js"></script> <!-- Using static --> | ||
<script src="https://static.nrk.no/core-components/major/10/core-tabs/core-tabs.min.js"></script> <!-- Using static --> | ||
``` | ||
@@ -240,0 +240,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
216658
3375