uikit 3.20.9-dev.50e5c71c4 → 3.20.9-dev.976ee5848

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 (49) 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 +5 -2
  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 +4 -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 +34 -22
  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 +46 -28
  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/inverse.js +30 -3
  47. package/src/js/core/modal.js +1 -1
  48. package/src/js/mixin/internal/slideshow-transitioner.js +4 -0
  49. 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.976ee5848 | 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);
@@ -1611,7 +1611,7 @@
1611
1611
  isTouch: isTouch,
1612
1612
  isUndefined: isUndefined,
1613
1613
  isVideo: isVideo,
1614
- isVisible: isVisible,
1614
+ isVisible: isVisible$1,
1615
1615
  isVoidElement: isVoidElement,
1616
1616
  isWindow: isWindow,
1617
1617
  last: last,
@@ -2065,7 +2065,7 @@
2065
2065
  (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent
2066
2066
  );
2067
2067
  for (const el of elements) {
2068
- if (!isVisible(el)) {
2068
+ if (!isVisible$1(el)) {
2069
2069
  continue;
2070
2070
  }
2071
2071
  const offset = getOffset(el, withOffset);
@@ -2149,7 +2149,7 @@
2149
2149
  }
2150
2150
  function getProps$1(el, opacity) {
2151
2151
  const zIndex = css(el, "zIndex");
2152
- return isVisible(el) ? {
2152
+ return isVisible$1(el) ? {
2153
2153
  display: "",
2154
2154
  opacity: opacity ? css(el, "opacity") : "0",
2155
2155
  pointerEvents: "none",
@@ -2160,7 +2160,7 @@
2160
2160
  }
2161
2161
  function getTransitionProps(target, nodes, currentProps) {
2162
2162
  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
2163
+ (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible$1(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible$1(el) ? 1 : 0 } : false
2164
2164
  );
2165
2165
  const propsFrom = propsTo.map((props, i) => {
2166
2166
  const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));
@@ -2274,7 +2274,7 @@
2274
2274
  );
2275
2275
  }
2276
2276
  function getTransitionNodes(target) {
2277
- return getRows(children(target)).flat().filter(isVisible);
2277
+ return getRows(children(target)).flat().filter(isVisible$1);
2278
2278
  }
2279
2279
  function awaitTimeout(timeout) {
2280
2280
  return new Promise((resolve) => setTimeout(resolve, timeout));
@@ -2572,7 +2572,7 @@
2572
2572
  },
2573
2573
  isToggled(el = this.$el) {
2574
2574
  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);
2575
+ return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(" ")[0]) : isVisible$1(el);
2576
2576
  },
2577
2577
  _toggle(el, toggled) {
2578
2578
  if (!el) {
@@ -2587,7 +2587,7 @@
2587
2587
  changed = toggled === el.hidden;
2588
2588
  changed && (el.hidden = !toggled);
2589
2589
  }
2590
- $$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
2590
+ $$("[autofocus]", el).some((el2) => isVisible$1(el2) ? el2.focus() || true : el2.blur());
2591
2591
  if (changed) {
2592
2592
  trigger(el, "toggled", [toggled, this]);
2593
2593
  }
@@ -2974,6 +2974,9 @@
2974
2974
  return this.show(duration, percent2, true);
2975
2975
  },
2976
2976
  translate(percent2) {
2977
+ if (percent2 === this.percent()) {
2978
+ return;
2979
+ }
2977
2980
  this.reset();
2978
2981
  const props2 = translate(percent2, dir);
2979
2982
  css(next, props2[1]);
@@ -3555,7 +3558,7 @@
3555
3558
  };
3556
3559
  App.util = util;
3557
3560
  App.options = {};
3558
- App.version = "3.20.9-dev.50e5c71c4";
3561
+ App.version = "3.20.9-dev.976ee5848";
3559
3562
 
3560
3563
  const PREFIX = "uk-";
3561
3564
  const DATA = "__uikit__";
@@ -3610,7 +3613,7 @@
3610
3613
  function detachFromElement(element, instance) {
3611
3614
  var _a;
3612
3615
  (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];
3613
- if (!isEmpty(element[DATA])) {
3616
+ if (isEmpty(element[DATA])) {
3614
3617
  delete element[DATA];
3615
3618
  }
3616
3619
  }
@@ -4557,7 +4560,7 @@
4557
4560
  }
4558
4561
 
4559
4562
  function getMaxPathLength(el) {
4560
- return isVisible(el) ? Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => stroke.getTotalLength()))) : 0;
4563
+ return isVisible$1(el) ? Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => stroke.getTotalLength()))) : 0;
4561
4564
  }
4562
4565
 
4563
4566
  const props = {
@@ -4904,7 +4907,7 @@
4904
4907
  if (!types.has("scroll")) {
4905
4908
  percent = false;
4906
4909
  }
4907
- if (!isVisible(this.$el)) {
4910
+ if (!isVisible$1(this.$el)) {
4908
4911
  return false;
4909
4912
  }
4910
4913
  if (!this.matchMedia) {
@@ -5107,6 +5110,9 @@
5107
5110
  return this.show(duration, percent, true);
5108
5111
  },
5109
5112
  translate(percent) {
5113
+ if (percent === this.percent()) {
5114
+ return;
5115
+ }
5110
5116
  const distance = this.getDistance() * dir * (isRtl ? -1 : 1);
5111
5117
  css(
5112
5118
  list,
@@ -5259,7 +5265,7 @@
5259
5265
  };
5260
5266
  },
5261
5267
  slides() {
5262
- return children(this.list).filter(isVisible);
5268
+ return children(this.list).filter(isVisible$1);
5263
5269
  }
5264
5270
  },
5265
5271
  connected() {
@@ -5325,7 +5331,7 @@
5325
5331
  this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : ""
5326
5332
  )
5327
5333
  );
5328
- if (!this.center) {
5334
+ if (!this.center || !this.length) {
5329
5335
  return;
5330
5336
  }
5331
5337
  const next = this.slides[index];
@@ -7766,7 +7772,7 @@
7766
7772
  }
7767
7773
  function getHeight(element) {
7768
7774
  const style = pick(element.style, ["display", "minHeight"]);
7769
- if (!isVisible(element)) {
7775
+ if (!isVisible$1(element)) {
7770
7776
  css(element, "display", "block", "important");
7771
7777
  }
7772
7778
  css(element, "minHeight", "");
@@ -7821,7 +7827,7 @@
7821
7827
  ],
7822
7828
  update: {
7823
7829
  read() {
7824
- if (!isVisible(this.$el)) {
7830
+ if (!isVisible$1(this.$el)) {
7825
7831
  return false;
7826
7832
  }
7827
7833
  let minHeight = "";
@@ -8347,11 +8353,11 @@
8347
8353
  let last;
8348
8354
  for (const percent of [0.25, 0.5, 0.75]) {
8349
8355
  const elements = target.ownerDocument.elementsFromPoint(
8350
- Math.max(0, left) + width * percent,
8351
- Math.max(0, top) + height / 2
8356
+ Math.max(0, left + width * percent),
8357
+ Math.max(0, top + height / 2)
8352
8358
  );
8353
8359
  for (const element of elements) {
8354
- if (target.contains(element) || element.closest('[class*="-leave"]') && elements.some((el) => element !== el && matches(el, '[class*="-enter"]'))) {
8360
+ if (target.contains(element) || !isVisible(element) || element.closest('[class*="-leave"]') && elements.some((el) => element !== el && matches(el, '[class*="-enter"]'))) {
8355
8361
  continue;
8356
8362
  }
8357
8363
  const color = css(element, "--uk-inverse");
@@ -8366,6 +8372,18 @@
8366
8372
  }
8367
8373
  return last ? `uk-${last}` : "";
8368
8374
  }
8375
+ function isVisible(element) {
8376
+ if (css(element, "visibility") !== "visible") {
8377
+ return false;
8378
+ }
8379
+ while (element) {
8380
+ if (css(element, "opacity") === "0") {
8381
+ return false;
8382
+ }
8383
+ element = parent(element);
8384
+ }
8385
+ return true;
8386
+ }
8369
8387
 
8370
8388
  var leader = {
8371
8389
  mixins: [Class, Media],
@@ -8479,7 +8497,7 @@
8479
8497
  };
8480
8498
  modal.prompt = function(message, value, options) {
8481
8499
  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>`,
8500
+ ({ 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
8501
  options,
8484
8502
  () => null,
8485
8503
  () => input.value
@@ -8639,7 +8657,7 @@
8639
8657
  observe: swipe({ filter: ({ swiping }) => swiping }),
8640
8658
  update: {
8641
8659
  read() {
8642
- if (this.isToggled() && !isVisible(this.$el)) {
8660
+ if (this.isToggled() && !isVisible$1(this.$el)) {
8643
8661
  this.hide();
8644
8662
  }
8645
8663
  },
@@ -8746,7 +8764,7 @@
8746
8764
  }),
8747
8765
  update: {
8748
8766
  read() {
8749
- if (!this.content || !this.container || !isVisible(this.$el)) {
8767
+ if (!this.content || !this.container || !isVisible$1(this.$el)) {
8750
8768
  return false;
8751
8769
  }
8752
8770
  return {
@@ -8962,7 +8980,7 @@
8962
8980
  read() {
8963
8981
  const targets = this.links.map(getTargetedElement).filter(Boolean);
8964
8982
  const { length } = targets;
8965
- if (!length || !isVisible(this.$el)) {
8983
+ if (!length || !isVisible$1(this.$el)) {
8966
8984
  return false;
8967
8985
  }
8968
8986
  const scrollElement = scrollParent(targets, true);
@@ -9107,7 +9125,7 @@
9107
9125
  update: [
9108
9126
  {
9109
9127
  read({ height: height$1, width, margin, sticky }) {
9110
- this.inactive = !this.matchMedia || !isVisible(this.$el);
9128
+ this.inactive = !this.matchMedia || !isVisible$1(this.$el);
9111
9129
  if (this.inactive) {
9112
9130
  return;
9113
9131
  }