uikit 3.14.4-dev.6a00f7fe6 → 3.14.4-dev.834a27060

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 (90) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/css/uikit-core-rtl.css +140 -75
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +140 -75
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +137 -76
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +137 -76
  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 +7 -5
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +115 -24
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +115 -24
  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 +4 -5
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +4 -5
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +22 -7
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +4 -5
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +22 -7
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +3 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +26 -19
  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 +740 -644
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +1563 -1450
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/images/{backgrounds/nav-parent-open.svg → components/nav-parent-icon-large.svg} +0 -0
  44. package/src/images/components/nav-parent-icon.svg +3 -0
  45. package/src/images/components/navbar-parent-icon.svg +3 -0
  46. package/src/js/components/filter.js +5 -3
  47. package/src/js/components/sortable.js +2 -3
  48. package/src/js/core/drop.js +7 -0
  49. package/src/js/core/height-viewport.js +11 -5
  50. package/src/js/core/icon.js +16 -0
  51. package/src/js/core/index.js +2 -0
  52. package/src/js/core/leader.js +2 -2
  53. package/src/js/core/navbar.js +44 -15
  54. package/src/js/core/offcanvas.js +1 -47
  55. package/src/js/core/sticky.js +8 -9
  56. package/src/js/mixin/media.js +4 -5
  57. package/src/js/mixin/modal.js +90 -4
  58. package/src/js/mixin/position.js +27 -11
  59. package/src/js/mixin/slider-drag.js +20 -8
  60. package/src/js/mixin/togglable.js +8 -17
  61. package/src/js/util/dimensions.js +6 -6
  62. package/src/js/util/position.js +1 -0
  63. package/src/js/util/style.js +0 -5
  64. package/src/js/util/viewport.js +22 -36
  65. package/src/less/components/dropdown.less +14 -0
  66. package/src/less/components/leader.less +1 -1
  67. package/src/less/components/nav.less +29 -41
  68. package/src/less/components/navbar.less +109 -24
  69. package/src/less/components/utility.less +21 -4
  70. package/src/less/theme/nav.less +3 -15
  71. package/src/less/theme/navbar.less +7 -7
  72. package/src/scss/components/dropdown.scss +14 -0
  73. package/src/scss/components/leader.scss +1 -1
  74. package/src/scss/components/nav.scss +29 -30
  75. package/src/scss/components/navbar.scss +97 -24
  76. package/src/scss/components/utility.scss +19 -3
  77. package/src/scss/mixins-theme.scss +16 -19
  78. package/src/scss/mixins.scss +14 -14
  79. package/src/scss/theme/nav.scss +3 -15
  80. package/src/scss/theme/navbar.scss +6 -3
  81. package/src/scss/variables-theme.scss +27 -15
  82. package/src/scss/variables.scss +27 -13
  83. package/tests/drop.html +72 -16
  84. package/tests/dropdown.html +103 -16
  85. package/tests/index.html +3 -3
  86. package/tests/nav.html +20 -87
  87. package/tests/navbar.html +2132 -1131
  88. package/tests/offcanvas.html +8 -8
  89. package/tests/utility.html +19 -0
  90. package/src/images/backgrounds/nav-parent-close.svg +0 -3
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.6a00f7fe6 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.834a27060 | 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() :
@@ -785,11 +785,6 @@
785
785
  return elements[0];
786
786
  }
787
787
 
788
- const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
789
- function getCssVar(name, element) {if (element === void 0) {element = document.documentElement;}
790
- return css(element, "--uk-" + name).replace(propertyRe, '$2');
791
- }
792
-
793
788
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
794
789
  const propName = memoize((name) => vendorPropName(name));
795
790
 
@@ -1060,13 +1055,13 @@
1060
1055
  }
1061
1056
 
1062
1057
  function offsetPosition(element) {
1063
- const offset = [0, 0];
1064
-
1065
1058
  element = toNode(element);
1066
1059
 
1067
- do {
1068
- offset[0] += element.offsetTop;
1069
- offset[1] += element.offsetLeft;
1060
+ const offset = [element.offsetTop, element.offsetLeft];
1061
+
1062
+ while (element = element.offsetParent) {
1063
+ offset[0] += element.offsetTop + toFloat(css(element, "borderTopWidth"));
1064
+ offset[1] += element.offsetLeft + toFloat(css(element, "borderLeftWidth"));
1070
1065
 
1071
1066
  if (css(element, 'position') === 'fixed') {
1072
1067
  const win = toWindow(element);
@@ -1074,7 +1069,7 @@
1074
1069
  offset[1] += win.scrollX;
1075
1070
  return offset;
1076
1071
  }
1077
- } while (element = element.offsetParent);
1072
+ }
1078
1073
 
1079
1074
  return offset;
1080
1075
  }
@@ -1795,20 +1790,6 @@
1795
1790
 
1796
1791
  }
1797
1792
 
1798
- function scrollTop(element, top) {
1799
- if (isWindow(element) || isDocument(element)) {
1800
- element = scrollingElement(element);
1801
- } else {
1802
- element = toNode(element);
1803
- }
1804
-
1805
- if (isUndefined(top)) {
1806
- return element.scrollTop;
1807
- } else {
1808
- element.scrollTop = top;
1809
- }
1810
- }
1811
-
1812
1793
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1813
1794
  const parents = isVisible(element) ? scrollParents(element) : [];
1814
1795
  return parents.reduce(
@@ -1850,7 +1831,7 @@
1850
1831
  (function step() {
1851
1832
  const percent = ease(clamp((Date.now() - start) / duration));
1852
1833
 
1853
- scrollTop(element, scroll + top * percent);
1834
+ element.scrollTop = scroll + top * percent;
1854
1835
 
1855
1836
  // scroll more if we have not reached our destination
1856
1837
  if (percent === 1) {
@@ -1911,18 +1892,33 @@
1911
1892
  }
1912
1893
 
1913
1894
  function offsetViewport(scrollElement) {
1914
- let viewportElement = getViewport$1(scrollElement);
1895
+ const window = toWindow(scrollElement);
1896
+ const {
1897
+ document: { body, documentElement } } =
1898
+ window;
1899
+ let viewportElement =
1900
+ scrollElement === scrollingElement(scrollElement) || scrollElement === body ?
1901
+ window :
1902
+ scrollElement;
1903
+
1904
+ const { visualViewport } = window;
1905
+ if (isWindow(viewportElement) && visualViewport) {
1906
+ let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
1907
+ height = Math.round(height * scale);
1908
+ width = Math.round(width * scale);
1909
+ return { height, width, top, left, bottom: top + height, right: left + width };
1910
+ }
1915
1911
 
1916
1912
  let rect = offset(viewportElement);
1917
1913
  for (let [prop, dir, start, end] of [
1918
1914
  ['width', 'x', 'left', 'right'],
1919
1915
  ['height', 'y', 'top', 'bottom']])
1920
1916
  {
1921
- if (!isWindow(viewportElement)) {
1922
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1923
- } else {
1917
+ if (isWindow(viewportElement)) {
1924
1918
  // iOS 12 returns <body> as scrollingElement
1925
- viewportElement = viewportElement.document.documentElement;
1919
+ viewportElement = documentElement;
1920
+ } else {
1921
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1926
1922
  }
1927
1923
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1928
1924
  rect[end] = rect[prop] + rect[start];
@@ -1934,10 +1930,6 @@
1934
1930
  return toWindow(element).document.scrollingElement;
1935
1931
  }
1936
1932
 
1937
- function getViewport$1(scrollElement) {
1938
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1939
- }
1940
-
1941
1933
  const dirs = [
1942
1934
  ['width', 'x', 'left', 'right'],
1943
1935
  ['height', 'y', 'top', 'bottom']];
@@ -2095,6 +2087,7 @@
2095
2087
  return newPos;
2096
2088
  }
2097
2089
  }
2090
+ continue;
2098
2091
  }
2099
2092
 
2100
2093
  // Move
@@ -2284,10 +2277,8 @@
2284
2277
  findAll: findAll,
2285
2278
  escape: escape,
2286
2279
  css: css,
2287
- getCssVar: getCssVar,
2288
2280
  propName: propName,
2289
2281
  isInView: isInView,
2290
- scrollTop: scrollTop,
2291
2282
  scrollIntoView: scrollIntoView,
2292
2283
  scrolledOver: scrolledOver,
2293
2284
  scrollParents: scrollParents,
@@ -2950,7 +2941,7 @@
2950
2941
  UIkit.data = '__uikit__';
2951
2942
  UIkit.prefix = 'uk-';
2952
2943
  UIkit.options = {};
2953
- UIkit.version = '3.14.4-dev.6a00f7fe6';
2944
+ UIkit.version = '3.14.4-dev.834a27060';
2954
2945
 
2955
2946
  globalAPI(UIkit);
2956
2947
  hooksAPI(UIkit);
@@ -3248,7 +3239,7 @@
3248
3239
 
3249
3240
  Transition.cancel(el);
3250
3241
 
3251
- const [scrollElement] = scrollParents(el);
3242
+ const [scrollElement] = scrollParents(el.offsetParent);
3252
3243
  css(scrollElement, 'overflowX', 'hidden');
3253
3244
 
3254
3245
  if (!isToggled(el)) {
@@ -3259,17 +3250,11 @@
3259
3250
  duration = velocity * width + duration;
3260
3251
 
3261
3252
  const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3262
- const offsetEl = offset(el);
3263
- const useClipPath = right ?
3264
- offsetEl.right < scrollElement.clientWidth :
3265
- Math.round(offsetEl.left) > 0;
3266
3253
 
3267
3254
  css(el, {
3268
- clipPath: useClipPath ?
3269
- right ? "polygon(0 0," +
3255
+ clipPath: right ? "polygon(0 0," +
3270
3256
  percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3271
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3272
- '',
3257
+ 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3273
3258
  marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3274
3259
 
3275
3260
 
@@ -3278,7 +3263,7 @@
3278
3263
  Transition.start(
3279
3264
  el,
3280
3265
  {
3281
- clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3266
+ clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3282
3267
  marginLeft: 0 },
3283
3268
 
3284
3269
  duration * (1 - percent / 100),
@@ -3287,11 +3272,9 @@
3287
3272
  Transition.start(
3288
3273
  el,
3289
3274
  {
3290
- clipPath: useClipPath ?
3291
- right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3275
+ clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3292
3276
 
3293
3277
 
3294
- '',
3295
3278
  marginLeft: (right ? 1 : -1) * width },
3296
3279
 
3297
3280
  duration * (percent / 100),
@@ -3687,23 +3670,38 @@
3687
3670
  offset = offset.reverse();
3688
3671
  }
3689
3672
 
3673
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3674
+ const { scrollTop, scrollLeft } = scrollElement;
3675
+
3690
3676
  // Ensure none positioned element does not generate scrollbars
3691
3677
  const elDim = dimensions(element);
3692
3678
  css(element, { top: -elDim.height, left: -elDim.width });
3693
3679
 
3694
- positionAt(element, target, {
3680
+ const args = [
3681
+ element,
3682
+ target,
3683
+ {
3695
3684
  attach,
3696
3685
  offset,
3697
3686
  boundary,
3698
3687
  flip: this.flip,
3699
- viewportOffset: this.getViewportOffset(element) });
3688
+ viewportOffset: this.getViewportOffset(element) }];
3689
+
3690
+
3691
+
3692
+ trigger(element, 'beforeposition', args);
3700
3693
 
3694
+ positionAt(...args);
3695
+
3696
+ // Restore scroll position
3697
+ scrollElement.scrollTop = scrollTop;
3698
+ scrollElement.scrollLeft = scrollLeft;
3701
3699
  },
3702
3700
 
3703
3701
  getPositionOffset(element) {
3704
3702
  return (
3705
3703
  toPx(
3706
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3704
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3707
3705
  this.axis === 'x' ? 'width' : 'height',
3708
3706
  element) * (
3709
3707
  includes(['left', 'top'], this.dir) ? -1 : 1));
@@ -3714,74 +3712,54 @@
3714
3712
  return includes(['center', 'justify', 'stretch'], this.align) ?
3715
3713
  0 :
3716
3714
  toPx(
3717
- getCssVar('position-shift-offset', element),
3715
+ css(element, '--uk-position-shift-offset'),
3718
3716
  this.axis === 'y' ? 'width' : 'height',
3719
3717
  element) * (
3720
3718
  includes(['left', 'top'], this.align) ? 1 : -1);
3721
3719
  },
3722
3720
 
3723
3721
  getViewportOffset(element) {
3724
- return toPx(getCssVar('position-viewport-offset', element));
3722
+ return toPx(css(element, '--uk-position-viewport-offset'));
3725
3723
  } } };
3726
3724
 
3727
- let active$1;
3728
-
3729
- var drop = {
3730
- mixins: [Container, Lazyload, Position, Togglable],
3725
+ const active$1 = [];
3731
3726
 
3732
- args: 'pos',
3727
+ var Modal = {
3728
+ mixins: [Class, Container, Togglable],
3733
3729
 
3734
3730
  props: {
3735
- mode: 'list',
3736
- toggle: Boolean,
3737
- boundary: Boolean,
3738
- boundaryAlign: Boolean,
3739
- delayShow: Number,
3740
- delayHide: Number,
3741
- display: String,
3742
- clsDrop: String,
3743
- animateOut: Boolean },
3731
+ selPanel: String,
3732
+ selClose: String,
3733
+ escClose: Boolean,
3734
+ bgClose: Boolean,
3735
+ stack: Boolean },
3744
3736
 
3745
3737
 
3746
3738
  data: {
3747
- mode: ['click', 'hover'],
3748
- toggle: '- *',
3749
- boundary: true,
3750
- boundaryAlign: false,
3751
- delayShow: 0,
3752
- delayHide: 800,
3753
- display: null,
3754
- clsDrop: false,
3755
- animation: ['uk-animation-fade'],
3756
3739
  cls: 'uk-open',
3757
- container: false,
3758
- animateOut: false },
3740
+ escClose: true,
3741
+ bgClose: true,
3742
+ overlay: true,
3743
+ stack: false },
3759
3744
 
3760
3745
 
3761
- created() {
3762
- this.tracker = new MouseTracker();
3763
- },
3746
+ computed: {
3747
+ panel(_ref, $el) {let { selPanel } = _ref;
3748
+ return $(selPanel, $el);
3749
+ },
3764
3750
 
3765
- beforeConnect() {
3766
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3767
- },
3751
+ transitionElement() {
3752
+ return this.panel;
3753
+ },
3768
3754
 
3769
- connected() {
3770
- addClass(this.$el, this.clsDrop);
3755
+ bgClose(_ref2) {let { bgClose } = _ref2;
3756
+ return bgClose && this.panel;
3757
+ } },
3771
3758
 
3772
- if (this.toggle && !this.target) {
3773
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3774
- target: this.$el,
3775
- mode: this.mode }).
3776
- $el;
3777
- attr(this.target, 'aria-haspopup', true);
3778
- this.lazyload(this.target);
3779
- }
3780
- },
3781
3759
 
3782
- disconnected() {
3783
- if (this.isActive()) {
3784
- active$1 = null;
3760
+ beforeDisconnect() {
3761
+ if (includes(active$1, this)) {
3762
+ this.toggleElement(this.$el, false, false);
3785
3763
  }
3786
3764
  },
3787
3765
 
@@ -3790,161 +3768,522 @@
3790
3768
  name: 'click',
3791
3769
 
3792
3770
  delegate() {
3793
- return "." + this.clsDrop + "-close";
3771
+ return this.selClose;
3794
3772
  },
3795
3773
 
3796
3774
  handler(e) {
3797
3775
  e.preventDefault();
3798
- this.hide(false);
3776
+ this.hide();
3799
3777
  } },
3800
3778
 
3801
3779
 
3802
3780
  {
3803
- name: 'click',
3781
+ name: 'toggle',
3804
3782
 
3805
- delegate() {
3806
- return 'a[href^="#"]';
3807
- },
3783
+ self: true,
3808
3784
 
3809
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3810
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3811
- this.hide(false);
3785
+ handler(e) {
3786
+ if (e.defaultPrevented) {
3787
+ return;
3812
3788
  }
3813
- } },
3814
3789
 
3790
+ e.preventDefault();
3815
3791
 
3816
- {
3817
- name: 'beforescroll',
3818
-
3819
- handler() {
3820
- this.hide(false);
3792
+ if (this.isToggled() === includes(active$1, this)) {
3793
+ this.toggle();
3794
+ }
3821
3795
  } },
3822
3796
 
3823
3797
 
3824
3798
  {
3825
- name: 'toggle',
3799
+ name: 'beforeshow',
3826
3800
 
3827
3801
  self: true,
3828
3802
 
3829
- handler(e, toggle) {
3830
- e.preventDefault();
3803
+ handler(e) {
3804
+ if (includes(active$1, this)) {
3805
+ return false;
3806
+ }
3831
3807
 
3832
- if (this.isToggled()) {
3833
- this.hide(false);
3808
+ if (!this.stack && active$1.length) {
3809
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3810
+ e.preventDefault();
3834
3811
  } else {
3835
- this.show(toggle == null ? void 0 : toggle.$el, false);
3812
+ active$1.push(this);
3836
3813
  }
3837
3814
  } },
3838
3815
 
3839
3816
 
3840
3817
  {
3841
- name: 'toggleshow',
3818
+ name: 'show',
3842
3819
 
3843
3820
  self: true,
3844
3821
 
3845
- handler(e, toggle) {
3846
- e.preventDefault();
3847
- this.show(toggle == null ? void 0 : toggle.$el);
3848
- } },
3849
-
3850
-
3851
- {
3852
- name: 'togglehide',
3822
+ handler() {
3823
+ once(
3824
+ this.$el,
3825
+ 'hide',
3826
+ on(document, 'focusin', (e) => {
3827
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3828
+ this.$el.focus();
3829
+ }
3830
+ }));
3853
3831
 
3854
- self: true,
3855
3832
 
3856
- handler(e) {
3857
- e.preventDefault();
3858
- if (!matches(this.$el, ':focus,:hover')) {
3859
- this.hide();
3833
+ if (this.overlay) {
3834
+ once(this.$el, 'hide', preventOverscroll(this.$el));
3835
+ once(this.$el, 'hide', preventBackgroundScroll());
3860
3836
  }
3861
- } },
3862
3837
 
3838
+ if (this.stack) {
3839
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3840
+ }
3863
3841
 
3864
- {
3865
- name: pointerEnter + " focusin",
3842
+ addClass(document.documentElement, this.clsPage);
3866
3843
 
3867
- filter() {
3868
- return includes(this.mode, 'hover');
3869
- },
3844
+ if (this.bgClose) {
3845
+ once(
3846
+ this.$el,
3847
+ 'hide',
3848
+ on(document, pointerDown, (_ref3) => {let { target } = _ref3;
3849
+ if (
3850
+ last(active$1) !== this ||
3851
+ this.overlay && !within(target, this.$el) ||
3852
+ within(target, this.panel))
3853
+ {
3854
+ return;
3855
+ }
3870
3856
 
3871
- handler(e) {
3872
- if (!isTouch(e)) {
3873
- this.clearTimers();
3874
- }
3875
- } },
3857
+ once(
3858
+ document,
3859
+ pointerUp + " " + pointerCancel + " scroll",
3860
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3861
+ if (
3862
+ !defaultPrevented &&
3863
+ type === pointerUp &&
3864
+ target === newTarget)
3865
+ {
3866
+ this.hide();
3867
+ }
3868
+ },
3869
+ true);
3876
3870
 
3871
+ }),
3872
+ { self: true });
3877
3873
 
3878
- {
3879
- name: pointerLeave + " focusout",
3874
+ }
3880
3875
 
3881
- filter() {
3882
- return includes(this.mode, 'hover');
3883
- },
3876
+ if (this.escClose) {
3877
+ once(
3878
+ this.$el,
3879
+ 'hide',
3880
+ on(document, 'keydown', (e) => {
3881
+ if (e.keyCode === 27 && last(active$1) === this) {
3882
+ this.hide();
3883
+ }
3884
+ }),
3885
+ { self: true });
3884
3886
 
3885
- handler(e) {
3886
- if (!isTouch(e) && e.relatedTarget) {
3887
- this.hide();
3888
3887
  }
3889
3888
  } },
3890
3889
 
3891
3890
 
3892
3891
  {
3893
- name: 'toggled',
3892
+ name: 'shown',
3894
3893
 
3895
3894
  self: true,
3896
3895
 
3897
- handler(e, toggled) {
3898
- if (!toggled) {
3899
- return;
3896
+ handler() {
3897
+ if (!isFocusable(this.$el)) {
3898
+ attr(this.$el, 'tabindex', '-1');
3900
3899
  }
3901
3900
 
3902
- this.clearTimers();
3903
- this.position();
3901
+ if (!$(':focus', this.$el)) {
3902
+ this.$el.focus();
3903
+ }
3904
3904
  } },
3905
3905
 
3906
3906
 
3907
3907
  {
3908
- name: 'show',
3908
+ name: 'hidden',
3909
3909
 
3910
3910
  self: true,
3911
3911
 
3912
3912
  handler() {
3913
- active$1 = this;
3913
+ if (includes(active$1, this)) {
3914
+ active$1.splice(active$1.indexOf(this), 1);
3915
+ }
3914
3916
 
3915
- this.tracker.init();
3917
+ if (!active$1.length) {
3918
+ css(document.body, 'overflowY', '');
3919
+ }
3916
3920
 
3917
- for (const handler of [
3918
- on(
3919
- document,
3920
- pointerDown,
3921
- (_ref2) => {let { target } = _ref2;return (
3922
- !within(target, this.$el) &&
3923
- once(
3924
- document,
3925
- pointerUp + " " + pointerCancel + " scroll",
3926
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3927
- if (
3928
- !defaultPrevented &&
3929
- type === pointerUp &&
3930
- target === newTarget &&
3931
- !(this.target && within(target, this.target)))
3932
- {
3933
- this.hide(false);
3934
- }
3935
- },
3936
- true));}),
3921
+ css(this.$el, 'zIndex', '');
3937
3922
 
3923
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3924
+ removeClass(document.documentElement, this.clsPage);
3925
+ }
3926
+ } }],
3938
3927
 
3939
3928
 
3940
- on(document, 'keydown', (e) => {
3941
- if (e.keyCode === 27) {
3942
- this.hide(false);
3943
- }
3944
- }),
3945
3929
 
3946
- ...(this.display === 'static' && this.align !== 'stretch' ?
3947
- [] :
3930
+ methods: {
3931
+ toggle() {
3932
+ return this.isToggled() ? this.hide() : this.show();
3933
+ },
3934
+
3935
+ show() {
3936
+ if (this.container && parent(this.$el) !== this.container) {
3937
+ append(this.container, this.$el);
3938
+ return new Promise((resolve) =>
3939
+ requestAnimationFrame(() => this.show().then(resolve)));
3940
+
3941
+ }
3942
+
3943
+ return this.toggleElement(this.$el, true, animate(this));
3944
+ },
3945
+
3946
+ hide() {
3947
+ return this.toggleElement(this.$el, false, animate(this));
3948
+ } } };
3949
+
3950
+
3951
+
3952
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3953
+ return (el, show) =>
3954
+ new Promise((resolve, reject) =>
3955
+ once(el, 'show hide', () => {
3956
+ el._reject == null ? void 0 : el._reject();
3957
+ el._reject = reject;
3958
+
3959
+ _toggle(el, show);
3960
+
3961
+ const off = once(
3962
+ transitionElement,
3963
+ 'transitionstart',
3964
+ () => {
3965
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3966
+ self: true });
3967
+
3968
+ clearTimeout(timer);
3969
+ },
3970
+ { self: true });
3971
+
3972
+
3973
+ const timer = setTimeout(() => {
3974
+ off();
3975
+ resolve();
3976
+ }, toMs(css(transitionElement, 'transitionDuration')));
3977
+ })).
3978
+ then(() => delete el._reject);
3979
+ }
3980
+
3981
+ function toMs(time) {
3982
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3983
+ }
3984
+
3985
+ function preventOverscroll(el) {
3986
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3987
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3988
+ css(elements, 'overscrollBehavior', 'contain');
3989
+ return () => css(elements, 'overscrollBehavior', '');
3990
+ }
3991
+
3992
+ let startClientY;
3993
+
3994
+ const events = [
3995
+ on(
3996
+ el,
3997
+ 'touchstart',
3998
+ (_ref6) => {let { targetTouches } = _ref6;
3999
+ if (targetTouches.length === 1) {
4000
+ startClientY = targetTouches[0].clientY;
4001
+ }
4002
+ },
4003
+ { passive: true }),
4004
+
4005
+
4006
+ on(
4007
+ el,
4008
+ 'touchmove',
4009
+ (e) => {
4010
+ if (e.targetTouches.length !== 1) {
4011
+ return;
4012
+ }
4013
+
4014
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4015
+ if (!within(scrollParent, el)) {
4016
+ scrollParent = el;
4017
+ }
4018
+
4019
+ const clientY = e.targetTouches[0].clientY - startClientY;
4020
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4021
+
4022
+ if (
4023
+ clientHeight >= scrollHeight ||
4024
+ scrollTop === 0 && clientY > 0 ||
4025
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
4026
+ {
4027
+ e.cancelable && e.preventDefault();
4028
+ }
4029
+ },
4030
+ { passive: false })];
4031
+
4032
+
4033
+
4034
+ return () => events.forEach((fn) => fn());
4035
+ }
4036
+
4037
+ function preventBackgroundScroll() {
4038
+ const { body, documentElement } = document;
4039
+ css(body, {
4040
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4041
+ touchAction: 'none' });
4042
+
4043
+ css(documentElement, 'overflowY', 'hidden');
4044
+ return () => {
4045
+ css(documentElement, 'overflowY', '');
4046
+ css(body, { overflowY: '', touchAction: '' });
4047
+ };
4048
+ }
4049
+
4050
+ function filterChildren(el, fn) {
4051
+ const children = [];
4052
+ apply(el, (node) => {
4053
+ if (fn(node)) {
4054
+ children.push(node);
4055
+ }
4056
+ });
4057
+ return children;
4058
+ }
4059
+
4060
+ let active;
4061
+
4062
+ var drop = {
4063
+ mixins: [Container, Lazyload, Position, Togglable],
4064
+
4065
+ args: 'pos',
4066
+
4067
+ props: {
4068
+ mode: 'list',
4069
+ toggle: Boolean,
4070
+ boundary: Boolean,
4071
+ boundaryAlign: Boolean,
4072
+ delayShow: Number,
4073
+ delayHide: Number,
4074
+ display: String,
4075
+ clsDrop: String,
4076
+ animateOut: Boolean,
4077
+ bgScroll: Boolean },
4078
+
4079
+
4080
+ data: {
4081
+ mode: ['click', 'hover'],
4082
+ toggle: '- *',
4083
+ boundary: true,
4084
+ boundaryAlign: false,
4085
+ delayShow: 0,
4086
+ delayHide: 800,
4087
+ display: null,
4088
+ clsDrop: false,
4089
+ animation: ['uk-animation-fade'],
4090
+ cls: 'uk-open',
4091
+ container: false,
4092
+ animateOut: false,
4093
+ bgScroll: true },
4094
+
4095
+
4096
+ created() {
4097
+ this.tracker = new MouseTracker();
4098
+ },
4099
+
4100
+ beforeConnect() {
4101
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4102
+ },
4103
+
4104
+ connected() {
4105
+ addClass(this.$el, this.clsDrop);
4106
+
4107
+ if (this.toggle && !this.target) {
4108
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4109
+ target: this.$el,
4110
+ mode: this.mode }).
4111
+ $el;
4112
+ attr(this.target, 'aria-haspopup', true);
4113
+ this.lazyload(this.target);
4114
+ }
4115
+ },
4116
+
4117
+ disconnected() {
4118
+ if (this.isActive()) {
4119
+ active = null;
4120
+ }
4121
+ },
4122
+
4123
+ events: [
4124
+ {
4125
+ name: 'click',
4126
+
4127
+ delegate() {
4128
+ return "." + this.clsDrop + "-close";
4129
+ },
4130
+
4131
+ handler(e) {
4132
+ e.preventDefault();
4133
+ this.hide(false);
4134
+ } },
4135
+
4136
+
4137
+ {
4138
+ name: 'click',
4139
+
4140
+ delegate() {
4141
+ return 'a[href^="#"]';
4142
+ },
4143
+
4144
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4145
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4146
+ this.hide(false);
4147
+ }
4148
+ } },
4149
+
4150
+
4151
+ {
4152
+ name: 'beforescroll',
4153
+
4154
+ handler() {
4155
+ this.hide(false);
4156
+ } },
4157
+
4158
+
4159
+ {
4160
+ name: 'toggle',
4161
+
4162
+ self: true,
4163
+
4164
+ handler(e, toggle) {
4165
+ e.preventDefault();
4166
+
4167
+ if (this.isToggled()) {
4168
+ this.hide(false);
4169
+ } else {
4170
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4171
+ }
4172
+ } },
4173
+
4174
+
4175
+ {
4176
+ name: 'toggleshow',
4177
+
4178
+ self: true,
4179
+
4180
+ handler(e, toggle) {
4181
+ e.preventDefault();
4182
+ this.show(toggle == null ? void 0 : toggle.$el);
4183
+ } },
4184
+
4185
+
4186
+ {
4187
+ name: 'togglehide',
4188
+
4189
+ self: true,
4190
+
4191
+ handler(e) {
4192
+ e.preventDefault();
4193
+ if (!matches(this.$el, ':focus,:hover')) {
4194
+ this.hide();
4195
+ }
4196
+ } },
4197
+
4198
+
4199
+ {
4200
+ name: pointerEnter + " focusin",
4201
+
4202
+ filter() {
4203
+ return includes(this.mode, 'hover');
4204
+ },
4205
+
4206
+ handler(e) {
4207
+ if (!isTouch(e)) {
4208
+ this.clearTimers();
4209
+ }
4210
+ } },
4211
+
4212
+
4213
+ {
4214
+ name: pointerLeave + " focusout",
4215
+
4216
+ filter() {
4217
+ return includes(this.mode, 'hover');
4218
+ },
4219
+
4220
+ handler(e) {
4221
+ if (!isTouch(e) && e.relatedTarget) {
4222
+ this.hide();
4223
+ }
4224
+ } },
4225
+
4226
+
4227
+ {
4228
+ name: 'toggled',
4229
+
4230
+ self: true,
4231
+
4232
+ handler(e, toggled) {
4233
+ if (!toggled) {
4234
+ return;
4235
+ }
4236
+
4237
+ this.clearTimers();
4238
+ this.position();
4239
+ } },
4240
+
4241
+
4242
+ {
4243
+ name: 'show',
4244
+
4245
+ self: true,
4246
+
4247
+ handler() {
4248
+ active = this;
4249
+
4250
+ this.tracker.init();
4251
+
4252
+ for (const handler of [
4253
+ on(
4254
+ document,
4255
+ pointerDown,
4256
+ (_ref2) => {let { target } = _ref2;return (
4257
+ !within(target, this.$el) &&
4258
+ once(
4259
+ document,
4260
+ pointerUp + " " + pointerCancel + " scroll",
4261
+ (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4262
+ if (
4263
+ !defaultPrevented &&
4264
+ type === pointerUp &&
4265
+ target === newTarget &&
4266
+ !(this.target && within(target, this.target)))
4267
+ {
4268
+ this.hide(false);
4269
+ }
4270
+ },
4271
+ true));}),
4272
+
4273
+
4274
+
4275
+ on(document, 'keydown', (e) => {
4276
+ if (e.keyCode === 27) {
4277
+ this.hide(false);
4278
+ }
4279
+ }),
4280
+
4281
+ ...(this.bgScroll ?
4282
+ [] :
4283
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4284
+
4285
+ ...(this.display === 'static' && this.align !== 'stretch' ?
4286
+ [] :
3948
4287
  (() => {
3949
4288
  const handler = () => this.$emit();
3950
4289
  return [
@@ -3980,14 +4319,14 @@
3980
4319
 
3981
4320
  handler(_ref4) {let { target } = _ref4;
3982
4321
  if (this.$el !== target) {
3983
- active$1 =
3984
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4322
+ active =
4323
+ active === null && within(target, this.$el) && this.isToggled() ?
3985
4324
  this :
3986
- active$1;
4325
+ active;
3987
4326
  return;
3988
4327
  }
3989
4328
 
3990
- active$1 = this.isActive() ? null : active$1;
4329
+ active = this.isActive() ? null : active;
3991
4330
  this.tracker.cancel();
3992
4331
  } }],
3993
4332
 
@@ -4015,16 +4354,16 @@
4015
4354
  return;
4016
4355
  }
4017
4356
 
4018
- if (active$1) {
4019
- if (delay && active$1.isDelaying) {
4357
+ if (active) {
4358
+ if (delay && active.isDelaying) {
4020
4359
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4021
4360
  return;
4022
4361
  }
4023
4362
 
4024
4363
  let prev;
4025
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
4026
- prev = active$1;
4027
- active$1.hide(false, false);
4364
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4365
+ prev = active;
4366
+ active.hide(false, false);
4028
4367
  }
4029
4368
  }
4030
4369
 
@@ -4065,7 +4404,7 @@
4065
4404
  },
4066
4405
 
4067
4406
  isActive() {
4068
- return active$1 === this;
4407
+ return active === this;
4069
4408
  },
4070
4409
 
4071
4410
  position() {
@@ -4631,14 +4970,20 @@
4631
4970
  0);
4632
4971
 
4633
4972
  } else {
4634
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4635
- minHeight = "calc(" + (
4636
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4973
+ const { body, scrollingElement } = document;
4974
+ const isScrollingElement =
4975
+ scrollingElement === scrollElement || body === scrollElement;
4637
4976
 
4977
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4978
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4638
4979
 
4639
4980
  if (this.offsetTop) {
4640
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4641
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4981
+ if (isScrollingElement) {
4982
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4983
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4984
+ } else {
4985
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4986
+ }
4642
4987
  }
4643
4988
 
4644
4989
  if (this.offsetBottom === true) {
@@ -4881,6 +5226,12 @@
4881
5226
 
4882
5227
  var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
4883
5228
 
5229
+ var navParentIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 3.5 6 8.5 11 3.5\"/></svg>";
5230
+
5231
+ var navParentIconLarge = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 4 7 10 13 4\"/></svg>";
5232
+
5233
+ var navbarParentIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 3.5 6 8.5 11 3.5\"/></svg>";
5234
+
4884
5235
  var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
4885
5236
 
4886
5237
  var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
@@ -4913,6 +5264,9 @@
4913
5264
  marker,
4914
5265
  'close-icon': closeIcon,
4915
5266
  'close-large': closeLarge,
5267
+ 'nav-parent-icon': navParentIcon,
5268
+ 'nav-parent-icon-large': navParentIconLarge,
5269
+ 'navbar-parent-icon': navbarParentIcon,
4916
5270
  'navbar-toggle-icon': navbarToggleIcon,
4917
5271
  'overlay-icon': overlayIcon,
4918
5272
  'pagination-next': paginationNext,
@@ -4966,7 +5320,16 @@
4966
5320
 
4967
5321
 
4968
5322
  beforeConnect() {
4969
- addClass(this.$el, this.$name);
5323
+ addClass(this.$el, this.$name);
5324
+ } };
5325
+
5326
+
5327
+ const NavParentIcon = {
5328
+ extends: IconComponent,
5329
+
5330
+ beforeConnect() {
5331
+ const icon = this.$props.icon;
5332
+ this.icon = closest(this.$el, '.uk-nav-primary') ? icon + "-large" : icon;
4970
5333
  } };
4971
5334
 
4972
5335
 
@@ -5161,405 +5524,153 @@
5161
5524
  function getImageFromElement(el, src, sources) {
5162
5525
  const img = new Image();
5163
5526
 
5164
- wrapInPicture(img, sources);
5165
- setSourceProps(el, img);
5166
- img.onload = () => {
5167
- setSrcAttrs(el, img.currentSrc);
5168
- };
5169
- attr(img, 'src', src);
5170
- return img;
5171
- }
5172
-
5173
- function wrapInPicture(img, sources) {
5174
- sources = parseSources(sources);
5175
-
5176
- if (sources.length) {
5177
- const picture = fragment('<picture>');
5178
- for (const attrs of sources) {
5179
- const source = fragment('<source>');
5180
- attr(source, attrs);
5181
- append(picture, source);
5182
- }
5183
- append(picture, img);
5184
- }
5185
- }
5186
-
5187
- function parseSources(sources) {
5188
- if (!sources) {
5189
- return [];
5190
- }
5191
-
5192
- if (startsWith(sources, '[')) {
5193
- try {
5194
- sources = JSON.parse(sources);
5195
- } catch (e) {
5196
- sources = [];
5197
- }
5198
- } else {
5199
- sources = parseOptions(sources);
5200
- }
5201
-
5202
- if (!isArray(sources)) {
5203
- sources = [sources];
5204
- }
5205
-
5206
- return sources.filter((source) => !isEmpty(source));
5207
- }
5208
-
5209
- function ensureSrcAttribute(el) {
5210
- if (isImg(el) && !hasAttr(el, 'src')) {
5211
- attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5212
- }
5213
- }
5214
-
5215
- function isPicture(el) {
5216
- return isTag(el, 'picture');
5217
- }
5218
-
5219
- function isImg(el) {
5220
- return isTag(el, 'img');
5221
- }
5222
-
5223
- var Media = {
5224
- props: {
5225
- media: Boolean },
5226
-
5227
-
5228
- data: {
5229
- media: false },
5230
-
5231
-
5232
- connected() {
5233
- const media = toMedia(this.media);
5234
- this.matchMedia = true;
5235
- if (media) {
5236
- this.mediaObj = window.matchMedia(media);
5237
- const handler = () => {
5238
- this.matchMedia = this.mediaObj.matches;
5239
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5240
- };
5241
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5242
- handler();
5243
- this.$emit('resize');
5244
- });
5245
- handler();
5246
- }
5247
- },
5248
-
5249
- disconnected() {var _this$offMediaObj;
5250
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5251
- } };
5252
-
5253
-
5254
- function toMedia(value) {
5255
- if (isString(value)) {
5256
- if (startsWith(value, '@')) {
5257
- const name = "breakpoint-" + value.substr(1);
5258
- value = toFloat(getCssVar(name));
5259
- } else if (isNaN(value)) {
5260
- return value;
5261
- }
5262
- }
5263
-
5264
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5265
- }
5266
-
5267
- var leader = {
5268
- mixins: [Class, Media, Resize],
5269
-
5270
- props: {
5271
- fill: String },
5272
-
5273
-
5274
- data: {
5275
- fill: '',
5276
- clsWrapper: 'uk-leader-fill',
5277
- clsHide: 'uk-leader-hide',
5278
- attrFill: 'data-fill' },
5279
-
5280
-
5281
- computed: {
5282
- fill(_ref) {let { fill } = _ref;
5283
- return fill || getCssVar('leader-fill-content');
5284
- } },
5285
-
5286
-
5287
- connected() {
5288
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5289
- },
5290
-
5291
- disconnected() {
5292
- unwrap(this.wrapper.childNodes);
5293
- },
5294
-
5295
- update: {
5296
- read() {
5297
- const width = Math.trunc(this.$el.offsetWidth / 2);
5298
-
5299
- return {
5300
- width,
5301
- fill: this.fill,
5302
- hide: !this.matchMedia };
5303
-
5304
- },
5305
-
5306
- write(_ref2) {let { width, fill, hide } = _ref2;
5307
- toggleClass(this.wrapper, this.clsHide, hide);
5308
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5309
- },
5310
-
5311
- events: ['resize'] } };
5312
-
5313
- const active = [];
5314
-
5315
- var Modal = {
5316
- mixins: [Class, Container, Togglable],
5317
-
5318
- props: {
5319
- selPanel: String,
5320
- selClose: String,
5321
- escClose: Boolean,
5322
- bgClose: Boolean,
5323
- stack: Boolean },
5324
-
5325
-
5326
- data: {
5327
- cls: 'uk-open',
5328
- escClose: true,
5329
- bgClose: true,
5330
- overlay: true,
5331
- stack: false },
5332
-
5333
-
5334
- computed: {
5335
- panel(_ref, $el) {let { selPanel } = _ref;
5336
- return $(selPanel, $el);
5337
- },
5338
-
5339
- transitionElement() {
5340
- return this.panel;
5341
- },
5342
-
5343
- bgClose(_ref2) {let { bgClose } = _ref2;
5344
- return bgClose && this.panel;
5345
- } },
5346
-
5347
-
5348
- beforeDisconnect() {
5349
- if (includes(active, this)) {
5350
- this.toggleElement(this.$el, false, false);
5351
- }
5352
- },
5353
-
5354
- events: [
5355
- {
5356
- name: 'click',
5357
-
5358
- delegate() {
5359
- return this.selClose;
5360
- },
5361
-
5362
- handler(e) {
5363
- e.preventDefault();
5364
- this.hide();
5365
- } },
5366
-
5367
-
5368
- {
5369
- name: 'toggle',
5370
-
5371
- self: true,
5372
-
5373
- handler(e) {
5374
- if (e.defaultPrevented) {
5375
- return;
5376
- }
5377
-
5378
- e.preventDefault();
5379
-
5380
- if (this.isToggled() === includes(active, this)) {
5381
- this.toggle();
5382
- }
5383
- } },
5384
-
5385
-
5386
- {
5387
- name: 'beforeshow',
5388
-
5389
- self: true,
5390
-
5391
- handler(e) {
5392
- if (includes(active, this)) {
5393
- return false;
5394
- }
5395
-
5396
- if (!this.stack && active.length) {
5397
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5398
- e.preventDefault();
5399
- } else {
5400
- active.push(this);
5401
- }
5402
- } },
5403
-
5404
-
5405
- {
5406
- name: 'show',
5407
-
5408
- self: true,
5409
-
5410
- handler() {
5411
- const docEl = document.documentElement;
5412
-
5413
- if (width(window) > docEl.clientWidth && this.overlay) {
5414
- css(document.body, 'overflowY', 'scroll');
5415
- }
5416
-
5417
- if (this.stack) {
5418
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5419
- }
5420
-
5421
- addClass(docEl, this.clsPage);
5422
-
5423
- if (this.bgClose) {
5424
- once(
5425
- this.$el,
5426
- 'hide',
5427
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5428
- if (
5429
- last(active) !== this ||
5430
- this.overlay && !within(target, this.$el) ||
5431
- within(target, this.panel))
5432
- {
5433
- return;
5434
- }
5527
+ wrapInPicture(img, sources);
5528
+ setSourceProps(el, img);
5529
+ img.onload = () => {
5530
+ setSrcAttrs(el, img.currentSrc);
5531
+ };
5532
+ attr(img, 'src', src);
5533
+ return img;
5534
+ }
5435
5535
 
5436
- once(
5437
- document,
5438
- pointerUp + " " + pointerCancel + " scroll",
5439
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5440
- if (
5441
- !defaultPrevented &&
5442
- type === pointerUp &&
5443
- target === newTarget)
5444
- {
5445
- this.hide();
5446
- }
5447
- },
5448
- true);
5536
+ function wrapInPicture(img, sources) {
5537
+ sources = parseSources(sources);
5449
5538
 
5450
- }),
5451
- { self: true });
5539
+ if (sources.length) {
5540
+ const picture = fragment('<picture>');
5541
+ for (const attrs of sources) {
5542
+ const source = fragment('<source>');
5543
+ attr(source, attrs);
5544
+ append(picture, source);
5545
+ }
5546
+ append(picture, img);
5547
+ }
5548
+ }
5452
5549
 
5453
- }
5550
+ function parseSources(sources) {
5551
+ if (!sources) {
5552
+ return [];
5553
+ }
5454
5554
 
5455
- if (this.escClose) {
5456
- once(
5457
- this.$el,
5458
- 'hide',
5459
- on(document, 'keydown', (e) => {
5460
- if (e.keyCode === 27 && last(active) === this) {
5461
- this.hide();
5462
- }
5463
- }),
5464
- { self: true });
5555
+ if (startsWith(sources, '[')) {
5556
+ try {
5557
+ sources = JSON.parse(sources);
5558
+ } catch (e) {
5559
+ sources = [];
5560
+ }
5561
+ } else {
5562
+ sources = parseOptions(sources);
5563
+ }
5465
5564
 
5466
- }
5467
- } },
5565
+ if (!isArray(sources)) {
5566
+ sources = [sources];
5567
+ }
5468
5568
 
5569
+ return sources.filter((source) => !isEmpty(source));
5570
+ }
5469
5571
 
5470
- {
5471
- name: 'shown',
5572
+ function ensureSrcAttribute(el) {
5573
+ if (isImg(el) && !hasAttr(el, 'src')) {
5574
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5575
+ }
5576
+ }
5472
5577
 
5473
- self: true,
5578
+ function isPicture(el) {
5579
+ return isTag(el, 'picture');
5580
+ }
5474
5581
 
5475
- handler() {
5476
- if (!isFocusable(this.$el)) {
5477
- attr(this.$el, 'tabindex', '-1');
5478
- }
5582
+ function isImg(el) {
5583
+ return isTag(el, 'img');
5584
+ }
5479
5585
 
5480
- if (!$(':focus', this.$el)) {
5481
- this.$el.focus();
5482
- }
5483
- } },
5586
+ var Media = {
5587
+ props: {
5588
+ media: Boolean },
5484
5589
 
5485
5590
 
5486
- {
5487
- name: 'hidden',
5591
+ data: {
5592
+ media: false },
5488
5593
 
5489
- self: true,
5490
5594
 
5491
- handler() {
5492
- if (includes(active, this)) {
5493
- active.splice(active.indexOf(this), 1);
5494
- }
5595
+ connected() {
5596
+ const media = toMedia(this.media, this.$el);
5597
+ this.matchMedia = true;
5598
+ if (media) {
5599
+ this.mediaObj = window.matchMedia(media);
5600
+ const handler = () => {
5601
+ this.matchMedia = this.mediaObj.matches;
5602
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5603
+ };
5604
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5605
+ handler();
5606
+ this.$emit('resize');
5607
+ });
5608
+ handler();
5609
+ }
5610
+ },
5495
5611
 
5496
- if (!active.length) {
5497
- css(document.body, 'overflowY', '');
5498
- }
5612
+ disconnected() {var _this$offMediaObj;
5613
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5614
+ } };
5499
5615
 
5500
- css(this.$el, 'zIndex', '');
5501
5616
 
5502
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5503
- removeClass(document.documentElement, this.clsPage);
5504
- }
5505
- } }],
5617
+ function toMedia(value, element) {
5618
+ if (isString(value)) {
5619
+ if (startsWith(value, '@')) {
5620
+ value = toFloat(css(element, "uk-breakpoint-" + value.substr(1)));
5621
+ } else if (isNaN(value)) {
5622
+ return value;
5623
+ }
5624
+ }
5506
5625
 
5626
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5627
+ }
5507
5628
 
5629
+ var leader = {
5630
+ mixins: [Class, Media, Resize],
5508
5631
 
5509
- methods: {
5510
- toggle() {
5511
- return this.isToggled() ? this.hide() : this.show();
5512
- },
5632
+ props: {
5633
+ fill: String },
5513
5634
 
5514
- show() {
5515
- if (this.container && parent(this.$el) !== this.container) {
5516
- append(this.container, this.$el);
5517
- return new Promise((resolve) =>
5518
- requestAnimationFrame(() => this.show().then(resolve)));
5519
5635
 
5520
- }
5636
+ data: {
5637
+ fill: '',
5638
+ clsWrapper: 'uk-leader-fill',
5639
+ clsHide: 'uk-leader-hide',
5640
+ attrFill: 'data-fill' },
5521
5641
 
5522
- return this.toggleElement(this.$el, true, animate(this));
5523
- },
5524
5642
 
5525
- hide() {
5526
- return this.toggleElement(this.$el, false, animate(this));
5527
- } } };
5643
+ computed: {
5644
+ fill(_ref) {let { fill } = _ref;
5645
+ return fill || css(this.$el, '--uk-leader-fill-content');
5646
+ } },
5528
5647
 
5529
5648
 
5649
+ connected() {
5650
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5651
+ },
5530
5652
 
5531
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5532
- return (el, show) =>
5533
- new Promise((resolve, reject) =>
5534
- once(el, 'show hide', () => {
5535
- el._reject == null ? void 0 : el._reject();
5536
- el._reject = reject;
5653
+ disconnected() {
5654
+ unwrap(this.wrapper.childNodes);
5655
+ },
5537
5656
 
5538
- _toggle(el, show);
5657
+ update: {
5658
+ read() {
5659
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5539
5660
 
5540
- const off = once(
5541
- transitionElement,
5542
- 'transitionstart',
5543
- () => {
5544
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5545
- self: true });
5661
+ return {
5662
+ width,
5663
+ fill: this.fill,
5664
+ hide: !this.matchMedia };
5546
5665
 
5547
- clearTimeout(timer);
5548
5666
  },
5549
- { self: true });
5550
5667
 
5668
+ write(_ref2) {let { width, fill, hide } = _ref2;
5669
+ toggleClass(this.wrapper, this.clsHide, hide);
5670
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5671
+ },
5551
5672
 
5552
- const timer = setTimeout(() => {
5553
- off();
5554
- resolve();
5555
- }, toMs(css(transitionElement, 'transitionDuration')));
5556
- })).
5557
- then(() => delete el._reject);
5558
- }
5559
-
5560
- function toMs(time) {
5561
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5562
- }
5673
+ events: ['resize'] } };
5563
5674
 
5564
5675
  var modal = {
5565
5676
  install,
@@ -5810,8 +5921,7 @@
5810
5921
  {
5811
5922
  ...this.$props,
5812
5923
  boundary: this.boundary,
5813
- pos: this.pos,
5814
- offset: this.dropbar || this.offset });
5924
+ pos: this.pos });
5815
5925
 
5816
5926
 
5817
5927
  },
@@ -5972,8 +6082,8 @@
5972
6082
  return this.dropbar;
5973
6083
  },
5974
6084
 
5975
- handler(_, _ref9) {let { $el, align } = _ref9;
5976
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6085
+ handler(_ref9) {let { target } = _ref9;
6086
+ if (!this.isDropbarDrop(target)) {
5977
6087
  return;
5978
6088
  }
5979
6089
 
@@ -5981,7 +6091,7 @@
5981
6091
  after(this.dropbarAnchor || this.$el, this.dropbar);
5982
6092
  }
5983
6093
 
5984
- addClass($el, this.clsDrop + "-dropbar");
6094
+ addClass(target, this.clsDrop + "-dropbar");
5985
6095
  } },
5986
6096
 
5987
6097
 
@@ -5996,19 +6106,44 @@
5996
6106
  return this.dropbar;
5997
6107
  },
5998
6108
 
5999
- handler(_, _ref10) {let { $el, align } = _ref10;
6000
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6109
+ handler(_ref10) {let { target } = _ref10;
6110
+ if (!this.isDropbarDrop(target)) {
6001
6111
  return;
6002
6112
  }
6003
6113
 
6004
- this._observer = observeResize($el, () =>
6114
+ this._observer = observeResize(target, () =>
6005
6115
  this.transitionTo(
6006
- offset($el).bottom -
6116
+ offset(target).bottom -
6007
6117
  offset(this.dropbar).top +
6008
- toFloat(css($el, 'marginBottom')),
6009
- $el));
6118
+ toFloat(css(target, 'marginBottom')),
6119
+ target));
6120
+
6121
+
6122
+ } },
6123
+
6124
+
6125
+ {
6126
+ name: 'beforeposition',
6127
+
6128
+ el() {
6129
+ return this.dropContainer;
6130
+ },
6131
+
6132
+ filter() {
6133
+ return this.dropbar;
6134
+ },
6135
+
6136
+ handler(e, element, target, options) {
6137
+ if (!this.isDropbarDrop(element)) {
6138
+ return;
6139
+ }
6140
+
6141
+ const dropbarOffset = offset(this.dropbar);
6010
6142
 
6143
+ css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6011
6144
 
6145
+ options.offset[1] = dropbarOffset.top - offset(target).bottom;
6146
+ options.viewportOffset += dropbarOffset.left;
6012
6147
  } },
6013
6148
 
6014
6149
 
@@ -6023,12 +6158,12 @@
6023
6158
  return this.dropbar;
6024
6159
  },
6025
6160
 
6026
- handler(e, _ref11) {let { $el } = _ref11;
6161
+ handler(e) {
6027
6162
  const active = this.getActive();
6028
6163
 
6029
6164
  if (
6030
6165
  matches(this.dropbar, ':hover') &&
6031
- (active == null ? void 0 : active.$el) === $el &&
6166
+ (active == null ? void 0 : active.$el) === e.target &&
6032
6167
  !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6033
6168
  {
6034
6169
  e.preventDefault();
@@ -6047,8 +6182,8 @@
6047
6182
  return this.dropbar;
6048
6183
  },
6049
6184
 
6050
- handler(_, _ref12) {let { $el, align } = _ref12;
6051
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6185
+ handler(_ref11) {let { target } = _ref11;
6186
+ if (!this.isDropbarDrop(target)) {
6052
6187
  return;
6053
6188
  }
6054
6189
 
@@ -6056,7 +6191,7 @@
6056
6191
 
6057
6192
  const active = this.getActive();
6058
6193
 
6059
- if (!active || (active == null ? void 0 : active.$el) === $el) {
6194
+ if (!active || (active == null ? void 0 : active.$el) === target) {
6060
6195
  this.transitionTo(0);
6061
6196
  }
6062
6197
  } }],
@@ -6065,7 +6200,7 @@
6065
6200
 
6066
6201
  methods: {
6067
6202
  getActive() {
6068
- return active$1 && within(active$1.target, this.$el) && active$1;
6203
+ return active && within(active.target, this.$el) && active;
6069
6204
  },
6070
6205
 
6071
6206
  transitionTo(newHeight, el) {
@@ -6095,6 +6230,11 @@
6095
6230
 
6096
6231
  getDropdown(el) {
6097
6232
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6233
+ },
6234
+
6235
+ isDropbarDrop(el) {
6236
+ const drop = this.getDropdown(el);
6237
+ return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6098
6238
  } } };
6099
6239
 
6100
6240
 
@@ -6275,22 +6415,6 @@
6275
6415
  } },
6276
6416
 
6277
6417
 
6278
- {
6279
- name: 'touchstart',
6280
-
6281
- passive: true,
6282
-
6283
- el() {
6284
- return this.panel;
6285
- },
6286
-
6287
- handler(_ref8) {let { targetTouches } = _ref8;
6288
- if (targetTouches.length === 1) {
6289
- this.clientY = targetTouches[0].clientY;
6290
- }
6291
- } },
6292
-
6293
-
6294
6418
  {
6295
6419
  name: 'touchmove',
6296
6420
 
@@ -6306,33 +6430,6 @@
6306
6430
  } },
6307
6431
 
6308
6432
 
6309
- {
6310
- name: 'touchmove',
6311
-
6312
- passive: false,
6313
-
6314
- el() {
6315
- return this.panel;
6316
- },
6317
-
6318
- handler(e) {
6319
- if (e.targetTouches.length !== 1) {
6320
- return;
6321
- }
6322
-
6323
- const clientY = e.targetTouches[0].clientY - this.clientY;
6324
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6325
-
6326
- if (
6327
- clientHeight >= scrollHeight ||
6328
- scrollTop === 0 && clientY > 0 ||
6329
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6330
- {
6331
- e.cancelable && e.preventDefault();
6332
- }
6333
- } },
6334
-
6335
-
6336
6433
  {
6337
6434
  name: 'show',
6338
6435
 
@@ -6344,7 +6441,6 @@
6344
6441
  addClass(parent(this.panel), this.clsMode);
6345
6442
  }
6346
6443
 
6347
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6348
6444
  addClass(document.body, this.clsContainer, this.clsFlip);
6349
6445
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6350
6446
  css(this.$el, 'display', 'block');
@@ -6352,7 +6448,7 @@
6352
6448
  addClass(
6353
6449
  this.panel,
6354
6450
  this.clsSidebarAnimation,
6355
- this.mode !== 'reveal' ? this.clsMode : '');
6451
+ this.mode === 'reveal' ? '' : this.clsMode);
6356
6452
 
6357
6453
 
6358
6454
  height(document.body); // force reflow
@@ -6389,8 +6485,6 @@
6389
6485
  removeClass(this.$el, this.clsOverlay);
6390
6486
  css(this.$el, 'display', '');
6391
6487
  removeClass(document.body, this.clsContainer, this.clsFlip);
6392
-
6393
- css(document.documentElement, 'overflowY', '');
6394
6488
  } },
6395
6489
 
6396
6490
 
@@ -6866,7 +6960,9 @@
6866
6960
  },
6867
6961
 
6868
6962
  handler() {
6869
- if (!location.hash || scrollTop(window) === 0) {
6963
+ const { scrollingElement } = document;
6964
+
6965
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6870
6966
  return;
6871
6967
  }
6872
6968
 
@@ -6875,13 +6971,11 @@
6875
6971
  const elOffset = offset(this.$el);
6876
6972
 
6877
6973
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6878
- scrollTop(
6879
- window,
6974
+ scrollingElement.scrollTop =
6880
6975
  targetOffset.top -
6881
6976
  elOffset.height -
6882
6977
  toPx(this.targetOffset, 'height', this.placeholder) -
6883
- toPx(this.offset, 'height', this.placeholder));
6884
-
6978
+ toPx(this.offset, 'height', this.placeholder);
6885
6979
  }
6886
6980
  });
6887
6981
  } }],
@@ -6979,7 +7073,7 @@
6979
7073
 
6980
7074
 
6981
7075
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6982
- const scroll = scrollTop(window);
7076
+ const scroll = document.scrollingElement.scrollTop;
6983
7077
  const dir = prevScroll <= scroll ? 'down' : 'up';
6984
7078
 
6985
7079
  return {
@@ -7605,10 +7699,12 @@
7605
7699
  Video: Video,
7606
7700
  Close: Close,
7607
7701
  Spinner: Spinner,
7702
+ NavParentIcon: NavParentIcon,
7608
7703
  SlidenavNext: Slidenav,
7609
7704
  SlidenavPrevious: Slidenav,
7610
7705
  SearchIcon: Search,
7611
7706
  Marker: IconComponent,
7707
+ NavbarParentIcon: IconComponent,
7612
7708
  NavbarToggleIcon: IconComponent,
7613
7709
  OverlayIcon: IconComponent,
7614
7710
  PaginationNext: IconComponent,