uikit 3.7.4-dev.51f672566 → 3.7.4-dev.54855f777

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/css/uikit-core-rtl.css +24 -24
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +24 -24
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +24 -24
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +24 -24
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +3 -2
  15. package/dist/js/components/lightbox-panel.min.js +2 -2
  16. package/dist/js/components/lightbox.js +3 -2
  17. package/dist/js/components/lightbox.min.js +2 -2
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +3 -2
  33. package/dist/js/components/tooltip.min.js +2 -2
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +184 -22
  37. package/dist/js/uikit-core.min.js +2 -2
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +184 -22
  41. package/dist/js/uikit.min.js +2 -2
  42. package/package.json +1 -1
  43. package/src/js/core/navbar.js +137 -8
  44. package/src/js/core/overflow-auto.js +2 -2
  45. package/src/js/core/switcher.js +3 -1
  46. package/src/js/core/toggle.js +28 -9
  47. package/src/js/mixin/togglable.js +3 -2
  48. package/src/js/util/filter.js +2 -2
  49. package/src/less/components/navbar.less +3 -3
  50. package/src/scss/components/navbar.scss +1 -1
  51. package/src/scss/mixins-theme.scss +2 -2
  52. package/src/scss/mixins.scss +2 -2
  53. package/tests/drop.html +19 -13
  54. package/tests/navbar.html +3 -3
  55. package/tests/switcher.html +7 -1
  56. package/tests/toggle.html +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.7.4-dev.51f672566 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.7.4-dev.54855f777 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -130,13 +130,14 @@
130
130
  isToggled: function(el) {
131
131
  if ( el === void 0 ) el = this.$el;
132
132
 
133
+ el = uikitUtil.toNodes(el)[0];
133
134
  return uikitUtil.hasClass(el, this.clsEnter)
134
135
  ? true
135
136
  : uikitUtil.hasClass(el, this.clsLeave)
136
137
  ? false
137
138
  : this.cls
138
139
  ? uikitUtil.hasClass(el, this.cls.split(' ')[0])
139
- : !uikitUtil.hasAttr(el, 'hidden');
140
+ : uikitUtil.isVisible(el);
140
141
  },
141
142
 
142
143
  _toggle: function(el, toggled) {
@@ -1,3 +1,3 @@
1
- /*! UIkit 3.7.4-dev.51f672566 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.7.4-dev.54855f777 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
- !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("uikit-util")):"function"==typeof define&&define.amd?define("uikittooltip",["uikit-util"],i):(t="undefined"!=typeof globalThis?globalThis:t||self).UIkitTooltip=i(t.UIkit.util)}(this,function(f){"use strict";var t={mixins:[{props:{container:Boolean},data:{container:!0},computed:{container:function(t){t=t.container;return!0===t&&this.$container||t&&f.$(t)}}},{props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation:function(t){return!!t.animation[0]},hasTransition:function(t){t=t.animation;return this.hasAnimation&&!0===t[0]}},methods:{toggleElement:function(i,c,g){var p=this;return new f.Promise(function(t){return f.Promise.all(f.toNodes(i).map(function(t){var i=f.isBoolean(c)?c:!p.isToggled(t);if(!f.trigger(t,"before"+(i?"show":"hide"),[p]))return f.Promise.reject();var s,r,l,a,h,u,d,o=(f.isFunction(g)?g:!1!==g&&p.hasAnimation?p.hasTransition?(r=p.isToggled,l=p.duration,a=p.initProps,h=p.hideProps,u=p.transition,d=p._toggle,function(t,i){var o=f.Transition.inProgress(t),n=t.hasChildNodes?f.toFloat(f.css(t.firstElementChild,"marginTop"))+f.toFloat(f.css(t.lastElementChild,"marginBottom")):0,e=f.isVisible(t)?f.height(t)+(o?0:n):0;f.Transition.cancel(t),r(t)||d(t,!0),f.height(t,""),f.fastdom.flush();n=f.height(t)+(o?0:n);return f.height(t,e),(i?f.Transition.start(t,f.assign({},a,{overflow:"hidden",height:n}),Math.round(l*(1-e/n)),u):f.Transition.start(t,h,Math.round(l*(e/n)),u).then(function(){return d(t,!1)})).then(function(){return f.css(t,a)})}):(s=p,function(t,i){f.Animation.cancel(t);var o=s.animation,n=s.duration,e=s._toggle;return i?(e(t,!0),f.Animation.in(t,o[0],n,s.origin)):f.Animation.out(t,o[1]||o[0],n,s.origin).then(function(){return e(t,!1)})}):p._toggle)(t,i),n=i?p.clsEnter:p.clsLeave;f.addClass(t,n),f.trigger(t,i?"show":"hide",[p]);function e(){f.removeClass(t,n),f.trigger(t,i?"shown":"hidden",[p]),p.$update(t)}return o?o.then(e,function(){return f.removeClass(t,n),f.Promise.reject()}):e()})).then(t,f.noop)})},isToggled:function(t){return void 0===t&&(t=this.$el),!!f.hasClass(t,this.clsEnter)||!f.hasClass(t,this.clsLeave)&&(this.cls?f.hasClass(t,this.cls.split(" ")[0]):!f.hasAttr(t,"hidden"))},_toggle:function(t,i){var o;t&&(i=Boolean(i),this.cls?(o=f.includes(this.cls," ")||i!==f.hasClass(t,this.cls))&&f.toggleClass(t,this.cls,f.includes(this.cls," ")?void 0:i):(o=i===t.hidden)&&(t.hidden=!i),f.$$("[autofocus]",t).some(function(t){return f.isVisible(t)?t.focus()||!0:t.blur()}),o&&(f.trigger(t,"toggled",[i,this]),this.$update(t)))}}},{props:{pos:String,offset:null,flip:Boolean,clsPos:String},data:{pos:"bottom-"+(f.isRtl?"right":"left"),flip:!0,offset:!1,clsPos:""},computed:{pos:function(t){t=t.pos;return(t+(f.includes(t,"-")?"":"-center")).split("-")},dir:function(){return this.pos[0]},align:function(){return this.pos[1]}},methods:{positionAt:function(t,i,o){f.removeClasses(t,this.clsPos+"-(top|bottom|left|right)(-[a-z]+)?");var n,e=this.offset,s=this.getAxis();f.isNumeric(e)||(e=(n=f.$(e))?f.offset(n)["x"===s?"left":"top"]-f.offset(i)["x"===s?"right":"bottom"]:0);e=f.positionAt(t,i,"x"===s?f.flipPosition(this.dir)+" "+this.align:this.align+" "+f.flipPosition(this.dir),"x"===s?this.dir+" "+this.align:this.align+" "+this.dir,"x"===s?""+("left"===this.dir?-e:e):" "+("top"===this.dir?-e:e),null,this.flip,o).target,o=e.x,e=e.y;this.dir="x"===s?o:e,this.align="x"===s?e:o,f.toggleClass(t,this.clsPos+"-"+this.dir+"-"+this.align,!1===this.offset)},getAxis:function(){return"top"===this.dir||"bottom"===this.dir?"y":"x"}}}],args:"title",props:{delay:Number,title:String},data:{pos:"top",title:"",delay:0,animation:["uk-animation-scale-up"],duration:100,cls:"uk-active",clsPos:"uk-tooltip"},beforeConnect:function(){var t;this._hasTitle=f.hasAttr(this.$el,"title"),f.attr(this.$el,"title",""),this.updateAria(!1),t=this.$el,f.isFocusable(t)||f.attr(t,"tabindex","0")},disconnected:function(){this.hide(),f.attr(this.$el,"title",this._hasTitle?this.title:null)},methods:{show:function(){var i=this;!this.isToggled(this.tooltip||null)&&this.title&&(this._unbind=f.once(document,"show keydown "+f.pointerDown,this.hide,!1,function(t){return t.type===f.pointerDown&&!f.within(t.target,i.$el)||"keydown"===t.type&&27===t.keyCode||"show"===t.type&&t.detail[0]!==i&&t.detail[0].$name===i.$name}),clearTimeout(this.showTimer),this.showTimer=setTimeout(this._show,this.delay))},hide:function(){var t=this;f.matches(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&this.toggleElement(this.tooltip,!1,!1).then(function(){t.tooltip=f.remove(t.tooltip),t._unbind()}))},_show:function(){var o=this;this.tooltip=f.append(this.container,'<div class="'+this.clsPos+'"> <div class="'+this.clsPos+'-inner">'+this.title+"</div> </div>"),f.on(this.tooltip,"toggled",function(t,i){o.updateAria(i),i&&(o.positionAt(o.tooltip,o.$el),o.origin="y"===o.getAxis()?f.flipPosition(o.dir)+"-"+o.align:o.align+"-"+f.flipPosition(o.dir))}),this.toggleElement(this.tooltip,!0)},updateAria:function(t){f.attr(this.$el,"aria-expanded",t)}},events:((t={focus:"show",blur:"hide"})[f.pointerEnter+" "+f.pointerLeave]=function(t){f.isTouch(t)||this[t.type===f.pointerEnter?"show":"hide"]()},t[f.pointerDown]=function(t){f.isTouch(t)&&this.show()},t)};return"undefined"!=typeof window&&window.UIkit&&window.UIkit.component("tooltip",t),t});
3
+ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("uikit-util")):"function"==typeof define&&define.amd?define("uikittooltip",["uikit-util"],i):(t="undefined"!=typeof globalThis?globalThis:t||self).UIkitTooltip=i(t.UIkit.util)}(this,function(f){"use strict";var t={mixins:[{props:{container:Boolean},data:{container:!0},computed:{container:function(t){t=t.container;return!0===t&&this.$container||t&&f.$(t)}}},{props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",clsEnter:"uk-togglabe-enter",clsLeave:"uk-togglabe-leave",initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation:function(t){return!!t.animation[0]},hasTransition:function(t){t=t.animation;return this.hasAnimation&&!0===t[0]}},methods:{toggleElement:function(i,c,g){var p=this;return new f.Promise(function(t){return f.Promise.all(f.toNodes(i).map(function(t){var i=f.isBoolean(c)?c:!p.isToggled(t);if(!f.trigger(t,"before"+(i?"show":"hide"),[p]))return f.Promise.reject();var s,r,l,a,h,u,d,o=(f.isFunction(g)?g:!1!==g&&p.hasAnimation?p.hasTransition?(r=p.isToggled,l=p.duration,a=p.initProps,h=p.hideProps,u=p.transition,d=p._toggle,function(t,i){var o=f.Transition.inProgress(t),n=t.hasChildNodes?f.toFloat(f.css(t.firstElementChild,"marginTop"))+f.toFloat(f.css(t.lastElementChild,"marginBottom")):0,e=f.isVisible(t)?f.height(t)+(o?0:n):0;f.Transition.cancel(t),r(t)||d(t,!0),f.height(t,""),f.fastdom.flush();n=f.height(t)+(o?0:n);return f.height(t,e),(i?f.Transition.start(t,f.assign({},a,{overflow:"hidden",height:n}),Math.round(l*(1-e/n)),u):f.Transition.start(t,h,Math.round(l*(e/n)),u).then(function(){return d(t,!1)})).then(function(){return f.css(t,a)})}):(s=p,function(t,i){f.Animation.cancel(t);var o=s.animation,n=s.duration,e=s._toggle;return i?(e(t,!0),f.Animation.in(t,o[0],n,s.origin)):f.Animation.out(t,o[1]||o[0],n,s.origin).then(function(){return e(t,!1)})}):p._toggle)(t,i),n=i?p.clsEnter:p.clsLeave;f.addClass(t,n),f.trigger(t,i?"show":"hide",[p]);function e(){f.removeClass(t,n),f.trigger(t,i?"shown":"hidden",[p]),p.$update(t)}return o?o.then(e,function(){return f.removeClass(t,n),f.Promise.reject()}):e()})).then(t,f.noop)})},isToggled:function(t){return void 0===t&&(t=this.$el),t=f.toNodes(t)[0],!!f.hasClass(t,this.clsEnter)||!f.hasClass(t,this.clsLeave)&&(this.cls?f.hasClass(t,this.cls.split(" ")[0]):f.isVisible(t))},_toggle:function(t,i){var o;t&&(i=Boolean(i),this.cls?(o=f.includes(this.cls," ")||i!==f.hasClass(t,this.cls))&&f.toggleClass(t,this.cls,f.includes(this.cls," ")?void 0:i):(o=i===t.hidden)&&(t.hidden=!i),f.$$("[autofocus]",t).some(function(t){return f.isVisible(t)?t.focus()||!0:t.blur()}),o&&(f.trigger(t,"toggled",[i,this]),this.$update(t)))}}},{props:{pos:String,offset:null,flip:Boolean,clsPos:String},data:{pos:"bottom-"+(f.isRtl?"right":"left"),flip:!0,offset:!1,clsPos:""},computed:{pos:function(t){t=t.pos;return(t+(f.includes(t,"-")?"":"-center")).split("-")},dir:function(){return this.pos[0]},align:function(){return this.pos[1]}},methods:{positionAt:function(t,i,o){f.removeClasses(t,this.clsPos+"-(top|bottom|left|right)(-[a-z]+)?");var n,e=this.offset,s=this.getAxis();f.isNumeric(e)||(e=(n=f.$(e))?f.offset(n)["x"===s?"left":"top"]-f.offset(i)["x"===s?"right":"bottom"]:0);e=f.positionAt(t,i,"x"===s?f.flipPosition(this.dir)+" "+this.align:this.align+" "+f.flipPosition(this.dir),"x"===s?this.dir+" "+this.align:this.align+" "+this.dir,"x"===s?""+("left"===this.dir?-e:e):" "+("top"===this.dir?-e:e),null,this.flip,o).target,o=e.x,e=e.y;this.dir="x"===s?o:e,this.align="x"===s?e:o,f.toggleClass(t,this.clsPos+"-"+this.dir+"-"+this.align,!1===this.offset)},getAxis:function(){return"top"===this.dir||"bottom"===this.dir?"y":"x"}}}],args:"title",props:{delay:Number,title:String},data:{pos:"top",title:"",delay:0,animation:["uk-animation-scale-up"],duration:100,cls:"uk-active",clsPos:"uk-tooltip"},beforeConnect:function(){var t;this._hasTitle=f.hasAttr(this.$el,"title"),f.attr(this.$el,"title",""),this.updateAria(!1),t=this.$el,f.isFocusable(t)||f.attr(t,"tabindex","0")},disconnected:function(){this.hide(),f.attr(this.$el,"title",this._hasTitle?this.title:null)},methods:{show:function(){var i=this;!this.isToggled(this.tooltip||null)&&this.title&&(this._unbind=f.once(document,"show keydown "+f.pointerDown,this.hide,!1,function(t){return t.type===f.pointerDown&&!f.within(t.target,i.$el)||"keydown"===t.type&&27===t.keyCode||"show"===t.type&&t.detail[0]!==i&&t.detail[0].$name===i.$name}),clearTimeout(this.showTimer),this.showTimer=setTimeout(this._show,this.delay))},hide:function(){var t=this;f.matches(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&this.toggleElement(this.tooltip,!1,!1).then(function(){t.tooltip=f.remove(t.tooltip),t._unbind()}))},_show:function(){var o=this;this.tooltip=f.append(this.container,'<div class="'+this.clsPos+'"> <div class="'+this.clsPos+'-inner">'+this.title+"</div> </div>"),f.on(this.tooltip,"toggled",function(t,i){o.updateAria(i),i&&(o.positionAt(o.tooltip,o.$el),o.origin="y"===o.getAxis()?f.flipPosition(o.dir)+"-"+o.align:o.align+"-"+f.flipPosition(o.dir))}),this.toggleElement(this.tooltip,!0)},updateAria:function(t){f.attr(this.$el,"aria-expanded",t)}},events:((t={focus:"show",blur:"hide"})[f.pointerEnter+" "+f.pointerLeave]=function(t){f.isTouch(t)||this[t.type===f.pointerEnter?"show":"hide"]()},t[f.pointerDown]=function(t){f.isTouch(t)&&this.show()},t)};return"undefined"!=typeof window&&window.UIkit&&window.UIkit.component("tooltip",t),t});
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.7.4-dev.51f672566 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.7.4-dev.54855f777 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -1,3 +1,3 @@
1
- /*! UIkit 3.7.4-dev.51f672566 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.7.4-dev.54855f777 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
3
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("uikit-util")):"function"==typeof define&&define.amd?define("uikitupload",["uikit-util"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).UIkitUpload=t(e.UIkit.util)}(this,function(a){"use strict";var e={props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,msgInvalidMime:String,msgInvalidName:String,msgInvalidSize:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,msgInvalidMime:"Invalid File Type: %s",msgInvalidName:"Invalid File Name: %s",msgInvalidSize:"Invalid File Size: %s Kilobytes Max",multiple:!1,name:"files[]",params:{},type:"",url:"",abort:a.noop,beforeAll:a.noop,beforeSend:a.noop,complete:a.noop,completeAll:a.noop,error:a.noop,fail:a.noop,load:a.noop,loadEnd:a.noop,loadStart:a.noop,progress:a.noop},events:{change:function(e){a.matches(e.target,'input[type="file"]')&&(e.preventDefault(),e.target.files&&this.upload(e.target.files),e.target.value="")},drop:function(e){t(e);e=e.dataTransfer;e&&e.files&&(a.removeClass(this.$el,this.clsDragover),this.upload(e.files))},dragenter:function(e){t(e)},dragover:function(e){t(e),a.addClass(this.$el,this.clsDragover)},dragleave:function(e){t(e),a.removeClass(this.$el,this.clsDragover)}},methods:{upload:function(e){var o=this;if(e.length){a.trigger(this.$el,"upload",[e]);for(var t=0;t<e.length;t++){if(this.maxSize&&1e3*this.maxSize<e[t].size)return void this.fail(this.msgInvalidSize.replace("%s",this.maxSize));if(this.allow&&!i(this.allow,e[t].name))return void this.fail(this.msgInvalidName.replace("%s",this.allow));if(this.mime&&!i(this.mime,e[t].type))return void this.fail(this.msgInvalidMime.replace("%s",this.mime))}this.multiple||(e=[e[0]]),this.beforeAll(this,e);var n=function(e,t){for(var i=[],o=0;o<e.length;o+=t){for(var n=[],r=0;r<t;r++)n.push(e[o+r]);i.push(n)}return i}(e,this.concurrent),r=function(e){var t,i=new FormData;for(t in e.forEach(function(e){return i.append(o.name,e)}),o.params)i.append(t,o.params[t]);a.ajax(o.url,{data:i,method:o.method,responseType:o.type,beforeSend:function(e){var t=e.xhr;return t.upload&&a.on(t.upload,"progress",o.progress),["loadStart","load","loadEnd","abort"].forEach(function(e){return a.on(t,e.toLowerCase(),o[e])}),o.beforeSend(e)}}).then(function(e){o.complete(e),n.length?r(n.shift()):o.completeAll(e)},function(e){return o.error(e)})};r(n.shift())}}}};function i(e,t){return t.match(new RegExp("^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$","i"))}function t(e){e.preventDefault(),e.stopPropagation()}return"undefined"!=typeof window&&window.UIkit&&window.UIkit.component("upload",e),e});
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.7.4-dev.51f672566 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.7.4-dev.54855f777 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -463,8 +463,9 @@
463
463
  return toNodes(element).some(function (element) { return matches(element, selInput); });
464
464
  }
465
465
 
466
+ var selFocusable = selInput + ",a[href],[tabindex]";
466
467
  function isFocusable(element) {
467
- return isInput(element) || matches(element, 'a[href],button') || hasAttr(element, 'tabindex');
468
+ return matches(element, selFocusable);
468
469
  }
469
470
 
470
471
  function parent(element) {
@@ -2574,6 +2575,7 @@
2574
2575
  isVisible: isVisible,
2575
2576
  selInput: selInput,
2576
2577
  isInput: isInput,
2578
+ selFocusable: selFocusable,
2577
2579
  isFocusable: isFocusable,
2578
2580
  parent: parent,
2579
2581
  filter: filter,
@@ -3444,7 +3446,7 @@
3444
3446
  UIkit.data = '__uikit__';
3445
3447
  UIkit.prefix = 'uk-';
3446
3448
  UIkit.options = {};
3447
- UIkit.version = '3.7.4-dev.51f672566';
3449
+ UIkit.version = '3.7.4-dev.54855f777';
3448
3450
 
3449
3451
  globalAPI(UIkit);
3450
3452
  hooksAPI(UIkit);
@@ -3726,13 +3728,14 @@
3726
3728
  isToggled: function(el) {
3727
3729
  if ( el === void 0 ) el = this.$el;
3728
3730
 
3731
+ el = toNodes(el)[0];
3729
3732
  return hasClass(el, this.clsEnter)
3730
3733
  ? true
3731
3734
  : hasClass(el, this.clsLeave)
3732
3735
  ? false
3733
3736
  : this.cls
3734
3737
  ? hasClass(el, this.cls.split(' ')[0])
3735
- : !hasAttr(el, 'hidden');
3738
+ : isVisible(el);
3736
3739
  },
3737
3740
 
3738
3741
  _toggle: function(el, toggled) {
@@ -6571,7 +6574,7 @@
6571
6574
  var boundary = ref.boundary;
6572
6575
  var boundaryAlign = ref.boundaryAlign;
6573
6576
 
6574
- return (boundary === true || boundaryAlign) ? $el : boundary;
6577
+ return boundary === true || boundaryAlign ? $el : boundary;
6575
6578
  },
6576
6579
 
6577
6580
  dropbarAnchor: function(ref, $el) {
@@ -6617,12 +6620,18 @@
6617
6620
  dropdowns: {
6618
6621
 
6619
6622
  get: function(ref, $el) {
6623
+ var this$1 = this;
6620
6624
  var clsDrop = ref.clsDrop;
6621
6625
 
6622
6626
  var dropdowns = $$(("." + clsDrop), $el);
6623
6627
 
6624
- if (this.container !== $el) {
6625
- $$(("." + clsDrop), this.container).forEach(function (el) { return !includes(dropdowns, el) && dropdowns.push(el); });
6628
+ if (this.dropContainer !== $el) {
6629
+ $$(("." + clsDrop), this.dropContainer).forEach(function (el) {
6630
+ var dropdown = this$1.getDropdown(el);
6631
+ if (!includes(dropdowns, el) && dropdown && dropdown.target && within(dropdown.target, this$1.$el)) {
6632
+ dropdowns.push(el);
6633
+ }
6634
+ });
6626
6635
  }
6627
6636
 
6628
6637
  return dropdowns;
@@ -6640,6 +6649,12 @@
6640
6649
 
6641
6650
  immediate: true
6642
6651
 
6652
+ },
6653
+
6654
+ toggles: function(ref, $el) {
6655
+ var dropdown = ref.dropdown;
6656
+
6657
+ return $$(dropdown, $el);
6643
6658
  }
6644
6659
 
6645
6660
  },
@@ -6652,7 +6667,7 @@
6652
6667
  events: [
6653
6668
 
6654
6669
  {
6655
- name: 'mouseover',
6670
+ name: 'mouseover focusin',
6656
6671
 
6657
6672
  delegate: function() {
6658
6673
  return this.dropdown;
@@ -6662,13 +6677,93 @@
6662
6677
  var current = ref.current;
6663
6678
 
6664
6679
  var active = this.getActive();
6665
- if (active && active.target && !within(active.target, current) && !active.tracker.movesTo(active.$el)) {
6680
+ if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.tracker.movesTo(active.$el)) {
6666
6681
  active.hide(false);
6667
6682
  }
6668
6683
  }
6669
6684
 
6670
6685
  },
6671
6686
 
6687
+ {
6688
+ name: 'keydown',
6689
+
6690
+ delegate: function() {
6691
+ return this.dropdown;
6692
+ },
6693
+
6694
+ handler: function(e) {
6695
+
6696
+ var current = e.current;
6697
+ var keyCode = e.keyCode;
6698
+ var active = this.getActive();
6699
+
6700
+ if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
6701
+
6702
+ e.preventDefault();
6703
+
6704
+ if (!active || active.target !== current) {
6705
+ current.click();
6706
+ once(this.dropContainer, 'show', function (ref) {
6707
+ var target = ref.target;
6708
+
6709
+ return focusFirstFocusableElement(target);
6710
+ });
6711
+ } else {
6712
+ focusFirstFocusableElement(active.$el);
6713
+ }
6714
+
6715
+ }
6716
+
6717
+ handleNavItemNavigation(e, this.toggles, active);
6718
+ }
6719
+ },
6720
+
6721
+ {
6722
+ name: 'keydown',
6723
+
6724
+ el: function() {
6725
+ return this.dropContainer;
6726
+ },
6727
+
6728
+ delegate: function() {
6729
+ return ("." + (this.clsDrop));
6730
+ },
6731
+
6732
+ handler: function(e) {
6733
+
6734
+ var current = e.current;
6735
+ var keyCode = e.keyCode;
6736
+
6737
+ if (!includes(this.dropdowns, current)) {
6738
+ return;
6739
+ }
6740
+
6741
+ var active = this.getActive();
6742
+ var elements = $$(selFocusable, current);
6743
+ var i = findIndex(elements, function (el) { return matches(el, ':focus'); });
6744
+
6745
+ if (keyCode === keyMap.UP) {
6746
+ e.preventDefault();
6747
+ if (i > 0) {
6748
+ elements[i - 1].focus();
6749
+ }
6750
+ }
6751
+
6752
+ if (keyCode === keyMap.DOWN) {
6753
+ e.preventDefault();
6754
+ if (i < elements.length - 1) {
6755
+ elements[i + 1].focus();
6756
+ }
6757
+ }
6758
+
6759
+ if (keyCode === keyMap.ESC) {
6760
+ active && active.target && active.target.focus();
6761
+ }
6762
+
6763
+ handleNavItemNavigation(e, this.toggles, active);
6764
+ }
6765
+ },
6766
+
6672
6767
  {
6673
6768
  name: 'mouseleave',
6674
6769
 
@@ -6676,10 +6771,14 @@
6676
6771
  return this.dropbar;
6677
6772
  },
6678
6773
 
6774
+ filter: function() {
6775
+ return this.dropbar;
6776
+ },
6777
+
6679
6778
  handler: function() {
6680
6779
  var active = this.getActive();
6681
6780
 
6682
- if (active && !this.dropdowns.some(function (el) { return matches(el, ':hover'); })) {
6781
+ if (active && includes(active.mode, 'hover') && !this.dropdowns.some(function (el) { return matches(el, ':hover'); })) {
6683
6782
  active.hide();
6684
6783
  }
6685
6784
  }
@@ -6790,7 +6889,7 @@
6790
6889
  methods: {
6791
6890
 
6792
6891
  getActive: function() {
6793
- return active$1 && includes(active$1.mode, 'hover') && within(active$1.target, this.$el) && active$1;
6892
+ return active$1 && within(active$1.target, this.$el) && active$1;
6794
6893
  },
6795
6894
 
6796
6895
  transitionTo: function(newHeight, el) {
@@ -6827,6 +6926,49 @@
6827
6926
 
6828
6927
  };
6829
6928
 
6929
+ function handleNavItemNavigation(e, toggles, active) {
6930
+
6931
+ var current = e.current;
6932
+ var keyCode = e.keyCode;
6933
+ var target = active && active.target || current;
6934
+ var i = toggles.indexOf(target);
6935
+
6936
+ // Left
6937
+ if (keyCode === keyMap.LEFT && i > 0) {
6938
+ active && active.hide(false);
6939
+ toggles[i - 1].focus();
6940
+ }
6941
+
6942
+ // Right
6943
+ if (keyCode === keyMap.RIGHT && i < toggles.length - 1) {
6944
+ active && active.hide(false);
6945
+ toggles[i + 1].focus();
6946
+ }
6947
+
6948
+ if (keyCode === keyMap.TAB) {
6949
+ target.focus();
6950
+ active && active.hide(false);
6951
+ }
6952
+ }
6953
+
6954
+ function focusFirstFocusableElement(el) {
6955
+ if (!$(':focus', el)) {
6956
+ var focusEl = $(selFocusable, el);
6957
+ if (focusEl) {
6958
+ focusEl.focus();
6959
+ }
6960
+ }
6961
+ }
6962
+
6963
+ var keyMap = {
6964
+ TAB: 9,
6965
+ ESC: 27,
6966
+ LEFT: 37,
6967
+ UP: 38,
6968
+ RIGHT: 39,
6969
+ DOWN: 40
6970
+ };
6971
+
6830
6972
  var offcanvas = {
6831
6973
 
6832
6974
  mixins: [Modal],
@@ -7101,13 +7243,13 @@
7101
7243
  props: {
7102
7244
  selContainer: String,
7103
7245
  selContent: String,
7104
- minHeight: Number,
7246
+ minHeight: Number
7105
7247
  },
7106
7248
 
7107
7249
  data: {
7108
7250
  selContainer: '.uk-modal',
7109
7251
  selContent: '.uk-modal-dialog',
7110
- minHeight: 150,
7252
+ minHeight: 150
7111
7253
  },
7112
7254
 
7113
7255
  computed: {
@@ -7857,6 +7999,7 @@
7857
7999
  props: {
7858
8000
  connect: String,
7859
8001
  toggle: String,
8002
+ itemNav: String,
7860
8003
  active: Number,
7861
8004
  swiping: Boolean
7862
8005
  },
@@ -7864,6 +8007,7 @@
7864
8007
  data: {
7865
8008
  connect: '~.uk-switcher',
7866
8009
  toggle: '> * > :first-child',
8010
+ itemNav: false,
7867
8011
  active: 0,
7868
8012
  swiping: true,
7869
8013
  cls: 'uk-active',
@@ -7945,7 +8089,7 @@
7945
8089
  name: 'click',
7946
8090
 
7947
8091
  el: function() {
7948
- return this.connects;
8092
+ return this.connects.concat(this.itemNav ? queryAll(this.itemNav, this.$el) : []);
7949
8093
  },
7950
8094
 
7951
8095
  delegate: function() {
@@ -8123,19 +8267,37 @@
8123
8267
  handler: function(e) {
8124
8268
  if (!isTouch(e) && !this._isTouch) {
8125
8269
 
8126
- var isPointerEvent = includes(['pointerleave', 'pointerenter'], e.type);
8127
- if (!isPointerEvent && matches(this.$el, ':hover')
8128
- || isPointerEvent && matches(this.$el, ':focus')
8270
+ var show = includes([pointerEnter, 'focus'], e.type);
8271
+
8272
+ if (e.type === 'blur' && matches(this.$el, ':hover')
8273
+ || e.type === pointerLeave && matches(this.$el, ':focus')
8274
+ || show && attr(this.$el, 'aria-expanded') === 'true'
8129
8275
  ) {
8130
8276
  return;
8131
8277
  }
8132
8278
 
8133
- this.toggle(("toggle" + (includes([pointerEnter, 'focus'], e.type) ? 'show' : 'hide')));
8279
+ this.toggle(("toggle" + (show ? 'show' : 'hide')));
8134
8280
  }
8135
8281
  }
8136
8282
 
8137
8283
  },
8138
8284
 
8285
+ {
8286
+ name: 'keydown',
8287
+
8288
+ filter: function() {
8289
+ return includes(this.mode, 'click');
8290
+ },
8291
+
8292
+ handler: function(e) {
8293
+ // Space
8294
+ if (e.keyCode === 32) {
8295
+ e.preventDefault();
8296
+ this.$el.click();
8297
+ }
8298
+ }
8299
+ },
8300
+
8139
8301
  {
8140
8302
 
8141
8303
  name: 'click',
@@ -8172,7 +8334,9 @@
8172
8334
  },
8173
8335
 
8174
8336
  handler: function(e, toggled) {
8175
- this.updateAria(toggled);
8337
+ if (e.target === this.target[0]) {
8338
+ this.updateAria(toggled);
8339
+ }
8176
8340
  }
8177
8341
  }
8178
8342
 
@@ -8235,9 +8399,7 @@
8235
8399
  updateAria: function(toggled) {
8236
8400
  attr(this.$el, 'aria-expanded', isBoolean(toggled)
8237
8401
  ? toggled
8238
- : this.cls
8239
- ? hasClass(this.target[0], this.cls.split(' ')[0])
8240
- : isVisible(this.target[0])
8402
+ : this.isToggled(this.target)
8241
8403
  );
8242
8404
  }
8243
8405