uikit 3.20.9-dev.50e5c71c4 → 3.20.9-dev.76ecfef9e

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 (55) hide show
  1. package/CHANGELOG.md +2 -0
  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 +4 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +4 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +11 -5
  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 +10 -4
  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 +63 -62
  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 +81 -71
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/component.js +1 -1
  44. package/src/js/components/internal/slider-transitioner.js +4 -0
  45. package/src/js/components/slider.js +1 -1
  46. package/src/js/core/grid.js +4 -7
  47. package/src/js/core/inverse.js +30 -3
  48. package/src/js/core/modal.js +1 -1
  49. package/src/js/core/scrollspy-nav.js +2 -2
  50. package/src/js/core/scrollspy.js +1 -1
  51. package/src/js/core/sticky.js +16 -22
  52. package/src/js/mixin/internal/slideshow-transitioner.js +4 -0
  53. package/src/js/mixin/slider-parallax.js +7 -3
  54. package/src/js/util/viewport.js +8 -8
  55. package/tests/modal.html +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.20.9-dev.50e5c71c4 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.20.9-dev.76ecfef9e | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -310,7 +310,7 @@
310
310
  const isVisibleFn = inBrowser && Element.prototype.checkVisibility || function() {
311
311
  return this.offsetWidth || this.offsetHeight || this.getClientRects().length;
312
312
  };
313
- function isVisible(element) {
313
+ function isVisible$1(element) {
314
314
  return toNodes(element).some((element2) => isVisibleFn.call(element2));
315
315
  }
316
316
  const selInput = "input,select,textarea,button";
@@ -1199,7 +1199,7 @@
1199
1199
  }
1200
1200
 
1201
1201
  function isInView(element, offsetTop = 0, offsetLeft = 0) {
1202
- if (!isVisible(element)) {
1202
+ if (!isVisible$1(element)) {
1203
1203
  return false;
1204
1204
  }
1205
1205
  return intersectRect(
@@ -1215,7 +1215,7 @@
1215
1215
  );
1216
1216
  }
1217
1217
  function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
1218
- const parents2 = isVisible(element) ? scrollParents(element, false, ["hidden"]) : [];
1218
+ const parents2 = isVisible$1(element) ? scrollParents(element, false, ["hidden"]) : [];
1219
1219
  return parents2.reduce(
1220
1220
  (fn, scrollElement, i) => {
1221
1221
  const { scrollTop, scrollHeight, offsetHeight } = scrollElement;
@@ -1274,7 +1274,7 @@
1274
1274
  }
1275
1275
  }
1276
1276
  function scrolledOver(element, startOffset = 0, endOffset = 0) {
1277
- if (!isVisible(element)) {
1277
+ if (!isVisible$1(element)) {
1278
1278
  return 0;
1279
1279
  }
1280
1280
  const scrollElement = scrollParent(element, true);
@@ -1324,7 +1324,7 @@
1324
1324
  ["height", "y", "top", "bottom"]
1325
1325
  ]) {
1326
1326
  if (isWindow(viewportElement)) {
1327
- viewportElement = scrollElement.ownerDocument;
1327
+ viewportElement = viewportElement.document;
1328
1328
  } else {
1329
1329
  rect[start] += toFloat(css(viewportElement, `border-${start}-width`));
1330
1330
  }
@@ -1336,17 +1336,16 @@
1336
1336
  }
1337
1337
  function getCoveringElement(target) {
1338
1338
  const { left, width, top } = dimensions$1(target);
1339
- for (const topPosition of [0, top]) {
1340
- const coverEl = target.ownerDocument.elementsFromPoint(left + width / 2, topPosition).find(
1341
- (el) => !el.contains(target) && // If e.g. Offcanvas is not yet closed
1339
+ for (const position of top ? [0, top] : [0]) {
1340
+ for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {
1341
+ if (!el.contains(target) && // If e.g. Offcanvas is not yet closed
1342
1342
  !hasClass(el, "uk-togglable-leave") && (hasPosition(el, "fixed") && zIndex(
1343
1343
  parents(target).reverse().find(
1344
1344
  (parent2) => !parent2.contains(el) && !hasPosition(parent2, "static")
1345
1345
  )
1346
- ) < zIndex(el) || hasPosition(el, "sticky") && parent(el).contains(target))
1347
- );
1348
- if (coverEl) {
1349
- return coverEl;
1346
+ ) < zIndex(el) || hasPosition(el, "sticky") && parent(el).contains(target))) {
1347
+ return el;
1348
+ }
1350
1349
  }
1351
1350
  }
1352
1351
  }
@@ -1611,7 +1610,7 @@
1611
1610
  isTouch: isTouch,
1612
1611
  isUndefined: isUndefined,
1613
1612
  isVideo: isVideo,
1614
- isVisible: isVisible,
1613
+ isVisible: isVisible$1,
1615
1614
  isVoidElement: isVoidElement,
1616
1615
  isWindow: isWindow,
1617
1616
  last: last,
@@ -2065,7 +2064,7 @@
2065
2064
  (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent
2066
2065
  );
2067
2066
  for (const el of elements) {
2068
- if (!isVisible(el)) {
2067
+ if (!isVisible$1(el)) {
2069
2068
  continue;
2070
2069
  }
2071
2070
  const offset = getOffset(el, withOffset);
@@ -2149,7 +2148,7 @@
2149
2148
  }
2150
2149
  function getProps$1(el, opacity) {
2151
2150
  const zIndex = css(el, "zIndex");
2152
- return isVisible(el) ? {
2151
+ return isVisible$1(el) ? {
2153
2152
  display: "",
2154
2153
  opacity: opacity ? css(el, "opacity") : "0",
2155
2154
  pointerEvents: "none",
@@ -2160,7 +2159,7 @@
2160
2159
  }
2161
2160
  function getTransitionProps(target, nodes, currentProps) {
2162
2161
  const propsTo = nodes.map(
2163
- (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible(el) ? 1 : 0 } : false
2162
+ (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible$1(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible$1(el) ? 1 : 0 } : false
2164
2163
  );
2165
2164
  const propsFrom = propsTo.map((props, i) => {
2166
2165
  const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));
@@ -2274,7 +2273,7 @@
2274
2273
  );
2275
2274
  }
2276
2275
  function getTransitionNodes(target) {
2277
- return getRows(children(target)).flat().filter(isVisible);
2276
+ return getRows(children(target)).flat().filter(isVisible$1);
2278
2277
  }
2279
2278
  function awaitTimeout(timeout) {
2280
2279
  return new Promise((resolve) => setTimeout(resolve, timeout));
@@ -2572,7 +2571,7 @@
2572
2571
  },
2573
2572
  isToggled(el = this.$el) {
2574
2573
  el = toNode(el);
2575
- return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(" ")[0]) : isVisible(el);
2574
+ return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(" ")[0]) : isVisible$1(el);
2576
2575
  },
2577
2576
  _toggle(el, toggled) {
2578
2577
  if (!el) {
@@ -2587,7 +2586,7 @@
2587
2586
  changed = toggled === el.hidden;
2588
2587
  changed && (el.hidden = !toggled);
2589
2588
  }
2590
- $$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
2589
+ $$("[autofocus]", el).some((el2) => isVisible$1(el2) ? el2.focus() || true : el2.blur());
2591
2590
  if (changed) {
2592
2591
  trigger(el, "toggled", [toggled, this]);
2593
2592
  }
@@ -2974,6 +2973,9 @@
2974
2973
  return this.show(duration, percent2, true);
2975
2974
  },
2976
2975
  translate(percent2) {
2976
+ if (percent2 === this.percent()) {
2977
+ return;
2978
+ }
2977
2979
  this.reset();
2978
2980
  const props2 = translate(percent2, dir);
2979
2981
  css(next, props2[1]);
@@ -3555,7 +3557,7 @@
3555
3557
  };
3556
3558
  App.util = util;
3557
3559
  App.options = {};
3558
- App.version = "3.20.9-dev.50e5c71c4";
3560
+ App.version = "3.20.9-dev.76ecfef9e";
3559
3561
 
3560
3562
  const PREFIX = "uk-";
3561
3563
  const DATA = "__uikit__";
@@ -3610,7 +3612,7 @@
3610
3612
  function detachFromElement(element, instance) {
3611
3613
  var _a;
3612
3614
  (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];
3613
- if (!isEmpty(element[DATA])) {
3615
+ if (isEmpty(element[DATA])) {
3614
3616
  delete element[DATA];
3615
3617
  }
3616
3618
  }
@@ -4557,7 +4559,7 @@
4557
4559
  }
4558
4560
 
4559
4561
  function getMaxPathLength(el) {
4560
- return isVisible(el) ? Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => stroke.getTotalLength()))) : 0;
4562
+ return isVisible$1(el) ? Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => stroke.getTotalLength()))) : 0;
4561
4563
  }
4562
4564
 
4563
4565
  const props = {
@@ -4904,7 +4906,7 @@
4904
4906
  if (!types.has("scroll")) {
4905
4907
  percent = false;
4906
4908
  }
4907
- if (!isVisible(this.$el)) {
4909
+ if (!isVisible$1(this.$el)) {
4908
4910
  return false;
4909
4911
  }
4910
4912
  if (!this.matchMedia) {
@@ -4959,15 +4961,18 @@
4959
4961
  }
4960
4962
  },
4961
4963
  update: {
4962
- write() {
4964
+ read() {
4963
4965
  if (!this.parallax) {
4964
- return;
4966
+ return false;
4965
4967
  }
4966
4968
  const target = this.parallaxTarget;
4967
4969
  const start = toPx(this.parallaxStart, "height", target, true);
4968
4970
  const end = toPx(this.parallaxEnd, "height", target, true);
4969
4971
  const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
4970
- const [prevIndex, slidePercent] = this.getIndexAt(percent);
4972
+ return { parallax: this.getIndexAt(percent) };
4973
+ },
4974
+ write({ parallax }) {
4975
+ const [prevIndex, slidePercent] = parallax;
4971
4976
  const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));
4972
4977
  const prev = this.slides[prevIndex];
4973
4978
  const next = this.slides[nextIndex];
@@ -5107,6 +5112,9 @@
5107
5112
  return this.show(duration, percent, true);
5108
5113
  },
5109
5114
  translate(percent) {
5115
+ if (percent === this.percent()) {
5116
+ return;
5117
+ }
5110
5118
  const distance = this.getDistance() * dir * (isRtl ? -1 : 1);
5111
5119
  css(
5112
5120
  list,
@@ -5259,7 +5267,7 @@
5259
5267
  };
5260
5268
  },
5261
5269
  slides() {
5262
- return children(this.list).filter(isVisible);
5270
+ return children(this.list).filter(isVisible$1);
5263
5271
  }
5264
5272
  },
5265
5273
  connected() {
@@ -5325,7 +5333,7 @@
5325
5333
  this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : ""
5326
5334
  )
5327
5335
  );
5328
- if (!this.center) {
5336
+ if (!this.center || !this.length) {
5329
5337
  return;
5330
5338
  }
5331
5339
  const next = this.slides[index];
@@ -7640,11 +7648,8 @@
7640
7648
  },
7641
7649
  {
7642
7650
  read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {
7643
- if (scrollColumns && positionedAbsolute(rows)) {
7644
- return false;
7645
- }
7646
7651
  return {
7647
- scrolled: scrollColumns ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false
7652
+ scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false
7648
7653
  };
7649
7654
  },
7650
7655
  write({ columns, scrolled, scrollColumns, translates }) {
@@ -7766,7 +7771,7 @@
7766
7771
  }
7767
7772
  function getHeight(element) {
7768
7773
  const style = pick(element.style, ["display", "minHeight"]);
7769
- if (!isVisible(element)) {
7774
+ if (!isVisible$1(element)) {
7770
7775
  css(element, "display", "block", "important");
7771
7776
  }
7772
7777
  css(element, "minHeight", "");
@@ -7821,7 +7826,7 @@
7821
7826
  ],
7822
7827
  update: {
7823
7828
  read() {
7824
- if (!isVisible(this.$el)) {
7829
+ if (!isVisible$1(this.$el)) {
7825
7830
  return false;
7826
7831
  }
7827
7832
  let minHeight = "";
@@ -8347,11 +8352,11 @@
8347
8352
  let last;
8348
8353
  for (const percent of [0.25, 0.5, 0.75]) {
8349
8354
  const elements = target.ownerDocument.elementsFromPoint(
8350
- Math.max(0, left) + width * percent,
8351
- Math.max(0, top) + height / 2
8355
+ Math.max(0, left + width * percent),
8356
+ Math.max(0, top + height / 2)
8352
8357
  );
8353
8358
  for (const element of elements) {
8354
- if (target.contains(element) || element.closest('[class*="-leave"]') && elements.some((el) => element !== el && matches(el, '[class*="-enter"]'))) {
8359
+ if (target.contains(element) || !isVisible(element) || element.closest('[class*="-leave"]') && elements.some((el) => element !== el && matches(el, '[class*="-enter"]'))) {
8355
8360
  continue;
8356
8361
  }
8357
8362
  const color = css(element, "--uk-inverse");
@@ -8366,6 +8371,18 @@
8366
8371
  }
8367
8372
  return last ? `uk-${last}` : "";
8368
8373
  }
8374
+ function isVisible(element) {
8375
+ if (css(element, "visibility") !== "visible") {
8376
+ return false;
8377
+ }
8378
+ while (element) {
8379
+ if (css(element, "opacity") === "0") {
8380
+ return false;
8381
+ }
8382
+ element = parent(element);
8383
+ }
8384
+ return true;
8385
+ }
8369
8386
 
8370
8387
  var leader = {
8371
8388
  mixins: [Class, Media],
@@ -8479,7 +8496,7 @@
8479
8496
  };
8480
8497
  modal.prompt = function(message, value, options) {
8481
8498
  const promise = openDialog(
8482
- ({ i18n }) => `<form class="uk-form-stacked"> <div class="uk-modal-body"> <label>${isString(message) ? message : html(message)}</label> <input class="uk-input" value="" autofocus> </div> <div class="uk-modal-footer uk-text-right"> <button class="uk-button uk-button-default uk-modal-close" type="button">${i18n.cancel}</button> <button class="uk-button uk-button-primary">${i18n.ok}</button> </div> </form>`,
8499
+ ({ i18n }) => `<form class="uk-form-stacked"> <div class="uk-modal-body"> <label>${isString(message) ? message : html(message)}</label> <input class="uk-input" autofocus> </div> <div class="uk-modal-footer uk-text-right"> <button class="uk-button uk-button-default uk-modal-close" type="button">${i18n.cancel}</button> <button class="uk-button uk-button-primary">${i18n.ok}</button> </div> </form>`,
8483
8500
  options,
8484
8501
  () => null,
8485
8502
  () => input.value
@@ -8639,7 +8656,7 @@
8639
8656
  observe: swipe({ filter: ({ swiping }) => swiping }),
8640
8657
  update: {
8641
8658
  read() {
8642
- if (this.isToggled() && !isVisible(this.$el)) {
8659
+ if (this.isToggled() && !isVisible$1(this.$el)) {
8643
8660
  this.hide();
8644
8661
  }
8645
8662
  },
@@ -8746,7 +8763,7 @@
8746
8763
  }),
8747
8764
  update: {
8748
8765
  read() {
8749
- if (!this.content || !this.container || !isVisible(this.$el)) {
8766
+ if (!this.content || !this.container || !isVisible$1(this.$el)) {
8750
8767
  return false;
8751
8768
  }
8752
8769
  return {
@@ -8903,12 +8920,12 @@
8903
8920
  ],
8904
8921
  methods: {
8905
8922
  toggle(el, inview) {
8906
- var _a;
8907
- const state = this.elementData.get(el);
8923
+ var _a, _b;
8924
+ const state = (_a = this.elementData) == null ? void 0 : _a.get(el);
8908
8925
  if (!state) {
8909
8926
  return;
8910
8927
  }
8911
- (_a = state.off) == null ? void 0 : _a.call(state);
8928
+ (_b = state.off) == null ? void 0 : _b.call(state);
8912
8929
  css(el, "opacity", !inview && this.hidden ? 0 : "");
8913
8930
  toggleClass(el, this.inViewClass, inview);
8914
8931
  toggleClass(el, state.cls);
@@ -8962,7 +8979,7 @@
8962
8979
  read() {
8963
8980
  const targets = this.links.map(getTargetedElement).filter(Boolean);
8964
8981
  const { length } = targets;
8965
- if (!length || !isVisible(this.$el)) {
8982
+ if (!length || !isVisible$1(this.$el)) {
8966
8983
  return false;
8967
8984
  }
8968
8985
  const scrollElement = scrollParent(targets, true);
@@ -8973,9 +8990,8 @@
8973
8990
  if (scrollTop === max) {
8974
8991
  active = length - 1;
8975
8992
  } else {
8993
+ const offsetBy = this.offset + offset(getCoveringElement()).height;
8976
8994
  for (let i = 0; i < targets.length; i++) {
8977
- const fixedEl = getCoveringElement(targets[i]);
8978
- const offsetBy = this.offset + (fixedEl ? offset(fixedEl).height : 0);
8979
8995
  if (offset(targets[i]).top - viewport.top - offsetBy > 0) {
8980
8996
  break;
8981
8997
  }
@@ -9058,15 +9074,17 @@
9058
9074
  this.placeholder = null;
9059
9075
  },
9060
9076
  observe: [
9061
- viewport({
9062
- handler() {
9063
- if (toPx("100vh", "height") !== this._data.viewport) {
9064
- this.$emit("resize");
9065
- }
9066
- }
9067
- }),
9077
+ viewport(),
9068
9078
  scroll$1({ target: () => document.scrollingElement }),
9069
- resize({ target: ({ $el }) => [$el, document.scrollingElement] })
9079
+ resize({
9080
+ target: ({ $el }) => [$el, parent($el), document.scrollingElement],
9081
+ handler(entries) {
9082
+ this.$emit(
9083
+ this._data.resized && entries.some(({ target }) => target === parent(this.$el)) ? "update" : "resize"
9084
+ );
9085
+ this._data.resized = true;
9086
+ }
9087
+ })
9070
9088
  ],
9071
9089
  events: [
9072
9090
  {
@@ -9092,26 +9110,16 @@
9092
9110
  }
9093
9111
  });
9094
9112
  }
9095
- },
9096
- {
9097
- name: "transitionstart",
9098
- handler() {
9099
- this.transitionInProgress = once(
9100
- this.$el,
9101
- "transitionend transitioncancel",
9102
- () => this.transitionInProgress = null
9103
- );
9104
- }
9105
9113
  }
9106
9114
  ],
9107
9115
  update: [
9108
9116
  {
9109
- read({ height: height$1, width, margin, sticky }) {
9110
- this.inactive = !this.matchMedia || !isVisible(this.$el);
9117
+ read({ height: height$1, width, margin, sticky }, types) {
9118
+ this.inactive = !this.matchMedia || !isVisible$1(this.$el);
9111
9119
  if (this.inactive) {
9112
9120
  return;
9113
9121
  }
9114
- const hide = this.isFixed && !this.transitionInProgress;
9122
+ const hide = this.isFixed && types.has("update");
9115
9123
  if (hide) {
9116
9124
  preventTransition(this.target);
9117
9125
  this.hide();
@@ -9161,7 +9169,8 @@
9161
9169
  margin,
9162
9170
  top: offsetPosition(referenceElement)[0],
9163
9171
  sticky,
9164
- viewport: viewport2
9172
+ viewport: viewport2,
9173
+ maxScrollHeight
9165
9174
  };
9166
9175
  },
9167
9176
  write({ height, width, margin, offset, sticky }) {
@@ -9194,9 +9203,10 @@
9194
9203
  end,
9195
9204
  elHeight,
9196
9205
  height,
9197
- sticky
9206
+ sticky,
9207
+ maxScrollHeight
9198
9208
  }) {
9199
- const scroll2 = document.scrollingElement.scrollTop;
9209
+ const scroll2 = Math.min(document.scrollingElement.scrollTop, maxScrollHeight);
9200
9210
  const dir = prevScroll <= scroll2 ? "down" : "up";
9201
9211
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
9202
9212
  return {