uikit 3.14.4-dev.6a00f7fe6 → 3.14.4-dev.7db3661de

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 (91) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/css/uikit-core-rtl.css +146 -77
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +146 -77
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +143 -78
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +143 -78
  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 +765 -647
  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 +1593 -1458
  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 +14 -6
  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/scroll.js +37 -10
  56. package/src/js/core/sticky.js +8 -9
  57. package/src/js/mixin/media.js +4 -5
  58. package/src/js/mixin/modal.js +90 -4
  59. package/src/js/mixin/position.js +27 -11
  60. package/src/js/mixin/slider-drag.js +20 -8
  61. package/src/js/mixin/togglable.js +8 -17
  62. package/src/js/util/dimensions.js +6 -6
  63. package/src/js/util/position.js +1 -0
  64. package/src/js/util/style.js +4 -13
  65. package/src/js/util/viewport.js +20 -36
  66. package/src/less/components/dropdown.less +14 -0
  67. package/src/less/components/leader.less +1 -1
  68. package/src/less/components/nav.less +37 -44
  69. package/src/less/components/navbar.less +108 -24
  70. package/src/less/components/utility.less +21 -4
  71. package/src/less/theme/nav.less +3 -15
  72. package/src/less/theme/navbar.less +7 -7
  73. package/src/scss/components/dropdown.scss +14 -0
  74. package/src/scss/components/leader.scss +1 -1
  75. package/src/scss/components/nav.scss +36 -32
  76. package/src/scss/components/navbar.scss +96 -24
  77. package/src/scss/components/utility.scss +19 -3
  78. package/src/scss/mixins-theme.scss +18 -20
  79. package/src/scss/mixins.scss +16 -15
  80. package/src/scss/theme/nav.scss +3 -15
  81. package/src/scss/theme/navbar.scss +6 -3
  82. package/src/scss/variables-theme.scss +27 -15
  83. package/src/scss/variables.scss +27 -13
  84. package/tests/drop.html +72 -16
  85. package/tests/dropdown.html +103 -16
  86. package/tests/index.html +3 -3
  87. package/tests/nav.html +20 -87
  88. package/tests/navbar.html +2128 -1133
  89. package/tests/offcanvas.html +8 -8
  90. package/tests/utility.html +19 -0
  91. 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.7db3661de | 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,18 +785,11 @@
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
 
796
- const cssPrefixes = ['webkit', 'moz'];
797
-
798
791
  function vendorPropName(name) {
799
- if (name[0] === '-') {
792
+ if (startsWith(name, '--')) {
800
793
  return name;
801
794
  }
802
795
 
@@ -808,11 +801,8 @@
808
801
  return name;
809
802
  }
810
803
 
811
- let i = cssPrefixes.length,
812
- prefixedName;
813
-
814
- while (i--) {
815
- prefixedName = "-" + cssPrefixes[i] + "-" + name;
804
+ for (const prefix of ['webkit', 'moz']) {
805
+ const prefixedName = "-" + prefix + "-" + name;
816
806
  if (prefixedName in style) {
817
807
  return prefixedName;
818
808
  }
@@ -1060,13 +1050,13 @@
1060
1050
  }
1061
1051
 
1062
1052
  function offsetPosition(element) {
1063
- const offset = [0, 0];
1064
-
1065
1053
  element = toNode(element);
1066
1054
 
1067
- do {
1068
- offset[0] += element.offsetTop;
1069
- offset[1] += element.offsetLeft;
1055
+ const offset = [element.offsetTop, element.offsetLeft];
1056
+
1057
+ while (element = element.offsetParent) {
1058
+ offset[0] += element.offsetTop + toFloat(css(element, "borderTopWidth"));
1059
+ offset[1] += element.offsetLeft + toFloat(css(element, "borderLeftWidth"));
1070
1060
 
1071
1061
  if (css(element, 'position') === 'fixed') {
1072
1062
  const win = toWindow(element);
@@ -1074,7 +1064,7 @@
1074
1064
  offset[1] += win.scrollX;
1075
1065
  return offset;
1076
1066
  }
1077
- } while (element = element.offsetParent);
1067
+ }
1078
1068
 
1079
1069
  return offset;
1080
1070
  }
@@ -1795,20 +1785,6 @@
1795
1785
 
1796
1786
  }
1797
1787
 
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
1788
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1813
1789
  const parents = isVisible(element) ? scrollParents(element) : [];
1814
1790
  return parents.reduce(
@@ -1850,7 +1826,7 @@
1850
1826
  (function step() {
1851
1827
  const percent = ease(clamp((Date.now() - start) / duration));
1852
1828
 
1853
- scrollTop(element, scroll + top * percent);
1829
+ element.scrollTop = scroll + top * percent;
1854
1830
 
1855
1831
  // scroll more if we have not reached our destination
1856
1832
  if (percent === 1) {
@@ -1911,18 +1887,31 @@
1911
1887
  }
1912
1888
 
1913
1889
  function offsetViewport(scrollElement) {
1914
- let viewportElement = getViewport$1(scrollElement);
1890
+ const window = toWindow(scrollElement);
1891
+ const {
1892
+ document: { documentElement } } =
1893
+ window;
1894
+ let viewportElement =
1895
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1896
+
1897
+ const { visualViewport } = window;
1898
+ if (isWindow(viewportElement) && visualViewport) {
1899
+ let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
1900
+ height = Math.round(height * scale);
1901
+ width = Math.round(width * scale);
1902
+ return { height, width, top, left, bottom: top + height, right: left + width };
1903
+ }
1915
1904
 
1916
1905
  let rect = offset(viewportElement);
1917
1906
  for (let [prop, dir, start, end] of [
1918
1907
  ['width', 'x', 'left', 'right'],
1919
1908
  ['height', 'y', 'top', 'bottom']])
1920
1909
  {
1921
- if (!isWindow(viewportElement)) {
1922
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1923
- } else {
1910
+ if (isWindow(viewportElement)) {
1924
1911
  // iOS 12 returns <body> as scrollingElement
1925
- viewportElement = viewportElement.document.documentElement;
1912
+ viewportElement = documentElement;
1913
+ } else {
1914
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1926
1915
  }
1927
1916
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1928
1917
  rect[end] = rect[prop] + rect[start];
@@ -1934,10 +1923,6 @@
1934
1923
  return toWindow(element).document.scrollingElement;
1935
1924
  }
1936
1925
 
1937
- function getViewport$1(scrollElement) {
1938
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1939
- }
1940
-
1941
1926
  const dirs = [
1942
1927
  ['width', 'x', 'left', 'right'],
1943
1928
  ['height', 'y', 'top', 'bottom']];
@@ -2095,6 +2080,7 @@
2095
2080
  return newPos;
2096
2081
  }
2097
2082
  }
2083
+ continue;
2098
2084
  }
2099
2085
 
2100
2086
  // Move
@@ -2284,10 +2270,8 @@
2284
2270
  findAll: findAll,
2285
2271
  escape: escape,
2286
2272
  css: css,
2287
- getCssVar: getCssVar,
2288
2273
  propName: propName,
2289
2274
  isInView: isInView,
2290
- scrollTop: scrollTop,
2291
2275
  scrollIntoView: scrollIntoView,
2292
2276
  scrolledOver: scrolledOver,
2293
2277
  scrollParents: scrollParents,
@@ -2950,7 +2934,7 @@
2950
2934
  UIkit.data = '__uikit__';
2951
2935
  UIkit.prefix = 'uk-';
2952
2936
  UIkit.options = {};
2953
- UIkit.version = '3.14.4-dev.6a00f7fe6';
2937
+ UIkit.version = '3.14.4-dev.7db3661de';
2954
2938
 
2955
2939
  globalAPI(UIkit);
2956
2940
  hooksAPI(UIkit);
@@ -3248,7 +3232,7 @@
3248
3232
 
3249
3233
  Transition.cancel(el);
3250
3234
 
3251
- const [scrollElement] = scrollParents(el);
3235
+ const [scrollElement] = scrollParents(el.offsetParent);
3252
3236
  css(scrollElement, 'overflowX', 'hidden');
3253
3237
 
3254
3238
  if (!isToggled(el)) {
@@ -3259,17 +3243,11 @@
3259
3243
  duration = velocity * width + duration;
3260
3244
 
3261
3245
  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
3246
 
3267
3247
  css(el, {
3268
- clipPath: useClipPath ?
3269
- right ? "polygon(0 0," +
3248
+ clipPath: right ? "polygon(0 0," +
3270
3249
  percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3271
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3272
- '',
3250
+ 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)",
3273
3251
  marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3274
3252
 
3275
3253
 
@@ -3278,7 +3256,7 @@
3278
3256
  Transition.start(
3279
3257
  el,
3280
3258
  {
3281
- clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3259
+ clipPath: "polygon(0 0,100% 0,100% 100%,0 100%)",
3282
3260
  marginLeft: 0 },
3283
3261
 
3284
3262
  duration * (1 - percent / 100),
@@ -3287,11 +3265,9 @@
3287
3265
  Transition.start(
3288
3266
  el,
3289
3267
  {
3290
- clipPath: useClipPath ?
3291
- right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3268
+ clipPath: right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)",
3292
3269
 
3293
3270
 
3294
- '',
3295
3271
  marginLeft: (right ? 1 : -1) * width },
3296
3272
 
3297
3273
  duration * (percent / 100),
@@ -3687,23 +3663,38 @@
3687
3663
  offset = offset.reverse();
3688
3664
  }
3689
3665
 
3666
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3667
+ const { scrollTop, scrollLeft } = scrollElement;
3668
+
3690
3669
  // Ensure none positioned element does not generate scrollbars
3691
3670
  const elDim = dimensions(element);
3692
3671
  css(element, { top: -elDim.height, left: -elDim.width });
3693
3672
 
3694
- positionAt(element, target, {
3673
+ const args = [
3674
+ element,
3675
+ target,
3676
+ {
3695
3677
  attach,
3696
3678
  offset,
3697
3679
  boundary,
3698
3680
  flip: this.flip,
3699
- viewportOffset: this.getViewportOffset(element) });
3681
+ viewportOffset: this.getViewportOffset(element) }];
3682
+
3700
3683
 
3684
+
3685
+ trigger(element, 'beforeposition', args);
3686
+
3687
+ positionAt(...args);
3688
+
3689
+ // Restore scroll position
3690
+ scrollElement.scrollTop = scrollTop;
3691
+ scrollElement.scrollLeft = scrollLeft;
3701
3692
  },
3702
3693
 
3703
3694
  getPositionOffset(element) {
3704
3695
  return (
3705
3696
  toPx(
3706
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3697
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3707
3698
  this.axis === 'x' ? 'width' : 'height',
3708
3699
  element) * (
3709
3700
  includes(['left', 'top'], this.dir) ? -1 : 1));
@@ -3714,74 +3705,54 @@
3714
3705
  return includes(['center', 'justify', 'stretch'], this.align) ?
3715
3706
  0 :
3716
3707
  toPx(
3717
- getCssVar('position-shift-offset', element),
3708
+ css(element, '--uk-position-shift-offset'),
3718
3709
  this.axis === 'y' ? 'width' : 'height',
3719
3710
  element) * (
3720
3711
  includes(['left', 'top'], this.align) ? 1 : -1);
3721
3712
  },
3722
3713
 
3723
3714
  getViewportOffset(element) {
3724
- return toPx(getCssVar('position-viewport-offset', element));
3715
+ return toPx(css(element, '--uk-position-viewport-offset'));
3725
3716
  } } };
3726
3717
 
3727
- let active$1;
3728
-
3729
- var drop = {
3730
- mixins: [Container, Lazyload, Position, Togglable],
3718
+ const active$1 = [];
3731
3719
 
3732
- args: 'pos',
3720
+ var Modal = {
3721
+ mixins: [Class, Container, Togglable],
3733
3722
 
3734
3723
  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 },
3724
+ selPanel: String,
3725
+ selClose: String,
3726
+ escClose: Boolean,
3727
+ bgClose: Boolean,
3728
+ stack: Boolean },
3744
3729
 
3745
3730
 
3746
3731
  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
3732
  cls: 'uk-open',
3757
- container: false,
3758
- animateOut: false },
3733
+ escClose: true,
3734
+ bgClose: true,
3735
+ overlay: true,
3736
+ stack: false },
3759
3737
 
3760
3738
 
3761
- created() {
3762
- this.tracker = new MouseTracker();
3763
- },
3739
+ computed: {
3740
+ panel(_ref, $el) {let { selPanel } = _ref;
3741
+ return $(selPanel, $el);
3742
+ },
3764
3743
 
3765
- beforeConnect() {
3766
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3767
- },
3744
+ transitionElement() {
3745
+ return this.panel;
3746
+ },
3768
3747
 
3769
- connected() {
3770
- addClass(this.$el, this.clsDrop);
3748
+ bgClose(_ref2) {let { bgClose } = _ref2;
3749
+ return bgClose && this.panel;
3750
+ } },
3771
3751
 
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
3752
 
3782
- disconnected() {
3783
- if (this.isActive()) {
3784
- active$1 = null;
3753
+ beforeDisconnect() {
3754
+ if (includes(active$1, this)) {
3755
+ this.toggleElement(this.$el, false, false);
3785
3756
  }
3786
3757
  },
3787
3758
 
@@ -3790,158 +3761,519 @@
3790
3761
  name: 'click',
3791
3762
 
3792
3763
  delegate() {
3793
- return "." + this.clsDrop + "-close";
3764
+ return this.selClose;
3794
3765
  },
3795
3766
 
3796
3767
  handler(e) {
3797
3768
  e.preventDefault();
3798
- this.hide(false);
3769
+ this.hide();
3799
3770
  } },
3800
3771
 
3801
3772
 
3802
3773
  {
3803
- name: 'click',
3774
+ name: 'toggle',
3804
3775
 
3805
- delegate() {
3806
- return 'a[href^="#"]';
3807
- },
3776
+ self: true,
3808
3777
 
3809
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3810
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3811
- this.hide(false);
3778
+ handler(e) {
3779
+ if (e.defaultPrevented) {
3780
+ return;
3812
3781
  }
3813
- } },
3814
3782
 
3783
+ e.preventDefault();
3815
3784
 
3816
- {
3817
- name: 'beforescroll',
3818
-
3819
- handler() {
3820
- this.hide(false);
3785
+ if (this.isToggled() === includes(active$1, this)) {
3786
+ this.toggle();
3787
+ }
3821
3788
  } },
3822
3789
 
3823
3790
 
3824
3791
  {
3825
- name: 'toggle',
3792
+ name: 'beforeshow',
3826
3793
 
3827
3794
  self: true,
3828
3795
 
3829
- handler(e, toggle) {
3830
- e.preventDefault();
3796
+ handler(e) {
3797
+ if (includes(active$1, this)) {
3798
+ return false;
3799
+ }
3831
3800
 
3832
- if (this.isToggled()) {
3833
- this.hide(false);
3801
+ if (!this.stack && active$1.length) {
3802
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3803
+ e.preventDefault();
3834
3804
  } else {
3835
- this.show(toggle == null ? void 0 : toggle.$el, false);
3805
+ active$1.push(this);
3836
3806
  }
3837
3807
  } },
3838
3808
 
3839
3809
 
3840
3810
  {
3841
- name: 'toggleshow',
3811
+ name: 'show',
3842
3812
 
3843
3813
  self: true,
3844
3814
 
3845
- handler(e, toggle) {
3846
- e.preventDefault();
3847
- this.show(toggle == null ? void 0 : toggle.$el);
3848
- } },
3849
-
3850
-
3851
- {
3852
- name: 'togglehide',
3815
+ handler() {
3816
+ once(
3817
+ this.$el,
3818
+ 'hide',
3819
+ on(document, 'focusin', (e) => {
3820
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3821
+ this.$el.focus();
3822
+ }
3823
+ }));
3853
3824
 
3854
- self: true,
3855
3825
 
3856
- handler(e) {
3857
- e.preventDefault();
3858
- if (!matches(this.$el, ':focus,:hover')) {
3859
- this.hide();
3826
+ if (this.overlay) {
3827
+ once(this.$el, 'hide', preventOverscroll(this.$el));
3828
+ once(this.$el, 'hide', preventBackgroundScroll());
3860
3829
  }
3861
- } },
3862
3830
 
3831
+ if (this.stack) {
3832
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3833
+ }
3863
3834
 
3864
- {
3865
- name: pointerEnter + " focusin",
3835
+ addClass(document.documentElement, this.clsPage);
3866
3836
 
3867
- filter() {
3868
- return includes(this.mode, 'hover');
3869
- },
3837
+ if (this.bgClose) {
3838
+ once(
3839
+ this.$el,
3840
+ 'hide',
3841
+ on(document, pointerDown, (_ref3) => {let { target } = _ref3;
3842
+ if (
3843
+ last(active$1) !== this ||
3844
+ this.overlay && !within(target, this.$el) ||
3845
+ within(target, this.panel))
3846
+ {
3847
+ return;
3848
+ }
3870
3849
 
3871
- handler(e) {
3872
- if (!isTouch(e)) {
3873
- this.clearTimers();
3874
- }
3875
- } },
3850
+ once(
3851
+ document,
3852
+ pointerUp + " " + pointerCancel + " scroll",
3853
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3854
+ if (
3855
+ !defaultPrevented &&
3856
+ type === pointerUp &&
3857
+ target === newTarget)
3858
+ {
3859
+ this.hide();
3860
+ }
3861
+ },
3862
+ true);
3876
3863
 
3864
+ }),
3865
+ { self: true });
3877
3866
 
3878
- {
3879
- name: pointerLeave + " focusout",
3867
+ }
3880
3868
 
3881
- filter() {
3882
- return includes(this.mode, 'hover');
3883
- },
3869
+ if (this.escClose) {
3870
+ once(
3871
+ this.$el,
3872
+ 'hide',
3873
+ on(document, 'keydown', (e) => {
3874
+ if (e.keyCode === 27 && last(active$1) === this) {
3875
+ this.hide();
3876
+ }
3877
+ }),
3878
+ { self: true });
3884
3879
 
3885
- handler(e) {
3886
- if (!isTouch(e) && e.relatedTarget) {
3887
- this.hide();
3888
3880
  }
3889
3881
  } },
3890
3882
 
3891
3883
 
3892
3884
  {
3893
- name: 'toggled',
3885
+ name: 'shown',
3894
3886
 
3895
3887
  self: true,
3896
3888
 
3897
- handler(e, toggled) {
3898
- if (!toggled) {
3899
- return;
3889
+ handler() {
3890
+ if (!isFocusable(this.$el)) {
3891
+ attr(this.$el, 'tabindex', '-1');
3900
3892
  }
3901
3893
 
3902
- this.clearTimers();
3903
- this.position();
3894
+ if (!$(':focus', this.$el)) {
3895
+ this.$el.focus();
3896
+ }
3904
3897
  } },
3905
3898
 
3906
3899
 
3907
3900
  {
3908
- name: 'show',
3901
+ name: 'hidden',
3909
3902
 
3910
3903
  self: true,
3911
3904
 
3912
3905
  handler() {
3913
- active$1 = this;
3906
+ if (includes(active$1, this)) {
3907
+ active$1.splice(active$1.indexOf(this), 1);
3908
+ }
3914
3909
 
3915
- this.tracker.init();
3910
+ if (!active$1.length) {
3911
+ css(document.body, 'overflowY', '');
3912
+ }
3916
3913
 
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));}),
3914
+ css(this.$el, 'zIndex', '');
3937
3915
 
3916
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3917
+ removeClass(document.documentElement, this.clsPage);
3918
+ }
3919
+ } }],
3938
3920
 
3939
3921
 
3940
- on(document, 'keydown', (e) => {
3941
- if (e.keyCode === 27) {
3942
- this.hide(false);
3943
- }
3944
- }),
3922
+
3923
+ methods: {
3924
+ toggle() {
3925
+ return this.isToggled() ? this.hide() : this.show();
3926
+ },
3927
+
3928
+ show() {
3929
+ if (this.container && parent(this.$el) !== this.container) {
3930
+ append(this.container, this.$el);
3931
+ return new Promise((resolve) =>
3932
+ requestAnimationFrame(() => this.show().then(resolve)));
3933
+
3934
+ }
3935
+
3936
+ return this.toggleElement(this.$el, true, animate(this));
3937
+ },
3938
+
3939
+ hide() {
3940
+ return this.toggleElement(this.$el, false, animate(this));
3941
+ } } };
3942
+
3943
+
3944
+
3945
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3946
+ return (el, show) =>
3947
+ new Promise((resolve, reject) =>
3948
+ once(el, 'show hide', () => {
3949
+ el._reject == null ? void 0 : el._reject();
3950
+ el._reject = reject;
3951
+
3952
+ _toggle(el, show);
3953
+
3954
+ const off = once(
3955
+ transitionElement,
3956
+ 'transitionstart',
3957
+ () => {
3958
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3959
+ self: true });
3960
+
3961
+ clearTimeout(timer);
3962
+ },
3963
+ { self: true });
3964
+
3965
+
3966
+ const timer = setTimeout(() => {
3967
+ off();
3968
+ resolve();
3969
+ }, toMs(css(transitionElement, 'transitionDuration')));
3970
+ })).
3971
+ then(() => delete el._reject);
3972
+ }
3973
+
3974
+ function toMs(time) {
3975
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3976
+ }
3977
+
3978
+ function preventOverscroll(el) {
3979
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3980
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3981
+ css(elements, 'overscrollBehavior', 'contain');
3982
+ return () => css(elements, 'overscrollBehavior', '');
3983
+ }
3984
+
3985
+ let startClientY;
3986
+
3987
+ const events = [
3988
+ on(
3989
+ el,
3990
+ 'touchstart',
3991
+ (_ref6) => {let { targetTouches } = _ref6;
3992
+ if (targetTouches.length === 1) {
3993
+ startClientY = targetTouches[0].clientY;
3994
+ }
3995
+ },
3996
+ { passive: true }),
3997
+
3998
+
3999
+ on(
4000
+ el,
4001
+ 'touchmove',
4002
+ (e) => {
4003
+ if (e.targetTouches.length !== 1) {
4004
+ return;
4005
+ }
4006
+
4007
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
4008
+ if (!within(scrollParent, el)) {
4009
+ scrollParent = el;
4010
+ }
4011
+
4012
+ const clientY = e.targetTouches[0].clientY - startClientY;
4013
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4014
+
4015
+ if (
4016
+ clientHeight >= scrollHeight ||
4017
+ scrollTop === 0 && clientY > 0 ||
4018
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
4019
+ {
4020
+ e.cancelable && e.preventDefault();
4021
+ }
4022
+ },
4023
+ { passive: false })];
4024
+
4025
+
4026
+
4027
+ return () => events.forEach((fn) => fn());
4028
+ }
4029
+
4030
+ function preventBackgroundScroll() {
4031
+ const { body, documentElement } = document;
4032
+ css(body, {
4033
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4034
+ touchAction: 'none' });
4035
+
4036
+ css(documentElement, 'overflowY', 'hidden');
4037
+ return () => {
4038
+ css(documentElement, 'overflowY', '');
4039
+ css(body, { overflowY: '', touchAction: '' });
4040
+ };
4041
+ }
4042
+
4043
+ function filterChildren(el, fn) {
4044
+ const children = [];
4045
+ apply(el, (node) => {
4046
+ if (fn(node)) {
4047
+ children.push(node);
4048
+ }
4049
+ });
4050
+ return children;
4051
+ }
4052
+
4053
+ let active;
4054
+
4055
+ var drop = {
4056
+ mixins: [Container, Lazyload, Position, Togglable],
4057
+
4058
+ args: 'pos',
4059
+
4060
+ props: {
4061
+ mode: 'list',
4062
+ toggle: Boolean,
4063
+ boundary: Boolean,
4064
+ boundaryAlign: Boolean,
4065
+ delayShow: Number,
4066
+ delayHide: Number,
4067
+ display: String,
4068
+ clsDrop: String,
4069
+ animateOut: Boolean,
4070
+ bgScroll: Boolean },
4071
+
4072
+
4073
+ data: {
4074
+ mode: ['click', 'hover'],
4075
+ toggle: '- *',
4076
+ boundary: true,
4077
+ boundaryAlign: false,
4078
+ delayShow: 0,
4079
+ delayHide: 800,
4080
+ display: null,
4081
+ clsDrop: false,
4082
+ animation: ['uk-animation-fade'],
4083
+ cls: 'uk-open',
4084
+ container: false,
4085
+ animateOut: false,
4086
+ bgScroll: true },
4087
+
4088
+
4089
+ created() {
4090
+ this.tracker = new MouseTracker();
4091
+ },
4092
+
4093
+ beforeConnect() {
4094
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4095
+ },
4096
+
4097
+ connected() {
4098
+ addClass(this.$el, this.clsDrop);
4099
+
4100
+ if (this.toggle && !this.target) {
4101
+ this.target = this.$create('toggle', query(this.toggle, this.$el), {
4102
+ target: this.$el,
4103
+ mode: this.mode }).
4104
+ $el;
4105
+ attr(this.target, 'aria-haspopup', true);
4106
+ this.lazyload(this.target);
4107
+ }
4108
+ },
4109
+
4110
+ disconnected() {
4111
+ if (this.isActive()) {
4112
+ active = null;
4113
+ }
4114
+ },
4115
+
4116
+ events: [
4117
+ {
4118
+ name: 'click',
4119
+
4120
+ delegate() {
4121
+ return "." + this.clsDrop + "-close";
4122
+ },
4123
+
4124
+ handler(e) {
4125
+ e.preventDefault();
4126
+ this.hide(false);
4127
+ } },
4128
+
4129
+
4130
+ {
4131
+ name: 'click',
4132
+
4133
+ delegate() {
4134
+ return 'a[href^="#"]';
4135
+ },
4136
+
4137
+ handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
4138
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4139
+ this.hide(false);
4140
+ }
4141
+ } },
4142
+
4143
+
4144
+ {
4145
+ name: 'beforescroll',
4146
+
4147
+ handler() {
4148
+ this.hide(false);
4149
+ } },
4150
+
4151
+
4152
+ {
4153
+ name: 'toggle',
4154
+
4155
+ self: true,
4156
+
4157
+ handler(e, toggle) {
4158
+ e.preventDefault();
4159
+
4160
+ if (this.isToggled()) {
4161
+ this.hide(false);
4162
+ } else {
4163
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4164
+ }
4165
+ } },
4166
+
4167
+
4168
+ {
4169
+ name: 'toggleshow',
4170
+
4171
+ self: true,
4172
+
4173
+ handler(e, toggle) {
4174
+ e.preventDefault();
4175
+ this.show(toggle == null ? void 0 : toggle.$el);
4176
+ } },
4177
+
4178
+
4179
+ {
4180
+ name: 'togglehide',
4181
+
4182
+ self: true,
4183
+
4184
+ handler(e) {
4185
+ e.preventDefault();
4186
+ if (!matches(this.$el, ':focus,:hover')) {
4187
+ this.hide();
4188
+ }
4189
+ } },
4190
+
4191
+
4192
+ {
4193
+ name: pointerEnter + " focusin",
4194
+
4195
+ filter() {
4196
+ return includes(this.mode, 'hover');
4197
+ },
4198
+
4199
+ handler(e) {
4200
+ if (!isTouch(e)) {
4201
+ this.clearTimers();
4202
+ }
4203
+ } },
4204
+
4205
+
4206
+ {
4207
+ name: pointerLeave + " focusout",
4208
+
4209
+ filter() {
4210
+ return includes(this.mode, 'hover');
4211
+ },
4212
+
4213
+ handler(e) {
4214
+ if (!isTouch(e) && e.relatedTarget) {
4215
+ this.hide();
4216
+ }
4217
+ } },
4218
+
4219
+
4220
+ {
4221
+ name: 'toggled',
4222
+
4223
+ self: true,
4224
+
4225
+ handler(e, toggled) {
4226
+ if (!toggled) {
4227
+ return;
4228
+ }
4229
+
4230
+ this.clearTimers();
4231
+ this.position();
4232
+ } },
4233
+
4234
+
4235
+ {
4236
+ name: 'show',
4237
+
4238
+ self: true,
4239
+
4240
+ handler() {
4241
+ active = this;
4242
+
4243
+ this.tracker.init();
4244
+
4245
+ for (const handler of [
4246
+ on(
4247
+ document,
4248
+ pointerDown,
4249
+ (_ref2) => {let { target } = _ref2;return (
4250
+ !within(target, this.$el) &&
4251
+ once(
4252
+ document,
4253
+ pointerUp + " " + pointerCancel + " scroll",
4254
+ (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4255
+ if (
4256
+ !defaultPrevented &&
4257
+ type === pointerUp &&
4258
+ target === newTarget &&
4259
+ !(this.target && within(target, this.target)))
4260
+ {
4261
+ this.hide(false);
4262
+ }
4263
+ },
4264
+ true));}),
4265
+
4266
+
4267
+
4268
+ on(document, 'keydown', (e) => {
4269
+ if (e.keyCode === 27) {
4270
+ this.hide(false);
4271
+ }
4272
+ }),
4273
+
4274
+ ...(this.bgScroll ?
4275
+ [] :
4276
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
3945
4277
 
3946
4278
  ...(this.display === 'static' && this.align !== 'stretch' ?
3947
4279
  [] :
@@ -3980,14 +4312,14 @@
3980
4312
 
3981
4313
  handler(_ref4) {let { target } = _ref4;
3982
4314
  if (this.$el !== target) {
3983
- active$1 =
3984
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4315
+ active =
4316
+ active === null && within(target, this.$el) && this.isToggled() ?
3985
4317
  this :
3986
- active$1;
4318
+ active;
3987
4319
  return;
3988
4320
  }
3989
4321
 
3990
- active$1 = this.isActive() ? null : active$1;
4322
+ active = this.isActive() ? null : active;
3991
4323
  this.tracker.cancel();
3992
4324
  } }],
3993
4325
 
@@ -4015,16 +4347,16 @@
4015
4347
  return;
4016
4348
  }
4017
4349
 
4018
- if (active$1) {
4019
- if (delay && active$1.isDelaying) {
4350
+ if (active) {
4351
+ if (delay && active.isDelaying) {
4020
4352
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4021
4353
  return;
4022
4354
  }
4023
4355
 
4024
4356
  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);
4357
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4358
+ prev = active;
4359
+ active.hide(false, false);
4028
4360
  }
4029
4361
  }
4030
4362
 
@@ -4065,7 +4397,7 @@
4065
4397
  },
4066
4398
 
4067
4399
  isActive() {
4068
- return active$1 === this;
4400
+ return active === this;
4069
4401
  },
4070
4402
 
4071
4403
  position() {
@@ -4620,8 +4952,11 @@
4620
4952
  let minHeight = '';
4621
4953
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4622
4954
 
4955
+ const { body, scrollingElement } = document;
4623
4956
  const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4624
- const { height: viewportHeight } = offsetViewport(scrollElement);
4957
+ const { height: viewportHeight } = offsetViewport(
4958
+ scrollElement === body ? scrollingElement : scrollElement);
4959
+
4625
4960
 
4626
4961
  if (this.expand) {
4627
4962
  minHeight = Math.max(
@@ -4631,14 +4966,19 @@
4631
4966
  0);
4632
4967
 
4633
4968
  } else {
4634
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4635
- minHeight = "calc(" + (
4636
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4969
+ const isScrollingElement =
4970
+ scrollingElement === scrollElement || body === scrollElement;
4637
4971
 
4972
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4973
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4638
4974
 
4639
4975
  if (this.offsetTop) {
4640
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4641
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4976
+ if (isScrollingElement) {
4977
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4978
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4979
+ } else {
4980
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4981
+ }
4642
4982
  }
4643
4983
 
4644
4984
  if (this.offsetBottom === true) {
@@ -4881,6 +5221,12 @@
4881
5221
 
4882
5222
  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
5223
 
5224
+ 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>";
5225
+
5226
+ 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>";
5227
+
5228
+ 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>";
5229
+
4884
5230
  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
5231
 
4886
5232
  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 +5259,9 @@
4913
5259
  marker,
4914
5260
  'close-icon': closeIcon,
4915
5261
  'close-large': closeLarge,
5262
+ 'nav-parent-icon': navParentIcon,
5263
+ 'nav-parent-icon-large': navParentIconLarge,
5264
+ 'navbar-parent-icon': navbarParentIcon,
4916
5265
  'navbar-toggle-icon': navbarToggleIcon,
4917
5266
  'overlay-icon': overlayIcon,
4918
5267
  'pagination-next': paginationNext,
@@ -4970,6 +5319,15 @@
4970
5319
  } };
4971
5320
 
4972
5321
 
5322
+ const NavParentIcon = {
5323
+ extends: IconComponent,
5324
+
5325
+ beforeConnect() {
5326
+ const icon = this.$props.icon;
5327
+ this.icon = closest(this.$el, '.uk-nav-primary') ? icon + "-large" : icon;
5328
+ } };
5329
+
5330
+
4973
5331
  const Slidenav = {
4974
5332
  extends: IconComponent,
4975
5333
 
@@ -5175,391 +5533,139 @@
5175
5533
 
5176
5534
  if (sources.length) {
5177
5535
  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
- }
5435
-
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);
5449
-
5450
- }),
5451
- { self: true });
5536
+ for (const attrs of sources) {
5537
+ const source = fragment('<source>');
5538
+ attr(source, attrs);
5539
+ append(picture, source);
5540
+ }
5541
+ append(picture, img);
5542
+ }
5543
+ }
5452
5544
 
5453
- }
5545
+ function parseSources(sources) {
5546
+ if (!sources) {
5547
+ return [];
5548
+ }
5454
5549
 
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 });
5550
+ if (startsWith(sources, '[')) {
5551
+ try {
5552
+ sources = JSON.parse(sources);
5553
+ } catch (e) {
5554
+ sources = [];
5555
+ }
5556
+ } else {
5557
+ sources = parseOptions(sources);
5558
+ }
5465
5559
 
5466
- }
5467
- } },
5560
+ if (!isArray(sources)) {
5561
+ sources = [sources];
5562
+ }
5468
5563
 
5564
+ return sources.filter((source) => !isEmpty(source));
5565
+ }
5469
5566
 
5470
- {
5471
- name: 'shown',
5567
+ function ensureSrcAttribute(el) {
5568
+ if (isImg(el) && !hasAttr(el, 'src')) {
5569
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5570
+ }
5571
+ }
5472
5572
 
5473
- self: true,
5573
+ function isPicture(el) {
5574
+ return isTag(el, 'picture');
5575
+ }
5474
5576
 
5475
- handler() {
5476
- if (!isFocusable(this.$el)) {
5477
- attr(this.$el, 'tabindex', '-1');
5478
- }
5577
+ function isImg(el) {
5578
+ return isTag(el, 'img');
5579
+ }
5479
5580
 
5480
- if (!$(':focus', this.$el)) {
5481
- this.$el.focus();
5482
- }
5483
- } },
5581
+ var Media = {
5582
+ props: {
5583
+ media: Boolean },
5484
5584
 
5485
5585
 
5486
- {
5487
- name: 'hidden',
5586
+ data: {
5587
+ media: false },
5488
5588
 
5489
- self: true,
5490
5589
 
5491
- handler() {
5492
- if (includes(active, this)) {
5493
- active.splice(active.indexOf(this), 1);
5494
- }
5590
+ connected() {
5591
+ const media = toMedia(this.media, this.$el);
5592
+ this.matchMedia = true;
5593
+ if (media) {
5594
+ this.mediaObj = window.matchMedia(media);
5595
+ const handler = () => {
5596
+ this.matchMedia = this.mediaObj.matches;
5597
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5598
+ };
5599
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5600
+ handler();
5601
+ this.$emit('resize');
5602
+ });
5603
+ handler();
5604
+ }
5605
+ },
5495
5606
 
5496
- if (!active.length) {
5497
- css(document.body, 'overflowY', '');
5498
- }
5607
+ disconnected() {var _this$offMediaObj;
5608
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5609
+ } };
5499
5610
 
5500
- css(this.$el, 'zIndex', '');
5501
5611
 
5502
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5503
- removeClass(document.documentElement, this.clsPage);
5504
- }
5505
- } }],
5612
+ function toMedia(value, element) {
5613
+ if (isString(value)) {
5614
+ if (startsWith(value, '@')) {
5615
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5616
+ } else if (isNaN(value)) {
5617
+ return value;
5618
+ }
5619
+ }
5506
5620
 
5621
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5622
+ }
5507
5623
 
5624
+ var leader = {
5625
+ mixins: [Class, Media, Resize],
5508
5626
 
5509
- methods: {
5510
- toggle() {
5511
- return this.isToggled() ? this.hide() : this.show();
5512
- },
5627
+ props: {
5628
+ fill: String },
5513
5629
 
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
5630
 
5520
- }
5631
+ data: {
5632
+ fill: '',
5633
+ clsWrapper: 'uk-leader-fill',
5634
+ clsHide: 'uk-leader-hide',
5635
+ attrFill: 'data-fill' },
5521
5636
 
5522
- return this.toggleElement(this.$el, true, animate(this));
5523
- },
5524
5637
 
5525
- hide() {
5526
- return this.toggleElement(this.$el, false, animate(this));
5527
- } } };
5638
+ computed: {
5639
+ fill(_ref) {let { fill } = _ref;
5640
+ return fill || css(this.$el, '--uk-leader-fill-content');
5641
+ } },
5528
5642
 
5529
5643
 
5644
+ connected() {
5645
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5646
+ },
5530
5647
 
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;
5648
+ disconnected() {
5649
+ unwrap(this.wrapper.childNodes);
5650
+ },
5537
5651
 
5538
- _toggle(el, show);
5652
+ update: {
5653
+ read() {
5654
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5539
5655
 
5540
- const off = once(
5541
- transitionElement,
5542
- 'transitionstart',
5543
- () => {
5544
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5545
- self: true });
5656
+ return {
5657
+ width,
5658
+ fill: this.fill,
5659
+ hide: !this.matchMedia };
5546
5660
 
5547
- clearTimeout(timer);
5548
5661
  },
5549
- { self: true });
5550
-
5551
5662
 
5552
- const timer = setTimeout(() => {
5553
- off();
5554
- resolve();
5555
- }, toMs(css(transitionElement, 'transitionDuration')));
5556
- })).
5557
- then(() => delete el._reject);
5558
- }
5663
+ write(_ref2) {let { width, fill, hide } = _ref2;
5664
+ toggleClass(this.wrapper, this.clsHide, hide);
5665
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5666
+ },
5559
5667
 
5560
- function toMs(time) {
5561
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5562
- }
5668
+ events: ['resize'] } };
5563
5669
 
5564
5670
  var modal = {
5565
5671
  install,
@@ -5810,8 +5916,7 @@
5810
5916
  {
5811
5917
  ...this.$props,
5812
5918
  boundary: this.boundary,
5813
- pos: this.pos,
5814
- offset: this.dropbar || this.offset });
5919
+ pos: this.pos });
5815
5920
 
5816
5921
 
5817
5922
  },
@@ -5972,8 +6077,8 @@
5972
6077
  return this.dropbar;
5973
6078
  },
5974
6079
 
5975
- handler(_, _ref9) {let { $el, align } = _ref9;
5976
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6080
+ handler(_ref9) {let { target } = _ref9;
6081
+ if (!this.isDropbarDrop(target)) {
5977
6082
  return;
5978
6083
  }
5979
6084
 
@@ -5981,7 +6086,7 @@
5981
6086
  after(this.dropbarAnchor || this.$el, this.dropbar);
5982
6087
  }
5983
6088
 
5984
- addClass($el, this.clsDrop + "-dropbar");
6089
+ addClass(target, this.clsDrop + "-dropbar");
5985
6090
  } },
5986
6091
 
5987
6092
 
@@ -5996,19 +6101,44 @@
5996
6101
  return this.dropbar;
5997
6102
  },
5998
6103
 
5999
- handler(_, _ref10) {let { $el, align } = _ref10;
6000
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6104
+ handler(_ref10) {let { target } = _ref10;
6105
+ if (!this.isDropbarDrop(target)) {
6001
6106
  return;
6002
6107
  }
6003
6108
 
6004
- this._observer = observeResize($el, () =>
6109
+ this._observer = observeResize(target, () =>
6005
6110
  this.transitionTo(
6006
- offset($el).bottom -
6111
+ offset(target).bottom -
6007
6112
  offset(this.dropbar).top +
6008
- toFloat(css($el, 'marginBottom')),
6009
- $el));
6113
+ toFloat(css(target, 'marginBottom')),
6114
+ target));
6115
+
6116
+
6117
+ } },
6010
6118
 
6011
6119
 
6120
+ {
6121
+ name: 'beforeposition',
6122
+
6123
+ el() {
6124
+ return this.dropContainer;
6125
+ },
6126
+
6127
+ filter() {
6128
+ return this.dropbar;
6129
+ },
6130
+
6131
+ handler(e, element, target, options) {
6132
+ if (!this.isDropbarDrop(element)) {
6133
+ return;
6134
+ }
6135
+
6136
+ const dropbarOffset = offset(this.dropbar);
6137
+
6138
+ css(element, 'maxWidth', dropbarOffset.width - options.viewportOffset * 2);
6139
+
6140
+ options.offset[1] = dropbarOffset.top - offset(target).bottom;
6141
+ options.viewportOffset += dropbarOffset.left;
6012
6142
  } },
6013
6143
 
6014
6144
 
@@ -6023,12 +6153,12 @@
6023
6153
  return this.dropbar;
6024
6154
  },
6025
6155
 
6026
- handler(e, _ref11) {let { $el } = _ref11;
6156
+ handler(e) {
6027
6157
  const active = this.getActive();
6028
6158
 
6029
6159
  if (
6030
6160
  matches(this.dropbar, ':hover') &&
6031
- (active == null ? void 0 : active.$el) === $el &&
6161
+ (active == null ? void 0 : active.$el) === e.target &&
6032
6162
  !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6033
6163
  {
6034
6164
  e.preventDefault();
@@ -6047,8 +6177,8 @@
6047
6177
  return this.dropbar;
6048
6178
  },
6049
6179
 
6050
- handler(_, _ref12) {let { $el, align } = _ref12;
6051
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6180
+ handler(_ref11) {let { target } = _ref11;
6181
+ if (!this.isDropbarDrop(target)) {
6052
6182
  return;
6053
6183
  }
6054
6184
 
@@ -6056,7 +6186,7 @@
6056
6186
 
6057
6187
  const active = this.getActive();
6058
6188
 
6059
- if (!active || (active == null ? void 0 : active.$el) === $el) {
6189
+ if (!active || (active == null ? void 0 : active.$el) === target) {
6060
6190
  this.transitionTo(0);
6061
6191
  }
6062
6192
  } }],
@@ -6065,7 +6195,7 @@
6065
6195
 
6066
6196
  methods: {
6067
6197
  getActive() {
6068
- return active$1 && within(active$1.target, this.$el) && active$1;
6198
+ return active && within(active.target, this.$el) && active;
6069
6199
  },
6070
6200
 
6071
6201
  transitionTo(newHeight, el) {
@@ -6095,6 +6225,11 @@
6095
6225
 
6096
6226
  getDropdown(el) {
6097
6227
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6228
+ },
6229
+
6230
+ isDropbarDrop(el) {
6231
+ const drop = this.getDropdown(el);
6232
+ return drop && hasClass(el, this.clsDrop) && drop.align !== 'stretch';
6098
6233
  } } };
6099
6234
 
6100
6235
 
@@ -6275,22 +6410,6 @@
6275
6410
  } },
6276
6411
 
6277
6412
 
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
6413
  {
6295
6414
  name: 'touchmove',
6296
6415
 
@@ -6306,33 +6425,6 @@
6306
6425
  } },
6307
6426
 
6308
6427
 
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
6428
  {
6337
6429
  name: 'show',
6338
6430
 
@@ -6344,7 +6436,6 @@
6344
6436
  addClass(parent(this.panel), this.clsMode);
6345
6437
  }
6346
6438
 
6347
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6348
6439
  addClass(document.body, this.clsContainer, this.clsFlip);
6349
6440
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6350
6441
  css(this.$el, 'display', 'block');
@@ -6352,7 +6443,7 @@
6352
6443
  addClass(
6353
6444
  this.panel,
6354
6445
  this.clsSidebarAnimation,
6355
- this.mode !== 'reveal' ? this.clsMode : '');
6446
+ this.mode === 'reveal' ? '' : this.clsMode);
6356
6447
 
6357
6448
 
6358
6449
  height(document.body); // force reflow
@@ -6389,8 +6480,6 @@
6389
6480
  removeClass(this.$el, this.clsOverlay);
6390
6481
  css(this.$el, 'display', '');
6391
6482
  removeClass(document.body, this.clsContainer, this.clsFlip);
6392
-
6393
- css(document.documentElement, 'overflowY', '');
6394
6483
  } },
6395
6484
 
6396
6485
 
@@ -6515,6 +6604,14 @@
6515
6604
  offset: 0 },
6516
6605
 
6517
6606
 
6607
+ connected() {
6608
+ registerClick(this);
6609
+ },
6610
+
6611
+ disconnected() {
6612
+ unregisterClick(this);
6613
+ },
6614
+
6518
6615
  methods: {
6519
6616
  async scrollTo(el) {
6520
6617
  el = el && $(el) || document.body;
@@ -6523,20 +6620,39 @@
6523
6620
  await scrollIntoView(el, { offset: this.offset });
6524
6621
  trigger(this.$el, 'scrolled', [this, el]);
6525
6622
  }
6526
- } },
6623
+ } } };
6527
6624
 
6528
6625
 
6529
- events: {
6530
- click(e) {
6531
- if (e.defaultPrevented) {
6532
- return;
6533
- }
6534
6626
 
6535
- e.preventDefault();
6536
- this.scrollTo(getTargetElement(this.$el));
6537
- } } };
6627
+ const components$1 = new Set();
6628
+ function registerClick(cmp) {
6629
+ if (!components$1.size) {
6630
+ on(document, 'click', clickHandler);
6631
+ }
6632
+
6633
+ components$1.add(cmp);
6634
+ }
6635
+
6636
+ function unregisterClick(cmp) {
6637
+ components$1.delete(cmp);
6638
+
6639
+ if (!components$1.length) {
6640
+ off(document, 'click', clickHandler);
6641
+ }
6642
+ }
6538
6643
 
6644
+ function clickHandler(e) {
6645
+ if (e.defaultPrevented) {
6646
+ return;
6647
+ }
6539
6648
 
6649
+ for (const component of components$1) {
6650
+ if (within(component.$el, e.target)) {
6651
+ e.preventDefault();
6652
+ component.scrollTo(getTargetElement(component.$el));
6653
+ }
6654
+ }
6655
+ }
6540
6656
 
6541
6657
  function getTargetElement(el) {
6542
6658
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -6866,7 +6982,9 @@
6866
6982
  },
6867
6983
 
6868
6984
  handler() {
6869
- if (!location.hash || scrollTop(window) === 0) {
6985
+ const { scrollingElement } = document;
6986
+
6987
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6870
6988
  return;
6871
6989
  }
6872
6990
 
@@ -6875,13 +6993,11 @@
6875
6993
  const elOffset = offset(this.$el);
6876
6994
 
6877
6995
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6878
- scrollTop(
6879
- window,
6996
+ scrollingElement.scrollTop =
6880
6997
  targetOffset.top -
6881
6998
  elOffset.height -
6882
6999
  toPx(this.targetOffset, 'height', this.placeholder) -
6883
- toPx(this.offset, 'height', this.placeholder));
6884
-
7000
+ toPx(this.offset, 'height', this.placeholder);
6885
7001
  }
6886
7002
  });
6887
7003
  } }],
@@ -6979,7 +7095,7 @@
6979
7095
 
6980
7096
 
6981
7097
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6982
- const scroll = scrollTop(window);
7098
+ const scroll = document.scrollingElement.scrollTop;
6983
7099
  const dir = prevScroll <= scroll ? 'down' : 'up';
6984
7100
 
6985
7101
  return {
@@ -7605,10 +7721,12 @@
7605
7721
  Video: Video,
7606
7722
  Close: Close,
7607
7723
  Spinner: Spinner,
7724
+ NavParentIcon: NavParentIcon,
7608
7725
  SlidenavNext: Slidenav,
7609
7726
  SlidenavPrevious: Slidenav,
7610
7727
  SearchIcon: Search,
7611
7728
  Marker: IconComponent,
7729
+ NavbarParentIcon: IconComponent,
7612
7730
  NavbarToggleIcon: IconComponent,
7613
7731
  OverlayIcon: IconComponent,
7614
7732
  PaginationNext: IconComponent,