uikit 3.15.15-dev.cc41b76e3 → 3.15.15-dev.f41a7c271

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 (53) hide show
  1. package/CHANGELOG.md +9 -2
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +5 -2
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +5 -2
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +9 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  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 +213 -172
  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 +221 -172
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/images/components/navbar-toggle-icon.svg +1 -1
  44. package/src/js/components/parallax.js +9 -1
  45. package/src/js/core/drop.js +5 -3
  46. package/src/js/core/img.js +3 -11
  47. package/src/js/core/scrollspy.js +3 -10
  48. package/src/js/core/sticky.js +56 -19
  49. package/src/js/mixin/modal.js +4 -1
  50. package/src/js/util/dimensions.js +25 -1
  51. package/tests/image.html +6 -12
  52. package/tests/scrollspy.html +4 -10
  53. package/src/js/mixin/style.js +0 -11
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.15.15-dev.cc41b76e3 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.15.15-dev.f41a7c271 | 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() :
@@ -970,6 +970,124 @@
970
970
  }
971
971
  };
972
972
 
973
+ function ready(fn) {
974
+ if (document.readyState !== 'loading') {
975
+ fn();
976
+ return;
977
+ }
978
+
979
+ once(document, 'DOMContentLoaded', fn);
980
+ }
981
+
982
+ function isTag(element, tagName) {var _element$tagName;
983
+ return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
984
+ }
985
+
986
+ function empty(element) {
987
+ element = $(element);
988
+ element.innerHTML = '';
989
+ return element;
990
+ }
991
+
992
+ function html(parent, html) {
993
+ return isUndefined(html) ? $(parent).innerHTML : append(empty(parent), html);
994
+ }
995
+
996
+ const prepend = applyFn('prepend');
997
+ const append = applyFn('append');
998
+ const before = applyFn('before');
999
+ const after = applyFn('after');
1000
+
1001
+ function applyFn(fn) {
1002
+ return function (ref, element) {var _$;
1003
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
1004
+ (_$ = $(ref)) == null ? void 0 : _$[fn](...nodes);
1005
+ return unwrapSingle(nodes);
1006
+ };
1007
+ }
1008
+
1009
+ function remove$1(element) {
1010
+ toNodes(element).forEach((element) => element.remove());
1011
+ }
1012
+
1013
+ function wrapAll(element, structure) {
1014
+ structure = toNode(before(element, structure));
1015
+
1016
+ while (structure.firstChild) {
1017
+ structure = structure.firstChild;
1018
+ }
1019
+
1020
+ append(structure, element);
1021
+
1022
+ return structure;
1023
+ }
1024
+
1025
+ function wrapInner(element, structure) {
1026
+ return toNodes(
1027
+ toNodes(element).map((element) =>
1028
+ element.hasChildNodes() ?
1029
+ wrapAll(toNodes(element.childNodes), structure) :
1030
+ append(element, structure)));
1031
+
1032
+
1033
+ }
1034
+
1035
+ function unwrap(element) {
1036
+ toNodes(element).
1037
+ map(parent).
1038
+ filter((value, index, self) => self.indexOf(value) === index).
1039
+ forEach((parent) => parent.replaceWith(...parent.childNodes));
1040
+ }
1041
+
1042
+ const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
1043
+ const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
1044
+
1045
+ function fragment(html) {
1046
+ const matches = singleTagRe.exec(html);
1047
+ if (matches) {
1048
+ return document.createElement(matches[1]);
1049
+ }
1050
+
1051
+ const container = document.createElement('div');
1052
+ if (fragmentRe.test(html)) {
1053
+ container.insertAdjacentHTML('beforeend', html.trim());
1054
+ } else {
1055
+ container.textContent = html;
1056
+ }
1057
+
1058
+ return unwrapSingle(container.childNodes);
1059
+ }
1060
+
1061
+ function unwrapSingle(nodes) {
1062
+ return nodes.length > 1 ? nodes : nodes[0];
1063
+ }
1064
+
1065
+ function apply(node, fn) {
1066
+ if (!isElement(node)) {
1067
+ return;
1068
+ }
1069
+
1070
+ fn(node);
1071
+ node = node.firstElementChild;
1072
+ while (node) {
1073
+ const next = node.nextElementSibling;
1074
+ apply(node, fn);
1075
+ node = next;
1076
+ }
1077
+ }
1078
+
1079
+ function $(selector, context) {
1080
+ return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);
1081
+ }
1082
+
1083
+ function $$(selector, context) {
1084
+ return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);
1085
+ }
1086
+
1087
+ function isHtml(str) {
1088
+ return isString(str) && startsWith(str.trim(), '<');
1089
+ }
1090
+
973
1091
  const dirs$1 = {
974
1092
  width: ['left', 'right'],
975
1093
  height: ['top', 'bottom']
@@ -1137,7 +1255,7 @@
1137
1255
  if (unit) {
1138
1256
  value = percent(
1139
1257
  unit === 'vh' ?
1140
- height(toWindow(element)) :
1258
+ getViewportHeight() :
1141
1259
  unit === 'vw' ?
1142
1260
  width(toWindow(element)) :
1143
1261
  offsetDim ?
@@ -1160,122 +1278,26 @@
1160
1278
  return base * toFloat(value) / 100;
1161
1279
  }
1162
1280
 
1163
- function ready(fn) {
1164
- if (document.readyState !== 'loading') {
1165
- fn();
1166
- return;
1167
- }
1168
-
1169
- once(document, 'DOMContentLoaded', fn);
1170
- }
1171
-
1172
- function isTag(element, tagName) {var _element$tagName;
1173
- return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
1174
- }
1281
+ let vh;
1282
+ let vhEl;
1175
1283
 
1176
- function empty(element) {
1177
- element = $(element);
1178
- element.innerHTML = '';
1179
- return element;
1180
- }
1181
-
1182
- function html(parent, html) {
1183
- return isUndefined(html) ? $(parent).innerHTML : append(empty(parent), html);
1184
- }
1185
-
1186
- const prepend = applyFn('prepend');
1187
- const append = applyFn('append');
1188
- const before = applyFn('before');
1189
- const after = applyFn('after');
1190
-
1191
- function applyFn(fn) {
1192
- return function (ref, element) {var _$;
1193
- const nodes = toNodes(isString(element) ? fragment(element) : element);
1194
- (_$ = $(ref)) == null ? void 0 : _$[fn](...nodes);
1195
- return unwrapSingle(nodes);
1196
- };
1197
- }
1198
-
1199
- function remove$1(element) {
1200
- toNodes(element).forEach((element) => element.remove());
1201
- }
1202
-
1203
- function wrapAll(element, structure) {
1204
- structure = toNode(before(element, structure));
1205
-
1206
- while (structure.firstChild) {
1207
- structure = structure.firstChild;
1208
- }
1209
-
1210
- append(structure, element);
1211
-
1212
- return structure;
1213
- }
1214
-
1215
- function wrapInner(element, structure) {
1216
- return toNodes(
1217
- toNodes(element).map((element) =>
1218
- element.hasChildNodes() ?
1219
- wrapAll(toNodes(element.childNodes), structure) :
1220
- append(element, structure)));
1221
-
1222
-
1223
- }
1224
-
1225
- function unwrap(element) {
1226
- toNodes(element).
1227
- map(parent).
1228
- filter((value, index, self) => self.indexOf(value) === index).
1229
- forEach((parent) => parent.replaceWith(...parent.childNodes));
1230
- }
1231
-
1232
- const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
1233
- const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
1234
-
1235
- function fragment(html) {
1236
- const matches = singleTagRe.exec(html);
1237
- if (matches) {
1238
- return document.createElement(matches[1]);
1239
- }
1240
-
1241
- const container = document.createElement('div');
1242
- if (fragmentRe.test(html)) {
1243
- container.insertAdjacentHTML('beforeend', html.trim());
1244
- } else {
1245
- container.textContent = html;
1246
- }
1247
-
1248
- return unwrapSingle(container.childNodes);
1249
- }
1250
-
1251
- function unwrapSingle(nodes) {
1252
- return nodes.length > 1 ? nodes : nodes[0];
1253
- }
1254
-
1255
- function apply(node, fn) {
1256
- if (!isElement(node)) {
1257
- return;
1284
+ function getViewportHeight() {
1285
+ if (vh) {
1286
+ return vh;
1258
1287
  }
1259
-
1260
- fn(node);
1261
- node = node.firstElementChild;
1262
- while (node) {
1263
- const next = node.nextElementSibling;
1264
- apply(node, fn);
1265
- node = next;
1288
+ if (!vhEl) {
1289
+ vhEl = $('<div>');
1290
+ css(vhEl, {
1291
+ height: '100vh',
1292
+ position: 'fixed'
1293
+ });
1294
+ on(window, 'resize', () => vh = null);
1266
1295
  }
1267
- }
1268
1296
 
1269
- function $(selector, context) {
1270
- return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);
1271
- }
1272
-
1273
- function $$(selector, context) {
1274
- return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);
1275
- }
1276
-
1277
- function isHtml(str) {
1278
- return isString(str) && startsWith(str.trim(), '<');
1297
+ append(document.body, vhEl);
1298
+ vh = vhEl.clientHeight;
1299
+ remove$1(vhEl);
1300
+ return vh;
1279
1301
  }
1280
1302
 
1281
1303
  const inBrowser = typeof window !== 'undefined';
@@ -2956,7 +2978,7 @@
2956
2978
  UIkit.data = '__uikit__';
2957
2979
  UIkit.prefix = 'uk-';
2958
2980
  UIkit.options = {};
2959
- UIkit.version = '3.15.15-dev.cc41b76e3';
2981
+ UIkit.version = '3.15.15-dev.f41a7c271';
2960
2982
 
2961
2983
  globalAPI(UIkit);
2962
2984
  hooksAPI(UIkit);
@@ -3772,16 +3794,6 @@
3772
3794
  }
3773
3795
  };
3774
3796
 
3775
- var Style = {
3776
- beforeConnect() {
3777
- this._style = attr(this.$el, 'style');
3778
- },
3779
-
3780
- disconnected() {
3781
- attr(this.$el, 'style', this._style);
3782
- }
3783
- };
3784
-
3785
3797
  const active$1 = [];
3786
3798
 
3787
3799
  var Modal = {
@@ -4060,7 +4072,10 @@
4060
4072
 
4061
4073
  function preventOverscroll(el) {
4062
4074
  if (CSS.supports('overscroll-behavior', 'contain')) {
4063
- const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
4075
+ const elements = [
4076
+ el,
4077
+ ...filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')))];
4078
+
4064
4079
  css(elements, 'overscrollBehavior', 'contain');
4065
4080
  return () => css(elements, 'overscrollBehavior', '');
4066
4081
  }
@@ -4146,7 +4161,7 @@
4146
4161
  let active;
4147
4162
 
4148
4163
  var drop = {
4149
- mixins: [Container, Lazyload, Position, Style, Togglable],
4164
+ mixins: [Container, Lazyload, Position, Togglable],
4150
4165
 
4151
4166
  args: 'pos',
4152
4167
 
@@ -4227,6 +4242,8 @@
4227
4242
  attr(this.targetEl, 'aria-haspopup', true);
4228
4243
  this.lazyload(this.targetEl);
4229
4244
  }
4245
+
4246
+ this._style = ((_ref3) => {let { width, height } = _ref3;return { width, height };})(this.$el.style);
4230
4247
  },
4231
4248
 
4232
4249
  disconnected() {
@@ -4234,6 +4251,7 @@
4234
4251
  this.hide(false);
4235
4252
  active = null;
4236
4253
  }
4254
+ css(this.$el, this._style);
4237
4255
  },
4238
4256
 
4239
4257
  events: [
@@ -4257,7 +4275,7 @@
4257
4275
  return 'a[href*="#"]';
4258
4276
  },
4259
4277
 
4260
- handler(_ref3) {let { defaultPrevented, current } = _ref3;
4278
+ handler(_ref4) {let { defaultPrevented, current } = _ref4;
4261
4279
  const { hash } = current;
4262
4280
  if (
4263
4281
  !defaultPrevented &&
@@ -4376,12 +4394,12 @@
4376
4394
  on(
4377
4395
  document,
4378
4396
  pointerDown$1,
4379
- (_ref4) => {let { target } = _ref4;return (
4397
+ (_ref5) => {let { target } = _ref5;return (
4380
4398
  !within(target, this.$el) &&
4381
4399
  once(
4382
4400
  document,
4383
4401
  pointerUp$1 + " " + pointerCancel + " scroll",
4384
- (_ref5) => {let { defaultPrevented, type, target: newTarget } = _ref5;
4402
+ (_ref6) => {let { defaultPrevented, type, target: newTarget } = _ref6;
4385
4403
  if (
4386
4404
  !defaultPrevented &&
4387
4405
  type === pointerUp$1 &&
@@ -4443,7 +4461,7 @@
4443
4461
  {
4444
4462
  name: 'hide',
4445
4463
 
4446
- handler(_ref6) {let { target } = _ref6;
4464
+ handler(_ref7) {let { target } = _ref7;
4447
4465
  if (this.$el !== target) {
4448
4466
  active =
4449
4467
  active === null && within(target, this.$el) && this.isToggled() ?
@@ -4535,7 +4553,7 @@
4535
4553
 
4536
4554
  position() {
4537
4555
  removeClass(this.$el, this.clsDrop + "-stack");
4538
- attr(this.$el, 'style', this._style);
4556
+ css(this.$el, this._style);
4539
4557
 
4540
4558
  // Ensure none positioned element does not generate scrollbars
4541
4559
  this.$el.hidden = true;
@@ -5375,7 +5393,7 @@
5375
5393
 
5376
5394
  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>";
5377
5395
 
5378
- var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle-animate svg>[class*=line-]{transition:.2s ease-in-out;transition-property:transform,opacity,;transform-origin:center;opacity:1}.uk-navbar-toggle svg>.line-3{opacity:0}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-3{opacity:1}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-2{transform:rotate(45deg)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-3{transform:rotate(-45deg)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-1,.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-4{opacity:0}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-1{transform:translateY(6px) scaleX(0)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-4{transform:translateY(-6px) scaleX(0)}</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5396
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle-animate svg>[class*=line-]{transition:.2s ease-in-out;transition-property:transform,opacity;transform-origin:center;opacity:1}.uk-navbar-toggle svg>.line-3{opacity:0}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-3{opacity:1}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-2{transform:rotate(45deg)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-3{transform:rotate(-45deg)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-1,.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-4{opacity:0}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-1{transform:translateY(6px) scaleX(0)}.uk-navbar-toggle-animate[aria-expanded=true] svg>.line-4{transform:translateY(-6px) scaleX(0)}</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
5379
5397
 
5380
5398
  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>";
5381
5399
 
@@ -5566,8 +5584,7 @@
5566
5584
  props: {
5567
5585
  dataSrc: String,
5568
5586
  sources: String,
5569
- offsetTop: String,
5570
- offsetLeft: String,
5587
+ margin: String,
5571
5588
  target: String,
5572
5589
  loading: String
5573
5590
  },
@@ -5575,8 +5592,7 @@
5575
5592
  data: {
5576
5593
  dataSrc: '',
5577
5594
  sources: false,
5578
- offsetTop: '50vh',
5579
- offsetLeft: '50vw',
5595
+ margin: '50%',
5580
5596
  target: false,
5581
5597
  loading: 'lazy'
5582
5598
  },
@@ -5607,12 +5623,7 @@
5607
5623
  this.load();
5608
5624
  observer.disconnect();
5609
5625
  },
5610
- {
5611
- rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5612
- this.offsetLeft,
5613
- 'width') + "px"
5614
-
5615
- }));
5626
+ { rootMargin: this.margin }));
5616
5627
 
5617
5628
 
5618
5629
  },
@@ -6793,8 +6804,7 @@
6793
6804
  cls: String,
6794
6805
  target: String,
6795
6806
  hidden: Boolean,
6796
- offsetTop: Number,
6797
- offsetLeft: Number,
6807
+ margin: String,
6798
6808
  repeat: Boolean,
6799
6809
  delay: Number
6800
6810
  },
@@ -6803,8 +6813,7 @@
6803
6813
  cls: '',
6804
6814
  target: false,
6805
6815
  hidden: true,
6806
- offsetTop: 0,
6807
- offsetLeft: 0,
6816
+ margin: '-1px',
6808
6817
  repeat: false,
6809
6818
  delay: 0,
6810
6819
  inViewClass: 'uk-scrollspy-inview'
@@ -6855,11 +6864,7 @@
6855
6864
 
6856
6865
  this.$emit();
6857
6866
  },
6858
- {
6859
- rootMargin: toPx(this.offsetTop, 'height') - 1 + "px " + (
6860
- toPx(this.offsetLeft, 'width') - 1) + "px"
6861
-
6862
- },
6867
+ { rootMargin: this.margin },
6863
6868
  false));
6864
6869
 
6865
6870
 
@@ -7086,6 +7091,7 @@
7086
7091
  this.hide();
7087
7092
  removeClass(this.selTarget, this.clsInactive);
7088
7093
  }
7094
+ css(this.$el, { position: '', top: '' });
7089
7095
 
7090
7096
  remove$1(this.placeholder);
7091
7097
  this.placeholder = null;
@@ -7139,7 +7145,7 @@
7139
7145
 
7140
7146
  update: [
7141
7147
  {
7142
- read(_ref2, types) {let { height: height$1, width, margin } = _ref2;
7148
+ read(_ref2, types) {let { height: height$1, width, margin, sticky } = _ref2;
7143
7149
  this.inactive = !this.matchMedia || !isVisible(this.$el);
7144
7150
 
7145
7151
  if (this.inactive) {
@@ -7163,6 +7169,7 @@
7163
7169
  }
7164
7170
 
7165
7171
  const windowHeight = height(window);
7172
+ const maxScrollHeight = document.scrollingElement.scrollHeight - windowHeight;
7166
7173
 
7167
7174
  let position = this.position;
7168
7175
  if (this.overflowFlip && height$1 > windowHeight) {
@@ -7170,7 +7177,7 @@
7170
7177
  }
7171
7178
 
7172
7179
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
7173
- let offset$1 = toPx(this.offset, 'height', referenceElement);
7180
+ let offset$1 = toPx(this.offset, 'height', sticky ? this.$el : referenceElement);
7174
7181
  if (position === 'bottom' && (height$1 < windowHeight || this.overflowFlip)) {
7175
7182
  offset$1 += windowHeight - height$1;
7176
7183
  }
@@ -7179,6 +7186,7 @@
7179
7186
  0 :
7180
7187
  Math.max(0, height$1 + offset$1 - windowHeight);
7181
7188
  const topOffset = offset(referenceElement).top;
7189
+ const elHeight = offset(this.$el).height;
7182
7190
 
7183
7191
  const start =
7184
7192
  (this.start === false ?
@@ -7186,11 +7194,23 @@
7186
7194
  parseProp(this.start, this.$el, topOffset)) - offset$1;
7187
7195
  const end =
7188
7196
  this.end === false ?
7189
- document.scrollingElement.scrollHeight - windowHeight :
7197
+ maxScrollHeight :
7198
+ Math.min(
7199
+ maxScrollHeight,
7190
7200
  parseProp(this.end, this.$el, topOffset + height$1, true) -
7191
- offset(this.$el).height +
7192
- overflow -
7193
- offset$1;
7201
+ elHeight -
7202
+ offset$1 +
7203
+ overflow);
7204
+
7205
+
7206
+ sticky =
7207
+ !this.showOnUp &&
7208
+ start + offset$1 === topOffset &&
7209
+ end ===
7210
+ Math.min(
7211
+ maxScrollHeight,
7212
+ parseProp('!*', this.$el, 0, true) - elHeight - offset$1 + overflow);
7213
+
7194
7214
 
7195
7215
  return {
7196
7216
  start,
@@ -7201,19 +7221,24 @@
7201
7221
  height: height$1,
7202
7222
  width,
7203
7223
  margin,
7204
- top: offsetPosition(referenceElement)[0]
7224
+ top: offsetPosition(referenceElement)[0],
7225
+ sticky
7205
7226
  };
7206
7227
  },
7207
7228
 
7208
- write(_ref3) {let { height, width, margin } = _ref3;
7229
+ write(_ref3) {let { height, width, margin, offset, sticky } = _ref3;
7230
+ if (sticky) {
7231
+ height = width = margin = 0;
7232
+ css(this.$el, { position: 'sticky', top: offset });
7233
+ }
7209
7234
  const { placeholder } = this;
7210
7235
 
7211
7236
  css(placeholder, { height, width, margin });
7212
7237
 
7213
7238
  if (!within(placeholder, document)) {
7214
- after(this.$el, placeholder);
7215
7239
  placeholder.hidden = true;
7216
7240
  }
7241
+ (sticky ? before : after)(this.$el, placeholder);
7217
7242
  },
7218
7243
 
7219
7244
  events: ['resize']
@@ -7330,9 +7355,19 @@
7330
7355
  },
7331
7356
 
7332
7357
  hide() {
7358
+ const { offset, sticky } = this._data;
7333
7359
  this.setActive(false);
7334
7360
  removeClass(this.$el, this.clsFixed, this.clsBelow);
7335
- css(this.$el, { position: '', top: '', width: '' });
7361
+ if (sticky) {
7362
+ css(this.$el, 'top', offset);
7363
+ } else {
7364
+ css(this.$el, {
7365
+ position: '',
7366
+ top: '',
7367
+ width: '',
7368
+ marginTop: ''
7369
+ });
7370
+ }
7336
7371
  this.placeholder.hidden = true;
7337
7372
  this.isFixed = false;
7338
7373
  },
@@ -7348,25 +7383,31 @@
7348
7383
  offset,
7349
7384
  topOffset,
7350
7385
  height,
7351
- offsetParentTop
7386
+ offsetParentTop,
7387
+ sticky
7352
7388
  } = this._data;
7353
7389
  const active = start !== 0 || scroll > start;
7354
- let position = 'fixed';
7355
7390
 
7356
- if (scroll > end) {
7357
- offset += end - offsetParentTop;
7358
- position = 'absolute';
7391
+ if (!sticky) {
7392
+ let position = 'fixed';
7393
+
7394
+ if (scroll > end) {
7395
+ offset += end - offsetParentTop;
7396
+ position = 'absolute';
7397
+ }
7398
+
7399
+ css(this.$el, {
7400
+ position,
7401
+ width
7402
+ });
7403
+ css(this.$el, 'marginTop', 0, 'important');
7359
7404
  }
7360
7405
 
7361
7406
  if (overflow) {
7362
7407
  offset -= overflowScroll;
7363
7408
  }
7364
7409
 
7365
- css(this.$el, {
7366
- position,
7367
- top: offset + "px",
7368
- width
7369
- });
7410
+ css(this.$el, 'top', offset);
7370
7411
 
7371
7412
  this.setActive(active);
7372
7413
  toggleClass(this.$el, this.clsBelow, scroll > topOffset + height);
@@ -10130,12 +10171,20 @@
10130
10171
  }
10131
10172
  },
10132
10173
 
10174
+ resizeTargets() {
10175
+ return [this.$el, this.target];
10176
+ },
10177
+
10133
10178
  update: {
10134
10179
  read(_ref4, types) {let { percent } = _ref4;
10135
10180
  if (!types.has('scroll')) {
10136
10181
  percent = false;
10137
10182
  }
10138
10183
 
10184
+ if (!isVisible(this.$el)) {
10185
+ return false;
10186
+ }
10187
+
10139
10188
  if (!this.matchMedia) {
10140
10189
  return;
10141
10190
  }