uikit-reset 2.1.0 → 3.2.0

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.
@@ -1,6 +1,6 @@
1
1
  //= require jquery
2
2
 
3
- /*! UIkit 3.1.0 | http://www.getuikit.com | (c) 2014 - 2018 YOOtheme | MIT License */
3
+ /*! UIkit 3.2.0 | http://www.getuikit.com | (c) 2014 - 2019 YOOtheme | MIT License */
4
4
 
5
5
  (function (global, factory) {
6
6
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -9,13 +9,6 @@
9
9
  }(this, function () {
10
10
  'use strict';
11
11
 
12
- function bind(fn, context) {
13
- return function (a) {
14
- var l = arguments.length;
15
- return l ? l > 1 ? fn.apply(context, arguments) : fn.call(context, a) : fn.call(context);
16
- };
17
- }
18
-
19
12
  var objPrototype = Object.prototype;
20
13
  var hasOwnProperty = objPrototype.hasOwnProperty;
21
14
 
@@ -68,16 +61,33 @@
68
61
  return endsWithFn.call(str, search);
69
62
  }
70
63
 
64
+ var arrPrototype = Array.prototype;
65
+
71
66
  var includesFn = function (search, i) {
72
67
  return ~this.indexOf(search, i);
73
68
  };
74
69
  var includesStr = strPrototype.includes || includesFn;
75
- var includesArray = Array.prototype.includes || includesFn;
70
+ var includesArray = arrPrototype.includes || includesFn;
76
71
 
77
72
  function includes(obj, search) {
78
73
  return obj && (isString(obj) ? includesStr : includesArray).call(obj, search);
79
74
  }
80
75
 
76
+ var findIndexFn = arrPrototype.findIndex || function (predicate) {
77
+ var arguments$1 = arguments;
78
+
79
+ for (var i = 0; i < this.length; i++) {
80
+ if (predicate.call(arguments$1[1], this[i], i, this)) {
81
+ return i;
82
+ }
83
+ }
84
+ return -1;
85
+ };
86
+
87
+ function findIndex(array, predicate) {
88
+ return findIndexFn.call(array, predicate);
89
+ }
90
+
81
91
  var isArray = Array.isArray;
82
92
 
83
93
  function isFunction(obj) {
@@ -130,6 +140,15 @@
130
140
  return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));
131
141
  }
132
142
 
143
+ function isEmpty(obj) {
144
+ return !(isArray(obj) ?
145
+ obj.length :
146
+ isObject(obj) ?
147
+ Object.keys(obj).length :
148
+ false
149
+ );
150
+ }
151
+
133
152
  function isUndefined(value) {
134
153
  return value === void 0;
135
154
  }
@@ -163,13 +182,11 @@
163
182
  null;
164
183
  }
165
184
 
166
- var arrayProto = Array.prototype;
167
-
168
185
  function toNodes(element) {
169
186
  return isNode(element) ?
170
187
  [element] :
171
188
  isNodeCollection(element) ?
172
- arrayProto.slice.call(element) :
189
+ arrPrototype.slice.call(element) :
173
190
  isArray(element) ?
174
191
  element.map(toNode).filter(Boolean) :
175
192
  isJQuery(element) ?
@@ -232,6 +249,10 @@
232
249
  return target;
233
250
  };
234
251
 
252
+ function last(array) {
253
+ return array[array.length - 1];
254
+ }
255
+
235
256
  function each(obj, cb) {
236
257
  for (var key in obj) {
237
258
  if (false === cb(obj[key], key)) {
@@ -384,6 +405,24 @@
384
405
  }
385
406
  }
386
407
 
408
+ /* global DocumentTouch */
409
+
410
+ var isIE = /msie|trident/i.test(window.navigator.userAgent);
411
+ var isRtl = attr(document.documentElement, 'dir') === 'rtl';
412
+
413
+ var hasTouchEvents = 'ontouchstart' in window;
414
+ var hasPointerEvents = window.PointerEvent;
415
+ var hasTouch = hasTouchEvents ||
416
+ window.DocumentTouch && document instanceof DocumentTouch ||
417
+ navigator.maxTouchPoints; // IE >=11
418
+
419
+ var pointerDown = hasPointerEvents ? 'pointerdown' : hasTouchEvents ? 'touchstart' : 'mousedown';
420
+ var pointerMove = hasPointerEvents ? 'pointermove' : hasTouchEvents ? 'touchmove' : 'mousemove';
421
+ var pointerUp = hasPointerEvents ? 'pointerup' : hasTouchEvents ? 'touchend' : 'mouseup';
422
+ var pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouchEvents ? '' : 'mouseenter';
423
+ var pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouchEvents ? '' : 'mouseleave';
424
+ var pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
425
+
387
426
  function query(selector, context) {
388
427
  return toNode(selector) || find(selector, getContext(selector, context));
389
428
  }
@@ -490,7 +529,7 @@
490
529
  return isString(selector) && selector.match(contextSelectorRe);
491
530
  }
492
531
 
493
- var selectorRe = /.*?[^\\](?:,|$)/;
532
+ var selectorRe = /.*?[^\\](?:,|$)/g;
494
533
 
495
534
  function splitSelector(selector) {
496
535
  return selector.match(selectorRe).map(function (selector) {
@@ -528,7 +567,7 @@
528
567
  }
529
568
 
530
569
  return isNode(element) ?
531
- element.parentNode && closestFn.call(element, selector) :
570
+ closestFn.call(element, selector) :
532
571
  toNodes(element).map(function (element) {
533
572
  return closest(element, selector);
534
573
  }).filter(Boolean);
@@ -536,15 +575,12 @@
536
575
 
537
576
  function parents(element, selector) {
538
577
  var elements = [];
539
- var parent = toNode(element).parentNode;
540
-
541
- while (parent && parent.nodeType === 1) {
578
+ element = toNode(element);
542
579
 
543
- if (matches(parent, selector)) {
544
- elements.push(parent);
580
+ while ((element = element.parentNode) && element.nodeType === 1) {
581
+ if (matches(element, selector)) {
582
+ elements.push(element);
545
583
  }
546
-
547
- parent = parent.parentNode;
548
584
  }
549
585
 
550
586
  return elements;
@@ -629,14 +665,20 @@
629
665
 
630
666
  targets = toEventTargets(targets);
631
667
 
668
+ if (listener.length > 1) {
669
+ listener = detail(listener);
670
+ }
671
+
632
672
  if (selector) {
633
673
  listener = delegate(targets, selector, listener);
634
674
  }
635
675
 
636
- if (listener.length > 1) {
637
- listener = detail(listener);
676
+ if (useCapture && useCapture.self) {
677
+ listener = selfFilter(listener);
638
678
  }
639
679
 
680
+ useCapture = useCaptureFilter(useCapture);
681
+
640
682
  type.split(' ').forEach(function (type) {
641
683
  return targets.forEach(function (target) {
642
684
  return target.addEventListener(type, listener, useCapture);
@@ -650,6 +692,7 @@
650
692
  function off(targets, type, listener, useCapture) {
651
693
  if (useCapture === void 0) useCapture = false;
652
694
 
695
+ useCapture = useCaptureFilter(useCapture);
653
696
  targets = toEventTargets(targets);
654
697
  type.split(' ').forEach(function (type) {
655
698
  return targets.forEach(function (target) {
@@ -739,6 +782,20 @@
739
782
  };
740
783
  }
741
784
 
785
+ function selfFilter(listener) {
786
+ return function (e) {
787
+ if (e.target === e.currentTarget || e.target === e.current) {
788
+ return listener.call(null, e);
789
+ }
790
+ };
791
+ }
792
+
793
+ function useCaptureFilter(options) {
794
+ return options && isIE && !isBoolean(options) ?
795
+ !!options.capture :
796
+ options;
797
+ }
798
+
742
799
  function isEventTarget(target) {
743
800
  return target && 'addEventListener' in target;
744
801
  }
@@ -758,7 +815,7 @@
758
815
  }
759
816
 
760
817
  function isTouch(e) {
761
- return e.pointerType === 'touch' || e.touches;
818
+ return e.pointerType === 'touch' || !!e.touches;
762
819
  }
763
820
 
764
821
  function getEventPos(e, prop) {
@@ -1051,24 +1108,6 @@
1051
1108
 
1052
1109
  }
1053
1110
 
1054
- /* global DocumentTouch */
1055
-
1056
- var isIE = /msie|trident/i.test(window.navigator.userAgent);
1057
- var isRtl = attr(document.documentElement, 'dir') === 'rtl';
1058
-
1059
- var hasTouchEvents = 'ontouchstart' in window;
1060
- var hasPointerEvents = window.PointerEvent;
1061
- var hasTouch = hasTouchEvents ||
1062
- window.DocumentTouch && document instanceof DocumentTouch ||
1063
- navigator.maxTouchPoints; // IE >=11
1064
-
1065
- var pointerDown = hasPointerEvents ? 'pointerdown' : hasTouchEvents ? 'touchstart' : 'mousedown';
1066
- var pointerMove = hasPointerEvents ? 'pointermove' : hasTouchEvents ? 'touchmove' : 'mousemove';
1067
- var pointerUp = hasPointerEvents ? 'pointerup' : hasTouchEvents ? 'touchend' : 'mouseup';
1068
- var pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouchEvents ? '' : 'mouseenter';
1069
- var pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouchEvents ? '' : 'mouseleave';
1070
- var pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
1071
-
1072
1111
  function ready(fn) {
1073
1112
 
1074
1113
  if (document.readyState !== 'loading') {
@@ -1315,7 +1354,7 @@
1315
1354
 
1316
1355
  args = getArgs$1(args);
1317
1356
 
1318
- var force = !isString(args[args.length - 1]) ? args.pop() : []; // in iOS 9.3 force === undefined evaluates to false
1357
+ var force = !isString(last(args)) ? args.pop() : []; // in iOS 9.3 force === undefined evaluates to false
1319
1358
 
1320
1359
  args = args.filter(Boolean);
1321
1360
 
@@ -1535,10 +1574,8 @@
1535
1574
  'transition-timing-function': ''
1536
1575
  });
1537
1576
  type === 'transitioncanceled' ? reject() : resolve();
1538
- }, false, function (ref) {
1539
- var target = ref.target;
1540
-
1541
- return element === target;
1577
+ }, {
1578
+ self: true
1542
1579
  });
1543
1580
 
1544
1581
  addClass(element, 'uk-transition');
@@ -1635,10 +1672,8 @@
1635
1672
  }
1636
1673
  });
1637
1674
 
1638
- }, false, function (ref) {
1639
- var target = ref.target;
1640
-
1641
- return element === target;
1675
+ }, {
1676
+ self: true
1642
1677
  });
1643
1678
 
1644
1679
  css(element, 'animationDuration', (duration + "ms"));
@@ -1814,6 +1849,10 @@
1814
1849
 
1815
1850
  element = toNode(element);
1816
1851
 
1852
+ if (!element) {
1853
+ return {};
1854
+ }
1855
+
1817
1856
  var ref = getWindow(element);
1818
1857
  var top = ref.pageYOffset;
1819
1858
  var left = ref.pageXOffset;
@@ -2137,25 +2176,31 @@
2137
2176
  return remove$1(this.reads, task) || remove$1(this.writes, task);
2138
2177
  },
2139
2178
 
2140
- flush: function () {
2179
+ flush: flush
2141
2180
 
2142
- runTasks(this.reads);
2143
- runTasks(this.writes.splice(0, this.writes.length));
2181
+ };
2144
2182
 
2145
- this.scheduled = false;
2183
+ function flush() {
2184
+ runTasks(fastdom.reads);
2185
+ runTasks(fastdom.writes.splice(0, fastdom.writes.length));
2146
2186
 
2147
- if (this.reads.length || this.writes.length) {
2148
- scheduleFlush();
2149
- }
2187
+ fastdom.scheduled = false;
2150
2188
 
2189
+ if (fastdom.reads.length || fastdom.writes.length) {
2190
+ scheduleFlush(true);
2151
2191
  }
2192
+ }
2152
2193
 
2153
- };
2194
+ function scheduleFlush(microtask) {
2195
+ if (microtask === void 0) microtask = false;
2154
2196
 
2155
- function scheduleFlush() {
2156
2197
  if (!fastdom.scheduled) {
2157
2198
  fastdom.scheduled = true;
2158
- requestAnimationFrame(fastdom.flush.bind(fastdom));
2199
+ if (microtask) {
2200
+ Promise.resolve().then(flush);
2201
+ } else {
2202
+ requestAnimationFrame(flush);
2203
+ }
2159
2204
  }
2160
2205
  }
2161
2206
 
@@ -2233,7 +2278,7 @@
2233
2278
  }
2234
2279
 
2235
2280
  var p = offset(target);
2236
- var position = this.positions[this.positions.length - 1];
2281
+ var position = last(this.positions);
2237
2282
  var ref = this.positions;
2238
2283
  var prevPos = ref[0];
2239
2284
 
@@ -2291,7 +2336,7 @@
2291
2336
 
2292
2337
  // args strategy
2293
2338
  strats.args = function (parentVal, childVal) {
2294
- return concatStrat(childVal || parentVal);
2339
+ return childVal !== false && concatStrat(childVal || parentVal);
2295
2340
  };
2296
2341
 
2297
2342
  // update strategy
@@ -2769,7 +2814,6 @@
2769
2814
  isInput: isInput,
2770
2815
  filter: filter,
2771
2816
  within: within,
2772
- bind: bind,
2773
2817
  hasOwn: hasOwn,
2774
2818
  hyphenate: hyphenate,
2775
2819
  camelize: camelize,
@@ -2777,6 +2821,7 @@
2777
2821
  startsWith: startsWith,
2778
2822
  endsWith: endsWith,
2779
2823
  includes: includes,
2824
+ findIndex: findIndex,
2780
2825
  isArray: isArray,
2781
2826
  isFunction: isFunction,
2782
2827
  isObject: isObject,
@@ -2790,6 +2835,7 @@
2790
2835
  isString: isString,
2791
2836
  isNumber: isNumber,
2792
2837
  isNumeric: isNumeric,
2838
+ isEmpty: isEmpty,
2793
2839
  isUndefined: isUndefined,
2794
2840
  toBoolean: toBoolean,
2795
2841
  toNumber: toNumber,
@@ -2801,6 +2847,7 @@
2801
2847
  isEqual: isEqual,
2802
2848
  swap: swap,
2803
2849
  assign: assign,
2850
+ last: last,
2804
2851
  each: each,
2805
2852
  sortBy: sortBy,
2806
2853
  uniqueBy: uniqueBy,
@@ -2962,7 +3009,7 @@
2962
3009
 
2963
3010
  if (document.body) {
2964
3011
 
2965
- init();
3012
+ fastdom.read(init);
2966
3013
 
2967
3014
  } else {
2968
3015
 
@@ -2984,6 +3031,7 @@
2984
3031
 
2985
3032
  apply(document.body, connect);
2986
3033
 
3034
+ // Safari renders prior to first animation frame
2987
3035
  fastdom.flush();
2988
3036
 
2989
3037
  (new MutationObserver(function (mutations) {
@@ -3320,7 +3368,7 @@
3320
3368
 
3321
3369
  if (methods) {
3322
3370
  for (var key in methods) {
3323
- this[key] = bind(methods[key], this);
3371
+ this[key] = methods[key].bind(this);
3324
3372
  }
3325
3373
  }
3326
3374
  };
@@ -3554,12 +3602,6 @@
3554
3602
  return;
3555
3603
  }
3556
3604
 
3557
- handler = detail(isString(handler) ? component[handler] : bind(handler, component));
3558
-
3559
- if (self) {
3560
- handler = selfFilter(handler);
3561
- }
3562
-
3563
3605
  component._events.push(
3564
3606
  on(
3565
3607
  el,
@@ -3569,38 +3611,22 @@
3569
3611
  isString(delegate) ?
3570
3612
  delegate :
3571
3613
  delegate.call(component),
3572
- handler,
3573
- isBoolean(passive) ?
3574
- {
3575
- passive: passive,
3576
- capture: capture
3577
- } :
3578
- capture
3614
+ isString(handler) ? component[handler] : handler.bind(component), {
3615
+ passive: passive,
3616
+ capture: capture,
3617
+ self: self
3618
+ }
3579
3619
  )
3580
3620
  );
3581
3621
 
3582
3622
  }
3583
3623
 
3584
- function selfFilter(handler) {
3585
- return function selfHandler(e) {
3586
- if (e.target === e.currentTarget || e.target === e.current) {
3587
- return handler.call(null, e);
3588
- }
3589
- };
3590
- }
3591
-
3592
3624
  function notIn(options, key) {
3593
3625
  return options.every(function (arr) {
3594
3626
  return !arr || !hasOwn(arr, key);
3595
3627
  });
3596
3628
  }
3597
3629
 
3598
- function detail(listener) {
3599
- return function (e) {
3600
- return isArray(e.detail) ? listener.apply(void 0, [e].concat(e.detail)) : listener(e);
3601
- };
3602
- }
3603
-
3604
3630
  function coerce(type, value) {
3605
3631
 
3606
3632
  if (type === Boolean) {
@@ -3622,7 +3648,7 @@
3622
3648
  if (props === void 0) props = {};
3623
3649
 
3624
3650
  data = isArray(data) ?
3625
- args && args.length ?
3651
+ !isEmpty(args) ?
3626
3652
  data.slice(0, args.length).reduce(function (data, value, index) {
3627
3653
  if (isPlainObject(value)) {
3628
3654
  assign(data, value);
@@ -3639,7 +3665,7 @@
3639
3665
  if (isUndefined(data[key])) {
3640
3666
  delete data[key];
3641
3667
  } else {
3642
- data[key] = props[key] ? coerce(props[key], data[key], el) : data[key];
3668
+ data[key] = props[key] ? coerce(props[key], data[key]) : data[key];
3643
3669
  }
3644
3670
  }
3645
3671
  }
@@ -3703,7 +3729,7 @@
3703
3729
 
3704
3730
  delete el[DATA][name];
3705
3731
 
3706
- if (!Object.keys(el[DATA]).length) {
3732
+ if (!isEmpty(el[DATA])) {
3707
3733
  delete el[DATA];
3708
3734
  }
3709
3735
 
@@ -4262,37 +4288,50 @@
4262
4288
  }
4263
4289
  }, true);
4264
4290
 
4265
- });
4291
+ var off;
4292
+ on(document, pointerDown, function (e) {
4293
+
4294
+ off && off();
4266
4295
 
4267
- var off;
4296
+ if (!isTouch(e)) {
4297
+ return;
4298
+ }
4268
4299
 
4269
- on(document, pointerDown, function (e) {
4300
+ // Handle Swipe Gesture
4301
+ var pos = getEventPos(e);
4302
+ var target = 'tagName' in e.target ? e.target : e.target.parentNode;
4303
+ off = once(document, (pointerUp + " " + pointerCancel), function (e) {
4270
4304
 
4271
- off && off();
4305
+ var ref = getEventPos(e);
4306
+ var x = ref.x;
4307
+ var y = ref.y;
4272
4308
 
4273
- if (!isTouch(e)) {
4274
- return;
4275
- }
4309
+ // swipe
4310
+ if (target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
4276
4311
 
4277
- var pos = getEventPos(e);
4278
- var target = 'tagName' in e.target ? e.target : e.target.parentNode;
4279
- off = once(document, pointerUp, function (e) {
4312
+ setTimeout(function () {
4313
+ trigger(target, 'swipe');
4314
+ trigger(target, ("swipe" + (swipeDirection(pos.x, pos.y, x, y))));
4315
+ });
4280
4316
 
4281
- var ref = getEventPos(e);
4282
- var x = ref.x;
4283
- var y = ref.y;
4317
+ }
4284
4318
 
4285
- // swipe
4286
- if (target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
4319
+ });
4287
4320
 
4288
- setTimeout(function () {
4289
- trigger(target, 'swipe');
4290
- trigger(target, ("swipe" + (swipeDirection(pos.x, pos.y, x, y))));
4321
+ // Force click event anywhere on iOS < 13
4322
+ if (pointerDown === 'touchstart') {
4323
+ css(document.body, 'cursor', 'pointer');
4324
+ once(document, (pointerUp + " " + pointerCancel), function () {
4325
+ return setTimeout(function () {
4326
+ return css(document.body, 'cursor', '');
4327
+ }, 50);
4291
4328
  });
4292
-
4293
4329
  }
4294
4330
 
4331
+ }, {
4332
+ passive: true
4295
4333
  });
4334
+
4296
4335
  });
4297
4336
 
4298
4337
  }
@@ -4394,42 +4433,32 @@
4394
4433
  read: function () {
4395
4434
 
4396
4435
  var el = this.$el;
4397
-
4398
- if (!isVisible(el)) {
4399
- return false;
4400
- }
4401
-
4402
4436
  var ref = el.parentNode;
4403
4437
  var height = ref.offsetHeight;
4404
4438
  var width = ref.offsetWidth;
4439
+ var dim = Dimensions.cover({
4440
+ width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
4441
+ height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight
4442
+ }, {
4443
+ width: width + (width % 2 ? 1 : 0),
4444
+ height: height + (height % 2 ? 1 : 0)
4445
+ });
4405
4446
 
4406
- return {
4407
- height: height,
4408
- width: width
4409
- };
4447
+ if (!dim.width || !dim.height) {
4448
+ return false;
4449
+ }
4450
+
4451
+ return dim;
4410
4452
  },
4411
4453
 
4412
4454
  write: function (ref) {
4413
4455
  var height = ref.height;
4414
4456
  var width = ref.width;
4415
4457
 
4416
-
4417
- var el = this.$el;
4418
- var elWidth = this.width || el.naturalWidth || el.videoWidth || el.clientWidth;
4419
- var elHeight = this.height || el.naturalHeight || el.videoHeight || el.clientHeight;
4420
-
4421
- if (!elWidth || !elHeight) {
4422
- return;
4423
- }
4424
-
4425
- css(el, Dimensions.cover({
4426
- width: elWidth,
4427
- height: elHeight
4428
- }, {
4429
- width: width + (width % 2 ? 1 : 0),
4430
- height: height + (height % 2 ? 1 : 0)
4431
- }));
4432
-
4458
+ css(this.$el, {
4459
+ height: height,
4460
+ width: width
4461
+ });
4433
4462
  },
4434
4463
 
4435
4464
  events: ['resize']
@@ -4618,19 +4647,11 @@
4618
4647
  return 'a[href^="#"]';
4619
4648
  },
4620
4649
 
4621
- handler: function (e) {
4622
-
4623
- if (e.defaultPrevented) {
4624
- return;
4625
- }
4626
-
4627
- var id = e.target.hash;
4628
-
4629
- if (!id) {
4630
- e.preventDefault();
4631
- }
4650
+ handler: function (ref) {
4651
+ var defaultPrevented = ref.defaultPrevented;
4652
+ var hash = ref.current.hash;
4632
4653
 
4633
- if (!id || !within(id, this.$el)) {
4654
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4634
4655
  this.hide(false);
4635
4656
  }
4636
4657
  }
@@ -4755,9 +4776,24 @@
4755
4776
  self: true,
4756
4777
 
4757
4778
  handler: function () {
4779
+ var this$1 = this;
4780
+
4758
4781
  this.tracker.init();
4759
4782
  trigger(this.$el, 'updatearia');
4760
- registerEvent();
4783
+
4784
+ // If triggered from an click event handler, delay adding the click handler
4785
+ var off = delayOn(document, 'click', function (ref) {
4786
+ var defaultPrevented = ref.defaultPrevented;
4787
+ var target = ref.target;
4788
+
4789
+ if (!defaultPrevented && !within(target, this$1.$el) && !(this$1.toggle && within(target, this$1.toggle.$el))) {
4790
+ this$1.hide(false);
4791
+ }
4792
+ });
4793
+
4794
+ once(this.$el, 'hide', off, {
4795
+ self: true
4796
+ });
4761
4797
  }
4762
4798
 
4763
4799
  },
@@ -4807,7 +4843,7 @@
4807
4843
  this.updateAria(this.$el);
4808
4844
 
4809
4845
  if (toggle || this.toggle) {
4810
- attr((toggle || this.toggle).$el, 'aria-expanded', this.isToggled() ? 'true' : 'false');
4846
+ attr((toggle || this.toggle).$el, 'aria-expanded', this.isToggled());
4811
4847
  toggleClass(this.toggle.$el, this.cls, this.isToggled());
4812
4848
  }
4813
4849
  }
@@ -4858,7 +4894,7 @@
4858
4894
  return;
4859
4895
  }
4860
4896
 
4861
- } else if (active && this$1.isChildOf(active)) {
4897
+ } else if (this$1.isChildOf(active)) {
4862
4898
 
4863
4899
  active.clearTimers();
4864
4900
 
@@ -4963,30 +4999,13 @@
4963
4999
 
4964
5000
  };
4965
5001
 
4966
- var registered;
4967
-
4968
- function registerEvent() {
4969
-
4970
- if (registered) {
4971
- return;
4972
- }
4973
-
4974
- registered = true;
4975
- on(document, pointerUp, function (ref) {
4976
- var target = ref.target;
4977
- var defaultPrevented = ref.defaultPrevented;
4978
-
4979
- var prev;
4980
-
4981
- if (defaultPrevented) {
4982
- return;
4983
- }
4984
-
4985
- while (active && active !== prev && !within(target, active.$el) && !(active.toggle && within(target, active.toggle.$el))) {
4986
- prev = active;
4987
- active.hide(false);
4988
- }
4989
- });
5002
+ function delayOn(el, type, fn) {
5003
+ var off = once(el, type, function () {
5004
+ return off = on(el, type, fn);
5005
+ }, true);
5006
+ return function () {
5007
+ return off();
5008
+ };
4990
5009
  }
4991
5010
 
4992
5011
  var Dropdown = {
@@ -5047,7 +5066,8 @@
5047
5066
  input.files[0].name :
5048
5067
  matches(input, 'select') && (option = $$('option', input).filter(function (el) {
5049
5068
  return el.selected;
5050
- })[0]) ?
5069
+ })[0]) // eslint-disable-line prefer-destructuring
5070
+ ?
5051
5071
  option.textContent :
5052
5072
  input.value;
5053
5073
 
@@ -5057,13 +5077,29 @@
5057
5077
 
5058
5078
  },
5059
5079
 
5060
- events: {
5080
+ events: [
5061
5081
 
5062
- change: function () {
5063
- this.$emit();
5082
+ {
5083
+ name: 'change',
5084
+
5085
+ handler: function () {
5086
+ this.$emit();
5087
+ }
5088
+ },
5089
+
5090
+ {
5091
+ name: 'reset',
5092
+
5093
+ el: function () {
5094
+ return closest(this.$el, 'form');
5095
+ },
5096
+
5097
+ handler: function () {
5098
+ this.$emit();
5099
+ }
5064
5100
  }
5065
5101
 
5066
- }
5102
+ ]
5067
5103
 
5068
5104
  };
5069
5105
 
@@ -5175,7 +5211,7 @@
5175
5211
  leftDim = getOffset(row[0], true);
5176
5212
  }
5177
5213
 
5178
- if (dim.top >= leftDim.bottom - 1) {
5214
+ if (dim.top >= leftDim.bottom - 1 && dim.top !== leftDim.top) {
5179
5215
  rows.push([el]);
5180
5216
  break;
5181
5217
  }
@@ -5311,7 +5347,10 @@
5311
5347
 
5312
5348
  }
5313
5349
 
5350
+ var padding = this.parallax && getPaddingBottom(this.parallax, rows, translates);
5351
+
5314
5352
  return {
5353
+ padding: padding,
5315
5354
  rows: rows,
5316
5355
  translates: translates,
5317
5356
  height: !transitionInProgress ? elHeight : false
@@ -5322,11 +5361,12 @@
5322
5361
  write: function (ref) {
5323
5362
  var stacks = ref.stacks;
5324
5363
  var height = ref.height;
5364
+ var padding = ref.padding;
5325
5365
 
5326
5366
 
5327
5367
  toggleClass(this.$el, this.clsStack, stacks);
5328
5368
 
5329
- css(this.$el, 'paddingBottom', this.parallax);
5369
+ css(this.$el, 'paddingBottom', padding);
5330
5370
  height !== false && css(this.$el, 'height', height);
5331
5371
 
5332
5372
  },
@@ -5373,6 +5413,22 @@
5373
5413
 
5374
5414
  };
5375
5415
 
5416
+ function getPaddingBottom(distance, rows, translates) {
5417
+ var column = 0;
5418
+ var max = 0;
5419
+ var maxScrolled = 0;
5420
+ for (var i = rows.length - 1; i >= 0; i--) {
5421
+ for (var j = column; j < rows[i].length; j++) {
5422
+ var el = rows[i][j];
5423
+ var bottom = el.offsetTop + height(el) + (translates && -translates[i][j]);
5424
+ max = Math.max(max, bottom);
5425
+ maxScrolled = Math.max(maxScrolled, bottom + (j % 2 ? distance : distance / 8));
5426
+ column++;
5427
+ }
5428
+ }
5429
+ return maxScrolled - max;
5430
+ }
5431
+
5376
5432
  function getMarginTop(root, cls) {
5377
5433
 
5378
5434
  var nodes = toNodes(root.children);
@@ -5398,6 +5454,10 @@
5398
5454
  // IE 11 fix (min-height on a flex container won't apply to its flex items)
5399
5455
  var FlexBug = isIE ? {
5400
5456
 
5457
+ props: {
5458
+ selMinHeight: String
5459
+ },
5460
+
5401
5461
  data: {
5402
5462
  selMinHeight: false,
5403
5463
  forceHeight: false
@@ -5572,13 +5632,25 @@
5572
5632
 
5573
5633
  update: {
5574
5634
 
5575
- read: function () {
5635
+ read: function (ref) {
5636
+ var prev = ref.minHeight;
5637
+
5638
+
5639
+ if (!isVisible(this.$el)) {
5640
+ return false;
5641
+ }
5576
5642
 
5577
5643
  var minHeight = '';
5578
5644
  var box = boxModelAdjust('height', this.$el, 'content-box');
5579
5645
 
5580
5646
  if (this.expand) {
5581
5647
 
5648
+ this.$el.dataset.heightExpand = '';
5649
+
5650
+ if ($('[data-height-expand]') !== this.$el) {
5651
+ return false;
5652
+ }
5653
+
5582
5654
  minHeight = height(window) - (offsetHeight(document.documentElement) - offsetHeight(this.$el)) - box || '';
5583
5655
 
5584
5656
  } else {
@@ -5588,9 +5660,9 @@
5588
5660
 
5589
5661
  if (this.offsetTop) {
5590
5662
 
5591
- var ref = offset(this.$el);
5592
- var top = ref.top;
5593
- minHeight += top < height(window) / 2 ? (" - " + top + "px") : '';
5663
+ var ref$1 = offset(this.$el);
5664
+ var top = ref$1.top;
5665
+ minHeight += top > 0 && top < height(window) / 2 ? (" - " + top + "px") : '';
5594
5666
 
5595
5667
  }
5596
5668
 
@@ -5617,18 +5689,24 @@
5617
5689
  }
5618
5690
 
5619
5691
  return {
5620
- minHeight: minHeight
5692
+ minHeight: minHeight,
5693
+ prev: prev
5621
5694
  };
5622
5695
  },
5623
5696
 
5624
5697
  write: function (ref) {
5625
5698
  var minHeight = ref.minHeight;
5699
+ var prev = ref.prev;
5626
5700
 
5627
5701
 
5628
5702
  css(this.$el, {
5629
5703
  minHeight: minHeight
5630
5704
  });
5631
5705
 
5706
+ if (minHeight !== prev) {
5707
+ this.$update(this.$el, 'resize');
5708
+ }
5709
+
5632
5710
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5633
5711
  css(this.$el, 'minHeight', this.minHeight);
5634
5712
  }
@@ -5642,7 +5720,7 @@
5642
5720
  };
5643
5721
 
5644
5722
  function offsetHeight(el) {
5645
- return el && el.offsetHeight || 0;
5723
+ return el && offset(el).height || 0;
5646
5724
  }
5647
5725
 
5648
5726
  var Svg = {
@@ -5657,19 +5735,20 @@
5657
5735
  width: Number,
5658
5736
  height: Number,
5659
5737
  ratio: Number,
5660
- 'class': String,
5738
+ class: String,
5661
5739
  strokeAnimation: Boolean,
5740
+ focusable: Boolean, // IE 11
5662
5741
  attributes: 'list'
5663
5742
  },
5664
5743
 
5665
5744
  data: {
5666
5745
  ratio: 1,
5667
- include: ['style', 'class'],
5668
- 'class': '',
5746
+ include: ['style', 'class', 'focusable'],
5747
+ class: '',
5669
5748
  strokeAnimation: false
5670
5749
  },
5671
5750
 
5672
- connected: function () {
5751
+ beforeConnect: function () {
5673
5752
  var this$1 = this;
5674
5753
  var assign;
5675
5754
 
@@ -5950,19 +6029,19 @@
5950
6029
 
5951
6030
  install: install,
5952
6031
 
5953
- mixins: [Class, Svg],
6032
+ extends: Svg,
5954
6033
 
5955
6034
  args: 'icon',
5956
6035
 
5957
6036
  props: ['icon'],
5958
6037
 
5959
6038
  data: {
5960
- include: []
6039
+ include: ['focusable']
5961
6040
  },
5962
6041
 
5963
6042
  isIcon: true,
5964
6043
 
5965
- connected: function () {
6044
+ beforeConnect: function () {
5966
6045
  addClass(this.$el, 'uk-icon');
5967
6046
  },
5968
6047
 
@@ -5985,12 +6064,18 @@
5985
6064
 
5986
6065
  var IconComponent = {
5987
6066
 
6067
+ args: false,
6068
+
5988
6069
  extends: Icon,
5989
6070
 
5990
6071
  data: function (vm) {
5991
6072
  return ({
5992
6073
  icon: hyphenate(vm.constructor.options.name)
5993
6074
  });
6075
+ },
6076
+
6077
+ beforeConnect: function () {
6078
+ addClass(this.$el, this.$name);
5994
6079
  }
5995
6080
 
5996
6081
  };
@@ -5999,7 +6084,7 @@
5999
6084
 
6000
6085
  extends: IconComponent,
6001
6086
 
6002
- connected: function () {
6087
+ beforeConnect: function () {
6003
6088
  addClass(this.$el, 'uk-slidenav');
6004
6089
  },
6005
6090
 
@@ -6255,8 +6340,9 @@
6255
6340
  var this$1 = this;
6256
6341
 
6257
6342
 
6343
+ // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
6258
6344
  if (!entries.some(function (entry) {
6259
- return entry.isIntersecting;
6345
+ return isUndefined(entry.isIntersecting) || entry.isIntersecting;
6260
6346
  })) {
6261
6347
  return;
6262
6348
  }
@@ -6514,7 +6600,7 @@
6514
6600
 
6515
6601
  };
6516
6602
 
6517
- var active$1;
6603
+ var active$1 = [];
6518
6604
 
6519
6605
  var Modal = {
6520
6606
 
@@ -6604,36 +6690,18 @@
6604
6690
 
6605
6691
  handler: function (e) {
6606
6692
 
6607
- var prev = active$1 && active$1 !== this && active$1;
6608
-
6609
- active$1 = this;
6610
-
6611
- if (prev) {
6612
- if (this.stack) {
6613
- this.prev = prev;
6614
- } else {
6615
-
6616
- active$1 = prev;
6617
-
6618
- if (prev.isToggled()) {
6619
- prev.hide().then(this.show);
6620
- } else {
6621
- once(prev.$el, 'beforeshow hidden', this.show, false, function (ref) {
6622
- var target = ref.target;
6623
- var type = ref.type;
6624
-
6625
- return type === 'hidden' && target === prev.$el;
6626
- });
6627
- }
6628
- e.preventDefault();
6629
-
6630
- }
6631
-
6632
- return;
6693
+ if (includes(active$1, this)) {
6694
+ return false;
6633
6695
  }
6634
6696
 
6635
- registerEvents();
6636
-
6697
+ if (!this.stack && active$1.length) {
6698
+ Promise.all(active$1.map(function (modal) {
6699
+ return modal.hide();
6700
+ })).then(this.show);
6701
+ e.preventDefault();
6702
+ } else {
6703
+ active$1.push(this);
6704
+ }
6637
6705
  }
6638
6706
 
6639
6707
  },
@@ -6645,27 +6713,43 @@
6645
6713
  self: true,
6646
6714
 
6647
6715
  handler: function () {
6716
+ var this$1 = this;
6717
+
6648
6718
 
6649
- if (!hasClass(document.documentElement, this.clsPage)) {
6650
- this.scrollbarWidth = width(window) - width(document);
6651
- css(document.body, 'overflowY', this.scrollbarWidth && this.overlay ? 'scroll' : '');
6719
+ if (width(window) - width(document) && this.overlay) {
6720
+ css(document.body, 'overflowY', 'scroll');
6652
6721
  }
6653
6722
 
6654
6723
  addClass(document.documentElement, this.clsPage);
6655
6724
 
6656
- }
6657
-
6658
- },
6659
-
6660
- {
6661
-
6662
- name: 'hide',
6663
-
6664
- self: true,
6725
+ if (this.bgClose) {
6726
+ once(this.$el, 'hide', delayOn(document, 'click', function (ref) {
6727
+ var defaultPrevented = ref.defaultPrevented;
6728
+ var target = ref.target;
6729
+
6730
+ var current = last(active$1);
6731
+ if (!defaultPrevented &&
6732
+ current === this$1 &&
6733
+ (!current.overlay || within(target, current.$el)) &&
6734
+ !within(target, current.panel)
6735
+ ) {
6736
+ current.hide();
6737
+ }
6738
+ }), {
6739
+ self: true
6740
+ });
6741
+ }
6665
6742
 
6666
- handler: function () {
6667
- if (!active$1 || active$1 === this && !this.prev) {
6668
- deregisterEvents();
6743
+ if (this.escClose) {
6744
+ once(this.$el, 'hide', on(document, 'keydown', function (e) {
6745
+ var current = last(active$1);
6746
+ if (e.keyCode === 27 && current === this$1) {
6747
+ e.preventDefault();
6748
+ current.hide();
6749
+ }
6750
+ }), {
6751
+ self: true
6752
+ });
6669
6753
  }
6670
6754
  }
6671
6755
 
@@ -6678,32 +6762,18 @@
6678
6762
  self: true,
6679
6763
 
6680
6764
  handler: function () {
6765
+ var this$1 = this;
6681
6766
 
6682
- var found;
6683
- var ref = this;
6684
- var prev = ref.prev;
6685
-
6686
- active$1 = active$1 && active$1 !== this && active$1 || prev;
6687
6767
 
6688
- if (!active$1) {
6768
+ active$1.splice(active$1.indexOf(this), 1);
6689
6769
 
6770
+ if (!active$1.length) {
6690
6771
  css(document.body, 'overflowY', '');
6691
-
6692
- } else {
6693
- while (prev) {
6694
-
6695
- if (prev.clsPage === this.clsPage) {
6696
- found = true;
6697
- break;
6698
- }
6699
-
6700
- prev = prev.prev;
6701
-
6702
- }
6703
-
6704
6772
  }
6705
6773
 
6706
- if (!found) {
6774
+ if (!active$1.some(function (modal) {
6775
+ return modal.clsPage === this$1.clsPage;
6776
+ })) {
6707
6777
  removeClass(document.documentElement, this.clsPage);
6708
6778
  }
6709
6779
 
@@ -6723,10 +6793,6 @@
6723
6793
  var this$1 = this;
6724
6794
 
6725
6795
 
6726
- if (this.isToggled()) {
6727
- return Promise.resolve();
6728
- }
6729
-
6730
6796
  if (this.container && this.$el.parentNode !== this.container) {
6731
6797
  append(this.container, this.$el);
6732
6798
  return new Promise(function (resolve) {
@@ -6740,52 +6806,13 @@
6740
6806
  },
6741
6807
 
6742
6808
  hide: function () {
6743
- return this.isToggled() ?
6744
- this.toggleElement(this.$el, false, animate$1(this)) :
6745
- Promise.resolve();
6746
- },
6747
-
6748
- getActive: function () {
6749
- return active$1;
6809
+ return this.toggleElement(this.$el, false, animate$1(this));
6750
6810
  }
6751
6811
 
6752
6812
  }
6753
6813
 
6754
6814
  };
6755
6815
 
6756
- var events;
6757
-
6758
- function registerEvents() {
6759
-
6760
- if (events) {
6761
- return;
6762
- }
6763
-
6764
- events = [
6765
- on(document, pointerUp, function (ref) {
6766
- var target = ref.target;
6767
- var defaultPrevented = ref.defaultPrevented;
6768
-
6769
- if (active$1 && active$1.bgClose && !defaultPrevented && (!active$1.overlay || within(target, active$1.$el)) && !within(target, active$1.panel)) {
6770
- active$1.hide();
6771
- }
6772
- }),
6773
- on(document, 'keydown', function (e) {
6774
- if (e.keyCode === 27 && active$1 && active$1.escClose) {
6775
- e.preventDefault();
6776
- active$1.hide();
6777
- }
6778
- })
6779
- ];
6780
- }
6781
-
6782
- function deregisterEvents() {
6783
- events && events.forEach(function (unbind) {
6784
- return unbind();
6785
- });
6786
- events = null;
6787
- }
6788
-
6789
6816
  function animate$1(ref) {
6790
6817
  var transitionElement = ref.transitionElement;
6791
6818
  var _toggle = ref._toggle;
@@ -6798,13 +6825,20 @@
6798
6825
 
6799
6826
  _toggle(el, show);
6800
6827
 
6801
- if (toMs(css(transitionElement, 'transitionDuration'))) {
6802
- once(transitionElement, 'transitionend', resolve, false, function (e) {
6803
- return e.target === transitionElement;
6828
+ var off = once(transitionElement, 'transitionstart', function () {
6829
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
6830
+ self: true
6804
6831
  });
6805
- } else {
6832
+ clearTimeout(timer);
6833
+ }, {
6834
+ self: true
6835
+ });
6836
+
6837
+ var timer = setTimeout(function () {
6838
+ off();
6806
6839
  resolve();
6807
- }
6840
+ }, toMs(css(transitionElement, 'transitionDuration')));
6841
+
6808
6842
  });
6809
6843
  });
6810
6844
  };
@@ -6866,15 +6900,12 @@
6866
6900
 
6867
6901
  dialog.show();
6868
6902
 
6869
- on(dialog.$el, 'hidden', function (ref) {
6870
- var target = ref.target;
6871
- var currentTarget = ref.currentTarget;
6872
-
6873
- if (target === currentTarget) {
6874
- Promise.resolve(function () {
6875
- return dialog.$destroy(true);
6876
- });
6877
- }
6903
+ on(dialog.$el, 'hidden', function () {
6904
+ return Promise.resolve(function () {
6905
+ return dialog.$destroy(true);
6906
+ });
6907
+ }, {
6908
+ self: true
6878
6909
  });
6879
6910
 
6880
6911
  return dialog;
@@ -7114,7 +7145,9 @@
7114
7145
  handler: function () {
7115
7146
  var active = this.getActive();
7116
7147
 
7117
- if (active && !matches(this.dropbar, ':hover')) {
7148
+ if (active && !this.dropdowns.some(function (el) {
7149
+ return matches(el, ':hover');
7150
+ })) {
7118
7151
  active.hide();
7119
7152
  }
7120
7153
  }
@@ -7274,7 +7307,8 @@
7274
7307
  clsSidebarAnimation: 'uk-offcanvas-bar-animation',
7275
7308
  clsMode: 'uk-offcanvas',
7276
7309
  clsOverlay: 'uk-offcanvas-overlay',
7277
- selClose: '.uk-offcanvas-close'
7310
+ selClose: '.uk-offcanvas-close',
7311
+ container: false
7278
7312
  },
7279
7313
 
7280
7314
  computed: {
@@ -7333,9 +7367,10 @@
7333
7367
  },
7334
7368
 
7335
7369
  handler: function (ref) {
7336
- var current = ref.current;
7370
+ var hash = ref.current.hash;
7371
+ var defaultPrevented = ref.defaultPrevented;
7337
7372
 
7338
- if (current.hash && $(current.hash, document.body)) {
7373
+ if (!defaultPrevented && hash && $(hash, document.body)) {
7339
7374
  this.hide();
7340
7375
  }
7341
7376
  }
@@ -7345,6 +7380,8 @@
7345
7380
  {
7346
7381
  name: 'touchstart',
7347
7382
 
7383
+ passive: true,
7384
+
7348
7385
  el: function () {
7349
7386
  return this.panel;
7350
7387
  },
@@ -7372,7 +7409,7 @@
7372
7409
  },
7373
7410
 
7374
7411
  handler: function (e) {
7375
- e.preventDefault();
7412
+ e.cancelable && e.preventDefault();
7376
7413
  }
7377
7414
 
7378
7415
  },
@@ -7402,7 +7439,7 @@
7402
7439
  scrollTop === 0 && clientY > 0 ||
7403
7440
  scrollHeight - scrollTop <= clientHeight && clientY < 0
7404
7441
  ) {
7405
- e.preventDefault();
7442
+ e.cancelable && e.preventDefault();
7406
7443
  }
7407
7444
 
7408
7445
  }
@@ -7423,6 +7460,7 @@
7423
7460
 
7424
7461
  css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
7425
7462
  addClass(document.body, this.clsContainer, this.clsFlip);
7463
+ css(document.body, 'touch-action', 'pan-y pinch-zoom');
7426
7464
  css(this.$el, 'display', 'block');
7427
7465
  addClass(this.$el, this.clsOverlay);
7428
7466
  addClass(this.panel, this.clsSidebarAnimation, this.mode !== 'reveal' ? this.clsMode : '');
@@ -7432,6 +7470,7 @@
7432
7470
 
7433
7471
  this.clsContainerAnimation && suppressUserScale();
7434
7472
 
7473
+
7435
7474
  }
7436
7475
  },
7437
7476
 
@@ -7442,11 +7481,7 @@
7442
7481
 
7443
7482
  handler: function () {
7444
7483
  removeClass(document.body, this.clsContainerAnimation);
7445
-
7446
- var active = this.getActive();
7447
- if (this.mode === 'none' || active && active !== this && active !== this.prev) {
7448
- trigger(this.panel, 'transitionend');
7449
- }
7484
+ css(document.body, 'touch-action', '');
7450
7485
  }
7451
7486
  },
7452
7487
 
@@ -7876,7 +7911,7 @@
7876
7911
 
7877
7912
  targets: function () {
7878
7913
  return $$(this.links.map(function (el) {
7879
- return escape(el.hash);
7914
+ return escape(el.hash).substr(1);
7880
7915
  }).join(','));
7881
7916
  }
7882
7917
 
@@ -7966,7 +8001,7 @@
7966
8001
  props: {
7967
8002
  top: null,
7968
8003
  bottom: Boolean,
7969
- offset: Number,
8004
+ offset: String,
7970
8005
  animation: String,
7971
8006
  clsActive: String,
7972
8007
  clsInactive: String,
@@ -7995,6 +8030,12 @@
7995
8030
 
7996
8031
  computed: {
7997
8032
 
8033
+ offset: function (ref) {
8034
+ var offset = ref.offset;
8035
+
8036
+ return toPx(offset);
8037
+ },
8038
+
7998
8039
  selTarget: function (ref, $el) {
7999
8040
  var selTarget = ref.selTarget;
8000
8041
 
@@ -8302,21 +8343,13 @@
8302
8343
  return;
8303
8344
  }
8304
8345
 
8305
- if (isNumeric(value)) {
8306
-
8307
- return propOffset + toFloat(value);
8308
-
8309
- } else if (isString(value) && value.match(/^-?\d+vh$/)) {
8346
+ if (isNumeric(value) && isString(value) && value.match(/^-?\d/)) {
8310
8347
 
8311
- return height(window) * toFloat(value) / 100;
8348
+ return propOffset + toPx(value);
8312
8349
 
8313
8350
  } else {
8314
8351
 
8315
- var el = value === true ? $el.parentNode : query(value, $el);
8316
-
8317
- if (el) {
8318
- return offset(el).top + el.offsetHeight;
8319
- }
8352
+ return offset(value === true ? $el.parentNode : query(value, $el)).bottom;
8320
8353
 
8321
8354
  }
8322
8355
  }
@@ -8428,12 +8461,14 @@
8428
8461
  var children = ref.children;
8429
8462
  this.show(filter(children, ("." + (this.cls)))[0] || children[this.active] || children[0]);
8430
8463
 
8464
+ this.swiping && css(this.connects, 'touch-action', 'pan-y pinch-zoom');
8465
+
8431
8466
  },
8432
8467
 
8433
8468
  methods: {
8434
8469
 
8435
8470
  index: function () {
8436
- return !!this.connects.length && index(filter(this.connects[0].children, ("." + (this.cls)))[0]);
8471
+ return !isEmpty(this.connects) && index(filter(this.connects[0].children, ("." + (this.cls)))[0]);
8437
8472
  },
8438
8473
 
8439
8474
  show: function (item) {
@@ -8579,7 +8614,7 @@
8579
8614
 
8580
8615
  // TODO better isToggled handling
8581
8616
  var link;
8582
- if (closest(e.target, 'a[href="#"], a[href=""], button') ||
8617
+ if (closest(e.target, 'a[href="#"], a[href=""]') ||
8583
8618
  (link = closest(e.target, 'a[href]')) && (
8584
8619
  this.cls ||
8585
8620
  !isVisible(this.target) ||
@@ -8684,7 +8719,7 @@
8684
8719
 
8685
8720
  }
8686
8721
 
8687
- UIkit.version = '3.1.0';
8722
+ UIkit.version = '3.2.0';
8688
8723
 
8689
8724
  core(UIkit);
8690
8725
 
@@ -9080,7 +9115,7 @@
9080
9115
  children: {
9081
9116
 
9082
9117
  get: function () {
9083
- return toNodes(this.target.children);
9118
+ return toNodes(this.target && this.target.children);
9084
9119
  },
9085
9120
 
9086
9121
  watch: function (list, old) {
@@ -9119,14 +9154,13 @@
9119
9154
 
9120
9155
  this.updateState();
9121
9156
 
9122
- if (this.selActive === false) {
9123
- return;
9157
+ if (this.selActive !== false) {
9158
+ var actives = $$(this.selActive, this.$el);
9159
+ this.toggles.forEach(function (el) {
9160
+ return toggleClass(el, this$1.cls, includes(actives, el));
9161
+ });
9124
9162
  }
9125
9163
 
9126
- var actives = $$(this.selActive, this.$el);
9127
- this.toggles.forEach(function (el) {
9128
- return toggleClass(el, this$1.cls, includes(actives, el));
9129
- });
9130
9164
  },
9131
9165
 
9132
9166
  methods: {
@@ -9170,7 +9204,7 @@
9170
9204
  var children = ref.children;
9171
9205
 
9172
9206
  this.toggles.forEach(function (el) {
9173
- return toggleClass(el, this$1.cls, matchFilter(el, this$1.attrItem, state));
9207
+ return toggleClass(el, this$1.cls, !!matchFilter(el, this$1.attrItem, state));
9174
9208
  });
9175
9209
 
9176
9210
  var apply = function () {
@@ -9225,31 +9259,42 @@
9225
9259
 
9226
9260
  function mergeState(el, attr, state) {
9227
9261
 
9228
- toNodes(el).forEach(function (el) {
9229
- var filterBy = getFilter(el, attr);
9230
- var filter = filterBy.filter;
9231
- var group = filterBy.group;
9232
- var sort = filterBy.sort;
9233
- var order = filterBy.order;
9234
- if (order === void 0) order = 'asc';
9262
+ var filterBy = getFilter(el, attr);
9263
+ var filter = filterBy.filter;
9264
+ var group = filterBy.group;
9265
+ var sort = filterBy.sort;
9266
+ var order = filterBy.order;
9267
+ if (order === void 0) order = 'asc';
9268
+
9269
+ if (filter || isUndefined(sort)) {
9235
9270
 
9236
- if (filter || isUndefined(sort)) {
9271
+ if (group) {
9237
9272
 
9238
- if (group) {
9273
+ if (filter) {
9239
9274
  delete state.filter[''];
9240
9275
  state.filter[group] = filter;
9241
9276
  } else {
9242
- state.filter = {
9243
- '': filter || ''
9244
- };
9277
+ delete state.filter[group];
9278
+
9279
+ if (isEmpty(state.filter) || '' in state.filter) {
9280
+ state.filter = {
9281
+ '': filter || ''
9282
+ };
9283
+ }
9284
+
9245
9285
  }
9246
9286
 
9287
+ } else {
9288
+ state.filter = {
9289
+ '': filter || ''
9290
+ };
9247
9291
  }
9248
9292
 
9249
- if (!isUndefined(sort)) {
9250
- state.sort = [sort, order];
9251
- }
9252
- });
9293
+ }
9294
+
9295
+ if (!isUndefined(sort)) {
9296
+ state.sort = [sort, order];
9297
+ }
9253
9298
 
9254
9299
  return state;
9255
9300
  }
@@ -9266,17 +9311,17 @@
9266
9311
 
9267
9312
  var ref$1 = getFilter(el, attr);
9268
9313
  var filter = ref$1.filter;
9314
+ if (filter === void 0) filter = '';
9269
9315
  var group = ref$1.group;
9270
9316
  if (group === void 0) group = '';
9271
9317
  var sort = ref$1.sort;
9272
9318
  var order = ref$1.order;
9273
9319
  if (order === void 0) order = 'asc';
9274
9320
 
9275
- filter = isUndefined(sort) ? filter || '' : filter;
9276
- sort = isUndefined(filter) ? sort || '' : sort;
9277
-
9278
- return (isUndefined(filter) || group in stateFilter && filter === stateFilter[group]) &&
9279
- (isUndefined(sort) || stateSort === sort && stateOrder === order);
9321
+ return isUndefined(sort) ?
9322
+ group in stateFilter && filter === stateFilter[group] ||
9323
+ !filter && group && !(group in stateFilter) && !stateFilter[''] :
9324
+ stateSort === sort && stateOrder === order;
9280
9325
  }
9281
9326
 
9282
9327
  function isEqualList(listA, listB) {
@@ -9344,7 +9389,8 @@
9344
9389
  if (value === void 0) value = 0;
9345
9390
  if (unit === void 0) unit = '%';
9346
9391
 
9347
- return ("translateX(" + value + (value ? unit : '') + ")"); // currently not translate3d to support IE, translate3d within translate3d does not work while transitioning
9392
+ value += value ? unit : '';
9393
+ return isIE ? ("translateX(" + value + ")") : ("translate3d(" + value + ", 0, 0)"); // currently not translate3d in IE, translate3d within translate3d does not work while transitioning
9348
9394
  }
9349
9395
 
9350
9396
  function scale3d(value) {
@@ -9567,34 +9613,6 @@
9567
9613
  }
9568
9614
  }
9569
9615
 
9570
- },
9571
-
9572
- {
9573
-
9574
- name: 'mouseenter',
9575
-
9576
- filter: function () {
9577
- return this.autoplay && this.pauseOnHover;
9578
- },
9579
-
9580
- handler: function () {
9581
- this.isHovering = true;
9582
- }
9583
-
9584
- },
9585
-
9586
- {
9587
-
9588
- name: 'mouseleave',
9589
-
9590
- filter: function () {
9591
- return this.autoplay && this.pauseOnHover;
9592
- },
9593
-
9594
- handler: function () {
9595
- this.isHovering = false;
9596
- }
9597
-
9598
9616
  }
9599
9617
 
9600
9618
  ],
@@ -9609,8 +9627,8 @@
9609
9627
 
9610
9628
  this.interval = setInterval(
9611
9629
  function () {
9612
- return !within(document.activeElement, this$1.$el) &&
9613
- !this$1.isHovering &&
9630
+ return (!this$1.draggable || !$(':focus', this$1.$el)) &&
9631
+ (!this$1.pauseOnHover || !matches(this$1.$el, ':hover')) &&
9614
9632
  !this$1.stack.length &&
9615
9633
  this$1.show('next');
9616
9634
  },
@@ -9990,6 +10008,7 @@
9990
10008
  finite: false,
9991
10009
  velocity: 1,
9992
10010
  index: 0,
10011
+ prevIndex: -1,
9993
10012
  stack: [],
9994
10013
  percent: 0,
9995
10014
  clsActive: 'uk-active',
@@ -9999,6 +10018,16 @@
9999
10018
  });
10000
10019
  },
10001
10020
 
10021
+ connected: function () {
10022
+ this.prevIndex = -1;
10023
+ this.index = this.getValidIndex(this.index);
10024
+ this.stack = [];
10025
+ },
10026
+
10027
+ disconnected: function () {
10028
+ removeClass(this.slides, this.clsActive);
10029
+ },
10030
+
10002
10031
  computed: {
10003
10032
 
10004
10033
  duration: function (ref, $el) {
@@ -10007,10 +10036,6 @@
10007
10036
  return speedUp($el.offsetWidth / velocity);
10008
10037
  },
10009
10038
 
10010
- length: function () {
10011
- return this.slides.length;
10012
- },
10013
-
10014
10039
  list: function (ref, $el) {
10015
10040
  var selList = ref.selList;
10016
10041
 
@@ -10027,8 +10052,20 @@
10027
10052
  return (selList + " > *");
10028
10053
  },
10029
10054
 
10030
- slides: function () {
10031
- return toNodes(this.list.children);
10055
+ slides: {
10056
+
10057
+ get: function () {
10058
+ return toNodes(this.list.children);
10059
+ },
10060
+
10061
+ watch: function () {
10062
+ this.$reset();
10063
+ }
10064
+
10065
+ },
10066
+
10067
+ length: function () {
10068
+ return this.slides.length;
10032
10069
  }
10033
10070
 
10034
10071
  },
@@ -10162,7 +10199,7 @@
10162
10199
  },
10163
10200
 
10164
10201
  _getDistance: function (prev, next) {
10165
- return new this._getTransitioner(prev, prev !== next && next).getDistance();
10202
+ return this._getTransitioner(prev, prev !== next && next).getDistance();
10166
10203
  },
10167
10204
 
10168
10205
  _translate: function (percent, prev, next) {
@@ -10248,10 +10285,6 @@
10248
10285
  this.$update(target);
10249
10286
  },
10250
10287
 
10251
- itemshow: function () {
10252
- isNumber(this.prevIndex) && fastdom.flush(); // iOS 10+ will honor the video.play only if called from a gesture handler
10253
- },
10254
-
10255
10288
  beforeitemshow: function (ref) {
10256
10289
  var target = ref.target;
10257
10290
 
@@ -10298,6 +10331,7 @@
10298
10331
  selList: '.uk-lightbox-items',
10299
10332
  attrItem: 'uk-lightbox-item',
10300
10333
  selClose: '.uk-close-large',
10334
+ selCaption: '.uk-lightbox-caption',
10301
10335
  pauseOnHover: false,
10302
10336
  velocity: 2,
10303
10337
  Animations: Animations$1,
@@ -10306,16 +10340,24 @@
10306
10340
  },
10307
10341
 
10308
10342
  created: function () {
10309
- var this$1 = this;
10310
10343
 
10344
+ var $el = $(this.template);
10345
+ var list = $(this.selList, $el);
10346
+ this.items.forEach(function () {
10347
+ return append(list, '<li></li>');
10348
+ });
10349
+
10350
+ this.$mount(append(this.container, $el));
10311
10351
 
10312
- this.$mount(append(this.container, this.template));
10352
+ },
10313
10353
 
10314
- this.caption = $('.uk-lightbox-caption', this.$el);
10354
+ computed: {
10315
10355
 
10316
- this.items.forEach(function () {
10317
- return append(this$1.list, '<li></li>');
10318
- });
10356
+ caption: function (ref, $el) {
10357
+ var selCaption = ref.selCaption;
10358
+
10359
+ return $('.uk-lightbox-caption', $el);
10360
+ }
10319
10361
 
10320
10362
  },
10321
10363
 
@@ -10331,7 +10373,7 @@
10331
10373
 
10332
10374
  {
10333
10375
 
10334
- name: pointerUp,
10376
+ name: 'click',
10335
10377
 
10336
10378
  self: true,
10337
10379
 
@@ -10345,7 +10387,6 @@
10345
10387
  return;
10346
10388
  }
10347
10389
 
10348
- e.preventDefault();
10349
10390
  this.hide();
10350
10391
  }
10351
10392
 
@@ -10670,6 +10711,10 @@
10670
10711
  this.hide();
10671
10712
  }
10672
10713
 
10714
+ },
10715
+
10716
+ items: function () {
10717
+ return uniqueBy(this.toggles.map(toItem), 'source');
10673
10718
  }
10674
10719
 
10675
10720
  },
@@ -10690,7 +10735,12 @@
10690
10735
 
10691
10736
  handler: function (e) {
10692
10737
  e.preventDefault();
10693
- this.show(index(this.toggles, e.current));
10738
+ var src = data(e.current, 'href');
10739
+ this.show(findIndex(this.items, function (ref) {
10740
+ var source = ref.source;
10741
+
10742
+ return source === src;
10743
+ }));
10694
10744
  }
10695
10745
 
10696
10746
  }
@@ -10704,19 +10754,15 @@
10704
10754
 
10705
10755
 
10706
10756
  this.panel = this.panel || this.$create('lightboxPanel', assign({}, this.$props, {
10707
- items: uniqueBy(this.toggles.reduce(function (items, el) {
10708
- items.push(['href', 'caption', 'type', 'poster', 'alt'].reduce(function (obj, attr) {
10709
- obj[attr === 'href' ? 'source' : attr] = data(el, attr);
10710
- return obj;
10711
- }, {}));
10712
- return items;
10713
- }, []), 'source')
10757
+ items: this.items
10714
10758
  }));
10715
10759
 
10716
10760
  on(this.panel.$el, 'hidden', function () {
10717
10761
  return this$1.panel = false;
10718
10762
  });
10763
+
10719
10764
  return this.panel.show(index);
10765
+
10720
10766
  },
10721
10767
 
10722
10768
  hide: function () {
@@ -10742,6 +10788,13 @@
10742
10788
 
10743
10789
  }
10744
10790
 
10791
+ function toItem(el) {
10792
+ return ['href', 'caption', 'type', 'poster', 'alt'].reduce(function (obj, attr) {
10793
+ obj[attr === 'href' ? 'source' : attr] = data(el, attr);
10794
+ return obj;
10795
+ }, {});
10796
+ }
10797
+
10745
10798
  var obj;
10746
10799
 
10747
10800
  var containers = {};
@@ -10923,7 +10976,7 @@
10923
10976
  0) || 0);
10924
10977
  }
10925
10978
 
10926
- var unit = getUnit(steps, prop);
10979
+ var unit = getUnit(steps);
10927
10980
 
10928
10981
  if (isColor) {
10929
10982
 
@@ -11357,10 +11410,11 @@
11357
11410
  return;
11358
11411
  }
11359
11412
 
11360
- var index = this.getValidIndex();
11361
- delete this.index;
11362
- removeClass(this.slides, this.clsActive, this.clsActivated);
11363
- this.show(index);
11413
+ var index = this.getValidIndex(this.index);
11414
+
11415
+ if (!~this.prevIndex || this.index !== index) {
11416
+ this.show(index);
11417
+ }
11364
11418
 
11365
11419
  },
11366
11420
 
@@ -11601,7 +11655,7 @@
11601
11655
  }
11602
11656
 
11603
11657
  if (this.center) {
11604
- return this.sets[this.sets.length - 1];
11658
+ return last(this.sets);
11605
11659
  }
11606
11660
 
11607
11661
  css(this.slides, 'order', '');
@@ -11661,7 +11715,7 @@
11661
11715
 
11662
11716
  }, []);
11663
11717
 
11664
- return sets && sets.length && sets;
11718
+ return !isEmpty(sets) && sets;
11665
11719
 
11666
11720
  },
11667
11721
 
@@ -11689,6 +11743,10 @@
11689
11743
  this$1.maxIndex && toggleClass(el, 'uk-hidden', isNumeric(index) && (this$1.sets && !includes(this$1.sets, toFloat(index)) || index > this$1.maxIndex));
11690
11744
  });
11691
11745
 
11746
+ if (!this.dragging && !this.stack.length) {
11747
+ this._getTransitioner().translate(1);
11748
+ }
11749
+
11692
11750
  },
11693
11751
 
11694
11752
  events: ['resize']
@@ -11820,7 +11878,7 @@
11820
11878
 
11821
11879
  };
11822
11880
 
11823
- var SliderParallax = {
11881
+ var SlideshowParallax = {
11824
11882
 
11825
11883
  mixins: [Parallax],
11826
11884
 
@@ -12163,7 +12221,7 @@
12163
12221
  write: function (ref) {
12164
12222
  var height = ref.height;
12165
12223
 
12166
- css(this.list, 'minHeight', height);
12224
+ height > 0 && css(this.list, 'minHeight', height);
12167
12225
  },
12168
12226
 
12169
12227
  events: ['resize']
@@ -12237,7 +12295,7 @@
12237
12295
  write: function () {
12238
12296
 
12239
12297
  if (this.clsEmpty) {
12240
- toggleClass(this.$el, this.clsEmpty, !this.$el.children.length);
12298
+ toggleClass(this.$el, this.clsEmpty, isEmpty(this.$el.children));
12241
12299
  }
12242
12300
 
12243
12301
  css(this.handle ? $$(this.handle, this.$el) : this.$el.children, {
@@ -12245,30 +12303,21 @@
12245
12303
  userSelect: 'none'
12246
12304
  });
12247
12305
 
12248
- if (!this.drag) {
12249
- return;
12250
- }
12306
+ if (this.drag) {
12251
12307
 
12252
- offset(this.drag, {
12253
- top: this.pos.y + this.origin.top,
12254
- left: this.pos.x + this.origin.left
12255
- });
12308
+ // clamp to viewport
12309
+ var ref = offset(window);
12310
+ var right = ref.right;
12311
+ var bottom = ref.bottom;
12312
+ offset(this.drag, {
12313
+ top: clamp(this.pos.y + this.origin.top, 0, bottom - this.drag.offsetHeight),
12314
+ left: clamp(this.pos.x + this.origin.left, 0, right - this.drag.offsetWidth)
12315
+ });
12256
12316
 
12257
- var ref = offset(this.drag);
12258
- var top = ref.top;
12259
- var offsetHeight = ref.height;
12260
- var bottom = top + offsetHeight;
12261
- var scroll;
12317
+ trackScroll(this.pos);
12262
12318
 
12263
- if (top > 0 && top < this.scrollY) {
12264
- scroll = this.scrollY - 5;
12265
- } else if (bottom < height(document) && bottom > height(window) + this.scrollY) {
12266
- scroll = this.scrollY + 5;
12267
12319
  }
12268
12320
 
12269
- scroll && setTimeout(function () {
12270
- return scrollTop(window, scroll);
12271
- }, 5);
12272
12321
  }
12273
12322
 
12274
12323
  },
@@ -12321,7 +12370,8 @@
12321
12370
  css(this.drag, assign({
12322
12371
  boxSizing: 'border-box',
12323
12372
  width: this.placeholder.offsetWidth,
12324
- height: this.placeholder.offsetHeight
12373
+ height: this.placeholder.offsetHeight,
12374
+ overflow: 'hidden'
12325
12375
  }, css(this.placeholder, ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom'])));
12326
12376
  attr(this.drag, 'uk-no-boot', '');
12327
12377
  addClass(this.drag, this.clsDrag, this.clsCustom);
@@ -12336,8 +12386,6 @@
12336
12386
  top: top - this.pos.y
12337
12387
  });
12338
12388
 
12339
- css(this.origin.target, 'pointerEvents', 'none');
12340
-
12341
12389
  addClass(this.placeholder, this.clsPlaceholder);
12342
12390
  addClass(this.$el.children, this.clsItem);
12343
12391
  addClass(document.documentElement, this.clsDragState);
@@ -12394,8 +12442,6 @@
12394
12442
  off(document, pointerUp, this.end);
12395
12443
  off(window, 'scroll', this.scroll);
12396
12444
 
12397
- css(this.origin.target, 'pointerEvents', '');
12398
-
12399
12445
  if (!this.drag) {
12400
12446
  if (e.type === 'touchend') {
12401
12447
  e.target.click();
@@ -12404,6 +12450,8 @@
12404
12450
  return;
12405
12451
  }
12406
12452
 
12453
+ untrackScroll();
12454
+
12407
12455
  var sortable = this.getSortable(this.placeholder);
12408
12456
 
12409
12457
  if (this === sortable) {
@@ -12503,6 +12551,76 @@
12503
12551
  return element.parentNode === target.parentNode && index(element) > index(target);
12504
12552
  }
12505
12553
 
12554
+ var trackTimer;
12555
+
12556
+ function trackScroll(ref) {
12557
+ var x = ref.x;
12558
+ var y = ref.y;
12559
+
12560
+
12561
+ clearTimeout(trackTimer);
12562
+
12563
+ scrollParents(document.elementFromPoint(x - window.pageXOffset, y - window.pageYOffset)).some(function (scrollEl) {
12564
+
12565
+ var scroll = scrollEl.scrollTop;
12566
+ var scrollHeight = scrollEl.scrollHeight;
12567
+
12568
+ if (getScrollingElement() === scrollEl) {
12569
+ scrollEl = window;
12570
+ scrollHeight -= window.innerHeight;
12571
+ }
12572
+
12573
+ var ref = offset(scrollEl);
12574
+ var top = ref.top;
12575
+ var bottom = ref.bottom;
12576
+
12577
+ if (top < y && top + 30 > y) {
12578
+ scroll -= 5;
12579
+ } else if (bottom > y && bottom - 20 < y) {
12580
+ scroll += 5;
12581
+ }
12582
+
12583
+ if (scroll > 0 && scroll < scrollHeight) {
12584
+ return trackTimer = setTimeout(function () {
12585
+ scrollTop(scrollEl, scroll);
12586
+ trackScroll({
12587
+ x: x,
12588
+ y: y
12589
+ });
12590
+ }, 10);
12591
+ }
12592
+
12593
+ });
12594
+
12595
+ }
12596
+
12597
+ function untrackScroll() {
12598
+ clearTimeout(trackTimer);
12599
+ }
12600
+
12601
+ var overflowRe = /auto|scroll/;
12602
+
12603
+ function scrollParents(element) {
12604
+ var scrollEl = getScrollingElement();
12605
+ return parents$1(element, function (parent) {
12606
+ return parent === scrollEl || overflowRe.test(css(parent, 'overflow'));
12607
+ });
12608
+ }
12609
+
12610
+ function parents$1(element, fn) {
12611
+ var parents = [];
12612
+ do {
12613
+ if (fn(element)) {
12614
+ parents.unshift(element);
12615
+ }
12616
+ } while (element && (element = element.parentElement));
12617
+ return parents;
12618
+ }
12619
+
12620
+ function getScrollingElement() {
12621
+ return document.scrollingElement || document.documentElement;
12622
+ }
12623
+
12506
12624
  var obj$1;
12507
12625
 
12508
12626
  var actives = [];
@@ -12550,7 +12668,7 @@
12550
12668
  var this$1 = this;
12551
12669
 
12552
12670
 
12553
- if (this.isActive()) {
12671
+ if (this.isActive() || !this.title) {
12554
12672
  return;
12555
12673
  }
12556
12674
 
@@ -12578,7 +12696,7 @@
12578
12696
 
12579
12697
  hide: function () {
12580
12698
 
12581
- if (!this.isActive() || matches(this.$el, 'input') && this.$el === document.activeElement) {
12699
+ if (!this.isActive() || matches(this.$el, 'input:focus')) {
12582
12700
  return;
12583
12701
  }
12584
12702
 
@@ -12853,9 +12971,9 @@
12853
12971
  UIkit.component('notification', Notification);
12854
12972
  UIkit.component('parallax', Parallax$1);
12855
12973
  UIkit.component('slider', Slider$1);
12856
- UIkit.component('sliderParallax', SliderParallax);
12974
+ UIkit.component('sliderParallax', SlideshowParallax);
12857
12975
  UIkit.component('slideshow', Slideshow$1);
12858
- UIkit.component('slideshowParallax', SliderParallax);
12976
+ UIkit.component('slideshowParallax', SlideshowParallax);
12859
12977
  UIkit.component('sortable', Sortable);
12860
12978
  UIkit.component('tooltip', Tooltip);
12861
12979
  UIkit.component('upload', Upload);