sass-basis
Advanced tools
Comparing version 13.0.0 to 13.0.1
#Changelog | ||
## April 22, 2021 13.0.1 | ||
* Add `_var-margin-scale()` to `.c-row`, `_row()` and `_lattice()`. | ||
## April 22, 2021 13.0.0 | ||
@@ -4,0 +7,0 @@ * Abandon `$_base-font-size`. |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var e=function(e,t){0<e.length&&Array.prototype.slice.call(e,0).forEach((function(e,n){t(e,n)}))},t=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];try{n=new CustomEvent(t,{bubbles:o,cancelable:i,detail:r})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(t,o,i,r)}e.dispatchEvent(n)};function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o,i=function(){function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,o),this.args=t,this.args.drawer=this.args.drawer||".c-drawer",e(document.querySelectorAll(this.args.drawer),(function(e){e.addEventListener("openDrawer",(function(){return o.createCloseZone(e)}),!1),e.addEventListener("closeDrawer",(function(){return o.removeCloseZone(e)}),!1)}))}var i,a;return i=o,a=[{key:"createCloseZone",value:function(e){if(null===o.getCloseZone(e)){var n=document.createElement("div");n.classList.add("c-drawer-close-zone"),e.classList.contains("c-drawer--fixed")&&n.classList.add("c-drawer-close-zone--fixed");var r=e.getAttribute("id");n.setAttribute("id",o.generateCloseZoneId(r)),n.setAttribute("aria-controls",r),n.addEventListener("click",(function(e){return t(n,"clickDrawerCloseZone")}),!1),e.parentNode.appendChild(n)}}},{key:"removeCloseZone",value:function(e){var t=o.getCloseZone(e);null!==t&&t.parentNode.removeChild(t)}},{key:"generateCloseZoneId",value:function(e){return"".concat(e,"-close-zone")}},{key:"getCloseZone",value:function(e){var t=e.getAttribute("id"),n=o.generateCloseZoneId(t);return document.getElementById(n)}}],null&&r(i.prototype,null),a&&r(i,a),o}(),a=function(e,t){var n;try{n=new CustomEvent(t)}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,null)}e.dispatchEvent(n)},u=window.innerWidth,s=window.innerHeight;function c(e){e.setAttribute("aria-hidden","false")}function l(e){e.setAttribute("aria-hidden","true")}function f(e){e.setAttribute("aria-expanded","true")}function d(e){e.setAttribute("aria-expanded","false")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}o="inc2734/dispatch-custom-resize-event/dispatch",Boolean(sessionStorage.getItem(o))||window.addEventListener("resize",(function(){window.innerWidth!==u?(a(window,"resize:width"),u=window.innerWidth,s=window.innerHeight):function(){if(a(window,"resize:height"),window.innerHeight===s)a(window,"resize:height:undo");else{a(window,"resize:height:update");var e=/iP(hone|(o|a)d)/.test(navigator.userAgent);49<Math.abs(window.innerHeight-s)&&e&&a(window,"resize:height:ios")}}()}),!1),sessionStorage.setItem(o,!0),window.addEventListener("beforeunload",(function(){return sessionStorage.removeItem(o)}),!1);var g=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.btn=t,this.prefix=n,this._relation(),t.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.click(t.currentTarget)}),!1)}var t,n,r;return t=e,r=[{key:"click",value:function(t){"false"==t.getAttribute("aria-expanded")?e.open(t):e.close(t)}},{key:"open",value:function(t){var n=e.getMenu(t);n&&c(n),f(t)}},{key:"close",value:function(t){var n=e.getMenu(t);n&&l(n),d(t)}},{key:"getMenu",value:function(e){return document.getElementById(e.getAttribute("aria-controls"))}}],(n=[{key:"_relation",value:function(){var e,t,n,r=this.btn.nextElementSibling;if(r){var o=(e=this.prefix,t=Math.floor(8999999*Math.random()+1e6),n=(new Date).getTime(),"".concat(e,"-").concat(n).concat(t));r.setAttribute("id",o),this.btn.setAttribute("aria-controls","".concat(o))}}}])&&h(t.prototype,n),r&&h(t,r),e}();function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var b=document.activeElement,m=function(){function n(){var r=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,n),this.args=o,this.args.drawer=this.args.drawer||".c-drawer",this.args.toggle=this.args.toggle||"".concat(this.args.drawer,"__toggle"),this.args.submenu=this.args.submenu||"".concat(this.args.drawer,"__submenu"),this.args.item=this.args.item||"".concat(this.args.drawer,"__item"),this.args.subitem=this.args.subitem||"".concat(this.args.drawer,"__subitem"),e(document.querySelectorAll(this.args.drawer),(function(o){window.addEventListener("resize:width",(function(){return r._resizeWindow(o)}),!1),o.addEventListener("closeDrawer",(function(){return r._closeAllSubmenus(o)}),!1),o.addEventListener("click",(function(){return event.stopPropagation()}),!1),o.addEventListener("keydown",(function(e){return 27===e.keyCode&&n.close(o)}));var i=o.querySelectorAll("".concat(r.args.item," > a"));e(i,(function(e){return e.addEventListener("click",(function(){t(e,"clickDrawerItemLink"),n.close(o)}),!1)}));var a=o.querySelectorAll("".concat(r.args.subitem," > a"));e(a,(function(e){return e.addEventListener("click",(function(){t(e,"clickDrawerSubItemLink"),n.close(o)}),!1)}));var u=o.querySelectorAll("".concat(r.args.toggle));e(u,(function(e){new g(e,"drawer"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget.parentNode;r._closeOtherSubmenus(t)}),!1)}));var s=o.querySelectorAll([r.args.item,r.args.subitem].join(","));e(s,(function(e){e.addEventListener("focusin",(function(){var t=e.querySelector(r.args.toggle);t&&g.open(t),r._closeOtherSubmenus(e)}),!1)}))}))}var r,o,i;return r=n,i=[{key:"close",value:function(e){var n=e.parentNode,r=e.classList[0];e.classList.contains("".concat(r,"--fixed"))&&"body"===n.tagName.toLowerCase()&&n.classList.remove("u-noscroll"),t(e,"closeDrawer"),null!==b&&b.focus(),l(e)}},{key:"open",value:function(r){var o=r.parentNode,i=r.classList[0];e(o.children,(function(e){e.classList.contains(i)&&n.close(e)})),r.classList.contains("".concat(i,"--fixed"))&&"body"===o.tagName.toLowerCase()&&o.classList.add("u-noscroll"),t(r,"openDrawer"),c(r),b=document.activeElement;var a=r.querySelector('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [tabindex="-1"], [contenteditable]');null!==a&&a.focus(),r.scrollTop=0;var u=r.getAttribute("id"),s=document.querySelector('.c-drawer-close-zone[aria-controls="'.concat(u,'"]'));s&&s.addEventListener("clickDrawerCloseZone",(function(){return n.close(r)}),!1)}}],(o=[{key:"_resizeWindow",value:function(e){t(e,"resizeDrawer"),n.close(e)}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){var o=r.querySelectorAll(n.args.toggle);r!==t&&e(o,(function(e){return g.close(e)}))}))}},{key:"_closeAllSubmenus",value:function(t){var n=t.querySelectorAll(this.args.toggle);e(n,(function(e){return g.close(e)}))}}])&&p(r.prototype,o),i&&p(r,i),n}();function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var _=function(){function n(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w(this,n),this.args=r,this.args.btn=this.args.btn||".c-hamburger-btn",e(document.querySelectorAll(this.args.btn),(function(e){e.addEventListener("click",(function(e){return t._click(e)}),!1);var r=document.getElementById(e.getAttribute("aria-controls"));null!==r&&(e.addEventListener("openHamburgerBtn",(function(){return m.open(r)}),!1),e.addEventListener("closeHamburgerBtn",(function(){return m.close(r)}),!1),r.addEventListener("closeDrawer",(function(){return n.close(e)}),!1),r.addEventListener("openDrawer",(function(){return n.open(e)}),!1))}))}var r,o,i;return r=n,i=[{key:"open",value:function(e){"true"!==e.getAttribute("aria-expanded")&&f(e)}},{key:"close",value:function(e){"false"!==e.getAttribute("aria-expanded")&&d(e)}}],(o=[{key:"_click",value:function(e){e.preventDefault(),e.stopPropagation();var n=e.currentTarget;"false"===n.getAttribute("aria-expanded")?t(n,"openHamburgerBtn"):t(n,"closeHamburgerBtn")}}])&&y(r.prototype,o),i&&y(r,i),n}();function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function A(e){var t=function(){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(e){return!1}}();return function(){var n,r=C(e);if(t){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}var P=function(){function t(n,r){var o=this;O(this,t),this.wrapper=n,this.args=r,window.addEventListener("resize:width",(function(){o._closeAllSubmenus(),o._setSubmenuOpenDirection()}),!1),e(this.wrapper.querySelectorAll([this.args.item,this.args.subitem].join(",")),(function(e){return e.addEventListener("focusin",(function(){return o._closeOtherSubmenus(e)}),!1)})),this._setSubmenuOpenDirection(),this._init()}return D(t,[{key:"_setSubmenuOpenDirection",value:function(){var t=this;e(this.wrapper.querySelectorAll("".concat(this.args.item,'[aria-haspopup="true"]')),(function(e){var n=[].slice.call(e.querySelectorAll(t.args.submenu));if(!(1>n.length)){var r=e.getBoundingClientRect();if(!(r.left+r.width/2<window.innerWidth/2)){var o=n.slice(0)[0];o.classList.remove("c-navbar__submenu--turn-left");var i=n.slice(-1)[0].getBoundingClientRect();window.innerWidth<i.right&&o.classList.add("c-navbar__submenu--turn-left")}}}))}},{key:"_getItemsHasPopup",value:function(){return this.wrapper.querySelectorAll(["".concat(this.args.item,'[aria-haspopup="true"]'),"".concat(this.args.subitem,'[aria-haspopup="true"]')].join(","))}}]),t}(),j=function(t){S(r,t);var n=A(r);function r(e,t){return O(this,r),n.call(this,e,t)}return D(r,[{key:"_init",value:function(){var t=this;e(this._getItemsHasPopup(),(function(e){var n=e.querySelector(t.args.submenu);if(n){var r=function(n){c(n),t._closeOtherSubmenus(e)};e.addEventListener("mouseover",(function(){return r(n)}),!1),e.addEventListener("mouseleave",(function(){return function(e){return l(e)}(n)}),!1),e.addEventListener("focusin",(function(){return r(n)}),!1)}}))}},{key:"_closeAllSubmenus",value:function(){var t=this;e(this.wrapper.querySelectorAll(this.args.submenu),(function(e){return t._closeSubmenu(e)}))}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){r!==t&&e(r.querySelectorAll(n.args.submenu),(function(e){return n._closeSubmenu(e)}))}))}},{key:"_closeSubmenu",value:function(t){var n=this;l(t),e(t.querySelectorAll(this.args.submenu),(function(e){return n._closeSubmenu(e)}))}}]),r}(P),x=function(t){S(r,t);var n=A(r);function r(e,t){return O(this,r),n.call(this,e,t)}return D(r,[{key:"_init",value:function(){var t=this;e(this.wrapper.querySelectorAll(this.args.toggle),(function(e){new g(e,"navbar"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var n=e.currentTarget.parentNode;t._closeOtherSubmenus(n)}),!1)})),e(this._getItemsHasPopup(),(function(e){e.addEventListener("focusin",(function(){var n=e.querySelector(t.args.toggle);n&&g.open(n),t._closeOtherSubmenus(e)}),!1)}))}},{key:"_closeAllSubmenus",value:function(){e(this.wrapper.querySelectorAll(this.args.toggle),(function(e){return g.close(e)}))}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){r!==t&&e(r.querySelectorAll(n.args.toggle),(function(e){return g.close(e)}))}))}}]),r}(P),z=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,t),this.args=n,this.args.wrapper=this.args.wrapper||".c-navbar",this.args.item=this.args.item||"".concat(this.args.wrapper,"__item"),this.args.submenu=this.args.submenu||"".concat(this.args.wrapper,"__submenu"),this.args.subitem=this.args.subitem||"".concat(this.args.wrapper,"__subitem"),this.args.toggle=this.args.toggle||"".concat(this.args.wrapper,"__toggle"),e(document.querySelectorAll(this.args.wrapper),(function(e){"hover"===(e.getAttribute("data-popup-mode")||"hover")?new j(e,n):new x(e,n)}))};function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var T=function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,t),this.args=r,this.args.pageEffect=this.args.pageEffect||".c-page-effect",this.args.duration=this.args.duration||0===this.args.duration?this.args.duration:200;var o=document.querySelector(this.args.pageEffect),i=document.querySelectorAll('[data-page-effect-link="true"], a[href]:not([target="_blank"]):not([href^="#"]):not([href*="javascript"]):not([href*=".jpg"]):not([href*=".jpeg"]):not([href*=".gif"]):not([href*=".png"]):not([href*=".mov"]):not([href*=".swf"]):not([href*=".mp4"]):not([href*=".flv"]):not([href*=".avi"]):not([href*=".mp3"]):not([href*=".pdf"]):not([href*=".zip"]):not([href^="mailto:"]):not([data-page-effect-link="false"])');if(o){var a=function(){l(o),o.setAttribute("data-page-effect","fadein")},u=function(){c(o),o.setAttribute("data-page-effect","fadeout")},s=function(e){setTimeout((function(){return window.location.href=e}),n.args.duration)};window.addEventListener("load",(function(){return a()}),!1),window.addEventListener("pageshow",(function(){return a()}),!1),e(i,(function(e){e.addEventListener("click",(function(t){if(!(t.shiftKey||t.ctrlKey||t.metaKey)){if(e.hash&&window.location.pathname+window.location.search===e.pathname+e.search)return;t.preventDefault(),u(),s(e.getAttribute("href"))}}),!1)}))}};document.addEventListener("DOMContentLoaded",(function(){new i,new m({drawer:".c-drawer"}),new m({drawer:".c-dropdown"}),new _,new z,new T}),!1)}(); | ||
!function(){"use strict";var e=function(e,t){0<e.length&&Array.prototype.slice.call(e,0).forEach((function(e,n){t(e,n)}))},t=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];try{n=new CustomEvent(t,{bubbles:o,cancelable:i,detail:r})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(t,o,i,r)}e.dispatchEvent(n)};function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o,i=function(){function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,o),this.args=t,this.args.drawer=this.args.drawer||".c-drawer",e(document.querySelectorAll(this.args.drawer),(function(e){e.addEventListener("openDrawer",(function(){return o.createCloseZone(e)}),!1),e.addEventListener("closeDrawer",(function(){return o.removeCloseZone(e)}),!1)}))}var i,a;return i=o,a=[{key:"createCloseZone",value:function(e){if(null===o.getCloseZone(e)){var n=document.createElement("div");n.classList.add("c-drawer-close-zone"),e.classList.contains("c-drawer--fixed")&&n.classList.add("c-drawer-close-zone--fixed");var r=e.getAttribute("id");n.setAttribute("id",o.generateCloseZoneId(r)),n.setAttribute("aria-controls",r),n.addEventListener("click",(function(e){return t(n,"clickDrawerCloseZone")}),!1),e.parentNode.appendChild(n)}}},{key:"removeCloseZone",value:function(e){var t=o.getCloseZone(e);null!==t&&t.parentNode.removeChild(t)}},{key:"generateCloseZoneId",value:function(e){return"".concat(e,"-close-zone")}},{key:"getCloseZone",value:function(e){var t=e.getAttribute("id"),n=o.generateCloseZoneId(t);return document.getElementById(n)}}],null&&r(i.prototype,null),a&&r(i,a),o}(),a=function(e,t){var n;try{n=new CustomEvent(t)}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,null)}e.dispatchEvent(n)},u=window.innerWidth,s=window.innerHeight;function c(e){e.setAttribute("aria-hidden","false")}function l(e){e.setAttribute("aria-hidden","true")}function f(e){e.setAttribute("aria-expanded","true")}function d(e){e.setAttribute("aria-expanded","false")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}o="inc2734/dispatch-custom-resize-event/dispatch",Boolean(sessionStorage.getItem(o))||window.addEventListener("resize",(function(){window.innerWidth!==u?(a(window,"resize:width"),u=window.innerWidth,s=window.innerHeight):function(){if(a(window,"resize:height"),window.innerHeight===s)a(window,"resize:height:undo");else{a(window,"resize:height:update");var e=/iP(hone|(o|a)d)/.test(navigator.userAgent);49<Math.abs(window.innerHeight-s)&&e&&a(window,"resize:height:ios")}}()}),!1),sessionStorage.setItem(o,!0),window.addEventListener("beforeunload",(function(){return sessionStorage.removeItem(o)}),!1);var g=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.btn=t,this.prefix=n,this._relation(),t.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.click(t.currentTarget)}),!1)}var t,n,r;return t=e,r=[{key:"click",value:function(t){"false"==t.getAttribute("aria-expanded")?e.open(t):e.close(t)}},{key:"open",value:function(t){var n=e.getMenu(t);n&&c(n),f(t)}},{key:"close",value:function(t){var n=e.getMenu(t);n&&l(n),d(t)}},{key:"getMenu",value:function(e){return document.getElementById(e.getAttribute("aria-controls"))}}],(n=[{key:"_relation",value:function(){var e,t,n,r=this.btn.nextElementSibling;if(r){var o=(e=this.prefix,t=Math.floor(8999999*Math.random()+1e6),n=(new Date).getTime(),"".concat(e,"-").concat(n).concat(t));r.setAttribute("id",o),this.btn.setAttribute("aria-controls","".concat(o))}}}])&&h(t.prototype,n),r&&h(t,r),e}();function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var b=document.activeElement,m=function(){function n(){var r=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,n),this.args=o,this.args.drawer=this.args.drawer||".c-drawer",this.args.toggle=this.args.toggle||"".concat(this.args.drawer,"__toggle"),this.args.submenu=this.args.submenu||"".concat(this.args.drawer,"__submenu"),this.args.item=this.args.item||"".concat(this.args.drawer,"__item"),this.args.subitem=this.args.subitem||"".concat(this.args.drawer,"__subitem"),e(document.querySelectorAll(this.args.drawer),(function(o){window.addEventListener("resize:width",(function(){return r._resizeWindow(o)}),!1),o.addEventListener("closeDrawer",(function(){return r._closeAllSubmenus(o)}),!1),o.addEventListener("click",(function(e){return e.stopPropagation()}),!1),o.addEventListener("keydown",(function(e){return 27===e.keyCode&&n.close(o)}));var i=o.querySelectorAll("".concat(r.args.item," > a"));e(i,(function(e){return e.addEventListener("click",(function(){t(e,"clickDrawerItemLink"),n.close(o)}),!1)}));var a=o.querySelectorAll("".concat(r.args.subitem," > a"));e(a,(function(e){return e.addEventListener("click",(function(){t(e,"clickDrawerSubItemLink"),n.close(o)}),!1)}));var u=o.querySelectorAll("".concat(r.args.toggle));e(u,(function(e){new g(e,"drawer"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget.parentNode;r._closeOtherSubmenus(t)}),!1)}));var s=o.querySelectorAll([r.args.item,r.args.subitem].join(","));e(s,(function(e){e.addEventListener("focusin",(function(){var t=e.querySelector(r.args.toggle);t&&g.open(t),r._closeOtherSubmenus(e)}),!1)}))}))}var r,o,i;return r=n,i=[{key:"close",value:function(e){var n=e.parentNode,r=e.classList[0];e.classList.contains("".concat(r,"--fixed"))&&"body"===n.tagName.toLowerCase()&&n.classList.remove("u-noscroll"),t(e,"closeDrawer"),null!==b&&b.focus(),l(e)}},{key:"open",value:function(r){var o=r.parentNode,i=r.classList[0];e(o.children,(function(e){e.classList.contains(i)&&n.close(e)})),r.classList.contains("".concat(i,"--fixed"))&&"body"===o.tagName.toLowerCase()&&o.classList.add("u-noscroll"),t(r,"openDrawer"),c(r),b=document.activeElement;var a=r.querySelector('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [tabindex="-1"], [contenteditable]');null!==a&&a.focus(),r.scrollTop=0;var u=r.getAttribute("id"),s=document.querySelector('.c-drawer-close-zone[aria-controls="'.concat(u,'"]'));s&&s.addEventListener("clickDrawerCloseZone",(function(){return n.close(r)}),!1)}}],(o=[{key:"_resizeWindow",value:function(e){t(e,"resizeDrawer"),n.close(e)}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){var o=r.querySelectorAll(n.args.toggle);r!==t&&e(o,(function(e){return g.close(e)}))}))}},{key:"_closeAllSubmenus",value:function(t){var n=t.querySelectorAll(this.args.toggle);e(n,(function(e){return g.close(e)}))}}])&&p(r.prototype,o),i&&p(r,i),n}();function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var _=function(){function n(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w(this,n),this.args=r,this.args.btn=this.args.btn||".c-hamburger-btn",e(document.querySelectorAll(this.args.btn),(function(e){e.addEventListener("click",(function(e){return t._click(e)}),!1);var r=document.getElementById(e.getAttribute("aria-controls"));null!==r&&(e.addEventListener("openHamburgerBtn",(function(){return m.open(r)}),!1),e.addEventListener("closeHamburgerBtn",(function(){return m.close(r)}),!1),r.addEventListener("closeDrawer",(function(){return n.close(e)}),!1),r.addEventListener("openDrawer",(function(){return n.open(e)}),!1))}))}var r,o,i;return r=n,i=[{key:"open",value:function(e){"true"!==e.getAttribute("aria-expanded")&&f(e)}},{key:"close",value:function(e){"false"!==e.getAttribute("aria-expanded")&&d(e)}}],(o=[{key:"_click",value:function(e){e.preventDefault(),e.stopPropagation();var n=e.currentTarget;"false"===n.getAttribute("aria-expanded")?t(n,"openHamburgerBtn"):t(n,"closeHamburgerBtn")}}])&&y(r.prototype,o),i&&y(r,i),n}();function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function A(e){var t=function(){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(e){return!1}}();return function(){var n,r=C(e);if(t){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}var P=function(){function t(n,r){var o=this;O(this,t),this.wrapper=n,this.args=r,window.addEventListener("resize:width",(function(){o._closeAllSubmenus(),o._setSubmenuOpenDirection()}),!1),e(this.wrapper.querySelectorAll([this.args.item,this.args.subitem].join(",")),(function(e){return e.addEventListener("focusin",(function(){return o._closeOtherSubmenus(e)}),!1)})),this._setSubmenuOpenDirection(),this._init()}return D(t,[{key:"_setSubmenuOpenDirection",value:function(){var t=this;e(this.wrapper.querySelectorAll("".concat(this.args.item,'[aria-haspopup="true"]')),(function(e){var n=[].slice.call(e.querySelectorAll(t.args.submenu));if(!(1>n.length)){var r=e.getBoundingClientRect();if(!(r.left+r.width/2<window.innerWidth/2)){var o=n.slice(0)[0];o.classList.remove("c-navbar__submenu--turn-left");var i=n.slice(-1)[0].getBoundingClientRect();window.innerWidth<i.right&&o.classList.add("c-navbar__submenu--turn-left")}}}))}},{key:"_getItemsHasPopup",value:function(){return this.wrapper.querySelectorAll(["".concat(this.args.item,'[aria-haspopup="true"]'),"".concat(this.args.subitem,'[aria-haspopup="true"]')].join(","))}}]),t}(),j=function(t){S(r,t);var n=A(r);function r(e,t){return O(this,r),n.call(this,e,t)}return D(r,[{key:"_init",value:function(){var t=this;e(this._getItemsHasPopup(),(function(e){var n=e.querySelector(t.args.submenu);if(n){var r=function(n){c(n),t._closeOtherSubmenus(e)};e.addEventListener("mouseover",(function(){return r(n)}),!1),e.addEventListener("mouseleave",(function(){return function(e){return l(e)}(n)}),!1),e.addEventListener("focusin",(function(){return r(n)}),!1)}}))}},{key:"_closeAllSubmenus",value:function(){var t=this;e(this.wrapper.querySelectorAll(this.args.submenu),(function(e){return t._closeSubmenu(e)}))}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){r!==t&&e(r.querySelectorAll(n.args.submenu),(function(e){return n._closeSubmenu(e)}))}))}},{key:"_closeSubmenu",value:function(t){var n=this;l(t),e(t.querySelectorAll(this.args.submenu),(function(e){return n._closeSubmenu(e)}))}}]),r}(P),x=function(t){S(r,t);var n=A(r);function r(e,t){return O(this,r),n.call(this,e,t)}return D(r,[{key:"_init",value:function(){var t=this;e(this.wrapper.querySelectorAll(this.args.toggle),(function(e){new g(e,"navbar"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var n=e.currentTarget.parentNode;t._closeOtherSubmenus(n)}),!1)})),e(this._getItemsHasPopup(),(function(e){e.addEventListener("focusin",(function(){var n=e.querySelector(t.args.toggle);n&&g.open(n),t._closeOtherSubmenus(e)}),!1)}))}},{key:"_closeAllSubmenus",value:function(){e(this.wrapper.querySelectorAll(this.args.toggle),(function(e){return g.close(e)}))}},{key:"_closeOtherSubmenus",value:function(t){var n=this;e(t.parentNode.children,(function(r){r!==t&&e(r.querySelectorAll(n.args.toggle),(function(e){return g.close(e)}))}))}}]),r}(P),z=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,t),this.args=n,this.args.wrapper=this.args.wrapper||".c-navbar",this.args.item=this.args.item||"".concat(this.args.wrapper,"__item"),this.args.submenu=this.args.submenu||"".concat(this.args.wrapper,"__submenu"),this.args.subitem=this.args.subitem||"".concat(this.args.wrapper,"__subitem"),this.args.toggle=this.args.toggle||"".concat(this.args.wrapper,"__toggle"),e(document.querySelectorAll(this.args.wrapper),(function(e){"hover"===(e.getAttribute("data-popup-mode")||"hover")?new j(e,n):new x(e,n)}))};function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var T=function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I(this,t),this.args=r,this.args.pageEffect=this.args.pageEffect||".c-page-effect",this.args.duration=this.args.duration||0===this.args.duration?this.args.duration:200;var o=document.querySelector(this.args.pageEffect),i=document.querySelectorAll('[data-page-effect-link="true"], a[href]:not([target="_blank"]):not([href^="#"]):not([href*="javascript"]):not([href*=".jpg"]):not([href*=".jpeg"]):not([href*=".gif"]):not([href*=".png"]):not([href*=".mov"]):not([href*=".swf"]):not([href*=".mp4"]):not([href*=".flv"]):not([href*=".avi"]):not([href*=".mp3"]):not([href*=".pdf"]):not([href*=".zip"]):not([href^="mailto:"]):not([data-page-effect-link="false"])');if(o){var a=function(){l(o),o.setAttribute("data-page-effect","fadein")},u=function(){c(o),o.setAttribute("data-page-effect","fadeout")},s=function(e){setTimeout((function(){return window.location.href=e}),n.args.duration)};window.addEventListener("load",(function(){return a()}),!1),window.addEventListener("pageshow",(function(){return a()}),!1),e(i,(function(e){e.addEventListener("click",(function(t){if(!(t.shiftKey||t.ctrlKey||t.metaKey)){if(e.hash&&window.location.pathname+window.location.search===e.pathname+e.search)return;t.preventDefault(),u(),s(e.getAttribute("href"))}}),!1)}))}};document.addEventListener("DOMContentLoaded",(function(){new i,new m({drawer:".c-drawer"}),new m({drawer:".c-dropdown"}),new _,new z,new T}),!1)}(); |
{ | ||
"name": "sass-basis", | ||
"version": "13.0.0", | ||
"version": "13.0.1", | ||
"main": "src/css/basis.scss", | ||
@@ -5,0 +5,0 @@ "author": "inc2734", |
@@ -26,3 +26,3 @@ 'use strict'; | ||
drawer.addEventListener('closeDrawer', () => this._closeAllSubmenus(drawer), false); | ||
drawer.addEventListener('click', () => event.stopPropagation(), false); | ||
drawer.addEventListener('click', (event) => event.stopPropagation(), false); | ||
drawer.addEventListener('keydown', (event) => 27 === event.keyCode && BasisDrawer.close(drawer)); | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
371886