@evs-chris/raui
Advanced tools
Comparing version 0.5.14 to 0.5.15
@@ -143,3 +143,3 @@ import Ractive from 'ractive'; | ||
primary.popout = Object.assign({}, data('raui.menu.popout'), data('raui.menu.primary.popout')); | ||
var base = "\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n " + (data('raui.menu.font') ? ("font-family: " + (data('raui.menu.font')) + ";") : '') + "\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: " + (primary.fga || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid " + (primary.bc || '#ccc') + ";\n border-bottom: 0.0625em solid " + (primary.bc || '#ccc') + ";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: " + (primary.popout.bga || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n background-color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.popout.bga || '#f4f4f4') + ";\n color: " + (primary.popout.fg || '#222') + ";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.25em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n top: -0.25em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n box-sizing: border-box;\n border-right: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n background-color: " + (primary.popout.bga || primary.bga || '#f4f4f4') + ";\n border-bottom: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n border-top: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n \n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.5em;\n }\n "; | ||
var base = "\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n " + (data('raui.menu.font') ? ("font-family: " + (data('raui.menu.font')) + ";") : '') + "\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: " + (primary.fga || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid " + (primary.bc || '#ccc') + ";\n border-bottom: 0.0625em solid " + (primary.bc || '#ccc') + ";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: " + (primary.popout.bga || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n background-color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.popout.bga || '#f4f4f4') + ";\n color: " + (primary.popout.fg || '#222') + ";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n box-sizing: border-box;\n border-right: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n background-color: " + (primary.popout.bga || primary.bga || '#f4f4f4') + ";\n border-bottom: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n border-top: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n "; | ||
// TODO: other themes | ||
@@ -146,0 +146,0 @@ return base; |
@@ -1,1 +0,1 @@ | ||
import Ractive from"ractive";import expand from"./transition-expand";import clickout from"./event-clickout";import globalRegister from"./globalRegister";function findRef(items,ref){for(var i=0;i<items.length;i++){if(items[i].ref===ref){return[items[i]]}else if(items[i].items){var res=findRef(items[i].items,ref);if(res){res.unshift(items[i]);return res}}}}export var Menu=function(Ractive){function Menu(opt){Ractive.call(this,opts);this.refs={}}if(Ractive)Menu.__proto__=Ractive;Menu.prototype=Object.create(Ractive&&Ractive.prototype);Menu.prototype.constructor=Menu;Menu.prototype.addItem=function addItem(item,idx){if(typeof idx==="number"){this.splice("items",idx,0,item)}else{this.push("items",item)}return new Handle(this,null,item)};Menu.prototype.visibleItems=function visibleItems(items){var this$1=this;return items.filter(function(i){return i.condition!==false&&(typeof i.condition!=="string"||this$1.get(i.condition)!==false)}).length};Menu.prototype.getHandle=function getHandle(what){var this$1=this;var ctx;if(typeof what==="string"){if(this.refs[what]){ctx=this.refs[what].ctx}else{var el=this.find(what);if(el){ctx=this.getContext(el)}else{var path=findRef(this.get("items"),what);if(path){return path.reduce(function(a,c){return new Handle(this$1,a,c)},null)}}}}else if(what&&what.parentNode){ctx=this.getContext(what)}else if(what&&what.decorators){ctx=what}if(ctx){var path$1=[ctx.get()];var str="../../";while(ctx.resolve(str)!==""){path$1.unshift(ctx.get(str));str+="../../"}return path$1.reduce(function(a,c){return new Handle(this$1,a,c)},null)}};Menu.prototype.popAllIn=function popAllIn(path){var this$1=this;if(!path){path=""}var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){this$1.popAllIn((path?path+".":"")+"items."+i)}}if(item.open&&item.popout){this.set((path?path+".":"")+"open",false)}};Menu.prototype.popSiblingsIn=function popSiblingsIn(ctx){var me=ctx.resolve();var items=ctx.get("../");if(items){for(var i=0;i<items.length;i++){if(me===ctx.resolve("../"+i)){continue}if(items[i].open&&items[i].popout){ctx.toggle("../"+i+".open")}}}};Menu.prototype._actioned=function _actioned(){this.fire("action");this.popAllIn()};Menu.prototype._itemRendered=function _itemRendered(ctx){var this$1=this;setTimeout(function(){return this$1.fire("item",ctx,this$1.getHandle(ctx))});return""};Menu.prototype.childActive=function childActive(path){var this$1=this;var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){if(this$1.get(path+".items."+i+".active")===true||typeof item.items[i].active==="function"&&item.items[i].active()||this$1.get(path+".items."+i+".activeRef")&&this$1.get(item.items[i].activeRef)||this$1.childActive(path+".items."+i)){return true}}}};return Menu}(Ractive);Ractive.extendWith(Menu,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(_0){return!_0},"_0||_1":function(_0,_1){return _0||_1},'_0&&(_1||_2==="section")':function(_0,_1,_2){return _0&&(_1||_2==="section")},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(_0,_1,_2,_3){return _0?_3.active(_1.getHandle(_2)):_3.active()},'typeof _0==="function"':function(_0){return typeof _0==="function"},'typeof _0==="boolean"':function(_0){return typeof _0==="boolean"},"_0.childActive(_1)":function(_0,_1){return _0.childActive(_1)},"_0!=null":function(_0){return _0!=null},"[_0.action(),_1._actioned()]":function(_0,_1){return[_0.action(),_1._actioned()]},"[_0._actioned()]":function(_0){return[_0._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(_0,_1,_2){return[_0&&_1.popSiblingsIn(_2),_2.toggle(".open"),false]},"_0||(_1&&_2[_1])":function(_0,_1,_2){return _0||_1&&_2[_1]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(_0,_1,_2){return _2&&_0&&_1.visibleItems(_2)},"[_0.popAllIn(_1),false]":function(_0,_1){return[_0.popAllIn(_1),false]},'!_0||_0==="item"':function(_0){return!_0||_0==="item"},'_0==="section"':function(_0){return _0==="section"},'_0==="container"':function(_0){return _0==="container"},'(!_0||_0==="item")&&_1':function(_0,_1){return(!_0||_0==="item")&&_1},"[_0.popAllIn(_1)]":function(_0,_1){return[_0.popAllIn(_1)]},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'_0||"item"':function(_0){return _0||"item"},"_0._itemRendered((_1))":function(_0,_1){return _0._itemRendered(_1)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(_0,_1,_2){return _1===undefined||typeof _1==="boolean"&&_1||typeof _1==="string"&&_0[_1]||typeof _1==="function"&&_2.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.menu.primary"));primary.popout=Object.assign({},data("raui.menu.popout"),data("raui.menu.primary.popout"));var base="\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(data("raui.menu.font")?"font-family: "+data("raui.menu.font")+";":"")+"\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(primary.fga||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(primary.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(primary.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(primary.popout.bga||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.fga||"#07e")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.popout.bg||primary.bg||"#fff")+";\n background-color: "+(primary.popout.fga||primary.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.popout.bga||"#f4f4f4")+";\n color: "+(primary.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.25em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n top: -0.25em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.popout.bg||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(primary.popout.fga||primary.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n background-color: "+(primary.popout.bga||primary.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n border-top: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n \n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.5em;\n }\n ";return base}.call(this,data)].join(" ")},cssId:"menu",noCssTransform:true,noIntro:true,nestedTransitions:false,on:{construct:construct,config:function config(){if(this._items){this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:true})}}},attributes:["noExpand"],use:[expand(),clickout()],decorators:{ref:function ref(node,name){var r=this;var nm=name;if(!r.refs){r.refs={}}var handle={update:function update(name){if(r.refs[nm]===handle){delete r.refs[nm]}nm=name;r.refs[nm]=handle},teardown:function teardown(){if(r.refs[nm]===handle){delete r.refs[nm]}}};handle.ctx=r.getContext(node);r.refs[nm]=handle;return handle}},transitions:{pop:function pop(t,params){var p=t.processParams(params,{duration:200,easing:"easeInOut"});var ctx=this.getContext(t.node);var shrink=ctx.get(".shrink");if(t.isIntro){var rect=t.node.getBoundingClientRect();function findParent(){var n=t.node.parentNode;while(n&&n.classList){if(n.classList.contains("rmenu")){return n}else if(n.parentNode.classList.contains("rmenu-popout")){return n}n=n.parentNode}}if(rect.left+rect.width>window.innerWidth){setTimeout(function(){return ctx.set(".shrink",true)});shrink=true;findParent().style.overflowX="hidden"}else if(shrink){setTimeout(function(){return ctx.set(".shrink",false)});findParent().style.overflowX="";shrink=false}else{findParent().style.overflowX=""}}else{setTimeout(function(){return ctx.set("shrink",false)})}if(t.isIntro){if(shrink){t.setStyle("left","100%");return t.animateStyle("left",0,p)}else{t.setStyle("left",0);t.setStyle("z-index",-1);return t.animateStyle("left","100%",p)}}else{if(shrink){t.setStyle("left",0);return t.animateStyle("left","100%",p)}else{t.setStyle("left","100%");t.setStyle("z-index",-1);return t.animateStyle("left",0,p)}}}}});var justSpace=/^\s*$/;function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};function item(el){if(el.e!=="item"&&el.e!=="section"&&el.e!=="container"){return}var res={};var as=[];var title;if(el.e!=="item"){res.type=el.e}el.m&&el.m.forEach(function(a){if(a.n==="title"){if(typeof a.f==="string"){res.title=a.f}else{res.titlePartial={t:a.f}}}else if(a.t===70&&a.n[0]==="action"){res.actionPartial={t:[{n:["click"],f:a.f,t:a.t}]}}else if(a.n==="guard"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;res.condition=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="ref"){if(typeof a.f==="string"){res.ref=a.f}else if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;attrs.push({t:13,n:cnd$1,f:a.f});res.refPartials={t:[{t:71,n:"ref",f:{r:cnd$1,s:"[_0]"}}]}}}else if(a.n==="active"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;res.activeRef=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}}else if(a.n==="open"){res.open=true}else if(a.n==="popout"){res.popout=true}else if(el.e==="container"&&a.n==="pad"){res.pad=true}else if(a.n==="disabled"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$3="_cnd"+attrs.length;res.disabledRef=cnd$3;attrs.push({t:13,n:cnd$3,f:a.f})}else if(a.f===0){res.disabled=true}}else{as.push(a)}});if(as.length){res.extra={t:as}}if(el.e==="container"){res.contentPartial={t:el.f};res.extra=as;return res}el.f&&el.f.forEach(function(e){if(e.e==="title"){if(e.f.length===1&&typeof e.f[0]==="string"){res.title=e.f[0]}else{res.titlePartial={t:e.f}}}else if(e.e==="item"||e.e==="section"||e.e==="container"){var i=item(e);if(i){(res.items||(res.items=[])).push(i)}}else if(e.e==="left"){res.leftPartial={t:e.f}}else if(e.e==="right"){res.rightPartial={t:e.f}}else if(typeof e!=="string"||!justSpace.test(e)){if(!title){title=[]}title.push(e)}});if(!res.titlePartial&&title){res.titlePartial={t:title}}title=null;return res}var list=[];tpl.forEach(function(e){var i=item(e);if(i){list.push(i)}});this._items=list}var Handle=function Handle(menu,parent,item){this.menu=menu;this.parent=parent;this.item=item};var prototypeAccessors={keypath:{configurable:true},action:{configurable:true},active:{configurable:true},disabled:{configurable:true},items:{configurable:true},ref:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}if(!this.parent){return"items."+this.menu.get("items").indexOf(this.item)}var path=this.parent.keypath+".items";var parent=this.menu.get(path);return path+"."+parent.indexOf(this.item)};prototypeAccessors.action.get=function(){if(this.removed){return}return this.item.action};prototypeAccessors.action.set=function(v){return this.set(".action",v)};prototypeAccessors.active.get=function(){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.get(item.activeRef)}else if(typeof item.active==="function"){return item.active()}else{return item.active}};prototypeAccessors.active.set=function(v){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.set(item.activeRef,v)}else{return this.set(".active",v)}};prototypeAccessors.disabled.get=function(){if(this.removed){return}return this.get(".disabled")};prototypeAccessors.disabled.set=function(v){if(this.removed){return}return this.set(".disabled",v)};prototypeAccessors.items.get=function(){var this$1=this;if(this.item.items){return this.item.items.map(function(item){return new Handle(this$1.menu,this$1,item)})}else{return[]}};prototypeAccessors.ref.get=function(){if(this.removed){return}return this.item.ref};prototypeAccessors.ref.set=function(v){return this.set(".ref",v)};Handle.prototype.addItem=function addItem(item,idx){if(this.removed){return false}var items=this.keypath+".items";if(typeof idx==="number"){this.menu.splice(items,0,idx,item)}else{this.menu.push(items,item)}return new Handle(this.menu,this,item)};Handle.prototype.open=function open(){if(this.removed){return false}this.menu.set(this.keypath+".open",true)};Handle.prototype.close=function close(){if(this.removed){return false}this.menu.set(this.keypath+".open",false)};Handle.prototype.remove=function remove(){if(this.removed){return false}var parentPath=(this.parent?this.parent.keypath+".":"")+"items";var parent=this.menu.get(parentPath);this.menu.splice(parentPath,parent.indexOf(this.item),1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.menu.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);function close(instance,path){var item=instance.get(path);if(item.open&&item.popout){instance.toggle(path+".open")}var items;if(items=instance.get(path+".items")){for(var i=0;i<items.length;i++){close(instance,path+".items."+i)}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"menu"]=Menu}}globalRegister("RMMenu","components",Menu);export default plugin; | ||
import Ractive from"ractive";import expand from"./transition-expand";import clickout from"./event-clickout";import globalRegister from"./globalRegister";function findRef(items,ref){for(var i=0;i<items.length;i++){if(items[i].ref===ref){return[items[i]]}else if(items[i].items){var res=findRef(items[i].items,ref);if(res){res.unshift(items[i]);return res}}}}export var Menu=function(Ractive){function Menu(opt){Ractive.call(this,opts);this.refs={}}if(Ractive)Menu.__proto__=Ractive;Menu.prototype=Object.create(Ractive&&Ractive.prototype);Menu.prototype.constructor=Menu;Menu.prototype.addItem=function addItem(item,idx){if(typeof idx==="number"){this.splice("items",idx,0,item)}else{this.push("items",item)}return new Handle(this,null,item)};Menu.prototype.visibleItems=function visibleItems(items){var this$1=this;return items.filter(function(i){return i.condition!==false&&(typeof i.condition!=="string"||this$1.get(i.condition)!==false)}).length};Menu.prototype.getHandle=function getHandle(what){var this$1=this;var ctx;if(typeof what==="string"){if(this.refs[what]){ctx=this.refs[what].ctx}else{var el=this.find(what);if(el){ctx=this.getContext(el)}else{var path=findRef(this.get("items"),what);if(path){return path.reduce(function(a,c){return new Handle(this$1,a,c)},null)}}}}else if(what&&what.parentNode){ctx=this.getContext(what)}else if(what&&what.decorators){ctx=what}if(ctx){var path$1=[ctx.get()];var str="../../";while(ctx.resolve(str)!==""){path$1.unshift(ctx.get(str));str+="../../"}return path$1.reduce(function(a,c){return new Handle(this$1,a,c)},null)}};Menu.prototype.popAllIn=function popAllIn(path){var this$1=this;if(!path){path=""}var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){this$1.popAllIn((path?path+".":"")+"items."+i)}}if(item.open&&item.popout){this.set((path?path+".":"")+"open",false)}};Menu.prototype.popSiblingsIn=function popSiblingsIn(ctx){var me=ctx.resolve();var items=ctx.get("../");if(items){for(var i=0;i<items.length;i++){if(me===ctx.resolve("../"+i)){continue}if(items[i].open&&items[i].popout){ctx.toggle("../"+i+".open")}}}};Menu.prototype._actioned=function _actioned(){this.fire("action");this.popAllIn()};Menu.prototype._itemRendered=function _itemRendered(ctx){var this$1=this;setTimeout(function(){return this$1.fire("item",ctx,this$1.getHandle(ctx))});return""};Menu.prototype.childActive=function childActive(path){var this$1=this;var item=this.get(path);if(item&&item.items){for(var i=0;i<item.items.length;i++){if(this$1.get(path+".items."+i+".active")===true||typeof item.items[i].active==="function"&&item.items[i].active()||this$1.get(path+".items."+i+".activeRef")&&this$1.get(item.items[i].activeRef)||this$1.childActive(path+".items."+i)){return true}}}};return Menu}(Ractive);Ractive.extendWith(Menu,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(_0){return!_0},"_0||_1":function(_0,_1){return _0||_1},'_0&&(_1||_2==="section")':function(_0,_1,_2){return _0&&(_1||_2==="section")},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(_0,_1,_2,_3){return _0?_3.active(_1.getHandle(_2)):_3.active()},'typeof _0==="function"':function(_0){return typeof _0==="function"},'typeof _0==="boolean"':function(_0){return typeof _0==="boolean"},"_0.childActive(_1)":function(_0,_1){return _0.childActive(_1)},"_0!=null":function(_0){return _0!=null},"[_0.action(),_1._actioned()]":function(_0,_1){return[_0.action(),_1._actioned()]},"[_0._actioned()]":function(_0){return[_0._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(_0,_1,_2){return[_0&&_1.popSiblingsIn(_2),_2.toggle(".open"),false]},"_0||(_1&&_2[_1])":function(_0,_1,_2){return _0||_1&&_2[_1]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(_0,_1,_2){return _2&&_0&&_1.visibleItems(_2)},"[_0.popAllIn(_1),false]":function(_0,_1){return[_0.popAllIn(_1),false]},'!_0||_0==="item"':function(_0){return!_0||_0==="item"},'_0==="section"':function(_0){return _0==="section"},'_0==="container"':function(_0){return _0==="container"},'(!_0||_0==="item")&&_1':function(_0,_1){return(!_0||_0==="item")&&_1},"[_0.popAllIn(_1)]":function(_0,_1){return[_0.popAllIn(_1)]},"[_0]":function(_0){return[_0]},'typeof _0==="string"':function(_0){return typeof _0==="string"},'_0||"item"':function(_0){return _0||"item"},"_0._itemRendered((_1))":function(_0,_1){return _0._itemRendered(_1)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(_0,_1,_2){return _1===undefined||typeof _1==="boolean"&&_1||typeof _1==="string"&&_0[_1]||typeof _1==="function"&&_2.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.menu.primary"));primary.popout=Object.assign({},data("raui.menu.popout"),data("raui.menu.primary.popout"));var base="\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(data("raui.menu.font")?"font-family: "+data("raui.menu.font")+";":"")+"\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(primary.fga||"#222")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.fga||"#07e")+";\n color: "+(primary.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(primary.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(primary.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(primary.popout.bga||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.fga||"#07e")+";\n background-color: "+(primary.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(primary.popout.bg||primary.bg||"#fff")+";\n background-color: "+(primary.popout.fga||primary.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(primary.bg||"#fff")+";\n background-color: "+(primary.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(primary.popout.bga||"#f4f4f4")+";\n color: "+(primary.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(primary.popout.bg||primary.bg||"#fff")+";\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(primary.popout.fga||primary.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(primary.popout.fg||primary.fg||"#222")+";\n background-color: "+(primary.popout.bga||primary.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n border-top: 1px solid "+(primary.popout.bc||primary.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n ";return base}.call(this,data)].join(" ")},cssId:"menu",noCssTransform:true,noIntro:true,nestedTransitions:false,on:{construct:construct,config:function config(){if(this._items){this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:true})}}},attributes:["noExpand"],use:[expand(),clickout()],decorators:{ref:function ref(node,name){var r=this;var nm=name;if(!r.refs){r.refs={}}var handle={update:function update(name){if(r.refs[nm]===handle){delete r.refs[nm]}nm=name;r.refs[nm]=handle},teardown:function teardown(){if(r.refs[nm]===handle){delete r.refs[nm]}}};handle.ctx=r.getContext(node);r.refs[nm]=handle;return handle}},transitions:{pop:function pop(t,params){var p=t.processParams(params,{duration:200,easing:"easeInOut"});var ctx=this.getContext(t.node);var shrink=ctx.get(".shrink");if(t.isIntro){var rect=t.node.getBoundingClientRect();function findParent(){var n=t.node.parentNode;while(n&&n.classList){if(n.classList.contains("rmenu")){return n}else if(n.parentNode.classList.contains("rmenu-popout")){return n}n=n.parentNode}}if(rect.left+rect.width>window.innerWidth){setTimeout(function(){return ctx.set(".shrink",true)});shrink=true;findParent().style.overflowX="hidden"}else if(shrink){setTimeout(function(){return ctx.set(".shrink",false)});findParent().style.overflowX="";shrink=false}else{findParent().style.overflowX=""}}else{setTimeout(function(){return ctx.set("shrink",false)})}if(t.isIntro){if(shrink){t.setStyle("left","100%");return t.animateStyle("left",0,p)}else{t.setStyle("left",0);t.setStyle("z-index",-1);return t.animateStyle("left","100%",p)}}else{if(shrink){t.setStyle("left",0);return t.animateStyle("left","100%",p)}else{t.setStyle("left","100%");t.setStyle("z-index",-1);return t.animateStyle("left",0,p)}}}}});var justSpace=/^\s*$/;function construct(){var cmp=this.component;if(!cmp){return}var tpl=cmp.template.f||[];var attrs=cmp.template.m?cmp.template.m.slice():[];var t=cmp.template;cmp.template={e:t.e,f:t.f,t:t.t,m:attrs};function item(el){if(el.e!=="item"&&el.e!=="section"&&el.e!=="container"){return}var res={};var as=[];var title;if(el.e!=="item"){res.type=el.e}el.m&&el.m.forEach(function(a){if(a.n==="title"){if(typeof a.f==="string"){res.title=a.f}else{res.titlePartial={t:a.f}}}else if(a.t===70&&a.n[0]==="action"){res.actionPartial={t:[{n:["click"],f:a.f,t:a.t}]}}else if(a.n==="guard"&&a.f&&a.f.length===1&&a.f[0].t===2){var cnd="_cnd"+attrs.length;res.condition=cnd;attrs.push({t:13,n:cnd,f:a.f})}else if(a.n==="ref"){if(typeof a.f==="string"){res.ref=a.f}else if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$1="_cnd"+attrs.length;attrs.push({t:13,n:cnd$1,f:a.f});res.refPartials={t:[{t:71,n:"ref",f:{r:cnd$1,s:"[_0]"}}]}}}else if(a.n==="active"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$2="_cnd"+attrs.length;res.activeRef=cnd$2;attrs.push({t:13,n:cnd$2,f:a.f})}}else if(a.n==="open"){res.open=true}else if(a.n==="popout"){res.popout=true}else if(el.e==="container"&&a.n==="pad"){res.pad=true}else if(a.n==="disabled"){if(a.f&&a.f.length===1&&a.f[0].t===2){var cnd$3="_cnd"+attrs.length;res.disabledRef=cnd$3;attrs.push({t:13,n:cnd$3,f:a.f})}else if(a.f===0){res.disabled=true}}else{as.push(a)}});if(as.length){res.extra={t:as}}if(el.e==="container"){res.contentPartial={t:el.f};res.extra=as;return res}el.f&&el.f.forEach(function(e){if(e.e==="title"){if(e.f.length===1&&typeof e.f[0]==="string"){res.title=e.f[0]}else{res.titlePartial={t:e.f}}}else if(e.e==="item"||e.e==="section"||e.e==="container"){var i=item(e);if(i){(res.items||(res.items=[])).push(i)}}else if(e.e==="left"){res.leftPartial={t:e.f}}else if(e.e==="right"){res.rightPartial={t:e.f}}else if(typeof e!=="string"||!justSpace.test(e)){if(!title){title=[]}title.push(e)}});if(!res.titlePartial&&title){res.titlePartial={t:title}}title=null;return res}var list=[];tpl.forEach(function(e){var i=item(e);if(i){list.push(i)}});this._items=list}var Handle=function Handle(menu,parent,item){this.menu=menu;this.parent=parent;this.item=item};var prototypeAccessors={keypath:{configurable:true},action:{configurable:true},active:{configurable:true},disabled:{configurable:true},items:{configurable:true},ref:{configurable:true}};prototypeAccessors.keypath.get=function(){if(this.removed){return}if(!this.parent){return"items."+this.menu.get("items").indexOf(this.item)}var path=this.parent.keypath+".items";var parent=this.menu.get(path);return path+"."+parent.indexOf(this.item)};prototypeAccessors.action.get=function(){if(this.removed){return}return this.item.action};prototypeAccessors.action.set=function(v){return this.set(".action",v)};prototypeAccessors.active.get=function(){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.get(item.activeRef)}else if(typeof item.active==="function"){return item.active()}else{return item.active}};prototypeAccessors.active.set=function(v){if(this.removed){return}var item=this.item;if(item.activeRef){return this.menu.set(item.activeRef,v)}else{return this.set(".active",v)}};prototypeAccessors.disabled.get=function(){if(this.removed){return}return this.get(".disabled")};prototypeAccessors.disabled.set=function(v){if(this.removed){return}return this.set(".disabled",v)};prototypeAccessors.items.get=function(){var this$1=this;if(this.item.items){return this.item.items.map(function(item){return new Handle(this$1.menu,this$1,item)})}else{return[]}};prototypeAccessors.ref.get=function(){if(this.removed){return}return this.item.ref};prototypeAccessors.ref.set=function(v){return this.set(".ref",v)};Handle.prototype.addItem=function addItem(item,idx){if(this.removed){return false}var items=this.keypath+".items";if(typeof idx==="number"){this.menu.splice(items,0,idx,item)}else{this.menu.push(items,item)}return new Handle(this.menu,this,item)};Handle.prototype.open=function open(){if(this.removed){return false}this.menu.set(this.keypath+".open",true)};Handle.prototype.close=function close(){if(this.removed){return false}this.menu.set(this.keypath+".open",false)};Handle.prototype.remove=function remove(){if(this.removed){return false}var parentPath=(this.parent?this.parent.keypath+".":"")+"items";var parent=this.menu.get(parentPath);this.menu.splice(parentPath,parent.indexOf(this.item),1);this.removed=true;return true};Handle.prototype.get=function get(keypath){if(this.removed){return false}if(!keypath){return this.menu.get(this.keypath)}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+key)};Handle.prototype.set=function set(keypath,value){if(this.removed){return false}var key=keypath.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+key,value)};Object.defineProperties(Handle.prototype,prototypeAccessors);function close(instance,path){var item=instance.get(path);if(item.open&&item.popout){instance.toggle(path+".open")}var items;if(items=instance.get(path+".items")){for(var i=0;i<items.length;i++){close(instance,path+".items."+i)}}}export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"menu"]=Menu}}globalRegister("RMMenu","components",Menu);export default plugin; |
@@ -6,3 +6,3 @@ import Ractive from 'ractive'; | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0.done(),false]":function (_0){return([_0.done(),false]);},"[_0?_1.done():false,false]":function (_0,_1){return([_0?_1.done():false,false]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0===_1&&_2.done(),true]":function (_0,_1,_2){return([_0===_1&&_2.done(),true]);},"[_0.done()]":function (_0){return([_0.done()]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
@@ -9,0 +9,0 @@ function noop() {} |
@@ -1,1 +0,1 @@ | ||
import Ractive from"ractive";import pop from"./transition-pop";import clickout from"./event-clickout";import fade from"./transition-fade";var template={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(_0){return _0||"below"},'_0||"middle"':function(_0){return _0||"middle"},'[{dir:_0||"below"}]':function(_0){return[{dir:_0||"below"}]},'[_0.set("popped",false)]':function(_0){return[_0.set("popped",false)]},"_0+(_1?1:0)":function(_0,_1){return _0+(_1?1:0)},"_0+(_1?0:1)":function(_0,_1){return _0+(_1?0:1)},"_0-2":function(_0){return _0-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0.done(),false]":function(_0){return[_0.done(),false]},"[_0?_1.done():false,false]":function(_0,_1){return[_0?_1.done():false,false]},true:function(){return true}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function noop(){}var source,tailSource,mobilePopped,mobilePop;export var Popover=function(Ractive){function Popover(opts){Ractive.call(this,opts)}if(Ractive)Popover.__proto__=Ractive;Popover.prototype=Object.create(Ractive&&Ractive.prototype);Popover.prototype.constructor=Popover;Popover.prototype.position=function position(node){var source=node||this.source;var popped=this.get("popped");if(!source||!popped){return}var wrapper=this.find("div");if(source&&wrapper&&wrapper.offsetParent){var parent=wrapper.offsetParent;var offset=parent.getBoundingClientRect();var local=wrapper.getBoundingClientRect();var target=source.getBoundingClientRect();var where=this.get("where")||"below";var align=this.get("align")||"middle";var tail=this.get("tail");var vert=where==="above"||where==="below";var fit=this.get("fit");var gap=this.get("gap");var offx=where==="above"||where==="below"?0:where==="left"?-local.width-gap:target.width+gap;var offy=where==="left"||where==="right"?-target.height:where==="above"?-target.height-local.height-gap:gap;if(align==="middle"){if(where==="below"||where==="above"){offx-=(local.width-target.width)/2}else if(where==="left"||where==="right"){offy-=(local.height-target.height)/2}}else if(align==="end"){if(where==="below"||where==="above"){offx+=target.width-local.width}else if(where==="left"||where==="right"){offy+=target.height-local.height}}var pos={popTop:target.bottom-offset.top+offy,popLeft:target.left-offset.left+offx,tail:tail,vert:where==="above"||where==="below"};if(parent.scrollTop){pos.popTop+=parent.scrollTop}if(parent.scrollLeft){pos.popLeft+=parent.scrollLeft}if(tail){if(where==="above"){pos.tailBottom=-10}else if(where==="below"){pos.tailTop=-10}else if(where==="left"){pos.tailRight=-10}else if(where==="right"){pos.tailLeft=-10}var tailTarget=this.tailSource?this.tailSource.getBoundingClientRect():target;if(align==="start"){if(vert){pos.tailLeft=Math.floor(tailTarget.width/2)-10}else{pos.tailTop=Math.floor(tailTarget.height/2)-10}}else if(align==="end"){if(vert){pos.tailRight=Math.floor(tailTarget.width/2)-10}else{pos.tailBottom=Math.floor(tailTarget.height/2)-10}}else if(align==="middle"){if(vert){pos.tailLeft=Math.floor(tailTarget.width/2)-10}else{pos.tailTop=Math.floor(tailTarget.height/2)-10}}if(tailTarget!==target){if(vert){if(pos.tailLeft){pos.tailLeft+=tailTarget.left-target.left}if(pos.tailRight){pos.tailRight+=target.right-tailTarget.right}}else{if(pos.tailTop){pos.tailTop+=tailTarget.top-target.top}if(pos.tailBottom){pos.tailBottom+=target.bottom-tailTarget.bottom}}}else if(align==="middle"){if(vert){if(pos.tailLeft){pos.tailLeft+=tailTarget.left-(pos.popLeft+offset.left)}if(pos.tailRight){pos.tailRight+=pos.popLeft+offset.left+local.width-tailTarget.right}}else{if(pos.tailTop){pos.tailTop+=tailTarget.top-(pos.popTop+offset.top)}if(pos.tailBottom){pos.tailBottom+=pos.popTop+offset.top+local.height-tailTarget.bottom}}}}if(fit){var el=parent;if(this.get("offsets")){var i=this.get("offsets");while(i--){el=el.offsetParent}}var owidth=parent.scrollWidth;var oheight=parent.scrollHeight;if(pos.popLeft+local.width>owidth){var diff=pos.popLeft-(owidth-local.width);pos.popLeft-=diff;if(vert&&pos.tailLeft){pos.tailLeft+=diff}if(vert&&pos.tailRight){pos.tailRight-=diff}if(tail&&!vert){pos.tail=false}}if(pos.popLeft<0){var diff$1=-1*pos.popLeft;pos.popLeft+=diff$1;if(vert&&pos.tailLeft){pos.tailLeft-=diff$1}if(vert&&pos.tailRight){pos.tailRight+=diff$1}if(tail&&!vert){pos.tail=false}}if(pos.popTop+local.height>oheight){var diff$2=pos.popTop-(oheight-local.height);pos.popTop-=diff$2;if(!vert&&pos.tailTop){pos.tailTop+=diff$2}if(!vert&&pos.tailBottom){pos.tailBottom-=diff$2}if(tail&&vert){pos.tail=false}}if(pos.popTop<0){var diff$3=-1*pos.popTop;pos.popTop+=diff$3;if(!vert&&pos.tailTop){pos.tailTop-=diff$3}if(!vert&&pos.tailBottom){pos.tailBottom+=diff$3}if(tail&&vert){pos.tail=false}}}this.set("position",pos)}else{this.set("position",null)}};Popover.prototype.show=function show(node){this.source=node;this.set("popped",true)};Popover.prototype.hide=function hide(){this.set("popped",false)};return Popover}(Ractive);Ractive.extendWith(Popover,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[pop(),clickout(),fade()],template:template,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.pop.primary"));var themes=(data("raui.themes")||[]).slice();(data("raui.pop.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});return"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(primary.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(primary.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(primary.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(primary.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(primary.bc||"#ccc")+";\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.pop.primary"),data("raui."+t),data("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(theme.bg||"#fff")+";\n color: "+(theme.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(theme.bc||"#ccc")+";\n }\n "})}.call(this,data)].join(" ")},cssId:"rpop",noCssTransform:true,observe:{popped:function popped(v){var this$1=this;if(v){if(source){this.source=source}if(tailSource){this.tailSource=tailSource}}setTimeout(function(){if(this$1.get("popped")===v){this$1.set("_popped",v)}},100)},_popped:{handler:function handler(v){var this$1=this;if(v){var mobile=this.get("@style.raui.pop.mobile");if(mobile&&window.matchMedia("(max-width: "+mobile+")").matches){if(!mobilePop){mobilePop=new MobilePop({target:document.body,append:true});mobilePop.observe("contents",function(v){mobilePopped=(v||[]).length>0})}mobilePop.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(true),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){this$1.set("popped",false)}})}else{this.set("__popped",true)}}else{if(mobilePopped){mobilePop.shift("contents")}else{this.set("__popped",false)}}},defer:true},__popped:{handler:function handler(v){if(v){var el=this.find("div");var node=el;var h=node.offsetHeight+node.offsetTop;var w=node.offsetWidth+node.offsetLeft;var offset=node.offsetParent;if(!this.overflows){var o=this.overflows={e:[],v:[]};while(el&&el.style){if(el===offset){if(el.offsetWidth>=w&&el.offsetHeight>=h){break}else{w+=el.offsetLeft;h+=el.offsetTop;offset=el.offsetParent}}var css=getComputedStyle(el);if(css.overflow==="auto"){break}if(css.overflow==="hidden"){o.e.push(el);o.v.push(el.style.overflow);el.style.overflow="visible"}el=el.parentNode}}this.position();this.transition("pop",node,{intro:true,dir:this.get("where")||"below"})}else{this.source=null;this.tailSource=null}},defer:true},"align where tail fit":{handler:function handler(){this.position()},defer:true}},decorators:{cleanup:function cleanup(node){var pop=this;return{teardown:function teardown(){var o=pop.overflows;if(o){pop.overflows=null;for(var i=0;i<o.e.length;i++){o.e[i].style.overflow=o.v[i]}}}}}},data:function data(){return{gap:4}}});export function trigger(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"pop"]=function(node,path,opts){if(opts===void 0)opts={};if(!path){return{teardown:noop}}if(typeof path==="string"){opts.path=path}else if(typeof path==="object"){opts=path}var ctx=this.getContext(node);var clicked,hover;function listener(ev){if(ev.type==="mouseover"&&ctx.get(path)){return}if(ev.type!=="click"||!hover||clicked){var init=source;var initTail=tailSource;source=opts.node||node;if(typeof source==="function"){source=source()}source=source||node;tailSource=opts.tail;if(typeof tailSource==="function"){tailSource=tailSource()}ctx.toggle(opts.path);source=init;tailSource=initTail}if(hover&&ev.type==="click"){clicked=ctx.observeOnce(opts.path,function(){clicked=null})}}function out(ev){if(!clicked){ctx.set(opts.path,false)}}if("click"in opts?opts.click:options.click!==false){ctx.listen("click",listener)}if("hover"in opts?opts.hover:options.hover){hover=1;ctx.listen("mouseover",listener);ctx.listen("mouseout",out)}return{teardown:function teardown(){ctx.unlisten("click",listener);if(hover){ctx.unlisten("mouseover",listener);ctx.unlisten("mouseout",out);if(clicked){clicked.cancel()}}}}}}}var MobilePop=function(Ractive){function MobilePop(opts){Ractive.call(this,opts)}if(Ractive)MobilePop.__proto__=Ractive;MobilePop.prototype=Object.create(Ractive&&Ractive.prototype);MobilePop.prototype.constructor=MobilePop;return MobilePop}(Ractive);Ractive.extendWith(MobilePop,{template:{v:template.v,t:template.p.modal},data:function data(){return{contents:[]}},use:[pop(),fade()]});export default function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.components[options.name||"pop"]=Popover;var opts=Object.assign({},options);opts.name=opts.trigger||opts.name;trigger(opts)({instance:instance})}} | ||
import Ractive from"ractive";import pop from"./transition-pop";import clickout from"./event-clickout";import fade from"./transition-fade";var template={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(_0){return _0||"below"},'_0||"middle"':function(_0){return _0||"middle"},'[{dir:_0||"below"}]':function(_0){return[{dir:_0||"below"}]},'[_0.set("popped",false)]':function(_0){return[_0.set("popped",false)]},"_0+(_1?1:0)":function(_0,_1){return _0+(_1?1:0)},"_0+(_1?0:1)":function(_0,_1){return _0+(_1?0:1)},"_0-2":function(_0){return _0-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(_0,_1,_2){return[_0===_1&&_2.done(),true]},"[_0.done()]":function(_0){return[_0.done()]},true:function(){return true}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function noop(){}var source,tailSource,mobilePopped,mobilePop;export var Popover=function(Ractive){function Popover(opts){Ractive.call(this,opts)}if(Ractive)Popover.__proto__=Ractive;Popover.prototype=Object.create(Ractive&&Ractive.prototype);Popover.prototype.constructor=Popover;Popover.prototype.position=function position(node){var source=node||this.source;var popped=this.get("popped");if(!source||!popped){return}var wrapper=this.find("div");if(source&&wrapper&&wrapper.offsetParent){var parent=wrapper.offsetParent;var offset=parent.getBoundingClientRect();var local=wrapper.getBoundingClientRect();var target=source.getBoundingClientRect();var where=this.get("where")||"below";var align=this.get("align")||"middle";var tail=this.get("tail");var vert=where==="above"||where==="below";var fit=this.get("fit");var gap=this.get("gap");var offx=where==="above"||where==="below"?0:where==="left"?-local.width-gap:target.width+gap;var offy=where==="left"||where==="right"?-target.height:where==="above"?-target.height-local.height-gap:gap;if(align==="middle"){if(where==="below"||where==="above"){offx-=(local.width-target.width)/2}else if(where==="left"||where==="right"){offy-=(local.height-target.height)/2}}else if(align==="end"){if(where==="below"||where==="above"){offx+=target.width-local.width}else if(where==="left"||where==="right"){offy+=target.height-local.height}}var pos={popTop:target.bottom-offset.top+offy,popLeft:target.left-offset.left+offx,tail:tail,vert:where==="above"||where==="below"};if(parent.scrollTop){pos.popTop+=parent.scrollTop}if(parent.scrollLeft){pos.popLeft+=parent.scrollLeft}if(tail){if(where==="above"){pos.tailBottom=-10}else if(where==="below"){pos.tailTop=-10}else if(where==="left"){pos.tailRight=-10}else if(where==="right"){pos.tailLeft=-10}var tailTarget=this.tailSource?this.tailSource.getBoundingClientRect():target;if(align==="start"){if(vert){pos.tailLeft=Math.floor(tailTarget.width/2)-10}else{pos.tailTop=Math.floor(tailTarget.height/2)-10}}else if(align==="end"){if(vert){pos.tailRight=Math.floor(tailTarget.width/2)-10}else{pos.tailBottom=Math.floor(tailTarget.height/2)-10}}else if(align==="middle"){if(vert){pos.tailLeft=Math.floor(tailTarget.width/2)-10}else{pos.tailTop=Math.floor(tailTarget.height/2)-10}}if(tailTarget!==target){if(vert){if(pos.tailLeft){pos.tailLeft+=tailTarget.left-target.left}if(pos.tailRight){pos.tailRight+=target.right-tailTarget.right}}else{if(pos.tailTop){pos.tailTop+=tailTarget.top-target.top}if(pos.tailBottom){pos.tailBottom+=target.bottom-tailTarget.bottom}}}else if(align==="middle"){if(vert){if(pos.tailLeft){pos.tailLeft+=tailTarget.left-(pos.popLeft+offset.left)}if(pos.tailRight){pos.tailRight+=pos.popLeft+offset.left+local.width-tailTarget.right}}else{if(pos.tailTop){pos.tailTop+=tailTarget.top-(pos.popTop+offset.top)}if(pos.tailBottom){pos.tailBottom+=pos.popTop+offset.top+local.height-tailTarget.bottom}}}}if(fit){var el=parent;if(this.get("offsets")){var i=this.get("offsets");while(i--){el=el.offsetParent}}var owidth=parent.scrollWidth;var oheight=parent.scrollHeight;if(pos.popLeft+local.width>owidth){var diff=pos.popLeft-(owidth-local.width);pos.popLeft-=diff;if(vert&&pos.tailLeft){pos.tailLeft+=diff}if(vert&&pos.tailRight){pos.tailRight-=diff}if(tail&&!vert){pos.tail=false}}if(pos.popLeft<0){var diff$1=-1*pos.popLeft;pos.popLeft+=diff$1;if(vert&&pos.tailLeft){pos.tailLeft-=diff$1}if(vert&&pos.tailRight){pos.tailRight+=diff$1}if(tail&&!vert){pos.tail=false}}if(pos.popTop+local.height>oheight){var diff$2=pos.popTop-(oheight-local.height);pos.popTop-=diff$2;if(!vert&&pos.tailTop){pos.tailTop+=diff$2}if(!vert&&pos.tailBottom){pos.tailBottom-=diff$2}if(tail&&vert){pos.tail=false}}if(pos.popTop<0){var diff$3=-1*pos.popTop;pos.popTop+=diff$3;if(!vert&&pos.tailTop){pos.tailTop-=diff$3}if(!vert&&pos.tailBottom){pos.tailBottom+=diff$3}if(tail&&vert){pos.tail=false}}}this.set("position",pos)}else{this.set("position",null)}};Popover.prototype.show=function show(node){this.source=node;this.set("popped",true)};Popover.prototype.hide=function hide(){this.set("popped",false)};return Popover}(Ractive);Ractive.extendWith(Popover,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[pop(),clickout(),fade()],template:template,css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.pop.primary"));var themes=(data("raui.themes")||[]).slice();(data("raui.pop.themes")||[]).forEach(function(t){if(!~themes.indexOf(t)){themes.push(t)}});return"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(primary.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(primary.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(primary.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(primary.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(primary.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(primary.bc||"#ccc")+";\n }\n "+themes.map(function(t){var theme=Object.assign({},data("raui.primary"),data("raui.pop.primary"),data("raui."+t),data("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(theme.bg||"#fff")+";\n color: "+(theme.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(theme.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(theme.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(theme.bc||"#ccc")+";\n }\n "})}.call(this,data)].join(" ")},cssId:"rpop",noCssTransform:true,observe:{popped:function popped(v){var this$1=this;if(v){if(source){this.source=source}if(tailSource){this.tailSource=tailSource}}setTimeout(function(){if(this$1.get("popped")===v){this$1.set("_popped",v)}},100)},_popped:{handler:function handler(v){var this$1=this;if(v){var mobile=this.get("@style.raui.pop.mobile");if(mobile&&window.matchMedia("(max-width: "+mobile+")").matches){if(!mobilePop){mobilePop=new MobilePop({target:document.body,append:true});mobilePop.observe("contents",function(v){mobilePopped=(v||[]).length>0})}mobilePop.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(true),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){this$1.set("popped",false)}})}else{this.set("__popped",true)}}else{if(mobilePopped){mobilePop.shift("contents")}else{this.set("__popped",false)}}},defer:true},__popped:{handler:function handler(v){if(v){var el=this.find("div");var node=el;var h=node.offsetHeight+node.offsetTop;var w=node.offsetWidth+node.offsetLeft;var offset=node.offsetParent;if(!this.overflows){var o=this.overflows={e:[],v:[]};while(el&&el.style){if(el===offset){if(el.offsetWidth>=w&&el.offsetHeight>=h){break}else{w+=el.offsetLeft;h+=el.offsetTop;offset=el.offsetParent}}var css=getComputedStyle(el);if(css.overflow==="auto"){break}if(css.overflow==="hidden"){o.e.push(el);o.v.push(el.style.overflow);el.style.overflow="visible"}el=el.parentNode}}this.position();this.transition("pop",node,{intro:true,dir:this.get("where")||"below"})}else{this.source=null;this.tailSource=null}},defer:true},"align where tail fit":{handler:function handler(){this.position()},defer:true}},decorators:{cleanup:function cleanup(node){var pop=this;return{teardown:function teardown(){var o=pop.overflows;if(o){pop.overflows=null;for(var i=0;i<o.e.length;i++){o.e[i].style.overflow=o.v[i]}}}}}},data:function data(){return{gap:4}}});export function trigger(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.decorators[options.name||"pop"]=function(node,path,opts){if(opts===void 0)opts={};if(!path){return{teardown:noop}}if(typeof path==="string"){opts.path=path}else if(typeof path==="object"){opts=path}var ctx=this.getContext(node);var clicked,hover;function listener(ev){if(ev.type==="mouseover"&&ctx.get(path)){return}if(ev.type!=="click"||!hover||clicked){var init=source;var initTail=tailSource;source=opts.node||node;if(typeof source==="function"){source=source()}source=source||node;tailSource=opts.tail;if(typeof tailSource==="function"){tailSource=tailSource()}ctx.toggle(opts.path);source=init;tailSource=initTail}if(hover&&ev.type==="click"){clicked=ctx.observeOnce(opts.path,function(){clicked=null})}}function out(ev){if(!clicked){ctx.set(opts.path,false)}}if("click"in opts?opts.click:options.click!==false){ctx.listen("click",listener)}if("hover"in opts?opts.hover:options.hover){hover=1;ctx.listen("mouseover",listener);ctx.listen("mouseout",out)}return{teardown:function teardown(){ctx.unlisten("click",listener);if(hover){ctx.unlisten("mouseover",listener);ctx.unlisten("mouseout",out);if(clicked){clicked.cancel()}}}}}}}var MobilePop=function(Ractive){function MobilePop(opts){Ractive.call(this,opts)}if(Ractive)MobilePop.__proto__=Ractive;MobilePop.prototype=Object.create(Ractive&&Ractive.prototype);MobilePop.prototype.constructor=MobilePop;return MobilePop}(Ractive);Ractive.extendWith(MobilePop,{template:{v:template.v,t:template.p.modal},data:function data(){return{contents:[]}},use:[pop(),fade()]});export default function plugin(options){if(options===void 0)options={};return function(ref){var instance=ref.instance;instance.components[options.name||"pop"]=Popover;var opts=Object.assign({},options);opts.name=opts.trigger||opts.name;trigger(opts)({instance:instance})}} |
{ | ||
"name": "@evs-chris/raui", | ||
"version": "0.5.14", | ||
"version": "0.5.15", | ||
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/evs-chris/raui", |
@@ -144,3 +144,3 @@ (function (global, factory) { | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0.done(),false]":function (_0){return([_0.done(),false]);},"[_0?_1.done():false,false]":function (_0,_1){return([_0?_1.done():false,false]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0===_1&&_2.done(),true]":function (_0,_1,_2){return([_0===_1&&_2.done(),true]);},"[_0.done()]":function (_0){return([_0.done()]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
var source, tailSource, mobilePopped, mobilePop; | ||
@@ -147,0 +147,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],t):t(e.RMAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function o(e,t,o){if(n&&n.Ractive&&"object"==typeof n.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("="),o=n[0],i=n[1];return e[o]=i,e},{})),Ractive[t][r&&r[e]||e]=o}}}function i(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var o=t.distance||"20px",i=t.scale||"0.9",r="above"===t.dir?"translateY("+o+")":"left"===t.dir?"translateX("+o+")":"right"===t.dir?"translateX(-"+o+")":"translateY(-"+o+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+i+") "+r),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+i+") "+r},n))}function r(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=i}}function a(e,t){var n=!1,o=!1;function i(n){for(var o=n.target;o;){if(o===e)return;if(!o.parentNode&&o!==document)return;o=o.parentNode}t(n)}return setTimeout(function(){n=!0,o||(document.body.addEventListener("click",i),document.body.addEventListener("touchstop",i))}),{teardown:function(){o=!0,n&&(document.body.removeEventListener("click",i),document.body.removeEventListener("touchstop",i))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}o("pop","transitions",i),o("fade","transitions",l);var s,p,f,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?1:0)":function(e,t){return e+(t?1:0)},"_0+(_1?0:1)":function(e,t){return e+(t?0:1)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0.done(),false]":function(e){return[e.done(),!1]},"[_0?_1.done():false,false]":function(e,t){return[!!e&&t.done(),!1]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=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.position=function(e){var t=e||this.source,n=this.get("popped");if(t&&n){var o=this.find("div");if(t&&o&&o.offsetParent){var i=o.offsetParent,r=i.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),c=this.get("where")||"below",s=this.get("align")||"middle",p=this.get("tail"),f="above"===c||"below"===c,d=this.get("fit"),u=this.get("gap"),b="above"===c||"below"===c?0:"left"===c?-a.width-u:l.width+u,m="left"===c||"right"===c?-l.height:"above"===c?-l.height-a.height-u:u;"middle"===s?"below"===c||"above"===c?b-=(a.width-l.width)/2:"left"!==c&&"right"!==c||(m-=(a.height-l.height)/2):"end"===s&&("below"===c||"above"===c?b+=l.width-a.width:"left"!==c&&"right"!==c||(m+=l.height-a.height));var h={popTop:l.bottom-r.top+m,popLeft:l.left-r.left+b,tail:p,vert:"above"===c||"below"===c};if(i.scrollTop&&(h.popTop+=i.scrollTop),i.scrollLeft&&(h.popLeft+=i.scrollLeft),p){"above"===c?h.tailBottom=-10:"below"===c?h.tailTop=-10:"left"===c?h.tailRight=-10:"right"===c&&(h.tailLeft=-10);var g=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===s?f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10:"end"===s?f?h.tailRight=Math.floor(g.width/2)-10:h.tailBottom=Math.floor(g.height/2)-10:"middle"===s&&(f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10),g!==l?f?(h.tailLeft&&(h.tailLeft+=g.left-l.left),h.tailRight&&(h.tailRight+=l.right-g.right)):(h.tailTop&&(h.tailTop+=g.top-l.top),h.tailBottom&&(h.tailBottom+=l.bottom-g.bottom)):"middle"===s&&(f?(h.tailLeft&&(h.tailLeft+=g.left-(h.popLeft+r.left)),h.tailRight&&(h.tailRight+=h.popLeft+r.left+a.width-g.right)):(h.tailTop&&(h.tailTop+=g.top-(h.popTop+r.top)),h.tailBottom&&(h.tailBottom+=h.popTop+r.top+a.height-g.bottom)))}if(d){var v=i;if(this.get("offsets"))for(var y=this.get("offsets");y--;)v=v.offsetParent;var x=i.scrollWidth,w=i.scrollHeight;if(h.popLeft+a.width>x){var _=h.popLeft-(x-a.width);h.popLeft-=_,f&&h.tailLeft&&(h.tailLeft+=_),f&&h.tailRight&&(h.tailRight-=_),p&&!f&&(h.tail=!1)}if(h.popLeft<0){var k=-1*h.popLeft;h.popLeft+=k,f&&h.tailLeft&&(h.tailLeft-=k),f&&h.tailRight&&(h.tailRight+=k),p&&!f&&(h.tail=!1)}if(h.popTop+a.height>w){var O=h.popTop-(w-a.height);h.popTop-=O,!f&&h.tailTop&&(h.tailTop+=O),!f&&h.tailBottom&&(h.tailBottom-=O),p&&f&&(h.tail=!1)}if(h.popTop<0){var T=-1*h.popTop;h.popTop+=T,!f&&h.tailTop&&(h.tailTop-=T),!f&&h.tailBottom&&(h.tailBottom+=T),p&&f&&(h.tail=!1)}}this.set("position",h)}else this.set("position",null)}},t.prototype.show=function(e){this.source=e,this.set("popped",!0)},t.prototype.hide=function(){this.set("popped",!1)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===f&&(f={}),function(e){e.instance.events[f.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t=this;setTimeout(function(){t.get("popped")===e&&t.set("_popped",e)},100)},_popped:{handler:function(e){var t=this;if(e){var n=this.get("@style.raui.pop.mobile");n&&window.matchMedia("(max-width: "+n+")").matches?(p||(p=new b({target:document.body,append:!0})).observe("contents",function(e){s=(e||[]).length>0}),p.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})):this.set("__popped",!0)}else s?p.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(e){if(e){var t=this.find("div"),n=t,o=n.offsetHeight+n.offsetTop,i=n.offsetWidth+n.offsetLeft,r=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};t&&t.style;){if(t===r){if(t.offsetWidth>=i&&t.offsetHeight>=o)break;i+=t.offsetLeft,o+=t.offsetTop,r=t.offsetParent}var l=getComputedStyle(t);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(t),a.v.push(t.style.overflow),t.style.overflow="visible"),t=t.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=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}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,o,i,r,a,l,c,s,p,f,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(o=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||o;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&p?(p.cancel(),p=0,f&&(f.disconnect(),f=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var o=[];o.push.apply(o,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(o=o.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var i=m.checked;i&&!~e.className.indexOf("checked")?e.className+=" checked":!i&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(f=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),p=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(i=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(r=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||o||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var p=e.className;return t||(p=p.replace(/\bfield\b/g,"").trim()),n||(p=p.replace(/\bcheck(ed)?\b/g,"").trim()),o||(p=p.replace(/\bradio\b/g,"").trim()),i||(p=p.replace(/\btextarea\b/g,"").trim()),r||(p=p.replace(/\bselect\b/g,"").trim()),a||(p=p.replace(/\bfile\b/g,"").trim()),l||(p=p.replace(/\bbutton\b/g,"").trim()),c||(p=p.replace(/\bplain\b/g,"").trim()),s||(p=p.replace(/\binput\b/g,"").trim()),p=p.replace(/ +/g," ")}var x=b.listen("focusin",h),w=b.listen("focusout",g);return v.call(this),{update:m,invalidate:v.bind(this),teardown:function(){var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),w.cancel(),p&&p.cancel(),f&&f.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t}}}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[r(),c()]}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),o=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(o?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(o?"":":disabled")+",\n label.field select"+(o?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(o?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(o?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(t.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(t.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(o?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(o?"center":"left")+";\n padding: 0.5em "+(o?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(o?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(o?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(o?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(o?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(o?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var x=t.macro(function(e){var t=[],n=(e.template.m||[]).slice(),o=e.template.f||[],i=n.find(function(e){return"value"===e.n}),r=n.find(function(e){return"type"===e.n}),a=n.find(function(e){return"tip"===e.n});if(a&&n.splice(n.indexOf(a),1),r&&"function"==typeof x.types[r.f])t.push.apply(t,x.types[r.f](n,o,e));else if(i){var l={t:7,e:"input",m:[i]};if(y(o,"option")&&(l.e="select",l.f=o),r&&(l.m.push(r),"checkbox"===r.f||"radio"===r.f)){var c=n.find(function(e){return"target"===e.n});c?l.m.push(Object.assign({},c,{n:"name"})):l.m.splice(l.m.indexOf(i),1,Object.assign({},i,{n:"checked"}))}l.m=l.m.concat(n.filter(function(e){return 73===e.t||"placeholder"===e.n})),t.push(l);var s=o.filter(function(e){return"button"===e.e||y(e.f,"button")});s.length&&(t.push.apply(t,s),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{var p=o.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1?t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:o}]:t.push.apply(t,o)}var f=n.find(function(e){return"label"===e.n});a&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(f?"":" field-solo-tip"),g:1},{t:13,n:"title",f:a.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),f?t.unshift(f.f):t.unshift(" ");var d={t:7,e:"label",m:[{t:71,n:"field"}].concat(n.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:t};n.find(function(e){return"inline"===e.n})&&d.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([d])});function w(e){return"function"==typeof e.focus&&e.focus(),{teardown:m}}x.types={},o("field","decorators",v),o("field","partials",x),o("autofocus","decorators",w);var _={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{n:["click"],t:70,f:{r:["@context","."],s:'[(_0).set("rac.value",_1)]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],f:[{t:2,x:{r:["rac","."],s:"_0._member(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1)]':function(e,t){return[e.set("rac.value",t)]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._member(_1)":function(e,t){return e._member(t)}}};function k(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var O=t.macro(function(e){var n,o;function i(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var o=n(t);"object"==typeof o&&"function"==typeof o.then?o.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",o)}else if(Array.isArray(n)){var i,r=e.get("rac._member");try{i=new RegExp(t||"","i")}catch(e){i=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return i.test(r(e))}))}else e.set("rac.list",[])}function r(n,r,a){var l=e.get("rac.member");if(e.get("rac.__member")!==l||void 0===e.get("rac._member")){if("string"==typeof l){var s=t.splitKeypath(l);l=function(e){return null==e?"(none)":k(e,s)}}else Array.isArray(l)?l=function(e){return null==e?"(none)":k(e,e)}:l||(l=function(e){return null==e?"(none)":""+e});e.set("rac._member",l),e.set("rac.__member",e.get("rac.member")),e.set("rac.display",l(e.get("rac.value")))}l=e.get("rac.items"),e.get("rac.__items")===l&&void 0!==e.get("rac._items")||(Array.isArray(l)?e.set("rac._items",l):"function"==typeof l?e.set("rac._items",l):"object"==typeof l&&"function"==typeof l.then?l.then(function(t){e.set("rac._items",t),i()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),o&&"rac.display"===a&&e.get("rac.limit")&&!o.contains(document.activeElement)&&c(),i()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",""),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var o=e.get("rac.selected"),i=e.get("rac.list");38===n?o<=0||null==o?e.set("rac.selected",Array.isArray(i)?i.length-1:0):e.set("rac.selected",o-1):Array.isArray(i)?e.set("rac.selected",o<i.length?o+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var r=e.get("rac.list");Array.isArray(r)&&e.set("rac.value",r[e.get("rac.selected")])}else 9===n&&(e.set("rac.popped",!1),e.get("rac.updateDisplay")())}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,i(t.target.value),e.get("rac.pop").show(e.find("input"))},500),e.set("rac.display",t.target.value)}),e.setTemplate(_);var a={init:!1,defer:!0},l=[e.observe("rac.display",r,a),e.observe("rac.member",r,a),e.observe("rac.items",r,a),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},a),e.observe("rac.value",function(t){c(),e.set("rac.popped",!1),e.set("rac.tempValue",t)})];function c(){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function s(t){(t.items&&e.link(t.items,"rac.items"),t.display&&e.link(t.display,"rac.display"),t.value&&e.link(t.value,"rac.value"),t.selected&&e.link(t.selected,"rac.selected"),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!0)):e.set("rac.fit",!1),e.set("rac.limit",t["limit-set"]),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());r()}return e.set("rac.updateDisplay",function(t){setTimeout(function(){o&&e.get("rac.limit")&&!o.contains(document.activeElement)&&c()},140)}),s(e.attributes),{teardown:function(){e.unlink("rac.items"),e.unlink("rac.display"),e.unlink("rac.value"),e.unlink("rac.selected"),l.forEach(function(e){return e.cancel()})},update:s,render:function(){o=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","offsets"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete.primary"));return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 10em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function T(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=O,n.components["rac-pop"]=u,n.decorators.autocompletefocus=w}}e.Autocomplete=O,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,o){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=T,e.default=T,Object.defineProperty(e,"__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.RMAutocomplete={},e.Ractive)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:null;function o(e,t,o){if(n&&n.Ractive&&"object"==typeof n.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("="),o=n[0],i=n[1];return e[o]=i,e},{})),Ractive[t][r&&r[e]||e]=o}}}function i(e,t){void 0===t&&(t={});var n=e.processParams(t,{duration:400,easing:"easeInOut"});t.dir=t.dir||!1;var o=t.distance||"20px",i=t.scale||"0.9",r="above"===t.dir?"translateY("+o+")":"left"===t.dir?"translateX("+o+")":"right"===t.dir?"translateX(-"+o+")":"translateY(-"+o+")";return e.isIntro||n.intro?(e.setStyle("opacity",0),e.setStyle("transform","scale("+i+") "+r),e.animateStyle({opacity:1,transform:"none"},n)):(e.setStyle("opacity",1),e.setStyle("transform","none"),e.animateStyle({opacity:0,transform:"scale("+i+") "+r},n))}function r(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"pop"]=i}}function a(e,t){var n=!1,o=!1;function i(n){for(var o=n.target;o;){if(o===e)return;if(!o.parentNode&&o!==document)return;o=o.parentNode}t(n)}return setTimeout(function(){n=!0,o||(document.body.addEventListener("click",i),document.body.addEventListener("touchstop",i))}),{teardown:function(){o=!0,n&&(document.body.removeEventListener("click",i),document.body.removeEventListener("touchstop",i))}}}function l(e,t){var n=e.processParams(t,{duration:200,easing:"easeInOut"});return e.isIntro||n.intro?(e.setStyle("opacity",0),e.animateStyle("opacity",1,n)):(e.setStyle("opacity",1),e.animateStyle("opacity",0,n))}function c(e){return void 0===e&&(e={}),function(t){t.instance.transitions[e.name||"fade"]=l}}o("pop","transitions",i),o("fade","transitions",l);var s,p,f,d={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(e){return e||"below"},'_0||"middle"':function(e){return e||"middle"},'[{dir:_0||"below"}]':function(e){return[{dir:e||"below"}]},'[_0.set("popped",false)]':function(e){return[e.set("popped",!1)]},"_0+(_1?1:0)":function(e,t){return e+(t?1:0)},"_0+(_1?0:1)":function(e,t){return e+(t?0:1)},"_0-2":function(e){return e-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(e,t,n){return[e===t&&n.done(),!0]},"[_0.done()]":function(e){return[e.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}},u=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.position=function(e){var t=e||this.source,n=this.get("popped");if(t&&n){var o=this.find("div");if(t&&o&&o.offsetParent){var i=o.offsetParent,r=i.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),c=this.get("where")||"below",s=this.get("align")||"middle",p=this.get("tail"),f="above"===c||"below"===c,d=this.get("fit"),u=this.get("gap"),b="above"===c||"below"===c?0:"left"===c?-a.width-u:l.width+u,m="left"===c||"right"===c?-l.height:"above"===c?-l.height-a.height-u:u;"middle"===s?"below"===c||"above"===c?b-=(a.width-l.width)/2:"left"!==c&&"right"!==c||(m-=(a.height-l.height)/2):"end"===s&&("below"===c||"above"===c?b+=l.width-a.width:"left"!==c&&"right"!==c||(m+=l.height-a.height));var h={popTop:l.bottom-r.top+m,popLeft:l.left-r.left+b,tail:p,vert:"above"===c||"below"===c};if(i.scrollTop&&(h.popTop+=i.scrollTop),i.scrollLeft&&(h.popLeft+=i.scrollLeft),p){"above"===c?h.tailBottom=-10:"below"===c?h.tailTop=-10:"left"===c?h.tailRight=-10:"right"===c&&(h.tailLeft=-10);var g=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===s?f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10:"end"===s?f?h.tailRight=Math.floor(g.width/2)-10:h.tailBottom=Math.floor(g.height/2)-10:"middle"===s&&(f?h.tailLeft=Math.floor(g.width/2)-10:h.tailTop=Math.floor(g.height/2)-10),g!==l?f?(h.tailLeft&&(h.tailLeft+=g.left-l.left),h.tailRight&&(h.tailRight+=l.right-g.right)):(h.tailTop&&(h.tailTop+=g.top-l.top),h.tailBottom&&(h.tailBottom+=l.bottom-g.bottom)):"middle"===s&&(f?(h.tailLeft&&(h.tailLeft+=g.left-(h.popLeft+r.left)),h.tailRight&&(h.tailRight+=h.popLeft+r.left+a.width-g.right)):(h.tailTop&&(h.tailTop+=g.top-(h.popTop+r.top)),h.tailBottom&&(h.tailBottom+=h.popTop+r.top+a.height-g.bottom)))}if(d){var v=i;if(this.get("offsets"))for(var y=this.get("offsets");y--;)v=v.offsetParent;var x=i.scrollWidth,w=i.scrollHeight;if(h.popLeft+a.width>x){var _=h.popLeft-(x-a.width);h.popLeft-=_,f&&h.tailLeft&&(h.tailLeft+=_),f&&h.tailRight&&(h.tailRight-=_),p&&!f&&(h.tail=!1)}if(h.popLeft<0){var k=-1*h.popLeft;h.popLeft+=k,f&&h.tailLeft&&(h.tailLeft-=k),f&&h.tailRight&&(h.tailRight+=k),p&&!f&&(h.tail=!1)}if(h.popTop+a.height>w){var O=h.popTop-(w-a.height);h.popTop-=O,!f&&h.tailTop&&(h.tailTop+=O),!f&&h.tailBottom&&(h.tailBottom-=O),p&&f&&(h.tail=!1)}if(h.popTop<0){var T=-1*h.popTop;h.popTop+=T,!f&&h.tailTop&&(h.tailTop-=T),!f&&h.tailBottom&&(h.tailBottom+=T),p&&f&&(h.tail=!1)}}this.set("position",h)}else this.set("position",null)}},t.prototype.show=function(e){this.source=e,this.set("popped",!0)},t.prototype.hide=function(){this.set("popped",!1)},t}(t);t.extendWith(u,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===f&&(f={}),function(e){e.instance.events[f.name||"clickout"]=a}),c()],template:d,css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.pop.primary")),n=(e("raui.themes")||[]).slice();return(e("raui.pop.themes")||[]).forEach(function(e){~n.indexOf(e)||n.push(e)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(t.bg||"#fff")+";\n color: "+(t.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(t.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(t.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(t.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(t.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(t.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(t.bc||"#ccc")+";\n }\n "+n.map(function(t){var n=Object.assign({},e("raui.primary"),e("raui.pop.primary"),e("raui."+t),e("raui.pop."+t));return"\n ."+t+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+t+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+t+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+t+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,e)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(e){var t=this;setTimeout(function(){t.get("popped")===e&&t.set("_popped",e)},100)},_popped:{handler:function(e){var t=this;if(e){var n=this.get("@style.raui.pop.mobile");n&&window.matchMedia("(max-width: "+n+")").matches?(p||(p=new b({target:document.body,append:!0})).observe("contents",function(e){s=(e||[]).length>0}),p.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){t.set("popped",!1)}})):this.set("__popped",!0)}else s?p.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(e){if(e){var t=this.find("div"),n=t,o=n.offsetHeight+n.offsetTop,i=n.offsetWidth+n.offsetLeft,r=n.offsetParent;if(!this.overflows)for(var a=this.overflows={e:[],v:[]};t&&t.style;){if(t===r){if(t.offsetWidth>=i&&t.offsetHeight>=o)break;i+=t.offsetLeft,o+=t.offsetTop,r=t.offsetParent}var l=getComputedStyle(t);if("auto"===l.overflow)break;"hidden"===l.overflow&&(a.e.push(t),a.v.push(t.style.overflow),t.style.overflow="visible"),t=t.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(e){var t=this;return{teardown:function(){var e=t.overflows;if(e){t.overflows=null;for(var n=0;n<e.e.length;n++)e.e[n].style.overflow=e.v[n]}}}}},data:function(){return{gap:4}}});var b=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}(t);function m(){}function h(e){~this.className.indexOf("focus")||(this.className+=" focus")}function g(e){this.className=this.className.replace(/\bfocus\b/g,"").trim()}function v(e){var t,n,o,i,r,a,l,c,s,p,f,d,u,b=this.getContext(e);function v(){var b=y().split(/\s+/).filter(function(e){return!!e});(t=!!~b.indexOf("field"))||(b.push("field"),t=!0),(n=e.querySelector("input[type=checkbox]"))&&!~b.indexOf("check")&&b.push("check"),(o=e.querySelector("input[type=radio]"))&&!~b.indexOf("radio")&&b.push("radio");var m=n||o;m&&m.checked&&!~b.indexOf("checked")&&b.push("checked"),m&&m.disabled&&!~b.indexOf("disabled")&&b.push("disabled"),!m&&p?(p.cancel(),p=0,f&&(f.disconnect(),f=0),delete m._form_callback,u&&(delete u.checked,d=u=void 0)):m&&(m._form_callback=function(t,n){if(void 0===n&&(n=!0),n&&"radio"===m.type&&m.name){var o=[];o.push.apply(o,document.querySelectorAll("input[type=radio][name="+m.name+"]")),(o=o.filter(function(e){return e!==m})).forEach(function(e){return e._form_callback&&e._form_callback(t,!1)})}var i=m.checked;i&&!~e.className.indexOf("checked")?e.className+=" checked":!i&&~e.className.indexOf("checked")&&(e.className=e.className.replace(/\bchecked\b/g,"").replace(/ +/g," ").trim())},MutationObserver&&(f=new MutationObserver(function(){var t;(t=m.disabled)&&!~e.className.indexOf("disabled")?e.className+=" disabled":!t&&~e.className.indexOf("disabled")&&(e.className=e.className.replace(/\bdisabled\b/g,"").replace(/ +/g," ").trim())})).observe(m,{attributes:!0}),p=this.getContext(m).listen("change",m._form_callback),(d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(m),"checked"))&&d.configurable&&(u=m,Object.defineProperty(m,"checked",{get:d.get,set:function(e){d.set.call(u,e),m._form_callback()},enumerable:!0,configurable:!0}))),(i=!!e.querySelector("textarea"))&&!~b.indexOf("textarea")&&b.push("textarea"),(r=!!e.querySelector("select"))&&!~b.indexOf("select")&&b.push("select"),(a=!!e.querySelector("input[type=file]"))&&!~b.indexOf("file")&&b.push("file"),(l=!!(l=e.querySelector("button"))&&l.parentNode===e)&&!~b.indexOf("button")&&b.push("button"),(c=!!e.querySelector("div"))&&!~b.indexOf("plain")&&b.push("plain"),(s=!(n||o||a||!e.querySelector("input")))&&!~b.indexOf("input")&&b.push("input"),e.className=b.join(" ")}function y(){var p=e.className;return t||(p=p.replace(/\bfield\b/g,"").trim()),n||(p=p.replace(/\bcheck(ed)?\b/g,"").trim()),o||(p=p.replace(/\bradio\b/g,"").trim()),i||(p=p.replace(/\btextarea\b/g,"").trim()),r||(p=p.replace(/\bselect\b/g,"").trim()),a||(p=p.replace(/\bfile\b/g,"").trim()),l||(p=p.replace(/\bbutton\b/g,"").trim()),c||(p=p.replace(/\bplain\b/g,"").trim()),s||(p=p.replace(/\binput\b/g,"").trim()),p=p.replace(/ +/g," ")}var x=b.listen("focusin",h),w=b.listen("focusout",g);return v.call(this),{update:m,invalidate:v.bind(this),teardown:function(){var t=y();t=t.replace(/\bfocus\b/g,"").trim(),x.cancel(),w.cancel(),p&&p.cancel(),f&&f.disconnect(),u&&(delete u.checked,d=u=void 0),e.className=t}}}function y(e,t){if(!e)return!1;for(var n=0;n<e.length;n++){if(e[n].e===t)return!0;if(e[n].f&&y(e[n].f,t))return!0}return!1}t.extendWith(b,{template:{v:d.v,t:d.p.modal},data:function(){return{contents:[]}},use:[r(),c()]}),v.style=function(e){var t=Object.assign({},e("raui.primary"),e("raui.form.primary")),n=Object.assign({},e("raui.primary.active"),e("raui.form.primary.active")),o=e("raui.form.boxy");return"\n label.field {\n display: inline-block;\n font-size: 0.9em;\n font-weight: 500;\n color: "+(t.fg||"#222")+";\n transition: 0.2s ease-in-out;\n transition-property: color;\n vertical-align: top;\n box-sizing: border-box;\n padding: 0.25em 0.5em;\n line-height: 1.5em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: inherit;\n }\n\n label.field.textarea {\n display: block;\n border: 0.0625em solid "+(t.bc||"#ccc")+";\n padding: 0.5em 0.8em 0.8em 0.8em;\n border-radius: "+(t.radius||"0.2em")+";\n box-shadow: none;\n transition-property: color, border-color, box-shadow;\n margin: 0.8em 0.2em;\n min-height: auto;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n }\n\n label.field.focus {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n\n label.field.textarea.focus {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input,\n label.field select,\n label.field textarea\n {\n display: block;\n border-width: "+(o?"0.0625em":"0 0 0.0625em 0")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n box-sizing: border-box;\n background-color: "+(o?t.bg||"#fff":"transparent")+";\n transition: 0.2s ease-in-out;\n transition-property: box-shadow, color;\n outline: none;\n box-shadow: none;\n width: 100%;\n margin-bottom: 0.8em;\n font-size: 1.1em;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";":"")+"\n font-weight: 400;\n font-family: inherit;\n }\n\n label.field input"+(o?"":":disabled")+",\n label.field select"+(o?"":":disabled")+" {\n padding: 0 0.75em;\n }\n label.field select"+(o?"":":disabled")+" {\n padding-right: 2em;\n }\n\n label.field input:disabled,\n label.field select:disabled,\n label.field textarea:disabled {\n background: #f4f4f4;\n }\n\n label.field textarea {\n line-height: 1.2em;\n }\n label.field .field-wrapper {\n display: block;\n }\n label.field > select, label.field > input,\n label.field > .field-wrapper > input, label.field > .field-wrapper > select {\n height: 2.5em;\n }\n\n "+(o?"":"label.field:hover > input,\n label.field:hover select,\n label.field.file:hover:after {\n box-shadow: 0 0.0625em 0 0 "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea:hover {\n box-shadow: 0.0625em 0.0625em "+(t.bc||"#ccc")+",\n -0.0625em 0.0625em "+(t.bc||"#ccc")+",\n 0.0625em -0.0625em "+(t.bc||"#ccc")+",\n -0.0625em -0.0625em "+(t.bc||"#ccc")+";\n }\n\n label.field.textarea.focus:hover {\n box-shadow: 0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em 0.0625em "+(n.fg||t.fga||"#07e")+",\n 0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+",\n -0.0625em -0.0625em "+(n.fg||t.fga||"#07e")+";\n }")+"\n\n /**** CHECK BOXES ****/\n\n label.field.check {\n position:relative;\n z-index: 0;\n overflow: visible;\n cursor: pointer;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.check.inline {\n padding-top: 0.7em;\n }\n\n label.field.check input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: -3px;\n top: 23px;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+";\n box-shadow: none;\n outline: none;\n opacity: 0;\n transform: scale(1);\n pointer-events: none;\n transition: opacity 0.3s, transform 0.2s;\n }\n label.field.inline.check input {\n top: 3px;\n left: -3px;\n }\n\n label.field.check input:checked {\n background-color: "+(t.fga||"#07e")+';\n }\n\n label.field.check:hover > input {\n opacity: 0.04;\n }\n\n label.field.check input:focus {\n opacity: 0.12;\n }\n\n label.field.check:hover > input:focus {\n opacity: 0.16;\n }\n\n label.field.check input:active {\n opacity: 0.6;\n transform: scale(0);\n transition: transform 0s, opacity 0s;\n }\n\n label.field.check:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 3px 11px 3px 1px;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 2px;\n width: 18px;\n height: 18px;\n vertical-align: bottom;\n transition: border-color 0.2s, background-color 0.2s;\n }\n\n label.field.check:after {\n content: "";\n display: block;\n position: absolute;\n top: 0px;\n left: 0px;\n width: 10px;\n height: 5px;\n border: solid 2px transparent;\n border-right: none;\n border-top: none;\n transform: translate(0.8em, 2.65em) rotate(-45deg);\n }\n\n label.field.check.inline:after {\n transform: translate(0.8em, 1.2em) rotate(-45deg);\n }\n\n label.field.check.checked:before {\n border-color: '+(t.fga||"#07e")+";\n background-color: "+(t.fga||"#07e")+";\n }\n label.field.check.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.check.checked:after {\n border-color: "+(t.bg||"#fff")+";\n }\n\n label.field.check input:disabled {\n opacity: 0;\n }\n\n label.field.check.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.check.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.check.checked.disabled:before {\n border-color: transparent;\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n /**** RADIO BUTTONS ****/\n \n label.field.radio {\n z-index: 0;\n position: relative;\n display: inline-block;\n overflow: visible;\n padding-top: 2.2em;\n white-space: normal;\n }\n label.field.radio.inline {\n padding-top: 0.8em;\n }\n\n label.field.radio input {\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n display: block;\n margin: 0;\n border-radius: 50%;\n width: 41px;\n height: 40px;\n background-color: "+(t.bc||"#ccc")+';\n outline: none;\n opacity: 0;\n pointer-events: none;\n transform: translate(-0.2em, 24px) scale(1);\n transition: opacity 0.3s, transform 0.3s;\n }\n label.field.inline.radio input {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio {\n cursor: pointer;\n position: relative;\n }\n\n label.field.radio:before {\n content: "";\n display: inline-block;\n box-sizing: border-box;\n margin: 2px 10px 2px 0;\n border: solid 2px; /* Safari */\n border-color: '+(t.fg||"#222")+';\n border-radius: 50%;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n transition: border-color 0.2s;\n }\n\n label.field.radio:after {\n content: "";\n display: block;\n position: absolute;\n border-radius: 50%;\n width: 10px;\n height: 10px;\n background-color: '+(t.fga||"#07e")+";\n transform: translate(5px, -17px) scale(0);\n transition: transform 0.2s;\n }\n\n label.field.radio input:checked {\n background-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.checked:after {\n transform: translate(5px, -17px) scale(1);\n }\n\n label.field.radio:hover input {\n opacity: 0.04;\n }\n\n label.field.radio input:focus {\n opacity: 0.12;\n transform: translate(-0.2em, 24px) scale(1);\n transition: transform 0.2s, opacity 0.2s;\n }\n label.field.inline.radio input:focus {\n transform: translate(-0.2em, 3px) scale(1);\n }\n\n label.field.radio:hover input:focus {\n opacity: 0.16;\n }\n\n label.field.radio input:active {\n opacity: 1;\n transform: translate(-0.2em, 24px) scale(0);\n transition: transform 0s, opacity 0s;\n }\n label.field.inline.radio input:active {\n transform: translate(-0.2em, 3px) scale(0);\n }\n\n label.field.radio.checked:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio.focus:before {\n border-color: "+(t.fga||"#07e")+";\n }\n\n label.field.radio input:disabled {\n opacity: 0;\n }\n\n label.field.radio.disabled {\n color: "+(t.bc||"#ccc")+";\n cursor: initial;\n }\n\n label.field.radio.disabled:before {\n border-color: "+(t.bc||"#ccc")+";\n }\n\n label.field.radio.disabled:after {\n background-color: "+(t.bc||"#ccc")+";\n }\n\n\n\n label.field select {\n padding-right: 2em;\n }\n\n label.field.select {\n cursor: pointer;\n position: relative;\n }\n\n label.field.select:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n right: 19px;\n height: 0.6em;\n top: 2.6em;\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n pointer-events: none;\n color: "+(t.bc||"#ccc")+";\n }\n\n label.field textarea {\n border: none;"+(o?"\n padding: 0;":"")+"\n }\n\n label.field > select {\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n\n label.field input:focus,\n label.field select:focus,\n label.field.file.focus:after\n {\n border-color: "+(n.fg||t.fga||"#07e")+";\n "+(o?"":"box-shadow: 0 0.0625em 0 0 "+(n.fg||t.fga||"#07e")+";")+"\n }\n\n label.field input[type=checkbox]:focus,\n label.field input[type=radio]:focus {\n box-shadow: none;\n }\n\n label.field.file.focus:after {\n color: "+(n.fg||t.fga||"#07e")+";\n }\n label.field.file [type=file] {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n z-index: -1;\n }\n label.field.file {\n position: relative;\n min-width: 9em;\n height: 5em;\n }\n label.field.file:after {\n position: absolute;\n content: 'Choose a file';\n box-sizing: border-box;\n width: calc(100% - 0.3em);\n height: 2.5em;\n font-size: 1.1em;\n line-height: 1.5em;\n color: "+(t.fg||"#222")+";\n text-align: "+(o?"center":"left")+";\n padding: 0.5em "+(o?"0.5em":"0")+";\n cursor: pointer;\n font-style: oblique;\n left: 0.25em;\n top: 1.6em;\n transition: 0.2s ease-in-out;\n transition-property: color, border-bolor, box-shadow;"+(o?"\n border-radius: "+(t.radius||"0.2em")+";\n border-color: "+(t.bc||"#ccc")+";\n border-style: solid;\n border-width: 0.0625em;":"\n border-bottom-color: "+(t.bc||"#ccc")+";\n border-bottom-width: 0.0625em;\n border-bottom-style: solid;\n ")+"\n }\n label.field.file.inline:after {\n top: 0.2em;\n }\n\n label.field.button {\n vertical-align: top;\n padding-top: "+(o?"1.7":"1.958")+"em;\n }\n label.field .with-buttons button, label.field.button button {\n font-size: 1.1em;\n margin-top: "+(o?"0.15em":"0")+";\n }\n\n label.field .field-wrapper.with-buttons {\n display: flex;\n }\n label.field .with-buttons button {\n flex-shrink: 0;\n padding-left: 0.5em;\n padding-right: 0.5em;\n margin-top: 0;\n margin-right: 0;\n "+(o?"height: 2.5em;\n box-shadow: none;\n border-radius: 0;\n border-left: 1px solid "+(t.bg||"#fff")+";\n margin-left: 0;":"height: 2.25em;")+"\n }"+(o?"\n label.field .with-buttons button:first-of-type {\n margin-left: -0.05em;\n border-left: none;\n }\n label.field .with-buttons button:last-of-type {\n border-radius: 0 "+(t.radius||"0.2em")+" "+(t.radius||"0.2em")+" 0;\n }\n label.field .with-buttons input {\n border-radius: "+(t.radius||"0.2em")+" 0 0 "+(t.radius||"0.2em")+";\n min-width: 0;\n }\n ":"")+"\n\n label.field.plain > div {\n position: absolute;\n font-size: 1.1em;\n top: 2.4em;\n }\n\n /* inline fields (no labels) */\n label.field.inline {\n height: 3.3em;\n }\n\n label.field.button.inline {\n margin-top: 0.2em;\n padding-top: 0.12em;\n }\n\n label.field.button.inline button {\n margin-top: 0;\n }\n\n label.field.inline.select:after {\n top: 1."+(o?"15":"1")+"em;\n }\n\n label.field .field-tip {\n display: inline-block;\n width: 1em;\n height: 1em;\n background-color: "+(t.fga||"#07e")+";\n color: "+(t.bg||"#fff;")+";\n cursor: default;\n user-select: none;\n border-radius: 1em;\n margin-left: 0.5em;\n line-height: 1.2em;\n text-align: center;\n margin-top: -0.2em;\n }\n\n label.field .field-solo-tip {\n margin-left: -0.1em;\n }\n "};var x=t.macro(function(e){var t=[],n=(e.template.m||[]).slice(),o=e.template.f||[],i=n.find(function(e){return"value"===e.n}),r=n.find(function(e){return"type"===e.n}),a=n.find(function(e){return"tip"===e.n});if(a&&n.splice(n.indexOf(a),1),r&&"function"==typeof x.types[r.f])t.push.apply(t,x.types[r.f](n,o,e));else if(i){var l={t:7,e:"input",m:[i]};if(y(o,"option")&&(l.e="select",l.f=o),r&&(l.m.push(r),"checkbox"===r.f||"radio"===r.f)){var c=n.find(function(e){return"target"===e.n});c?l.m.push(Object.assign({},c,{n:"name"})):l.m.splice(l.m.indexOf(i),1,Object.assign({},i,{n:"checked"}))}l.m=l.m.concat(n.filter(function(e){return 73===e.t||"placeholder"===e.n})),t.push(l);var s=o.filter(function(e){return"button"===e.e||y(e.f,"button")});s.length&&(t.push.apply(t,s),t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:t}])}else{var p=o.filter(function(e){return e.e});p.find(function(e){return"button"===e.e})&&p.length>1?t=[{t:7,e:"span",m:[{t:13,n:"class",f:"field-wrapper with-buttons",g:1}],f:o}]:t.push.apply(t,o)}var f=n.find(function(e){return"label"===e.n});a&&t.unshift({t:7,e:"span",m:[{t:13,n:"class",f:"field-tip"+(f?"":" field-solo-tip"),g:1},{t:13,n:"title",f:a.f},{t:70,n:["click"],f:{r:[],s:"[false]"}}],f:"?"}),f?t.unshift(f.f):t.unshift(" ");var d={t:7,e:"label",m:[{t:71,n:"field"}].concat(n.filter(function(e){return 13!==e.t&&73!==e.t||"value"!==e.n&&"type"!==e.n&&"inline"!==e.n&&"label"!==e.n&&"placeholder"!==e.n&&"target"!==e.n})),f:t};n.find(function(e){return"inline"===e.n})&&d.m.push({t:13,n:"class",f:"inline"}),e.setTemplate([d])});function w(e){return"function"==typeof e.focus&&e.focus(),{teardown:m}}x.types={},o("field","decorators",v),o("field","partials",x),o("autofocus","decorators",w);var _={v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rautocomplete field-wrapper",g:1},{n:["pop"],t:70,f:{r:["@context","$1"],s:'[(_0).set("rac.pop",_1)]'}}],f:[{t:7,e:"input",m:[{t:8,r:"extra-attributes"},{n:["dblclick"],t:70,f:{r:["rac.pop","@node"],s:"[_0.show(_1)]"}},{n:["focus"],t:70,f:{r:["rac"],s:"[_0.stash()]"}},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13}]}," ",{t:7,e:"rac-pop",m:[{t:13,n:"style",f:"padding: 0;",g:1},{t:13,n:"class",f:"rac-pop",g:1},{n:["init"],t:70,f:{r:["@context","$1"],s:'[(_0).raise("pop",{},_1)]'}},{n:"popped",t:13,f:[{t:2,r:"rac.popped"}]},{n:"where",f:"below",t:13,g:1},{n:"align",f:"end",t:13,g:1},{n:"gap",f:[{t:2,x:{r:[],s:"2"},s:1}],t:13},{n:"offsets",t:13,f:[{t:2,r:"rac.offsets"}]},{n:"fit",t:13,f:[{t:2,r:"rac.fit"}]}],f:[{t:4,f:[{t:7,e:"input",m:[{n:"class-rac-modal",t:13},{n:["input"],t:70,f:{r:["rac","@event"],s:"[_0.input(_1)]"}},{n:["keydown"],t:70,f:{r:["rac","@event"],s:"[_0.key(_1)]"}},{t:73,v:"t",f:"false"},{n:"value",f:[{t:2,r:"rac.display"}],t:13},{n:"autocompletefocus",t:71}]}],n:50,r:"inModal"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rac-list",g:1},{n:"tabindex",f:"-1",t:13,g:1}],f:[{t:55,f:[{f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Loading..."]}],t:4},{t:62,f:[" ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item",g:1},{n:"tabindex",f:"-1",t:13,g:1},{n:"class-rac-selected",t:13,f:[{t:2,x:{r:["rac.value","."],s:"_0===_1"}}]},{n:"class-rac-hover",t:13,f:[{t:2,x:{r:["rac.selected","@index"],s:"_0===_1"}}]},{n:["click"],t:70,f:{r:["@context","."],s:'[(_0).set("rac.value",_1)]'}},{n:["mouseover"],t:70,f:{r:["@context","@index"],s:'[(_0).set("rac.selected",_1)]'}}],f:[{t:2,x:{r:["rac","."],s:"_0._member(_1)"}}]}],n:52,r:"items"}," "],n:"items"},{t:63,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rac-item rac-invalid",g:1}],f:["Load failed."]}]}],r:"rac.list"}]}]}]}],e:{2:function(){return 2},'[(_0).set("rac.pop",_1)]':function(e,t){return[e.set("rac.pop",t)]},"[_0.show(_1)]":function(e,t){return[e.show(t)]},"[_0.stash()]":function(e){return[e.stash()]},"[_0.input(_1)]":function(e,t){return[e.input(t)]},"[_0.key(_1)]":function(e,t){return[e.key(t)]},'[(_0).raise("pop",{},_1)]':function(e,t){return[e.raise("pop",{},t)]},"_0===_1":function(e,t){return e===t},'[(_0).set("rac.value",_1)]':function(e,t){return[e.set("rac.value",t)]},'[(_0).set("rac.selected",_1)]':function(e,t){return[e.set("rac.selected",t)]},"_0._member(_1)":function(e,t){return e._member(t)}}};function k(e,t){return t.reduce(function(e,t){return e?e[t]:e},e)}var O=t.macro(function(e){var n,o;function i(t){null==t&&(t=null==e.get("rac.value")?"":e.get("rac.display")),t===e.get("rac.tempDisplay")&&(t="");var n=e.get("rac._items");if("function"==typeof n){var o=n(t);"object"==typeof o&&"function"==typeof o.then?o.then(function(t){return e.set("rac.list",t)}):e.set("rac.list",o)}else if(Array.isArray(n)){var i,r=e.get("rac._member");try{i=new RegExp(t||"","i")}catch(e){i=new RegExp((t||"").replace(/([\{\(\[\]\)\}\?\*\^\$])/g,"\\$1"))}e.set("rac.list",n.filter(function(e){return i.test(r(e))}))}else e.set("rac.list",[])}function r(n,r,a){var l=e.get("rac.member");if(e.get("rac.__member")!==l||void 0===e.get("rac._member")){if("string"==typeof l){var s=t.splitKeypath(l);l=function(e){return null==e?"(none)":k(e,s)}}else Array.isArray(l)?l=function(e){return null==e?"(none)":k(e,e)}:l||(l=function(e){return null==e?"(none)":""+e});e.set("rac._member",l),e.set("rac.__member",e.get("rac.member")),e.set("rac.display",l(e.get("rac.value")))}l=e.get("rac.items"),e.get("rac.__items")===l&&void 0!==e.get("rac._items")||(Array.isArray(l)?e.set("rac._items",l):"function"==typeof l?e.set("rac._items",l):"object"==typeof l&&"function"==typeof l.then?l.then(function(t){e.set("rac._items",t),i()}):e.set("rac._items",[]),e.set("rac.__items",e.get("rac.items"))),o&&"rac.display"===a&&e.get("rac.limit")&&!o.contains(document.activeElement)&&c(),i()}e.aliasLocal("rac"),e.set("rac.list",[]),e.set("rac.popped",!1),e.set("rac.stash",function(){e.set("rac.tempDisplay",e.get("rac.display")),e.set("rac.tempValue",e.get("rac.value"))}),e.set("rac.key",function(t){var n=t.which;if(27===n)e.set("rac.popped",!1),e.set("rac.display",""),e.set("rac.display",e.get("rac.tempDisplay")),e.set("rac.value",e.get("rac.tempValue"));else if(38===n||40===n){t.preventDefault(),e.get("rac.pop").show(e.find("input"));var o=e.get("rac.selected"),i=e.get("rac.list");38===n?o<=0||null==o?e.set("rac.selected",Array.isArray(i)?i.length-1:0):e.set("rac.selected",o-1):Array.isArray(i)?e.set("rac.selected",o<i.length?o+1:0):e.set("rac.selected",0)}else if(10===n||13===n){var r=e.get("rac.list");Array.isArray(r)&&e.set("rac.value",r[e.get("rac.selected")])}else 9===n&&(e.set("rac.popped",!1),e.get("rac.updateDisplay")())}),e.set("rac.input",function(t){n&&clearTimeout(n),n=setTimeout(function(){n=null,i(t.target.value),e.get("rac.pop").show(e.find("input"))},500),e.set("rac.display",t.target.value)}),e.setTemplate(_);var a={init:!1,defer:!0},l=[e.observe("rac.display",r,a),e.observe("rac.member",r,a),e.observe("rac.items",r,a),e.observe("rac.list",function(t){Array.isArray(t)?e.set("rac.selected",t.indexOf(e.get("rac.value"))):e.set("rac.selected",-1)},a),e.observe("rac.value",function(t){c(),e.set("rac.popped",!1),e.set("rac.tempValue",t)})];function c(){var t=e.get("rac._member");if("function"==typeof t){var n=t(e.get("rac.value"));e.set("rac.display",n),e.set("rac.tempDisplay",n)}}function s(t){(t.items&&e.link(t.items,"rac.items"),t.display&&e.link(t.display,"rac.display"),t.value&&e.link(t.value,"rac.value"),t.selected&&e.link(t.selected,"rac.selected"),"member"in t&&e.set("rac.member",t.member),"offsets"in t?(e.set("rac.offsets",t.offsets),e.set("rac.fit",!0)):e.set("rac.fit",!1),e.set("rac.limit",t["limit-set"]),e.get("rac.limit")&&e.get("input"))&&(e.get("input")!==document.activeElement&&c());r()}return e.set("rac.updateDisplay",function(t){setTimeout(function(){o&&e.get("rac.limit")&&!o.contains(document.activeElement)&&c()},140)}),s(e.attributes),{teardown:function(){e.unlink("rac.items"),e.unlink("rac.display"),e.unlink("rac.value"),e.unlink("rac.selected"),l.forEach(function(e){return e.cancel()})},update:s,render:function(){o=e.find("span")}}},{attributes:["items","selected","display","value","member","limit-set","offsets"],css:function(e){return[function(e){var t=Object.assign({},e("raui.primary"),e("raui.autocomplete.primary"));return".rautocomplete {\n position: relative;\n display: inline-block;\n }\n \n .rac-pop {\n min-width: 100%;\n }\n \n .rac-pop > .rpop {\n padding: 0;\n }\n \n .rac-list {\n display: flex;\n flex-direction: column;\n max-height: 50vh;\n min-height: 10em;\n max-width: 100%;\n overflow: auto;\n }\n \n .rac-item {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bg||"#fff")+";\n padding: 0.25em;\n cursor: pointer;\n }\n \n .rac-selected {\n color: "+(t.bg||"#fff")+";\n background-color: "+(t.fga||"#07e")+";\n }\n \n .rac-hover {\n color: "+(t.fg||"#222")+";\n background-color: "+(t.bc||"#ccc")+";\n }\n \n .rac-invalid {\n cursor: not-allowed;\n }\n \n input.rac-modal {\n width: 100%;\n box-sizing: border-box;\n }"}.call(this,e)].join(" ")},cssId:"rautocomplete",noCssTransform:!0});function T(e){return void 0===e&&(e={}),function(t){var n=t.instance;n.partials[e.name||"autocomplete"]=O,n.components["rac-pop"]=u,n.decorators.autocompletefocus=w}}e.Autocomplete=O,e.FieldType=function(e){return void 0===e&&(e={}),function(t,n,o){return[{t:7,e:e.name||"autocomplete",m:t,f:n}]}},e.plugin=T,e.default=T,Object.defineProperty(e,"__esModule",{value:!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.RMDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],o=n[1],a=o.map(function(t){return t[0]}).concat(o.map(function(t){return t[0].toUpperCase()})),i=r.map(function(t){return t.substr(0,3)}),l=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.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var o=new Date(r.getFullYear(),r.getMonth(),0),i=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),c=[],f=c[0]=[],u=0;u<7;u++)c[0].unshift({y:o.getFullYear(),m:o.getMonth(),d:o.getDate()-u}),c[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});c[0]=n<=s?c[0].slice(7-(s-n),14-(s-n)):c[0].slice(n-s,7+n-s),1===c[0][0].d&&c.unshift(f.slice(0,7));for(var p=c[c.length-1][c[c.length-1].length-1].d,d=c.length;d<5;d++){c[d]=[];for(var g=0;g<7&&p+1<=i;g++)c[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(c[d].length<7){for(var h=7-c[d].length,v=1;v<=h;v++)c[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});c[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)c[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!c[5]){for(c[5]=[];p<i;)c[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)c[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});c[5]=c[5].slice(0,7)}return{days:a.slice(n,n+7),weeks:c,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],o=0;o<4;o++){r.push([]);for(var a=0;a<3;a++)r[o].push({m:3*o+a,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),o=r-1,a=[],i=0;i<4;i++){a.push([]);for(var l=0;l<3;l++)a[i].push({y:o+3*i+l})}return{start:r,end:r+9,years:a}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return i[t]},e.prototype.dayName=function(t){return o[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),t.m||e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev()]":function(t){return[t.prev()]},'[_0.set("mode","month")]':function(t){return[t.set("mode","month")]},"[_0.next()]":function(t){return[t.next()]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year")]':function(t){return[t.set("mode","year")]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months")]':function(t){return[t.set("mode","months")]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month")]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year")]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months")]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}});var s="undefined"!=typeof window?window:null;function c(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],o=n[1];return t[r]=o,t},{})),Ractive[e][o&&o[t]||t]=n}}}function f(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",o=e.scale||"0.9",a="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+o+") "+a),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+o+") "+a},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=f}}function p(t,e){var n=!1,r=!1;function o(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}c("pop","transitions",f),c("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,e){return t+(e?1:0)},"_0+(_1?0:1)":function(t,e){return t+(e?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0.done(),false]":function(t){return[t.done(),!1]},"[_0?_1.done():false,false]":function(t,e){return[!!t&&e.done(),!1]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var k,x=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.position=function(t){var e=t||this.source,n=this.get("popped");if(e&&n){var r=this.find("div");if(e&&r&&r.offsetParent){var o=r.offsetParent,a=o.getBoundingClientRect(),i=r.getBoundingClientRect(),l=e.getBoundingClientRect(),s=this.get("where")||"below",c=this.get("align")||"middle",f=this.get("tail"),u="above"===s||"below"===s,p=this.get("fit"),d=this.get("gap"),g="above"===s||"below"===s?0:"left"===s?-i.width-d:l.width+d,h="left"===s||"right"===s?-l.height:"above"===s?-l.height-i.height-d:d;"middle"===c?"below"===s||"above"===s?g-=(i.width-l.width)/2:"left"!==s&&"right"!==s||(h-=(i.height-l.height)/2):"end"===c&&("below"===s||"above"===s?g+=l.width-i.width:"left"!==s&&"right"!==s||(h+=l.height-i.height));var v={popTop:l.bottom-a.top+h,popLeft:l.left-a.left+g,tail:f,vert:"above"===s||"below"===s};if(o.scrollTop&&(v.popTop+=o.scrollTop),o.scrollLeft&&(v.popLeft+=o.scrollLeft),f){"above"===s?v.tailBottom=-10:"below"===s?v.tailTop=-10:"left"===s?v.tailRight=-10:"right"===s&&(v.tailLeft=-10);var m=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===c?u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10:"end"===c?u?v.tailRight=Math.floor(m.width/2)-10:v.tailBottom=Math.floor(m.height/2)-10:"middle"===c&&(u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10),m!==l?u?(v.tailLeft&&(v.tailLeft+=m.left-l.left),v.tailRight&&(v.tailRight+=l.right-m.right)):(v.tailTop&&(v.tailTop+=m.top-l.top),v.tailBottom&&(v.tailBottom+=l.bottom-m.bottom)):"middle"===c&&(u?(v.tailLeft&&(v.tailLeft+=m.left-(v.popLeft+a.left)),v.tailRight&&(v.tailRight+=v.popLeft+a.left+i.width-m.right)):(v.tailTop&&(v.tailTop+=m.top-(v.popTop+a.top)),v.tailBottom&&(v.tailBottom+=v.popTop+a.top+i.height-m.bottom)))}if(p){var y=o;if(this.get("offsets"))for(var b=this.get("offsets");b--;)y=y.offsetParent;var w=o.scrollWidth,k=o.scrollHeight;if(v.popLeft+i.width>w){var x=v.popLeft-(w-i.width);v.popLeft-=x,u&&v.tailLeft&&(v.tailLeft+=x),u&&v.tailRight&&(v.tailRight-=x),f&&!u&&(v.tail=!1)}if(v.popLeft<0){var _=-1*v.popLeft;v.popLeft+=_,u&&v.tailLeft&&(v.tailLeft-=_),u&&v.tailRight&&(v.tailRight+=_),f&&!u&&(v.tail=!1)}if(v.popTop+i.height>k){var D=v.popTop-(k-i.height);v.popTop-=D,!u&&v.tailTop&&(v.tailTop+=D),!u&&v.tailBottom&&(v.tailBottom-=D),f&&u&&(v.tail=!1)}if(v.popTop<0){var M=-1*v.popTop;v.popTop+=M,!u&&v.tailTop&&(v.tailTop-=M),!u&&v.tailBottom&&(v.tailBottom+=M),f&&u&&(v.tail=!1)}}this.set("position",v)}else this.set("position",null)}},e.prototype.show=function(t){this.source=t,this.set("popped",!0)},e.prototype.hide=function(){this.set("popped",!1)},e}(e);e.extendWith(x,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===k&&(k={}),function(t){t.instance.events[k.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e=this;t&&(h&&(this.source=h),v&&(this.tailSource=v)),setTimeout(function(){e.get("popped")===t&&e.set("_popped",t)},100)},_popped:{handler:function(t){var e=this;if(t){var n=this.get("@style.raui.pop.mobile");n&&window.matchMedia("(max-width: "+n+")").matches?(y||(y=new _({target:document.body,append:!0})).observe("contents",function(t){m=(t||[]).length>0}),y.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})):this.set("__popped",!0)}else m?y.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var e=this.find("div"),n=e,r=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,a=n.offsetParent;if(!this.overflows)for(var i=this.overflows={e:[],v:[]};e&&e.style;){if(e===a){if(e.offsetWidth>=o&&e.offsetHeight>=r)break;o+=e.offsetLeft,r+=e.offsetTop,a=e.offsetParent}var l=getComputedStyle(e);if("auto"===l.overflow)break;"hidden"===l.overflow&&(i.e.push(e),i.v.push(e.style.overflow),e.style.overflow="visible"),e=e.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var _=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}(e);function D(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r=n+r;return r}e.extendWith(_,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()]});var M={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var t=new Date;return new Date(t.getFullYear()+"-"+D(t.getMonth()+1,2)+"-"+D(t.getDate(),2)+"T"+M.time)}};function T(t){void 0===t&&(t={});var e=t.mask||M.mask,n=(t.time||M.time,t.date||M.date);if("function"!=typeof n){var r=n;n=function(){return r}}return function(r){r.instance.decorators[t.name||"date"]=function(t,r,o){void 0===r&&(r={}),"string"==typeof r&&(r={value:r}),"string"==typeof o&&(r.mask=o);var a,i,l=this.getContext(t),s=r.mask||e,c={observers:[],listeners:[]};if("INPUT"!==t.tagName)return console.warn("Attempted to add a date decorator a "+t.tagName),Y;if(!s)return Y;for(var f,u=[],p=0;f=S.exec(s);){var d={mask:f[0],type:f[0][0],length:f[0].length,start:f.index,end:f.index+f[0].length,chunk:u.length,prefix:s.substring(p,f.index),groups:u};p=d.end,u.push(d)}if(u.suffix=s.substring(u[u.length-1].end),u.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+s+"'"),Y;function g(e){if(a){var n=a;a=!1;var r=t.value,o=B(t,n),l=o[0],s=o[1];if(n.value=+(s||1),"M"===n.type)n.value--;else if("y"===n.type&&n.value<100){var c=(new Date).getFullYear()+"";n.value-+c.substr(2)<20?n.value=+(c.substr(0,2)+"00")+n.value:n.value=+(c.substr(0,2)+"00")-100+n.value}if(H(u),C(n),A(t,u),l.length+s.length<t.selectionStart){var f=t.selectionStart+(t.value.length-r.length);t.setSelectionRange(f,f)}}"mouseup"===e.type&&document.removeEventListener("mouseup",g),(t.selectionStart>t.selectionEnd?t.selectionStart-t.selectionEnd:t.selectionEnd-t.selectionStart)===t.value.length&&"focus"!==e.type||(i&&clearTimeout(i),"focus"===e.type?i=setTimeout(function(){return N(t,j(u,t.selectionStart))}):N(t,j(u,t.selectionStart)))}return"string"==typeof r.value?c.observers.push(l.observe(r.value,function(e){e||(e=n()),u.value=e,function(t,e){if(!t)return"";if("string"==typeof t)t=new Date(t),t=new Date(+t+60*t.getTimezoneOffset()*1e3),e.value=t;else if("[object Date]"!==Object.prototype.toString.call(t))return"";e.forEach(function(e){!function(t,e){switch(e.type){case"y":e.value=t.getFullYear();break;case"M":e.value=t.getMonth();break;case"d":e.value=t.getDate();break;case"H":e.value=t.getHours();break;case"m":e.value=t.getMinutes();break;case"s":e.value=t.getSeconds();break;case"S":e.value=t.getMilliseconds()}}(t,e),C(e)})}(e,u),t.value=P(u)},{defer:!0})):u.value=z(r.date||n()),c.listeners.push(l.listen("focus",function(t){g(t)})),c.listeners.push(l.listen("blur",function(){if(a){var e=j(u,t.selectionStart);I(t,e),H(u),C(e),A(t,u),a=!1}"string"==typeof r.value&&(c.observers.forEach(function(t){return t.silence()}),l.set(r.value,u.value),c.observers.forEach(function(t){return t.resume()}))})),c.listeners.push(l.listen("dragstart",function(t){t.preventDefault(),t.stopPropagation()})),c.listeners.push(l.listen("keydown",function(e){var n=j(u,t.selectionStart),r=!0,o=!1,i=0;switch(e.key){case"ArrowDown":R(n,!0),o=n;break;case"ArrowRight":var l=B(t,n),s=l[0],c=l[1];t.selectionStart>=(s+c).length?i=1:r=!1;break;case"ArrowLeft":var f=B(t,n)[0];t.selectionStart<=f.length&&t.selectionStart-t.selectionEnd==0?i=-1:r=!1;break;case"ArrowUp":R(n,!1),o=n;break;case"Enter":i=e.shiftKey?-1:1;break;case"Backspace":case"Delete":r=!1;break;case"Tab":e.shiftKey?0===n.chunk?r=!1:i=-1:n.chunk===u.length-1?r=!1:i=1}if(e.key>="0"&&e.key<="9"){a=n;var p=t.selectionStart,d=t.selectionEnd;p!==d&&(t.value=t.value.slice(0,p>d?d:p)+t.value.slice(p>d?p:d));var g=B(t,n),h=g[0],v=g[1],m=g[2];v+=e.key,t.value=h+v+m,t.setSelectionRange(h.length+v.length,h.length+v.length),("y"===n.type&&(n.length<=2&&v.length>1||v.length>=4)||"M"===n.type&&(+v>1||v.length>1)||"d"===n.type&&(+v>3||v.length>1)||"H"===n.type&&(+v>2||v.length>1)||("m"===n.type||"s"===n.type)&&(+v>6||v.length>1)||"S"===n.type&&3===v.length)&&(n.value="M"===n.type?+v-1:+v,o=n,n.chunk<u.length-1&&(i=1),a=!1)}else e.ctrlKey||e.metaKey||e.altKey?r=!1:1===e.key.length&&a&&(i=1);r&&(e.preventDefault(),e.stopPropagation()),i&&!o&&a&&(o=!0,I(t,n)),o&&(H(u),C(n),A(t,u),!i&&o.groups&&N(t,o)),i&&(i>0?function(t,e){N(t,e.groups[e.chunk+1]?e.groups[e.chunk+1]:e.groups[0])}(t,n):i<0&&function(t,e){N(t,e.groups[e.chunk-1]?e.groups[e.chunk-1]:e.groups[e.groups.length-1])}(t,n))})),c.listeners.push(l.listen("mousedown",function(){document.addEventListener("mouseup",g)})),{teardown:function(){c.observers.forEach(function(t){return t.cancel()}),c.listeners.forEach(function(t){return t.cancel()})}}}}}var S=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,L=["January","February","March","April","May","June","July","August","September","October","November","December"],F=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var Y={teardown:function(){}};function C(t){switch(t.type){case"y":t.display=t.length<=2?(""+t.value).substr(2,2):""+D(t.value,4);break;case"M":1===t.length?t.display=""+(t.value+1):2===t.length?t.display=(t.value<9?"0":"")+(t.value+1):3===t.length?t.display=L[t.value].substr(0,3):t.display=L[t.value];break;case"d":1===t.length?t.display=""+t.value:2===t.length?t.display=(t.value<=9?"0":"")+t.value:3===t.length?t.display=F[t.groups.value.getDay()].substr(0,3):t.display=F[t.groups.value.getDay()];break;case"H":case"m":case"s":1===t.length?t.display=""+t.value:t.display=D(t.value,2);break;case"S":1===t.length?t.display=""+t.value:t.display=D(t.value,3)}}function R(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":t.value=e?t.value<2?E(t.groups.value):t.value-1:t.value+1>E(t.groups.value)?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value.down?t.value<1||t.value:!(t.value>998)&&t.value}}function P(t){return t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function j(t,e){for(var n,r=0,o=0;o<t.length;o++)if(e<=(r+=(n=t[o]).prefix.length+(n.display||"").length))return n;return t[0]}function E(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}function N(t,e){for(var n,r=0,o=e.groups,a=0;a<=e.chunk;a++)r+=(n=o[a]).prefix.length,a===e.chunk?t.setSelectionRange(r,r+(n.display||"").length):r+=(n.display||"").length}function B(t,e){var n,r=t.value,o=e.groups,a=0,i=0,l=[];for(i=0;i<e.chunk;i++)a+=o[i].prefix.length,a+=(o[i].display||"").length;return a+=o[i].prefix.length,l[0]=r.substr(0,a),o[i+1]&&(n=r.indexOf(o[i+1].prefix,a)),l[1]=r.substring(a,n),l[2]="number"==typeof n?r.substr(n):"",l}var O=new Date("0000-01-01T00:00:00");function z(t){var e=t;if("function"==typeof e&&(e=t()),"string"==typeof e)try{e=Date.parse(e)}catch(t){return defaultDate()}return"[object Date]"===Object.toString.call(Object,e)?e:O}function A(t,e){var n=t.selectionStart;t.value=P(e),t.setSelectionRange(n,n)}function H(t){var e,n=t.value||new Date,r=[n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()];t.forEach(function(t){switch(t.type){case"y":r[0]=t.value;break;case"M":r[1]=t.value,r[1]<0?(r[1]=t.value=0,C(t)):r[1]>11&&(r[1]=t.value=11,C(t)),r[1]++;break;case"d":r[2]=t.value,r[2]<1?(r[2]=t.value=1,C(t)):r[2]>31&&(r[2]=t.value=31,C(t));break;case"H":r[3]=t.value,r[3]<0?(r[3]=t.value=0,C(t)):r[3]>23&&(r[3]=t.value=23,C(t));break;case"m":r[4]=t.value,r[4]<0?(r[4]=t.value=0,C(t)):r[4]>59&&(r[4]=t.value=59,C(t));break;case"s":r[5]=t.value,r[5]<0?(r[5]=t.value=0,C(t)):r[5]>59&&(r[5]=t.value=59,C(t));break;case"S":r[6]=t.value,r[6]<0?(r[6]=t.value=0,C(t)):r[6]>999&&(r[6]=t.value=999,C(t))}});for(var o=0;o<4;o++){if(e=new Date(D(r[0],4)+"-"+D(r[1],2)+"-"+D(r[2],2)+"T"+D(r[3],2)+":"+D(r[4],2)+":"+D(r[5],2)+"."+D(r[6],3)),!isNaN(e.getDate())&&e.getDate()===r[2])return t.value=e,void(o>0&&t.filter(function(t){return"d"===t.type}).forEach(function(t){t.value=r[2],C(t)}));r[2]--}}function I(t,e){if(e.value=+(B(t,e)[1]||1),"M"===e.type)e.value--;else if("y"===e.type&&e.value<100){var n=(new Date).getFullYear()+"";e.value-+n.substr(2)<20?e.value=+(n.substr(0,2)+"00")+e.value:e.value=+(n.substr(0,2)+"00")-100+e.value}}function W(t){t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val")}var J=Ractive.macro(function(t){return t.aliasLocal("rdi"),W(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:[],s:'["rdi.val"]'}},{n:"class-rdi-date",t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"current",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},'["rdi.val"]':function(){return["rdi.val"]},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){W(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value"]});t.DateInput=J,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=x,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var o,a,i=this.getContext(t);function l(n){if("mouseover"!==n.type||!i.get(e)){if("click"!==n.type||!a||o){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),i.toggle(r.path),h=l,v=s}a&&"click"===n.type&&(o=i.observeOnce(r.path,function(){o=null}))}}function s(t){o||i.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&i.listen("click",l),("hover"in r?r.hover:n.hover)&&(a=1,i.listen("mouseover",l),i.listen("mouseout",s)),{teardown:function(){i.unlisten("click",l),a&&(i.unlisten("mouseover",l),i.unlisten("mouseout",s),o&&o.cancel())}}}})({instance:r}),T({name:"rdi-date"})({instance:r}),r.partials[t.name||"date-input"]=J,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMDateInput={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){try{var t=navigator.language||navigator.browserLanguage||navigator.languages[0]||"en";return[[0,1,2,3,4,5,6,7,8,9,10,11].map(function(e){return new Date(2006,e,1).toLocaleString(t,{month:"long"})}),[1,2,3,4,5,6,7].map(function(e){return new Date(2006,0,e).toLocaleString(t,{weekday:"long"})})]}catch(t){return[["January","February","March","April","May","June","July","August","September","October","November","December"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]]}}(),r=n[0],o=n[1],a=o.map(function(t){return t[0]}).concat(o.map(function(t){return t[0].toUpperCase()})),i=r.map(function(t){return t.substr(0,3)}),l=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.month=function(t,e){void 0===e&&(e=0);var n,r=t||new Date;if(!(r instanceof Date))return{};e&&(r=new Date(r.getFullYear(),r.getMonth()+e,r.getDate()));try{n=+this.get("firstDay")}catch(t){}("number"!=typeof n||isNaN(n))&&(n=0),n>6&&(n=0);for(var o=new Date(r.getFullYear(),r.getMonth(),0),i=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),l=new Date(r.getFullYear(),r.getMonth()+1,1),s=new Date(r.getFullYear(),r.getMonth(),1).getDay(),c=[],f=c[0]=[],u=0;u<7;u++)c[0].unshift({y:o.getFullYear(),m:o.getMonth(),d:o.getDate()-u}),c[0].push({y:r.getFullYear(),m:r.getMonth(),d:u+1});c[0]=n<=s?c[0].slice(7-(s-n),14-(s-n)):c[0].slice(n-s,7+n-s),1===c[0][0].d&&c.unshift(f.slice(0,7));for(var p=c[c.length-1][c[c.length-1].length-1].d,d=c.length;d<5;d++){c[d]=[];for(var g=0;g<7&&p+1<=i;g++)c[d].push({y:r.getFullYear(),m:r.getMonth(),d:++p});if(c[d].length<7){for(var h=7-c[d].length,v=1;v<=h;v++)c[d].push({y:l.getFullYear(),m:l.getMonth(),d:v});c[d+1]=[];for(var m=0,y=h+1;m<7;m++,y++)c[d+1].push({y:l.getFullYear(),m:l.getMonth(),d:y})}}if(!c[5]){for(c[5]=[];p<i;)c[5].push({y:r.getFullYear(),m:r.getMonth(),d:++p});for(var b=1;b<8;b++)c[5].push({y:l.getFullYear(),m:l.getMonth(),d:b});c[5]=c[5].slice(0,7)}return{days:a.slice(n,n+7),weeks:c,year:r.getFullYear(),month:r.getMonth(),currentYear:(new Date).getFullYear()}},e.prototype.year=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+e,n.getMonth(),n.getDate()));for(var r=[],o=0;o<4;o++){r.push([]);for(var a=0;a<3;a++)r[o].push({m:3*o+a,y:n.getFullYear()})}return{year:n.getFullYear(),months:r}},e.prototype.decade=function(t,e){void 0===e&&(e=0);var n=t||new Date;if(!(n instanceof Date))return{};e&&(n=new Date(n.getFullYear()+10*e,n.getMonth(),n.getDate()));for(var r=10*Math.floor(n.getFullYear()/10),o=r-1,a=[],i=0;i<4;i++){a.push([]);for(var l=0;l<3;l++)a[i].push({y:o+3*i+l})}return{start:r,end:r+9,years:a}},e.prototype.monthName=function(t){return r[t]},e.prototype.shortMonthName=function(t){return i[t]},e.prototype.dayName=function(t){return o[t]},e.prototype.select=function(t){if(t&&t instanceof Date)this.set("current",t);else{var e=this.get("safeCurrent");t&&this.set("current",new Date(t.y||e.getFullYear(),t.m||e.getMonth(),t.d||e.getDate()));var n=this.get("mode");"year"===n?this.set("mode","months"):"months"===n&&this.set("mode","month"),this.set("target",this.get("current"))}},e.prototype.isCurrent=function(t){var e=this.get("safeCurrent");return!!e&&(t&&t.y===e.getFullYear()&&(null==t.m||t.m===e.getMonth())&&(null==t.d||t.d===e.getDate()))},e.prototype.next=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()+1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()+1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()+10,t.getMonth(),1))},e.prototype.prev=function(){var t=this.get("safeTarget"),e=this.get("mode");"month"===e&&this.set("target",new Date(t.getFullYear(),t.getMonth()-1,1)),"months"===e&&this.set("target",new Date(t.getFullYear()-1,t.getMonth(),1)),"year"===e&&this.set("target",new Date(t.getFullYear()-10,t.getMonth(),1))},e.prototype.today=function(){this.set("current",new Date),this.set("target",this.get("current"))},e}(e);e.extendWith(l,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal",g:1}],f:[{t:4,f:[{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"left",x:{x:{r:["@index"],s:"_0===0"}}},{n:"right",x:{x:{r:["@last","@index"],s:"_0===_1"}}}]}],n:52,z:[{n:"offset",x:{r:"."}}],r:"~/padding"}],n:50,r:"~/padding"},{t:4,f:[{t:19,f:[{t:8,r:"~/mode"}],n:54,z:[{n:"offset",x:{x:{r:[],s:"0"}}},{n:"left",x:{x:{r:[],s:"true"}}},{n:"right",x:{x:{r:[],s:"true"}}}]}],n:51,l:1}]}],e:{0:function(){return 0},"_0===0":function(t){return 0===t},"_0===_1":function(t,e){return t===e},true:function(){return!0},"[_0.prev()]":function(t){return[t.prev()]},'[_0.set("mode","month")]':function(t){return[t.set("mode","month")]},"[_0.next()]":function(t){return[t.next()]},"_1>_0||_1<_2":function(t,e,n){return e>t||e<n},"_0.isCurrent(_1)":function(t,e){return t.isCurrent(e)},"[_0.select(_1)]":function(t,e){return[t.select(e)]},"_0.decade(_1,_2)":function(t,e,n){return t.decade(e,n)},'[_0.set("mode","year")]':function(t){return[t.set("mode","year")]},"_0.shortMonthName(_1)":function(t,e){return t.shortMonthName(e)},"_0.year(_1,_2)":function(t,e,n){return t.year(e,n)},'[_0.set("mode","months")]':function(t){return[t.set("mode","months")]},"_0.monthName(_1)":function(t,e){return t.monthName(e)},"_0!==_1":function(t,e){return t!==e},"_0.month(_1,_2)":function(t,e,n){return t.month(e,n)}},p:{year:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","month")]'}}],f:[{t:2,r:".start"}," - ",{t:2,r:".end"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-decade",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:["year.end",".y","year.start"],s:"_1>_0||_1<_2"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".y"}]}],n:52,r:"."}]}],n:52,r:".years"}]}],n:54,z:[{n:"year",x:{r:"."}}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.decade(_1,_2)"}}],months:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","year")]'}}],f:[{t:2,r:".year"}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-year",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-row",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-inner-pick",g:1},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,x:{r:["@this",".m"],s:"_0.shortMonthName(_1)"}}]}],n:52,r:"."}]}],n:52,r:".months"}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.year(_1,_2)"}}],month:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-wrapper",g:1},{n:"class-rcal-pad",t:13,f:[{t:2,r:"~/pad"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-outer",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-block-header",g:1}],f:[{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-left",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.prev()]"}}]}],n:50,r:"left"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-click",g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("mode","months")]'}}],f:[{t:2,x:{r:["@this",".month"],s:"_0.monthName(_1)"}},{t:4,f:[", ",{t:2,r:".year"}],n:50,x:{r:[".currentYear",".year"],s:"_0!==_1"}}]}," ",{t:7,e:"div",f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-right",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.next()]"}}]}],n:50,r:"right"}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-month",g:1}],f:[{t:19,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week rcal-week-header",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day rcal-day-header",g:1}],f:[{t:2,r:"."}]}],n:52,r:".days"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-week",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rcal-day",g:1},{n:"class-rcal-off-day",t:13,f:[{t:2,x:{r:[".m","month.month"],s:"_0!==_1"}}]},{n:"class-rcal-current",t:13,f:[{t:2,x:{r:["@this","."],s:"_0.isCurrent(_1)"}}]},{n:["click"],t:70,f:{r:["@this","."],s:"[_0.select(_1)]"}}],f:[{t:2,r:".d"}]}],n:52,r:"."}]}],n:52,r:".weeks"}],n:54,z:[{n:"month",x:{r:"."}}]}]}]}]}],n:54,x:{r:["@this","~/safeTarget","offset"],s:"_0.month(_1,_2)"}}]}},css:function(t){return[function(t){return".rcal-wrapper {\n display: inline-block;\n }\n \n .rcal-pad {\n padding: 0.5em;\n }\n \n .rcal-block-outer {\n border: 1px solid "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n }\n \n .rcal-block-header {\n text-align: center;\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n cursor: default;\n display: flex;\n justify-content: space-between;\n padding: 0 0.5em;\n line-height: 1em;\n height: 1.5em;\n align-items: center;\n }\n \n .rcal-click {\n cursor: pointer;\n }\n \n .rcal-left, .rcal-right {\n height: 0.8em;\n display: inline-block;\n box-sizing: border-box;\n border: 0.4em solid transparent;\n cursor: pointer;\n }\n .rcal-left {\n border-right-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n .rcal-right {\n border-left-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n }\n \n .rcal-month, .rcal-year, .rcal-decade {\n display: flex;\n flex-direction: column;\n background-color: "+(t("raui.datePicker.primary.bga")||t("raui.primary.bga")||"#f4f4f4")+";\n width: calc(10.5em + 6px);\n height: calc(10.5em + 6px);\n justify-content: space-between;\n }\n .rcal-year, .rcal-decade {\n justify-content: space-around;\n }\n \n .rcal-week {\n height: 1.5em;\n display: flex;\n justify-content: space-between;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-row {\n height: 2em;\n display: flex;\n justify-content: space-around;\n width: calc(10.5em + 6px);\n }\n \n .rcal-inner-pick {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 3em;\n height: 2em;\n line-height: 2em;\n text-align: center;\n cursor: pointer;\n }\n \n .rcal-week-header {\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }\n \n .rcal-day {\n background-color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n width: 1.5em;\n height: 1.5em;\n text-align: center;\n line-height: 1.5em;\n cursor: pointer;\n }\n \n .rcal-day-header {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fga")||t("raui.primary.fga")||"#07e")+";\n cursor: default;\n }\n \n .rcal-off-day {\n background-color: "+(t("raui.datePicker.primary.bc")||t("raui.primary.bc")||"#ccc")+";\n }\n \n .rcal-current {\n color: "+(t("raui.datePicker.primary.bg")||t("raui.primary.bg")||"#fff")+";\n background-color: "+(t("raui.datePicker.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n "}.call(this,t)].join(" ")},noCssTransform:!0,data:function(){return{mode:"month",target:new Date}},computed:{safeCurrent:function(){var t=this.get("current");if("string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date||(t=new Date),t},safeTarget:function(){var t=this.get("target");if(t||(t=this.get("current")),"string"==typeof t)try{t=new Date(t)}catch(t){}return t instanceof Date?t:new Date}}});var s="undefined"!=typeof window?window:null;function c(t,e,n){if(s&&s.Ractive&&"object"==typeof s.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),r=n[0],o=n[1];return t[r]=o,t},{})),Ractive[e][o&&o[t]||t]=n}}}function f(t,e){void 0===e&&(e={});var n=t.processParams(e,{duration:400,easing:"easeInOut"});e.dir=e.dir||!1;var r=e.distance||"20px",o=e.scale||"0.9",a="above"===e.dir?"translateY("+r+")":"left"===e.dir?"translateX("+r+")":"right"===e.dir?"translateX(-"+r+")":"translateY(-"+r+")";return t.isIntro||n.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+o+") "+a),t.animateStyle({opacity:1,transform:"none"},n)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+o+") "+a},n))}function u(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"pop"]=f}}function p(t,e){var n=!1,r=!1;function o(n){for(var r=n.target;r;){if(r===t)return;if(!r.parentNode&&r!==document)return;r=r.parentNode}e(n)}return setTimeout(function(){n=!0,r||(document.body.addEventListener("click",o),document.body.addEventListener("touchstop",o))}),{teardown:function(){r=!0,n&&(document.body.removeEventListener("click",o),document.body.removeEventListener("touchstop",o))}}}function d(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return t.isIntro||n.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,n)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,n))}function g(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"fade"]=d}}c("pop","transitions",f),c("fade","transitions",d);var h,v,m,y,b={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,e){return t+(e?1:0)},"_0+(_1?0:1)":function(t,e){return t+(e?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,e,n){return[t===e&&n.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function w(){}var k,x=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.position=function(t){var e=t||this.source,n=this.get("popped");if(e&&n){var r=this.find("div");if(e&&r&&r.offsetParent){var o=r.offsetParent,a=o.getBoundingClientRect(),i=r.getBoundingClientRect(),l=e.getBoundingClientRect(),s=this.get("where")||"below",c=this.get("align")||"middle",f=this.get("tail"),u="above"===s||"below"===s,p=this.get("fit"),d=this.get("gap"),g="above"===s||"below"===s?0:"left"===s?-i.width-d:l.width+d,h="left"===s||"right"===s?-l.height:"above"===s?-l.height-i.height-d:d;"middle"===c?"below"===s||"above"===s?g-=(i.width-l.width)/2:"left"!==s&&"right"!==s||(h-=(i.height-l.height)/2):"end"===c&&("below"===s||"above"===s?g+=l.width-i.width:"left"!==s&&"right"!==s||(h+=l.height-i.height));var v={popTop:l.bottom-a.top+h,popLeft:l.left-a.left+g,tail:f,vert:"above"===s||"below"===s};if(o.scrollTop&&(v.popTop+=o.scrollTop),o.scrollLeft&&(v.popLeft+=o.scrollLeft),f){"above"===s?v.tailBottom=-10:"below"===s?v.tailTop=-10:"left"===s?v.tailRight=-10:"right"===s&&(v.tailLeft=-10);var m=this.tailSource?this.tailSource.getBoundingClientRect():l;"start"===c?u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10:"end"===c?u?v.tailRight=Math.floor(m.width/2)-10:v.tailBottom=Math.floor(m.height/2)-10:"middle"===c&&(u?v.tailLeft=Math.floor(m.width/2)-10:v.tailTop=Math.floor(m.height/2)-10),m!==l?u?(v.tailLeft&&(v.tailLeft+=m.left-l.left),v.tailRight&&(v.tailRight+=l.right-m.right)):(v.tailTop&&(v.tailTop+=m.top-l.top),v.tailBottom&&(v.tailBottom+=l.bottom-m.bottom)):"middle"===c&&(u?(v.tailLeft&&(v.tailLeft+=m.left-(v.popLeft+a.left)),v.tailRight&&(v.tailRight+=v.popLeft+a.left+i.width-m.right)):(v.tailTop&&(v.tailTop+=m.top-(v.popTop+a.top)),v.tailBottom&&(v.tailBottom+=v.popTop+a.top+i.height-m.bottom)))}if(p){var y=o;if(this.get("offsets"))for(var b=this.get("offsets");b--;)y=y.offsetParent;var w=o.scrollWidth,k=o.scrollHeight;if(v.popLeft+i.width>w){var x=v.popLeft-(w-i.width);v.popLeft-=x,u&&v.tailLeft&&(v.tailLeft+=x),u&&v.tailRight&&(v.tailRight-=x),f&&!u&&(v.tail=!1)}if(v.popLeft<0){var _=-1*v.popLeft;v.popLeft+=_,u&&v.tailLeft&&(v.tailLeft-=_),u&&v.tailRight&&(v.tailRight+=_),f&&!u&&(v.tail=!1)}if(v.popTop+i.height>k){var D=v.popTop-(k-i.height);v.popTop-=D,!u&&v.tailTop&&(v.tailTop+=D),!u&&v.tailBottom&&(v.tailBottom-=D),f&&u&&(v.tail=!1)}if(v.popTop<0){var M=-1*v.popTop;v.popTop+=M,!u&&v.tailTop&&(v.tailTop-=M),!u&&v.tailBottom&&(v.tailBottom+=M),f&&u&&(v.tail=!1)}}this.set("position",v)}else this.set("position",null)}},e.prototype.show=function(t){this.source=t,this.set("popped",!0)},e.prototype.hide=function(){this.set("popped",!1)},e}(e);e.extendWith(x,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[u(),(void 0===k&&(k={}),function(t){t.instance.events[k.name||"clickout"]=p}),g()],template:b,css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary")),n=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~n.indexOf(t)||n.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "+n.map(function(e){var n=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+e),t("raui.pop."+e));return"\n ."+e+" .rpop {\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n }\n \n ."+e+".rpop-below .rpop-tail {\n border-bottom-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-above .rpop-tail {\n border-top-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-above .rpop-tail-outer {\n border-top-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-left .rpop-tail {\n border-left-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-left .rpop-tail-outer {\n border-left-color: "+(n.bc||"#ccc")+";\n }\n \n ."+e+".rpop-right .rpop-tail {\n border-right-color: "+(n.bg||"#fff")+";\n }\n ."+e+".rpop-right .rpop-tail-outer {\n border-right-color: "+(n.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var e=this;t&&(h&&(this.source=h),v&&(this.tailSource=v)),setTimeout(function(){e.get("popped")===t&&e.set("_popped",t)},100)},_popped:{handler:function(t){var e=this;if(t){var n=this.get("@style.raui.pop.mobile");n&&window.matchMedia("(max-width: "+n+")").matches?(y||(y=new _({target:document.body,append:!0})).observe("contents",function(t){m=(t||[]).length>0}),y.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){e.set("popped",!1)}})):this.set("__popped",!0)}else m?y.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var e=this.find("div"),n=e,r=n.offsetHeight+n.offsetTop,o=n.offsetWidth+n.offsetLeft,a=n.offsetParent;if(!this.overflows)for(var i=this.overflows={e:[],v:[]};e&&e.style;){if(e===a){if(e.offsetWidth>=o&&e.offsetHeight>=r)break;o+=e.offsetLeft,r+=e.offsetTop,a=e.offsetParent}var l=getComputedStyle(e);if("auto"===l.overflow)break;"hidden"===l.overflow&&(i.e.push(e),i.v.push(e.style.overflow),e.style.overflow="visible"),e=e.parentNode}this.position(),this.transition("pop",n,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var e=this;return{teardown:function(){var t=e.overflows;if(t){e.overflows=null;for(var n=0;n<t.e.length;n++)t.e[n].style.overflow=t.v[n]}}}}},data:function(){return{gap:4}}});var _=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}(e);function D(t,e,n){void 0===n&&(n="0");for(var r=null==t?"":""+t,o=r.length;o<e;o++)r=n+r;return r}e.extendWith(_,{template:{v:b.v,t:b.p.modal},data:function(){return{contents:[]}},use:[u(),g()]});var M={mask:"yyyy-MM-dd",time:"00:00:00.000",date:function(){var t=new Date;return new Date(t.getFullYear()+"-"+D(t.getMonth()+1,2)+"-"+D(t.getDate(),2)+"T"+M.time)}};function T(t){void 0===t&&(t={});var e=t.mask||M.mask,n=(t.time||M.time,t.date||M.date);if("function"!=typeof n){var r=n;n=function(){return r}}return function(r){r.instance.decorators[t.name||"date"]=function(t,r,o){void 0===r&&(r={}),"string"==typeof r&&(r={value:r}),"string"==typeof o&&(r.mask=o);var a,i,l=this.getContext(t),s=r.mask||e,c={observers:[],listeners:[]};if("INPUT"!==t.tagName)return console.warn("Attempted to add a date decorator a "+t.tagName),Y;if(!s)return Y;for(var f,u=[],p=0;f=S.exec(s);){var d={mask:f[0],type:f[0][0],length:f[0].length,start:f.index,end:f.index+f[0].length,chunk:u.length,prefix:s.substring(p,f.index),groups:u};p=d.end,u.push(d)}if(u.suffix=s.substring(u[u.length-1].end),u.slice(1).find(function(t){return!t.prefix}))return console.warn("Attempted to add a date decorator missing interstitial between fields '"+s+"'"),Y;function g(e){if(a){var n=a;a=!1;var r=t.value,o=B(t,n),l=o[0],s=o[1];if(n.value=+(s||1),"M"===n.type)n.value--;else if("y"===n.type&&n.value<100){var c=(new Date).getFullYear()+"";n.value-+c.substr(2)<20?n.value=+(c.substr(0,2)+"00")+n.value:n.value=+(c.substr(0,2)+"00")-100+n.value}if(H(u),C(n),A(t,u),l.length+s.length<t.selectionStart){var f=t.selectionStart+(t.value.length-r.length);t.setSelectionRange(f,f)}}"mouseup"===e.type&&document.removeEventListener("mouseup",g),(t.selectionStart>t.selectionEnd?t.selectionStart-t.selectionEnd:t.selectionEnd-t.selectionStart)===t.value.length&&"focus"!==e.type||(i&&clearTimeout(i),"focus"===e.type?i=setTimeout(function(){return N(t,j(u,t.selectionStart))}):N(t,j(u,t.selectionStart)))}return"string"==typeof r.value?c.observers.push(l.observe(r.value,function(e){e||(e=n()),u.value=e,function(t,e){if(!t)return"";if("string"==typeof t)t=new Date(t),t=new Date(+t+60*t.getTimezoneOffset()*1e3),e.value=t;else if("[object Date]"!==Object.prototype.toString.call(t))return"";e.forEach(function(e){!function(t,e){switch(e.type){case"y":e.value=t.getFullYear();break;case"M":e.value=t.getMonth();break;case"d":e.value=t.getDate();break;case"H":e.value=t.getHours();break;case"m":e.value=t.getMinutes();break;case"s":e.value=t.getSeconds();break;case"S":e.value=t.getMilliseconds()}}(t,e),C(e)})}(e,u),t.value=P(u)},{defer:!0})):u.value=z(r.date||n()),c.listeners.push(l.listen("focus",function(t){g(t)})),c.listeners.push(l.listen("blur",function(){if(a){var e=j(u,t.selectionStart);I(t,e),H(u),C(e),A(t,u),a=!1}"string"==typeof r.value&&(c.observers.forEach(function(t){return t.silence()}),l.set(r.value,u.value),c.observers.forEach(function(t){return t.resume()}))})),c.listeners.push(l.listen("dragstart",function(t){t.preventDefault(),t.stopPropagation()})),c.listeners.push(l.listen("keydown",function(e){var n=j(u,t.selectionStart),r=!0,o=!1,i=0;switch(e.key){case"ArrowDown":R(n,!0),o=n;break;case"ArrowRight":var l=B(t,n),s=l[0],c=l[1];t.selectionStart>=(s+c).length?i=1:r=!1;break;case"ArrowLeft":var f=B(t,n)[0];t.selectionStart<=f.length&&t.selectionStart-t.selectionEnd==0?i=-1:r=!1;break;case"ArrowUp":R(n,!1),o=n;break;case"Enter":i=e.shiftKey?-1:1;break;case"Backspace":case"Delete":r=!1;break;case"Tab":e.shiftKey?0===n.chunk?r=!1:i=-1:n.chunk===u.length-1?r=!1:i=1}if(e.key>="0"&&e.key<="9"){a=n;var p=t.selectionStart,d=t.selectionEnd;p!==d&&(t.value=t.value.slice(0,p>d?d:p)+t.value.slice(p>d?p:d));var g=B(t,n),h=g[0],v=g[1],m=g[2];v+=e.key,t.value=h+v+m,t.setSelectionRange(h.length+v.length,h.length+v.length),("y"===n.type&&(n.length<=2&&v.length>1||v.length>=4)||"M"===n.type&&(+v>1||v.length>1)||"d"===n.type&&(+v>3||v.length>1)||"H"===n.type&&(+v>2||v.length>1)||("m"===n.type||"s"===n.type)&&(+v>6||v.length>1)||"S"===n.type&&3===v.length)&&(n.value="M"===n.type?+v-1:+v,o=n,n.chunk<u.length-1&&(i=1),a=!1)}else e.ctrlKey||e.metaKey||e.altKey?r=!1:1===e.key.length&&a&&(i=1);r&&(e.preventDefault(),e.stopPropagation()),i&&!o&&a&&(o=!0,I(t,n)),o&&(H(u),C(n),A(t,u),!i&&o.groups&&N(t,o)),i&&(i>0?function(t,e){N(t,e.groups[e.chunk+1]?e.groups[e.chunk+1]:e.groups[0])}(t,n):i<0&&function(t,e){N(t,e.groups[e.chunk-1]?e.groups[e.chunk-1]:e.groups[e.groups.length-1])}(t,n))})),c.listeners.push(l.listen("mousedown",function(){document.addEventListener("mouseup",g)})),{teardown:function(){c.observers.forEach(function(t){return t.cancel()}),c.listeners.forEach(function(t){return t.cancel()})}}}}}var S=/y+|M+|d+|E+|H+|m+|s+|S+|k+|a+/g,L=["January","February","March","April","May","June","July","August","September","October","November","December"],F=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var Y={teardown:function(){}};function C(t){switch(t.type){case"y":t.display=t.length<=2?(""+t.value).substr(2,2):""+D(t.value,4);break;case"M":1===t.length?t.display=""+(t.value+1):2===t.length?t.display=(t.value<9?"0":"")+(t.value+1):3===t.length?t.display=L[t.value].substr(0,3):t.display=L[t.value];break;case"d":1===t.length?t.display=""+t.value:2===t.length?t.display=(t.value<=9?"0":"")+t.value:3===t.length?t.display=F[t.groups.value.getDay()].substr(0,3):t.display=F[t.groups.value.getDay()];break;case"H":case"m":case"s":1===t.length?t.display=""+t.value:t.display=D(t.value,2);break;case"S":1===t.length?t.display=""+t.value:t.display=D(t.value,3)}}function R(t,e){switch(t.type){case"y":t.value=t.value+(e?-1:1);break;case"M":t.value=e?t.value<1?11:t.value-1:t.value>10?0:t.value+1;break;case"d":t.value=e?t.value<2?E(t.groups.value):t.value-1:t.value+1>E(t.groups.value)?1:t.value+1;break;case"H":t.value=e?t.value<1?23:t.value-1:t.value>22?0:t.value+1;break;case"m":case"s":t.value=e?t.value<1?59:t.value-1:t.value>58?0:t.value+1;break;case"S":t.value.down?t.value<1||t.value:!(t.value>998)&&t.value}}function P(t){return t.reduce(function(t,e){return t+e.prefix+e.display},"")+t.suffix}function j(t,e){for(var n,r=0,o=0;o<t.length;o++)if(e<=(r+=(n=t[o]).prefix.length+(n.display||"").length))return n;return t[0]}function E(t){return new Date(new Date(t.getFullYear(),t.getMonth()+1,1)-864e5).getDate()}function N(t,e){for(var n,r=0,o=e.groups,a=0;a<=e.chunk;a++)r+=(n=o[a]).prefix.length,a===e.chunk?t.setSelectionRange(r,r+(n.display||"").length):r+=(n.display||"").length}function B(t,e){var n,r=t.value,o=e.groups,a=0,i=0,l=[];for(i=0;i<e.chunk;i++)a+=o[i].prefix.length,a+=(o[i].display||"").length;return a+=o[i].prefix.length,l[0]=r.substr(0,a),o[i+1]&&(n=r.indexOf(o[i+1].prefix,a)),l[1]=r.substring(a,n),l[2]="number"==typeof n?r.substr(n):"",l}var O=new Date("0000-01-01T00:00:00");function z(t){var e=t;if("function"==typeof e&&(e=t()),"string"==typeof e)try{e=Date.parse(e)}catch(t){return defaultDate()}return"[object Date]"===Object.toString.call(Object,e)?e:O}function A(t,e){var n=t.selectionStart;t.value=P(e),t.setSelectionRange(n,n)}function H(t){var e,n=t.value||new Date,r=[n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()];t.forEach(function(t){switch(t.type){case"y":r[0]=t.value;break;case"M":r[1]=t.value,r[1]<0?(r[1]=t.value=0,C(t)):r[1]>11&&(r[1]=t.value=11,C(t)),r[1]++;break;case"d":r[2]=t.value,r[2]<1?(r[2]=t.value=1,C(t)):r[2]>31&&(r[2]=t.value=31,C(t));break;case"H":r[3]=t.value,r[3]<0?(r[3]=t.value=0,C(t)):r[3]>23&&(r[3]=t.value=23,C(t));break;case"m":r[4]=t.value,r[4]<0?(r[4]=t.value=0,C(t)):r[4]>59&&(r[4]=t.value=59,C(t));break;case"s":r[5]=t.value,r[5]<0?(r[5]=t.value=0,C(t)):r[5]>59&&(r[5]=t.value=59,C(t));break;case"S":r[6]=t.value,r[6]<0?(r[6]=t.value=0,C(t)):r[6]>999&&(r[6]=t.value=999,C(t))}});for(var o=0;o<4;o++){if(e=new Date(D(r[0],4)+"-"+D(r[1],2)+"-"+D(r[2],2)+"T"+D(r[3],2)+":"+D(r[4],2)+":"+D(r[5],2)+"."+D(r[6],3)),!isNaN(e.getDate())&&e.getDate()===r[2])return t.value=e,void(o>0&&t.filter(function(t){return"d"===t.type}).forEach(function(t){t.value=r[2],C(t)}));r[2]--}}function I(t,e){if(e.value=+(B(t,e)[1]||1),"M"===e.type)e.value--;else if("y"===e.type&&e.value<100){var n=(new Date).getFullYear()+"";e.value-+n.substr(2)<20?e.value=+(n.substr(0,2)+"00")+e.value:e.value=+(n.substr(0,2)+"00")-100+e.value}}function W(t){t.attributes.value?t.link(t.attributes.value,"rdi.val"):t.unlink("rdi.val")}var J=Ractive.macro(function(t){return t.aliasLocal("rdi"),W(t),t.setTemplate({v:4,t:[{t:7,e:"span",m:[{t:13,n:"class",f:"rdi-date field-wrapper",g:1}],f:[{t:7,e:"input",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["node"]'}},{n:"rdi-date",t:71,f:{r:[],s:'["rdi.val"]'}},{n:"class-rdi-date",t:13}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rdi-pop",g:1},{n:"rdi-pop",t:71,f:{r:["rdi.node","rdi.tail"],s:'[{path:"rdi.popped",node:_0,tail:_1}]'}},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:7,e:"svg",m:[{n:"rdi-reg",t:71,f:{r:[],s:'["tail"]'}},{n:"x",f:"0px",t:13,g:1},{n:"y",f:"0px",t:13,g:1},{n:"viewBox",f:"0 0 48 48",t:13,g:1},{n:"xml:space",f:"preserve",t:13}],f:[{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.5;fill:none;stroke-width:1;",g:1},{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"46",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{n:"y",f:"1",t:13,g:1},{n:"x",f:"1",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"46",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.8;stroke:none;",g:1},{t:13,n:"class",f:"rdi-today",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"13",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"24",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"3",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"14",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.2;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"25",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}," ",{t:7,e:"rect",m:[{t:13,n:"style",f:"opacity:0.4;stroke:none;",g:1},{n:"y",f:"35",t:13,g:1},{n:"x",f:"37",t:13,g:1},{n:"height",f:"8",t:13,g:1},{n:"width",f:"8",t:13,g:1}]}]}]}]}," ",{t:7,e:"rdi-pop",m:[{n:"popped",t:13,f:[{t:2,r:"rdi.popped"}]},{n:"tail",f:0,t:13},{n:"align",f:"end",t:13,g:1}],f:[{t:7,e:"rdi-picker",m:[{n:["init"],t:70,f:{r:["@context","rdi.val"],s:'[(_0).component.set("target",_1)]'}},{n:"current",t:13,f:[{t:2,r:"rdi.val"}]}]}]}],e:{'["node"]':function(){return["node"]},'["rdi.val"]':function(){return["rdi.val"]},'[{path:"rdi.popped",node:_0,tail:_1}]':function(t,e){return[{path:"rdi.popped",node:t,tail:e}]},"[false,false]":function(){return[!1,!1]},'["tail"]':function(){return["tail"]},'[(_0).component.set("target",_1)]':function(t,e){return[t.component.set("target",e)]}}}),{update:function(){W(t)}}},{css:function(t){return[function(t){return".rdi-date {\n position: relative;\n display: inline-block;\n }\n \n .rdi-pop {\n position: absolute;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n flex-direction: column;\n right: 0.5em;\n height: 100%;\n top: 0;\n cursor: pointer;\n }\n \n .rdi-pop > svg {\n height: 48px;\n max-height: 60%;\n fill: "+(t("raui.dateInput.primary.fg")||t("raui.primary.fg")||"#222")+";\n }\n \n .rdi-today {\n fill: "+(t("raui.dateInput.primary.fga")||t("raui.primary.fga")||"#07e")+";\n }"}.call(this,t)].join(" ")},cssId:"rdi",noCssTransform:!0,attributes:["value"]});t.DateInput=J,t.default=function(t){return void 0===t&&(t={}),function(e){var n,r=e.instance;r.components["rdi-picker"]=l,r.components["rdi-pop"]=x,(void 0===(n={name:"rdi-pop"})&&(n={}),function(t){t.instance.decorators[n.name||"pop"]=function(t,e,r){if(void 0===r&&(r={}),!e)return{teardown:w};"string"==typeof e?r.path=e:"object"==typeof e&&(r=e);var o,a,i=this.getContext(t);function l(n){if("mouseover"!==n.type||!i.get(e)){if("click"!==n.type||!a||o){var l=h,s=v;"function"==typeof(h=r.node||t)&&(h=h()),h=h||t,"function"==typeof(v=r.tail)&&(v=v()),i.toggle(r.path),h=l,v=s}a&&"click"===n.type&&(o=i.observeOnce(r.path,function(){o=null}))}}function s(t){o||i.set(r.path,!1)}return("click"in r?r.click:!1!==n.click)&&i.listen("click",l),("hover"in r?r.hover:n.hover)&&(a=1,i.listen("mouseover",l),i.listen("mouseout",s)),{teardown:function(){i.unlisten("click",l),a&&(i.unlisten("mouseover",l),i.unlisten("mouseout",s),o&&o.cancel())}}}})({instance:r}),T({name:"rdi-date"})({instance:r}),r.partials[t.name||"date-input"]=J,r.decorators["rdi-reg"]=function(t,e){return this.getContext(t).set("rdi."+e,function(){return t}),{teardown:function(){}}}}},Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -256,3 +256,3 @@ (function (global, factory) { | ||
primary.popout = Object.assign({}, data('raui.menu.popout'), data('raui.menu.primary.popout')); | ||
var base = "\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n " + (data('raui.menu.font') ? ("font-family: " + (data('raui.menu.font')) + ";") : '') + "\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: " + (primary.fga || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid " + (primary.bc || '#ccc') + ";\n border-bottom: 0.0625em solid " + (primary.bc || '#ccc') + ";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: " + (primary.popout.bga || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n background-color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.popout.bga || '#f4f4f4') + ";\n color: " + (primary.popout.fg || '#222') + ";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.25em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n top: -0.25em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n box-sizing: border-box;\n border-right: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n background-color: " + (primary.popout.bga || primary.bga || '#f4f4f4') + ";\n border-bottom: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n border-top: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n \n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.5em;\n }\n "; | ||
var base = "\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n " + (data('raui.menu.font') ? ("font-family: " + (data('raui.menu.font')) + ";") : '') + "\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: " + (primary.fga || '#222') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.fga || '#07e') + ";\n color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid " + (primary.bc || '#ccc') + ";\n border-bottom: 0.0625em solid " + (primary.bc || '#ccc') + ";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: " + (primary.popout.bga || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.fga || '#07e') + ";\n background-color: " + (primary.bg || '#fff') + ";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n background-color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: " + (primary.bg || '#fff') + ";\n background-color: " + (primary.fg || '#222') + ";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: " + (primary.popout.bga || '#f4f4f4') + ";\n color: " + (primary.popout.fg || '#222') + ";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: " + (primary.popout.bg || primary.bg || '#fff') + ";\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n box-sizing: border-box;\n border-right: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: " + (primary.popout.fga || primary.fga || '#07e') + ";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: " + (primary.popout.fg || primary.fg || '#222') + ";\n background-color: " + (primary.popout.bga || primary.bga || '#f4f4f4') + ";\n border-bottom: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n border-top: 1px solid " + (primary.popout.bc || primary.bc || '#ccc') + ";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n "; | ||
// TODO: other themes | ||
@@ -259,0 +259,0 @@ return base; |
@@ -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.RMMenu={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n="undefined"!=typeof window?window:null;function i(t,e,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),i=n[0],r=n[1];return t[i]=r,t},{})),Ractive[e][o&&o[t]||t]=i}}}function r(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return new Promise(function(e){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var i="x"===n.axis?"width":"height";if(t.isIntro||n.intro){var r=t.getStyle(i);t.setStyle(i,0),t.setStyle("opacity",0),e(t.animateStyle(i,r,n).then(function(){return t.animateStyle("opacity",1,n)}).then(function(){t.setStyle(i,""),t.setStyle("overflow","")}))}else t.setStyle(i,t.getStyle(i)),t.setStyle("opacity",1),e(t.animateStyle("opacity",0,n).then(function(){return t.animateStyle(i,0,n)}))})})}function o(t,e){var n=!1,i=!1;function r(n){for(var i=n.target;i;){if(i===t)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}e(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",r),document.body.addEventListener("touchstop",r))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",r),document.body.removeEventListener("touchstop",r))}}}i("expand","transitions",r);var s=function(t){function e(e){t.call(this,opts),this.refs={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addItem=function(t,e){return"number"==typeof e?this.splice("items",e,0,t):this.push("items",t),new u(this,null,t)},e.prototype.visibleItems=function(t){var e=this;return t.filter(function(t){return!1!==t.condition&&("string"!=typeof t.condition||!1!==e.get(t.condition))}).length},e.prototype.getHandle=function(t){var e,n=this;if("string"==typeof t)if(this.refs[t])e=this.refs[t].ctx;else{var i=this.find(t);if(i)e=this.getContext(i);else{var r=function t(e,n){for(var i=0;i<e.length;i++){if(e[i].ref===n)return[e[i]];if(e[i].items){var r=t(e[i].items,n);if(r)return r.unshift(e[i]),r}}}(this.get("items"),t);if(r)return r.reduce(function(t,e){return new u(n,t,e)},null)}}else t&&t.parentNode?e=this.getContext(t):t&&t.decorators&&(e=t);if(e){for(var o=[e.get()],s="../../";""!==e.resolve(s);)o.unshift(e.get(s)),s+="../../";return o.reduce(function(t,e){return new u(n,t,e)},null)}},e.prototype.popAllIn=function(t){t||(t="");var e=this.get(t);if(e&&e.items)for(var n=0;n<e.items.length;n++)this.popAllIn((t?t+".":"")+"items."+n);e.open&&e.popout&&this.set((t?t+".":"")+"open",!1)},e.prototype.popSiblingsIn=function(t){var e=t.resolve(),n=t.get("../");if(n)for(var i=0;i<n.length;i++)e!==t.resolve("../"+i)&&n[i].open&&n[i].popout&&t.toggle("../"+i+".open")},e.prototype._actioned=function(){this.fire("action"),this.popAllIn()},e.prototype._itemRendered=function(t){var e=this;return setTimeout(function(){return e.fire("item",t,e.getHandle(t))}),""},e.prototype.childActive=function(t){var e=this.get(t);if(e&&e.items)for(var n=0;n<e.items.length;n++)if(!0===this.get(t+".items."+n+".active")||"function"==typeof e.items[n].active&&e.items[n].active()||this.get(t+".items."+n+".activeRef")&&this.get(e.items[n].activeRef)||this.childActive(t+".items."+n))return!0},e}(e);e.extendWith(s,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(t){return!t},"_0||_1":function(t,e){return t||e},'_0&&(_1||_2==="section")':function(t,e,n){return t&&(e||"section"===n)},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(t,e,n,i){return t?i.active(e.getHandle(n)):i.active()},'typeof _0==="function"':function(t){return"function"==typeof t},'typeof _0==="boolean"':function(t){return"boolean"==typeof t},"_0.childActive(_1)":function(t,e){return t.childActive(e)},"_0!=null":function(t){return null!=t},"[_0.action(),_1._actioned()]":function(t,e){return[t.action(),e._actioned()]},"[_0._actioned()]":function(t){return[t._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(t,e,n){return[t&&e.popSiblingsIn(n),n.toggle(".open"),!1]},"_0||(_1&&_2[_1])":function(t,e,n){return t||e&&n[e]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(t,e,n){return n&&t&&e.visibleItems(n)},"[_0.popAllIn(_1),false]":function(t,e){return[t.popAllIn(e),!1]},'!_0||_0==="item"':function(t){return!t||"item"===t},'_0==="section"':function(t){return"section"===t},'_0==="container"':function(t){return"container"===t},'(!_0||_0==="item")&&_1':function(t,e){return(!t||"item"===t)&&e},"[_0.popAllIn(_1)]":function(t,e){return[t.popAllIn(e)]},"[_0]":function(t){return[t]},'typeof _0==="string"':function(t){return"string"==typeof t},'_0||"item"':function(t){return t||"item"},"_0._itemRendered((_1))":function(t,e){return t._itemRendered(e)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(t,e,n){return void 0===e||"boolean"==typeof e&&e||"string"==typeof e&&t[e]||"function"==typeof e&&n.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.menu.primary"));return e.popout=Object.assign({},t("raui.menu.popout"),t("raui.menu.primary.popout")),"\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(t("raui.menu.font")?"font-family: "+t("raui.menu.font")+";":"")+"\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(e.fga||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(e.fga||"#07e")+";\n color: "+(e.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(e.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(e.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(e.popout.bga||e.bg||"#fff")+";\n color: "+(e.popout.fg||e.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(e.fga||"#07e")+";\n background-color: "+(e.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(e.popout.bg||e.bg||"#fff")+";\n background-color: "+(e.popout.fga||e.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(e.popout.bga||"#f4f4f4")+";\n color: "+(e.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.25em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n top: -0.25em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(e.popout.bg||e.bg||"#fff")+";\n color: "+(e.popout.fg||e.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(e.popout.fga||e.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(e.popout.fg||e.fg||"#222")+";\n background-color: "+(e.popout.bga||e.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n border-top: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n \n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.5em;\n }\n "}.call(this,t)].join(" ")},cssId:"menu",noCssTransform:!0,noIntro:!0,nestedTransitions:!1,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){var e=function t(e){if("item"!==e.e&&"section"!==e.e&&"container"!==e.e)return;var i={};var r=[];var o;"item"!==e.e&&(i.type=e.e);e.m&&e.m.forEach(function(t){if("title"===t.n)"string"==typeof t.f?i.title=t.f:i.titlePartial={t:t.f};else if(70===t.t&&"action"===t.n[0])i.actionPartial={t:[{n:["click"],f:t.f,t:t.t}]};else if("guard"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var o="_cnd"+n.length;i.condition=o,n.push({t:13,n:o,f:t.f})}else if("ref"===t.n){if("string"==typeof t.f)i.ref=t.f;else if(t.f&&1===t.f.length&&2===t.f[0].t){var s="_cnd"+n.length;n.push({t:13,n:s,f:t.f}),i.refPartials={t:[{t:71,n:"ref",f:{r:s,s:"[_0]"}}]}}}else if("active"===t.n){if(t.f&&1===t.f.length&&2===t.f[0].t){var a="_cnd"+n.length;i.activeRef=a,n.push({t:13,n:a,f:t.f})}}else if("open"===t.n)i.open=!0;else if("popout"===t.n)i.popout=!0;else if("container"===e.e&&"pad"===t.n)i.pad=!0;else if("disabled"===t.n)if(t.f&&1===t.f.length&&2===t.f[0].t){var u="_cnd"+n.length;i.disabledRef=u,n.push({t:13,n:u,f:t.f})}else 0===t.f&&(i.disabled=!0);else r.push(t)});r.length&&(i.extra={t:r});if("container"===e.e)return i.contentPartial={t:e.f},i.extra=r,i;e.f&&e.f.forEach(function(e){if("title"===e.e)1===e.f.length&&"string"==typeof e.f[0]?i.title=e.f[0]:i.titlePartial={t:e.f};else if("item"===e.e||"section"===e.e||"container"===e.e){var n=t(e);n&&(i.items||(i.items=[])).push(n)}else"left"===e.e?i.leftPartial={t:e.f}:"right"===e.e?i.rightPartial={t:e.f}:"string"==typeof e&&a.test(e)||(o||(o=[]),o.push(e))});!i.titlePartial&&o&&(i.titlePartial={t:o});o=null;return i}(t);e&&r.push(e)}),this._items=r},config:function(){this._items&&this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:!0})}},attributes:["noExpand"],use:[function(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"expand"]=r}}(),function(t){return void 0===t&&(t={}),function(e){e.instance.events[t.name||"clickout"]=o}}()],decorators:{ref:function(t,e){var n=this,i=e;n.refs||(n.refs={});var r={update:function(t){n.refs[i]===r&&delete n.refs[i],i=t,n.refs[i]=r},teardown:function(){n.refs[i]===r&&delete n.refs[i]}};return r.ctx=n.getContext(t),n.refs[i]=r,r}},transitions:{pop:function(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"}),i=this.getContext(t.node),r=i.get(".shrink");if(t.isIntro){var o=t.node.getBoundingClientRect();function s(){for(var e=t.node.parentNode;e&&e.classList;){if(e.classList.contains("rmenu"))return e;if(e.parentNode.classList.contains("rmenu-popout"))return e;e=e.parentNode}}o.left+o.width>window.innerWidth?(setTimeout(function(){return i.set(".shrink",!0)}),r=!0,s().style.overflowX="hidden"):r?(setTimeout(function(){return i.set(".shrink",!1)}),s().style.overflowX="",r=!1):s().style.overflowX=""}else setTimeout(function(){return i.set("shrink",!1)});return t.isIntro?r?(t.setStyle("left","100%"),t.animateStyle("left",0,n)):(t.setStyle("left",0),t.setStyle("z-index",-1),t.animateStyle("left","100%",n)):r?(t.setStyle("left",0),t.animateStyle("left","100%",n)):(t.setStyle("left","100%"),t.setStyle("z-index",-1),t.animateStyle("left",0,n))}}});var a=/^\s*$/;var u=function(t,e,n){this.menu=t,this.parent=e,this.item=n},f={keypath:{configurable:!0},action:{configurable:!0},active:{configurable:!0},disabled:{configurable:!0},items:{configurable:!0},ref:{configurable:!0}};function c(t){return void 0===t&&(t={}),function(e){e.instance.components[t.name||"menu"]=s}}f.keypath.get=function(){if(!this.removed){if(!this.parent)return"items."+this.menu.get("items").indexOf(this.item);var t=this.parent.keypath+".items";return t+"."+this.menu.get(t).indexOf(this.item)}},f.action.get=function(){if(!this.removed)return this.item.action},f.action.set=function(t){return this.set(".action",t)},f.active.get=function(){if(!this.removed){var t=this.item;return t.activeRef?this.menu.get(t.activeRef):"function"==typeof t.active?t.active():t.active}},f.active.set=function(t){if(!this.removed){var e=this.item;return e.activeRef?this.menu.set(e.activeRef,t):this.set(".active",t)}},f.disabled.get=function(){if(!this.removed)return this.get(".disabled")},f.disabled.set=function(t){if(!this.removed)return this.set(".disabled",t)},f.items.get=function(){var t=this;return this.item.items?this.item.items.map(function(e){return new u(t.menu,t,e)}):[]},f.ref.get=function(){if(!this.removed)return this.item.ref},f.ref.set=function(t){return this.set(".ref",t)},u.prototype.addItem=function(t,e){if(this.removed)return!1;var n=this.keypath+".items";return"number"==typeof e?this.menu.splice(n,0,e,t):this.menu.push(n,t),new u(this.menu,this,t)},u.prototype.open=function(){if(this.removed)return!1;this.menu.set(this.keypath+".open",!0)},u.prototype.close=function(){if(this.removed)return!1;this.menu.set(this.keypath+".open",!1)},u.prototype.remove=function(){if(this.removed)return!1;var t=(this.parent?this.parent.keypath+".":"")+"items",e=this.menu.get(t);return this.menu.splice(t,e.indexOf(this.item),1),this.removed=!0,!0},u.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.menu.get(this.keypath);var e=t.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+e)},u.prototype.set=function(t,e){if(this.removed)return!1;var n=t.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+n,e)},Object.defineProperties(u.prototype,f),i("RMMenu","components",s),t.Menu=s,t.plugin=c,t.default=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],e):e(t.RMMenu={},t.Ractive)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n="undefined"!=typeof window?window:null;function i(t,e,i){if(n&&n.Ractive&&"object"==typeof n.Ractive[e]){var r=document.currentScript;if(r||(r=(r=document.querySelectorAll("script"))[r.length-1]),r){var o=r.getAttribute("data-alias");o&&(o=(o=o.split("&")).reduce(function(t,e){var n=e.split("="),i=n[0],r=n[1];return t[i]=r,t},{})),Ractive[e][o&&o[t]||t]=i}}}function r(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"});return new Promise(function(e){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var i="x"===n.axis?"width":"height";if(t.isIntro||n.intro){var r=t.getStyle(i);t.setStyle(i,0),t.setStyle("opacity",0),e(t.animateStyle(i,r,n).then(function(){return t.animateStyle("opacity",1,n)}).then(function(){t.setStyle(i,""),t.setStyle("overflow","")}))}else t.setStyle(i,t.getStyle(i)),t.setStyle("opacity",1),e(t.animateStyle("opacity",0,n).then(function(){return t.animateStyle(i,0,n)}))})})}function o(t,e){var n=!1,i=!1;function r(n){for(var i=n.target;i;){if(i===t)return;if(!i.parentNode&&i!==document)return;i=i.parentNode}e(n)}return setTimeout(function(){n=!0,i||(document.body.addEventListener("click",r),document.body.addEventListener("touchstop",r))}),{teardown:function(){i=!0,n&&(document.body.removeEventListener("click",r),document.body.removeEventListener("touchstop",r))}}}i("expand","transitions",r);var s=function(t){function e(e){t.call(this,opts),this.refs={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addItem=function(t,e){return"number"==typeof e?this.splice("items",e,0,t):this.push("items",t),new u(this,null,t)},e.prototype.visibleItems=function(t){var e=this;return t.filter(function(t){return!1!==t.condition&&("string"!=typeof t.condition||!1!==e.get(t.condition))}).length},e.prototype.getHandle=function(t){var e,n=this;if("string"==typeof t)if(this.refs[t])e=this.refs[t].ctx;else{var i=this.find(t);if(i)e=this.getContext(i);else{var r=function t(e,n){for(var i=0;i<e.length;i++){if(e[i].ref===n)return[e[i]];if(e[i].items){var r=t(e[i].items,n);if(r)return r.unshift(e[i]),r}}}(this.get("items"),t);if(r)return r.reduce(function(t,e){return new u(n,t,e)},null)}}else t&&t.parentNode?e=this.getContext(t):t&&t.decorators&&(e=t);if(e){for(var o=[e.get()],s="../../";""!==e.resolve(s);)o.unshift(e.get(s)),s+="../../";return o.reduce(function(t,e){return new u(n,t,e)},null)}},e.prototype.popAllIn=function(t){t||(t="");var e=this.get(t);if(e&&e.items)for(var n=0;n<e.items.length;n++)this.popAllIn((t?t+".":"")+"items."+n);e.open&&e.popout&&this.set((t?t+".":"")+"open",!1)},e.prototype.popSiblingsIn=function(t){var e=t.resolve(),n=t.get("../");if(n)for(var i=0;i<n.length;i++)e!==t.resolve("../"+i)&&n[i].open&&n[i].popout&&t.toggle("../"+i+".open")},e.prototype._actioned=function(){this.fire("action"),this.popAllIn()},e.prototype._itemRendered=function(t){var e=this;return setTimeout(function(){return e.fire("item",t,e.getHandle(t))}),""},e.prototype.childActive=function(t){var e=this.get(t);if(e&&e.items)for(var n=0;n<e.items.length;n++)if(!0===this.get(t+".items."+n+".active")||"function"==typeof e.items[n].active&&e.items[n].active()||this.get(t+".items."+n+".activeRef")&&this.get(e.items[n].activeRef)||this.childActive(t+".items."+n))return!0},e}(e);e.extendWith(s,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-wrapper",g:1},{t:16,r:"extra-attributes"},{n:"class-rmenu-vertical",t:13,f:[{t:2,x:{r:["~/horizontal"],s:"!_0"}}]},{n:"class-rmenu-horizontal",t:13,f:[{t:2,r:"~/horizontal"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-inner",g:1}],f:[{t:8,r:"items"}]}]}]}],e:{"!_0":function(t){return!t},"_0||_1":function(t,e){return t||e},'_0&&(_1||_2==="section")':function(t,e,n){return t&&(e||"section"===n)},"_0?_3.active(_1.getHandle((_2))):_3.active()":function(t,e,n,i){return t?i.active(e.getHandle(n)):i.active()},'typeof _0==="function"':function(t){return"function"==typeof t},'typeof _0==="boolean"':function(t){return"boolean"==typeof t},"_0.childActive(_1)":function(t,e){return t.childActive(e)},"_0!=null":function(t){return null!=t},"[_0.action(),_1._actioned()]":function(t,e){return[t.action(),e._actioned()]},"[_0._actioned()]":function(t){return[t._actioned()]},'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]':function(t,e,n){return[t&&e.popSiblingsIn(n),n.toggle(".open"),!1]},"_0||(_1&&_2[_1])":function(t,e,n){return t||e&&n[e]},'[{axis:"x"}]':function(){return[{axis:"x"}]},"_2&&_0&&_1.visibleItems(_2)":function(t,e,n){return n&&t&&e.visibleItems(n)},"[_0.popAllIn(_1),false]":function(t,e){return[t.popAllIn(e),!1]},'!_0||_0==="item"':function(t){return!t||"item"===t},'_0==="section"':function(t){return"section"===t},'_0==="container"':function(t){return"container"===t},'(!_0||_0==="item")&&_1':function(t,e){return(!t||"item"===t)&&e},"[_0.popAllIn(_1)]":function(t,e){return[t.popAllIn(e)]},"[_0]":function(t){return[t]},'typeof _0==="string"':function(t){return"string"==typeof t},'_0||"item"':function(t){return t||"item"},"_0._itemRendered((_1))":function(t,e){return t._itemRendered(e)},'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())':function(t,e,n){return void 0===e||"boolean"==typeof e&&e||"string"==typeof e&&t[e]||"function"==typeof e&&n.condition()}},p:{container:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:3,r:".content"}]}],n:50,r:".pad"},{t:4,f:[{t:3,r:".content"}],n:51,l:1}],n:50,r:".content"},{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-container-pad",g:1}],f:[{t:16,r:".contentPartial"}]}],n:50,r:".pad"},{t:4,f:[{t:16,r:".contentPartial"}],n:51,l:1}],n:50,r:".contentPartial",l:1}],section:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1}],f:[{t:4,f:[{t:2,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}]}],n:50,x:{r:[".title",".titlePartial"],s:"_0||_1"}}," ",{t:8,r:"children"}],children:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-items",g:1},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:[".popout"],s:"!_0"}},{t:4,f:[{n:"pop",t:72,v:"t0"}],n:51,l:1},{n:"class-rmenu-shrink",t:13,f:[{t:2,r:".shrink"}]}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popitems",g:1}],f:[{t:8,r:"items"}]}],n:50,r:".popout"},{t:4,f:[{t:8,r:"items"}],n:51,l:1}]}],n:50,x:{r:[".items.length",".open",".type"],s:'_0&&(_1||_2==="section")'}}],item:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-main",g:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".activeRef"}]}}]}],n:50,r:".activeRef"},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:[".active.length","@this","@context","."],s:"_0?_3.active(_1.getHandle((_2))):_3.active()"}}]}],n:50,x:{r:[".active"],s:'typeof _0==="function"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,r:".active"}]}],n:50,x:{r:[".active"],s:'typeof _0==="boolean"'},l:1},{t:4,f:[{n:"class-rmenu-active",t:13,f:[{t:2,x:{r:["@this","@keypath"],s:"_0.childActive(_1)"}}]}],n:50,r:".popout",l:1},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,r:".disabled"}]}],n:50,x:{r:[".disabled"],s:"_0!=null"}},{t:4,f:[{n:"class-rmenu-disabled",t:13,f:[{t:2,rx:{r:"~/",m:[{t:30,n:".disabledRef"}]}}]}],n:50,r:".disabledRef",l:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-left",g:1}],f:[{t:3,r:".left"}]}],n:50,r:".left"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-left",g:1}],f:[{t:16,r:".leftPartial"}]}],n:50,r:".leftPartial",l:1}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-title",g:1},{t:4,f:[{t:4,f:[{n:["click"],t:70,f:{r:[".","@this"],s:"[_0.action(),_1._actioned()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}},{t:4,f:[{t:16,r:".actionPartial"},{n:["click"],t:70,f:{r:["@this"],s:"[_0._actioned()]"}}],n:50,r:".actionPartial",l:1},{t:4,f:[{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}}],n:50,r:".items.length",l:1}],n:51,x:{r:[".disabled",".disabledRef","~/"],s:"_0||(_1&&_2[_1])"}}],f:[{t:4,f:[{t:3,r:".title"}],n:50,r:".title"},{t:4,f:[{t:16,r:".titlePartial"}],n:50,r:".titlePartial",l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"menu-right",g:1}],f:[{t:3,r:".right"}]}],n:50,r:".right"},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-right",g:1}],f:[{t:16,r:".rightPartial"}]}],n:50,r:".rightPartial",l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-expand",g:1},{n:["click"],t:70,f:{r:[".popout","@this","@context"],s:'[_0&&_1.popSiblingsIn((_2)),(_2).toggle(".open"),false]'}},{n:"expand",t:72,f:{r:[],s:'[{axis:"x"}]'},v:"t0"}]}],n:50,x:{r:[".items.length","@this",".items"],s:"_2&&_0&&_1.visibleItems(_2)"}}]}," ",{t:8,r:"children"}],items:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-popout-close",g:1},{n:["click"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1),false]"}}],f:["❌ Close"]}],n:50,r:".shrink"}," ",{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rmenu-entry",g:1},{t:4,f:[{n:"class-rmenu-item",t:13}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}},{t:4,f:[{n:"class-rmenu-section",t:13}],n:50,x:{r:[".type"],s:'_0==="section"'},l:1},{t:4,f:[{n:"class-rmenu-container",t:13}],n:50,x:{r:[".type"],s:'_0==="container"'},l:1},{n:"class-rmenu-expanded",t:13,f:[{t:2,r:".open"}]},{n:"class-rmenu-popout",t:13,f:[{t:2,x:{r:[".type",".popout"],s:'(!_0||_0==="item")&&_1'}}]},{t:4,f:[{n:"pop",t:72,v:"t0"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this","@keypath"],s:"[_0.popAllIn(_1)]"}}],n:50,r:".open"}," "],n:50,r:".popout"},{t:4,f:[{n:"expand",t:72,v:"t0"}],n:50,x:{r:["~/noExpand"],s:"!_0"},l:1},{t:4,f:[{t:8,r:".refPartial"}],n:50,r:".refPartial"},{t:4,f:[{n:"ref",t:71,f:{r:[".ref"],s:"[_0]"}}],n:50,x:{r:[".ref"],s:'typeof _0==="string"'},l:1},{t:4,f:[{t:16,r:".extra"}],n:50,r:".extra"}],f:[{t:8,x:{r:[".type"],s:'_0||"item"'}}," ",{t:4,f:[{t:2,x:{r:["@this","@context"],s:"_0._itemRendered((_1))"}}],n:50,x:{r:[".type"],s:'!_0||_0==="item"'}}]}],n:50,x:{r:["~/",".condition","."],s:'_1===undefined||(typeof _1==="boolean"&&_1)||(typeof _1==="string"&&_0[_1])||(typeof _1==="function"&&_2.condition())'}}],n:52,r:".items"}]}},css:function(t){return[function(t){var e=Object.assign({},t("raui.primary"),t("raui.menu.primary"));return e.popout=Object.assign({},t("raui.menu.popout"),t("raui.menu.primary.popout")),"\n .rmenu-wrapper {\n position: relative;\n z-index: 1;\n }\n .rmenu-wrapper.rmenu-vertical {\n min-height: 100%;\n }\n .rmenu {\n "+(t("raui.menu.font")?"font-family: "+t("raui.menu.font")+";":"")+"\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fg||"#222")+";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n .rmenu-wrapper.alt > .rmenu {\n color: "+(e.fga||"#222")+";\n background-color: "+(e.bg||"#fff")+";\n }\n .rmenu-inner {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-item {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n transition: border 0.2s ease-in-out;\n }\n .rmenu-item:hover > .rmenu-main {\n background-color: "+(e.fga||"#07e")+";\n color: "+(e.bg||"#fff")+";\n }\n .rmenu-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .rmenu-popout {\n border: none;\n }\n .rmenu-expanded {\n border-top: 0.0625em solid "+(e.bc||"#ccc")+";\n border-bottom: 0.0625em solid "+(e.bc||"#ccc")+";\n }\n .rmenu-popout.rmenu-expanded {\n border: none;\n }\n .rmenu-popout .rmenu-popout.rmenu-expanded {\n background-color: "+(e.popout.bga||e.bg||"#fff")+";\n color: "+(e.popout.fg||e.fg||"#222")+";\n }\n .rmenu-popitems {\n height: 100%;\n overflow-y: auto;\n }\n .rmenu-main {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n transition: 0.3s ease-in-out;\n transition-property: color, background-color;\n display: flex;\n align-items: center;\n min-height: 1em;\n }\n .rmenu-main.rmenu-active, .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(e.fga||"#07e")+";\n background-color: "+(e.bg||"#fff")+";\n }\n .rmenu-popout .rmenu-entry .rmenu-main.rmenu-active, .rmenu-popout .rmenu-item:hover > .rmenu-main.rmenu-active {\n color: "+(e.popout.bg||e.bg||"#fff")+";\n background-color: "+(e.popout.fga||e.fga||"#07e")+";\n }\n .rmenu-wrapper.alt .rmenu-main.rmenu.active {\n color: "+(e.bg||"#fff")+";\n background-color: "+(e.fg||"#222")+";\n }\n .rmenu-popout .rmenu-items .rmenu-item:hover > .rmenu-main {\n background-color: "+(e.popout.bga||"#f4f4f4")+";\n color: "+(e.popout.fg||"#222")+";\n }\n \n .rmenu-items {\n display: block;\n }\n .rmenu-right {\n padding-right: 0.4em; \n }\n .rmenu-left {\n padding-left: 0.4em;\n }\n .rmenu-expand {\n width: 1.5em;\n height: 1.5em;\n padding-left: 0.5em;\n cursor: pointer;\n position: relative;\n }\n .rmenu-expand:before {\n position: absolute;\n display: inline-block;\n top: 0.35em;\n content: ' ';\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out, left 0.2s ease-in-out;\n box-sizing: border-box;\n border-width: 0.25em;\n border-style: solid;\n border-left-color: transparent;\n border-top-color: transparent;\n }\n .rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-135deg);\n top: 0.65em;\n }\n \n .rmenu-popout > .rmenu-items {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: "+(e.popout.bg||e.bg||"#fff")+";\n color: "+(e.popout.fg||e.fg||"#222")+";\n box-sizing: border-box;\n border-right: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n z-index: -1;\n transition: box-shadow 0.2s ease-in-out;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: 100%;\n z-index: initial;\n box-shadow: 0.2em 0 0.2em rgba(0, 0, 0, 0.2);\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items {\n left: calc(100% + 1px);\n }\n \n .rmenu-popout > .rmenu-items.rmenu-shrink {\n left: 100%;\n z-index: 1;\n }\n .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink,\n .rmenu-popout.rmenu-expanded > .rmenu-items .rmenu-popout.rmenu-expanded > .rmenu-items.rmenu-shrink {\n left: 0;\n }\n \n .rmenu-popout > .rmenu-main > .rmenu-expand:before {\n transform: rotate(-45deg);\n top: 0.4em;\n }\n \n .rmenu-popout.rmenu-expanded > .rmenu-main > .rmenu-expand:before {\n transform: rotate(135deg);\n left: 0.75em;\n }\n \n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items {\n height: 100%;\n width: calc(100% + 1px);\n top: 0px;\n }\n .rmenu-popout > .rmenu-items .rmenu-popout > .rmenu-items.rmenu-shrink {\n height: 100%;\n }\n \n .rmenu-popout-close {\n color: "+(e.popout.fga||e.fga||"#07e")+";\n display: block;\n padding: 0.5em;\n cursor: pointer;\n }\n \n .rmenu-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: 0.5em;\n flex-grow: 1;\n }\n .rmenu-disabled > .rmenu-title {\n cursor: not-allowed;\n }\n .rmenu-item h1, .rmenu-item h2, .rmenu-item h3, .rmenu-item h4 {\n margin: 0;\n }\n \n .rmenu-section {\n padding: 0 0 0.75em 0;\n }\n .rmenu-section > .rmenu-main {\n cursor: default;\n font-size: 0.75em;\n opacity: 0.7;\n margin-bottom: 0.25em;\n }\n .rmenu-section > .rmenu-main .rmenu-title {\n cursor: default;\n }\n .rmenu-popout .rmenu-section:first-child > .rmenu-main {\n padding-top: 0;\n }\n .rmenu-popout .rmenu-section > .rmenu-main > .rmenu-title {\n font-size: 1.5em;\n text-align: center;\n padding: 0.75em;\n opacity: 1;\n font-weight: bold;\n color: "+(e.popout.fg||e.fg||"#222")+";\n background-color: "+(e.popout.bga||e.bga||"#f4f4f4")+";\n border-bottom: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n border-top: 1px solid "+(e.popout.bc||e.bc||"#ccc")+";\n }\n \n .rmenu-container {\n box-sizing: border-box;\n }\n \n .rmenu-container-pad {\n padding: 0.3em 0.3em 0.8em 0.3em;\n }\n "}.call(this,t)].join(" ")},cssId:"menu",noCssTransform:!0,noIntro:!0,nestedTransitions:!1,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){var e=function t(e){if("item"!==e.e&&"section"!==e.e&&"container"!==e.e)return;var i={};var r=[];var o;"item"!==e.e&&(i.type=e.e);e.m&&e.m.forEach(function(t){if("title"===t.n)"string"==typeof t.f?i.title=t.f:i.titlePartial={t:t.f};else if(70===t.t&&"action"===t.n[0])i.actionPartial={t:[{n:["click"],f:t.f,t:t.t}]};else if("guard"===t.n&&t.f&&1===t.f.length&&2===t.f[0].t){var o="_cnd"+n.length;i.condition=o,n.push({t:13,n:o,f:t.f})}else if("ref"===t.n){if("string"==typeof t.f)i.ref=t.f;else if(t.f&&1===t.f.length&&2===t.f[0].t){var s="_cnd"+n.length;n.push({t:13,n:s,f:t.f}),i.refPartials={t:[{t:71,n:"ref",f:{r:s,s:"[_0]"}}]}}}else if("active"===t.n){if(t.f&&1===t.f.length&&2===t.f[0].t){var a="_cnd"+n.length;i.activeRef=a,n.push({t:13,n:a,f:t.f})}}else if("open"===t.n)i.open=!0;else if("popout"===t.n)i.popout=!0;else if("container"===e.e&&"pad"===t.n)i.pad=!0;else if("disabled"===t.n)if(t.f&&1===t.f.length&&2===t.f[0].t){var u="_cnd"+n.length;i.disabledRef=u,n.push({t:13,n:u,f:t.f})}else 0===t.f&&(i.disabled=!0);else r.push(t)});r.length&&(i.extra={t:r});if("container"===e.e)return i.contentPartial={t:e.f},i.extra=r,i;e.f&&e.f.forEach(function(e){if("title"===e.e)1===e.f.length&&"string"==typeof e.f[0]?i.title=e.f[0]:i.titlePartial={t:e.f};else if("item"===e.e||"section"===e.e||"container"===e.e){var n=t(e);n&&(i.items||(i.items=[])).push(n)}else"left"===e.e?i.leftPartial={t:e.f}:"right"===e.e?i.rightPartial={t:e.f}:"string"==typeof e&&a.test(e)||(o||(o=[]),o.push(e))});!i.titlePartial&&o&&(i.titlePartial={t:o});o=null;return i}(t);e&&r.push(e)}),this._items=r},config:function(){this._items&&this.set("items",(this.get("items")||[]).concat(this._items),{shuffle:!0})}},attributes:["noExpand"],use:[function(t){return void 0===t&&(t={}),function(e){e.instance.transitions[t.name||"expand"]=r}}(),function(t){return void 0===t&&(t={}),function(e){e.instance.events[t.name||"clickout"]=o}}()],decorators:{ref:function(t,e){var n=this,i=e;n.refs||(n.refs={});var r={update:function(t){n.refs[i]===r&&delete n.refs[i],i=t,n.refs[i]=r},teardown:function(){n.refs[i]===r&&delete n.refs[i]}};return r.ctx=n.getContext(t),n.refs[i]=r,r}},transitions:{pop:function(t,e){var n=t.processParams(e,{duration:200,easing:"easeInOut"}),i=this.getContext(t.node),r=i.get(".shrink");if(t.isIntro){var o=t.node.getBoundingClientRect();function s(){for(var e=t.node.parentNode;e&&e.classList;){if(e.classList.contains("rmenu"))return e;if(e.parentNode.classList.contains("rmenu-popout"))return e;e=e.parentNode}}o.left+o.width>window.innerWidth?(setTimeout(function(){return i.set(".shrink",!0)}),r=!0,s().style.overflowX="hidden"):r?(setTimeout(function(){return i.set(".shrink",!1)}),s().style.overflowX="",r=!1):s().style.overflowX=""}else setTimeout(function(){return i.set("shrink",!1)});return t.isIntro?r?(t.setStyle("left","100%"),t.animateStyle("left",0,n)):(t.setStyle("left",0),t.setStyle("z-index",-1),t.animateStyle("left","100%",n)):r?(t.setStyle("left",0),t.animateStyle("left","100%",n)):(t.setStyle("left","100%"),t.setStyle("z-index",-1),t.animateStyle("left",0,n))}}});var a=/^\s*$/;var u=function(t,e,n){this.menu=t,this.parent=e,this.item=n},f={keypath:{configurable:!0},action:{configurable:!0},active:{configurable:!0},disabled:{configurable:!0},items:{configurable:!0},ref:{configurable:!0}};function c(t){return void 0===t&&(t={}),function(e){e.instance.components[t.name||"menu"]=s}}f.keypath.get=function(){if(!this.removed){if(!this.parent)return"items."+this.menu.get("items").indexOf(this.item);var t=this.parent.keypath+".items";return t+"."+this.menu.get(t).indexOf(this.item)}},f.action.get=function(){if(!this.removed)return this.item.action},f.action.set=function(t){return this.set(".action",t)},f.active.get=function(){if(!this.removed){var t=this.item;return t.activeRef?this.menu.get(t.activeRef):"function"==typeof t.active?t.active():t.active}},f.active.set=function(t){if(!this.removed){var e=this.item;return e.activeRef?this.menu.set(e.activeRef,t):this.set(".active",t)}},f.disabled.get=function(){if(!this.removed)return this.get(".disabled")},f.disabled.set=function(t){if(!this.removed)return this.set(".disabled",t)},f.items.get=function(){var t=this;return this.item.items?this.item.items.map(function(e){return new u(t.menu,t,e)}):[]},f.ref.get=function(){if(!this.removed)return this.item.ref},f.ref.set=function(t){return this.set(".ref",t)},u.prototype.addItem=function(t,e){if(this.removed)return!1;var n=this.keypath+".items";return"number"==typeof e?this.menu.splice(n,0,e,t):this.menu.push(n,t),new u(this.menu,this,t)},u.prototype.open=function(){if(this.removed)return!1;this.menu.set(this.keypath+".open",!0)},u.prototype.close=function(){if(this.removed)return!1;this.menu.set(this.keypath+".open",!1)},u.prototype.remove=function(){if(this.removed)return!1;var t=(this.parent?this.parent.keypath+".":"")+"items",e=this.menu.get(t);return this.menu.splice(t,e.indexOf(this.item),1),this.removed=!0,!0},u.prototype.get=function(t){if(this.removed)return!1;if(!t)return this.menu.get(this.keypath);var e=t.replace(/^[\.\/]*/,"");return this.menu.get(this.keypath+"."+e)},u.prototype.set=function(t,e){if(this.removed)return!1;var n=t.replace(/^[\.\/]*/,"");return this.menu.set(this.keypath+"."+n,e)},Object.defineProperties(u.prototype,f),i("RMMenu","components",s),t.Menu=s,t.plugin=c,t.default=c,Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -144,3 +144,3 @@ (function (global, factory) { | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0.done(),false]":function (_0){return([_0.done(),false]);},"[_0?_1.done():false,false]":function (_0,_1){return([_0?_1.done():false,false]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
var template = {v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:"_0||\"below\""}}," rpop-align-",{t:2,x:{r:["align"],s:"_0||\"middle\""}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:"[{dir:_0||\"below\"}]"},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:"[_0.set(\"popped\",false)]"}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{"_0||\"below\"":function (_0){return(_0||"below");},"_0||\"middle\"":function (_0){return(_0||"middle");},"[{dir:_0||\"below\"}]":function (_0){return([{dir:_0||"below"}]);},"[_0.set(\"popped\",false)]":function (_0){return([_0.set("popped",false)]);},"_0+(_1?1:0)":function (_0,_1){return(_0+(_1?1:0));},"_0+(_1?0:1)":function (_0,_1){return(_0+(_1?0:1));},"_0-2":function (_0){return(_0-2);},"[{delay:200}]":function (){return([{delay:200}]);},"[_0===_1&&_2.done(),true]":function (_0,_1,_2){return([_0===_1&&_2.done(),true]);},"[_0.done()]":function (_0){return([_0.done()]);},"true":function (){return(true);}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}}; | ||
@@ -147,0 +147,0 @@ function noop() {} |
@@ -1,1 +0,1 @@ | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],o):o(t.RMPopover={},t.Ractive)}(this,function(t,o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var e="undefined"!=typeof window?window:null;function n(t,o,n){if(e&&e.Ractive&&"object"==typeof e.Ractive[o]){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,o){var e=o.split("="),n=e[0],i=e[1];return t[n]=i,t},{})),Ractive[o][r&&r[t]||t]=n}}}function i(t,o){void 0===o&&(o={});var e=t.processParams(o,{duration:400,easing:"easeInOut"});o.dir=o.dir||!1;var n=o.distance||"20px",i=o.scale||"0.9",r="above"===o.dir?"translateY("+n+")":"left"===o.dir?"translateX("+n+")":"right"===o.dir?"translateX(-"+n+")":"translateY(-"+n+")";return t.isIntro||e.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+i+") "+r),t.animateStyle({opacity:1,transform:"none"},e)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+i+") "+r},e))}function r(t){return void 0===t&&(t={}),function(o){o.instance.transitions[t.name||"pop"]=i}}function p(t,o){var e=!1,n=!1;function i(e){for(var n=e.target;n;){if(n===t)return;if(!n.parentNode&&n!==document)return;n=n.parentNode}o(e)}return setTimeout(function(){e=!0,n||(document.body.addEventListener("click",i),document.body.addEventListener("touchstop",i))}),{teardown:function(){n=!0,e&&(document.body.removeEventListener("click",i),document.body.removeEventListener("touchstop",i))}}}function a(t,o){var e=t.processParams(o,{duration:200,easing:"easeInOut"});return t.isIntro||e.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,e)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,e))}function l(t){return void 0===t&&(t={}),function(o){o.instance.transitions[t.name||"fade"]=a}}n("pop","transitions",i),n("fade","transitions",a);var s,f,c,d,u={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,o){return t+(o?1:0)},"_0+(_1?0:1)":function(t,o){return t+(o?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0.done(),false]":function(t){return[t.done(),!1]},"[_0?_1.done():false,false]":function(t,o){return[!!t&&o.done(),!1]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done(),false]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{n:["click"],t:70,f:{r:[".clickClose","."],s:"[_0?_1.done():false,false]"}},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function h(){}var g,b=function(t){function o(o){t.call(this,o)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.position=function(t){var o=t||this.source,e=this.get("popped");if(o&&e){var n=this.find("div");if(o&&n&&n.offsetParent){var i=n.offsetParent,r=i.getBoundingClientRect(),p=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=this.get("where")||"below",s=this.get("align")||"middle",f=this.get("tail"),c="above"===l||"below"===l,d=this.get("fit"),u=this.get("gap"),h="above"===l||"below"===l?0:"left"===l?-p.width-u:a.width+u,g="left"===l||"right"===l?-a.height:"above"===l?-a.height-p.height-u:u;"middle"===s?"below"===l||"above"===l?h-=(p.width-a.width)/2:"left"!==l&&"right"!==l||(g-=(p.height-a.height)/2):"end"===s&&("below"===l||"above"===l?h+=a.width-p.width:"left"!==l&&"right"!==l||(g+=a.height-p.height));var b={popTop:a.bottom-r.top+g,popLeft:a.left-r.left+h,tail:f,vert:"above"===l||"below"===l};if(i.scrollTop&&(b.popTop+=i.scrollTop),i.scrollLeft&&(b.popLeft+=i.scrollLeft),f){"above"===l?b.tailBottom=-10:"below"===l?b.tailTop=-10:"left"===l?b.tailRight=-10:"right"===l&&(b.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():a;"start"===s?c?b.tailLeft=Math.floor(v.width/2)-10:b.tailTop=Math.floor(v.height/2)-10:"end"===s?c?b.tailRight=Math.floor(v.width/2)-10:b.tailBottom=Math.floor(v.height/2)-10:"middle"===s&&(c?b.tailLeft=Math.floor(v.width/2)-10:b.tailTop=Math.floor(v.height/2)-10),v!==a?c?(b.tailLeft&&(b.tailLeft+=v.left-a.left),b.tailRight&&(b.tailRight+=a.right-v.right)):(b.tailTop&&(b.tailTop+=v.top-a.top),b.tailBottom&&(b.tailBottom+=a.bottom-v.bottom)):"middle"===s&&(c?(b.tailLeft&&(b.tailLeft+=v.left-(b.popLeft+r.left)),b.tailRight&&(b.tailRight+=b.popLeft+r.left+p.width-v.right)):(b.tailTop&&(b.tailTop+=v.top-(b.popTop+r.top)),b.tailBottom&&(b.tailBottom+=b.popTop+r.top+p.height-v.bottom)))}if(d){var m=i;if(this.get("offsets"))for(var y=this.get("offsets");y--;)m=m.offsetParent;var w=i.scrollWidth,x=i.scrollHeight;if(b.popLeft+p.width>w){var _=b.popLeft-(w-p.width);b.popLeft-=_,c&&b.tailLeft&&(b.tailLeft+=_),c&&b.tailRight&&(b.tailRight-=_),f&&!c&&(b.tail=!1)}if(b.popLeft<0){var L=-1*b.popLeft;b.popLeft+=L,c&&b.tailLeft&&(b.tailLeft-=L),c&&b.tailRight&&(b.tailRight+=L),f&&!c&&(b.tail=!1)}if(b.popTop+p.height>x){var T=b.popTop-(x-p.height);b.popTop-=T,!c&&b.tailTop&&(b.tailTop+=T),!c&&b.tailBottom&&(b.tailBottom-=T),f&&c&&(b.tail=!1)}if(b.popTop<0){var k=-1*b.popTop;b.popTop+=k,!c&&b.tailTop&&(b.tailTop-=k),!c&&b.tailBottom&&(b.tailBottom+=k),f&&c&&(b.tail=!1)}}this.set("position",b)}else this.set("position",null)}},o.prototype.show=function(t){this.source=t,this.set("popped",!0)},o.prototype.hide=function(){this.set("popped",!1)},o}(o);function v(t){return void 0===t&&(t={}),function(o){o.instance.decorators[t.name||"pop"]=function(o,e,n){if(void 0===n&&(n={}),!e)return{teardown:h};"string"==typeof e?n.path=e:"object"==typeof e&&(n=e);var i,r,p=this.getContext(o);function a(t){if("mouseover"!==t.type||!p.get(e)){if("click"!==t.type||!r||i){var a=s,l=f;"function"==typeof(s=n.node||o)&&(s=s()),s=s||o,"function"==typeof(f=n.tail)&&(f=f()),p.toggle(n.path),s=a,f=l}r&&"click"===t.type&&(i=p.observeOnce(n.path,function(){i=null}))}}function l(t){i||p.set(n.path,!1)}return("click"in n?n.click:!1!==t.click)&&p.listen("click",a),("hover"in n?n.hover:t.hover)&&(r=1,p.listen("mouseover",a),p.listen("mouseout",l)),{teardown:function(){p.unlisten("click",a),r&&(p.unlisten("mouseover",a),p.unlisten("mouseout",l),i&&i.cancel())}}}}}o.extendWith(b,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===g&&(g={}),function(t){t.instance.events[g.name||"clickout"]=p}),l()],template:u,css:function(t){return[function(t){var o=Object.assign({},t("raui.primary"),t("raui.pop.primary")),e=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(o.bg||"#fff")+";\n color: "+(o.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(o.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(o.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(o.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(o.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(o.bc||"#ccc")+";\n }\n "+e.map(function(o){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+o),t("raui.pop."+o));return"\n ."+o+" .rpop {\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n }\n \n ."+o+".rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var o=this;t&&(s&&(this.source=s),f&&(this.tailSource=f)),setTimeout(function(){o.get("popped")===t&&o.set("_popped",t)},100)},_popped:{handler:function(t){var o=this;if(t){var e=this.get("@style.raui.pop.mobile");e&&window.matchMedia("(max-width: "+e+")").matches?(d||(d=new m({target:document.body,append:!0})).observe("contents",function(t){c=(t||[]).length>0}),d.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){o.set("popped",!1)}})):this.set("__popped",!0)}else c?d.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var o=this.find("div"),e=o,n=e.offsetHeight+e.offsetTop,i=e.offsetWidth+e.offsetLeft,r=e.offsetParent;if(!this.overflows)for(var p=this.overflows={e:[],v:[]};o&&o.style;){if(o===r){if(o.offsetWidth>=i&&o.offsetHeight>=n)break;i+=o.offsetLeft,n+=o.offsetTop,r=o.offsetParent}var a=getComputedStyle(o);if("auto"===a.overflow)break;"hidden"===a.overflow&&(p.e.push(o),p.v.push(o.style.overflow),o.style.overflow="visible"),o=o.parentNode}this.position(),this.transition("pop",e,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var o=this;return{teardown:function(){var t=o.overflows;if(t){o.overflows=null;for(var e=0;e<t.e.length;e++)t.e[e].style.overflow=t.v[e]}}}}},data:function(){return{gap:4}}});var m=function(t){function o(o){t.call(this,o)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o}(o);o.extendWith(m,{template:{v:u.v,t:u.p.modal},data:function(){return{contents:[]}},use:[r(),l()]}),t.Popover=b,t.trigger=v,t.default=function(t){return void 0===t&&(t={}),function(o){var e=o.instance;e.components[t.name||"pop"]=b;var n=Object.assign({},t);n.name=n.trigger||n.name,v(n)({instance:e})}},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],o):o(t.RMPopover={},t.Ractive)}(this,function(t,o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var e="undefined"!=typeof window?window:null;function n(t,o,n){if(e&&e.Ractive&&"object"==typeof e.Ractive[o]){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,o){var e=o.split("="),n=e[0],i=e[1];return t[n]=i,t},{})),Ractive[o][r&&r[t]||t]=n}}}function i(t,o){void 0===o&&(o={});var e=t.processParams(o,{duration:400,easing:"easeInOut"});o.dir=o.dir||!1;var n=o.distance||"20px",i=o.scale||"0.9",r="above"===o.dir?"translateY("+n+")":"left"===o.dir?"translateX("+n+")":"right"===o.dir?"translateX(-"+n+")":"translateY(-"+n+")";return t.isIntro||e.intro?(t.setStyle("opacity",0),t.setStyle("transform","scale("+i+") "+r),t.animateStyle({opacity:1,transform:"none"},e)):(t.setStyle("opacity",1),t.setStyle("transform","none"),t.animateStyle({opacity:0,transform:"scale("+i+") "+r},e))}function r(t){return void 0===t&&(t={}),function(o){o.instance.transitions[t.name||"pop"]=i}}function p(t,o){var e=!1,n=!1;function i(e){for(var n=e.target;n;){if(n===t)return;if(!n.parentNode&&n!==document)return;n=n.parentNode}o(e)}return setTimeout(function(){e=!0,n||(document.body.addEventListener("click",i),document.body.addEventListener("touchstop",i))}),{teardown:function(){n=!0,e&&(document.body.removeEventListener("click",i),document.body.removeEventListener("touchstop",i))}}}function a(t,o){var e=t.processParams(o,{duration:200,easing:"easeInOut"});return t.isIntro||e.intro?(t.setStyle("opacity",0),t.animateStyle("opacity",1,e)):(t.setStyle("opacity",1),t.animateStyle("opacity",0,e))}function l(t){return void 0===t&&(t={}),function(o){o.instance.transitions[t.name||"fade"]=a}}n("pop","transitions",i),n("fade","transitions",a);var s,f,c,d,u={v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-wrapper",g:1},{n:"class-rpop-with-tail",t:13,f:[{t:2,r:"position.tail"}]},{n:"class",f:["rpop-",{t:2,x:{r:["where"],s:'_0||"below"'}}," rpop-align-",{t:2,x:{r:["align"],s:'_0||"middle"'}}],t:13},{t:4,f:[{n:"style-top",f:[{t:2,r:"position.popTop"},"px"],t:13},{n:"style-left",f:[{t:2,r:"position.popLeft"},"px"],t:13}],n:50,r:"position"},{t:4,f:[{t:4,f:[{n:"style-top",f:[{t:2,r:"top"}],t:13}],n:50,r:"top"},{t:4,f:[{n:"style-left",f:[{t:2,r:"left"}],t:13}],n:50,r:"left"}],n:51,l:1},{n:"pop",t:72,f:{r:["where"],s:'[{dir:_0||"below"}]'},v:"t2"},{n:"cleanup",t:71},{t:4,f:[{n:["click"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:50,r:"clickClose"},{t:4,f:[{n:["clickout"],t:70,f:{r:["@this"],s:'[_0.set("popped",false)]'}}],n:51,r:"noClickout"},{t:16,r:"extra-attributes"}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom","position.vert"],s:"_0+(_1?1:0)"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight","position.vert"],s:"_0+(_1?0:1)"}},"px"],t:13}],n:50,r:"position.tailRight"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop-tail-outer",g:1},{t:4,f:[{n:"style-top",f:[{t:2,x:{r:["position.tailTop"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailTop"},{t:4,f:[{n:"style-bottom",f:[{t:2,x:{r:["position.tailBottom"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailBottom"},{t:4,f:[{n:"style-left",f:[{t:2,x:{r:["position.tailLeft"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailLeft"},{t:4,f:[{n:"style-right",f:[{t:2,x:{r:["position.tailRight"],s:"_0-2"}},"px"],t:13}],n:50,r:"position.tailRight"}]}],n:50,r:"~/tail"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1}],f:[{t:16,r:"content"}]}]}],n:50,r:"__popped"}],e:{'_0||"below"':function(t){return t||"below"},'_0||"middle"':function(t){return t||"middle"},'[{dir:_0||"below"}]':function(t){return[{dir:t||"below"}]},'[_0.set("popped",false)]':function(t){return[t.set("popped",!1)]},"_0+(_1?1:0)":function(t,o){return t+(o?1:0)},"_0+(_1?0:1)":function(t,o){return t+(o?0:1)},"_0-2":function(t){return t-2},"[{delay:200}]":function(){return[{delay:200}]},"[_0===_1&&_2.done(),true]":function(t,o,e){return[t===o&&e.done(),!0]},"[_0.done()]":function(t){return[t.done()]},true:function(){return!0}},p:{modal:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop rpop-modal",g:1},{n:"fade",t:72,v:"t1"},{n:"fade",t:72,f:{r:[],s:"[{delay:200}]"},v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["@node","@event.target","."],s:"[_0===_1&&_2.done(),true]"}}],n:51,r:".noClickout"}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rpop",g:1},{n:"pop",t:72,f:{r:[],s:"[{delay:200}]"},v:"t1"},{n:"pop",t:72,v:"t2"},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.done()]"}}],n:50,r:".clickClose"},{t:8,r:".attrs",c:{r:".context"}}],f:[{t:8,r:".content",c:{r:".context"},z:[{n:"inModal",x:{x:{r:[],s:"true"}}}]}]}]}],n:54,r:"contents.0"}],n:50,r:"contents.length"}]}};function h(){}var g,b=function(t){function o(o){t.call(this,o)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.position=function(t){var o=t||this.source,e=this.get("popped");if(o&&e){var n=this.find("div");if(o&&n&&n.offsetParent){var i=n.offsetParent,r=i.getBoundingClientRect(),p=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=this.get("where")||"below",s=this.get("align")||"middle",f=this.get("tail"),c="above"===l||"below"===l,d=this.get("fit"),u=this.get("gap"),h="above"===l||"below"===l?0:"left"===l?-p.width-u:a.width+u,g="left"===l||"right"===l?-a.height:"above"===l?-a.height-p.height-u:u;"middle"===s?"below"===l||"above"===l?h-=(p.width-a.width)/2:"left"!==l&&"right"!==l||(g-=(p.height-a.height)/2):"end"===s&&("below"===l||"above"===l?h+=a.width-p.width:"left"!==l&&"right"!==l||(g+=a.height-p.height));var b={popTop:a.bottom-r.top+g,popLeft:a.left-r.left+h,tail:f,vert:"above"===l||"below"===l};if(i.scrollTop&&(b.popTop+=i.scrollTop),i.scrollLeft&&(b.popLeft+=i.scrollLeft),f){"above"===l?b.tailBottom=-10:"below"===l?b.tailTop=-10:"left"===l?b.tailRight=-10:"right"===l&&(b.tailLeft=-10);var v=this.tailSource?this.tailSource.getBoundingClientRect():a;"start"===s?c?b.tailLeft=Math.floor(v.width/2)-10:b.tailTop=Math.floor(v.height/2)-10:"end"===s?c?b.tailRight=Math.floor(v.width/2)-10:b.tailBottom=Math.floor(v.height/2)-10:"middle"===s&&(c?b.tailLeft=Math.floor(v.width/2)-10:b.tailTop=Math.floor(v.height/2)-10),v!==a?c?(b.tailLeft&&(b.tailLeft+=v.left-a.left),b.tailRight&&(b.tailRight+=a.right-v.right)):(b.tailTop&&(b.tailTop+=v.top-a.top),b.tailBottom&&(b.tailBottom+=a.bottom-v.bottom)):"middle"===s&&(c?(b.tailLeft&&(b.tailLeft+=v.left-(b.popLeft+r.left)),b.tailRight&&(b.tailRight+=b.popLeft+r.left+p.width-v.right)):(b.tailTop&&(b.tailTop+=v.top-(b.popTop+r.top)),b.tailBottom&&(b.tailBottom+=b.popTop+r.top+p.height-v.bottom)))}if(d){var m=i;if(this.get("offsets"))for(var y=this.get("offsets");y--;)m=m.offsetParent;var w=i.scrollWidth,x=i.scrollHeight;if(b.popLeft+p.width>w){var _=b.popLeft-(w-p.width);b.popLeft-=_,c&&b.tailLeft&&(b.tailLeft+=_),c&&b.tailRight&&(b.tailRight-=_),f&&!c&&(b.tail=!1)}if(b.popLeft<0){var L=-1*b.popLeft;b.popLeft+=L,c&&b.tailLeft&&(b.tailLeft-=L),c&&b.tailRight&&(b.tailRight+=L),f&&!c&&(b.tail=!1)}if(b.popTop+p.height>x){var T=b.popTop-(x-p.height);b.popTop-=T,!c&&b.tailTop&&(b.tailTop+=T),!c&&b.tailBottom&&(b.tailBottom-=T),f&&c&&(b.tail=!1)}if(b.popTop<0){var k=-1*b.popTop;b.popTop+=k,!c&&b.tailTop&&(b.tailTop-=k),!c&&b.tailBottom&&(b.tailBottom+=k),f&&c&&(b.tail=!1)}}this.set("position",b)}else this.set("position",null)}},o.prototype.show=function(t){this.source=t,this.set("popped",!0)},o.prototype.hide=function(){this.set("popped",!1)},o}(o);function v(t){return void 0===t&&(t={}),function(o){o.instance.decorators[t.name||"pop"]=function(o,e,n){if(void 0===n&&(n={}),!e)return{teardown:h};"string"==typeof e?n.path=e:"object"==typeof e&&(n=e);var i,r,p=this.getContext(o);function a(t){if("mouseover"!==t.type||!p.get(e)){if("click"!==t.type||!r||i){var a=s,l=f;"function"==typeof(s=n.node||o)&&(s=s()),s=s||o,"function"==typeof(f=n.tail)&&(f=f()),p.toggle(n.path),s=a,f=l}r&&"click"===t.type&&(i=p.observeOnce(n.path,function(){i=null}))}}function l(t){i||p.set(n.path,!1)}return("click"in n?n.click:!1!==t.click)&&p.listen("click",a),("hover"in n?n.hover:t.hover)&&(r=1,p.listen("mouseover",a),p.listen("mouseout",l)),{teardown:function(){p.unlisten("click",a),r&&(p.unlisten("mouseover",a),p.unlisten("mouseout",l),i&&i.cancel())}}}}}o.extendWith(b,{attributes:["popped","tail","where","align","top","left","fit","clickClose","noClickout","gap","offsets"],use:[r(),(void 0===g&&(g={}),function(t){t.instance.events[g.name||"clickout"]=p}),l()],template:u,css:function(t){return[function(t){var o=Object.assign({},t("raui.primary"),t("raui.pop.primary")),e=(t("raui.themes")||[]).slice();return(t("raui.pop.themes")||[]).forEach(function(t){~e.indexOf(t)||e.push(t)}),"\n .rpop-wrapper {\n position: absolute;\n display: inline-block;\n z-index: 11;\n transition-property: top, left, padding;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-with-tail.rpop-above {\n padding-bottom: 10px;\n }\n .rpop-with-tail.rpop-below {\n padding-top: 10px;\n }\n .rpop-with-tail.rpop-left {\n padding-right: 10px;\n }\n .rpop-with-tail.rpop-right {\n padding-left: 10px;\n }\n \n .rpop {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0,0,0,0.24);\n border: 1px solid #ccc;\n border-radius: 0.2em;\n background-color: "+(o.bg||"#fff")+";\n color: "+(o.fg||"#222")+";\n padding: 0.5em;\n z-index: 2;\n }\n \n .rpop-modal {\n position: fixed;\n display: flex;\n z-index: 10;\n background-color: rgba(0, 0, 0, 0.2);\n align-items: center;\n justify-content: center;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1em;\n overflow: auto;\n }\n \n .rpop-tail, .rpop-tail-outer {\n z-index: 3;\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n border-width: 10px;\n border-color: transparent;\n transition-property: top, left, bottom, right, border-color;\n transition-timing-function: ease-in-out;\n transition-duration: 0.3s;\n }\n .rpop-tail-outer {\n z-index: 1;\n border-width: 12px;\n border-color: transparent;\n }\n \n .rpop-below .rpop-tail {\n border-bottom-color: "+(o.bg||"#fff")+";\n }\n .rpop-below .rpop-tail-outer {\n border-bottom-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-above .rpop-tail {\n border-top-color: "+(o.bg||"#fff")+";\n }\n .rpop-above .rpop-tail-outer {\n border-top-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-left .rpop-tail {\n border-left-color: "+(o.bg||"#fff")+";\n }\n .rpop-left .rpop-tail-outer {\n border-left-color: "+(o.bc||"#ccc")+";\n }\n \n .rpop-right .rpop-tail {\n border-right-color: "+(o.bg||"#fff")+";\n }\n .rpop-right .rpop-tail-outer {\n border-right-color: "+(o.bc||"#ccc")+";\n }\n "+e.map(function(o){var e=Object.assign({},t("raui.primary"),t("raui.pop.primary"),t("raui."+o),t("raui.pop."+o));return"\n ."+o+" .rpop {\n background-color: "+(e.bg||"#fff")+";\n color: "+(e.fg||"#222")+";\n }\n \n ."+o+".rpop-below .rpop-tail {\n border-bottom-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-below .rpop-tail-outer {\n border-bottom-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-above .rpop-tail {\n border-top-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-above .rpop-tail-outer {\n border-top-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-left .rpop-tail {\n border-left-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-left .rpop-tail-outer {\n border-left-color: "+(e.bc||"#ccc")+";\n }\n \n ."+o+".rpop-right .rpop-tail {\n border-right-color: "+(e.bg||"#fff")+";\n }\n ."+o+".rpop-right .rpop-tail-outer {\n border-right-color: "+(e.bc||"#ccc")+";\n }\n "})}.call(this,t)].join(" ")},cssId:"rpop",noCssTransform:!0,observe:{popped:function(t){var o=this;t&&(s&&(this.source=s),f&&(this.tailSource=f)),setTimeout(function(){o.get("popped")===t&&o.set("_popped",t)},100)},_popped:{handler:function(t){var o=this;if(t){var e=this.get("@style.raui.pop.mobile");e&&window.matchMedia("(max-width: "+e+")").matches?(d||(d=new m({target:document.body,append:!0})).observe("contents",function(t){c=(t||[]).length>0}),d.unshift("contents",{content:this.partials.content,context:this.getContext().getParent(!0),attrs:this.partials["extra-attributes"]||[],clickClose:this.get("clickClose"),noClickout:this.get("noClickout"),done:function(){o.set("popped",!1)}})):this.set("__popped",!0)}else c?d.shift("contents"):this.set("__popped",!1)},defer:!0},__popped:{handler:function(t){if(t){var o=this.find("div"),e=o,n=e.offsetHeight+e.offsetTop,i=e.offsetWidth+e.offsetLeft,r=e.offsetParent;if(!this.overflows)for(var p=this.overflows={e:[],v:[]};o&&o.style;){if(o===r){if(o.offsetWidth>=i&&o.offsetHeight>=n)break;i+=o.offsetLeft,n+=o.offsetTop,r=o.offsetParent}var a=getComputedStyle(o);if("auto"===a.overflow)break;"hidden"===a.overflow&&(p.e.push(o),p.v.push(o.style.overflow),o.style.overflow="visible"),o=o.parentNode}this.position(),this.transition("pop",e,{intro:!0,dir:this.get("where")||"below"})}else this.source=null,this.tailSource=null},defer:!0},"align where tail fit":{handler:function(){this.position()},defer:!0}},decorators:{cleanup:function(t){var o=this;return{teardown:function(){var t=o.overflows;if(t){o.overflows=null;for(var e=0;e<t.e.length;e++)t.e[e].style.overflow=t.v[e]}}}}},data:function(){return{gap:4}}});var m=function(t){function o(o){t.call(this,o)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o}(o);o.extendWith(m,{template:{v:u.v,t:u.p.modal},data:function(){return{contents:[]}},use:[r(),l()]}),t.Popover=b,t.trigger=v,t.default=function(t){return void 0===t&&(t={}),function(o){var e=o.instance;e.components[t.name||"pop"]=b;var n=Object.assign({},t);n.name=n.trigger||n.name,v(n)({instance:e})}},Object.defineProperty(t,"__esModule",{value:!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 too big to display
25710
2283236