uniform-ui 2.3.5 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ee8e0b603653407ba912e094246075c11185a9a4bdaebed02a7f25a5046677f
4
- data.tar.gz: 3479264ee4480f9e8e73d549216d94afab1d26307b164d6fb5d05310488a75a9
3
+ metadata.gz: 1a70cfa3c98bab49b50c2c5866fcfdb2f1dde00ced660c7c2c3cc9009a21f819
4
+ data.tar.gz: 5c64c92d6d8e636ded0928b2fd8e1a878f1b1deaf3998a6a4fcf6dadc160e7af
5
5
  SHA512:
6
- metadata.gz: 4c0f7f138450830356276a63e9272fee5ec6b2da795df327733c9d2f317d8fdf8ef15f9b5625df1073e7d643bbf72083eb3294add8ea71fc020ffe7684d6fdb0
7
- data.tar.gz: 1d61e6a926c7b2133ff79f5114ca91f08749553d5d5b98d729cea88631595d07d0deb6c7e0ef9777758a657ebc93085f7ed1a6debddc215ccca12fc56e9a2122
6
+ metadata.gz: e2c963331db17062cf77bd459435d6ec92e75783434304b5e35b6180ec34c9eec020996f4f4caad831243e3075c9b42bd3558ec4320d500bba8c08351fd609c7
7
+ data.tar.gz: 30c019f85d3b028382c89ccd5ef4611b88e3b9b83aeb69b528775909d7c0407cf7f8a691ba072c523c1db10f1dd0b4c5899ffb56666b5959e085428f4a20003e
@@ -1 +1 @@
1
- !function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var y=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),v=t(function(t){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)}),m=(v.version,function(i,o,t){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(i),void 0===o)return i;switch(t){case 1:return function(t){return i.call(o,t)};case 2:return function(t,e){return i.call(o,t,e)};case 3:return function(t,e,n){return i.call(o,t,e,n)}}return function(){return i.apply(o,arguments)}}),c=function(t){return"object"==typeof t?null!==t:"function"==typeof t},s=function(t){if(!c(t))throw TypeError(t+" is not an object!");return t},a=function(t){try{return!!t()}catch(t){return!0}},i=!a(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),e=y.document,n=c(e)&&c(e.createElement),o=function(t){return n?e.createElement(t):{}},r=!i&&!a(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}),l=function(t,e){if(!c(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!c(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!c(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!c(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},u=Object.defineProperty,h={f:i?Object.defineProperty:function(t,e,n){if(s(t),e=l(e,!0),s(n),r)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},x=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},S=i?function(t,e,n){return h.f(t,e,x(1,n))}:function(t,e,n){return t[e]=n,t},f={}.hasOwnProperty,g=function(t,e){return f.call(t,e)},b="prototype",w=function(t,e,n){var i,o,r,s=t&w.F,l=t&w.G,c=t&w.S,a=t&w.P,u=t&w.B,h=t&w.W,f=l?v:v[e]||(v[e]={}),p=f[b],d=l?y:c?y[e]:(y[e]||{})[b];for(i in l&&(n=e),n)(o=!s&&d&&void 0!==d[i])&&g(f,i)||(r=o?d[i]:n[i],f[i]=l&&"function"!=typeof d[i]?n[i]:u&&o?m(r,y):h&&d[i]==r?function(i){var t=function(t,e,n){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,e)}return new i(t,e,n)}return i.apply(this,arguments)};return t[b]=i[b],t}(r):a&&"function"==typeof r?m(Function.call,r):r,a&&((f.virtual||(f.virtual={}))[i]=r,t&w.R&&p&&!p[i]&&S(p,i,r)))};w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128;var p,_=w,d={}.toString,k=function(t){return d.call(t).slice(8,-1)},O=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==k(t)?t.split(""):Object(t)},T=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},E=function(t){return O(T(t))},P=Math.ceil,j=Math.floor,C=function(t){return isNaN(t=+t)?0:(0o;)g(i,n=e[o++])&&(~R(r,n)||r.push(n));return r},B="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),G=Object.keys||function(t){return D(t,B)},Y={f:Object.getOwnPropertySymbols},V={f:{}.propertyIsEnumerable},K=function(t){return Object(T(t))},J=Object.assign,U=!J||a(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=J({},t)[n]||Object.keys(J({},e)).join("")!=i})?function(t,e){for(var n=K(t),i=arguments.length,o=1,r=Y.f,s=V.f;o>>0||(lt.test(n)?16:10))}:rt;_(_.G+_.F*(parseInt!=ct),{parseInt:ct});var at=v.parseInt,ut=Array.isArray||function(t){return"Array"==k(t)};_(_.S,"Array",{isArray:ut});var ht=v.Array.isArray;var ft=function(t){if(ht(t))return t},pt=function(t,e){return{value:e,done:!!t}},dt={},yt=S,vt=i?Object.defineProperties:function(t,e){s(t);for(var n,i=G(e),o=i.length,r=0;rdocument.F=Object<\/script>"),t.close(),xt=t.F;n--;)delete xt[kt][B[n]];return xt()},St=Object.create||function(t,e){var n;return null!==t?(wt[kt]=s(t),n=new wt,wt[kt]=null,n[bt]=t):n=xt(),void 0===e?n:vt(n,e)},_t=t(function(t){var e=A("wks"),n=y.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:I)("Symbol."+t))}).store=e}),Ot=h.f,Tt=_t("toStringTag"),Et=function(t,e,n){t&&!g(t=n?t:t.prototype,Tt)&&Ot(t,Tt,{configurable:!0,value:e})},Pt={};S(Pt,_t("iterator"),function(){return this});var jt=q("IE_PROTO"),Ct=Object.prototype,Lt=Object.getPrototypeOf||function(t){return t=K(t),g(t,jt)?t[jt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ct:null},zt=_t("iterator"),Mt=!([].keys&&"next"in[].keys()),At="values",Nt=function(){return this},Ht=function(t,e,n,i,o,r,s){var l,c,a;c=e,a=i,(l=n).prototype=St(Pt,{next:x(1,a)}),Et(l,c+" Iterator");var u,h,f,p=function(t){if(!Mt&&t in m)return m[t];switch(t){case"keys":case At:return function(){return new n(this,t)}}return function(){return new n(this,t)}},d=e+" Iterator",y=o==At,v=!1,m=t.prototype,g=m[zt]||m["@@iterator"]||o&&m[o],b=g||p(o),w=o?y?p("entries"):b:void 0,k="Array"==e&&m.entries||g;if(k&&(f=Lt(k.call(new t)))!==Object.prototype&&f.next&&Et(f,d,!0),y&&g&&g.name!==At&&(v=!0,b=function(){return g.call(this)}),s&&(Mt||v||!m[zt])&&S(m,zt,b),dt[e]=b,dt[d]=Nt,o)if(u={values:y?b:p(At),keys:r?b:p("keys"),entries:w},s)for(h in u)h in m||yt(m,h,u[h]);else _(_.P+_.F*(Mt||v),e,u);return u};Ht(Array,"Array",function(t,e){this._t=E(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,pt(1)):pt(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");dt.Arguments=dt.Array;for(var It=_t("toStringTag"),Ft="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),qt=0;qt=e.length?{value:void 0,done:!0}:(t=Bt(e,n),this._i+=t.length,{value:t,done:!1})});var Gt=_t("toStringTag"),Yt="Arguments"==k(function(){return arguments}()),Vt=_t("iterator"),Kt=v.getIteratorMethod=function(t){if(null!=t)return t[Vt]||t["@@iterator"]||dt[(e=t,void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(n=Object(e),Gt))?i:Yt?k(n):"Object"==(o=k(n))&&"function"==typeof n.callee?"Arguments":o)];var e,n,i,o},Jt=v.getIterator=function(t){var e=Kt(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return s(e.call(t))};var Ut=function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,l=Jt(t);!(i=(s=l.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw r}}return n};var Xt=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var Qt=function(t,e){return ft(t)||Ut(t,e)||Xt()},Zt=function(t,e){var n=(v.Object||{})[t]||Object[t],i={};i[t]=e(n),_(_.S+_.F*a(function(){n(1)}),"Object",i)};Zt("keys",function(){return function(t){return G(K(t))}});var te=v.Object.keys;var ee=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};_(_.S+_.F*!i,"Object",{defineProperty:h.f});var ne=v.Object,ie=function(t,e,n){return ne.defineProperty(t,e,n)};function oe(t,e){for(var n=0;ns;)r.call(t,i=o[s++])&&e.push(i);return e}(e=E(e)),o=0,r=i.length;oo;)g(Le,e=n[o++])||e==Ee||e==be||i.push(e);return i},Ge=function(t){for(var e,n=t===Me,i=xe(n?ze:E(t)),o=[],r=0;i.length>r;)!g(Le,e=i[r++])||n&&!g(Me,e)||o.push(Le[e]);return o};Ae||(yt((Se=function(){if(this instanceof Se)throw TypeError("Symbol is not a constructor!");var e=I(0Ve;)_t(Ye[Ve++]);for(var Ke=G(_t.store),Je=0;Ke.length>Je;)ue(Ke[Je++]);_(_.S+_.F*!Ae,"Symbol",{for:function(t){return g(Ce,t+="")?Ce[t]:Ce[t]=Se(t)},keyFor:function(t){if(!qe(t))throw TypeError(t+" is not a symbol!");for(var e in Ce)if(Ce[e]===t)return e},useSetter:function(){He=!0},useSimple:function(){He=!1}}),_(_.S+_.F*!Ae,"Object",{create:function(t,e){return void 0===e?St(t):$e(St(t),e)},defineProperty:Re,defineProperties:$e,getOwnPropertyDescriptor:De,getOwnPropertyNames:Be,getOwnPropertySymbols:Ge}),_e&&_(_.S+_.F*(!Ae||a(function(){var t=Se();return"[null]"!=Oe([t])||"{}"!=Oe({a:t})||"{}"!=Oe(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=e=i[1],(c(e)||void 0!==t)&&!qe(t))return ut(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!qe(e))return e}),i[1]=e,Oe.apply(_e,i)}}),Se[Te][Pe]||S(Se[Te],Pe,Se[Te].valueOf),Et(Se,"Symbol"),Et(Math,"Math",!0),Et(y.JSON,"JSON",!0),ue("asyncIterator"),ue("observable");var Ue=v.Symbol,Xe=t(function(e){function n(t){return(n="function"==typeof Ue&&"symbol"==typeof le?function(t){return typeof t}:function(t){return t&&"function"==typeof Ue&&t.constructor===Ue&&t!==Ue.prototype?"symbol":typeof t})(t)}function i(t){return"function"==typeof Ue&&"symbol"===n(le)?e.exports=i=function(t){return n(t)}:e.exports=i=function(t){return t&&"function"==typeof Ue&&t.constructor===Ue&&t!==Ue.prototype?"symbol":n(t)},i(t)}e.exports=i});var Qe=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var Ze=function(t,e){return!e||"object"!==Xe(e)&&"function"!=typeof e?Qe(t):e};Zt("getPrototypeOf",function(){return function(t){return Lt(K(t))}});var tn=v.Object.getPrototypeOf,en=function(t,e){if(s(t),!c(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},nn={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,i){try{(i=m(Function.call,ge.f(Object.prototype,"__proto__").set,2))(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return en(t,e),n?t.__proto__=e:i(t,e),t}}({},!1):void 0),check:en};_(_.S,"Object",{setPrototypeOf:nn.set});var on=v.Object.setPrototypeOf,rn=t(function(e){function n(t){return e.exports=n=on?tn:function(t){return t.__proto__||tn(t)},n(t)}e.exports=n});_(_.S,"Object",{create:St});var sn=v.Object,ln=function(t,e){return sn.create(t,e)},cn=t(function(n){function i(t,e){return n.exports=i=on||function(t,e){return t.__proto__=e,t},i(t,e)}n.exports=i});var an=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=ln(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cn(t,e)};function un(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function hn(e,t){e.classList?yn(t.split(" "),function(t){e.classList.add(t)}):e.className+=" "+t}function fn(t,n){var e=function(e){e.classList?n.split(" ").forEach(function(t){return e.classList.remove(t)}):e.className=e.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")};NodeList.prototype.isPrototypeOf(t)?yn(t,e):e(t)}function pn(t,e,n){if(t.classList)t.classList.toggle(e,n);else{var i=t.className.split(" "),o=i.indexOf(e);!1===n||!0!==n&&0<=o?i.splice(o,1):i.push(e),t.className=i.join(" ")}}function dn(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!1),t.dispatchEvent(n)}function yn(t,e){for(var n=0;nMath.max(document.body.offsetHeight,window.innerHeight)&&(t[1]="top",e=!0),wn(this.dropdown).top<0&&(t[1]="bottom",e=!0),wn(this.dropdown).left<0&&(t[0]="right",e=!0),wn(this.dropdown).left+xn(this.dropdown)>document.body.offsetWidth&&(t[0]="left",e=!0),e&&this.setPosition(t.join(" "))}},{key:"setPosition",value:function(t){var e=(t=t||this.options.align).split(" "),n=Qt(e,2),i=n[0],o=n[1];i=i||"bottom",o=o||"bottom";var r=wn(this.el),s=this.options.container;"static"==getComputedStyle(s).position&&(s=s.offsetParent),s||(s=document.body);var l=wn(s);r={top:r.top-l.top,left:r.left-l.left};var c={};"left"==i?c.right=xn(s)-r.left:"center"==i?c.left=r.left+xn(this.el)/2-xn(this.dropdown)/2:"right"==i?c.left=r.left+xn(this.el):i.includes("%")?c.left=r.left+xn(this.el)*at(i)/100:i.includes("px")&&(c.left=r.left+xn(this.el)+at(i)),"top"==o?c.top=r.top-kn(this.dropdown):"center"==o?c.top=r.top+kn(this.el)/2-kn(this.dropdown)/2:"bottom"==o?c.top=r.top+kn(this.el):o.includes("%")?c.top=r.top+kn(this.el)*at(o)/100:o.includes("px")&&(c.top=r.top+kn(this.el)+at(o)),this.options.offset.left&&(c.left+=at(this.options.offset.left)),this.options.offset.top&&(c.top+=at(this.options.offset.top)),this.options.offset.left&&(c.right-=at(this.options.offset.left)),this.dropdown.style.left="auto",this.dropdown.style.right="auto",fn(this.dropdown,"popover-left popover-right popover-center popover-top popover-bottom"),hn(this.dropdown,"popover-"+o),hn(this.dropdown,"popover-"+i),te(c).forEach(function(t){this.dropdown.style[t]=c[t]+"px"},this)}},{key:"remove",value:function(){Sn.prototype.remove.apply(this,arguments),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown),delete this.dropdown}},{key:"toggle",value:function(t){un(this.el,"active")&&"click"==t.type?this.hide():this.show()}},{key:"show",value:function(t){t||(t={}),this.options.hide_sm&&window.innerWidth<720||(this.dropdown||this.render(),this.dropdown.style.display="block",hn(this.el,"active"),this.resize(),this.overlay=document.createElement("div"),hn(this.overlay,"uniformOverlay"),document.body.appendChild(this.overlay),window.innerWidth<720&&(this.lastScrollPosition=window.scrollY,hn(document.body,"uniformModal-hideBody")),this.listenTo(this.overlay,"click",this.hide),t.silent||this.trigger("shown"))}},{key:"hide",value:function(t){t||(t={}),this.dropdown&&un(this.el,"active")&&(this.dropdown.style.display="none",fn(this.el,"active"),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),window.innerWidth<720&&(fn(document.body,"uniformModal-hideBody"),window.scrollTo(0,this.lastScrollPosition)),t.silent||this.trigger("hidden"))}},{key:"outsideClick",value:function(t){this.dropdown&&null!==this.dropdown.offsetParent&&t.target!==this.el&&t.target!==this.overlay&&(this.el.contains(t.target)||this.dropdown.contains(t.target)||this.hide())}},{key:"keyup",value:function(t){27==t.which&&this.hide()}}]),e}(),Sn,"Dropdown"),On=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ee(this,e),Ze(this,rn(e).apply(this,arguments))}return an(e,Sn),re(e,[{key:"initialize",value:function(t){this.listenTo(this.el,"change",this.change)}},{key:"render",value:function(){var t=un(this.el,"uniformRadio")?"uniformRadio":"uniformCheckbox";return this.checkbox=document.createElement("div"),hn(this.checkbox,"".concat(t,"-indicator")),this.el.className&&""!=this.el.className.replace(t,"")&&hn(this.checkbox,this.el.className.replace(t,"")),pn(this.checkbox,"checked",this.el.checked),this.el.parentNode.insertBefore(this.checkbox,this.el.nextSibling),this.listenTo(this.checkbox,"click",this.click),this}},{key:"click",value:function(t){this.el.disabled||(this.el.checked=!this.el.checked,dn(this.el,"change"),t.preventDefault())}},{key:"change",value:function(){pn(this.checkbox,"checked",this.el.checked)}}]),e}(),Sn,"Checkbox"),Tn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ee(this,e),Ze(this,rn(e).apply(this,arguments))}return an(e,Sn),re(e,[{key:"initialize",value:function(t){this.options={},this.options.klass=t.klass||!1,this.content=t.content,hn(this.el,"uniformModal"),this.listenTo(document,"keyup",this.keyup),this.listenTo(this.el,"click",this.checkCloseButton)}},{key:"keyup",value:function(t){27==t.which&&this.close()}},{key:"render",value:function(){var t="function"==typeof this.content?this.content():this.content;this.highest_z_index=0,this.overlay=document.createElement("div"),hn(this.overlay,"uniformModal-overlay"),this.blur=document.createElement("div"),hn(this.blur,"uniformModal-blur"),this.original_scroll=window.scrollY,this.blur.style.top=0-this.original_scroll+"px",0').concat(Pn,"")),this.container.appendChild(this.edit_button),this.el.name&&hn(this.container,this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g,"-")),this.el.style.display="none",this.el.insertAdjacentElement("beforebegin",this.container),this.updateSelect(),this.resize(),this.listenTo(this.edit_button,"click",this.showOptions),this.listenTo(this.edit_button,"click",".uniformSelect-remove",this.removeSelection)}},{key:"resize",value:function(){for(var t=[],e=this.edit_button.children.length,n=0;n"),this.options.label&&this.select_options.append('
'.concat(this.options.label,"
")),this.el.name&&hn(this.select_options,this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g,"-")),this.select_options.style.fontSize=vn(this.el,"font-size"),this.select_options.style.display="none",this.options.container.appendChild(this.select_options),yn(this.el.querySelectorAll("option"),function(t,e){var n=gn("");this.listenTo(e,"click",function(t){dn(this.el,"show_all"),this.options.showAll&&this.options.showAll(this.select_options),t.preventDefault(),t.stopPropagation()}),t.appendChild(e)}if(this.el.multiple){var n=gn("");this.listenTo(n,"click",this.hideOptions),t.appendChild(n)}""!==t.innerHTML&&this.select_options.appendChild(t),dn(this.el,"rendered")}},{key:"hideOptions",value:function(){void 0!==this.select_options&&(this.showing=!1,this.select_options.style.display="none",fn(this.select_options,"fixed"),fn(this.edit_button,"active"),fn(document.body,"uniformModal-hideBody"),this.lastScrollPosition&&window.innerWidth<720&&window.scrollTo(0,this.lastScrollPosition),dn(this.el,"hidden:options"))}},{key:"showOptions",value:function(){if(this.showing)return this.hideOptions(),!1;this.showing=!0,this.select_options||this.renderOptions(),this.resize(),this.select_options.style.display="block",hn(this.edit_button,"active"),this.lastScrollPosition=window.scrollY,this.updatePosition(),hn(document.body,"uniformModal-hideBody"),this.options.container==document.body&&fn(document.body,"uniformModal-hideBody")}},{key:"selectOption",value:function(t){this.el.multiple||(yn(bn(this.el.querySelectorAll("option"),function(t){return t.selected}),function(t){t.selected=!1}),yn(this.select_options.querySelectorAll(".uniformSelect-option.active .uniformSelect-option-icon"),mn),fn(this.select_options.querySelectorAll(".uniformSelect-option.active"),"active")),pn(t.currentTarget,"active"),t.currentTarget.option.selected=un(t.currentTarget,"active"),this.updateOptions(),dn(this.el,"change")}},{key:"updateSelect",value:function(){this.el.multiple||this.hideOptions();var t=function(t,e){for(var n=[],i=0;i'.concat(t.textContent,'
'):t.textContent}.bind(this)).join(" ");""==t&&(t=" "),this.edit_button.querySelector(".text-js").innerHTML=t}},{key:"updateOptions",value:function(){yn(this.select_options.querySelectorAll("button"),function(t){t.option&&(pn(t,"active",t.option.selected),un(t,"active")?t.append(this.activeIcon.cloneNode(!0)):yn(t.querySelectorAll(".uniformSelect-option-icon"),mn))}.bind(this))}},{key:"updatePosition",value:function(){if(this.select_options){var t=bn(function(t){var e=[];for(t=t.parentElement;t;)e.push(t),t=t.parentElement;return e}(this.container),function(t){return"fixed"==vn(t,"position")});un(this.select_options,"fixed")?0==t.length&&(this.select_options.style.position="absolute",this.select_options.style.top=wn(this.container).top+this.container.offsetHeight+"px",fn(this.select_options,"fixed")):0e.bottom&&t.bottom>n){var i=e.bottom-t.bottom;null!=this.el.style.top&&(this.el.style.top=at(this.el.style.top)-i+"px"),null!=this.el.style.bottom&&(this.el.style.bottom=at(this.el.style.bottom)+i+"px")}if(t.tope.right){var s=e.right-t.right;null!=this.el.style.left&&(this.el.style.left=at(this.el.style.left)+s+"px"),null!=this.el.style.right&&(this.el.style.right=at(this.el.style.right)-s+"px")}}},{key:"setPosition",value:function(t){var e=(t=t||this.options.align).split(" "),n=Qt(e,2),i=n[0],o=n[1];i=i||"bottom";var r=wn(this.options.anchor),s=this.options.container;"static"==getComputedStyle(s).position&&(s=s.offsetParent),s||(s=document.body);var l=wn(s);r={top:r.top-l.top,left:r.left-l.left};var c={};if("left"==i?c.right=xn(s)-r.left:"center"==i?c.left=r.left+xn(this.options.anchor)/2-xn(this.el)/2:"right"==i?c.left=r.left+xn(this.options.anchor):i.includes("px")&&(c.left=r.left+xn(this.options.anchor)+at(i)),"top"==o){var a=kn(s);s==document.body&&"static"==getComputedStyle(s).position?a=window.innerHeight:s==document.body&&(a=Math.max(a,document.body.clientHeight)),c.bottom=a-r.top}else"center"==o?(c.top=r.top+kn(this.options.anchor)/2,c.transform="translateY(-50%)"):"bottom"==o?c.top=r.top+kn(this.options.anchor):o.includes("px")&&(c.top=r.top+kn(this.options.anchor)+at(o));this.options.offset.left&&(c.left+=at(this.options.offset.left)),this.options.offset.left&&(c.right-=at(this.options.offset.left)),this.options.offset.top&&(c.top+=at(this.options.offset.top)),this.options.offset.top&&(c.bottom-=at(this.options.offset.top)),this.el.style.left=null,this.el.style.right=null,this.el.style.top=null,this.el.style.bottom=null,this.el.style.transform=null,fn(this.el,"popover-left popover-right popover-center popover-top popover-bottom"),hn(this.el,"popover-"+o),hn(this.el,"popover-"+i),te(c).forEach(function(t){this.el.style[t]=c[t]+("transform"!=t?"px":"")},this)}},{key:"checkFocus",value:function(t){t.defaultPrevented||this.showing&&t.target!==this.el&&t.target!=this.options.anchor&&(this.el.contains(t.target)||this.options.anchor.contains(t.target)||this.hide())}},{key:"checkEscape",value:function(t){27==t.which&&this.hide()}},{key:"isHidden",value:function(){return!this.showing}},{key:"hide",value:function(t){t=t||{},this.showing&&(this.el.style.display="none",!(this.showing=!1)!==t.silent&&this.trigger("hidden"))}},{key:"show",value:function(){this.showing||(this.el.style.display="block",this.showing=!0,this.trigger("shown"))}},{key:"toggle",value:function(t){(t=t||this.showing)?this.hide():this.show()}}]),e}(),Sn,"Popover"),Mn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ee(this,e),Ze(this,rn(e).apply(this,arguments))}return an(e,Sn),re(e,[{key:"initialize",value:function(t){t=t||{},this.options={align:"top",container:!1},X(this.options,this.pick(t,te(this.options))),this.enabled=!0,this.message=t.message,(t.el.tooltip=this).listenTo(this.el,"mouseenter",this.show),this.listenTo(this.el,"mouseleave",this.hide)}},{key:"render",value:function(){return this}},{key:"show",value:function(){this.enabled&&(clearTimeout(this.hide_timeout),this.popup?this.popup.show():this.popup=new zn({content:"
\n
\n ".concat(this.message,"\n
"),anchor:this.el,align:"top"==this.options.align?"center top":"center 100%",offset:{top:-7},container:this.options.container||document.body}).render())}},{key:"hide",value:function(){var t=this;this.hide_timeout=setTimeout(function(){t.popup.remove(),delete t.popup},300)}},{key:"disable",value:function(){this.enabled=!1}},{key:"enabled",value:function(){this.enabled=!0}}]),e}(),Sn,"Tooltip"),An=Object.freeze({Dropdown:_n,Checkbox:On,Modal:Tn,Select:jn,FloatingLabel:Cn,Resizer:Ln,Tooltip:Mn,Popover:zn});window.Uniform=An,$&&($.fn.uniformDropdown=function(){return this.each(function(){var n=$(this),t={el:this};void 0!==n.data("dropdown-align")&&(t.align=n.data("dropdown-align")),void 0!==n.data("dropdown-trigger")&&(t.trigger=n.data("dropdown-trigger")),void 0!==n.data("dropdown-show_arrow")&&(t.show_arrow=n.data("dropdown-show_arrow")),void 0!==n.data("dropdown-square")&&(t.square=n.data("dropdown-square")),void 0!==n.data("dropdown-hide_sm")&&(t.hide_sm=n.data("dropdown-hide_sm")),void 0!==n.data("dropdown-content")&&(t.content="
".concat(n.data("dropdown-content"),"
")),void 0!==n.data("dropdown-target")&&(t.content=$(n.data("dropdown-target"))[0]);var e=new _n(t);e.on("*",function(t,e){n.trigger("dropdown-"+t,e)}),e.render()})},$.fn.uniformCheckbox=function(){return this.each(function(){$(this);new On({el:this}).render()})},$.fn.uniformRadio=$.fn.uniformCheckbox,$.fn.uniformFloatingLabel=function(){return this.each(function(){new Cn({el:this}).render()})},$.fn.uniformModal=function(){return this.click(function(){var n=$(this),t={klass:n.data("modal-klass"),content:n.data("modal-content")};if(n.data("modal-target")){var e=$(n.data("modal-target")).clone();e.removeClass("hidden"),t.content=e[0]}new Tn(t).render().on("*",function(t,e){n.trigger("modal-"+t,e)})})},$.fn.uniformResizer=function(){return this.each(function(){new Ln({el:this})})},$.fn.uniformSelect=function(){return this.each(function(){var t={el:this};X(t,$(this).data()),new jn(t).render()})},$.fn.uniformTooltip=function(){return this.each(function(){var n=$(this),t=new Mn({message:n.data("tooltip-message"),container:n.data("tooltip-container"),el:this});t.on("*",function(t,e){n.trigger("tooltip-"+t,e)}),t.render()})},$.fn.uniformTristate=function(){return this.each(function(){var i=$(this);function e(t){if(0==t.length)i.addClass("-null"),$(i.find("input")[1]).prop("checked",!0);else{var e=t.index(),n=0==e?"-true":1==e?"-null":"-false";i.removeClass("-true -null -false"),i.addClass(n)}}i.on("change","input",function(t){e($(t.currentTarget))}),e(i.find("input:checked")),i.on("blur","input",function(t){i.removeClass("-focus")}),i.on("focus","input",function(t){i.addClass("-focus")})})})}();
1
+ !function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var v=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),y=t(function(t){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)}),m=(y.version,function(i,o,t){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(i),void 0===o)return i;switch(t){case 1:return function(t){return i.call(o,t)};case 2:return function(t,e){return i.call(o,t,e)};case 3:return function(t,e,n){return i.call(o,t,e,n)}}return function(){return i.apply(o,arguments)}}),u=function(t){return"object"==typeof t?null!==t:"function"==typeof t},s=function(t){if(!u(t))throw TypeError(t+" is not an object!");return t},c=function(t){try{return!!t()}catch(t){return!0}},i=!c(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),e=v.document,n=u(e)&&u(e.createElement),o=function(t){return n?e.createElement(t):{}},r=!i&&!c(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}),l=function(t,e){if(!u(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!u(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!u(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!u(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},a=Object.defineProperty,h={f:i?Object.defineProperty:function(t,e,n){if(s(t),e=l(e,!0),s(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},_=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},x=i?function(t,e,n){return h.f(t,e,_(1,n))}:function(t,e,n){return t[e]=n,t},f={}.hasOwnProperty,b=function(t,e){return f.call(t,e)},g="prototype",w=function(t,e,n){var i,o,r,s=t&w.F,l=t&w.G,u=t&w.S,c=t&w.P,a=t&w.B,h=t&w.W,f=l?y:y[e]||(y[e]={}),p=f[g],d=l?v:u?v[e]:(v[e]||{})[g];for(i in l&&(n=e),n)(o=!s&&d&&void 0!==d[i])&&b(f,i)||(r=o?d[i]:n[i],f[i]=l&&"function"!=typeof d[i]?n[i]:a&&o?m(r,v):h&&d[i]==r?function(i){var t=function(t,e,n){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,e)}return new i(t,e,n)}return i.apply(this,arguments)};return t[g]=i[g],t}(r):c&&"function"==typeof r?m(Function.call,r):r,c&&((f.virtual||(f.virtual={}))[i]=r,t&w.R&&p&&!p[i]&&x(p,i,r)))};w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128;var p,S=w,d={}.toString,k=function(t){return d.call(t).slice(8,-1)},O=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==k(t)?t.split(""):Object(t)},T=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},j=function(t){return O(T(t))},E=Math.ceil,C=Math.floor,L=function(t){return isNaN(t=+t)?0:(0o;)b(i,n=e[o++])&&(~D(r,n)||r.push(n));return r},G="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Y=Object.keys||function(t){return B(t,G)},V={f:Object.getOwnPropertySymbols},K={f:{}.propertyIsEnumerable},J=function(t){return Object(T(t))},U=Object.assign,X=!U||c(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=U({},t)[n]||Object.keys(U({},e)).join("")!=i})?function(t,e){for(var n=J(t),i=arguments.length,o=1,r=V.f,s=K.f;o>>0||(ut.test(n)?16:10))}:st;S(S.G+S.F*(parseInt!=ct),{parseInt:ct});var at=y.parseInt,ht=Array.isArray||function(t){return"Array"==k(t)};S(S.S,"Array",{isArray:ht});var ft=y.Array.isArray;var pt=function(t){if(ft(t))return t},dt=function(t,e){return{value:e,done:!!t}},vt={},yt=x,mt=i?Object.defineProperties:function(t,e){s(t);for(var n,i=Y(e),o=i.length,r=0;rdocument.F=Object<\/script>"),t.close(),xt=t.F;n--;)delete xt[_t][G[n]];return xt()},St=Object.create||function(t,e){var n;return null!==t?(kt[_t]=s(t),n=new kt,kt[_t]=null,n[wt]=t):n=xt(),void 0===e?n:mt(n,e)},Ot=t(function(t){var e=N("wks"),n=v.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:q)("Symbol."+t))}).store=e}),Tt=h.f,jt=Ot("toStringTag"),Et=function(t,e,n){t&&!b(t=n?t:t.prototype,jt)&&Tt(t,jt,{configurable:!0,value:e})},Ct={};x(Ct,Ot("iterator"),function(){return this});var Lt=R("IE_PROTO"),Pt=Object.prototype,zt=Object.getPrototypeOf||function(t){return t=J(t),b(t,Lt)?t[Lt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Pt:null},At=Ot("iterator"),Mt=!([].keys&&"next"in[].keys()),Nt="values",It=function(){return this},Ht=function(t,e,n,i,o,r,s){var l,u,c;u=e,c=i,(l=n).prototype=St(Ct,{next:_(1,c)}),Et(l,u+" Iterator");var a,h,f,p=function(t){if(!Mt&&t in m)return m[t];switch(t){case"keys":case Nt:return function(){return new n(this,t)}}return function(){return new n(this,t)}},d=e+" Iterator",v=o==Nt,y=!1,m=t.prototype,b=m[At]||m["@@iterator"]||o&&m[o],g=b||p(o),w=o?v?p("entries"):g:void 0,k="Array"==e&&m.entries||b;if(k&&(f=zt(k.call(new t)))!==Object.prototype&&f.next&&Et(f,d,!0),v&&b&&b.name!==Nt&&(y=!0,g=function(){return b.call(this)}),s&&(Mt||y||!m[At])&&x(m,At,g),vt[e]=g,vt[d]=It,o)if(a={values:v?g:p(Nt),keys:r?g:p("keys"),entries:w},s)for(h in a)h in m||yt(m,h,a[h]);else S(S.P+S.F*(Mt||y),e,a);return a};Ht(Array,"Array",function(t,e){this._t=j(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,dt(1)):dt(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");vt.Arguments=vt.Array;for(var qt=Ot("toStringTag"),Ft="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Rt=0;Rt=e.length?{value:void 0,done:!0}:(t=Gt(e,n),this._i+=t.length,{value:t,done:!1})});var Yt=Ot("toStringTag"),Vt="Arguments"==k(function(){return arguments}()),Kt=function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Yt))?n:Vt?k(e):"Object"==(i=k(e))&&"function"==typeof e.callee?"Arguments":i},Jt=Ot("iterator"),Ut=y.getIteratorMethod=function(t){if(null!=t)return t[Jt]||t["@@iterator"]||vt[Kt(t)]},Xt=y.getIterator=function(t){var e=Ut(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return s(e.call(t))};var Qt=function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,l=Xt(t);!(i=(s=l.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{i||null==l.return||l.return()}finally{if(o)throw r}}return n};var Zt=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var te=function(t,e){return pt(t)||Qt(t,e)||Zt()},ee=function(t,e){var n=(y.Object||{})[t]||Object[t],i={};i[t]=e(n),S(S.S+S.F*c(function(){n(1)}),"Object",i)};ee("keys",function(){return function(t){return Y(J(t))}});var ne=y.Object.keys;var ie=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};S(S.S+S.F*!i,"Object",{defineProperty:h.f});var oe=y.Object,re=function(t,e,n){return oe.defineProperty(t,e,n)};function se(t,e){for(var n=0;ns;)r.call(t,i=o[s++])&&e.push(i);return e}(e=j(e)),o=0,r=i.length;oo;)b(Ae,e=n[o++])||e==Ce||e==ke||i.push(e);return i},Ve=function(t){for(var e,n=t===Ne,i=Se(n?Me:j(t)),o=[],r=0;i.length>r;)!b(Ae,e=i[r++])||n&&!b(Ne,e)||o.push(Ae[e]);return o};Ie||(yt((Oe=function(){if(this instanceof Oe)throw TypeError("Symbol is not a constructor!");var e=q(0Je;)Ot(Ke[Je++]);for(var Ue=Y(Ot.store),Xe=0;Ue.length>Xe;)fe(Ue[Xe++]);S(S.S+S.F*!Ie,"Symbol",{for:function(t){return b(ze,t+="")?ze[t]:ze[t]=Oe(t)},keyFor:function(t){if(!$e(t))throw TypeError(t+" is not a symbol!");for(var e in ze)if(ze[e]===t)return e},useSetter:function(){qe=!0},useSimple:function(){qe=!1}}),S(S.S+S.F*!Ie,"Object",{create:function(t,e){return void 0===e?St(t):We(St(t),e)},defineProperty:De,defineProperties:We,getOwnPropertyDescriptor:Ge,getOwnPropertyNames:Ye,getOwnPropertySymbols:Ve}),Te&&S(S.S+S.F*(!Ie||c(function(){var t=Oe();return"[null]"!=je([t])||"{}"!=je({a:t})||"{}"!=je(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=e=i[1],(u(e)||void 0!==t)&&!$e(t))return ht(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!$e(e))return e}),i[1]=e,je.apply(Te,i)}}),Oe[Ee][Le]||x(Oe[Ee],Le,Oe[Ee].valueOf),Et(Oe,"Symbol"),Et(Math,"Math",!0),Et(v.JSON,"JSON",!0),fe("asyncIterator"),fe("observable");var Qe=y.Symbol,Ze=t(function(e){function n(t){return(n="function"==typeof Qe&&"symbol"==typeof ce?function(t){return typeof t}:function(t){return t&&"function"==typeof Qe&&t.constructor===Qe&&t!==Qe.prototype?"symbol":typeof t})(t)}function i(t){return"function"==typeof Qe&&"symbol"===n(ce)?e.exports=i=function(t){return n(t)}:e.exports=i=function(t){return t&&"function"==typeof Qe&&t.constructor===Qe&&t!==Qe.prototype?"symbol":n(t)},i(t)}e.exports=i});var tn=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var en=function(t,e){return!e||"object"!==Ze(e)&&"function"!=typeof e?tn(t):e};ee("getPrototypeOf",function(){return function(t){return zt(J(t))}});var nn=y.Object.getPrototypeOf,on=function(t,e){if(s(t),!u(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},rn={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,i){try{(i=m(Function.call,we.f(Object.prototype,"__proto__").set,2))(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return on(t,e),n?t.__proto__=e:i(t,e),t}}({},!1):void 0),check:on};S(S.S,"Object",{setPrototypeOf:rn.set});var sn=y.Object.setPrototypeOf,ln=t(function(e){function n(t){return e.exports=n=sn?nn:function(t){return t.__proto__||nn(t)},n(t)}e.exports=n});S(S.S,"Object",{create:St});var un=y.Object,cn=function(t,e){return un.create(t,e)},an=t(function(n){function i(t,e){return n.exports=i=sn||function(t,e){return t.__proto__=e,t},i(t,e)}n.exports=i});var hn=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=cn(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&an(t,e)};function fn(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function pn(e,t){e.classList?mn(t.split(" "),function(t){e.classList.add(t)}):e.className+=" "+t}function dn(t,n){var e=function(e){e.classList?n.split(" ").forEach(function(t){return e.classList.remove(t)}):e.className=e.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")};NodeList.prototype.isPrototypeOf(t)?mn(t,e):e(t)}function vn(t,e,n){if(t.classList)t.classList.toggle(e,n);else{var i=t.className.split(" "),o=i.indexOf(e);!1===n||!0!==n&&0<=o?i.splice(o,1):i.push(e),t.className=i.join(" ")}}function yn(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!1),t.dispatchEvent(n)}function mn(t,e){for(var n=0;nMath.max(document.body.offsetHeight,window.innerHeight)&&(t[1]="top",e=!0),_n(this.dropdown).top<0&&(t[1]="bottom",e=!0),_n(this.dropdown).left<0&&(t[0]="right",e=!0),_n(this.dropdown).left+Sn(this.dropdown)>document.body.offsetWidth&&(t[0]="left",e=!0),e&&this.setPosition(t.join(" "))}},{key:"setPosition",value:function(t){var e=(t=t||this.options.align).split(" "),n=te(e,2),i=n[0],o=n[1];i=i||"bottom",o=o||"bottom";var r=_n(this.el),s=this.options.container;"static"==getComputedStyle(s).position&&(s=s.offsetParent),s||(s=document.body);var l=_n(s);r={top:r.top-l.top,left:r.left-l.left};var u={};"left"==i?u.right=Sn(s)-r.left:"center"==i?u.left=r.left+Sn(this.el)/2-Sn(this.dropdown)/2:"right"==i?u.left=r.left+Sn(this.el):i.includes("%")?u.left=r.left+Sn(this.el)*at(i)/100:i.includes("px")&&(u.left=r.left+Sn(this.el)+at(i)),"top"==o?u.top=r.top-xn(this.dropdown):"center"==o?u.top=r.top+xn(this.el)/2-xn(this.dropdown)/2:"bottom"==o?u.top=r.top+xn(this.el):o.includes("%")?u.top=r.top+xn(this.el)*at(o)/100:o.includes("px")&&(u.top=r.top+xn(this.el)+at(o)),this.options.offset.left&&(u.left+=at(this.options.offset.left)),this.options.offset.top&&(u.top+=at(this.options.offset.top)),this.options.offset.left&&(u.right-=at(this.options.offset.left)),this.dropdown.style.left="auto",this.dropdown.style.right="auto",dn(this.dropdown,"popover-left popover-right popover-center popover-top popover-bottom"),pn(this.dropdown,"popover-"+o),pn(this.dropdown,"popover-"+i),ne(u).forEach(function(t){this.dropdown.style[t]=u[t]+"px"},this)}},{key:"remove",value:function(){On.prototype.remove.apply(this,arguments),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown),delete this.dropdown}},{key:"toggle",value:function(t){fn(this.el,"active")&&"click"==t.type?this.hide():this.show()}},{key:"show",value:function(t){t||(t={}),this.options.hide_sm&&window.innerWidth<720||(this.dropdown||this.render(),this.dropdown.style.display="block",pn(this.el,"active"),this.resize(),this.overlay=document.createElement("div"),pn(this.overlay,"uniformOverlay"),document.body.appendChild(this.overlay),window.innerWidth<720&&(this.lastScrollPosition=window.scrollY,pn(document.body,"uniformModal-hideBody")),this.listenTo(this.overlay,"click",this.hide),t.silent||this.trigger("shown"))}},{key:"hide",value:function(t){t||(t={}),this.dropdown&&fn(this.el,"active")&&(this.dropdown.style.display="none",dn(this.el,"active"),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),window.innerWidth<720&&(dn(document.body,"uniformModal-hideBody"),window.scrollTo(0,this.lastScrollPosition)),t.silent||this.trigger("hidden"))}},{key:"outsideClick",value:function(t){this.dropdown&&null!==this.dropdown.offsetParent&&t.target!==this.el&&t.target!==this.overlay&&(this.el.contains(t.target)||this.dropdown.contains(t.target)||this.hide())}},{key:"keyup",value:function(t){27==t.which&&this.hide()}}]),e}(),On,"Dropdown"),jn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ie(this,e),en(this,ln(e).apply(this,arguments))}return hn(e,On),le(e,[{key:"initialize",value:function(t){this.listenTo(this.el,"change",this.change)}},{key:"render",value:function(){var t=fn(this.el,"uniformRadio")?"uniformRadio":"uniformCheckbox";return this.checkbox=document.createElement("div"),pn(this.checkbox,"".concat(t,"-indicator")),this.el.className&&""!=this.el.className.replace(t,"")&&pn(this.checkbox,this.el.className.replace(t,"")),vn(this.checkbox,"checked",this.el.checked),this.el.parentNode.insertBefore(this.checkbox,this.el.nextSibling),this.listenTo(this.checkbox,"click",this.click),this}},{key:"click",value:function(t){this.el.disabled||(this.el.checked=!this.el.checked,yn(this.el,"change"),t.preventDefault())}},{key:"change",value:function(){vn(this.checkbox,"checked",this.el.checked)}}]),e}(),On,"Checkbox"),En=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ie(this,e),en(this,ln(e).apply(this,arguments))}return hn(e,On),le(e,[{key:"initialize",value:function(t){this.options={},this.options.klass=t.klass||!1,this.content=t.content,pn(this.el,"uniformModal"),this.listenTo(document,"keyup",this.keyup),this.listenTo(this.el,"click",this.checkCloseButton)}},{key:"keyup",value:function(t){27==t.which&&this.close()}},{key:"render",value:function(){var t="function"==typeof this.content?this.content():this.content;this.highest_z_index=0,this.overlay=document.createElement("div"),pn(this.overlay,"uniformModal-overlay"),this.blur=document.createElement("div"),pn(this.blur,"uniformModal-blur"),this.original_scroll=window.scrollY,this.blur.style.top=0-this.original_scroll+"px",0Math.max(e.bottom,n.bottom)){var i=this.options.align.split(" "),o=te(i,2),r=o[0];o[1],this.setPosition("".concat(r," top"))}if(t.tope.right){var u=e.right-t.right;null!=this.el.style.left&&(this.el.style.left=at(this.el.style.left)+u+"px"),null!=this.el.style.right&&(this.el.style.right=at(this.el.style.right)-u+"px")}}},{key:"setPosition",value:function(t){var e=(t=t||this.options.align).split(" "),n=te(e,2),i=n[0],o=n[1];i=i||"bottom";var r=_n(this.options.anchor),s=this.options.container;"static"==getComputedStyle(s).position&&(s=s.offsetParent),s||(s=document.body);var l=_n(s);r={top:r.top-l.top,left:r.left-l.left};var u={};if("left"==i?u.right=Sn(s)-r.left:"center"==i?u.left=r.left+Sn(this.options.anchor)/2-Sn(this.el)/2:"right"==i?u.left=r.left+Sn(this.options.anchor):i.includes("px")&&(u.left=r.left+at(i)),"top"==o){var c=xn(s);s==document.body&&"static"==getComputedStyle(s).position?c=window.innerHeight:s==document.body&&(c=Math.max(c,document.body.clientHeight)),u.bottom=c-r.top}else"center"==o?(u.top=r.top+xn(this.options.anchor)/2,u.transform="translateY(-50%)"):"bottom"==o?u.top=r.top+xn(this.options.anchor):o.includes("px")&&(u.top=r.top+at(o));this.options.offset.left&&(u.left+=at(this.options.offset.left)),this.options.offset.left&&(u.right-=at(this.options.offset.left)),this.options.offset.top&&(u.top+=at(this.options.offset.top)),this.options.offset.top&&(u.bottom-=at(this.options.offset.top)),this.el.style.left=null,this.el.style.right=null,this.el.style.top=null,this.el.style.bottom=null,this.el.style.transform=null,dn(this.el,"popover-left popover-right popover-center popover-top popover-bottom"),pn(this.el,"popover-"+o),pn(this.el,"popover-"+i),ne(u).forEach(function(t){this.el.style[t]=u[t]+("transform"!=t?"px":"")},this)}},{key:"checkFocus",value:function(t){t.defaultPrevented||this.showing&&t.target!==this.el&&t.target!=this.options.anchor&&(this.el.contains(t.target)||this.options.anchor.contains(t.target)||this.hide())}},{key:"checkEscape",value:function(t){27==t.which&&this.hide()}},{key:"isHidden",value:function(){return!this.showing}},{key:"hide",value:function(t){t=t||{},this.showing&&(this.el.style.display="none",!(this.showing=!1)!==t.silent&&this.trigger("hidden"))}},{key:"show",value:function(){this.showing||(this.el.style.display="block",this.showing=!0,this.trigger("shown"))}},{key:"toggle",value:function(t){(t=t||this.showing)?this.hide():this.show()}}]),e}(),On,"Popover"),Wn='\n\n\n\n'.trim(),Bn='\n\n\n\n'.trim(),Gn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ie(this,e),en(this,ln(e).apply(this,arguments))}return hn(e,On),le(e,[{key:"initialize",value:function(){var t=0\n \n ').concat(Bn,"\n \n ")),this.el.name&&pn(this.edit_button,this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g,"-")),this.el.style.display="none",this.el.insertAdjacentElement("beforebegin",this.edit_button),this.options.container||(this.options.container=this.edit_button.parentElement);var t=$n(this.el.querySelectorAll("option")).sort(function(t,e){return t.textContent.length>e.textContent.length}).reverse()[0];this.edit_button.querySelector(".text-js").style.opacity=0,this.edit_button.querySelector(".text-js").innerHTML=t.textContent;var e=this.edit_button.querySelector(".text-js").offsetWidth;return this.edit_button.style.minWidth=e+"px",this.edit_button.querySelector(".text-js").innerHTML="",this.edit_button.querySelector(".text-js").style.opacity=null,this.renderSelected(),this.listenTo(this.edit_button,"click",this.showOptions),this.listenTo(this.edit_button,"click",".uniformSelect-remove",this.removeSelection),this}},{key:"renderOptions",value:function(){this.button_options=wn("
"),this.el.name&&pn(this.button_options,this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g,"-")),this.button_options.style.fontSize=bn(this.el,"font-size"),mn(this.el.querySelectorAll("option"),function(t,e){var n=wn("");this.listenTo(e,"click",function(t){yn(this.el,"show_all"),this.options.showAll&&this.options.showAll(this.button_options),t.preventDefault(),t.stopPropagation()}),t.appendChild(e)}if(this.el.multiple){var n=wn("");this.listenTo(n,"click",this.hideOptions),t.appendChild(n)}""!==t.innerHTML&&this.button_options.appendChild(t)}},{key:"renderSelected",value:function(){var t=function(t,e){for(var n=[],i=0;i'.concat(t.textContent,''):t.textContent}.bind(this)).join(" ");this.edit_button.querySelector(".text-js").innerHTML=""==t?" ":t,this.button_options&&mn(this.button_options.querySelectorAll(".uniformSelect-option"),function(t){t.option.selected?(pn(t,"active"),t.append(this.activeIcon.cloneNode(!0))):(dn(t,"active"),mn(t.querySelectorAll(".uniformSelect-option-icon"),gn))}.bind(this))}},{key:"hideOptions",value:function(){this.button_options&&(this.button_options_modal&&this.button_options_modal.close(),this.button_options_popover&&(this.button_options_popover.remove(),delete this.button_options_popover),dn(this.edit_button,"active"))}},{key:"showOptions",value:function(t){var e=this;if(!fn(t.target,"uniformSelect-remove")){if(this.button_options_modal)return this.hideOptions();if(this.button_options_popover)return this.hideOptions();if(this.button_options||this.renderOptions(),pn(this.edit_button,"active"),window.innerWidth<720){var n=wn('
');n.append(this.button_options),this.options.label&&n.append('
'.concat(this.options.label,"
")),this.button_options_modal=new En({content:n,klass:"-reset"}).render(),this.button_options_modal.on("closed",function(){dn(e.edit_button,"active"),delete e.button_options_modal}),this.listenTo(n,"click",function(t){t.target==n&&this.button_options_modal.close()})}else this.button_options.style.minWidth=this.edit_button.offsetWidth+"px",this.button_options_popover=new Dn({offset:{top:1},anchor:this.edit_button,align:"0px bottom",content:this.button_options,container:this.options.container}).render(),this.button_options_popover.on("hidden",function(){dn(e.edit_button,"active"),e.button_options_popover.remove(),delete e.button_options_popover})}}},{key:"selectOption",value:function(t){t.target,this.el.multiple||(mn(this.button_options.querySelectorAll(".uniformSelect-option.active .uniformSelect-option-icon"),gn),dn(this.button_options.querySelectorAll(".uniformSelect-option.active"),"active")),vn(t.target,"active"),t.target.option.selected=fn(t.target,"active"),fn(t.target,"active")?t.target.append(this.activeIcon.cloneNode(!0)):mn(t.target.querySelectorAll(".uniformSelect-option-icon"),gn),this.el.multiple||this.hideOptions(),yn(this.el,"change")}},{key:"removeSelection",value:function(e){e.preventDefault();var t=kn(this.el.querySelectorAll("option"),function(t){return t.innerText.trim()==e.target.parentNode.innerText.trim()})[0];t&&(t.selected=!1,yn(this.el,"change"))}}]),e}(),On,"Select"),Yn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ie(this,e),en(this,ln(e).apply(this,arguments))}return hn(e,On),le(e,[{key:"initialize",value:function(){this.label=this.el.querySelector("label"),this.input=this.el.querySelector("#"+this.label.getAttribute("for")),this.startingHeight,this.listenTo(this.input,"focus",this.activate),this.listenTo(this.input,"blur",this.deactivate),this.listenTo(this.input,"revealed",this.render)}},{key:"render",value:function(){if(null!==this.input.offsetParent&&!fn(this.el,"enabled")){var t,e=at(bn(this.input,"paddingBottom"));this.startingHeight=this.input.offsetHeight,pn(this.el,"enabled"),pn(this.el,"inactive"),this.input.style.paddingTop=e+e/2+"px",this.input.style.paddingBottom=e-e/2-2+"px",this.label.style.position="absolute",this.label.style.top=0,this.label.style.left=this.label.offsetLeft,this.label.style.paddingLeft=bn(this.input,"paddingLeft"),this.label.style.height=this.startingHeight,this.label.style.lineHeight=this.startingHeight+"px",t=this.input,document.activeElement===t&&this.activate(),void 0!==this.input.value&&""!=this.input.value&&this.activate()}}},{key:"activate",value:function(t){void 0!==t&&pn(this.el,"active"),fn(this.el,"float")||(pn(this.el,"float"),dn(this.el,"inactive"),this.label.style.lineHeight=this.startingHeight/2+"px")}},{key:"deactivate",value:function(t){void 0!==t&&dn(this.el,"active"),""==this.input.value&&(dn(this.el,"float"),pn(this.el,"inactive"),this.label.style.lineHeight=this.startingHeight+"px")}}]),e}(),On,"FloatingLabel"),Vn=function(t,e,n){if(n&&Object.defineProperty(t,"name",{value:n,configurable:!0}),"extended"in e){if("function"!=typeof e.extended)throw new TypeError("Attempted to call extended, but it was not a function");var i=e.extended(t);void 0!==i&&(n&&"function"==typeof i&&i.name!==n&&Object.defineProperty(i,"name",{value:n,configurable:!0}),t=i)}return t}(function(t){function e(){return ie(this,e),en(this,ln(e).apply(this,arguments))}return hn(e,On),le(e,[{key:"initialize",value:function(){this.listenTo(window,"resize",this.resize),yn(window,"resize")}},{key:"resize",value:function(){var t=this.el.offsetWidth;720\n
\n ".concat(this.message,"\n
"),anchor:this.el,align:"top"==this.options.align?"center top":"center 100%",offset:{top:-7},container:this.options.container||document.body}).render())}},{key:"hide",value:function(){var t=this;this.hide_timeout=setTimeout(function(){t.popup.remove(),delete t.popup},300)}},{key:"disable",value:function(){this.enabled=!1}},{key:"enabled",value:function(){this.enabled=!0}}]),e}(),On,"Tooltip"),Jn=Object.freeze({Dropdown:Tn,Checkbox:jn,Modal:En,Select:Gn,FloatingLabel:Yn,Resizer:Vn,Tooltip:Kn,Popover:Dn});window.Uniform=Jn,$&&($.fn.uniformDropdown=function(){return this.each(function(){var n=$(this),t={el:this};void 0!==n.data("dropdown-align")&&(t.align=n.data("dropdown-align")),void 0!==n.data("dropdown-trigger")&&(t.trigger=n.data("dropdown-trigger")),void 0!==n.data("dropdown-show_arrow")&&(t.show_arrow=n.data("dropdown-show_arrow")),void 0!==n.data("dropdown-square")&&(t.square=n.data("dropdown-square")),void 0!==n.data("dropdown-hide_sm")&&(t.hide_sm=n.data("dropdown-hide_sm")),void 0!==n.data("dropdown-content")&&(t.content="
".concat(n.data("dropdown-content"),"
")),void 0!==n.data("dropdown-target")&&(t.content=$(n.data("dropdown-target"))[0]);var e=new Tn(t);e.on("*",function(t,e){n.trigger("dropdown-"+t,e)}),e.render()})},$.fn.uniformCheckbox=function(){return this.each(function(){$(this);new jn({el:this}).render()})},$.fn.uniformRadio=$.fn.uniformCheckbox,$.fn.uniformFloatingLabel=function(){return this.each(function(){new Yn({el:this}).render()})},$.fn.uniformModal=function(){return this.click(function(){var n=$(this),t={klass:n.data("modal-klass"),content:n.data("modal-content")};if(n.data("modal-target")){var e=$(n.data("modal-target")).clone();e.removeClass("hidden"),t.content=e[0]}new En(t).render().on("*",function(t,e){n.trigger("modal-"+t,e)})})},$.fn.uniformResizer=function(){return this.each(function(){new Vn({el:this})})},$.fn.uniformSelect=function(){return this.each(function(){var t={el:this};Q(t,$(this).data()),new Gn(t).render()})},$.fn.uniformTooltip=function(){return this.each(function(){var n=$(this),t=new Kn({message:n.data("tooltip-message"),container:n.data("tooltip-container"),el:this});t.on("*",function(t,e){n.trigger("tooltip-"+t,e)}),t.render()})},$.fn.uniformTristate=function(){return this.each(function(){var i=$(this);function e(t){if(0==t.length)i.addClass("-null"),$(i.find("input")[1]).prop("checked",!0);else{var e=t.index(),n=0==e?"-true":1==e?"-null":"-false";i.removeClass("-true -null -false"),i.addClass(n)}}i.on("change","input",function(t){e($(t.currentTarget))}),e(i.find("input:checked")),i.on("blur","input",function(t){i.removeClass("-focus")}),i.on("focus","input",function(t){i.addClass("-focus")})})})}();
@@ -1,11 +1,11 @@
1
- import Dropdown from 'uniform/dropdown';
2
- import Checkbox from 'uniform/checkbox';
3
- import Modal from 'uniform/modal';
4
- import Select from 'uniform/select';
5
- import FloatingLabel from 'uniform/floating-label';
6
- import Resizer from 'uniform/resizer';
7
- import Tooltip from 'uniform/tooltip';
8
- import Popover from 'uniform/popover';
1
+ import Dropdown from './uniform/dropdown';
2
+ import Checkbox from './uniform/checkbox';
3
+ import Modal from './uniform/modal';
4
+ import Select from './uniform/select';
5
+ import FloatingLabel from './uniform/floating-label';
6
+ import Resizer from './uniform/resizer';
7
+ import Tooltip from './uniform/tooltip';
8
+ import Popover from './uniform/popover';
9
9
 
10
10
  export {
11
11
  Dropdown,
@@ -71,7 +71,7 @@ export default class Modal extends Component {
71
71
 
72
72
  var closeButton = document.createElement('div');
73
73
  Helpers.addClass(closeButton, 'uniformModal-close');
74
- container.appendChild(closeButton);
74
+ this.el.appendChild(closeButton);
75
75
 
76
76
  this.el.style.top = window.scrollY;
77
77
  this.listenTo(this.overlay, 'click', this.close);
@@ -18,7 +18,7 @@ export default class Popover extends Component {
18
18
  this.showing = false;
19
19
  options = options || {};
20
20
  this.options = {
21
- zIndex: 2,
21
+ zIndex: 3,
22
22
  container: document.body,
23
23
  align: 'center bottom',
24
24
  anchor: document.body,
@@ -59,7 +59,7 @@ export default class Popover extends Component {
59
59
 
60
60
  resize () {
61
61
  this.setPosition();
62
- const bounds = this.el.getBoundingClientRect();
62
+ let bounds = this.el.getBoundingClientRect();
63
63
  const body_bounds = document.body.getBoundingClientRect();
64
64
  const window_bounds = {
65
65
  top: 0,
@@ -69,10 +69,14 @@ export default class Popover extends Component {
69
69
  };
70
70
 
71
71
  var reposition = false;
72
- if (bounds.bottom > body_bounds.bottom && bounds.bottom > window_bounds.bottom) {
73
- const difference = body_bounds.bottom - bounds.bottom
74
- if(this.el.style.top != null) this.el.style.top = parseInt(this.el.style.top) - difference + "px"
75
- if(this.el.style.bottom != null) this.el.style.bottom = parseInt(this.el.style.bottom) + difference + "px"
72
+ if (bounds.bottom > Math.max(body_bounds.bottom, window_bounds.bottom)) {
73
+ var [leftAlign, topAlign] = this.options.align.split(" ");
74
+ this.setPosition(`${leftAlign} top`);
75
+ bounds = this.el.getBoundingClientRect()
76
+ if(bounds.top < 0) {
77
+ this.setPosition(`${leftAlign} bottom`);
78
+ }
79
+ bounds = this.el.getBoundingClientRect()
76
80
  }
77
81
  if (bounds.top < body_bounds.top) {
78
82
  const difference = body_bounds.top - bounds.top
@@ -83,6 +87,7 @@ export default class Popover extends Component {
83
87
  const difference = body_bounds.left - bounds.left
84
88
  if(this.el.style.left != null) this.el.style.left = parseInt(this.el.style.left) + difference + "px"
85
89
  if(this.el.style.right != null) this.el.style.right = parseInt(this.el.style.right) - difference + "px"
90
+ bounds = this.el.getBoundingClientRect()
86
91
  }
87
92
  if (bounds.right > body_bounds.right) {
88
93
  const difference = body_bounds.right - bounds.right
@@ -115,7 +120,7 @@ export default class Popover extends Component {
115
120
  } else if (leftAlign == 'right'){
116
121
  position.left = offset.left + Helpers.outerWidth(this.options.anchor);
117
122
  } else if (leftAlign.includes("px")){
118
- position.left = offset.left + Helpers.outerWidth(this.options.anchor) + parseInt(leftAlign);
123
+ position.left = offset.left + parseInt(leftAlign);
119
124
  }
120
125
 
121
126
  if(topAlign == 'top'){
@@ -132,7 +137,7 @@ export default class Popover extends Component {
132
137
  } else if (topAlign == 'bottom'){
133
138
  position.top = offset.top + Helpers.outerHeight(this.options.anchor);
134
139
  } else if (topAlign.includes("px")){
135
- position.top = offset.top + Helpers.outerHeight(this.options.anchor) + parseInt(topAlign);
140
+ position.top = offset.top + parseInt(topAlign);
136
141
  }
137
142
 
138
143
  if(this.options.offset.left) position.left += parseInt(this.options.offset.left);
@@ -160,11 +165,13 @@ export default class Popover extends Component {
160
165
  if (e.target == this.options.anchor) return;
161
166
  if (this.el.contains(e.target)) return;
162
167
  if (this.options.anchor.contains(e.target)) return;
168
+ if (this.persisting) return;
163
169
  this.hide();
164
170
  }
165
171
 
166
172
  checkEscape (e) {
167
173
  if(e.which != 27) return;
174
+ if (this.persisting) return;
168
175
  this.hide();
169
176
  }
170
177
 
@@ -193,4 +200,12 @@ export default class Popover extends Component {
193
200
  flag = flag || this.showing;
194
201
  if(flag) this.hide(); else this.show();
195
202
  }
203
+
204
+ persist() {
205
+ this.persisting = true;
206
+ }
207
+
208
+ unpersist() {
209
+ this.persisting = false;
210
+ }
196
211
  }
@@ -1,4 +1,6 @@
1
1
  import Component from './component';
2
+ import Popover from './popover';
3
+ import Modal from './modal';
2
4
  import { check as checkIcon, arrow_down as arrowIcon } from './icons';
3
5
  import * as Helpers from './dom-helpers';
4
6
 
@@ -6,7 +8,7 @@ import * as Helpers from './dom-helpers';
6
8
  options
7
9
  class: String, appended to uniformSelect-edit button as class
8
10
  limit: int | false - number of options to limit to, or false to not limit
9
- showAll: function(select_options) to run if/when "Show All" is clicked
11
+ showAll: function(button_options) to run if/when "Show All" is clicked
10
12
  label: string, used for mobile menu
11
13
  container: selector for where to render dropdown
12
14
  */
@@ -16,105 +18,89 @@ export default class Select extends Component {
16
18
  this.options = {
17
19
  label: false,
18
20
  class: "",
19
- showAll: function (select_options){
20
- Helpers.removeClass(select_options.querySelectorAll('button.hide'), 'hide');
21
- var button = select_options.querySelector('.uniformSelect-show-all');
21
+ showAll: function (button_options){
22
+ Helpers.removeClass(button_options.querySelectorAll('button.hide'), 'hide');
23
+ var button = button_options.querySelector('.uniformSelect-show-all');
22
24
  button.parentNode.removeChild(button);
23
25
 
24
26
  return false;
25
27
  },
26
28
  limit: 8,
27
- container: document.body
29
+ container: false
28
30
  }
29
31
 
30
32
  Object.assign(this.options, this.pick(options, Object.keys(this.options)));
31
33
 
32
- var showing, lastScrollPosition, select_options;
33
-
34
- this.listenTo(this.el, 'change', this.updateSelect);
34
+ this.listenTo(this.el, 'change', this.renderSelected);
35
35
  this.listenTo(this.el, 'close', this.hideOptions);
36
- this.listenTo(this.el, 'revealed', this.resize);
37
36
  this.el.uniformSelect = this;
38
37
 
39
- this.listenTo(window, 'resize', this.resize);
40
- this.listenTo(window, 'scroll', this.updatePosition);
41
- this.listenTo(document, 'click', this.outsideClick);
42
- this.listenTo(document, 'keyup', this.keyup);
43
-
44
38
  this.activeIcon = document.createElement('span');
45
- Helpers.addClass(this.activeIcon, 'uniformSelect-option-icon');
46
39
  this.activeIcon.innerHTML = checkIcon;
40
+ Helpers.addClass(this.activeIcon, 'uniformSelect-option-icon');
47
41
  }
48
-
49
- outsideClick (e) {
50
- if (!this.showing) return;
51
- if (e.target === this.select_options) return;
52
- if (this.container.contains(e.target)) return;
53
- if (this.select_options.contains(e.target)) return;
54
- this.hideOptions();
55
- }
56
-
57
- keyup (e) {
58
- if(e.which === 27) this.hideOptions();
42
+
43
+ remove () {
44
+ Component.prototype.remove.apply(this, arguments);
45
+ this.edit_button.parentNode.removeChild(this.edit_button);
46
+ delete this.this.edit_button;
47
+
48
+ this.activeIcon.parentNode.removeChild(this.activeIcon);
49
+ delete this.activeIcon;
50
+
51
+ if(this.button_options_popover) this.button_options_popover.remove();
52
+ if(this.button_options_modal) this.button_options_modal.remove();
53
+
54
+ if(this.button_options) {
55
+ this.button_options.parentNode.removeChild(this.button_options);
56
+ delete this.button_options;
57
+ }
59
58
  }
60
59
 
61
60
  render () {
62
- this.container = document.createElement('div');
63
- Helpers.addClass(this.container, 'uniformSelect-container');
64
-
65
- this.edit_button = Helpers.createElement(`<button type='button' class='uniformSelect-edit uniformInput outline block ${this.options.class}'><span class="text-js"></span><span class="uniformSelect-edit-icon">${arrowIcon}</span></button>`);
66
- this.container.appendChild(this.edit_button);
61
+ this.edit_button = Helpers.createElement(`
62
+ <button type='button' class='uniformSelect-edit uniformInput outline block ${this.options.class}'>
63
+ <span class="text-js"></span>
64
+ <span class="uniformSelect-edit-icon">${arrowIcon}</span>
65
+ </button>
66
+ `);
67
67
 
68
68
  if (this.el.name) {
69
- Helpers.addClass(this.container, this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g, '-'));
69
+ Helpers.addClass(this.edit_button, this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g, '-'));
70
70
  }
71
71
  this.el.style.display = "none";
72
- this.el.insertAdjacentElement('beforebegin', this.container);
73
- this.updateSelect();
74
- this.resize();
72
+ this.el.insertAdjacentElement('beforebegin', this.edit_button);
75
73
 
76
- this.listenTo(this.edit_button, 'click', this.showOptions);
77
- this.listenTo(this.edit_button, 'click', '.uniformSelect-remove', this.removeSelection);
78
- }
79
-
80
- resize () {
81
- // to keep button from extending beyond available width
82
- var children = [];
83
- var childrenCount = this.edit_button.children.length;
84
- for(var i = 0; i < childrenCount; i++){
85
- children.push(this.edit_button.children[0]);
86
- this.edit_button.children[0].parentNode.removeChild(this.edit_button.children[0]);
74
+ if(!this.options.container) {
75
+ this.options.container = this.edit_button.parentElement
87
76
  }
88
77
 
89
- this.edit_button.innerHTML = '';
90
- this.edit_button.style.width = "auto";
91
- this.edit_button.style.maxWidth = "100%";
92
- this.edit_button.style.minWidth = this.container.offsetWidth + "px";
78
+ // Set Min-Width for when empty
93
79
 
94
- Helpers.each(children, function(child){
95
- this.edit_button.appendChild(child);
96
- }.bind(this));
97
-
98
- if(typeof this.select_options === "undefined") return;
99
- if(window.innerWidth < 720) return;
100
-
101
- this.select_options.style.position = 'absolute';
102
- this.select_options.style.top = Helpers.offset(this.container).top + this.container.offsetHeight + "px";
103
- this.select_options.style.left = Helpers.offset(this.container).left + 1 + "px";
104
- this.select_options.style.minWidth = this.container.offsetWidth - 1 + "px";
80
+ const option = [...this.el.querySelectorAll("option")].sort((a, b) => {
81
+ return a.textContent.length > b.textContent.length
82
+ }).reverse()[0];
83
+ this.edit_button.querySelector('.text-js').style.opacity = 0;
84
+ this.edit_button.querySelector('.text-js').innerHTML = option.textContent;
85
+ const min_width = this.edit_button.querySelector('.text-js').offsetWidth;
86
+ this.edit_button.style.minWidth = min_width + "px";
87
+ this.edit_button.querySelector('.text-js').innerHTML = "";
88
+ this.edit_button.querySelector('.text-js').style.opacity = null;
89
+
90
+ this.renderSelected();
91
+
92
+ this.listenTo(this.edit_button, 'click', this.showOptions);
93
+ this.listenTo(this.edit_button, 'click', '.uniformSelect-remove', this.removeSelection);
94
+
95
+ return this;
105
96
  }
106
97
 
107
98
  renderOptions () {
108
- this.select_options = Helpers.createElement("<div class='uniformSelect-options'>");
109
- if (this.options.label) {
110
- this.select_options.append(`<div class="uniformSelect-label hide show-sm margin-bottom text-bold">${this.options.label}</div>`)
111
- }
99
+ this.button_options = Helpers.createElement("<div class='uniformSelect-options'>");
112
100
  if (this.el.name) {
113
- Helpers.addClass(this.select_options, this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g, '-'));
101
+ Helpers.addClass(this.button_options, this.el.name.toLowerCase().replace(/[^a-z0-9\-_]+/g, '-'));
114
102
  }
115
- this.select_options.style.fontSize = Helpers.css(this.el, 'font-size');
116
- this.select_options.style.display = 'none';
117
- this.options.container.appendChild(this.select_options);
103
+ this.button_options.style.fontSize = Helpers.css(this.el, 'font-size');
118
104
 
119
105
  Helpers.each(this.el.querySelectorAll('option'), function(el, index){
120
106
  var button = Helpers.createElement("<button type='button' class='uniformSelect-option block outline text-left'>");
@@ -128,16 +114,17 @@ export default class Select extends Component {
128
114
  } else if (this.options.limit && index > this.options.limit) {
129
115
  Helpers.addClass(button, 'hide');
130
116
  }
131
- this.select_options.append(button);
132
- this.listenTo(button, 'click', this.selectOption);
117
+ this.button_options.append(button);
133
118
  }.bind(this));
134
119
 
135
- var actions_el = Helpers.createElement('<div class="uniformSelect-options-actions"></div>');
120
+ this.listenTo(this.button_options, 'click', '.uniformSelect-option', this.selectOption);
121
+
122
+ const actions_el = Helpers.createElement('<div class="uniformSelect-options-actions"></div>');
136
123
  if (this.options.limit && this.el.querySelectorAll('option').length > this.options.limit) {
137
- var show_all_button = Helpers.createElement("<button type='button' class='uniformSelect-show-all outline blue' style='display: block; border: none'>Show All</button>");
124
+ const show_all_button = Helpers.createElement("<button type='button' class='uniformSelect-show-all outline blue' style='display: block; border: none'>Show All</button>");
138
125
  this.listenTo(show_all_button, 'click', function(e){
139
126
  Helpers.trigger(this.el, 'show_all');
140
- if (this.options.showAll) this.options.showAll(this.select_options);
127
+ if (this.options.showAll) this.options.showAll(this.button_options);
141
128
  e.preventDefault();
142
129
  e.stopPropagation();
143
130
  })
@@ -149,104 +136,108 @@ export default class Select extends Component {
149
136
  actions_el.appendChild(done_button);
150
137
  }
151
138
  if (!Helpers.is_empty(actions_el)) {
152
- this.select_options.appendChild(actions_el);
139
+ this.button_options.appendChild(actions_el);
153
140
  }
141
+ }
154
142
 
155
- Helpers.trigger(this.el, 'rendered');
143
+ renderSelected () {
144
+ const selected_options = Helpers.filter(this.el.querySelectorAll("option"), function(el){
145
+ return el.selected;
146
+ });
147
+ const html = Helpers.map(selected_options, function(el){
148
+ return this.el.multiple ? `<span class="uniformSelect-selection">${el.textContent}<span class="uniformSelect-remove"></span></span>` : el.textContent;
149
+ }.bind(this)).join(" ");
150
+
151
+ if (html == "") {
152
+ this.edit_button.querySelector('.text-js').innerHTML = "&nbsp;"
153
+ } else {
154
+ this.edit_button.querySelector('.text-js').innerHTML = html;
155
+ }
156
+
157
+ if(this.button_options) {
158
+ Helpers.each(this.button_options.querySelectorAll('.uniformSelect-option'), function(el) {
159
+ if(el.option.selected){
160
+ Helpers.addClass(el, 'active');
161
+ el.append(this.activeIcon.cloneNode(true));
162
+ } else {
163
+ Helpers.removeClass(el, 'active');
164
+ Helpers.each(el.querySelectorAll('.uniformSelect-option-icon'), Helpers.remove);
165
+ }
166
+ }.bind(this))
167
+ }
156
168
  }
157
169
 
158
170
  hideOptions () {
159
- if(typeof this.select_options === "undefined") return;
160
- this.showing = false;
161
- this.select_options.style.display = "none";
162
- Helpers.removeClass(this.select_options, 'fixed');
171
+ if(!this.button_options) return;
172
+ if(this.button_options_modal) this.button_options_modal.close();
173
+ if(this.button_options_popover) {
174
+ this.button_options_popover.remove();
175
+ delete this.button_options_popover;
176
+ }
163
177
  Helpers.removeClass(this.edit_button, 'active');
164
- Helpers.removeClass(document.body, 'uniformModal-hideBody');
165
-
166
- if(this.lastScrollPosition && window.innerWidth < 720) window.scrollTo(0, this.lastScrollPosition);
167
- Helpers.trigger(this.el, 'hidden:options');
168
178
  }
169
179
 
170
- showOptions() {
171
- if (this.showing){
172
- this.hideOptions();
173
- return false;
174
- }
175
- this.showing = true;
176
- if(!this.select_options) this.renderOptions();
177
- this.resize();
178
- this.select_options.style.display = "block";
180
+ showOptions(e) {
181
+ if(Helpers.hasClass(e.target, 'uniformSelect-remove')) return;
182
+ if(this.button_options_modal) return this.hideOptions();
183
+ if(this.button_options_popover) return this.hideOptions();
184
+ if(!this.button_options) this.renderOptions();
179
185
  Helpers.addClass(this.edit_button, 'active');
180
- this.lastScrollPosition = window.scrollY;
181
- this.updatePosition();
182
- Helpers.addClass(document.body, 'uniformModal-hideBody');
183
- if (this.options.container == document.body) {
184
- Helpers.removeClass(document.body, 'uniformModal-hideBody');
186
+ // For Mobile: Render Full Screen
187
+ if(window.innerWidth < 720) {
188
+ const content = Helpers.createElement('<div class="uniformSelect-modal">');
189
+ content.append(this.button_options);
190
+ if (this.options.label) {
191
+ content.append(`<div class="uniformSelect-label margin-bottom text-bold">${this.options.label}</div>`);
192
+ }
193
+ this.button_options_modal = new Modal({
194
+ content: content,
195
+ klass: '-reset'
196
+ }).render();
197
+ this.button_options_modal.on('closed', () => {
198
+ Helpers.removeClass(this.edit_button, 'active');
199
+ delete this.button_options_modal;
200
+ });
201
+ this.listenTo(content, 'click', function(e){
202
+ if(e.target == content) {
203
+ this.button_options_modal.close()
204
+ }
205
+ });
206
+ // For Larger: Render Popover
207
+ } else {
208
+ this.button_options.style.minWidth = this.edit_button.offsetWidth + "px";
209
+ this.button_options_popover = new Popover({
210
+ offset: {top: 1},
211
+ anchor: this.edit_button,
212
+ align: '0px bottom',
213
+ content: this.button_options,
214
+ container: this.options.container
215
+ }).render()
216
+ this.button_options_popover.on('hidden', () => {
217
+ Helpers.removeClass(this.edit_button, 'active');
218
+ this.button_options_popover.remove();
219
+ delete this.button_options_popover;
220
+ })
185
221
  }
186
222
  }
187
223
 
188
224
  selectOption(e) {
225
+ const button = e.target;
189
226
  if (!this.el.multiple) {
190
- Helpers.each(Helpers.filter(this.el.querySelectorAll("option"), function(el){
191
- return el.selected;
192
- }), function (child) {
193
- child.selected = false;
194
- });
195
- Helpers.each(this.select_options.querySelectorAll('.uniformSelect-option.active .uniformSelect-option-icon'), Helpers.remove);
196
- Helpers.removeClass(this.select_options.querySelectorAll('.uniformSelect-option.active'), 'active');
227
+ Helpers.each(this.button_options.querySelectorAll('.uniformSelect-option.active .uniformSelect-option-icon'), Helpers.remove);
228
+ Helpers.removeClass(this.button_options.querySelectorAll('.uniformSelect-option.active'), 'active');
197
229
  }
198
- Helpers.toggleClass(e.currentTarget, 'active');
199
- e.currentTarget.option.selected = Helpers.hasClass(e.currentTarget, 'active');
200
- this.updateOptions();
201
- Helpers.trigger(this.el, 'change');
202
- }
203
-
204
- updateSelect () {
205
- if (!this.el.multiple) this.hideOptions();
206
- var value = Helpers.map(Helpers.filter(this.el.querySelectorAll("option"), function(el){
207
- return el.selected;
208
- }), function(el){
209
- return this.el.multiple ? `<span class="uniformSelect-selection">${el.textContent}<span class="uniformSelect-remove"></span></span>` : el.textContent;
210
- }.bind(this)).join(" ");
211
-
212
- if (value == "") value = "&nbsp;";
213
- this.edit_button.querySelector('.text-js').innerHTML = value;
214
- }
215
-
216
- updateOptions () {
217
- Helpers.each(this.select_options.querySelectorAll("button"), function(button) {
218
- if(!button.option) return;
219
- Helpers.toggleClass(button, 'active', button.option.selected);
220
- if (Helpers.hasClass(button, 'active')) {
221
- button.append(this.activeIcon.cloneNode(true));
222
- } else {
223
- Helpers.each(button.querySelectorAll('.uniformSelect-option-icon'), Helpers.remove);
224
- }
225
- }.bind(this))
226
- }
227
-
228
- updatePosition () {
229
- if(!this.select_options) return;
230
-
231
- var fixedParents = Helpers.filter(Helpers.ancestors(this.container), function (el){
232
- return Helpers.css(el, 'position') == 'fixed';
233
- });
234
-
235
- if (Helpers.hasClass(this.select_options, 'fixed')) {
236
- if (fixedParents.length == 0) {
237
- this.select_options.style.position = 'absolute';
238
- this.select_options.style.top = Helpers.offset(this.container).top + this.container.offsetHeight + "px";
239
- Helpers.removeClass(this.select_options, 'fixed');
240
- }
241
- } else if(fixedParents.length > 0) {
242
- if (window.innerWidth > 720) {
243
- this.lastScrollPosition = false;
244
- }
245
- this.select_options.style.position = 'fixed';
246
- this.select_options.style.top = Helpers.offset(this.container).top + this.container.offsetHeight + "px";
247
- this.select_options.style.left = Helpers.offset(this.container).left + "px";
248
- Helpers.addClass(this.select_options, 'fixed');
230
+ Helpers.toggleClass(e.target, 'active');
231
+ e.target.option.selected = Helpers.hasClass(e.target, 'active');
232
+ if (Helpers.hasClass(e.target, 'active')) {
233
+ e.target.append(this.activeIcon.cloneNode(true));
234
+ } else {
235
+ Helpers.each(e.target.querySelectorAll('.uniformSelect-option-icon'), Helpers.remove);
249
236
  }
237
+ if (!this.el.multiple) {
238
+ this.hideOptions();
239
+ }
240
+ Helpers.trigger(this.el, 'change');
250
241
  }
251
242
 
252
243
  removeSelection(e) {
@@ -256,7 +247,6 @@ export default class Select extends Component {
256
247
  })[0];
257
248
  if(!target) return;
258
249
  target.selected = false;
259
- this.updatePosition();
260
250
  Helpers.trigger(this.el, 'change');
261
251
  }
262
252
  }
@@ -29,13 +29,22 @@
29
29
  &.-fill{
30
30
  width: 90%;
31
31
  }
32
+ &.-reset{
33
+ margin: -2em;
34
+ max-width: none;
35
+ border-radius: 0;
36
+ &.-fill{
37
+ width: 100%;
38
+ }
39
+ }
32
40
  }
33
41
 
34
42
  .uniformModal-close{
43
+ z-index: 2;
35
44
  position: absolute;
36
45
  padding: 0.3em;
37
- top: -2rem;
38
- right: -2rem;
46
+ top: 0;
47
+ right: 0;
39
48
  font-size:1.5em;
40
49
  color: white;
41
50
  opacity: 0.5;
@@ -8,7 +8,6 @@ select.uniformSelect{
8
8
  text-align: left;
9
9
  padding-right: 1.8em;
10
10
  &.active{
11
- z-index: 10000;
12
11
  .uniformSelect-edit-icon{
13
12
  svg{
14
13
  transform: rotate(180deg);
@@ -76,11 +75,9 @@ select.uniformSelect{
76
75
  }
77
76
 
78
77
  .uniformSelect-options{
79
- @include text-overflow;
80
- position: absolute;
81
- background: white;
82
- z-index: 9999;
78
+
83
79
  box-shadow: 0 0 15px 1px rgba(black, 0.2), 0 0 2px 1px rgba(black, 0.1) ;
80
+ background: white;
84
81
  button{
85
82
  appearance: none;
86
83
  outline: none;
@@ -133,27 +130,18 @@ select.uniformSelect{
133
130
  }
134
131
  }
135
132
 
136
- @include size-rule('sm'){
137
- .uniformSelect-options{
138
- top: 0 !important;
139
- left: 0 !important;
140
- min-height: 100vh;
141
- width: 100vw;
142
- padding: 1em;
143
- button{
144
- margin-bottom: 0.5em;
145
- border: 1px solid color('gray');
146
- &.uniformSelect-done{
147
- margin-bottom: 0;
148
- }
149
- }
150
- .uniformSelect-options-actions{
151
- margin: 0 -1em;
133
+ .uniformSelect-modal{
134
+ width: 100vw;
135
+ min-height: 100vh;
136
+ padding: 1em;
137
+ button{
138
+ margin-bottom: 0.5em;
139
+ border: 1px solid color('gray');
140
+ &.uniformSelect-done{
141
+ margin-bottom: 0;
152
142
  }
153
143
  }
154
- body.uniformModal-hideBody{
155
- & > *:not(.uniformSelect-options):not(.uniformDropdown-dropdown) {
156
- position: fixed;
157
- }
144
+ .uniformSelect-options-actions{
145
+ margin: 0 -1em;
158
146
  }
159
147
  }
@@ -1,3 +1,3 @@
1
1
  module Uniform
2
- VERSION = "2.3.5"
2
+ VERSION = "2.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniform-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ehmke
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -118,7 +118,7 @@ homepage: http://bemky.github.io/uniform/
118
118
  licenses:
119
119
  - MIT
120
120
  metadata: {}
121
- post_install_message:
121
+ post_install_message:
122
122
  rdoc_options: []
123
123
  require_paths:
124
124
  - lib
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubygems_version: 3.1.2
137
- signing_key:
137
+ signing_key:
138
138
  specification_version: 4
139
139
  summary: Sass UI
140
140
  test_files: []