@evs-chris/raui
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -97,4 +97,6 @@ import Ractive from 'ractive'; | ||
this$1._media && this$1._media.listener && this$1._media.listener.silence(); | ||
this$1._media && this$1._media.observer && this$1._media.observer.silence(); | ||
this$1.fire('resize') | ||
this$1._media && this$1._media.listener && this$1._media.listener.resume(); | ||
this$1._media && this$1._media.observer && this$1._media.observer.resume(); | ||
}, (this.get('shell.slide.ms') || 400) + 10); | ||
@@ -206,3 +208,5 @@ } | ||
tm = setTimeout(function () { | ||
if (media.listener) { media.listener.silence(); } | ||
r.fire('resize'); | ||
if (media.listener) { media.listener.resume(); } | ||
tm = 0; | ||
@@ -220,3 +224,3 @@ }, (r.get('shell.slide.ms') || 400) + 100); | ||
window.addEventListener('resize', media.fn); | ||
media.observer = r.observe('@style leftOver rightOver _leftPrimary _rightPrimary', media.fn); | ||
media.observer = r.observe('@style leftOver rightOver _leftPrimary _rightPrimary', media.fn, { init: false }); | ||
if (r.get('adaptive')) { media.listener = r.root.on('*.resize', media.fn); } | ||
@@ -223,0 +227,0 @@ |
{ | ||
"name": "@evs-chris/raui", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish", | ||
@@ -26,3 +26,3 @@ "homepage": "https://github.com/evs-chris/raui", | ||
"peerDependencies": { | ||
"ractive": ">= 0.10 || edge" | ||
"ractive": ">= 0.10.2 || edge" | ||
}, | ||
@@ -29,0 +29,0 @@ "scripts": { |
@@ -74,4 +74,2 @@ import Ractive, { InitOpts as BaseInitOpts, ExtendOpts as BaseExtendOpts, Plugin } from 'ractive'; | ||
export function plugin(opts?: PluginOpts): Plugin; | ||
export default plugin; | ||
export default function(opts?: PluginOpts): Plugin; |
@@ -445,4 +445,6 @@ (function (global, factory) { | ||
this$1._media && this$1._media.listener && this$1._media.listener.silence(); | ||
this$1._media && this$1._media.observer && this$1._media.observer.silence(); | ||
this$1.fire('resize'); | ||
this$1._media && this$1._media.listener && this$1._media.listener.resume(); | ||
this$1._media && this$1._media.observer && this$1._media.observer.resume(); | ||
}, (this.get('shell.slide.ms') || 400) + 10); | ||
@@ -554,3 +556,5 @@ } | ||
tm = setTimeout(function () { | ||
if (media.listener) { media.listener.silence(); } | ||
r.fire('resize'); | ||
if (media.listener) { media.listener.resume(); } | ||
tm = 0; | ||
@@ -568,3 +572,3 @@ }, (r.get('shell.slide.ms') || 400) + 100); | ||
window.addEventListener('resize', media.fn); | ||
media.observer = r.observe('@style leftOver rightOver _leftPrimary _rightPrimary', media.fn); | ||
media.observer = r.observe('@style leftOver rightOver _leftPrimary _rightPrimary', media.fn, { init: false }); | ||
if (r.get('adaptive')) { media.listener = r.root.on('*.resize', media.fn); } | ||
@@ -571,0 +575,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMShell={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=Math.abs;function i(t){var e=Object.assign({},{distance:150,flick:200,threshold:.2},t);return function(n){var i=n.Ractive;n.instance.events[t.name||"swipe"+(t.direction||"")]=function(t,n,r){var s;void 0===r&&(r={});var o=Object.assign({},{direction:"right"},e,r);return o.fire=n,(s=t.__r_swipes__)?s.subscribe(o):(s=new l(i.getContext(t)),t.__r_swipes__=s,s.subscribe(o)),{teardown:function(){s.unsubscribe(n)}}}}}var r=i({direction:"left"}),s=i({direction:"right"}),l=(i({direction:"up"}),i({direction:"down"}),function(t){this.context=t,this.node=t.node,this.fires=[],this.bind()});function o(t){return this.__r_swipes__.mousedown(t)}function h(t){return this.__r_swipes__.touchdown(t)}function d(t){t.preventDefault()}l.prototype.subscribe=function(t){this.fires.push(t),this.hasBinding=!!this.fires.find(function(t){return t.bindPx||t.bind}),this.hasBounds=!!this.fires.find(function(t){return null!=t.maxX||null!=t.maxY||null!=t.minX||null!=t.minY})},l.prototype.unsubscribe=function(t){this.fires=this.fires.filter(function(e){return e.fire!==t}),this.fires.length||this.teardown(),this.hasBinding=!!this.fires.find(function(t){return t.bindPx||t.bind}),this.hasBounds=!!this.fires.find(function(t){return null!=t.maxX||null!=t.maxY||null!=t.minX||null!=t.minY})},l.prototype.bind=function(){"ontouchstart"in window?(this.context.listen("mousedown",o),this.context.listen("dragstart",d),this.context.listen("touchstart",h,{passive:!1})):window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",o,{passive:!1}):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",o):(this.context.listen("mousedown",o),this.context.listen("dragstart",d),this.context.listen("touchstart",h,{passive:!1}))},l.prototype.fire=function(t,e,i,r,s,l){var o,h=this,d=this.node;return this.fires.forEach(function(f){if(f.active){var c=l<f.flick?r-e+f.flick/l*(r-e):r-e,a=l<f.flick?s-i+f.flick/l*(s-i):s-i,u=n(f.threshold<=0?Math.max(c,a):f.threshold<1?"right"===f.direction||"left"===f.direction?f.threshold*c:f.threshold*a:f.threshold),g=f.bindPx,p=f.bind;c>0&&"right"===f.direction&&c>=f.distance&&n(a)<=u?(f.fire({node:d,event:t}),o=!0):c<0&&"left"===f.direction&&-c>=f.distance&&n(a)<=u&&(f.fire({node:d,event:t}),o=!0),a>0&&"down"===f.direction&&a>=f.distance&&n(c)<=u?(f.fire({node:d,event:t}),o=!0):a<0&&"up"===f.direction&&-a>=f.distance&&n(c)<=u&&(f.fire({node:d,event:t}),o=!0),g&&h.context.set(g,0),p&&h.context.set(p,0)}else f.active=!0}),o},l.prototype.checkBounds=function(t,e){var n=this.node.getBoundingClientRect(),i=t-n.x,r=e-n.y;return this.fires.forEach(function(t){var e=t.maxX,s=t.maxY,l=t.minX,o=t.minY;e>0&&i>e?t.active=!1:e<0&&i>n.width+e?t.active=!1:s>0&&r>s?t.active=!1:s<0&&r>n.height+s?t.active=!1:l>0&&i<l?t.active=!1:l<0&&i<n.width+l?t.active=!1:o>0&&r<o?t.active=!1:o<0&&r<n.width+o?t.active=!1:t.active=!0}),!!this.fires.find(function(t){return t.active})},l.prototype.updateBindings=function(t,e,i,r){var s=this;this.fires.forEach(function(l){if(l.active&&(l.bindPx||l.bind)){var o=l.bindPx,h=l.bind,d=i-t,f=r-e,c=n(l.threshold<=0?Math.max(d,f):l.threshold<1?"right"===l.direction||"left"===l.direction?l.threshold*d:l.threshold*f:l.threshold);o&&("left"===l.direction?s.context.set(o,d<0&&n(f)<=c?-d:0):"right"===l.direction?s.context.set(o,d>0&&n(f)<=c?d:0):"up"===l.direction?s.context.set(o,f<0&&n(d)<=c?-f:0):"down"===l.direction&&s.context.set(o,f>0&&n(d)<=c?f:0)),h&&("left"===l.direction?s.context.set(h,d<0&&n(f)<=c?-d/l.distance*100:0):"right"===l.direction?s.context.set(h,d>0&&n(f)<=c?d/l.distance*100:0):"up"===l.direction?s.context.set(h,f<0&&n(d)<=c?-f/l.distance*100:0):"down"===l.direction&&s.context.set(h,f>0&&n(d)<=c?f/l.distance*100:0))}})},l.prototype.mousedown=function(t){var e=this;if(!this.preventMousedownEvents&&(void 0===t.which||1===t.which)){var n=new Date,i=t.clientX,r=t.clientY;if(!this.hasBounds||this.checkBounds(i,r)){var s=t.pointerId,l=function(t){e.fire(t,i,r,t.clientX,t.clientY,new Date-n)&&!1!==t.cancelable&&t.preventDefault(),h()},o=function(t){t.pointerId==s&&e.hasBinding&&e.updateBindings(i,r,t.clientX,t.clientY)},h=function(){e.node.removeEventListener("MSPointerUp",l,!1),document.removeEventListener("MSPointerMove",o,!1),document.removeEventListener("MSPointerCancel",h,!1),document.removeEventListener("pointerup",l,!1),document.removeEventListener("pointermove",o,!1),document.removeEventListener("pointercancel",h,!1),document.removeEventListener("mouseup",l,!1),document.removeEventListener("click",l,!1),document.removeEventListener("mousemove",o,!1)};window.PointerEvent||window.navigator.pointerEnabled?(document.addEventListener("pointerup",l,!1),document.addEventListener("pointermove",o,!1),document.addEventListener("pointercancel",h,!1)):window.navigator.msPointerEnabled?(document.addEventListener("MSPointerUp",l,!1),document.addEventListener("MSPointerMove",o,!1),document.addEventListener("MSPointerCancel",h,!1)):(document.addEventListener("mouseup",l,!1),document.addEventListener("click",l,!1),document.addEventListener("mousemove",o,!1))}}},l.prototype.touchdown=function(t){var e=this,i=t.touches[0],r=new Date,s=i.clientX,l=i.clientY;if(!this.hasBounds||this.checkBounds(s,l)){var o=i.identifier,h=function(t){var n=t.changedTouches[0];n.identifier===o?(e.preventMousedownEvents=!0,clearTimeout(e.preventMousedownTimeout),e.preventMousedownTimeout=setTimeout(function(){e.preventMousedownEvents=!1},400),e.fire(t,s,l,n.clientX,n.clientY,new Date-r)&&!1!==t.cancelable&&t.preventDefault(),f()):f()},d=function(t){1===t.touches.length&&t.touches[0].identifier===o||f();var i=t.touches[0];if(t.cancelable){var r=i.clientX-s,h=i.clientY-l;n(r)>n(h)&&(r>0&&e.fires.find(function(t){return"right"===t.direction})&&t.preventDefault(),r<0&&e.fires.find(function(t){return"left"===t.direction})&&t.preventDefault())}e.hasBinding&&e.updateBindings(s,l,i.clientX,i.clientY)},f=function(){e.node.removeEventListener("touchend",h,!1),window.removeEventListener("touchmove",d,{passive:!1,capture:!1}),window.removeEventListener("touchcancel",f,!1)};this.node.addEventListener("touchend",h,!1),window.addEventListener("touchmove",d,{passive:!1,capture:!1}),window.addEventListener("touchcancel",f,!1)}},l.prototype.teardown=function(){var t=this.context;t.unlisten("pointerdown",o),t.unlisten("MSPointerDown",o),t.unlisten("mousedown",o),t.unlisten("touchstart",h),t.unlisten("dragstart",d),delete this.node.__r_swipes__};var f="undefined"!=typeof window?window:null;var c=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.adaptSize=function(t){t?(this._media&&this._media.cancel(),g(this)):this._media&&this._media.fn()},e.prototype.sizeInPx=function(t){return this.sizer?(this.sizer.style.width="number"==typeof t?t+"px":t,this.sizer.clientWidth):160},e.prototype.relativeSize=function(t,e){return void 0===e&&(e="1em"),this.sizer?this.sizeInPx(t)/this.sizeInPx(e):10},e}(e);e.extendWith(c,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell",g:1},{t:16,r:"extra-attributes"},{n:"tracked",t:71,f:{r:[],s:'["outer"]'}},{n:"class-rshell-left-popped",t:13,f:[{t:2,r:".leftPop"}]},{n:"class-rshell-right-popped",t:13,f:[{t:2,r:".rightPop"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-main",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-top",g:1},{t:4,f:[{t:16,r:"._topA"}],n:50,r:"._topA"}],f:[{t:16,r:"._top"}]}],n:50,r:"._top"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-middle",g:1},{n:"class-rshell-has-left",t:13,f:[{t:2,x:{r:["._left","._leftOver",".leftOver"],s:"_0&&!_1&&!_2"}}]},{n:"class-rshell-has-right",t:13,f:[{t:2,x:{r:["._right","._rightOver",".rightOver"],s:"_0&&!_1&&!_2"}}]},{n:"class-rshell-left-hidden",t:13,f:[{t:2,r:".leftHidden"}]},{n:"class-rshell-right-hidden",t:13,f:[{t:2,r:".rightHidden"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-modal",g:1},{n:"class-rshell-blocked",t:13,f:[{t:2,x:{r:[".blocked",".blockableLeft",".leftPull",".blockableRight",".rightPull"],s:"_0||(_1&&_2)||(_3&&_4)"}}]},{n:["click"],t:70,f:{r:["@this",".leftOver","._leftOver",".leftHidden",".rightOver","._rightOver",".rightHidden"],s:"[_0.set({leftHidden:_1||_2?true:_3,rightHidden:_4||_5?true:_6})]"}},{n:["swipeleft"],t:70,a:{r:[],s:'[{bind:".leftPush"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",true)]'}},{n:["swiperight"],t:70,a:{r:[],s:'[{bind:".rightPush"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-opacity",f:[{t:2,x:{r:[".leftPull",".rightPull"],s:"Math.min(_0||_1,100)/200"}}],t:13}],n:50,x:{r:[".leftPull",".rightPull"],s:"_0||_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-left",g:1},{n:"tracked",t:71,f:{r:[],s:'["left"]'}},{t:4,f:[{t:16,r:"._leftA"}],n:50,r:"._leftA"},{n:["click"],t:70,f:{r:["._leftOver",".leftOver","@this"],s:'[(_0||_1)&&_2.toggle("leftHidden")]'}},{n:["swipeleft"],t:70,a:{r:[],s:'[{bind:".leftPush"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(-",{t:2,x:{r:[".leftPull"],s:"100-(_0>100?100:_0)"}},"%)"],t:13}],n:50,r:".leftPull"},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(-",{t:2,x:{r:[".leftPush"],s:"_0>100?100:_0"}},"%)"],t:13}],n:50,r:".leftPush"}],f:[{t:16,r:"._left"}]}],n:50,r:"._left"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-center",g:1},{n:"tracked",t:71,f:{r:[],s:'["center"]'}},{t:4,f:[{t:16,r:"._centerA"}],n:50,r:"._centerA"},{t:4,f:[{n:["swiperight"],t:70,a:{r:[],s:'[{maxX:80,bind:".leftPull"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",false)]'}}],n:50,x:{r:["._left",".leftHidden"],s:"_0&&_1"}},{t:4,f:[{n:["swipeleft"],t:70,a:{r:[],s:'[{minX:-80,bind:".rightPull"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",false)]'}}],n:50,x:{r:["._right",".rightHidden"],s:"_0&&_1"}}],f:[{t:16,r:"._center"}]}],n:50,r:"._center"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-right",g:1},{n:"tracked",t:71,f:{r:[],s:'["right"]'}},{t:4,f:[{t:16,r:"._rightA"}],n:50,r:"._rightA"},{n:["click"],t:70,f:{r:["._rightOver",".rightOver","@this"],s:'[(_0||_1)&&_2.toggle("rightHidden")]'}},{n:["swiperight"],t:70,a:{r:[],s:'[{bind:".rightPush"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(",{t:2,x:{r:[".rightPull"],s:"100-(_0>100?100:_0)"}},"%)"],t:13}],n:50,r:".rightPull"},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(",{t:2,x:{r:[".rightPush"],s:"_0>100?100:_0"}},"%)"],t:13}],n:50,r:".rightPush"}],f:[{t:16,r:"._right"}]}],n:50,r:"._right"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-bottom",g:1},{t:4,f:[{t:16,r:"._bottomA"}],n:50,r:"._bottomA"}],f:[{t:16,r:"._bottom"}]}],n:50,r:"._bottom"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-left-pop",g:1},{t:4,f:[{t:16,r:"._leftPopA"}],n:50,r:"._leftPopA"}],f:[{t:16,r:"._leftPop"}]}],n:50,r:"._leftPop"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-right-pop",g:1},{t:4,f:[{t:16,r:"._rightPopA"}],n:50,r:"._rightPopA"}],f:[{t:16,r:"._rightPop"}]}],n:50,r:"._rightPop"}]}],e:{'["outer"]':function(){return["outer"]},'["sizer"]':function(){return["sizer"]},"_0&&!_1&&!_2":function(t,e,n){return t&&!e&&!n},"_0||(_1&&_2)||(_3&&_4)":function(t,e,n,i,r){return t||e&&n||i&&r},"[_0.set({leftHidden:_1||_2?true:_3,rightHidden:_4||_5?true:_6})]":function(t,e,n,i,r,s,l){return[t.set({leftHidden:!(!e&&!n)||i,rightHidden:!(!r&&!s)||l})]},'[{bind:".leftPush"}]':function(){return[{bind:".leftPush"}]},'[_0.set("leftHidden",true)]':function(t){return[t.set("leftHidden",!0)]},'[{bind:".rightPush"}]':function(){return[{bind:".rightPush"}]},'[_0.set("rightHidden",true)]':function(t){return[t.set("rightHidden",!0)]},"Math.min(_0||_1,100)/200":function(t,e){return Math.min(t||e,100)/200},"_0||_1":function(t,e){return t||e},'["left"]':function(){return["left"]},'[(_0||_1)&&_2.toggle("leftHidden")]':function(t,e,n){return[(t||e)&&n.toggle("leftHidden")]},"100-(_0>100?100:_0)":function(t){return 100-(t>100?100:t)},"_0>100?100:_0":function(t){return t>100?100:t},'["center"]':function(){return["center"]},'[{maxX:80,bind:".leftPull"}]':function(){return[{maxX:80,bind:".leftPull"}]},'[_0.set("leftHidden",false)]':function(t){return[t.set("leftHidden",!1)]},"_0&&_1":function(t,e){return t&&e},'[{minX:-80,bind:".rightPull"}]':function(){return[{minX:-80,bind:".rightPull"}]},'[_0.set("rightHidden",false)]':function(t){return[t.set("rightHidden",!1)]},'["right"]':function(){return["right"]},'[(_0||_1)&&_2.toggle("rightHidden")]':function(t,e,n){return[(t||e)&&n.toggle("rightHidden")]}}},css:function(t){return[function(t){var e=t("shell.left.width")||t("menu.width")||"18em",n=t("shell.right.width")||t("menu.width")||"18em";return"\n .rshell {\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n }\n .rshell-sizer {\n position: absolute;\n }\n .rshell-modal {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n background-color: #000;\n z-index: -1;\n transition: opacity "+(t("shell.slide.ms")||400)+"ms ease-in-out, z-index 0s linear "+(t("shell.slide.ms")||400)+"ms;\n }\n .rshell-modal.rshell-blocked {\n opacity: 0.5;\n z-index: 3;\n transition: opacity "+(t("shell.slide.ms")||400)+"ms ease-in-out, z-index 0s linear;\n }\n .rshell-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n }\n \n .rshell-middle {\n flex-grow: 1;\n position: relative;\n }\n \n .rshell-left, .rshell-right {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n height: 100%;\n overflow: auto;\n z-index: 4;\n background-color: "+(t("shell.menu.bg")||t("bg1")||"inherit")+";\n transition: transform "+(t("shell.slide.ms")||400)+"ms ease-in-out;\n }\n .rshell-left {\n left: 0;\n width: "+e+";\n }\n .rshell-right {\n right: 0;\n width: "+n+";\n }\n .rshell-left-hidden > .rshell-left {\n transform: translateX(-100%);\n }\n .rshell-right-hidden > .rshell-right {\n transform: translateX(100%);\n }\n .rshell-has-right > .rshell-right,\n .rshell-has-left > .rshell-left {\n z-index: 2;\n }\n .rshell-left-popped > .rshell-main > .rshell-middle > .rshell-left,\n .rshell-left-popped > .rshell-main > .rshell-middle > .rshell-right,\n .rshell-right-popped > .rshell-main > .rshell-middle > .rshell-left,\n .rshell-right-popped > .rshell-main > .rshell-middle > .rshell-right {\n z-index: 2;\n }\n \n .rshell-left-pop, .rshell-right-pop {\n z-index: 5;\n transition: transform "+(t("shell.slide.ms")||400)+"ms ease-in-out;\n position: absolute;\n top: 0;\n bottom: 0;\n }\n .rshell-left-pop {\n transform: translateX(-100%);\n }\n .rshell-left-popped > .rshell-left-pop {\n transform: none;\n }\n \n .rshell-right-pop {\n transform: translateX(100%);\n right: 0;\n }\n .rshell-right-popped > .rshell-right-pop {\n transform: none;\n }\n \n .rshell-center {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n box-sizing: border-box;\n transition: left "+(t("shell.slide.ms")||400)+"ms ease-in-out, width "+(t("shell.slide.ms")||400)+"ms ease-in-out;\n height: 100%;\n width: 100%;\n flex-grow: 1;\n overflow: auto;\n }\n .rshell-has-left > .rshell-center {\n width: calc(100% - "+e+");\n left: "+e+";\n }\n .rshell-has-right > .rshell-center {\n width: calc(100% - "+n+");\n left: 0;\n }\n .rshell-has-left.rshell-has-right > .rshell-center {\n width: calc(100% - "+e+" - "+n+");\n left: "+e+";\n }\n .rshell-has-left.rshell-left-hidden > .rshell-center {\n width: 100%;\n left: 0;\n }\n .rshell-has-right.rshell-right-hidden > .rshell-center {\n width: 100%;\n }\n .rshell-has-left.rshell-has-right.rshell-left-hidden > .rshell-center {\n width: calc(100% - "+n+");\n left: 0;\n }\n .rshell-has-left.rshell-has-right.rshell-right-hidden > .rshell-center {\n width: calc(100% - "+e+");\n left: "+e+";\n }\n .rshell-has-left.rshell-has-right.rshell-left-hidden.rshell-right-hidden > .rshell-center {\n width: 100%;\n left: 0;\n }\n "}.call(this,t)].join(" ")},attributes:["adaptive"],use:[r,s],decorators:{tracked:function(t,e){return this[e]=t,{teardown:function(){this[e]=void 0}}}},cssId:"rshell",noCssTransform:!0,computed:{blockableLeft:function(){return this.get("_left")&&(this.get("leftOver")||this.get("_leftOver"))},blockableRight:function(){return this.get("_right")&&(this.get("rightOver")||this.get("_rightOver"))},blocked:function(){return this.get("blockableLeft")&&!this.get("leftHidden")||this.get("blockableRight")&&!this.get("rightHidden")||this.get("leftPop")||this.get("rightPop")}},on:{construct:function(){var t=this.component;if(!t)return;var e=t.template.f||[],n=t.template.m?t.template.m.slice():[],i=t.template;t.template={e:i.e,f:i.f,t:i.t,m:n};var r={};e.forEach(function(t){if(~a.indexOf(t.e)){var e="left-pop"===t.e?"leftPop":"right-pop"===t.e?"rightPop":t.e;if(r["_"+e]={t:t.f},t.m){var i=t.m.filter(function(t){return!~u.indexOf(t.n)});if(i.length&&(r["_"+e+"A"]={t:i}),i.length!==t.m.length){var s=t.m.find(function(t){return"hidden"===t.n});s&&n.push({t:13,n:e+"Hidden",f:s.f}),(s=t.m.find(function(t){return"over"===t.n}))&&n.push({t:13,n:e+"Over",f:s.f}),(s=t.m.find(function(t){return"primary"===t.n}))&&n.push({t:13,n:"_"+e+"Primary",f:s.f}),~t.e.indexOf("-pop")&&(s=t.m.find(function(t){return"popped"===t.n}))&&n.push({t:13,n:e,f:s.f})}}}}),this._items=r},config:function(){this._items&&this.set(this._items)},init:function(){var t=this;this.get("@style.shell.sides.initialTimeout")&&(this.get("rightOver")||this.get("leftOver"))?setTimeout(function(){t.get("rightOver")&&t.set("rightHidden",!0),t.get("leftOver")&&t.set("leftHidden",!0)},this.get("@style.shell.sides.initialTimeout")||1500):(this.get("rightOver")&&this.set("rightHidden",!0),this.get("leftOver")&&this.set("leftHidden",!0))},complete:function(){g(this)},unrender:function(){this._media&&this._media.cancel()}},observe:{"leftHidden rightHidden":{handler:function(t,e,n){var i=this;(~n.indexOf("left")&&!this.get("leftOver")&&!this.get("_leftOver")||~n.indexOf("right")&&!this.get("rightOver")&&!this.get("_rightOver"))&&setTimeout(function(){i._media&&i._media.listener&&i._media.listener.silence(),i.fire("resize"),i._media&&i._media.listener&&i._media.listener.resume()},(this.get("shell.slide.ms")||400)+10)},defer:!0,init:!1}}});var a=["top","bottom","center","left","right","left-pop","right-pop"],u=["hidden","primary","over","popped"];function g(t){if("undefined"!=typeof window&&(t.left||t.right)){if(t._media)return t._media.fn;var e,n=0,i={fn:function(){var i={left:!t.get("leftOver")&&t.left&&t.left.clientWidth||0,right:!t.get("rightOver")&&t.right&&t.right.clientWidth||0};i.left&&(i.left=t.relativeSize(i.left)),i.right&&(i.right=t.relativeSize(i.right));var r=t.relativeSize("100%"),s=t.get("_rightPrimary")?"right":"left",l="right"===s?"left":"right",o=t.relativeSize(t.get("@style.break.medium")||"60rem","1rem"),h={_leftOver:!1,_rightOver:!1},d={leftHidden:t.get("leftOver"),rightHidden:t.get("rightOver")};n||(h.leftHidden=!1,h.rightHidden=!1);var f=r-i.left-i.right;f<=o&&(f+=i[l],d[l+"Hidden"]=!0,h["_"+l+"Over"]=!0,f<=o&&(d[s+"Hidden"]=!0,h["_"+s+"Over"]=!0)),t.set(h),n?2===n&&t.set(d):(n=1,setTimeout(function(){n=2,t.set(d)},t.get("@style.shell.sides.initialTimeout")||1500)),e&&clearTimeout(e),e=setTimeout(function(){t.fire("resize"),e=0},(t.get("shell.slide.ms")||400)+100)},cancel:function(){t._media=null,window.removeEventListener("resize",i.fn),i.observer&&i.observer.cancel(),i.listener&&i.listener.cancel()}};window.addEventListener("resize",i.fn),i.observer=t.observe("@style leftOver rightOver _leftPrimary _rightPrimary",i.fn),t.get("adaptive")&&(i.listener=t.root.on("*.resize",i.fn)),t._media=i,t._media.fn()}}function p(t){return void 0===t&&(t={}),function(e){e.instance.components[t.name||"shell"]=c}}!function(t,e,n){if(f&&f.Ractive&&"object"==typeof f.Ractive[e]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,e){var n=e.split("="),i=n[0],r=n[1];return t[i]=r,t},{})),Ractive[e][r&&r[t]||t]=n}}}("RMShell","components",c),t.Shell=c,t.plugin=p,t.default=p,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RMShell={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n=Math.abs;function i(e){var t=Object.assign({},{distance:150,flick:200,threshold:.2},e);return function(n){var i=n.Ractive;n.instance.events[e.name||"swipe"+(e.direction||"")]=function(e,n,r){var s;void 0===r&&(r={});var o=Object.assign({},{direction:"right"},t,r);return o.fire=n,(s=e.__r_swipes__)?s.subscribe(o):(s=new l(i.getContext(e)),e.__r_swipes__=s,s.subscribe(o)),{teardown:function(){s.unsubscribe(n)}}}}}var r=i({direction:"left"}),s=i({direction:"right"}),l=(i({direction:"up"}),i({direction:"down"}),function(e){this.context=e,this.node=e.node,this.fires=[],this.bind()});function o(e){return this.__r_swipes__.mousedown(e)}function h(e){return this.__r_swipes__.touchdown(e)}function d(e){e.preventDefault()}l.prototype.subscribe=function(e){this.fires.push(e),this.hasBinding=!!this.fires.find(function(e){return e.bindPx||e.bind}),this.hasBounds=!!this.fires.find(function(e){return null!=e.maxX||null!=e.maxY||null!=e.minX||null!=e.minY})},l.prototype.unsubscribe=function(e){this.fires=this.fires.filter(function(t){return t.fire!==e}),this.fires.length||this.teardown(),this.hasBinding=!!this.fires.find(function(e){return e.bindPx||e.bind}),this.hasBounds=!!this.fires.find(function(e){return null!=e.maxX||null!=e.maxY||null!=e.minX||null!=e.minY})},l.prototype.bind=function(){"ontouchstart"in window?(this.context.listen("mousedown",o),this.context.listen("dragstart",d),this.context.listen("touchstart",h,{passive:!1})):window.PointerEvent||window.navigator.pointerEnabled?this.context.listen("pointerdown",o,{passive:!1}):window.navigator.msPointerEnabled?this.context.listen("MSPointerDown",o):(this.context.listen("mousedown",o),this.context.listen("dragstart",d),this.context.listen("touchstart",h,{passive:!1}))},l.prototype.fire=function(e,t,i,r,s,l){var o,h=this,d=this.node;return this.fires.forEach(function(f){if(f.active){var c=l<f.flick?r-t+f.flick/l*(r-t):r-t,a=l<f.flick?s-i+f.flick/l*(s-i):s-i,u=n(f.threshold<=0?Math.max(c,a):f.threshold<1?"right"===f.direction||"left"===f.direction?f.threshold*c:f.threshold*a:f.threshold),g=f.bindPx,m=f.bind;c>0&&"right"===f.direction&&c>=f.distance&&n(a)<=u?(f.fire({node:d,event:e}),o=!0):c<0&&"left"===f.direction&&-c>=f.distance&&n(a)<=u&&(f.fire({node:d,event:e}),o=!0),a>0&&"down"===f.direction&&a>=f.distance&&n(c)<=u?(f.fire({node:d,event:e}),o=!0):a<0&&"up"===f.direction&&-a>=f.distance&&n(c)<=u&&(f.fire({node:d,event:e}),o=!0),g&&h.context.set(g,0),m&&h.context.set(m,0)}else f.active=!0}),o},l.prototype.checkBounds=function(e,t){var n=this.node.getBoundingClientRect(),i=e-n.x,r=t-n.y;return this.fires.forEach(function(e){var t=e.maxX,s=e.maxY,l=e.minX,o=e.minY;t>0&&i>t?e.active=!1:t<0&&i>n.width+t?e.active=!1:s>0&&r>s?e.active=!1:s<0&&r>n.height+s?e.active=!1:l>0&&i<l?e.active=!1:l<0&&i<n.width+l?e.active=!1:o>0&&r<o?e.active=!1:o<0&&r<n.width+o?e.active=!1:e.active=!0}),!!this.fires.find(function(e){return e.active})},l.prototype.updateBindings=function(e,t,i,r){var s=this;this.fires.forEach(function(l){if(l.active&&(l.bindPx||l.bind)){var o=l.bindPx,h=l.bind,d=i-e,f=r-t,c=n(l.threshold<=0?Math.max(d,f):l.threshold<1?"right"===l.direction||"left"===l.direction?l.threshold*d:l.threshold*f:l.threshold);o&&("left"===l.direction?s.context.set(o,d<0&&n(f)<=c?-d:0):"right"===l.direction?s.context.set(o,d>0&&n(f)<=c?d:0):"up"===l.direction?s.context.set(o,f<0&&n(d)<=c?-f:0):"down"===l.direction&&s.context.set(o,f>0&&n(d)<=c?f:0)),h&&("left"===l.direction?s.context.set(h,d<0&&n(f)<=c?-d/l.distance*100:0):"right"===l.direction?s.context.set(h,d>0&&n(f)<=c?d/l.distance*100:0):"up"===l.direction?s.context.set(h,f<0&&n(d)<=c?-f/l.distance*100:0):"down"===l.direction&&s.context.set(h,f>0&&n(d)<=c?f/l.distance*100:0))}})},l.prototype.mousedown=function(e){var t=this;if(!this.preventMousedownEvents&&(void 0===e.which||1===e.which)){var n=new Date,i=e.clientX,r=e.clientY;if(!this.hasBounds||this.checkBounds(i,r)){var s=e.pointerId,l=function(e){t.fire(e,i,r,e.clientX,e.clientY,new Date-n)&&!1!==e.cancelable&&e.preventDefault(),h()},o=function(e){e.pointerId==s&&t.hasBinding&&t.updateBindings(i,r,e.clientX,e.clientY)},h=function(){t.node.removeEventListener("MSPointerUp",l,!1),document.removeEventListener("MSPointerMove",o,!1),document.removeEventListener("MSPointerCancel",h,!1),document.removeEventListener("pointerup",l,!1),document.removeEventListener("pointermove",o,!1),document.removeEventListener("pointercancel",h,!1),document.removeEventListener("mouseup",l,!1),document.removeEventListener("click",l,!1),document.removeEventListener("mousemove",o,!1)};window.PointerEvent||window.navigator.pointerEnabled?(document.addEventListener("pointerup",l,!1),document.addEventListener("pointermove",o,!1),document.addEventListener("pointercancel",h,!1)):window.navigator.msPointerEnabled?(document.addEventListener("MSPointerUp",l,!1),document.addEventListener("MSPointerMove",o,!1),document.addEventListener("MSPointerCancel",h,!1)):(document.addEventListener("mouseup",l,!1),document.addEventListener("click",l,!1),document.addEventListener("mousemove",o,!1))}}},l.prototype.touchdown=function(e){var t=this,i=e.touches[0],r=new Date,s=i.clientX,l=i.clientY;if(!this.hasBounds||this.checkBounds(s,l)){var o=i.identifier,h=function(e){var n=e.changedTouches[0];n.identifier===o?(t.preventMousedownEvents=!0,clearTimeout(t.preventMousedownTimeout),t.preventMousedownTimeout=setTimeout(function(){t.preventMousedownEvents=!1},400),t.fire(e,s,l,n.clientX,n.clientY,new Date-r)&&!1!==e.cancelable&&e.preventDefault(),f()):f()},d=function(e){1===e.touches.length&&e.touches[0].identifier===o||f();var i=e.touches[0];if(e.cancelable){var r=i.clientX-s,h=i.clientY-l;n(r)>n(h)&&(r>0&&t.fires.find(function(e){return"right"===e.direction})&&e.preventDefault(),r<0&&t.fires.find(function(e){return"left"===e.direction})&&e.preventDefault())}t.hasBinding&&t.updateBindings(s,l,i.clientX,i.clientY)},f=function(){t.node.removeEventListener("touchend",h,!1),window.removeEventListener("touchmove",d,{passive:!1,capture:!1}),window.removeEventListener("touchcancel",f,!1)};this.node.addEventListener("touchend",h,!1),window.addEventListener("touchmove",d,{passive:!1,capture:!1}),window.addEventListener("touchcancel",f,!1)}},l.prototype.teardown=function(){var e=this.context;e.unlisten("pointerdown",o),e.unlisten("MSPointerDown",o),e.unlisten("mousedown",o),e.unlisten("touchstart",h),e.unlisten("dragstart",d),delete this.node.__r_swipes__};var f="undefined"!=typeof window?window:null;var c=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.adaptSize=function(e){e?(this._media&&this._media.cancel(),g(this)):this._media&&this._media.fn()},t.prototype.sizeInPx=function(e){return this.sizer?(this.sizer.style.width="number"==typeof e?e+"px":e,this.sizer.clientWidth):160},t.prototype.relativeSize=function(e,t){return void 0===t&&(t="1em"),this.sizer?this.sizeInPx(e)/this.sizeInPx(t):10},t}(t);t.extendWith(c,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell",g:1},{t:16,r:"extra-attributes"},{n:"tracked",t:71,f:{r:[],s:'["outer"]'}},{n:"class-rshell-left-popped",t:13,f:[{t:2,r:".leftPop"}]},{n:"class-rshell-right-popped",t:13,f:[{t:2,r:".rightPop"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-main",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-top",g:1},{t:4,f:[{t:16,r:"._topA"}],n:50,r:"._topA"}],f:[{t:16,r:"._top"}]}],n:50,r:"._top"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-middle",g:1},{n:"class-rshell-has-left",t:13,f:[{t:2,x:{r:["._left","._leftOver",".leftOver"],s:"_0&&!_1&&!_2"}}]},{n:"class-rshell-has-right",t:13,f:[{t:2,x:{r:["._right","._rightOver",".rightOver"],s:"_0&&!_1&&!_2"}}]},{n:"class-rshell-left-hidden",t:13,f:[{t:2,r:".leftHidden"}]},{n:"class-rshell-right-hidden",t:13,f:[{t:2,r:".rightHidden"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-modal",g:1},{n:"class-rshell-blocked",t:13,f:[{t:2,x:{r:[".blocked",".blockableLeft",".leftPull",".blockableRight",".rightPull"],s:"_0||(_1&&_2)||(_3&&_4)"}}]},{n:["click"],t:70,f:{r:["@this",".leftOver","._leftOver",".leftHidden",".rightOver","._rightOver",".rightHidden"],s:"[_0.set({leftHidden:_1||_2?true:_3,rightHidden:_4||_5?true:_6})]"}},{n:["swipeleft"],t:70,a:{r:[],s:'[{bind:".leftPush"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",true)]'}},{n:["swiperight"],t:70,a:{r:[],s:'[{bind:".rightPush"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-opacity",f:[{t:2,x:{r:[".leftPull",".rightPull"],s:"Math.min(_0||_1,100)/200"}}],t:13}],n:50,x:{r:[".leftPull",".rightPull"],s:"_0||_1"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-left",g:1},{n:"tracked",t:71,f:{r:[],s:'["left"]'}},{t:4,f:[{t:16,r:"._leftA"}],n:50,r:"._leftA"},{n:["click"],t:70,f:{r:["._leftOver",".leftOver","@this"],s:'[(_0||_1)&&_2.toggle("leftHidden")]'}},{n:["swipeleft"],t:70,a:{r:[],s:'[{bind:".leftPush"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(-",{t:2,x:{r:[".leftPull"],s:"100-(_0>100?100:_0)"}},"%)"],t:13}],n:50,r:".leftPull"},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(-",{t:2,x:{r:[".leftPush"],s:"_0>100?100:_0"}},"%)"],t:13}],n:50,r:".leftPush"}],f:[{t:16,r:"._left"}]}],n:50,r:"._left"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-center",g:1},{n:"tracked",t:71,f:{r:[],s:'["center"]'}},{t:4,f:[{t:16,r:"._centerA"}],n:50,r:"._centerA"},{t:4,f:[{n:["swiperight"],t:70,a:{r:[],s:'[{maxX:80,bind:".leftPull"}]'},f:{r:["@this"],s:'[_0.set("leftHidden",false)]'}}],n:50,x:{r:["._left",".leftHidden"],s:"_0&&_1"}},{t:4,f:[{n:["swipeleft"],t:70,a:{r:[],s:'[{minX:-80,bind:".rightPull"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",false)]'}}],n:50,x:{r:["._right",".rightHidden"],s:"_0&&_1"}}],f:[{t:16,r:"._center"}]}],n:50,r:"._center"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-right",g:1},{n:"tracked",t:71,f:{r:[],s:'["right"]'}},{t:4,f:[{t:16,r:"._rightA"}],n:50,r:"._rightA"},{n:["click"],t:70,f:{r:["._rightOver",".rightOver","@this"],s:'[(_0||_1)&&_2.toggle("rightHidden")]'}},{n:["swiperight"],t:70,a:{r:[],s:'[{bind:".rightPush"}]'},f:{r:["@this"],s:'[_0.set("rightHidden",true)]'}},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(",{t:2,x:{r:[".rightPull"],s:"100-(_0>100?100:_0)"}},"%)"],t:13}],n:50,r:".rightPull"},{t:4,f:[{n:"style-transition",f:"none",t:13},{n:"style-transform",f:["translate(",{t:2,x:{r:[".rightPush"],s:"_0>100?100:_0"}},"%)"],t:13}],n:50,r:".rightPush"}],f:[{t:16,r:"._right"}]}],n:50,r:"._right"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-bottom",g:1},{t:4,f:[{t:16,r:"._bottomA"}],n:50,r:"._bottomA"}],f:[{t:16,r:"._bottom"}]}],n:50,r:"._bottom"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-left-pop",g:1},{t:4,f:[{t:16,r:"._leftPopA"}],n:50,r:"._leftPopA"}],f:[{t:16,r:"._leftPop"}]}],n:50,r:"._leftPop"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rshell-right-pop",g:1},{t:4,f:[{t:16,r:"._rightPopA"}],n:50,r:"._rightPopA"}],f:[{t:16,r:"._rightPop"}]}],n:50,r:"._rightPop"}]}],e:{'["outer"]':function(){return["outer"]},'["sizer"]':function(){return["sizer"]},"_0&&!_1&&!_2":function(e,t,n){return e&&!t&&!n},"_0||(_1&&_2)||(_3&&_4)":function(e,t,n,i,r){return e||t&&n||i&&r},"[_0.set({leftHidden:_1||_2?true:_3,rightHidden:_4||_5?true:_6})]":function(e,t,n,i,r,s,l){return[e.set({leftHidden:!(!t&&!n)||i,rightHidden:!(!r&&!s)||l})]},'[{bind:".leftPush"}]':function(){return[{bind:".leftPush"}]},'[_0.set("leftHidden",true)]':function(e){return[e.set("leftHidden",!0)]},'[{bind:".rightPush"}]':function(){return[{bind:".rightPush"}]},'[_0.set("rightHidden",true)]':function(e){return[e.set("rightHidden",!0)]},"Math.min(_0||_1,100)/200":function(e,t){return Math.min(e||t,100)/200},"_0||_1":function(e,t){return e||t},'["left"]':function(){return["left"]},'[(_0||_1)&&_2.toggle("leftHidden")]':function(e,t,n){return[(e||t)&&n.toggle("leftHidden")]},"100-(_0>100?100:_0)":function(e){return 100-(e>100?100:e)},"_0>100?100:_0":function(e){return e>100?100:e},'["center"]':function(){return["center"]},'[{maxX:80,bind:".leftPull"}]':function(){return[{maxX:80,bind:".leftPull"}]},'[_0.set("leftHidden",false)]':function(e){return[e.set("leftHidden",!1)]},"_0&&_1":function(e,t){return e&&t},'[{minX:-80,bind:".rightPull"}]':function(){return[{minX:-80,bind:".rightPull"}]},'[_0.set("rightHidden",false)]':function(e){return[e.set("rightHidden",!1)]},'["right"]':function(){return["right"]},'[(_0||_1)&&_2.toggle("rightHidden")]':function(e,t,n){return[(e||t)&&n.toggle("rightHidden")]}}},css:function(e){return[function(e){var t=e("shell.left.width")||e("menu.width")||"18em",n=e("shell.right.width")||e("menu.width")||"18em";return"\n .rshell {\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n }\n .rshell-sizer {\n position: absolute;\n }\n .rshell-modal {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n background-color: #000;\n z-index: -1;\n transition: opacity "+(e("shell.slide.ms")||400)+"ms ease-in-out, z-index 0s linear "+(e("shell.slide.ms")||400)+"ms;\n }\n .rshell-modal.rshell-blocked {\n opacity: 0.5;\n z-index: 3;\n transition: opacity "+(e("shell.slide.ms")||400)+"ms ease-in-out, z-index 0s linear;\n }\n .rshell-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n z-index: 1;\n }\n \n .rshell-middle {\n flex-grow: 1;\n position: relative;\n }\n \n .rshell-left, .rshell-right {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n height: 100%;\n overflow: auto;\n z-index: 4;\n background-color: "+(e("shell.menu.bg")||e("bg1")||"inherit")+";\n transition: transform "+(e("shell.slide.ms")||400)+"ms ease-in-out;\n }\n .rshell-left {\n left: 0;\n width: "+t+";\n }\n .rshell-right {\n right: 0;\n width: "+n+";\n }\n .rshell-left-hidden > .rshell-left {\n transform: translateX(-100%);\n }\n .rshell-right-hidden > .rshell-right {\n transform: translateX(100%);\n }\n .rshell-has-right > .rshell-right,\n .rshell-has-left > .rshell-left {\n z-index: 2;\n }\n .rshell-left-popped > .rshell-main > .rshell-middle > .rshell-left,\n .rshell-left-popped > .rshell-main > .rshell-middle > .rshell-right,\n .rshell-right-popped > .rshell-main > .rshell-middle > .rshell-left,\n .rshell-right-popped > .rshell-main > .rshell-middle > .rshell-right {\n z-index: 2;\n }\n \n .rshell-left-pop, .rshell-right-pop {\n z-index: 5;\n transition: transform "+(e("shell.slide.ms")||400)+"ms ease-in-out;\n position: absolute;\n top: 0;\n bottom: 0;\n }\n .rshell-left-pop {\n transform: translateX(-100%);\n }\n .rshell-left-popped > .rshell-left-pop {\n transform: none;\n }\n \n .rshell-right-pop {\n transform: translateX(100%);\n right: 0;\n }\n .rshell-right-popped > .rshell-right-pop {\n transform: none;\n }\n \n .rshell-center {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n box-sizing: border-box;\n transition: left "+(e("shell.slide.ms")||400)+"ms ease-in-out, width "+(e("shell.slide.ms")||400)+"ms ease-in-out;\n height: 100%;\n width: 100%;\n flex-grow: 1;\n overflow: auto;\n }\n .rshell-has-left > .rshell-center {\n width: calc(100% - "+t+");\n left: "+t+";\n }\n .rshell-has-right > .rshell-center {\n width: calc(100% - "+n+");\n left: 0;\n }\n .rshell-has-left.rshell-has-right > .rshell-center {\n width: calc(100% - "+t+" - "+n+");\n left: "+t+";\n }\n .rshell-has-left.rshell-left-hidden > .rshell-center {\n width: 100%;\n left: 0;\n }\n .rshell-has-right.rshell-right-hidden > .rshell-center {\n width: 100%;\n }\n .rshell-has-left.rshell-has-right.rshell-left-hidden > .rshell-center {\n width: calc(100% - "+n+");\n left: 0;\n }\n .rshell-has-left.rshell-has-right.rshell-right-hidden > .rshell-center {\n width: calc(100% - "+t+");\n left: "+t+";\n }\n .rshell-has-left.rshell-has-right.rshell-left-hidden.rshell-right-hidden > .rshell-center {\n width: 100%;\n left: 0;\n }\n "}.call(this,e)].join(" ")},attributes:["adaptive"],use:[r,s],decorators:{tracked:function(e,t){return this[t]=e,{teardown:function(){this[t]=void 0}}}},cssId:"rshell",noCssTransform:!0,computed:{blockableLeft:function(){return this.get("_left")&&(this.get("leftOver")||this.get("_leftOver"))},blockableRight:function(){return this.get("_right")&&(this.get("rightOver")||this.get("_rightOver"))},blocked:function(){return this.get("blockableLeft")&&!this.get("leftHidden")||this.get("blockableRight")&&!this.get("rightHidden")||this.get("leftPop")||this.get("rightPop")}},on:{construct:function(){var e=this.component;if(!e)return;var t=e.template.f||[],n=e.template.m?e.template.m.slice():[],i=e.template;e.template={e:i.e,f:i.f,t:i.t,m:n};var r={};t.forEach(function(e){if(~a.indexOf(e.e)){var t="left-pop"===e.e?"leftPop":"right-pop"===e.e?"rightPop":e.e;if(r["_"+t]={t:e.f},e.m){var i=e.m.filter(function(e){return!~u.indexOf(e.n)});if(i.length&&(r["_"+t+"A"]={t:i}),i.length!==e.m.length){var s=e.m.find(function(e){return"hidden"===e.n});s&&n.push({t:13,n:t+"Hidden",f:s.f}),(s=e.m.find(function(e){return"over"===e.n}))&&n.push({t:13,n:t+"Over",f:s.f}),(s=e.m.find(function(e){return"primary"===e.n}))&&n.push({t:13,n:"_"+t+"Primary",f:s.f}),~e.e.indexOf("-pop")&&(s=e.m.find(function(e){return"popped"===e.n}))&&n.push({t:13,n:t,f:s.f})}}}}),this._items=r},config:function(){this._items&&this.set(this._items)},init:function(){var e=this;this.get("@style.shell.sides.initialTimeout")&&(this.get("rightOver")||this.get("leftOver"))?setTimeout(function(){e.get("rightOver")&&e.set("rightHidden",!0),e.get("leftOver")&&e.set("leftHidden",!0)},this.get("@style.shell.sides.initialTimeout")||1500):(this.get("rightOver")&&this.set("rightHidden",!0),this.get("leftOver")&&this.set("leftHidden",!0))},complete:function(){g(this)},unrender:function(){this._media&&this._media.cancel()}},observe:{"leftHidden rightHidden":{handler:function(e,t,n){var i=this;(~n.indexOf("left")&&!this.get("leftOver")&&!this.get("_leftOver")||~n.indexOf("right")&&!this.get("rightOver")&&!this.get("_rightOver"))&&setTimeout(function(){i._media&&i._media.listener&&i._media.listener.silence(),i._media&&i._media.observer&&i._media.observer.silence(),i.fire("resize"),i._media&&i._media.listener&&i._media.listener.resume(),i._media&&i._media.observer&&i._media.observer.resume()},(this.get("shell.slide.ms")||400)+10)},defer:!0,init:!1}}});var a=["top","bottom","center","left","right","left-pop","right-pop"],u=["hidden","primary","over","popped"];function g(e){if("undefined"!=typeof window&&(e.left||e.right)){if(e._media)return e._media.fn;var t,n=0,i={fn:function(){var r={left:!e.get("leftOver")&&e.left&&e.left.clientWidth||0,right:!e.get("rightOver")&&e.right&&e.right.clientWidth||0};r.left&&(r.left=e.relativeSize(r.left)),r.right&&(r.right=e.relativeSize(r.right));var s=e.relativeSize("100%"),l=e.get("_rightPrimary")?"right":"left",o="right"===l?"left":"right",h=e.relativeSize(e.get("@style.break.medium")||"60rem","1rem"),d={_leftOver:!1,_rightOver:!1},f={leftHidden:e.get("leftOver"),rightHidden:e.get("rightOver")};n||(d.leftHidden=!1,d.rightHidden=!1);var c=s-r.left-r.right;c<=h&&(c+=r[o],f[o+"Hidden"]=!0,d["_"+o+"Over"]=!0,c<=h&&(f[l+"Hidden"]=!0,d["_"+l+"Over"]=!0)),e.set(d),n?2===n&&e.set(f):(n=1,setTimeout(function(){n=2,e.set(f)},e.get("@style.shell.sides.initialTimeout")||1500)),t&&clearTimeout(t),t=setTimeout(function(){i.listener&&i.listener.silence(),e.fire("resize"),i.listener&&i.listener.resume(),t=0},(e.get("shell.slide.ms")||400)+100)},cancel:function(){e._media=null,window.removeEventListener("resize",i.fn),i.observer&&i.observer.cancel(),i.listener&&i.listener.cancel()}};window.addEventListener("resize",i.fn),i.observer=e.observe("@style leftOver rightOver _leftPrimary _rightPrimary",i.fn,{init:!1}),e.get("adaptive")&&(i.listener=e.root.on("*.resize",i.fn)),e._media=i,e._media.fn()}}function m(e){return void 0===e&&(e={}),function(t){t.instance.components[e.name||"shell"]=c}}!function(e,t,n){if(f&&f.Ractive&&"object"==typeof f.Ractive[t]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(e,t){var n=t.split("="),i=n[0],r=n[1];return e[i]=r,e},{})),Ractive[t][r&&r[e]||e]=n}}}("RMShell","components",c),e.Shell=c,e.plugin=m,e.default=m,Object.defineProperty(e,"__esModule",{value:!0})}); |
Sorry, the diff of this file is not supported yet
1026807
150
13175