');
+ addClass(this.panel.parentNode, this.clsMode);
+ }
+
+ css(document.documentElement, 'overflowY', (!this.clsContentAnimation || this.flip) && this.scrollbarWidth && this.overlay ? 'scroll' : '');
+ addClass(document.body, this.clsContainer, this.clsFlip, this.clsOverlay);
+ height(document.body); // force reflow
+ addClass(this.content, this.clsContentAnimation);
+ addClass(this.panel, this.clsSidebarAnimation, this.mode !== 'reveal' ? this.clsMode : '');
+ addClass(this.$el, this.clsOverlay);
+ css(this.$el, 'display', 'block');
+ height(this.$el); // force reflow
+
+ }
+ },
+
+ {
+ name: 'hide',
+
+ self: true,
+
+ handler: function() {
+ removeClass(this.content, this.clsContentAnimation);
+
+ var active = this.getActive();
+ if (this.mode === 'none' || active && active !== this && active !== this.prev) {
+ trigger(this.panel, 'transitionend');
+ }
+ }
+ },
+
+ {
+ name: 'hidden',
+
+ self: true,
+
+ handler: function() {
+
+ if (this.mode === 'reveal') {
+ unwrap(this.panel);
+ }
+
+ if (!this.overlay) {
+ scroll = {x: window.pageXOffset, y: window.pageYOffset};
+ } else if (!scroll) {
+ var ref = this.content;
+ var x = ref.scrollLeft;
+ var y = ref.scrollTop;
+ scroll = {x: x, y: y};
+ }
+
+ removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
+ removeClass(this.$el, this.clsOverlay);
+ css(this.$el, 'display', '');
+ removeClass(document.body, this.clsContainer, this.clsFlip, this.clsOverlay);
+ document.body.scrollTop = scroll.y;
+
+ css(document.documentElement, 'overflowY', '');
+
+ width(this.content, '');
+ height(this.content, '');
+
+ window.scroll(scroll.x, scroll.y);
+
+ scroll = null;
+
+ }
+ },
+
+ {
+ name: 'swipeLeft swipeRight',
+
+ handler: function(e) {
+
+ if (this.isToggled() && isTouch(e) && (e.type === 'swipeLeft' && !this.flip || e.type === 'swipeRight' && this.flip)) {
+ this.hide();
+ }
+
+ }
+ }
+
+ ]
+
+ };
+
+ var OverflowAuto = {
+
+ mixins: [Class],
+
+ props: {
+ selContainer: String,
+ selContent: String,
+ },
+
+ data: {
+ selContainer: '.uk-modal',
+ selContent: '.uk-modal-dialog',
+ },
+
+ computed: {
+
+ container: function(ref, $el) {
+ var selContainer = ref.selContainer;
+
+ return closest($el, selContainer);
+ },
+
+ content: function(ref, $el) {
+ var selContent = ref.selContent;
+
+ return closest($el, selContent);
+ }
+
+ },
+
+ connected: function() {
+ css(this.$el, 'minHeight', 150);
+ },
+
+ update: {
+
+ read: function() {
+
+ if (!this.content || !this.container) {
+ return false;
+ }
+
+ return {
+ current: toFloat(css(this.$el, 'maxHeight')),
+ max: Math.max(150, height(this.container) - (offset(this.content).height - height(this.$el)))
+ };
+ },
+
+ write: function(ref) {
+ var current = ref.current;
+ var max = ref.max;
+
+ css(this.$el, 'maxHeight', max);
+ if (Math.round(current) !== Math.round(max)) {
+ trigger(this.$el, 'resize');
+ }
+ },
+
+ events: ['load', 'resize']
+
+ }
+
+ };
+
+ var Responsive = {
+
+ props: ['width', 'height'],
+
+ connected: function() {
+ addClass(this.$el, 'uk-responsive-width');
+ },
+
+ update: {
+
+ read: function() {
+ return isVisible(this.$el) && this.width && this.height
+ ? {width: width(this.$el.parentNode), height: this.height}
+ : false;
+ },
+
+ write: function(dim) {
+ height(this.$el, Dimensions.contain({height: this.height, width: this.width}, dim).height);
+ },
+
+ events: ['load', 'resize']
+
+ }
+
+ };
+
+ var Scroll = {
+
+ props: {
+ duration: Number,
+ offset: Number
+ },
+
+ data: {
+ duration: 1000,
+ offset: 0
+ },
+
+ methods: {
+
+ scrollTo: function(el) {
+ var this$1 = this;
+
+
+ el = el && $(el) || document.body;
+
+ var docHeight = height(document);
+ var winHeight = height(window);
+
+ var target = offset(el).top - this.offset;
+ if (target + winHeight > docHeight) {
+ target = docHeight - winHeight;
+ }
+
+ if (!trigger(this.$el, 'beforescroll', [this, el])) {
+ return;
+ }
+
+ var start = Date.now();
+ var startY = window.pageYOffset;
+ var step = function () {
+
+ var currentY = startY + (target - startY) * ease(clamp((Date.now() - start) / this$1.duration));
+
+ scrollTop(window, currentY);
+
+ // scroll more if we have not reached our destination
+ if (currentY !== target) {
+ requestAnimationFrame(step);
+ } else {
+ trigger(this$1.$el, 'scrolled', [this$1, el]);
+ }
+
+ };
+
+ step();
+
+ }
+
+ },
+
+ events: {
+
+ click: function(e) {
+
+ if (e.defaultPrevented) {
+ return;
+ }
+
+ e.preventDefault();
+ this.scrollTo(escape(this.$el.hash).substr(1));
+ }
+
+ }
+
+ };
+
+ function ease(k) {
+ return 0.5 * (1 - Math.cos(Math.PI * k));
+ }
+
+ var Scrollspy = {
+
+ args: 'cls',
+
+ props: {
+ cls: 'list',
+ target: String,
+ hidden: Boolean,
+ offsetTop: Number,
+ offsetLeft: Number,
+ repeat: Boolean,
+ delay: Number
+ },
+
+ data: function () { return ({
+ cls: [],
+ target: false,
+ hidden: true,
+ offsetTop: 0,
+ offsetLeft: 0,
+ repeat: false,
+ delay: 0,
+ inViewClass: 'uk-scrollspy-inview'
+ }); },
+
+ computed: {
+
+ elements: function(ref, $el) {
+ var target = ref.target;
+
+ return target ? $$(target, $el) : [$el];
+ }
+
+ },
+
+ update: [
+
+ {
+
+ write: function() {
+ if (this.hidden) {
+ css(filter(this.elements, (":not(." + (this.inViewClass) + ")")), 'visibility', 'hidden');
+ }
+ }
+
+ },
+
+ {
+
+ read: function(els) {
+ var this$1 = this;
+
+
+ if (!els.delay) {
+ return;
+ }
+
+ this.elements.forEach(function (el, i) {
+
+ var elData = els[i];
+
+ if (!elData || elData.el !== el) {
+ var cls = data(el, 'uk-scrollspy-class');
+ elData = {el: el, toggles: cls && cls.split(',') || this$1.cls};
+ }
+
+ elData.show = isInView(el, this$1.offsetTop, this$1.offsetLeft);
+ els[i] = elData;
+
+ });
+
+ },
+
+ write: function(els) {
+ var this$1 = this;
+
+
+ // Let child components be applied at least once first
+ if (!els.delay) {
+ this.$emit();
+ return els.delay = true;
+ }
+
+ this.elements.forEach(function (el, i) {
+
+ var elData = els[i];
+ var cls = elData.toggles[i] || elData.toggles[0];
+
+ if (elData.show && !elData.inview && !elData.queued) {
+
+ var show = function () {
+
+ css(el, 'visibility', '');
+ addClass(el, this$1.inViewClass);
+ toggleClass(el, cls);
+
+ trigger(el, 'inview');
+
+ this$1.$update(el);
+
+ elData.inview = true;
+ elData.abort && elData.abort();
+ };
+
+ if (this$1.delay) {
+
+ elData.queued = true;
+ els.promise = (els.promise || Promise.resolve()).then(function () {
+ return !elData.inview && new Promise(function (resolve) {
+
+ var timer = setTimeout(function () {
+
+ show();
+ resolve();
+
+ }, els.promise || this$1.elements.length === 1 ? this$1.delay : 0);
+
+ elData.abort = function () {
+ clearTimeout(timer);
+ resolve();
+ elData.queued = false;
+ };
+
+ });
+
+ });
+
+ } else {
+ show();
+ }
+
+ } else if (!elData.show && (elData.inview || elData.queued) && this$1.repeat) {
+
+ elData.abort && elData.abort();
+
+ if (!elData.inview) {
+ return;
+ }
+
+ css(el, 'visibility', this$1.hidden ? 'hidden' : '');
+ removeClass(el, this$1.inViewClass);
+ toggleClass(el, cls);
+
+ trigger(el, 'outview');
+
+ this$1.$update(el);
+
+ elData.inview = false;
+
+ }
+
+
+ });
+
+ },
+
+ events: ['scroll', 'load', 'resize']
+
+ }
+
+ ]
+
+ };
+
+ var ScrollspyNav = {
+
+ props: {
+ cls: String,
+ closest: String,
+ scroll: Boolean,
+ overflow: Boolean,
+ offset: Number
+ },
+
+ data: {
+ cls: 'uk-active',
+ closest: false,
+ scroll: false,
+ overflow: true,
+ offset: 0
+ },
+
+ computed: {
+
+ links: function(_, $el) {
+ return $$('a[href^="#"]', $el).filter(function (el) { return el.hash; });
+ },
+
+ elements: function() {
+ return this.closest ? closest(this.links, this.closest) : this.links;
+ },
+
+ targets: function() {
+ return $$(this.links.map(function (el) { return el.hash; }).join(','));
+ }
+
+ },
+
+ update: [
+
+ {
+
+ read: function() {
+ if (this.scroll) {
+ this.$create('scroll', this.links, {offset: this.offset || 0});
+ }
+ }
+
+ },
+
+ {
+
+ read: function(data$$1) {
+ var this$1 = this;
+
+
+ var scroll = window.pageYOffset + this.offset + 1;
+ var max = height(document) - height(window) + this.offset;
+
+ data$$1.active = false;
+
+ this.targets.every(function (el, i) {
+
+ var ref = offset(el);
+ var top = ref.top;
+ var last = i + 1 === this$1.targets.length;
+
+ if (!this$1.overflow && (i === 0 && top > scroll || last && top + el.offsetTop < scroll)) {
+ return false;
+ }
+
+ if (!last && offset(this$1.targets[i + 1]).top <= scroll) {
+ return true;
+ }
+
+ if (scroll >= max) {
+ for (var j = this$1.targets.length - 1; j > i; j--) {
+ if (isInView(this$1.targets[j])) {
+ el = this$1.targets[j];
+ break;
+ }
+ }
+ }
+
+ return !(data$$1.active = $(filter(this$1.links, ("[href=\"#" + (el.id) + "\"]"))));
+
+ });
+
+ },
+
+ write: function(ref) {
+ var active = ref.active;
+
+
+ this.links.forEach(function (el) { return el.blur(); });
+ removeClass(this.elements, this.cls);
+
+ if (active) {
+ trigger(this.$el, 'active', [active, addClass(this.closest ? closest(active, this.closest) : active, this.cls)]);
+ }
+
+ },
+
+ events: ['scroll', 'load', 'resize']
+
+ }
+
+ ]
+
+ };
+
+ var Sticky = {
+
+ mixins: [Class],
+
+ props: {
+ top: null,
+ bottom: Boolean,
+ offset: Number,
+ animation: String,
+ clsActive: String,
+ clsInactive: String,
+ clsFixed: String,
+ clsBelow: String,
+ selTarget: String,
+ widthElement: Boolean,
+ showOnUp: Boolean,
+ media: 'media',
+ targetOffset: Number
+ },
+
+ data: {
+ top: 0,
+ bottom: false,
+ offset: 0,
+ animation: '',
+ clsActive: 'uk-active',
+ clsInactive: '',
+ clsFixed: 'uk-sticky-fixed',
+ clsBelow: 'uk-sticky-below',
+ selTarget: '',
+ widthElement: false,
+ showOnUp: false,
+ media: false,
+ targetOffset: false
+ },
+
+ computed: {
+
+ selTarget: function(ref, $el) {
+ var selTarget = ref.selTarget;
+
+ return selTarget && $(selTarget, $el) || $el;
+ },
+
+ widthElement: function(ref, $el) {
+ var widthElement = ref.widthElement;
+
+ return query(widthElement, $el) || this.placeholder;
+ }
+
+ },
+
+ connected: function() {
+
+ this.placeholder = $('+ .uk-sticky-placeholder', this.$el) || $('
');
+
+ if (!this.isActive) {
+ this.hide();
+ }
+ },
+
+ disconnected: function() {
+
+ if (this.isActive) {
+ this.isActive = false;
+ this.hide();
+ removeClass(this.selTarget, this.clsInactive);
+ }
+
+ remove(this.placeholder);
+ this.placeholder = null;
+ this.widthElement = null;
+ },
+
+ events: [
+
+ {
+ name: 'active',
+
+ self: true,
+
+ handler: function() {
+ replaceClass(this.selTarget, this.clsInactive, this.clsActive);
+ }
+
+ },
+
+ {
+ name: 'inactive',
+
+ self: true,
+
+ handler: function() {
+ replaceClass(this.selTarget, this.clsActive, this.clsInactive);
+ }
+
+ },
+
+ {
+
+ name: 'load hashchange popstate',
+
+ el: window,
+
+ handler: function() {
+ var this$1 = this;
+
+
+ if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
+ return;
+ }
+
+ var target = $(location.hash);
+
+ if (target) {
+ fastdom.read(function () {
+
+ var ref = offset(target);
+ var top = ref.top;
+ var elTop = offset(this$1.$el).top;
+ var elHeight = this$1.$el.offsetHeight;
+
+ if (this$1.isActive && elTop + elHeight >= top && elTop <= top + target.offsetHeight) {
+ scrollTop(window, top - elHeight - (isNumeric(this$1.targetOffset) ? this$1.targetOffset : 0) - this$1.offset);
+ }
+
+ });
+ }
+
+ }
+
+ }
+
+ ],
+
+ update: [
+
+ {
+
+ read: function() {
+ return {
+ height: this.$el.offsetHeight,
+ top: offset(this.isActive ? this.placeholder : this.$el).top
+ };
+ },
+
+ write: function(ref) {
+ var height$$1 = ref.height;
+ var top = ref.top;
+
+
+ var ref$1 = this;
+ var placeholder = ref$1.placeholder;
+
+ css(placeholder, assign(
+ {height: css(this.$el, 'position') !== 'absolute' ? height$$1 : ''},
+ css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
+ ));
+
+ if (!within(placeholder, document)) {
+ after(this.$el, placeholder);
+ attr(placeholder, 'hidden', '');
+ }
+
+ this.topOffset = top;
+ this.bottomOffset = this.topOffset + height$$1;
+
+ var bottom = parseProp('bottom', this);
+
+ this.top = Math.max(toFloat(parseProp('top', this)), this.topOffset) - this.offset;
+ this.bottom = bottom && bottom - height$$1;
+ this.inactive = this.media && !window.matchMedia(this.media).matches;
+
+ },
+
+ events: ['load', 'resize']
+
+ },
+
+ {
+
+ read: function(_, ref) {
+ var scrollY = ref.scrollY; if ( scrollY === void 0 ) scrollY = window.pageYOffset;
+
+
+ this.width = (isVisible(this.widthElement) ? this.widthElement : this.$el).offsetWidth;
+
+ return {
+ scroll: this.scroll = scrollY,
+ visible: isVisible(this.$el)
+ };
+ },
+
+ write: function(ref, ref$1) {
+ var this$1 = this;
+ var visible = ref.visible;
+ var scroll = ref.scroll;
+ if ( ref$1 === void 0 ) ref$1 = {};
+ var dir = ref$1.dir;
+
+
+ if (scroll < 0 || !visible || this.disabled || this.showOnUp && !dir) {
+ return;
+ }
+
+ if (this.inactive
+ || scroll < this.top
+ || this.showOnUp && (scroll <= this.top || dir === 'down' || dir === 'up' && !this.isActive && scroll <= this.bottomOffset)
+ ) {
+
+ if (!this.isActive) {
+ return;
+ }
+
+ this.isActive = false;
+
+ if (this.animation && scroll > this.topOffset) {
+ Animation.cancel(this.$el);
+ Animation.out(this.$el, this.animation).then(function () { return this$1.hide(); }, noop);
+ } else {
+ this.hide();
+ }
+
+ } else if (this.isActive) {
+
+ this.update();
+
+ } else if (this.animation) {
+
+ Animation.cancel(this.$el);
+ this.show();
+ Animation.in(this.$el, this.animation).catch(noop);
+
+ } else {
+ this.show();
+ }
+
+ },
+
+ events: ['load', 'resize', 'scroll']
+
+ } ],
+
+ methods: {
+
+ show: function() {
+
+ this.isActive = true;
+ this.update();
+ attr(this.placeholder, 'hidden', null);
+
+ },
+
+ hide: function() {
+
+ if (!this.isActive || hasClass(this.selTarget, this.clsActive)) {
+ trigger(this.$el, 'inactive');
+ }
+
+ removeClass(this.$el, this.clsFixed, this.clsBelow);
+ css(this.$el, {position: '', top: '', width: ''});
+ attr(this.placeholder, 'hidden', '');
+
+ },
+
+ update: function() {
+
+ var active = this.top !== 0 || this.scroll > this.top;
+ var top = Math.max(0, this.offset);
+
+ if (this.bottom && this.scroll > this.bottom - this.offset) {
+ top = this.bottom - this.scroll;
+ }
+
+ css(this.$el, {
+ position: 'fixed',
+ top: (top + "px"),
+ width: this.width
+ });
+
+ if (hasClass(this.selTarget, this.clsActive)) {
+
+ if (!active) {
+ trigger(this.$el, 'inactive');
+ }
+
+ } else if (active) {
+ trigger(this.$el, 'active');
+ }
+
+ toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
+ addClass(this.$el, this.clsFixed);
+
+ }
+
+ }
+
+ };
+
+ function parseProp(prop, ref) {
+ var $props = ref.$props;
+ var $el = ref.$el;
+ var propOffset = ref[(prop + "Offset")];
+
+
+ var value = $props[prop];
+
+ if (!value) {
+ return;
+ }
+
+ if (isNumeric(value)) {
+
+ return propOffset + toFloat(value);
+
+ } else if (isString(value) && value.match(/^-?\d+vh$/)) {
+
+ return height(window) * toFloat(value) / 100;
+
+ } else {
+
+ var el = value === true ? $el.parentNode : query(value, $el);
+
+ if (el) {
+ return offset(el).top + el.offsetHeight;
+ }
+
+ }
+ }
+
+ var Switcher = {
mixins: [Togglable],
@@ -6809,7 +7705,7 @@ var Switcher = function (UIkit) {
swiping: Boolean
},
- defaults: {
+ data: {
connect: '~.uk-switcher',
toggle: '> *',
active: 0,
@@ -6822,13 +7718,13 @@ var Switcher = function (UIkit) {
computed: {
- connects: function connects(ref, $el) {
+ connects: function(ref, $el) {
var connect = ref.connect;
return queryAll(connect, $el);
},
- toggles: function toggles(ref, $el) {
+ toggles: function(ref, $el) {
var toggle = ref.toggle;
return $$(toggle, $el);
@@ -6842,11 +7738,11 @@ var Switcher = function (UIkit) {
name: 'click',
- delegate: function delegate() {
+ delegate: function() {
return ((this.toggle) + ":not(.uk-disabled)");
},
- handler: function handler(e) {
+ handler: function(e) {
e.preventDefault();
this.show(e.current);
}
@@ -6856,15 +7752,15 @@ var Switcher = function (UIkit) {
{
name: 'click',
- el: function el() {
+ el: function() {
return this.connects;
},
- delegate: function delegate() {
+ delegate: function() {
return ("[" + (this.attrItem) + "],[data-" + (this.attrItem) + "]");
},
- handler: function handler(e) {
+ handler: function(e) {
e.preventDefault();
this.show(data(e.current, this.attrItem));
}
@@ -6873,21 +7769,21 @@ var Switcher = function (UIkit) {
{
name: 'swipeRight swipeLeft',
- filter: function filter() {
+ filter: function() {
return this.swiping;
},
- el: function el() {
+ el: function() {
return this.connects;
},
- handler: function handler(e) {
+ handler: function(e) {
if (!isTouch(e)) {
return;
}
e.preventDefault();
- if (!win.getSelection().toString()) {
+ if (!window.getSelection().toString()) {
this.show(e.type === 'swipeLeft' ? 'next' : 'previous');
}
}
@@ -6895,7 +7791,7 @@ var Switcher = function (UIkit) {
],
- update: function update() {
+ update: function() {
var this$1 = this;
@@ -6906,16 +7802,21 @@ var Switcher = function (UIkit) {
methods: {
- show: function show(item) {
+ index: function() {
+ return !!this.connects.length && index(filter(this.connects[0].children, ("." + (this.cls)))[0]);
+ },
+
+ show: function(item) {
var this$1 = this;
- var length = this.toggles.length,
- prev = this.connects.length && index(filter(this.connects[0].children, ("." + (this.cls)))[0]),
- hasPrev = prev >= 0,
- next = getIndex(item, this.toggles, prev),
- dir = item === 'previous' ? -1 : 1,
- toggle;
+ var ref = this.toggles;
+ var length = ref.length;
+ var prev = this.index();
+ var hasPrev = prev >= 0;
+ var dir = item === 'previous' ? -1 : 1;
+
+ var toggle, next = getIndex(item, this.toggles, prev);
for (var i = 0; i < length; i++, next = (next + dir + length) % length) {
if (!matches(this$1.toggles[next], '.uk-disabled, [disabled]')) {
@@ -6945,28 +7846,24 @@ var Switcher = function (UIkit) {
}
- });
+ };
-};
-
-var Tab = function (UIkit) {
-
- UIkit.component('tab', UIkit.components.switcher.extend({
+ var Tab = {
mixins: [Class],
- name: 'tab',
+ extends: Switcher,
props: {
media: 'media'
},
- defaults: {
+ data: {
media: 960,
attrItem: 'uk-tab-item'
},
- init: function init() {
+ connected: function() {
var cls = hasClass(this.$el, 'uk-tab-left')
? 'uk-tab-left'
@@ -6975,19 +7872,15 @@ var Tab = function (UIkit) {
: false;
if (cls) {
- UIkit.toggle(this.$el, {cls: cls, mode: 'media', media: this.media});
+ this.$create('toggle', this.$el, {cls: cls, mode: 'media', media: this.media});
}
}
- }));
+ };
-};
+ var Toggle = {
-var Toggle = function (UIkit) {
-
- UIkit.component('toggle', {
-
- mixins: [UIkit.mixin.togglable],
+ mixins: [Togglable],
args: 'target',
@@ -6998,7 +7891,7 @@ var Toggle = function (UIkit) {
media: 'media'
},
- defaults: {
+ data: {
href: false,
target: false,
mode: 'click',
@@ -7008,7 +7901,7 @@ var Toggle = function (UIkit) {
computed: {
- target: function target(ref, $el) {
+ target: function(ref, $el) {
var href = ref.href;
var target = ref.target;
@@ -7024,11 +7917,11 @@ var Toggle = function (UIkit) {
name: (pointerEnter + " " + pointerLeave),
- filter: function filter() {
+ filter: function() {
return includes(this.mode, 'hover');
},
- handler: function handler(e) {
+ handler: function(e) {
if (!isTouch(e)) {
this.toggle(("toggle" + (e.type === pointerEnter ? 'show' : 'hide')));
}
@@ -7040,11 +7933,11 @@ var Toggle = function (UIkit) {
name: 'click',
- filter: function filter() {
- return includes(this.mode, 'click') || hasTouch;
+ filter: function() {
+ return includes(this.mode, 'click') || hasTouch && includes(this.mode, 'hover');
},
- handler: function handler(e) {
+ handler: function(e) {
if (!isTouch(e) && !includes(this.mode, 'click')) {
return;
@@ -7059,7 +7952,7 @@ var Toggle = function (UIkit) {
|| link.hash && matches(this.target, link.hash)
)
) {
- e.preventDefault();
+ once(document, 'click', function (e) { return e.preventDefault(); });
}
this.toggle();
@@ -7070,14 +7963,14 @@ var Toggle = function (UIkit) {
update: {
- write: function write() {
+ write: function() {
if (!includes(this.mode, 'media') || !this.media) {
return;
}
var toggled = this.isToggled(this.target);
- if (win.matchMedia(this.media).matches ? !toggled : toggled) {
+ if (window.matchMedia(this.media).matches ? !toggled : toggled) {
this.toggle();
}
@@ -7089,7 +7982,7 @@ var Toggle = function (UIkit) {
methods: {
- toggle: function toggle(type) {
+ toggle: function(type) {
if (trigger(this.target, type || 'toggle', [this])) {
this.toggleElement(this.target);
}
@@ -7097,179 +7990,110 @@ var Toggle = function (UIkit) {
}
- });
+ };
-};
+ function core (UIkit) {
-var Video = function (UIkit) {
+ // core components
+ UIkit.component('accordion', Accordion);
+ UIkit.component('alert', Alert);
+ UIkit.component('cover', Cover);
+ UIkit.component('drop', Drop);
+ UIkit.component('dropdown', Dropdown);
+ UIkit.component('formCustom', FormCustom);
+ UIkit.component('gif', Gif);
+ UIkit.component('grid', Grid);
+ UIkit.component('heightMatch', HeightMatch);
+ UIkit.component('heightViewport', HeightViewport);
+ UIkit.component('icon', Icon);
+ UIkit.component('img', Img);
+ UIkit.component('leader', Leader);
+ UIkit.component('margin', Margin);
+ UIkit.component('modal', Modal$1);
+ UIkit.component('nav', Nav);
+ UIkit.component('navbar', Navbar);
+ UIkit.component('offcanvas', Offcanvas);
+ UIkit.component('overflowAuto', OverflowAuto);
+ UIkit.component('responsive', Responsive);
+ UIkit.component('scroll', Scroll);
+ UIkit.component('scrollspy', Scrollspy);
+ UIkit.component('scrollspyNav', ScrollspyNav);
+ UIkit.component('sticky', Sticky);
+ UIkit.component('svg', SVG);
+ UIkit.component('switcher', Switcher);
+ UIkit.component('tab', Tab);
+ UIkit.component('toggle', Toggle);
+ UIkit.component('video', Video);
- UIkit.component('video', {
+ // Icon components
+ UIkit.component('close', Close);
+ UIkit.component('marker', IconComponent);
+ UIkit.component('navbarToggleIcon', IconComponent);
+ UIkit.component('overlayIcon', IconComponent);
+ UIkit.component('paginationNext', IconComponent);
+ UIkit.component('paginationPrevious', IconComponent);
+ UIkit.component('searchIcon', Search);
+ UIkit.component('slidenavNext', Slidenav);
+ UIkit.component('slidenavPrevious', Slidenav);
+ UIkit.component('spinner', Spinner);
+ UIkit.component('totop', IconComponent);
- props: {
- automute: Boolean,
- autoplay: Boolean,
- },
+ // core functionality
+ UIkit.use(Core);
- defaults: {automute: false, autoplay: true},
-
- ready: function ready() {
-
- this.player = new Player(this.$el);
-
- if (this.automute) {
- this.player.mute();
- }
-
- },
-
- update: {
-
- write: function write() {
-
- if (!this.player) {
- return;
- }
-
- if (!isVisible(this.$el) || css(this.$el, 'visibility') === 'hidden') {
- this.player.pause();
- } else if (this.autoplay) {
- this.player.play();
- }
-
- },
-
- events: ['load']
-
- },
-
- });
-
-};
-
-var core = function (UIkit) {
-
- var scroll = 0, started = 0;
-
- on(win, 'load resize', UIkit.update);
- on(win, 'scroll', function (e) {
- e.dir = scroll < win.pageYOffset ? 'down' : 'up';
- scroll = win.pageYOffset;
- UIkit.update(e);
- fastdom.flush();
- });
-
- animationstart && on(doc, animationstart, function (ref) {
- var target = ref.target;
-
- if ((css(target, 'animationName') || '').match(/^uk-.*(left|right)/)) {
- started++;
- doc.body.style.overflowX = 'hidden';
- setTimeout(function () {
- if (!--started) {
- doc.body.style.overflowX = '';
- }
- }, toMs(css(target, 'animationDuration')) + 100);
- }
- }, true);
-
- // core components
- UIkit.use(Toggle);
- UIkit.use(Accordion);
- UIkit.use(Alert);
- UIkit.use(Video);
- UIkit.use(Cover);
- UIkit.use(Drop);
- UIkit.use(Dropdown);
- UIkit.use(FormCustom);
- UIkit.use(HeightMatch);
- UIkit.use(HeightViewport);
- UIkit.use(Hover);
- UIkit.use(Margin);
- UIkit.use(Gif);
- UIkit.use(Grid);
- UIkit.use(Leader);
- UIkit.use(Modal$1);
- UIkit.use(Nav);
- UIkit.use(Navbar);
- UIkit.use(Offcanvas);
- UIkit.use(Responsive);
- UIkit.use(Scroll);
- UIkit.use(Scrollspy);
- UIkit.use(ScrollspyNav);
- UIkit.use(Sticky);
- UIkit.use(Svg);
- UIkit.use(Icon);
- UIkit.use(Switcher);
- UIkit.use(Tab);
-
-};
-
-UIkit$2.version = '3.0.0-beta.34';
-
-mixin(UIkit$2);
-core(UIkit$2);
-
-function plugin(UIkit) {
-
- if (plugin.installed) {
- return;
}
- var ref = UIkit.util;
- var $ = ref.$;
- var doc = ref.doc;
- var empty = ref.empty;
- var html = ref.html;
+ UIkit.version = '3.0.0-rc.16';
- UIkit.component('countdown', {
+ core(UIkit);
- mixins: [UIkit.mixin.class],
+ var Countdown = {
- attrs: true,
+ mixins: [Class],
props: {
date: String,
clsWrapper: String
},
- defaults: {
+ data: {
date: '',
clsWrapper: '.uk-countdown-%unit%'
},
computed: {
- date: function date(ref) {
+ date: function(ref) {
var date = ref.date;
return Date.parse(date);
},
- days: function days(ref, $el) {
+ days: function(ref, $el) {
var clsWrapper = ref.clsWrapper;
return $(clsWrapper.replace('%unit%', 'days'), $el);
},
- hours: function hours(ref, $el) {
+ hours: function(ref, $el) {
var clsWrapper = ref.clsWrapper;
return $(clsWrapper.replace('%unit%', 'hours'), $el);
},
- minutes: function minutes(ref, $el) {
+ minutes: function(ref, $el) {
var clsWrapper = ref.clsWrapper;
return $(clsWrapper.replace('%unit%', 'minutes'), $el);
},
- seconds: function seconds(ref, $el) {
+ seconds: function(ref, $el) {
var clsWrapper = ref.clsWrapper;
return $(clsWrapper.replace('%unit%', 'seconds'), $el);
},
- units: function units() {
+ units: function() {
var this$1 = this;
return ['days', 'hours', 'minutes', 'seconds'].filter(function (unit) { return this$1[unit]; });
@@ -7277,11 +8101,11 @@ function plugin(UIkit) {
},
- connected: function connected() {
+ connected: function() {
this.start();
},
- disconnected: function disconnected() {
+ disconnected: function() {
var this$1 = this;
this.stop();
@@ -7294,12 +8118,12 @@ function plugin(UIkit) {
name: 'visibilitychange',
- el: doc,
+ el: document,
- handler: function handler() {
- if (doc.hidden) {
+ handler: function() {
+ if (document.hidden) {
this.stop();
- } else {
+ } else {
this.start();
}
}
@@ -7310,7 +8134,7 @@ function plugin(UIkit) {
update: {
- write: function write() {
+ write: function() {
var this$1 = this;
@@ -7352,7 +8176,7 @@ function plugin(UIkit) {
methods: {
- start: function start() {
+ start: function() {
var this$1 = this;
@@ -7365,7 +8189,7 @@ function plugin(UIkit) {
},
- stop: function stop() {
+ stop: function() {
if (this.timer) {
clearInterval(this.timer);
@@ -7376,7 +8200,7 @@ function plugin(UIkit) {
}
- });
+ };
function getTimeSpan(date) {
@@ -7391,370 +8215,581 @@ function plugin(UIkit) {
};
}
-}
+ var targetClass = 'uk-animation-target';
-if (!true && typeof window !== 'undefined' && window.UIkit) {
- window.UIkit.use(plugin);
-}
-
-function plugin$1(UIkit) {
-
- if (plugin$1.installed) {
- return;
- }
-
- var ref = UIkit.util;
- var $$ = ref.$$;
- var addClass = ref.addClass;
- var css = ref.css;
- var scrolledOver = ref.scrolledOver;
- var toFloat = ref.toFloat;
- var toNodes = ref.toNodes;
-
- UIkit.component('grid-parallax', UIkit.components.grid.extend({
+ var Animate = {
props: {
- target: String,
- translate: Number
+ animation: Number
},
- defaults: {
- target: false,
- translate: 150
+ data: {
+ animation: 150
},
computed: {
- translate: function translate(ref) {
- var translate = ref.translate;
-
- return Math.abs(translate);
- },
-
- items: function items(ref, $el) {
- var target = ref.target;
-
- return target ? $$(target, $el) : toNodes($el.children);
+ target: function() {
+ return this.$el;
}
},
- init: function init() {
- addClass(this.$el, 'uk-grid');
- },
-
- disconnected: function disconnected() {
- this.reset();
- css(this.$el, 'marginBottom', '');
- },
-
- update: [
-
- {
-
- read: function read() {
- this.columns = this.rows && this.rows[0] && this.rows[0].length || 0;
- this.rows = this.rows && this.rows.map(function (elements) { return sortBy(elements, 'offsetLeft'); });
- },
-
- write: function write() {
- css(this.$el, 'marginBottom', this.columns > 1
- ? this.translate + toFloat(css(css(this.$el, 'marginBottom', ''), 'marginBottom'))
- : '');
- },
-
- events: ['load', 'resize']
- },
-
- {
-
- read: function read() {
-
- this.scrolled = scrolledOver(this.$el) * this.translate;
-
- },
-
- write: function write() {
- var this$1 = this;
-
-
- if (!this.rows || this.columns === 1 || !this.scrolled) {
- return this.reset();
- }
-
- this.rows.forEach(function (row) { return row.forEach(function (el, i) { return css(el, 'transform', ("translateY(" + (i % 2 ? this$1.scrolled : this$1.scrolled / 8) + "px)")); }
- ); }
- );
-
- },
-
- events: ['scroll', 'load', 'resize']
- }
- ],
-
methods: {
- reset: function reset() {
- css(this.items, 'transform', '');
+ animate: function(action) {
+ var this$1 = this;
+
+
+ addStyle();
+
+ var children = toNodes(this.target.children);
+ var propsFrom = children.map(function (el) { return getProps(el, true); });
+
+ var oldHeight = height(this.target);
+ var oldScrollY = window.pageYOffset;
+
+ action();
+
+ Transition.cancel(this.target);
+ children.forEach(Transition.cancel);
+
+ reset(this.target);
+ this.$update(this.target);
+ fastdom.flush();
+
+ var newHeight = height(this.target);
+
+ children = children.concat(toNodes(this.target.children).filter(function (el) { return !includes(children, el); }));
+
+ var propsTo = children.map(function (el, i) { return el.parentNode && i in propsFrom
+ ? propsFrom[i]
+ ? isVisible(el)
+ ? getPositionWithMargin(el)
+ : {opacity: 0}
+ : {opacity: isVisible(el) ? 1 : 0}
+ : false; }
+ );
+
+ propsFrom = propsTo.map(function (props, i) {
+ var from = children[i].parentNode === this$1.target
+ ? propsFrom[i] || getProps(children[i])
+ : false;
+
+ if (from) {
+ if (!props) {
+ delete from.opacity;
+ } else if (!('opacity' in props)) {
+ var opacity = from.opacity;
+
+ if (opacity % 1) {
+ props.opacity = 1;
+ } else {
+ delete from.opacity;
+ }
+ }
+ }
+
+ return from;
+ });
+
+ addClass(this.target, targetClass);
+ children.forEach(function (el, i) { return propsFrom[i] && css(el, propsFrom[i]); });
+ css(this.target, 'height', oldHeight);
+ scrollTop(window, oldScrollY);
+
+ return Promise.all(children.map(function (el, i) { return propsFrom[i] && propsTo[i]
+ ? Transition.start(el, propsTo[i], this$1.animation, 'ease')
+ : Promise.resolve(); }
+ ).concat(Transition.start(this.target, {height: newHeight}, this.animation, 'ease'))).then(function () {
+ children.forEach(function (el, i) { return css(el, {display: propsTo[i].opacity === 0 ? 'none' : '', zIndex: ''}); });
+ reset(this$1.target);
+ this$1.$update(this$1.target);
+ fastdom.flush(); // needed for IE11
+ }, noop);
+
}
-
}
-
- }));
-
- UIkit.component('grid-parallax').options.update.unshift({
-
- read: function read() {
- this.reset();
- },
-
- events: ['load', 'resize']
-
- });
-
- function sortBy(collection, prop) {
- return collection.sort(function (a, b) { return a[prop] > b[prop]
- ? 1
- : b[prop] > a[prop]
- ? -1
- : 0; }
- )
- }
-
-}
-
-if (!true && typeof window !== 'undefined' && window.UIkit) {
- window.UIkit.use(plugin$1);
-}
-
-var Animations = function (UIkit) {
-
- var ref = UIkit.util;
- var css = ref.css;
-
- var Animations = {
-
- slide: {
-
- show: function show(dir) {
- return [
- {transform: translate(dir * -100)},
- {transform: translate()}
- ];
- },
-
- percent: function percent(current) {
- return Animations.translated(current);
- },
-
- translate: function translate$1(percent, dir) {
- return [
- {transform: translate(dir * -100 * percent)},
- {transform: translate(dir * 100 * (1 - percent))}
- ];
- }
-
- },
-
- translated: function translated(el) {
- return Math.abs(css(el, 'transform').split(',')[4] / el.offsetWidth)
- }
-
};
- return Animations;
+ function getProps(el, opacity) {
-};
+ var zIndex = css(el, 'zIndex');
-function translate(value) {
- if ( value === void 0 ) value = 0;
-
- return ("translate(" + value + (value ? '%' : '') + ", 0)"); // currently not translate3d to support IE, translate3d within translate3d does not work while transitioning
-}
-
-function scale3d(value) {
- return ("scale3d(" + value + ", " + value + ", 1)");
-}
-
-function plugin$3(UIkit) {
-
- if (plugin$3.installed) {
- return;
+ return isVisible(el)
+ ? assign({
+ display: '',
+ opacity: opacity ? css(el, 'opacity') : '0',
+ pointerEvents: 'none',
+ position: 'absolute',
+ zIndex: zIndex === 'auto' ? index(el) : zIndex
+ }, getPositionWithMargin(el))
+ : false;
}
- var ref = UIkit.util;
- var $$ = ref.$$;
- var $ = ref.$;
- var addClass = ref.addClass;
- var assign = ref.assign;
- var createEvent = ref.createEvent;
- var css = ref.css;
- var data = ref.data;
- var doc = ref.doc;
- var endsWith = ref.endsWith;
- var fastdom = ref.fastdom;
- var getIndex = ref.getIndex;
- var getPos = ref.getPos;
- var hasClass = ref.hasClass;
- var index = ref.index;
- var isTouch = ref.isTouch;
- var noop = ref.noop;
- var off = ref.off;
- var on = ref.on;
- var pointerDown = ref.pointerDown;
- var pointerMove = ref.pointerMove;
- var pointerUp = ref.pointerUp;
- var preventClick = ref.preventClick;
- var Promise = ref.Promise;
- var removeClass = ref.removeClass;
- var toggleClass = ref.toggleClass;
- var toNodes = ref.toNodes;
- var Transition = ref.Transition;
- var trigger = ref.trigger;
- var win = ref.win;
+ function reset(el) {
+ css(el.children, {
+ height: '',
+ left: '',
+ opacity: '',
+ pointerEvents: '',
+ position: '',
+ top: '',
+ width: ''
+ });
+ removeClass(el, targetClass);
+ css(el, 'height', '');
+ }
- var abs = Math.abs;
+ function getPositionWithMargin(el) {
+ var ref = el.getBoundingClientRect();
+ var height$$1 = ref.height;
+ var width$$1 = ref.width;
+ var ref$1 = position(el);
+ var top = ref$1.top;
+ var left = ref$1.left;
+ top += toFloat(css(el, 'marginTop'));
- UIkit.mixin.slideshow = {
+ return {top: top, left: left, height: height$$1, width: width$$1};
+ }
- attrs: true,
+ var style$1;
+
+ function addStyle() {
+ if (!style$1) {
+ style$1 = append(document.head, '