uikit 3.15.10 → 3.15.11-dev.536b75ef2

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 (74) hide show
  1. package/CHANGELOG.md +29 -12
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +2 -2
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +5 -2
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +52 -53
  37. package/dist/js/uikit-core.min.js +2 -2
  38. package/dist/js/uikit-icons.js +2 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +57 -55
  41. package/dist/js/uikit.min.js +2 -2
  42. package/package.json +1 -1
  43. package/src/images/icons/crosshairs.svg +7 -0
  44. package/src/js/api/state.js +13 -6
  45. package/src/js/components/lightbox.js +1 -1
  46. package/src/js/components/tooltip.js +4 -1
  47. package/src/js/core/drop.js +5 -1
  48. package/src/js/core/icon.js +1 -3
  49. package/src/js/core/scrollspy.js +3 -2
  50. package/src/js/core/svg.js +2 -10
  51. package/src/js/core/switcher.js +16 -23
  52. package/src/js/core/toggle.js +1 -4
  53. package/src/js/util/position.js +11 -6
  54. package/tests/breadcrumb.html +25 -19
  55. package/tests/comment.html +9 -9
  56. package/tests/drop.html +2 -2
  57. package/tests/dropbar.html +1 -1
  58. package/tests/dropdown.html +1 -1
  59. package/tests/filter.html +1 -1
  60. package/tests/form.html +40 -40
  61. package/tests/icon.html +4 -0
  62. package/tests/index.html +22 -19
  63. package/tests/js/index.js +3 -3
  64. package/tests/lightbox.html +1 -1
  65. package/tests/list.html +1 -1
  66. package/tests/nav.html +1 -1
  67. package/tests/navbar.html +3 -3
  68. package/tests/search.html +21 -21
  69. package/tests/slider.html +3 -3
  70. package/tests/slideshow.html +2 -2
  71. package/tests/sticky.html +1 -1
  72. package/tests/table.html +9 -9
  73. package/tests/tooltip.html +2 -2
  74. package/tests/utility.html +4 -4
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.15.10 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.15.11-dev.536b75ef2 | 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() :
@@ -1953,7 +1953,7 @@
1953
1953
 
1954
1954
  let offsetPosition = position;
1955
1955
  for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
1956
- const viewport = getViewport$1(target[i], viewportOffset, boundary, i);
1956
+ const viewport = getViewport$2(element, target[i], viewportOffset, boundary, i);
1957
1957
 
1958
1958
  if (isWithin(position, viewport, i)) {
1959
1959
  continue;
@@ -1973,7 +1973,7 @@
1973
1973
 
1974
1974
  offsetBy = flip(element, target, options, i)[start] - position[start];
1975
1975
 
1976
- const scrollArea = getScrollArea(target[i], viewportOffset, i);
1976
+ const scrollArea = getScrollArea(element, target[i], viewportOffset, i);
1977
1977
 
1978
1978
  if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {
1979
1979
  if (isWithin(position, scrollArea, i)) {
@@ -2053,8 +2053,8 @@
2053
2053
  return attach === 'center' ? dim / 2 : attach === end ? dim : 0;
2054
2054
  }
2055
2055
 
2056
- function getViewport$1(element, viewportOffset, boundary, i) {
2057
- let viewport = getIntersectionArea(...scrollParents(element).map(offsetViewport));
2056
+ function getViewport$2(element, target, viewportOffset, boundary, i) {
2057
+ let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));
2058
2058
 
2059
2059
  if (viewportOffset) {
2060
2060
  viewport[dirs[i][2]] += viewportOffset;
@@ -2071,15 +2071,19 @@
2071
2071
  return viewport;
2072
2072
  }
2073
2073
 
2074
- function getScrollArea(element, viewportOffset, i) {
2074
+ function getScrollArea(element, target, viewportOffset, i) {
2075
2075
  const [prop,, start, end] = dirs[i];
2076
- const [scrollElement] = scrollParents(element);
2076
+ const [scrollElement] = commonScrollParents(element, target);
2077
2077
  const viewport = offsetViewport(scrollElement);
2078
2078
  viewport[start] -= scrollElement["scroll" + ucfirst(start)] - viewportOffset;
2079
2079
  viewport[end] = viewport[start] + scrollElement["scroll" + ucfirst(prop)] - viewportOffset;
2080
2080
  return viewport;
2081
2081
  }
2082
2082
 
2083
+ function commonScrollParents(element, target) {
2084
+ return scrollParents(target).filter((parent) => within(element, parent));
2085
+ }
2086
+
2083
2087
  function getIntersectionArea() {
2084
2088
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2085
2089
  for (const rect of rects) {
@@ -2571,11 +2575,7 @@
2571
2575
  };
2572
2576
 
2573
2577
  UIkit.prototype._initObservers = function () {
2574
- this._observers = [initPropsObserver(this)];
2575
-
2576
- if (this.$options.computed) {
2577
- this.registerObserver(initChildListObserver(this));
2578
- }
2578
+ this._observers = [initPropsObserver(this), initChildListObserver(this)];
2579
2579
  };
2580
2580
 
2581
2581
  UIkit.prototype.registerObserver = function () {
@@ -2728,7 +2728,18 @@
2728
2728
  }
2729
2729
 
2730
2730
  function initChildListObserver(component) {
2731
- const { el } = component.$options;
2731
+ let { el, computed } = component.$options;
2732
+
2733
+ if (!computed) {
2734
+ return;
2735
+ }
2736
+
2737
+ for (const key in computed) {
2738
+ if (computed[key].document) {
2739
+ el = el.ownerDocument;
2740
+ break;
2741
+ }
2742
+ }
2732
2743
 
2733
2744
  const observer = new MutationObserver(() => component._callWatches());
2734
2745
  observer.observe(el, {
@@ -2937,7 +2948,7 @@
2937
2948
  UIkit.data = '__uikit__';
2938
2949
  UIkit.prefix = 'uk-';
2939
2950
  UIkit.options = {};
2940
- UIkit.version = '3.15.10';
2951
+ UIkit.version = '3.15.11-dev.536b75ef2';
2941
2952
 
2942
2953
  globalAPI(UIkit);
2943
2954
  hooksAPI(UIkit);
@@ -4507,7 +4518,7 @@
4507
4518
  // Ensure none positioned element does not generate scrollbars
4508
4519
  this.$el.hidden = true;
4509
4520
 
4510
- const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4521
+ const viewports = this.target.map((target) => getViewport$1(this.$el, target));
4511
4522
  const viewportOffset = this.getViewportOffset(this.$el);
4512
4523
 
4513
4524
  const dirs = [
@@ -4573,6 +4584,10 @@
4573
4584
  return result;
4574
4585
  }
4575
4586
 
4587
+ function getViewport$1(el, target) {
4588
+ return offsetViewport(scrollParents(target).find((parent) => within(el, parent)));
4589
+ }
4590
+
4576
4591
  var formCustom = {
4577
4592
  mixins: [Class],
4578
4593
 
@@ -5132,13 +5147,12 @@
5132
5147
  ratio: Number,
5133
5148
  class: String,
5134
5149
  strokeAnimation: Boolean,
5135
- focusable: Boolean, // IE 11
5136
5150
  attributes: 'list' },
5137
5151
 
5138
5152
 
5139
5153
  data: {
5140
5154
  ratio: 1,
5141
- include: ['style', 'class', 'focusable'],
5155
+ include: ['style', 'class'],
5142
5156
  class: '',
5143
5157
  strokeAnimation: false },
5144
5158
 
@@ -5317,14 +5331,7 @@
5317
5331
  }
5318
5332
 
5319
5333
  function equals(el, other) {
5320
- return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
5321
- }
5322
-
5323
- function innerHTML(el) {
5324
- return (
5325
- el.innerHTML ||
5326
- new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
5327
- replace(/\s/g, '');
5334
+ return isTag(el, 'svg') && isTag(other, 'svg') && el.innerHTML === other.innerHTML;
5328
5335
  }
5329
5336
 
5330
5337
  var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
@@ -5396,9 +5403,7 @@
5396
5403
 
5397
5404
  props: ['icon'],
5398
5405
 
5399
- data: {
5400
- include: ['focusable'] },
5401
-
5406
+ data: { include: [] },
5402
5407
 
5403
5408
  isIcon: true,
5404
5409
 
@@ -6767,7 +6772,8 @@
6767
6772
 
6768
6773
  watch(elements, prev) {
6769
6774
  if (this.hidden) {
6770
- css(filter$1(elements, ":not(." + this.inViewClass + ")"), 'visibility', 'hidden');
6775
+ // use `opacity:0` instead of `visibility:hidden` to make content focusable with keyboard
6776
+ css(filter$1(elements, ":not(." + this.inViewClass + ")"), 'opacity', 0);
6771
6777
  }
6772
6778
 
6773
6779
  if (!isEqual(elements, prev)) {
@@ -6853,7 +6859,7 @@
6853
6859
 
6854
6860
  state.off == null ? void 0 : state.off();
6855
6861
 
6856
- css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
6862
+ css(el, 'opacity', !inview && this.hidden ? 0 : '');
6857
6863
 
6858
6864
  toggleClass(el, this.inViewClass, inview);
6859
6865
  toggleClass(el, state.cls);
@@ -7385,27 +7391,27 @@
7385
7391
  return queryAll(connect, $el);
7386
7392
  },
7387
7393
 
7388
- watch(connects) {var _this$_observer;
7394
+ watch(connects) {
7389
7395
  if (this.swiping) {
7390
7396
  css(connects, 'touchAction', 'pan-y pinch-zoom');
7391
7397
  }
7398
+ },
7399
+
7400
+ document: true,
7401
+ immediate: true },
7392
7402
 
7393
- (_this$_observer = this._observer) == null ? void 0 : _this$_observer.disconnect();
7394
- this.registerObserver(
7395
- this._observer = observeMutation(
7396
- connects,
7397
- (records) => {
7398
- const index = this.index();
7399
- for (const { target: el } of records) {
7400
- children(el).forEach((child, i) =>
7401
- toggleClass(child, this.cls, i === index));
7402
-
7403
- this.lazyload(this.$el, children(el));
7404
- }
7405
- },
7406
- { childList: true }));
7407
7403
 
7404
+ connectChildren: {
7405
+ get() {
7406
+ return this.connects.map((el) => children(el)).flat();
7407
+ },
7408
7408
 
7409
+ watch() {
7410
+ const index = this.index();
7411
+ for (const el of this.connects) {
7412
+ children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));
7413
+ this.lazyload(this.$el, children(el));
7414
+ }
7409
7415
  },
7410
7416
 
7411
7417
  immediate: true },
@@ -7437,11 +7443,6 @@
7437
7443
  } },
7438
7444
 
7439
7445
 
7440
- connected() {
7441
- // check for connects
7442
- ready(() => this.$emit());
7443
- },
7444
-
7445
7446
  events: [
7446
7447
  {
7447
7448
  name: 'click',
@@ -7574,6 +7575,7 @@
7574
7575
  this.lazyload(this.$el, this.target);
7575
7576
  },
7576
7577
 
7578
+ document: true,
7577
7579
  immediate: true } },
7578
7580
 
7579
7581
 
@@ -7582,9 +7584,6 @@
7582
7584
  if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
7583
7585
  attr(this.$el, 'tabindex', '0');
7584
7586
  }
7585
-
7586
- // check for target
7587
- ready(() => this.$emit());
7588
7587
  },
7589
7588
 
7590
7589
  events: [
@@ -9513,7 +9512,7 @@
9513
9512
 
9514
9513
  this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
9515
9514
 
9516
- on(this.panel.$el, 'hidden', () => this.panel = false);
9515
+ on(this.panel.$el, 'hidden', () => this.panel = null);
9517
9516
 
9518
9517
  return this.panel.show(index);
9519
9518
  },
@@ -11246,7 +11245,10 @@
11246
11245
 
11247
11246
  disconnected() {
11248
11247
  this.hide();
11249
- attr(this.$el, 'title', this._hasTitle ? this.title : null);
11248
+
11249
+ if (!attr(this.$el, 'title')) {
11250
+ attr(this.$el, 'title', this._hasTitle ? this.title : null);
11251
+ }
11250
11252
  },
11251
11253
 
11252
11254
  methods: {