uikit 3.10.1-dev.2a182d8f9 → 3.10.2-dev.3a696ee97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.eslintrc.json +0 -1
  2. package/CHANGELOG.md +22 -11
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/build/.eslintrc.json +10 -1
  6. package/build/less.js +1 -2
  7. package/build/scss.js +5 -5
  8. package/dist/css/uikit-core-rtl.css +8 -5
  9. package/dist/css/uikit-core-rtl.min.css +1 -1
  10. package/dist/css/uikit-core.css +8 -5
  11. package/dist/css/uikit-core.min.css +1 -1
  12. package/dist/css/uikit-rtl.css +8 -5
  13. package/dist/css/uikit-rtl.min.css +1 -1
  14. package/dist/css/uikit.css +8 -5
  15. package/dist/css/uikit.min.css +1 -1
  16. package/dist/js/components/countdown.js +1 -1
  17. package/dist/js/components/countdown.min.js +1 -1
  18. package/dist/js/components/filter.js +5 -5
  19. package/dist/js/components/filter.min.js +1 -1
  20. package/dist/js/components/lightbox-panel.js +2 -2
  21. package/dist/js/components/lightbox-panel.min.js +1 -1
  22. package/dist/js/components/lightbox.js +2 -2
  23. package/dist/js/components/lightbox.min.js +1 -1
  24. package/dist/js/components/notification.js +1 -1
  25. package/dist/js/components/notification.min.js +1 -1
  26. package/dist/js/components/parallax.js +4 -4
  27. package/dist/js/components/parallax.min.js +1 -1
  28. package/dist/js/components/slider-parallax.js +5 -11
  29. package/dist/js/components/slider-parallax.min.js +1 -1
  30. package/dist/js/components/slider.js +2 -2
  31. package/dist/js/components/slider.min.js +1 -1
  32. package/dist/js/components/slideshow-parallax.js +5 -11
  33. package/dist/js/components/slideshow-parallax.min.js +1 -1
  34. package/dist/js/components/slideshow.js +2 -2
  35. package/dist/js/components/slideshow.min.js +1 -1
  36. package/dist/js/components/sortable.js +5 -5
  37. package/dist/js/components/sortable.min.js +1 -1
  38. package/dist/js/components/tooltip.js +5 -4
  39. package/dist/js/components/tooltip.min.js +1 -1
  40. package/dist/js/components/upload.js +1 -1
  41. package/dist/js/components/upload.min.js +1 -1
  42. package/dist/js/uikit-core.js +32 -32
  43. package/dist/js/uikit-core.min.js +1 -1
  44. package/dist/js/uikit-icons.js +1 -1
  45. package/dist/js/uikit-icons.min.js +1 -1
  46. package/dist/js/uikit.js +43 -48
  47. package/dist/js/uikit.min.js +1 -1
  48. package/package.json +3 -3
  49. package/src/js/api/component.js +3 -3
  50. package/src/js/api/hooks.js +6 -10
  51. package/src/js/api/state.js +3 -3
  52. package/src/js/components/slider-parallax.js +1 -7
  53. package/src/js/components/tooltip.js +2 -1
  54. package/src/js/core/navbar.js +1 -1
  55. package/src/js/core/sticky.js +1 -1
  56. package/src/js/core/toggle.js +4 -3
  57. package/src/js/mixin/animate.js +4 -4
  58. package/src/js/mixin/internal/slideshow-animations.js +1 -1
  59. package/src/js/mixin/parallax.js +3 -3
  60. package/src/js/mixin/position.js +3 -3
  61. package/src/js/util/dom.js +3 -3
  62. package/src/js/util/lang.js +5 -1
  63. package/src/js/util/viewport.js +3 -3
  64. package/src/less/components/cover.less +4 -2
  65. package/src/less/components/divider.less +1 -1
  66. package/src/less/components/utility.less +2 -1
  67. package/src/scss/components/cover.scss +4 -2
  68. package/src/scss/components/divider.scss +1 -1
  69. package/src/scss/components/utility.scss +2 -1
  70. package/tests/base.html +12 -12
  71. package/tests/button.html +1 -1
  72. package/tests/cover.html +5 -5
  73. package/tests/drop.html +2 -2
  74. package/tests/dropdown.html +1 -1
  75. package/tests/flex.html +1 -1
  76. package/tests/grid-masonry.html +1 -1
  77. package/tests/grid-parallax.html +1 -1
  78. package/tests/grid.html +1 -1
  79. package/tests/height.html +2 -2
  80. package/tests/js/index.js +3 -8
  81. package/tests/margin.html +1 -1
  82. package/tests/modal.html +2 -2
  83. package/tests/navbar.html +2 -2
  84. package/tests/padding.html +1 -1
  85. package/tests/parallax.html +1 -1
  86. package/tests/slider.html +1 -1
  87. package/tests/slideshow.html +2 -2
  88. package/tests/sticky.html +2 -2
  89. package/tests/switcher.html +1 -1
  90. package/tests/tab.html +1 -1
  91. package/tests/utility.html +1 -1
  92. package/tests/video.html +3 -3
  93. package/tests/width.html +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.10.1-dev.2a182d8f9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.10.2-dev.3a696ee97 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -146,7 +146,7 @@
146
146
 
147
147
  function toNumber(value) {
148
148
  var number = Number(value);
149
- return !isNaN(number) ? number : false;
149
+ return isNaN(number) ? false : number;
150
150
  }
151
151
 
152
152
  function toFloat(value) {
@@ -343,6 +343,10 @@
343
343
 
344
344
  var length = elements.length;
345
345
 
346
+ if (!length) {
347
+ return -1;
348
+ }
349
+
346
350
  i = isNumeric(i)
347
351
  ? toNumber(i)
348
352
  : i === 'next'
@@ -1125,10 +1129,10 @@
1125
1129
 
1126
1130
  parent = $(parent);
1127
1131
 
1128
- if (!parent.hasChildNodes()) {
1129
- return append(parent, element);
1130
- } else {
1132
+ if (parent.hasChildNodes()) {
1131
1133
  return insertNodes(element, function (element) { return parent.insertBefore(element, parent.firstChild); });
1134
+ } else {
1135
+ return append(parent, element);
1132
1136
  }
1133
1137
  }
1134
1138
 
@@ -2292,10 +2296,10 @@
2292
2296
  scrollTop(element, scroll + top * percent);
2293
2297
 
2294
2298
  // scroll more if we have not reached our destination
2295
- if (percent !== 1) {
2296
- requestAnimationFrame(step);
2297
- } else {
2299
+ if (percent === 1) {
2298
2300
  resolve();
2301
+ } else {
2302
+ requestAnimationFrame(step);
2299
2303
  }
2300
2304
 
2301
2305
  })();
@@ -2888,26 +2892,21 @@
2888
2892
 
2889
2893
  var ref = this;
2890
2894
  var computed = ref.$options.computed;
2891
- var _computeds = ref._computeds;
2895
+ var values = assign({}, this._computeds);
2896
+ this._computeds = {};
2892
2897
 
2893
2898
  for (var key in computed) {
2894
-
2895
- var hasPrev = hasOwn(_computeds, key);
2896
- var prev = _computeds[key];
2897
-
2898
- delete _computeds[key];
2899
-
2900
2899
  var ref$1 = computed[key];
2901
2900
  var watch = ref$1.watch;
2902
2901
  var immediate = ref$1.immediate;
2903
2902
  if (watch && (
2904
2903
  initial && immediate
2905
- || hasPrev && !isEqual(prev, this[key])
2904
+ || hasOwn(values, key) && !isEqual(values[key], this[key])
2906
2905
  )) {
2907
- watch.call(this, this[key], prev);
2906
+ watch.call(this, this[key], values[key]);
2908
2907
  }
2909
-
2910
2908
  }
2909
+
2911
2910
  }
2912
2911
  }
2913
2912
 
@@ -3004,12 +3003,12 @@
3004
3003
 
3005
3004
  events.forEach(function (event) {
3006
3005
 
3007
- if (!hasOwn(event, 'handler')) {
3006
+ if (hasOwn(event, 'handler')) {
3007
+ registerEvent(this$1$1, event);
3008
+ } else {
3008
3009
  for (var key in event) {
3009
3010
  registerEvent(this$1$1, event[key], key);
3010
3011
  }
3011
- } else {
3012
- registerEvent(this$1$1, event);
3013
3012
  }
3014
3013
 
3015
3014
  });
@@ -3390,10 +3389,10 @@
3390
3389
  var instance = UIkit.getComponent(element, name);
3391
3390
 
3392
3391
  if (instance) {
3393
- if (!data) {
3394
- return instance;
3395
- } else {
3392
+ if (data) {
3396
3393
  instance.$destroy();
3394
+ } else {
3395
+ return instance;
3397
3396
  }
3398
3397
  }
3399
3398
 
@@ -3463,7 +3462,7 @@
3463
3462
  UIkit.data = '__uikit__';
3464
3463
  UIkit.prefix = 'uk-';
3465
3464
  UIkit.options = {};
3466
- UIkit.version = '3.10.1-dev.2a182d8f9';
3465
+ UIkit.version = '3.10.2-dev.3a696ee97';
3467
3466
 
3468
3467
  globalAPI(UIkit);
3469
3468
  hooksAPI(UIkit);
@@ -4193,7 +4192,7 @@
4193
4192
  },
4194
4193
 
4195
4194
  data: {
4196
- pos: ("bottom-" + (!isRtl ? 'left' : 'right')),
4195
+ pos: ("bottom-" + (isRtl ? 'right' : 'left')),
4197
4196
  flip: true,
4198
4197
  offset: false,
4199
4198
  clsPos: ''
@@ -4204,7 +4203,7 @@
4204
4203
  pos: function(ref) {
4205
4204
  var pos = ref.pos;
4206
4205
 
4207
- return (pos + (!includes(pos, '-') ? '-center' : '')).split('-');
4206
+ return pos.split('-').concat('center').slice(0, 2);
4208
4207
  },
4209
4208
 
4210
4209
  dir: function() {
@@ -6592,7 +6591,7 @@
6592
6591
 
6593
6592
  data: {
6594
6593
  dropdown: navItem,
6595
- align: !isRtl ? 'left' : 'right',
6594
+ align: isRtl ? 'right' : 'left',
6596
6595
  clsDrop: 'uk-navbar-dropdown',
6597
6596
  mode: undefined,
6598
6597
  offset: undefined,
@@ -7834,7 +7833,7 @@
7834
7833
  this.show();
7835
7834
  }
7836
7835
 
7837
- height$1 = !this.isActive ? this.$el.offsetHeight : height$1;
7836
+ height$1 = this.isActive ? height$1 : this.$el.offsetHeight;
7838
7837
 
7839
7838
  if (height$1 + this.offset > height(window)) {
7840
7839
  this.inactive = true;
@@ -8244,6 +8243,8 @@
8244
8243
 
8245
8244
  };
8246
8245
 
8246
+ var KEY_SPACE = 32;
8247
+
8247
8248
  var toggle = {
8248
8249
 
8249
8250
  mixins: [Media, Togglable],
@@ -8366,12 +8367,11 @@
8366
8367
  name: 'keydown',
8367
8368
 
8368
8369
  filter: function() {
8369
- return includes(this.mode, 'click');
8370
+ return includes(this.mode, 'click') && this.$el.tagName !== 'INPUT';
8370
8371
  },
8371
8372
 
8372
8373
  handler: function(e) {
8373
- // Space
8374
- if (e.keyCode === 32) {
8374
+ if (e.keyCode === KEY_SPACE) {
8375
8375
  e.preventDefault();
8376
8376
  this.$el.click();
8377
8377
  }
@@ -8970,12 +8970,12 @@
8970
8970
 
8971
8971
  return fade.apply(void 0, args.concat( [40] ));
8972
8972
  }
8973
- : !name
8974
- ? function () {
8973
+ : name
8974
+ ? slide
8975
+ : function () {
8975
8976
  action();
8976
8977
  return Promise$1.resolve();
8977
- }
8978
- : slide;
8978
+ };
8979
8979
 
8980
8980
  return animationFn(action, target, this.duration)
8981
8981
  .then(function () { return this$1$1.$update(target, 'resize'); }, noop);
@@ -9254,7 +9254,7 @@
9254
9254
  if ( unit === void 0 ) unit = '%';
9255
9255
 
9256
9256
  value += value ? unit : '';
9257
- return isIE ? ("translateX(" + value + ")") : ("translate3d(" + value + ", 0, 0)"); // currently not translate3d in IE, translate3d within translate3d does not work while transitioning
9257
+ return isIE ? ("translateX(" + value + ")") : ("translate3d(" + value + ", 0, 0)"); // currently, not translate3d in IE, translate3d within translate3d does not work while transitioning
9258
9258
  }
9259
9259
 
9260
9260
  function scale3d(value) {
@@ -10756,7 +10756,7 @@
10756
10756
  } else if (startsWith(prop, 'bg')) {
10757
10757
 
10758
10758
  var attr = prop === 'bgy' ? 'height' : 'width';
10759
- steps = steps.map(function (step) { return toPx(step, attr, this$1$1.$el); });
10759
+ steps = steps.map(function (step) { return toPx(step, attr, $el); });
10760
10760
 
10761
10761
  css($el, ("background-position-" + (prop[2])), '');
10762
10762
  bgPos = css($el, 'backgroundPosition').split(' ')[prop[2] === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
@@ -10790,7 +10790,7 @@
10790
10790
  return props;
10791
10791
  }
10792
10792
 
10793
- var length = getMaxPathLength(this$1$1.$el);
10793
+ var length = getMaxPathLength($el);
10794
10794
  css($el, 'strokeDasharray', length);
10795
10795
 
10796
10796
  if (unit === '%') {
@@ -10968,7 +10968,7 @@
10968
10968
  var p = ref$1[2];
10969
10969
 
10970
10970
  css[prop] = "rgba(" + (start.map(function (value, i) {
10971
- value = value + p * (end[i] - value);
10971
+ value += p * (end[i] - value);
10972
10972
  return i === 3 ? toFloat(value) : parseInt(value, 10);
10973
10973
  }).join(',')) + ")";
10974
10974
  break;
@@ -11685,13 +11685,7 @@
11685
11685
 
11686
11686
  percent /= 2;
11687
11687
 
11688
- return !isIn(type)
11689
- ? dir < 0
11690
- ? percent
11691
- : 1 - percent
11692
- : dir < 0
11693
- ? 1 - percent
11694
- : percent;
11688
+ return isIn(type) ^ dir < 0 ? percent : 1 - percent;
11695
11689
  }
11696
11690
 
11697
11691
  var Animations = assign({}, Animations$2, {
@@ -12385,7 +12379,8 @@
12385
12379
  }
12386
12380
 
12387
12381
  this.toggleElement(this.tooltip, false, false).then(function () {
12388
- this$1$1.tooltip = remove$1(this$1$1.tooltip);
12382
+ remove$1(this$1$1.tooltip);
12383
+ this$1$1.tooltip = null;
12389
12384
  this$1$1._unbind();
12390
12385
  });
12391
12386
  },