uikit-reset 3.3.0 → 3.4.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.3.0 | http://www.getuikit.com | (c) 2014 - 2019 YOOtheme | MIT License */
3
+ /*! UIkit 3.4.0 | https://www.getuikit.com | (c) 2014 - 2020 YOOtheme | MIT License */
4
4
 
5
5
  (function (global, factory) {
6
6
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -595,26 +595,6 @@
595
595
  return element && isElement(element.parentNode) && element.parentNode;
596
596
  }
597
597
 
598
- function parents(element, selector) {
599
- var elements = [];
600
-
601
- while ((element = parent(element))) {
602
- if (!selector || matches(element, selector)) {
603
- elements.push(element);
604
- }
605
- }
606
-
607
- return elements;
608
- }
609
-
610
- function children(element, selector) {
611
- element = toNode(element);
612
- var children = element ? toNodes(element.children) : [];
613
- return selector ? children.filter(function (element) {
614
- return matches(element, selector);
615
- }) : children;
616
- }
617
-
618
598
  var escapeFn = window.CSS && CSS.escape || function (css) {
619
599
  return css.replace(/([^\x7f-\uFFFF\w-])/g, function (match) {
620
600
  return ("\\" + match);
@@ -679,6 +659,24 @@
679
659
  matches(element, selector) || closest(element, selector);
680
660
  }
681
661
 
662
+ function parents(element, selector) {
663
+ var elements = [];
664
+
665
+ while ((element = parent(element))) {
666
+ if (!selector || matches(element, selector)) {
667
+ elements.push(element);
668
+ }
669
+ }
670
+
671
+ return elements;
672
+ }
673
+
674
+ function children(element, selector) {
675
+ element = toNode(element);
676
+ var children = element ? toNodes(element.children) : [];
677
+ return selector ? filter(children, selector) : children;
678
+ }
679
+
682
680
  function on() {
683
681
  var args = [],
684
682
  len = arguments.length;
@@ -847,14 +845,12 @@
847
845
  return e.pointerType === 'touch' || !!e.touches;
848
846
  }
849
847
 
850
- function getEventPos(e, prop) {
851
- if (prop === void 0) prop = 'client';
852
-
848
+ function getEventPos(e) {
853
849
  var touches = e.touches;
854
850
  var changedTouches = e.changedTouches;
855
851
  var ref = touches && touches[0] || changedTouches && changedTouches[0] || e;
856
- var x = ref[(prop + "X")];
857
- var y = ref[(prop + "Y")];
852
+ var x = ref.clientX;
853
+ var y = ref.clientY;
858
854
 
859
855
  return {
860
856
  x: x,
@@ -2034,7 +2030,7 @@
2034
2030
 
2035
2031
  if (pos.length === 1) {
2036
2032
  pos = x.test(pos[0]) ?
2037
- pos.concat(['center']) :
2033
+ pos.concat('center') :
2038
2034
  y.test(pos[0]) ?
2039
2035
  ['center'].concat(pos) :
2040
2036
  ['center', 'center'];
@@ -2181,7 +2177,7 @@
2181
2177
 
2182
2178
  var position;
2183
2179
  this.unbind = on(document, 'mousemove', function (e) {
2184
- return position = getEventPos(e, 'page');
2180
+ return position = getEventPos(e);
2185
2181
  });
2186
2182
  this.interval = setInterval(function () {
2187
2183
 
@@ -2209,7 +2205,7 @@
2209
2205
  return false;
2210
2206
  }
2211
2207
 
2212
- var p = offset(target);
2208
+ var p = target.getBoundingClientRect();
2213
2209
  var left = p.left;
2214
2210
  var right = p.right;
2215
2211
  var top = p.top;
@@ -2601,28 +2597,28 @@
2601
2597
  function listen(cb) {
2602
2598
 
2603
2599
  return new Promise(function (resolve) {
2600
+ return once(window, 'message', function (_, data) {
2601
+ return resolve(data);
2602
+ }, false, function (ref) {
2603
+ var data = ref.data;
2604
2604
 
2605
- once(window, 'message', function (_, data) {
2606
- return resolve(data);
2607
- }, false, function (ref) {
2608
- var data = ref.data;
2609
2605
 
2606
+ if (!data || !isString(data)) {
2607
+ return;
2608
+ }
2610
2609
 
2611
- if (!data || !isString(data)) {
2612
- return;
2613
- }
2614
-
2615
- try {
2616
- data = JSON.parse(data);
2617
- } catch (e) {
2618
- return;
2619
- }
2610
+ try {
2611
+ data = JSON.parse(data);
2612
+ } catch (e) {
2613
+ return;
2614
+ }
2620
2615
 
2621
- return data && cb(data);
2616
+ return data && cb(data);
2622
2617
 
2623
- });
2618
+ });
2619
+ }
2624
2620
 
2625
- });
2621
+ );
2626
2622
 
2627
2623
  }
2628
2624
 
@@ -2676,10 +2672,8 @@
2676
2672
 
2677
2673
  function scrollIntoView(element, ref) {
2678
2674
  if (ref === void 0) ref = {};
2679
- var duration = ref.duration;
2680
- if (duration === void 0) duration = 1000;
2681
- var offset = ref.offset;
2682
- if (offset === void 0) offset = 0;
2675
+ var offsetBy = ref.offset;
2676
+ if (offsetBy === void 0) offsetBy = 0;
2683
2677
 
2684
2678
 
2685
2679
  if (!isVisible(element)) {
@@ -2687,7 +2681,6 @@
2687
2681
  }
2688
2682
 
2689
2683
  var parents = overflowParents(element).concat(element);
2690
- duration /= parents.length - 1;
2691
2684
 
2692
2685
  var promise = Promise.resolve();
2693
2686
  var loop = function (i) {
@@ -2698,7 +2691,8 @@
2698
2691
  var element = parents[i + 1];
2699
2692
 
2700
2693
  var scroll = scrollElement.scrollTop;
2701
- var top = position(element, getViewport(scrollElement)).top - offset;
2694
+ var top = Math.ceil(position(element, getViewport(scrollElement)).top - offsetBy);
2695
+ var duration = getDuration(Math.abs(top));
2702
2696
 
2703
2697
  var start = Date.now();
2704
2698
  var step = function () {
@@ -2725,6 +2719,10 @@
2725
2719
 
2726
2720
  return promise;
2727
2721
 
2722
+ function getDuration(dist) {
2723
+ return 40 * Math.pow(dist, .375);
2724
+ }
2725
+
2728
2726
  function ease(k) {
2729
2727
  return 0.5 * (1 - Math.cos(Math.PI * k));
2730
2728
  }
@@ -2861,7 +2859,6 @@
2861
2859
  return IntersectionObserverClass;
2862
2860
  }());
2863
2861
 
2864
-
2865
2862
  var util = /*#__PURE__*/ Object.freeze({
2866
2863
  __proto__: null,
2867
2864
  ajax: ajax,
@@ -2930,6 +2927,8 @@
2930
2927
  isInput: isInput,
2931
2928
  filter: filter,
2932
2929
  within: within,
2930
+ parents: parents,
2931
+ children: children,
2933
2932
  hasOwn: hasOwn,
2934
2933
  hyphenate: hyphenate,
2935
2934
  camelize: camelize,
@@ -2988,8 +2987,6 @@
2988
2987
  matches: matches,
2989
2988
  closest: closest,
2990
2989
  parent: parent,
2991
- parents: parents,
2992
- children: children,
2993
2990
  escape: escape,
2994
2991
  css: css,
2995
2992
  getStyles: getStyles,
@@ -3083,7 +3080,6 @@
3083
3080
  }
3084
3081
 
3085
3082
  }
3086
-
3087
3083
  }
3088
3084
 
3089
3085
  function hooksAPI(UIkit) {
@@ -3109,6 +3105,11 @@
3109
3105
 
3110
3106
  this._data = {};
3111
3107
  this._computeds = {};
3108
+ this._frames = {
3109
+ reads: {},
3110
+ writes: {}
3111
+ };
3112
+
3112
3113
  this._initProps();
3113
3114
 
3114
3115
  this._callHook('beforeConnect');
@@ -3194,6 +3195,54 @@
3194
3195
 
3195
3196
  };
3196
3197
 
3198
+ UIkit.prototype._callWatches = function () {
3199
+ var this$1 = this;
3200
+
3201
+
3202
+ var ref = this;
3203
+ var _frames = ref._frames;
3204
+
3205
+ if (_frames.watch) {
3206
+ return;
3207
+ }
3208
+
3209
+ var initital = !hasOwn(_frames, 'watch');
3210
+
3211
+ _frames.watch = fastdom.read(function () {
3212
+
3213
+ if (!this$1._connected) {
3214
+ return;
3215
+ }
3216
+
3217
+ var ref = this$1;
3218
+ var computed = ref.$options.computed;
3219
+ var _computeds = ref._computeds;
3220
+
3221
+ for (var key in computed) {
3222
+
3223
+ var hasPrev = hasOwn(_computeds, key);
3224
+ var prev = _computeds[key];
3225
+
3226
+ delete _computeds[key];
3227
+
3228
+ var ref$1 = computed[key];
3229
+ var watch = ref$1.watch;
3230
+ var immediate = ref$1.immediate;
3231
+ if (watch && (
3232
+ initital && immediate ||
3233
+ hasPrev && !isEqual(prev, this$1[key])
3234
+ )) {
3235
+ watch.call(this$1, this$1[key], prev);
3236
+ }
3237
+
3238
+ }
3239
+
3240
+ _frames.watch = null;
3241
+
3242
+ });
3243
+
3244
+ };
3245
+
3197
3246
  }
3198
3247
 
3199
3248
  function stateAPI(UIkit) {
@@ -3209,12 +3258,6 @@
3209
3258
  this.$el = null;
3210
3259
  this.$props = {};
3211
3260
 
3212
- this._frames = {
3213
- reads: {},
3214
- writes: {}
3215
- };
3216
- this._events = [];
3217
-
3218
3261
  this._uid = uid++;
3219
3262
  this._initData();
3220
3263
  this._initMethods();
@@ -3263,25 +3306,6 @@
3263
3306
  }
3264
3307
  };
3265
3308
 
3266
- UIkit.prototype._callWatches = function () {
3267
-
3268
- var ref = this;
3269
- var computed = ref.$options.computed;
3270
- var _computeds = ref._computeds;
3271
-
3272
- for (var key in _computeds) {
3273
-
3274
- var value = _computeds[key];
3275
- delete _computeds[key];
3276
-
3277
- if (computed[key].watch && !isEqual(value, this[key])) {
3278
- computed[key].watch.call(this, this[key], value);
3279
- }
3280
-
3281
- }
3282
-
3283
- };
3284
-
3285
3309
  UIkit.prototype._initProps = function (props) {
3286
3310
 
3287
3311
  var key;
@@ -3306,6 +3330,8 @@
3306
3330
  var this$1 = this;
3307
3331
 
3308
3332
 
3333
+ this._events = [];
3334
+
3309
3335
  var ref = this.$options;
3310
3336
  var events = ref.events;
3311
3337
 
@@ -3329,7 +3355,7 @@
3329
3355
  this._events.forEach(function (unbind) {
3330
3356
  return unbind();
3331
3357
  });
3332
- this._events = [];
3358
+ delete this._events;
3333
3359
  };
3334
3360
 
3335
3361
  UIkit.prototype._initObserver = function () {
@@ -3554,6 +3580,10 @@
3554
3580
 
3555
3581
  var DATA = UIkit.data;
3556
3582
 
3583
+ UIkit.prototype.$create = function (component, element, data) {
3584
+ return UIkit[component](element, data);
3585
+ };
3586
+
3557
3587
  UIkit.prototype.$mount = function (el) {
3558
3588
 
3559
3589
  var ref = this.$options;
@@ -3576,10 +3606,6 @@
3576
3606
  }
3577
3607
  };
3578
3608
 
3579
- UIkit.prototype.$emit = function (e) {
3580
- this._callUpdate(e);
3581
- };
3582
-
3583
3609
  UIkit.prototype.$reset = function () {
3584
3610
  this._callDisconnected();
3585
3611
  this._callConnected();
@@ -3614,11 +3640,16 @@
3614
3640
  }
3615
3641
  };
3616
3642
 
3617
- UIkit.prototype.$create = function (component, element, data) {
3618
- return UIkit[component](element, data);
3643
+ UIkit.prototype.$emit = function (e) {
3644
+ this._callUpdate(e);
3645
+ };
3646
+
3647
+ UIkit.prototype.$update = function (element, e) {
3648
+ if (element === void 0) element = this.$el;
3649
+
3650
+ UIkit.update(element, e);
3619
3651
  };
3620
3652
 
3621
- UIkit.prototype.$update = UIkit.update;
3622
3653
  UIkit.prototype.$getComponent = UIkit.getComponent;
3623
3654
 
3624
3655
  var names = {};
@@ -3768,7 +3799,7 @@
3768
3799
  UIkit.data = '__uikit__';
3769
3800
  UIkit.prefix = 'uk-';
3770
3801
  UIkit.options = {};
3771
- UIkit.version = '3.3.0';
3802
+ UIkit.version = '3.4.0';
3772
3803
 
3773
3804
  globalAPI(UIkit);
3774
3805
  hooksAPI(UIkit);
@@ -3855,16 +3886,6 @@
3855
3886
 
3856
3887
  });
3857
3888
 
3858
- // Force click event anywhere on iOS < 13
3859
- if (pointerDown === 'touchstart') {
3860
- css(document.body, 'cursor', 'pointer');
3861
- once(document, (pointerUp + " " + pointerCancel), function () {
3862
- return setTimeout(function () {
3863
- return css(document.body, 'cursor', '');
3864
- }, 50);
3865
- });
3866
- }
3867
-
3868
3889
  }, {
3869
3890
  passive: true
3870
3891
  });
@@ -3901,7 +3922,13 @@
3901
3922
  }
3902
3923
 
3903
3924
  (new MutationObserver(function (mutations) {
3904
- return mutations.forEach(applyMutation);
3925
+ var updates = [];
3926
+ mutations.forEach(function (mutation) {
3927
+ return applyMutation(mutation, updates);
3928
+ });
3929
+ updates.forEach(function (el) {
3930
+ return UIkit.update(el);
3931
+ });
3905
3932
  })).observe(document, {
3906
3933
  childList: true,
3907
3934
  subtree: true,
@@ -3912,7 +3939,7 @@
3912
3939
  UIkit._initialized = true;
3913
3940
  }
3914
3941
 
3915
- function applyMutation(mutation) {
3942
+ function applyMutation(mutation, updates) {
3916
3943
 
3917
3944
  var target = mutation.target;
3918
3945
  var type = mutation.type;
@@ -3921,7 +3948,11 @@
3921
3948
  applyChildList(mutation) :
3922
3949
  applyAttribute(mutation);
3923
3950
 
3924
- update && UIkit.update(target);
3951
+ if (update && !updates.some(function (element) {
3952
+ return element.contains(target);
3953
+ })) {
3954
+ updates.push(target.contains ? target : target.parentNode); // IE 11 text node does not implement contains
3955
+ }
3925
3956
 
3926
3957
  }
3927
3958
 
@@ -4052,7 +4083,7 @@
4052
4083
 
4053
4084
  var p;
4054
4085
 
4055
- if (!this$1.queued || !isUndefined(animate) || !isUndefined(show) || !this$1.hasAnimation || targets.length < 2) {
4086
+ if (!this$1.queued || !isUndefined(show) || !this$1.hasAnimation || targets.length < 2) {
4056
4087
 
4057
4088
  p = all(targets);
4058
4089
 
@@ -4087,10 +4118,6 @@
4087
4118
  });
4088
4119
  },
4089
4120
 
4090
- toggleNow: function (targets, show) {
4091
- return this.toggleElement(targets, show, false);
4092
- },
4093
-
4094
4121
  isToggled: function (el) {
4095
4122
  var nodes = toNodes(el || this.$el);
4096
4123
  return this.cls ?
@@ -4162,7 +4189,11 @@
4162
4189
  });
4163
4190
 
4164
4191
  this.updateAria(el);
4165
- changed && this.$update(el);
4192
+
4193
+ if (changed) {
4194
+ trigger(el, 'toggled', [this]);
4195
+ this.$update(el);
4196
+ }
4166
4197
  }
4167
4198
 
4168
4199
  }
@@ -4212,22 +4243,21 @@
4212
4243
  };
4213
4244
  }
4214
4245
 
4215
- function toggleAnimation(ref) {
4216
- var animation = ref.animation;
4217
- var duration = ref.duration;
4218
- var origin = ref.origin;
4219
- var _toggle = ref._toggle;
4220
-
4246
+ function toggleAnimation(cmp) {
4221
4247
  return function (el, show) {
4222
4248
 
4223
4249
  Animation.cancel(el);
4224
4250
 
4251
+ var animation = cmp.animation;
4252
+ var duration = cmp.duration;
4253
+ var _toggle = cmp._toggle;
4254
+
4225
4255
  if (show) {
4226
4256
  _toggle(el, true);
4227
- return Animation.in(el, animation[0], duration, origin);
4257
+ return Animation.in(el, animation[0], duration, cmp.origin);
4228
4258
  }
4229
4259
 
4230
- return Animation.out(el, animation[1] || animation[0], duration, origin).then(function () {
4260
+ return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(function () {
4231
4261
  return _toggle(el, false);
4232
4262
  });
4233
4263
  };
@@ -4244,7 +4274,8 @@
4244
4274
  multiple: Boolean,
4245
4275
  toggle: String,
4246
4276
  content: String,
4247
- transition: String
4277
+ transition: String,
4278
+ offset: Number
4248
4279
  },
4249
4280
 
4250
4281
  data: {
@@ -4256,15 +4287,43 @@
4256
4287
  clsOpen: 'uk-open',
4257
4288
  toggle: '> .uk-accordion-title',
4258
4289
  content: '> .uk-accordion-content',
4259
- transition: 'ease'
4290
+ transition: 'ease',
4291
+ offset: 0
4260
4292
  },
4261
4293
 
4262
4294
  computed: {
4263
4295
 
4264
- items: function (ref, $el) {
4265
- var targets = ref.targets;
4296
+ items: {
4297
+
4298
+ get: function (ref, $el) {
4299
+ var targets = ref.targets;
4300
+
4301
+ return $$(targets, $el);
4302
+ },
4303
+
4304
+ watch: function (items, prev) {
4305
+ var this$1 = this;
4306
+
4307
+
4308
+ items.forEach(function (el) {
4309
+ return hide($(this$1.content, el), !hasClass(el, this$1.clsOpen));
4310
+ });
4311
+
4312
+ if (prev || hasClass(items, this.clsOpen)) {
4313
+ return;
4314
+ }
4315
+
4316
+ var active = this.active !== false && items[Number(this.active)] ||
4317
+ !this.collapsible && items[0];
4318
+
4319
+ if (active) {
4320
+ this.toggle(active, false);
4321
+ }
4322
+
4323
+ },
4324
+
4325
+ immediate: true
4266
4326
 
4267
- return $$(targets, $el);
4268
4327
  }
4269
4328
 
4270
4329
  },
@@ -4288,91 +4347,66 @@
4288
4347
 
4289
4348
  ],
4290
4349
 
4291
- connected: function () {
4292
-
4293
- if (this.active === false) {
4294
- return;
4295
- }
4296
-
4297
- var active = this.items[Number(this.active)];
4298
- if (active && !hasClass(active, this.clsOpen)) {
4299
- this.toggle(active, false);
4300
- }
4301
- },
4302
-
4303
- update: function () {
4304
- var this$1 = this;
4305
-
4306
-
4307
- this.items.forEach(function (el) {
4308
- return this$1._toggle($(this$1.content, el), hasClass(el, this$1.clsOpen));
4309
- });
4310
-
4311
- var active = !this.collapsible && !hasClass(this.items, this.clsOpen) && this.items[0];
4312
- if (active) {
4313
- this.toggle(active, false);
4314
- }
4315
- },
4316
-
4317
4350
  methods: {
4318
4351
 
4319
4352
  toggle: function (item, animate) {
4320
4353
  var this$1 = this;
4321
4354
 
4322
4355
 
4323
- var index = getIndex(item, this.items);
4324
- var active = filter(this.items, ("." + (this.clsOpen)));
4356
+ var items = [this.items[getIndex(item, this.items)]];
4357
+ var activeItems = filter(this.items, ("." + (this.clsOpen)));
4358
+
4359
+ if (!this.multiple && !includes(activeItems, items[0])) {
4360
+ items = items.concat(activeItems);
4361
+ }
4362
+
4363
+ if (!this.collapsible && !filter(items, (":not(." + (this.clsOpen) + ")")).length) {
4364
+ return;
4365
+ }
4325
4366
 
4326
- item = this.items[index];
4367
+ items.forEach(function (el) {
4368
+ return this$1.toggleElement(el, !hasClass(el, this$1.clsOpen), function (el, show) {
4327
4369
 
4328
- item && [item]
4329
- .concat(!this.multiple && !includes(active, item) && active || [])
4330
- .forEach(function (el) {
4370
+ toggleClass(el, this$1.clsOpen, show);
4331
4371
 
4332
- var isItem = el === item;
4333
- var state = isItem && !hasClass(el, this$1.clsOpen);
4372
+ var content = $(("" + (el._wrapper ? '> * ' : '') + (this$1.content)), el);
4334
4373
 
4335
- if (!state && isItem && !this$1.collapsible && active.length < 2) {
4374
+ if (animate === false || !this$1.hasTransition) {
4375
+ hide(content, !show);
4336
4376
  return;
4337
4377
  }
4338
4378
 
4339
- toggleClass(el, this$1.clsOpen, state);
4340
-
4341
- var content = el._wrapper ? el._wrapper.firstElementChild : $(this$1.content, el);
4342
-
4343
4379
  if (!el._wrapper) {
4344
- el._wrapper = wrapAll(content, '<div>');
4345
- attr(el._wrapper, 'hidden', state ? '' : null);
4380
+ el._wrapper = wrapAll(content, ("<div" + (show ? ' hidden' : '') + ">"));
4346
4381
  }
4347
4382
 
4348
- this$1._toggle(content, true);
4349
- this$1.toggleElement(el._wrapper, state, animate).then(function () {
4350
-
4351
- if (hasClass(el, this$1.clsOpen) !== state) {
4352
- return;
4353
- }
4383
+ hide(content, false);
4384
+ return toggleHeight(this$1)(el._wrapper, show).then(function () {
4385
+ hide(content, !show);
4386
+ delete el._wrapper;
4387
+ unwrap(content);
4354
4388
 
4355
- if (!state) {
4356
- this$1._toggle(content, false);
4357
- } else {
4389
+ if (show) {
4358
4390
  var toggle = $(this$1.$props.toggle, el);
4359
- if (animate !== false && !isInView(toggle)) {
4360
- scrollIntoView(toggle);
4391
+ if (!isInView(toggle)) {
4392
+ scrollIntoView(toggle, {
4393
+ offset: this$1.offset
4394
+ });
4361
4395
  }
4362
4396
  }
4363
-
4364
- el._wrapper = null;
4365
- unwrap(content);
4366
-
4367
4397
  });
4368
-
4369
4398
  });
4399
+ });
4370
4400
  }
4371
4401
 
4372
4402
  }
4373
4403
 
4374
4404
  };
4375
4405
 
4406
+ function hide(el, hide) {
4407
+ attr(el, 'hidden', hide ? '' : null);
4408
+ }
4409
+
4376
4410
  var alert = {
4377
4411
 
4378
4412
  mixins: [Class, Togglable],
@@ -4512,7 +4546,7 @@
4512
4546
  read: function () {
4513
4547
 
4514
4548
  var el = this.$el;
4515
- var ref = el.parentNode;
4549
+ var ref = getPositionedParent(el) || el.parentNode;
4516
4550
  var height = ref.offsetHeight;
4517
4551
  var width = ref.offsetWidth;
4518
4552
  var dim = Dimensions.cover({
@@ -4546,6 +4580,14 @@
4546
4580
 
4547
4581
  };
4548
4582
 
4583
+ function getPositionedParent(el) {
4584
+ while ((el = parent(el))) {
4585
+ if (css(el, 'position') !== 'static') {
4586
+ return el;
4587
+ }
4588
+ }
4589
+ }
4590
+
4549
4591
  var Position = {
4550
4592
 
4551
4593
  props: {
@@ -4632,7 +4674,7 @@
4632
4674
 
4633
4675
  var active;
4634
4676
 
4635
- var Drop = {
4677
+ var drop = {
4636
4678
 
4637
4679
  mixins: [Position, Togglable],
4638
4680
 
@@ -4821,7 +4863,7 @@
4821
4863
  },
4822
4864
 
4823
4865
  handler: function (e) {
4824
- if (!isTouch(e) && !matches(this.$el, ':hover')) {
4866
+ if (!isTouch(e)) {
4825
4867
  this.hide();
4826
4868
  }
4827
4869
  }
@@ -4830,11 +4872,16 @@
4830
4872
 
4831
4873
  {
4832
4874
 
4833
- name: 'beforeshow',
4875
+ name: 'toggled',
4834
4876
 
4835
4877
  self: true,
4836
4878
 
4837
4879
  handler: function () {
4880
+
4881
+ if (!this.isToggled()) {
4882
+ return;
4883
+ }
4884
+
4838
4885
  this.clearTimers();
4839
4886
  Animation.cancel(this.$el);
4840
4887
  this.position();
@@ -4857,19 +4904,22 @@
4857
4904
  this.tracker.init();
4858
4905
  trigger(this.$el, 'updatearia');
4859
4906
 
4860
- // If triggered from an click event handler, delay adding the click handler
4861
- var off = delayOn(document, 'click', function (ref) {
4862
- var defaultPrevented = ref.defaultPrevented;
4907
+ once(this.$el, 'hide', on(document, pointerDown, function (ref) {
4863
4908
  var target = ref.target;
4864
4909
 
4865
- if (!defaultPrevented && !within(target, this$1.$el) && !(this$1.toggle && within(target, this$1.toggle.$el))) {
4866
- this$1.hide(false);
4867
- }
4868
- });
4910
+ return !within(target, this$1.$el) && once(document, (pointerUp + " " + pointerCancel + " scroll"), function (ref) {
4911
+ var defaultPrevented = ref.defaultPrevented;
4912
+ var type = ref.type;
4913
+ var newTarget = ref.target;
4869
4914
 
4870
- once(this.$el, 'hide', off, {
4915
+ if (!defaultPrevented && type === pointerUp && target === newTarget && !(this$1.toggle && within(target, this$1.toggle.$el))) {
4916
+ this$1.hide(false);
4917
+ }
4918
+ }, true);
4919
+ }), {
4871
4920
  self: true
4872
4921
  });
4922
+
4873
4923
  }
4874
4924
 
4875
4925
  },
@@ -4985,7 +5035,7 @@
4985
5035
 
4986
5036
 
4987
5037
  var hide = function () {
4988
- return this$1.toggleNow(this$1.$el, false);
5038
+ return this$1.toggleElement(this$1.$el, false, false);
4989
5039
  };
4990
5040
 
4991
5041
  this.clearTimers();
@@ -5018,11 +5068,6 @@
5018
5068
  position: function () {
5019
5069
 
5020
5070
  removeClasses(this.$el, ((this.clsDrop) + "-(stack|boundary)"));
5021
- css(this.$el, {
5022
- top: '',
5023
- left: '',
5024
- display: 'block'
5025
- });
5026
5071
  toggleClass(this.$el, ((this.clsDrop) + "-boundary"), this.boundaryAlign);
5027
5072
 
5028
5073
  var boundary = offset(this.boundary);
@@ -5037,8 +5082,6 @@
5037
5082
 
5038
5083
  this.positionAt(this.$el, this.boundaryAlign ? this.boundary : this.toggle.$el, this.boundary);
5039
5084
 
5040
- css(this.$el, 'display', '');
5041
-
5042
5085
  }
5043
5086
 
5044
5087
  }
@@ -5046,25 +5089,13 @@
5046
5089
  };
5047
5090
 
5048
5091
  function getPositionedElements(el) {
5049
- var result = css(el, 'position') !== 'static' ? [el] : [];
5050
- return result.concat.apply(result, children(el).map(getPositionedElements));
5051
- }
5052
-
5053
- function delayOn(el, type, fn) {
5054
- var off = once(el, type, function () {
5055
- return off = on(el, type, fn);
5056
- }, true);
5057
- return function () {
5058
- return off();
5059
- };
5092
+ var result = [];
5093
+ apply(el, function (el) {
5094
+ return css(el, 'position') !== 'static' && result.push(el);
5095
+ });
5096
+ return result;
5060
5097
  }
5061
5098
 
5062
- var dropdown = {
5063
-
5064
- extends: Drop
5065
-
5066
- };
5067
-
5068
5099
  var formCustom = {
5069
5100
 
5070
5101
  mixins: [Class],
@@ -5134,7 +5165,7 @@
5134
5165
  name: 'change',
5135
5166
 
5136
5167
  handler: function () {
5137
- this.$emit();
5168
+ this.$update();
5138
5169
  }
5139
5170
  },
5140
5171
 
@@ -5146,7 +5177,7 @@
5146
5177
  },
5147
5178
 
5148
5179
  handler: function () {
5149
- this.$emit();
5180
+ this.$update();
5150
5181
  }
5151
5182
  }
5152
5183
 
@@ -5193,22 +5224,10 @@
5193
5224
 
5194
5225
  update: {
5195
5226
 
5196
- read: function (data) {
5197
-
5198
- var items = this.$el.children;
5199
- var rows = [
5200
- []
5201
- ];
5202
-
5203
- if (!items.length || !isVisible(this.$el)) {
5204
- return data.rows = rows;
5205
- }
5206
-
5207
- data.rows = getRows(items);
5208
- data.stacks = !data.rows.some(function (row) {
5209
- return row.length > 1;
5210
- });
5211
-
5227
+ read: function () {
5228
+ return {
5229
+ rows: getRows(this.$el.children)
5230
+ };
5212
5231
  },
5213
5232
 
5214
5233
  write: function (ref) {
@@ -5232,6 +5251,7 @@
5232
5251
  };
5233
5252
 
5234
5253
  function getRows(items) {
5254
+
5235
5255
  var rows = [
5236
5256
  []
5237
5257
  ];
@@ -5239,12 +5259,13 @@
5239
5259
  for (var i = 0; i < items.length; i++) {
5240
5260
 
5241
5261
  var el = items[i];
5242
- var dim = getOffset(el);
5243
5262
 
5244
- if (!dim.height) {
5263
+ if (!isVisible(el)) {
5245
5264
  continue;
5246
5265
  }
5247
5266
 
5267
+ var dim = getOffset(el);
5268
+
5248
5269
  for (var j = rows.length - 1; j >= 0; j--) {
5249
5270
 
5250
5271
  var row = rows[j];
@@ -5267,7 +5288,7 @@
5267
5288
  break;
5268
5289
  }
5269
5290
 
5270
- if (dim.bottom > leftDim.top) {
5291
+ if (dim.bottom > leftDim.top || dim.top === leftDim.top) {
5271
5292
 
5272
5293
  if (dim.left < leftDim.left && !isRtl) {
5273
5294
  row.unshift(el);
@@ -5354,11 +5375,21 @@
5354
5375
 
5355
5376
  {
5356
5377
 
5357
- write: function (ref) {
5358
- var stacks = ref.stacks;
5359
-
5360
- toggleClass(this.$el, this.clsStack, stacks);
5361
- },
5378
+ read: function (ref) {
5379
+ var rows = ref.rows;
5380
+
5381
+ return {
5382
+ stacks: !rows.some(function (row) {
5383
+ return row.length > 1;
5384
+ })
5385
+ };
5386
+ },
5387
+
5388
+ write: function (ref) {
5389
+ var stacks = ref.stacks;
5390
+
5391
+ toggleClass(this.$el, this.clsStack, stacks);
5392
+ },
5362
5393
 
5363
5394
  events: ['resize']
5364
5395
 
@@ -5370,19 +5401,18 @@
5370
5401
  var rows = ref.rows;
5371
5402
 
5372
5403
 
5373
- if (this.masonry || this.parallax) {
5374
- rows = rows.map(function (elements) {
5375
- return sortBy(elements, 'offsetLeft');
5376
- });
5404
+ if (!this.masonry && !this.parallax) {
5405
+ return false;
5406
+ }
5377
5407
 
5378
- if (isRtl) {
5379
- rows.map(function (row) {
5380
- return row.reverse();
5381
- });
5382
- }
5408
+ rows = rows.map(function (elements) {
5409
+ return sortBy(elements, 'offsetLeft');
5410
+ });
5383
5411
 
5384
- } else {
5385
- return false;
5412
+ if (isRtl) {
5413
+ rows.map(function (row) {
5414
+ return row.reverse();
5415
+ });
5386
5416
  }
5387
5417
 
5388
5418
  var transitionInProgress = rows.some(function (elements) {
@@ -5424,13 +5454,10 @@
5424
5454
  },
5425
5455
 
5426
5456
  write: function (ref) {
5427
- var stacks = ref.stacks;
5428
5457
  var height = ref.height;
5429
5458
  var padding = ref.padding;
5430
5459
 
5431
5460
 
5432
- toggleClass(this.$el, this.clsStack, stacks);
5433
-
5434
5461
  css(this.$el, 'paddingBottom', padding);
5435
5462
  height !== false && css(this.$el, 'height', height);
5436
5463
 
@@ -5977,7 +6004,7 @@
5977
6004
  return svg && svg.hasChildNodes() && svg;
5978
6005
  }
5979
6006
 
5980
- var symbolRe = /<symbol(.*?id=(['"])(.*?)\2[^]*?<\/)symbol>/g;
6007
+ var symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5981
6008
  var symbols = {};
5982
6009
 
5983
6010
  function parseSymbols(svg, icon) {
@@ -5986,13 +6013,13 @@
5986
6013
 
5987
6014
  symbols[svg] = {};
5988
6015
 
6016
+ symbolRe.lastIndex = 0;
6017
+
5989
6018
  var match;
5990
6019
  while ((match = symbolRe.exec(svg))) {
5991
6020
  symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + (match[1]) + "svg>";
5992
6021
  }
5993
6022
 
5994
- symbolRe.lastIndex = 0;
5995
-
5996
6023
  }
5997
6024
 
5998
6025
  return symbols[svg][icon];
@@ -6009,12 +6036,17 @@
6009
6036
  }
6010
6037
 
6011
6038
  function getMaxPathLength(el) {
6012
- return Math.ceil(Math.max.apply(Math, $$('[stroke]', el).map(function (stroke) {
6013
- return stroke.getTotalLength && stroke.getTotalLength() || 0;
6014
- }).concat([0])));
6039
+ return Math.ceil(Math.max.apply(Math, [0].concat($$('[stroke]', el).map(function (stroke) {
6040
+ try {
6041
+ return stroke.getTotalLength();
6042
+ } catch (e) {
6043
+ return 0;
6044
+ }
6045
+ }))));
6015
6046
  }
6016
6047
 
6017
6048
  function insertSVG(el, root) {
6049
+
6018
6050
  if (isVoidElement(root) || root.tagName === 'CANVAS') {
6019
6051
 
6020
6052
  attr(root, 'hidden', true);
@@ -6024,14 +6056,12 @@
6024
6056
  next :
6025
6057
  after(root, el);
6026
6058
 
6027
- } else {
6028
-
6029
- var last = root.lastElementChild;
6030
- return equals(el, last) ?
6031
- last :
6032
- append(root, el);
6033
-
6034
6059
  }
6060
+
6061
+ var last = root.lastElementChild;
6062
+ return equals(el, last) ?
6063
+ last :
6064
+ append(root, el);
6035
6065
  }
6036
6066
 
6037
6067
  function equals(el, other) {
@@ -6426,7 +6456,7 @@
6426
6456
  observe: function () {
6427
6457
  var this$1 = this;
6428
6458
 
6429
- if (!this._data.image && this._connected) {
6459
+ if (this._connected && !this._data.image) {
6430
6460
  this.target.forEach(function (el) {
6431
6461
  return this$1.observer.observe(el);
6432
6462
  });
@@ -6709,7 +6739,7 @@
6709
6739
 
6710
6740
  beforeDisconnect: function () {
6711
6741
  if (this.isToggled()) {
6712
- this.toggleNow(this.$el, false);
6742
+ this.toggleElement(this.$el, false, false);
6713
6743
  }
6714
6744
  },
6715
6745
 
@@ -6743,7 +6773,10 @@
6743
6773
  }
6744
6774
 
6745
6775
  e.preventDefault();
6746
- this.toggle();
6776
+
6777
+ if (this.isToggled() === includes(active$1, this)) {
6778
+ this.toggle();
6779
+ }
6747
6780
  }
6748
6781
 
6749
6782
  },
@@ -6785,21 +6818,29 @@
6785
6818
  css(document.body, 'overflowY', 'scroll');
6786
6819
  }
6787
6820
 
6821
+ this.stack && css(this.$el, 'zIndex', css(this.$el, 'zIndex') + active$1.length);
6822
+
6788
6823
  addClass(document.documentElement, this.clsPage);
6789
6824
 
6790
6825
  if (this.bgClose) {
6791
- once(this.$el, 'hide', delayOn(document, 'click', function (ref) {
6792
- var defaultPrevented = ref.defaultPrevented;
6826
+ once(this.$el, 'hide', on(document, pointerDown, function (ref) {
6793
6827
  var target = ref.target;
6794
6828
 
6795
- var current = last(active$1);
6796
- if (!defaultPrevented &&
6797
- current === this$1 &&
6798
- (!current.overlay || within(target, current.$el)) &&
6799
- !within(target, current.panel)
6800
- ) {
6801
- current.hide();
6829
+
6830
+ if (last(active$1) !== this$1 || this$1.overlay && !within(target, this$1.$el) || within(target, this$1.panel)) {
6831
+ return;
6802
6832
  }
6833
+
6834
+ once(document, (pointerUp + " " + pointerCancel + " scroll"), function (ref) {
6835
+ var defaultPrevented = ref.defaultPrevented;
6836
+ var type = ref.type;
6837
+ var newTarget = ref.target;
6838
+
6839
+ if (!defaultPrevented && type === pointerUp && target === newTarget) {
6840
+ this$1.hide();
6841
+ }
6842
+ }, true);
6843
+
6803
6844
  }), {
6804
6845
  self: true
6805
6846
  });
@@ -6807,10 +6848,9 @@
6807
6848
 
6808
6849
  if (this.escClose) {
6809
6850
  once(this.$el, 'hide', on(document, 'keydown', function (e) {
6810
- var current = last(active$1);
6811
- if (e.keyCode === 27 && current === this$1) {
6851
+ if (e.keyCode === 27 && last(active$1) === this$1) {
6812
6852
  e.preventDefault();
6813
- current.hide();
6853
+ this$1.hide();
6814
6854
  }
6815
6855
  }), {
6816
6856
  self: true
@@ -6836,6 +6876,8 @@
6836
6876
  css(document.body, 'overflowY', '');
6837
6877
  }
6838
6878
 
6879
+ css(this.$el, 'zIndex', '');
6880
+
6839
6881
  if (!active$1.some(function (modal) {
6840
6882
  return modal.clsPage === this$1.clsPage;
6841
6883
  })) {
@@ -6957,16 +6999,21 @@
6957
6999
 
6958
7000
  };
6959
7001
 
6960
- function install$1(UIkit) {
7002
+ function install$1(ref) {
7003
+ var modal = ref.modal;
7004
+
6961
7005
 
6962
- UIkit.modal.dialog = function (content, options) {
7006
+ modal.dialog = function (content, options) {
6963
7007
 
6964
- var dialog = UIkit.modal((" <div class=\"uk-modal\"> <div class=\"uk-modal-dialog\">" + content + "</div> </div> "), options);
7008
+ var dialog = modal(
7009
+ ("<div class=\"uk-modal\"> <div class=\"uk-modal-dialog\">" + content + "</div> </div>"),
7010
+ options
7011
+ );
6965
7012
 
6966
7013
  dialog.show();
6967
7014
 
6968
7015
  on(dialog.$el, 'hidden', function () {
6969
- return Promise.resolve(function () {
7016
+ return Promise.resolve().then(function () {
6970
7017
  return dialog.$destroy(true);
6971
7018
  });
6972
7019
  }, {
@@ -6976,86 +7023,84 @@
6976
7023
  return dialog;
6977
7024
  };
6978
7025
 
6979
- UIkit.modal.alert = function (message, options) {
7026
+ modal.alert = function (message, options) {
7027
+ return openDialog(
7028
+ function (ref) {
7029
+ var labels = ref.labels;
6980
7030
 
6981
- options = assign({
6982
- bgClose: false,
6983
- escClose: false,
6984
- labels: UIkit.modal.labels
6985
- }, options);
6986
-
6987
- return new Promise(
6988
- function (resolve) {
6989
- return on(UIkit.modal.dialog((" <div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-primary uk-modal-close\" autofocus>" + (options.labels.ok) + "</button> </div> "), options).$el, 'hide', resolve);
7031
+ return ("<div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-primary uk-modal-close\" autofocus>" + (labels.ok) + "</button> </div>");
7032
+ },
7033
+ options,
7034
+ function (deferred) {
7035
+ return deferred.resolve();
6990
7036
  }
6991
7037
  );
6992
7038
  };
6993
7039
 
6994
- UIkit.modal.confirm = function (message, options) {
6995
-
6996
- options = assign({
6997
- bgClose: false,
6998
- escClose: true,
6999
- labels: UIkit.modal.labels
7000
- }, options);
7001
-
7002
- return new Promise(function (resolve, reject) {
7040
+ modal.confirm = function (message, options) {
7041
+ return openDialog(
7042
+ function (ref) {
7043
+ var labels = ref.labels;
7003
7044
 
7004
- var confirm = UIkit.modal.dialog((" <form> <div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (options.labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\" autofocus>" + (options.labels.ok) + "</button> </div> </form> "), options);
7045
+ return ("<form> <div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\" autofocus>" + (labels.ok) + "</button> </div> </form>");
7046
+ },
7047
+ options,
7048
+ function (deferred) {
7049
+ return deferred.reject();
7050
+ }
7051
+ );
7052
+ };
7005
7053
 
7006
- var resolved = false;
7054
+ modal.prompt = function (message, value, options) {
7055
+ return openDialog(
7056
+ function (ref) {
7057
+ var labels = ref.labels;
7007
7058
 
7008
- on(confirm.$el, 'submit', 'form', function (e) {
7009
- e.preventDefault();
7010
- resolve();
7011
- resolved = true;
7012
- confirm.hide();
7013
- });
7014
- on(confirm.$el, 'hide', function () {
7015
- if (!resolved) {
7016
- reject();
7017
- }
7018
- });
7059
+ return ("<form class=\"uk-form-stacked\"> <div class=\"uk-modal-body\"> <label>" + (isString(message) ? message : html(message)) + "</label> <input class=\"uk-input\" value=\"" + (value || '') + "\" autofocus> </div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\">" + (labels.ok) + "</button> </div> </form>");
7060
+ },
7061
+ options,
7062
+ function (deferred) {
7063
+ return deferred.resolve(null);
7064
+ },
7065
+ function (dialog) {
7066
+ return $('input', dialog.$el).value;
7067
+ }
7068
+ );
7069
+ };
7019
7070
 
7020
- });
7071
+ modal.labels = {
7072
+ ok: 'Ok',
7073
+ cancel: 'Cancel'
7021
7074
  };
7022
7075
 
7023
- UIkit.modal.prompt = function (message, value, options) {
7076
+ function openDialog(tmpl, options, hideFn, submitFn) {
7024
7077
 
7025
7078
  options = assign({
7026
7079
  bgClose: false,
7027
7080
  escClose: true,
7028
- labels: UIkit.modal.labels
7081
+ labels: modal.labels
7029
7082
  }, options);
7030
7083
 
7031
- return new Promise(function (resolve) {
7084
+ var dialog = modal.dialog(tmpl(options), options);
7085
+ var deferred = new Deferred();
7032
7086
 
7033
- var prompt = UIkit.modal.dialog((" <form class=\"uk-form-stacked\"> <div class=\"uk-modal-body\"> <label>" + (isString(message) ? message : html(message)) + "</label> <input class=\"uk-input\" autofocus> </div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (options.labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\">" + (options.labels.ok) + "</button> </div> </form> "), options),
7034
- input = $('input', prompt.$el);
7087
+ var resolved = false;
7035
7088
 
7036
- input.value = value;
7037
-
7038
- var resolved = false;
7039
-
7040
- on(prompt.$el, 'submit', 'form', function (e) {
7041
- e.preventDefault();
7042
- resolve(input.value);
7043
- resolved = true;
7044
- prompt.hide();
7045
- });
7046
- on(prompt.$el, 'hide', function () {
7047
- if (!resolved) {
7048
- resolve(null);
7049
- }
7050
- });
7089
+ on(dialog.$el, 'submit', 'form', function (e) {
7090
+ e.preventDefault();
7091
+ deferred.resolve(submitFn && submitFn(dialog));
7092
+ resolved = true;
7093
+ dialog.hide();
7094
+ });
7051
7095
 
7096
+ on(dialog.$el, 'hide', function () {
7097
+ return !resolved && hideFn(deferred);
7052
7098
  });
7053
- };
7054
7099
 
7055
- UIkit.modal.labels = {
7056
- ok: 'Ok',
7057
- cancel: 'Cancel'
7058
- };
7100
+ deferred.promise.dialog = dialog;
7101
+
7102
+ return deferred.promise;
7103
+ }
7059
7104
 
7060
7105
  }
7061
7106
 
@@ -7131,55 +7176,67 @@
7131
7176
  return ("bottom-" + align);
7132
7177
  },
7133
7178
 
7134
- dropdowns: function (ref, $el) {
7135
- var dropdown = ref.dropdown;
7136
- var clsDrop = ref.clsDrop;
7179
+ dropbar: {
7137
7180
 
7138
- return $$((dropdown + " ." + clsDrop), $el);
7139
- }
7181
+ get: function (ref) {
7182
+ var dropbar = ref.dropbar;
7140
7183
 
7141
- },
7142
7184
 
7143
- beforeConnect: function () {
7185
+ if (!dropbar) {
7186
+ return null;
7187
+ }
7144
7188
 
7145
- var ref = this.$props;
7146
- var dropbar = ref.dropbar;
7189
+ dropbar = this._dropbar || query(dropbar, this.$el) || $('+ .uk-navbar-dropbar', this.$el);
7147
7190
 
7148
- this.dropbar = dropbar && (query(dropbar, this.$el) || $('+ .uk-navbar-dropbar', this.$el) || $('<div></div>'));
7191
+ return dropbar ? dropbar : (this._dropbar = $('<div></div>'));
7149
7192
 
7150
- if (this.dropbar) {
7193
+ },
7151
7194
 
7152
- addClass(this.dropbar, 'uk-navbar-dropbar');
7195
+ watch: function (dropbar) {
7196
+ addClass(dropbar, 'uk-navbar-dropbar');
7197
+ toggleClass(dropbar, 'uk-navbar-dropbar-slide', this.dropbarMode === 'slide');
7198
+ },
7153
7199
 
7154
- if (this.dropbarMode === 'slide') {
7155
- addClass(this.dropbar, 'uk-navbar-dropbar-slide');
7156
- }
7157
- }
7200
+ immediate: true
7158
7201
 
7159
- },
7202
+ },
7160
7203
 
7161
- disconnected: function () {
7162
- this.dropbar && remove(this.dropbar);
7163
- },
7204
+ dropdowns: {
7164
7205
 
7165
- update: function () {
7166
- var this$1 = this;
7206
+ get: function (ref, $el) {
7207
+ var dropdown = ref.dropdown;
7208
+ var clsDrop = ref.clsDrop;
7167
7209
 
7210
+ return $$((dropdown + " ." + clsDrop), $el);
7211
+ },
7168
7212
 
7169
- this.$create(
7170
- 'drop',
7171
- this.dropdowns.filter(function (el) {
7172
- return !this$1.getDropdown(el);
7173
- }),
7174
- assign({}, this.$props, {
7175
- boundary: this.boundary,
7176
- pos: this.pos,
7177
- offset: this.dropbar || this.offset
7178
- })
7179
- );
7213
+ watch: function (dropdowns) {
7214
+ var this$1 = this;
7215
+
7216
+ this.$create(
7217
+ 'drop',
7218
+ dropdowns.filter(function (el) {
7219
+ return !this$1.getDropdown(el);
7220
+ }),
7221
+ assign({}, this.$props, {
7222
+ boundary: this.boundary,
7223
+ pos: this.pos,
7224
+ offset: this.dropbar || this.offset
7225
+ })
7226
+ );
7227
+ },
7228
+
7229
+ immediate: true
7230
+
7231
+ }
7180
7232
 
7181
7233
  },
7182
7234
 
7235
+ disconnected: function () {
7236
+ this.dropbar && remove(this.dropbar);
7237
+ delete this._dropbar;
7238
+ },
7239
+
7183
7240
  events: [
7184
7241
 
7185
7242
  {
@@ -7702,12 +7759,10 @@
7702
7759
  var scroll = {
7703
7760
 
7704
7761
  props: {
7705
- duration: Number,
7706
7762
  offset: Number
7707
7763
  },
7708
7764
 
7709
7765
  data: {
7710
- duration: 1000,
7711
7766
  offset: 0
7712
7767
  },
7713
7768
 
@@ -7720,7 +7775,9 @@
7720
7775
  el = el && $(el) || document.body;
7721
7776
 
7722
7777
  if (trigger(this.$el, 'beforescroll', [this, el])) {
7723
- scrollIntoView(el, this.$props).then(function () {
7778
+ scrollIntoView(el, {
7779
+ offset: this.offset
7780
+ }).then(function () {
7724
7781
  return trigger(this$1.$el, 'scrolled', [this$1, el]);
7725
7782
  });
7726
7783
  }
@@ -7774,25 +7831,27 @@
7774
7831
 
7775
7832
  computed: {
7776
7833
 
7777
- elements: function (ref, $el) {
7778
- var target = ref.target;
7779
-
7780
- return target ? $$(target, $el) : [$el];
7781
- }
7834
+ elements: {
7782
7835
 
7783
- },
7784
-
7785
- update: [
7836
+ get: function (ref, $el) {
7837
+ var target = ref.target;
7786
7838
 
7787
- {
7839
+ return target ? $$(target, $el) : [$el];
7840
+ },
7788
7841
 
7789
- write: function () {
7842
+ watch: function (elements) {
7790
7843
  if (this.hidden) {
7791
- css(filter(this.elements, (":not(." + (this.inViewClass) + ")")), 'visibility', 'hidden');
7844
+ css(filter(elements, (":not(." + (this.inViewClass) + ")")), 'visibility', 'hidden');
7792
7845
  }
7793
- }
7846
+ },
7794
7847
 
7795
- },
7848
+ immediate: true
7849
+
7850
+ }
7851
+
7852
+ },
7853
+
7854
+ update: [
7796
7855
 
7797
7856
  {
7798
7857
 
@@ -7828,7 +7887,7 @@
7828
7887
 
7829
7888
  // Let child components be applied at least once first
7830
7889
  if (!data.update) {
7831
- this.$emit();
7890
+ this.$update();
7832
7891
  return data.update = true;
7833
7892
  }
7834
7893
 
@@ -7903,10 +7962,24 @@
7903
7962
 
7904
7963
  computed: {
7905
7964
 
7906
- links: function (_, $el) {
7907
- return $$('a[href^="#"]', $el).filter(function (el) {
7908
- return el.hash;
7909
- });
7965
+ links: {
7966
+
7967
+ get: function (_, $el) {
7968
+ return $$('a[href^="#"]', $el).filter(function (el) {
7969
+ return el.hash;
7970
+ });
7971
+ },
7972
+
7973
+ watch: function (links) {
7974
+ if (this.scroll) {
7975
+ this.$create('scroll', links, {
7976
+ offset: this.offset || 0
7977
+ });
7978
+ }
7979
+ },
7980
+
7981
+ immediate: true
7982
+
7910
7983
  },
7911
7984
 
7912
7985
  targets: function () {
@@ -7918,27 +7991,13 @@
7918
7991
  elements: function (ref) {
7919
7992
  var selector = ref.closest;
7920
7993
 
7921
- return closest($$(this.targets.map(function (el) {
7922
- return ("[href=\"#" + (el.id) + "\"]");
7923
- }).join(',')), selector || '*');
7994
+ return closest(this.links, selector || '*');
7924
7995
  }
7925
7996
 
7926
7997
  },
7927
7998
 
7928
7999
  update: [
7929
8000
 
7930
- {
7931
-
7932
- read: function () {
7933
- if (this.scroll) {
7934
- this.$create('scroll', this.links, {
7935
- offset: this.offset || 0
7936
- });
7937
- }
7938
- }
7939
-
7940
- },
7941
-
7942
8001
  {
7943
8002
 
7944
8003
  read: function () {
@@ -7956,18 +8015,15 @@
7956
8015
  var scrollTop = scrollElement.scrollTop;
7957
8016
  var scrollHeight = scrollElement.scrollHeight;
7958
8017
  var viewport = getViewport(scrollElement);
7959
- var scroll = scrollTop;
7960
8018
  var max = scrollHeight - offset(viewport).height;
7961
8019
  var active = false;
7962
8020
 
7963
- if (scroll === max) {
8021
+ if (scrollTop === max) {
7964
8022
  active = length - 1;
7965
8023
  } else {
7966
8024
 
7967
8025
  this.targets.every(function (el, i) {
7968
- var ref = position(el, viewport);
7969
- var top = ref.top;
7970
- if (top - this$1.offset <= 0) {
8026
+ if (position(el, viewport).top - this$1.offset <= 0) {
7971
8027
  active = i;
7972
8028
  return true;
7973
8029
  }
@@ -8392,16 +8448,49 @@
8392
8448
 
8393
8449
  computed: {
8394
8450
 
8395
- connects: function (ref, $el) {
8396
- var connect = ref.connect;
8451
+ connects: {
8452
+
8453
+ get: function (ref, $el) {
8454
+ var connect = ref.connect;
8455
+
8456
+ return queryAll(connect, $el);
8457
+ },
8458
+
8459
+ watch: function (connects) {
8460
+ var this$1 = this;
8461
+
8462
+
8463
+ connects.forEach(function (list) {
8464
+ return this$1.updateAria(list.children);
8465
+ });
8466
+
8467
+ if (this.swiping) {
8468
+ css(connects, 'touch-action', 'pan-y pinch-zoom');
8469
+ }
8470
+
8471
+ },
8472
+
8473
+ immediate: true
8397
8474
 
8398
- return queryAll(connect, $el);
8399
8475
  },
8400
8476
 
8401
- toggles: function (ref, $el) {
8402
- var toggle = ref.toggle;
8477
+ toggles: {
8478
+
8479
+ get: function (ref, $el) {
8480
+ var toggle = ref.toggle;
8481
+
8482
+ return $$(toggle, $el).filter(function (el) {
8483
+ return !matches(el, '.uk-disabled *, .uk-disabled, [disabled]');
8484
+ });
8485
+ },
8486
+
8487
+ watch: function (toggles) {
8488
+ var active = this.index();
8489
+ this.show(~active && active || toggles[this.active] || toggles[0]);
8490
+ },
8491
+
8492
+ immediate: true
8403
8493
 
8404
- return $$(toggle, $el);
8405
8494
  }
8406
8495
 
8407
8496
  },
@@ -8413,14 +8502,15 @@
8413
8502
  name: 'click',
8414
8503
 
8415
8504
  delegate: function () {
8416
- return ((this.toggle) + ":not(.uk-disabled)");
8505
+ return this.toggle;
8417
8506
  },
8418
8507
 
8419
8508
  handler: function (e) {
8509
+ if (!includes(this.toggles, e.current)) {
8510
+ return;
8511
+ }
8420
8512
  e.preventDefault();
8421
- this.show(children(this.$el).filter(function (el) {
8422
- return within(e.current, el);
8423
- })[0]);
8513
+ this.show(e.current);
8424
8514
  }
8425
8515
 
8426
8516
  },
@@ -8458,69 +8548,49 @@
8458
8548
 
8459
8549
  this.show(endsWith(type, 'Left') ? 'next' : 'previous');
8460
8550
  }
8461
- }
8551
+ },
8462
8552
 
8463
- ],
8553
+ {
8554
+ name: 'show',
8464
8555
 
8465
- update: function () {
8466
- var this$1 = this;
8556
+ el: function () {
8557
+ return this.connects;
8558
+ },
8467
8559
 
8560
+ handler: function () {
8561
+ var this$1 = this;
8468
8562
 
8469
- this.connects.forEach(function (list) {
8470
- return this$1.updateAria(list.children);
8471
- });
8472
- var ref = this.$el;
8473
- var children = ref.children;
8474
- this.show(filter(children, ("." + (this.cls)))[0] || children[this.active] || children[0]);
8563
+ var index = this.index();
8475
8564
 
8476
- this.swiping && css(this.connects, 'touch-action', 'pan-y pinch-zoom');
8565
+ this.toggles.forEach(function (toggle, i) {
8566
+ toggleClass(children(this$1.$el).filter(function (el) {
8567
+ return within(toggle, el);
8568
+ }), this$1.cls, index === i);
8569
+ attr(toggle, 'aria-expanded', index === i);
8570
+ });
8571
+ }
8572
+ }
8477
8573
 
8478
- },
8574
+ ],
8479
8575
 
8480
8576
  methods: {
8481
8577
 
8482
8578
  index: function () {
8483
- return !isEmpty(this.connects) ? index(filter(this.connects[0].children, ("." + (this.cls)))[0]) : -1;
8579
+ return index(children(this.connects[0], ("." + (this.cls)))[0]);
8484
8580
  },
8485
8581
 
8486
8582
  show: function (item) {
8487
8583
  var this$1 = this;
8488
8584
 
8489
8585
 
8490
- var ref = this.$el;
8491
- var children = ref.children;
8492
- var length = children.length;
8493
8586
  var prev = this.index();
8494
- var hasPrev = prev >= 0;
8495
- var dir = item === 'previous' ? -1 : 1;
8496
-
8497
- var toggle, active, next = getIndex(item, children, prev);
8498
-
8499
- for (var i = 0; i < length; i++, next = (next + dir + length) % length) {
8500
- if (!matches(this.toggles[next], '.uk-disabled *, .uk-disabled, [disabled]')) {
8501
- toggle = this.toggles[next];
8502
- active = children[next];
8503
- break;
8504
- }
8505
- }
8506
-
8507
- if (!active || prev === next) {
8508
- return;
8509
- }
8587
+ var next = getIndex(item, this.toggles, prev);
8510
8588
 
8511
- removeClass(children, this.cls);
8512
- addClass(active, this.cls);
8513
- attr(this.toggles, 'aria-expanded', false);
8514
- attr(toggle, 'aria-expanded', true);
8589
+ this.connects.forEach(function (ref) {
8590
+ var children = ref.children;
8515
8591
 
8516
- this.connects.forEach(function (list) {
8517
- if (!hasPrev) {
8518
- this$1.toggleNow(list.children[next]);
8519
- } else {
8520
- this$1.toggleElement([list.children[prev], list.children[next]]);
8521
- }
8592
+ return this$1.toggleElement([children[prev], children[next]], undefined, prev >= 0);
8522
8593
  });
8523
-
8524
8594
  }
8525
8595
 
8526
8596
  }
@@ -8582,18 +8652,24 @@
8582
8652
 
8583
8653
  computed: {
8584
8654
 
8585
- target: function (ref, $el) {
8586
- var href = ref.href;
8587
- var target = ref.target;
8655
+ target: {
8588
8656
 
8589
- target = queryAll(target || href, $el);
8590
- return target.length && target || [$el];
8591
- }
8657
+ get: function (ref, $el) {
8658
+ var href = ref.href;
8659
+ var target = ref.target;
8592
8660
 
8593
- },
8661
+ target = queryAll(target || href, $el);
8662
+ return target.length && target || [$el];
8663
+ },
8664
+
8665
+ watch: function () {
8666
+ trigger(this.target, 'updatearia', [this]);
8667
+ },
8668
+
8669
+ immediate: true
8670
+
8671
+ }
8594
8672
 
8595
- connected: function () {
8596
- trigger(this.target, 'updatearia', [this]);
8597
8673
  },
8598
8674
 
8599
8675
  events: [
@@ -8680,14 +8756,13 @@
8680
8756
 
8681
8757
  };
8682
8758
 
8683
-
8684
8759
  var coreComponents = /*#__PURE__*/ Object.freeze({
8685
8760
  __proto__: null,
8686
8761
  Accordion: Accordion,
8687
8762
  Alert: alert,
8688
8763
  Cover: cover,
8689
- Drop: Drop,
8690
- Dropdown: dropdown,
8764
+ Drop: drop,
8765
+ Dropdown: drop,
8691
8766
  FormCustom: formCustom,
8692
8767
  Gif: gif,
8693
8768
  Grid: grid,
@@ -8859,16 +8934,12 @@
8859
8934
  methods: {
8860
8935
 
8861
8936
  start: function () {
8862
- var this$1 = this;
8863
-
8864
8937
 
8865
8938
  this.stop();
8866
8939
 
8867
8940
  if (this.date && this.units.length) {
8868
- this.$emit();
8869
- this.timer = setInterval(function () {
8870
- return this$1.$emit();
8871
- }, 1000);
8941
+ this.$update();
8942
+ this.timer = setInterval(this.$update, 1000);
8872
8943
  }
8873
8944
 
8874
8945
  },
@@ -8941,7 +9012,7 @@
8941
9012
  children$1.forEach(Transition.cancel);
8942
9013
 
8943
9014
  reset(this.target);
8944
- this.$update(this.target);
9015
+ this.$update(this.target, 'resize');
8945
9016
  fastdom.flush();
8946
9017
 
8947
9018
  var newHeight = height(this.target);
@@ -8990,16 +9061,21 @@
8990
9061
  children$1.forEach(function (el, i) {
8991
9062
  return propsFrom[i] && css(el, propsFrom[i]);
8992
9063
  });
8993
- css(this.target, 'height', oldHeight);
9064
+ css(this.target, {
9065
+ height: oldHeight,
9066
+ display: 'block'
9067
+ });
8994
9068
  scrollTop(window, oldScrollY);
8995
9069
 
8996
- return Promise.all(children$1.map(function (el, i) {
8997
- return propsFrom[i] && propsTo[i] ?
8998
- Transition.start(el, propsTo[i], this$1.animation, 'ease') :
8999
- Promise.resolve();
9000
- }).concat(Transition.start(this.target, {
9001
- height: newHeight
9002
- }, this.animation, 'ease'))).then(function () {
9070
+ return Promise.all(
9071
+ children$1.map(function (el, i) {
9072
+ return ['top', 'left', 'height', 'width'].some(function (prop) {
9073
+ return propsFrom[i][prop] !== propsTo[i][prop];
9074
+ }) && Transition.start(el, propsTo[i], this$1.animation, 'ease');
9075
+ }).concat(oldHeight !== newHeight && Transition.start(this.target, {
9076
+ height: newHeight
9077
+ }, this.animation, 'ease'))
9078
+ ).then(function () {
9003
9079
  children$1.forEach(function (el, i) {
9004
9080
  return css(el, {
9005
9081
  display: propsTo[i].opacity === 0 ? 'none' : '',
@@ -9007,7 +9083,7 @@
9007
9083
  });
9008
9084
  });
9009
9085
  reset(this$1.target);
9010
- this$1.$update(this$1.target);
9086
+ this$1.$update(this$1.target, 'resize');
9011
9087
  fastdom.flush(); // needed for IE11
9012
9088
  }, noop);
9013
9089
 
@@ -9041,7 +9117,10 @@
9041
9117
  width: ''
9042
9118
  });
9043
9119
  removeClass(el, targetClass);
9044
- css(el, 'height', '');
9120
+ css(el, {
9121
+ height: '',
9122
+ display: ''
9123
+ });
9045
9124
  }
9046
9125
 
9047
9126
  function getPositionWithMargin(el) {
@@ -9102,8 +9181,21 @@
9102
9181
  },
9103
9182
 
9104
9183
  watch: function () {
9184
+ var this$1 = this;
9185
+
9186
+
9105
9187
  this.updateState();
9106
- }
9188
+
9189
+ if (this.selActive !== false) {
9190
+ var actives = $$(this.selActive, this.$el);
9191
+ this.toggles.forEach(function (el) {
9192
+ return toggleClass(el, this$1.cls, includes(actives, el));
9193
+ });
9194
+ }
9195
+
9196
+ },
9197
+
9198
+ immediate: true
9107
9199
 
9108
9200
  },
9109
9201
 
@@ -9149,21 +9241,6 @@
9149
9241
 
9150
9242
  ],
9151
9243
 
9152
- connected: function () {
9153
- var this$1 = this;
9154
-
9155
-
9156
- this.updateState();
9157
-
9158
- if (this.selActive !== false) {
9159
- var actives = $$(this.selActive, this.$el);
9160
- this.toggles.forEach(function (el) {
9161
- return toggleClass(el, this$1.cls, includes(actives, el));
9162
- });
9163
- }
9164
-
9165
- },
9166
-
9167
9244
  methods: {
9168
9245
 
9169
9246
  apply: function (el) {
@@ -9711,6 +9788,9 @@
9711
9788
  name: 'touchmove',
9712
9789
  passive: false,
9713
9790
  handler: 'move',
9791
+ filter: function () {
9792
+ return pointerMove === 'touchmove';
9793
+ },
9714
9794
  delegate: function () {
9715
9795
  return this.selSlides;
9716
9796
  }
@@ -9762,7 +9842,8 @@
9762
9842
  this$1.unbindMove = null;
9763
9843
  };
9764
9844
  on(window, 'scroll', this.unbindMove);
9765
- on(document, pointerUp, this.end, true);
9845
+ on(window.visualViewport, 'resize', this.unbindMove);
9846
+ on(document, (pointerUp + " " + pointerCancel), this.end, true);
9766
9847
 
9767
9848
  css(this.list, 'userSelect', 'none');
9768
9849
 
@@ -9854,6 +9935,7 @@
9854
9935
  end: function () {
9855
9936
 
9856
9937
  off(window, 'scroll', this.unbindMove);
9938
+ off(window.visualViewport, 'resize', this.unbindMove);
9857
9939
  this.unbindMove && this.unbindMove();
9858
9940
  off(document, pointerUp, this.end, true);
9859
9941
 
@@ -9931,7 +10013,7 @@
9931
10013
 
9932
10014
  if (this.nav && this.length !== this.nav.children.length) {
9933
10015
  html(this.nav, this.slides.map(function (_, i) {
9934
- return ("<li " + (this$1.attrItem) + "=\"" + i + "\"><a href=\"#\"></a></li>");
10016
+ return ("<li " + (this$1.attrItem) + "=\"" + i + "\"><a href></a></li>");
9935
10017
  }).join(''));
9936
10018
  }
9937
10019
 
@@ -10115,7 +10197,7 @@
10115
10197
  return;
10116
10198
  }
10117
10199
 
10118
- var prevIndex = this.index;
10200
+ var prevIndex = this.getIndex(this.index);
10119
10201
  var prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];
10120
10202
  var nextIndex = this.getIndex(index, this.index);
10121
10203
  var next = this.slides[nextIndex];
@@ -10339,7 +10421,7 @@
10339
10421
  pauseOnHover: false,
10340
10422
  velocity: 2,
10341
10423
  Animations: Animations$1,
10342
- template: "<div class=\"uk-lightbox uk-overflow-hidden\"> <ul class=\"uk-lightbox-items\"></ul> <div class=\"uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque\"> <button class=\"uk-lightbox-toolbar-icon uk-close-large\" type=\"button\" uk-close></button> </div> <a class=\"uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade\" href=\"#\" uk-slidenav-previous uk-lightbox-item=\"previous\"></a> <a class=\"uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade\" href=\"#\" uk-slidenav-next uk-lightbox-item=\"next\"></a> <div class=\"uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque\"></div> </div>"
10424
+ template: "<div class=\"uk-lightbox uk-overflow-hidden\"> <ul class=\"uk-lightbox-items\"></ul> <div class=\"uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque\"> <button class=\"uk-lightbox-toolbar-icon uk-close-large\" type=\"button\" uk-close></button> </div> <a class=\"uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade\" href uk-slidenav-previous uk-lightbox-item=\"previous\"></a> <a class=\"uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade\" href uk-slidenav-next uk-lightbox-item=\"next\"></a> <div class=\"uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque\"></div> </div>"
10343
10425
  });
10344
10426
  },
10345
10427
 
@@ -10348,7 +10430,7 @@
10348
10430
  var $el = $(this.template);
10349
10431
  var list = $(this.selList, $el);
10350
10432
  this.items.forEach(function () {
10351
- return append(list, '<li></li>');
10433
+ return append(list, '<li>');
10352
10434
  });
10353
10435
 
10354
10436
  this.$mount(append(this.container, $el));
@@ -10444,7 +10526,7 @@
10444
10526
 
10445
10527
  handler: function (e) {
10446
10528
 
10447
- if (!this.isToggled(this.$el)) {
10529
+ if (!this.isToggled(this.$el) || !this.draggable) {
10448
10530
  return;
10449
10531
  }
10450
10532
 
@@ -10473,7 +10555,7 @@
10473
10555
 
10474
10556
  e.preventDefault();
10475
10557
 
10476
- this.toggleNow(this.$el, true);
10558
+ this.toggleElement(this.$el, true, false);
10477
10559
 
10478
10560
  this.animation = Animations$1['scale'];
10479
10561
  removeClass(e.target, this.clsActive);
@@ -10487,20 +10569,12 @@
10487
10569
 
10488
10570
  name: 'itemshow',
10489
10571
 
10490
- handler: function (ref) {
10491
- var target = ref.target;
10492
-
10493
-
10494
- var i = index(target);
10495
- var ref$1 = this.getItem(i);
10496
- var caption = ref$1.caption;
10572
+ handler: function () {
10497
10573
 
10498
- css(this.caption, 'display', caption ? '' : 'none');
10499
- html(this.caption, caption);
10574
+ html(this.caption, this.getItem().caption || '');
10500
10575
 
10501
- for (var j = 0; j <= this.preload; j++) {
10502
- this.loadItem(this.getIndex(i + j));
10503
- this.loadItem(this.getIndex(i - j));
10576
+ for (var j = -this.preload; j <= this.preload; j++) {
10577
+ this.loadItem(this.index + j);
10504
10578
  }
10505
10579
 
10506
10580
  }
@@ -10525,24 +10599,44 @@
10525
10599
  var this$1 = this;
10526
10600
 
10527
10601
 
10528
- var source = item.source;
10602
+ var src = item.source;
10529
10603
  var type = item.type;
10530
10604
  var alt = item.alt;
10605
+ if (alt === void 0) alt = '';
10606
+ var poster = item.poster;
10607
+ var attrs = item.attrs;
10608
+ if (attrs === void 0) attrs = {};
10531
10609
 
10532
10610
  this.setItem(item, '<span uk-spinner></span>');
10533
10611
 
10534
- if (!source) {
10612
+ if (!src) {
10535
10613
  return;
10536
10614
  }
10537
10615
 
10538
10616
  var matches;
10617
+ var iframeAttrs = {
10618
+ frameborder: '0',
10619
+ allow: 'autoplay',
10620
+ allowfullscreen: '',
10621
+ style: 'max-width: 100%; box-sizing: border-box;',
10622
+ 'uk-responsive': '',
10623
+ 'uk-video': ("" + (this.videoAutoplay))
10624
+ };
10539
10625
 
10540
10626
  // Image
10541
- if (type === 'image' || source.match(/\.(jpe?g|png|gif|svg|webp)($|\?)/i)) {
10627
+ if (type === 'image' || src.match(/\.(jpe?g|png|gif|svg|webp)($|\?)/i)) {
10542
10628
 
10543
- getImage(source).then(
10544
- function (img) {
10545
- return this$1.setItem(item, ("<img width=\"" + (img.width) + "\" height=\"" + (img.height) + "\" src=\"" + source + "\" alt=\"" + (alt ? alt : '') + "\">"));
10629
+ getImage(src, attrs.srcset, attrs.size).then(
10630
+ function (ref) {
10631
+ var width = ref.width;
10632
+ var height = ref.height;
10633
+
10634
+ return this$1.setItem(item, createEl('img', assign({
10635
+ src: src,
10636
+ width: width,
10637
+ height: height,
10638
+ alt: alt
10639
+ }, attrs)));
10546
10640
  },
10547
10641
  function () {
10548
10642
  return this$1.setError(item);
@@ -10550,81 +10644,68 @@
10550
10644
  );
10551
10645
 
10552
10646
  // Video
10553
- } else if (type === 'video' || source.match(/\.(mp4|webm|ogv)($|\?)/i)) {
10554
-
10555
- var video = $(("<video controls playsinline" + (item.poster ? (" poster=\"" + (item.poster) + "\"") : '') + " uk-video=\"" + (this.videoAutoplay) + "\"></video>"));
10556
- attr(video, 'src', source);
10557
-
10558
- once(video, 'error loadedmetadata', function (type) {
10559
- if (type === 'error') {
10560
- this$1.setError(item);
10561
- } else {
10562
- attr(video, {
10563
- width: video.videoWidth,
10564
- height: video.videoHeight
10565
- });
10566
- this$1.setItem(item, video);
10567
- }
10647
+ } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
10648
+
10649
+ var video = createEl('video', assign({
10650
+ src: src,
10651
+ poster: poster,
10652
+ controls: '',
10653
+ playsinline: '',
10654
+ 'uk-video': ("" + (this.videoAutoplay))
10655
+ }, attrs));
10656
+
10657
+ on(video, 'loadedmetadata', function () {
10658
+ attr(video, {
10659
+ width: video.videoWidth,
10660
+ height: video.videoHeight
10661
+ });
10662
+ this$1.setItem(item, video);
10663
+ });
10664
+ on(video, 'error', function () {
10665
+ return this$1.setError(item);
10568
10666
  });
10569
10667
 
10570
10668
  // Iframe
10571
- } else if (type === 'iframe' || source.match(/\.(html|php)($|\?)/i)) {
10669
+ } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
10572
10670
 
10573
- this.setItem(item, ("<iframe class=\"uk-lightbox-iframe\" src=\"" + source + "\" frameborder=\"0\" allowfullscreen></iframe>"));
10671
+ this.setItem(item, createEl('iframe', assign({
10672
+ src: src,
10673
+ frameborder: '0',
10674
+ allowfullscreen: '',
10675
+ class: 'uk-lightbox-iframe'
10676
+ }, attrs)));
10574
10677
 
10575
10678
  // YouTube
10576
- } else if ((matches = source.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/watch\?v=([^&\s]+)/) || source.match(/()youtu\.be\/(.*)/))) {
10577
-
10578
- var id = matches[2];
10579
- var setIframe = function (width, height) {
10580
- if (width === void 0) width = 640;
10581
- if (height === void 0) height = 450;
10582
-
10583
- return this$1.setItem(item, getIframe(("https://www.youtube" + (matches[1] || '') + ".com/embed/" + id), width, height, this$1.videoAutoplay));
10584
- };
10585
-
10586
- getImage(("https://img.youtube.com/vi/" + id + "/maxresdefault.jpg")).then(
10587
- function (ref) {
10588
- var width = ref.width;
10589
- var height = ref.height;
10679
+ } else if ((matches = src.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))) {
10590
10680
 
10591
- // YouTube default 404 thumb, fall back to low resolution
10592
- if (width === 120 && height === 90) {
10593
- getImage(("https://img.youtube.com/vi/" + id + "/0.jpg")).then(
10594
- function (ref) {
10595
- var width = ref.width;
10596
- var height = ref.height;
10597
-
10598
- return setIframe(width, height);
10599
- },
10600
- setIframe
10601
- );
10602
- } else {
10603
- setIframe(width, height);
10604
- }
10605
- },
10606
- setIframe
10607
- );
10681
+ this.setItem(item, createEl('iframe', assign({
10682
+ src: ("https://www.youtube" + (matches[1] || '') + ".com/embed/" + (matches[2]) + (matches[3] ? ("?" + (matches[3])) : '')),
10683
+ width: 1920,
10684
+ height: 1080,
10685
+ }, iframeAttrs, attrs)));
10608
10686
 
10609
10687
  // Vimeo
10610
- } else if ((matches = source.match(/(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/))) {
10688
+ } else if ((matches = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))) {
10611
10689
 
10612
- ajax(("https://vimeo.com/api/oembed.json?maxwidth=1920&url=" + (encodeURI(source))), {
10690
+ ajax(("https://vimeo.com/api/oembed.json?maxwidth=1920&url=" + (encodeURI(src))), {
10613
10691
  responseType: 'json',
10614
10692
  withCredentials: false
10615
- })
10616
- .then(
10617
- function (ref) {
10618
- var ref_response = ref.response;
10619
- var height = ref_response.height;
10620
- var width = ref_response.width;
10621
-
10622
- return this$1.setItem(item, getIframe(("https://player.vimeo.com/video/" + (matches[2])), width, height, this$1.videoAutoplay));
10623
- },
10624
- function () {
10625
- return this$1.setError(item);
10626
- }
10627
- );
10693
+ }).then(
10694
+ function (ref) {
10695
+ var ref_response = ref.response;
10696
+ var height = ref_response.height;
10697
+ var width = ref_response.width;
10698
+
10699
+ return this$1.setItem(item, createEl('iframe', assign({
10700
+ src: ("https://player.vimeo.com/video/" + (matches[1]) + (matches[2] ? ("?" + (matches[2])) : '')),
10701
+ width: width,
10702
+ height: height
10703
+ }, iframeAttrs, attrs)));
10704
+ },
10705
+ function () {
10706
+ return this$1.setError(item);
10707
+ }
10708
+ );
10628
10709
 
10629
10710
  }
10630
10711
 
@@ -10642,26 +10723,23 @@
10642
10723
 
10643
10724
  var item = this.getItem(index);
10644
10725
 
10645
- if (item.content) {
10646
- return;
10726
+ if (!this.getSlide(item).childElementCount) {
10727
+ trigger(this.$el, 'itemload', [item]);
10647
10728
  }
10648
-
10649
- trigger(this.$el, 'itemload', [item]);
10650
10729
  },
10651
10730
 
10652
10731
  getItem: function (index) {
10653
10732
  if (index === void 0) index = this.index;
10654
10733
 
10655
- return this.items[index] || {};
10734
+ return this.items[getIndex(index, this.slides)];
10656
10735
  },
10657
10736
 
10658
10737
  setItem: function (item, content) {
10659
- assign(item, {
10660
- content: content
10661
- });
10662
- var el = html(this.slides[this.items.indexOf(item)], content);
10663
- trigger(this.$el, 'itemloaded', [this, el]);
10664
- this.$update(el);
10738
+ trigger(this.$el, 'itemloaded', [this, html(this.getSlide(item), content)]);
10739
+ },
10740
+
10741
+ getSlide: function (item) {
10742
+ return this.slides[this.items.indexOf(item)];
10665
10743
  },
10666
10744
 
10667
10745
  setError: function (item) {
@@ -10685,8 +10763,10 @@
10685
10763
 
10686
10764
  };
10687
10765
 
10688
- function getIframe(src, width, height, autoplay) {
10689
- return ("<iframe src=\"" + src + "\" width=\"" + width + "\" height=\"" + height + "\" style=\"max-width: 100%; box-sizing: border-box;\" frameborder=\"0\" allowfullscreen uk-video=\"autoplay: " + autoplay + "\" uk-responsive></iframe>");
10766
+ function createEl(tag, attrs) {
10767
+ var el = fragment(("<" + tag + ">"));
10768
+ attr(el, attrs);
10769
+ return el;
10690
10770
  }
10691
10771
 
10692
10772
  var lightbox = {
@@ -10715,10 +10795,6 @@
10715
10795
  this.hide();
10716
10796
  }
10717
10797
 
10718
- },
10719
-
10720
- items: function () {
10721
- return uniqueBy(this.toggles.map(toItem), 'source');
10722
10798
  }
10723
10799
 
10724
10800
  },
@@ -10739,12 +10815,7 @@
10739
10815
 
10740
10816
  handler: function (e) {
10741
10817
  e.preventDefault();
10742
- var src = data(e.current, 'href');
10743
- this.show(findIndex(this.items, function (ref) {
10744
- var source = ref.source;
10745
-
10746
- return source === src;
10747
- }));
10818
+ this.show(e.current);
10748
10819
  }
10749
10820
 
10750
10821
  }
@@ -10757,8 +10828,20 @@
10757
10828
  var this$1 = this;
10758
10829
 
10759
10830
 
10831
+ var items = uniqueBy(this.toggles.map(toItem), 'source');
10832
+
10833
+ if (isElement(index)) {
10834
+ var ref = toItem(index);
10835
+ var source = ref.source;
10836
+ index = findIndex(items, function (ref) {
10837
+ var src = ref.source;
10838
+
10839
+ return source === src;
10840
+ });
10841
+ }
10842
+
10760
10843
  this.panel = this.panel || this.$create('lightboxPanel', assign({}, this.$props, {
10761
- items: this.items
10844
+ items: items
10762
10845
  }));
10763
10846
 
10764
10847
  on(this.panel.$el, 'hidden', function () {
@@ -10793,16 +10876,20 @@
10793
10876
  }
10794
10877
 
10795
10878
  function toItem(el) {
10796
- return ['href', 'caption', 'type', 'poster', 'alt'].reduce(function (obj, attr) {
10797
- obj[attr === 'href' ? 'source' : attr] = data(el, attr);
10798
- return obj;
10799
- }, {});
10879
+
10880
+ var item = {};
10881
+
10882
+ ['href', 'caption', 'type', 'poster', 'alt', 'attrs'].forEach(function (attr) {
10883
+ item[attr === 'href' ? 'source' : attr] = data(el, attr);
10884
+ });
10885
+
10886
+ item.attrs = parseOptions(item.attrs);
10887
+
10888
+ return item;
10800
10889
  }
10801
10890
 
10802
10891
  var obj;
10803
10892
 
10804
- var containers = {};
10805
-
10806
10893
  var notification = {
10807
10894
 
10808
10895
  functional: true,
@@ -10815,6 +10902,7 @@
10815
10902
  timeout: 5000,
10816
10903
  group: null,
10817
10904
  pos: 'top-center',
10905
+ clsContainer: 'uk-notification',
10818
10906
  clsClose: 'uk-notification-close',
10819
10907
  clsMsg: 'uk-notification-message'
10820
10908
  },
@@ -10841,14 +10929,11 @@
10841
10929
 
10842
10930
  created: function () {
10843
10931
 
10844
- if (!containers[this.pos]) {
10845
- containers[this.pos] = append(this.$container, ("<div class=\"uk-notification uk-notification-" + (this.pos) + "\"></div>"));
10846
- }
10847
-
10848
- var container = css(containers[this.pos], 'display', 'block');
10932
+ var container = $(("." + (this.clsContainer) + "-" + (this.pos)), this.$container) ||
10933
+ append(this.$container, ("<div class=\"" + (this.clsContainer) + " " + (this.clsContainer) + "-" + (this.pos) + "\" style=\"display: block\"></div>"));
10849
10934
 
10850
10935
  this.$mount(append(container,
10851
- ("<div class=\"" + (this.clsMsg) + (this.status ? (" " + (this.clsMsg) + "-" + (this.status)) : '') + "\"> <a href=\"#\" class=\"" + (this.clsClose) + "\" data-uk-close></a> <div>" + (this.message) + "</div> </div>")
10936
+ ("<div class=\"" + (this.clsMsg) + (this.status ? (" " + (this.clsMsg) + "-" + (this.status)) : '') + "\"> <a href class=\"" + (this.clsClose) + "\" data-uk-close></a> <div>" + (this.message) + "</div> </div>")
10852
10937
  ));
10853
10938
 
10854
10939
  },
@@ -10899,11 +10984,13 @@
10899
10984
 
10900
10985
  var removeFn = function () {
10901
10986
 
10987
+ var container = this$1.$el.parentNode;
10988
+
10902
10989
  trigger(this$1.$el, 'close', [this$1]);
10903
10990
  remove(this$1.$el);
10904
10991
 
10905
- if (!containers[this$1.pos].children.length) {
10906
- css(containers[this$1.pos], 'display', 'none');
10992
+ if (container && !container.hasChildNodes()) {
10993
+ remove(container);
10907
10994
  }
10908
10995
 
10909
10996
  };
@@ -11102,7 +11189,7 @@
11102
11189
 
11103
11190
  if (!img.naturalWidth) {
11104
11191
  img.onload = function () {
11105
- return this$1.$emit();
11192
+ return this$1.$update();
11106
11193
  };
11107
11194
  }
11108
11195
  }
@@ -12269,9 +12356,7 @@
12269
12356
  ['init', 'start', 'move', 'end'].forEach(function (key) {
12270
12357
  var fn = this$1[key];
12271
12358
  this$1[key] = function (e) {
12272
- this$1.scrollY = window.pageYOffset;
12273
- assign(this$1.pos, getEventPos(e, 'page'));
12274
-
12359
+ assign(this$1.pos, getEventPos(e));
12275
12360
  fn(e);
12276
12361
  };
12277
12362
  });
@@ -12285,33 +12370,110 @@
12285
12370
 
12286
12371
  },
12287
12372
 
12373
+ computed: {
12374
+
12375
+ target: function () {
12376
+ return (this.$el.tBodies || [this.$el])[0];
12377
+ },
12378
+
12379
+ items: function () {
12380
+ return children(this.target);
12381
+ },
12382
+
12383
+ isEmpty: {
12384
+
12385
+ get: function () {
12386
+ return isEmpty(this.items);
12387
+ },
12388
+
12389
+ watch: function (empty) {
12390
+ toggleClass(this.target, this.clsEmpty, empty);
12391
+ },
12392
+
12393
+ immediate: true
12394
+
12395
+ },
12396
+
12397
+ handles: {
12398
+
12399
+ get: function (ref, el) {
12400
+ var handle = ref.handle;
12401
+
12402
+ return handle ? $$(handle, el) : this.items;
12403
+ },
12404
+
12405
+ watch: function (handles, prev) {
12406
+ css(prev, {
12407
+ touchAction: '',
12408
+ userSelect: ''
12409
+ });
12410
+ css(handles, {
12411
+ touchAction: hasTouch ? 'none' : '',
12412
+ userSelect: 'none'
12413
+ }); // touchAction set to 'none' causes a performance drop in Chrome 80
12414
+ },
12415
+
12416
+ immediate: true
12417
+
12418
+ }
12419
+
12420
+ },
12421
+
12288
12422
  update: {
12289
12423
 
12290
12424
  write: function () {
12291
12425
 
12292
- if (this.clsEmpty) {
12293
- toggleClass(this.$el, this.clsEmpty, isEmpty(this.$el.children));
12426
+ if (!this.drag || !parent(this.placeholder)) {
12427
+ return;
12294
12428
  }
12295
12429
 
12296
- css(this.handle ? $$(this.handle, this.$el) : this.$el.children, {
12297
- touchAction: 'none',
12298
- userSelect: 'none'
12430
+ // clamp to viewport
12431
+ var ref = this.pos;
12432
+ var x = ref.x;
12433
+ var y = ref.y;
12434
+ var ref$1 = this.origin;
12435
+ var offsetTop = ref$1.offsetTop;
12436
+ var offsetLeft = ref$1.offsetLeft;
12437
+ var ref$2 = this.drag;
12438
+ var offsetHeight = ref$2.offsetHeight;
12439
+ var offsetWidth = ref$2.offsetWidth;
12440
+ var ref$3 = offset(window);
12441
+ var right = ref$3.right;
12442
+ var bottom = ref$3.bottom;
12443
+ var target = document.elementFromPoint(x, y);
12444
+
12445
+ css(this.drag, {
12446
+ top: clamp(y - offsetTop, 0, bottom - offsetHeight),
12447
+ left: clamp(x - offsetLeft, 0, right - offsetWidth)
12299
12448
  });
12300
12449
 
12301
- if (this.drag) {
12450
+ var sortable = this.getSortable(target);
12451
+ var previous = this.getSortable(this.placeholder);
12452
+ var move = sortable !== previous;
12302
12453
 
12303
- // clamp to viewport
12304
- var ref = offset(window);
12305
- var right = ref.right;
12306
- var bottom = ref.bottom;
12307
- offset(this.drag, {
12308
- top: clamp(this.pos.y + this.origin.top, 0, bottom - this.drag.offsetHeight),
12309
- left: clamp(this.pos.x + this.origin.left, 0, right - this.drag.offsetWidth)
12310
- });
12454
+ if (!sortable || within(target, this.placeholder) || move && (!sortable.group || sortable.group !== previous.group)) {
12455
+ return;
12456
+ }
12457
+
12458
+ target = sortable.target === target.parentNode && target || sortable.items.filter(function (element) {
12459
+ return within(target, element);
12460
+ })[0];
12461
+
12462
+ if (move) {
12463
+ previous.remove(this.placeholder);
12464
+ } else if (!target) {
12465
+ return;
12466
+ }
12467
+
12468
+ sortable.insert(this.placeholder, target);
12311
12469
 
12470
+ if (!includes(this.touched, sortable)) {
12471
+ this.touched.push(sortable);
12312
12472
  }
12313
12473
 
12314
- }
12474
+ },
12475
+
12476
+ events: ['move']
12315
12477
 
12316
12478
  },
12317
12479
 
@@ -12322,7 +12484,7 @@
12322
12484
  var target = e.target;
12323
12485
  var button = e.button;
12324
12486
  var defaultPrevented = e.defaultPrevented;
12325
- var ref = children(this.$el).filter(function (el) {
12487
+ var ref = this.items.filter(function (el) {
12326
12488
  return within(target, el);
12327
12489
  });
12328
12490
  var placeholder = ref[0];
@@ -12348,7 +12510,6 @@
12348
12510
 
12349
12511
  on(document, pointerMove, this.move);
12350
12512
  on(document, pointerUp, this.end);
12351
- on(window, 'scroll', this.scroll);
12352
12513
 
12353
12514
  if (!this.threshold) {
12354
12515
  this.start(e);
@@ -12359,18 +12520,17 @@
12359
12520
  start: function (e) {
12360
12521
 
12361
12522
  this.drag = appendDrag(this.$container, this.placeholder);
12362
-
12363
- var ref = offset(this.placeholder);
12523
+ var ref = this.placeholder.getBoundingClientRect();
12364
12524
  var left = ref.left;
12365
12525
  var top = ref.top;
12366
12526
  assign(this.origin, {
12367
- left: left - this.pos.x,
12368
- top: top - this.pos.y
12527
+ offsetLeft: this.pos.x - left,
12528
+ offsetTop: this.pos.y - top
12369
12529
  });
12370
12530
 
12371
12531
  addClass(this.drag, this.clsDrag, this.clsCustom);
12372
12532
  addClass(this.placeholder, this.clsPlaceholder);
12373
- addClass(this.$el.children, this.clsItem);
12533
+ addClass(this.items, this.clsItem);
12374
12534
  addClass(document.documentElement, this.clsDragState);
12375
12535
 
12376
12536
  trigger(this.$el, 'start', [this, this.placeholder]);
@@ -12382,41 +12542,10 @@
12382
12542
 
12383
12543
  move: function (e) {
12384
12544
 
12385
- if (!this.drag) {
12386
-
12387
- if (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold) {
12388
- this.start(e);
12389
- }
12390
-
12391
- return;
12392
- }
12393
-
12394
- this.$emit();
12395
-
12396
- var target = e.type === 'mousemove' ? e.target : document.elementFromPoint(this.pos.x - window.pageXOffset, this.pos.y - window.pageYOffset);
12397
-
12398
- var sortable = this.getSortable(target);
12399
- var previous = this.getSortable(this.placeholder);
12400
- var move = sortable !== previous;
12401
-
12402
- if (!sortable || within(target, this.placeholder) || move && (!sortable.group || sortable.group !== previous.group)) {
12403
- return;
12404
- }
12405
-
12406
- target = sortable.$el === target.parentNode && target || children(sortable.$el).filter(function (element) {
12407
- return within(target, element);
12408
- })[0];
12409
-
12410
- if (move) {
12411
- previous.remove(this.placeholder);
12412
- } else if (!target) {
12413
- return;
12414
- }
12415
-
12416
- sortable.insert(this.placeholder, target);
12417
-
12418
- if (!includes(this.touched, sortable)) {
12419
- this.touched.push(sortable);
12545
+ if (this.drag) {
12546
+ this.$emit('move');
12547
+ } else if (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold) {
12548
+ this.start(e);
12420
12549
  }
12421
12550
 
12422
12551
  },
@@ -12457,40 +12586,31 @@
12457
12586
  return ((sortable.clsPlaceholder) + " " + (sortable.clsItem));
12458
12587
  }).join(' ');
12459
12588
  this.touched.forEach(function (sortable) {
12460
- return removeClass(sortable.$el.children, classes);
12589
+ return removeClass(sortable.items, classes);
12461
12590
  });
12462
12591
 
12463
12592
  removeClass(document.documentElement, this.clsDragState);
12464
12593
 
12465
12594
  },
12466
12595
 
12467
- scroll: function () {
12468
- var scroll = window.pageYOffset;
12469
- if (scroll !== this.scrollY) {
12470
- this.pos.y += scroll - this.scrollY;
12471
- this.scrollY = scroll;
12472
- this.$emit();
12473
- }
12474
- },
12475
-
12476
12596
  insert: function (element, target) {
12477
12597
  var this$1 = this;
12478
12598
 
12479
12599
 
12480
- addClass(this.$el.children, this.clsItem);
12600
+ addClass(this.items, this.clsItem);
12481
12601
 
12482
12602
  var insert = function () {
12483
12603
 
12484
12604
  if (target) {
12485
12605
 
12486
- if (!within(element, this$1.$el) || isPredecessor(element, target)) {
12606
+ if (!within(element, this$1.target) || isPredecessor(element, target)) {
12487
12607
  before(target, element);
12488
12608
  } else {
12489
12609
  after(target, element);
12490
12610
  }
12491
12611
 
12492
12612
  } else {
12493
- append(this$1.$el, element);
12613
+ append(this$1.target, element);
12494
12614
  }
12495
12615
 
12496
12616
  };
@@ -12505,15 +12625,10 @@
12505
12625
 
12506
12626
  remove: function (element) {
12507
12627
 
12508
- if (!within(element, this.$el)) {
12628
+ if (!within(element, this.target)) {
12509
12629
  return;
12510
12630
  }
12511
12631
 
12512
- css(this.handle ? $$(this.handle, element) : element, {
12513
- touchAction: '',
12514
- userSelect: ''
12515
- });
12516
-
12517
12632
  if (this.animation) {
12518
12633
  this.animate(function () {
12519
12634
  return remove(element);
@@ -12540,11 +12655,17 @@
12540
12655
 
12541
12656
  function trackScroll(pos) {
12542
12657
 
12658
+ var last = Date.now();
12543
12659
  trackTimer = setInterval(function () {
12544
12660
 
12545
12661
  var x = pos.x;
12546
12662
  var y = pos.y;
12547
- scrollParents(document.elementFromPoint(x - window.pageXOffset, y - window.pageYOffset)).some(function (scrollEl) {
12663
+ y += window.pageYOffset;
12664
+
12665
+ var dist = (Date.now() - last) * .3;
12666
+ last = Date.now();
12667
+
12668
+ scrollParents(document.elementFromPoint(x, pos.y)).some(function (scrollEl) {
12548
12669
 
12549
12670
  var scroll = scrollEl.scrollTop;
12550
12671
  var scrollHeight = scrollEl.scrollHeight;
@@ -12555,9 +12676,9 @@
12555
12676
  var height = ref.height;
12556
12677
 
12557
12678
  if (top < y && top + 30 > y) {
12558
- scroll -= 5;
12679
+ scroll -= dist;
12559
12680
  } else if (bottom > y && bottom - 30 < y) {
12560
- scroll += 5;
12681
+ scroll += dist;
12561
12682
  } else {
12562
12683
  return;
12563
12684
  }
@@ -12578,7 +12699,9 @@
12578
12699
  }
12579
12700
 
12580
12701
  function appendDrag(container, element) {
12581
- var clone = append(container, element.outerHTML.replace(/(^<)li|li(\/>$)/g, '$1div$2'));
12702
+ var clone = append(container, element.outerHTML.replace(/(^<)(?:li|tr)|(?:li|tr)(\/>$)/g, '$1div$2'));
12703
+
12704
+ attr(clone, 'style', ((attr(clone, 'style')) + ";margin:0!important"));
12582
12705
 
12583
12706
  css(clone, assign({
12584
12707
  boxSizing: 'border-box',
@@ -12653,50 +12776,60 @@
12653
12776
  });
12654
12777
 
12655
12778
  clearTimeout(this.showTimer);
12656
- this.showTimer = setTimeout(function () {
12657
- this$1._show();
12658
- this$1.hideTimer = setInterval(function () {
12659
-
12660
- if (!isVisible(this$1.$el)) {
12661
- this$1.hide();
12662
- }
12663
-
12664
- }, 150);
12665
- }, this.delay);
12779
+ this.showTimer = setTimeout(this._show, this.delay);
12666
12780
  },
12667
12781
 
12668
12782
  hide: function () {
12783
+ var this$1 = this;
12784
+
12669
12785
 
12670
12786
  if (!this.isActive() || matches(this.$el, 'input:focus')) {
12671
12787
  return;
12672
12788
  }
12673
12789
 
12674
- actives.splice(actives.indexOf(this), 1);
12790
+ this.toggleElement(this.tooltip, false, false).then(function () {
12675
12791
 
12676
- clearTimeout(this.showTimer);
12677
- clearInterval(this.hideTimer);
12678
- attr(this.$el, 'aria-expanded', false);
12679
- this.toggleElement(this.tooltip, false);
12680
- this.tooltip && remove(this.tooltip);
12681
- this.tooltip = false;
12682
- this._unbind();
12792
+ actives.splice(actives.indexOf(this$1), 1);
12793
+
12794
+ clearTimeout(this$1.showTimer);
12795
+ clearInterval(this$1.hideTimer);
12683
12796
 
12797
+ this$1.tooltip = remove(this$1.tooltip);
12798
+ this$1._unbind();
12799
+ });
12684
12800
  },
12685
12801
 
12686
12802
  _show: function () {
12803
+ var this$1 = this;
12804
+
12687
12805
 
12688
12806
  this.tooltip = append(this.container,
12689
- ("<div class=\"" + (this.clsPos) + "\" aria-expanded=\"true\" aria-hidden> <div class=\"" + (this.clsPos) + "-inner\">" + (this.title) + "</div> </div>")
12807
+ ("<div class=\"" + (this.clsPos) + "\"> <div class=\"" + (this.clsPos) + "-inner\">" + (this.title) + "</div> </div>")
12690
12808
  );
12691
12809
 
12692
- this.positionAt(this.tooltip, this.$el);
12810
+ on(this.tooltip, 'toggled', function () {
12811
+
12812
+ var toggled = this$1.isToggled(this$1.tooltip);
12813
+
12814
+ attr(this$1.$el, 'aria-expanded', toggled);
12693
12815
 
12694
- this.origin = this.getAxis() === 'y' ?
12695
- ((flipPosition(this.dir)) + "-" + (this.align)) :
12696
- ((this.align) + "-" + (flipPosition(this.dir)));
12816
+ if (!toggled) {
12817
+ return;
12818
+ }
12819
+
12820
+ this$1.positionAt(this$1.tooltip, this$1.$el);
12821
+
12822
+ this$1.origin = this$1.getAxis() === 'y' ?
12823
+ ((flipPosition(this$1.dir)) + "-" + (this$1.align)) :
12824
+ ((this$1.align) + "-" + (flipPosition(this$1.dir)));
12825
+ });
12697
12826
 
12698
12827
  this.toggleElement(this.tooltip, true);
12699
12828
 
12829
+ this.hideTimer = setInterval(function () {
12830
+ return !isVisible(this$1.$el) && this$1.hide();
12831
+ }, 150);
12832
+
12700
12833
  },
12701
12834
 
12702
12835
  isActive: function () {
@@ -12935,7 +13068,6 @@
12935
13068
  e.stopPropagation();
12936
13069
  }
12937
13070
 
12938
-
12939
13071
  var components = /*#__PURE__*/ Object.freeze({
12940
13072
  __proto__: null,
12941
13073
  Countdown: countdown,