uikit 3.20.9-dev.e2e1b058d → 3.20.10-dev.8e8f67f8b

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 (51) hide show
  1. package/CHANGELOG.md +10 -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 +2 -3
  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 +3 -3
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +3 -3
  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 -3
  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 +3 -3
  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 +4 -3
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +71 -73
  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 +79 -79
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/countdown.js +1 -3
  44. package/src/js/components/internal/slider-transitioner.js +6 -0
  45. package/src/js/components/upload.js +3 -4
  46. package/src/js/core/inverse.js +14 -6
  47. package/src/js/core/scrollspy.js +8 -7
  48. package/src/js/mixin/slider.js +2 -2
  49. package/src/js/mixin/togglable.js +1 -5
  50. package/src/js/util/animation.js +20 -19
  51. package/src/js/util/class.js +1 -8
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.20.9-dev.e2e1b058d | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.20.10-dev.8e8f67f8b | 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() :
@@ -192,43 +192,6 @@
192
192
  return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));
193
193
  }
194
194
 
195
- function attr(element, name, value) {
196
- var _a;
197
- if (isObject(name)) {
198
- for (const key in name) {
199
- attr(element, key, name[key]);
200
- }
201
- return;
202
- }
203
- if (isUndefined(value)) {
204
- return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);
205
- } else {
206
- for (const el of toNodes(element)) {
207
- if (isFunction(value)) {
208
- value = value.call(el, attr(el, name));
209
- }
210
- if (value === null) {
211
- removeAttr(el, name);
212
- } else {
213
- el.setAttribute(name, value);
214
- }
215
- }
216
- }
217
- }
218
- function hasAttr(element, name) {
219
- return toNodes(element).some((element2) => element2.hasAttribute(name));
220
- }
221
- function removeAttr(element, name) {
222
- toNodes(element).forEach((element2) => element2.removeAttribute(name));
223
- }
224
- function data(element, attribute) {
225
- for (const name of [attribute, `data-${attribute}`]) {
226
- if (hasAttr(element, name)) {
227
- return attr(element, name);
228
- }
229
- }
230
- }
231
-
232
195
  function addClass(element, ...classes) {
233
196
  for (const node of toNodes(element)) {
234
197
  const add = toClasses(classes).filter((cls) => !hasClass(node, cls));
@@ -245,12 +208,6 @@
245
208
  }
246
209
  }
247
210
  }
248
- function removeClasses(element, clsRegex) {
249
- clsRegex = new RegExp(clsRegex);
250
- for (const node of toNodes(element)) {
251
- node.classList.remove(...toArray(node.classList).filter((cls) => cls.match(clsRegex)));
252
- }
253
- }
254
211
  function replaceClass(element, oldClass, newClass) {
255
212
  newClass = toClasses(newClass);
256
213
  oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));
@@ -276,6 +233,43 @@
276
233
  return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(" ").filter(Boolean) : [];
277
234
  }
278
235
 
236
+ function attr(element, name, value) {
237
+ var _a;
238
+ if (isObject(name)) {
239
+ for (const key in name) {
240
+ attr(element, key, name[key]);
241
+ }
242
+ return;
243
+ }
244
+ if (isUndefined(value)) {
245
+ return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);
246
+ } else {
247
+ for (const el of toNodes(element)) {
248
+ if (isFunction(value)) {
249
+ value = value.call(el, attr(el, name));
250
+ }
251
+ if (value === null) {
252
+ removeAttr(el, name);
253
+ } else {
254
+ el.setAttribute(name, value);
255
+ }
256
+ }
257
+ }
258
+ }
259
+ function hasAttr(element, name) {
260
+ return toNodes(element).some((element2) => element2.hasAttribute(name));
261
+ }
262
+ function removeAttr(element, name) {
263
+ toNodes(element).forEach((element2) => element2.removeAttribute(name));
264
+ }
265
+ function data(element, attribute) {
266
+ for (const name of [attribute, `data-${attribute}`]) {
267
+ if (hasAttr(element, name)) {
268
+ return attr(element, name);
269
+ }
270
+ }
271
+ }
272
+
279
273
  const inBrowser = typeof window !== "undefined";
280
274
  const isRtl = inBrowser && document.dir === "rtl";
281
275
  const hasTouch = inBrowser && "ontouchstart" in window;
@@ -648,10 +642,7 @@
648
642
  toNodes(element).map(
649
643
  (element2) => new Promise((resolve, reject) => {
650
644
  for (const name in props) {
651
- const value = css(element2, name);
652
- if (value === "") {
653
- css(element2, name, value);
654
- }
645
+ css(element2, name);
655
646
  }
656
647
  const timer = setTimeout(() => trigger(element2, transitionEnd), duration);
657
648
  once(
@@ -694,14 +685,23 @@
694
685
  return hasClass(element, clsTransition);
695
686
  }
696
687
  };
697
- const animationPrefix = "uk-animation-";
688
+ const clsAnimation = "uk-animation";
698
689
  const animationEnd = "animationend";
699
690
  const animationCanceled = "animationcanceled";
700
691
  function animate$2(element, animation, duration = 200, origin, out) {
701
692
  return Promise.all(
702
693
  toNodes(element).map(
703
694
  (element2) => new Promise((resolve, reject) => {
704
- trigger(element2, animationCanceled);
695
+ if (hasClass(element2, clsAnimation)) {
696
+ trigger(element2, animationCanceled);
697
+ }
698
+ const classes = [
699
+ animation,
700
+ clsAnimation,
701
+ `${clsAnimation}-${out ? "leave" : "enter"}`,
702
+ origin && `uk-transform-origin-${origin}`,
703
+ out && `${clsAnimation}-reverse`
704
+ ];
705
705
  const timer = setTimeout(() => trigger(element2, animationEnd), duration);
706
706
  once(
707
707
  element2,
@@ -710,28 +710,23 @@
710
710
  clearTimeout(timer);
711
711
  type === animationCanceled ? reject() : resolve(element2);
712
712
  css(element2, "animationDuration", "");
713
- removeClasses(element2, `${animationPrefix}\\S*`);
713
+ removeClass(element2, classes);
714
714
  },
715
715
  { self: true }
716
716
  );
717
717
  css(element2, "animationDuration", `${duration}ms`);
718
- addClass(element2, animation, animationPrefix + (out ? "leave" : "enter"));
719
- if (startsWith(animation, animationPrefix)) {
720
- origin && addClass(element2, `uk-transform-origin-${origin}`);
721
- out && addClass(element2, `${animationPrefix}reverse`);
722
- }
718
+ addClass(element2, classes);
723
719
  })
724
720
  )
725
721
  );
726
722
  }
727
- const inProgressRe = new RegExp(`${animationPrefix}(enter|leave)`);
728
723
  const Animation = {
729
724
  in: animate$2,
730
725
  out(element, animation, duration, origin) {
731
726
  return animate$2(element, animation, duration, origin, true);
732
727
  },
733
728
  inProgress(element) {
734
- return inProgressRe.test(attr(element, "class"));
729
+ return hasClass(element, clsAnimation);
735
730
  },
736
731
  cancel(element) {
737
732
  trigger(element, animationCanceled);
@@ -1650,7 +1645,6 @@
1650
1645
  remove: remove$1,
1651
1646
  removeAttr: removeAttr,
1652
1647
  removeClass: removeClass,
1653
- removeClasses: removeClasses,
1654
1648
  replaceClass: replaceClass,
1655
1649
  scrollIntoView: scrollIntoView,
1656
1650
  scrollParent: scrollParent,
@@ -1750,8 +1744,7 @@
1750
1744
  if (!el) {
1751
1745
  continue;
1752
1746
  }
1753
- let digits = String(Math.trunc(timespan[unit]));
1754
- digits = digits.length < 2 ? `0${digits}` : digits;
1747
+ let digits = Math.trunc(timespan[unit]).toString().padStart(2, "0");
1755
1748
  if (el.textContent !== digits) {
1756
1749
  digits = digits.split("");
1757
1750
  if (digits.length !== el.children.length) {
@@ -3546,7 +3539,7 @@
3546
3539
  };
3547
3540
  App.util = util;
3548
3541
  App.options = {};
3549
- App.version = "3.20.9-dev.e2e1b058d";
3542
+ App.version = "3.20.10-dev.8e8f67f8b";
3550
3543
 
3551
3544
  const PREFIX = "uk-";
3552
3545
  const DATA = "__uikit__";
@@ -4001,14 +3994,14 @@
4001
3994
  getValidIndex(index = this.index, prevIndex = this.prevIndex) {
4002
3995
  return this.getIndex(index, prevIndex);
4003
3996
  },
4004
- _show(prev, next, force) {
3997
+ async _show(prev, next, force) {
4005
3998
  this._transitioner = this._getTransitioner(prev, next, this.dir, {
4006
3999
  easing: force ? next.offsetWidth < 600 ? "cubic-bezier(0.25, 0.46, 0.45, 0.94)" : "cubic-bezier(0.165, 0.84, 0.44, 1)" : this.easing,
4007
4000
  ...this.transitionOptions
4008
4001
  });
4009
4002
  if (!force && !prev) {
4010
4003
  this._translate(1);
4011
- return Promise.resolve();
4004
+ return;
4012
4005
  }
4013
4006
  const { length } = this.stack;
4014
4007
  return this._transitioner[length > 1 ? "forward" : "show"](
@@ -5061,7 +5054,9 @@
5061
5054
  show(duration, percent = 0, linear) {
5062
5055
  const timing = linear ? "linear" : easing;
5063
5056
  duration -= Math.round(duration * clamp(percent, -1, 1));
5057
+ css(list, "transitionProperty", "none");
5064
5058
  this.translate(percent);
5059
+ css(list, "transitionProperty", "");
5065
5060
  percent = prev ? percent : clamp(percent, 0, 1);
5066
5061
  triggerUpdate(this.getItemIn(), "itemin", { percent, duration, timing, dir });
5067
5062
  prev && triggerUpdate(this.getItemIn(true), "itemout", {
@@ -6274,7 +6269,7 @@
6274
6269
  e.preventDefault();
6275
6270
  e.stopPropagation();
6276
6271
  }
6277
- function ajax(url, options) {
6272
+ async function ajax(url, options) {
6278
6273
  const env = {
6279
6274
  data: null,
6280
6275
  method: "GET",
@@ -6284,7 +6279,8 @@
6284
6279
  responseType: "",
6285
6280
  ...options
6286
6281
  };
6287
- return Promise.resolve().then(() => env.beforeSend(env)).then(() => send(url, env));
6282
+ await env.beforeSend(env);
6283
+ return send(url, env);
6288
6284
  }
6289
6285
  function send(url, env) {
6290
6286
  return new Promise((resolve, reject) => {
@@ -8256,18 +8252,21 @@
8256
8252
  return false;
8257
8253
  }
8258
8254
  for (const target of toNodes(this.target)) {
8259
- replaceClass(
8260
- target,
8261
- "uk-light uk-dark",
8262
- !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : ""
8263
- );
8255
+ let color = !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : "";
8256
+ if (color !== false) {
8257
+ replaceClass(target, "uk-light uk-dark", color);
8258
+ }
8264
8259
  }
8265
8260
  }
8266
8261
  }
8267
8262
  };
8268
8263
  function findTargetColor(target) {
8269
- const { left, top, height, width } = dimensions$1(target);
8264
+ const dim = dimensions$1(target);
8270
8265
  const viewport = dimensions$1(window);
8266
+ if (!intersectRect(dim, viewport)) {
8267
+ return false;
8268
+ }
8269
+ const { left, top, height, width } = dim;
8271
8270
  let last;
8272
8271
  for (const percent of [0.25, 0.5, 0.75]) {
8273
8272
  const elements = target.ownerDocument.elementsFromPoint(
@@ -8752,6 +8751,7 @@
8752
8751
  }
8753
8752
  }
8754
8753
 
8754
+ const clsInView = "uk-scrollspy-inview";
8755
8755
  var scrollspy = {
8756
8756
  args: "cls",
8757
8757
  props: {
@@ -8768,8 +8768,7 @@
8768
8768
  hidden: true,
8769
8769
  margin: "-1px",
8770
8770
  repeat: false,
8771
- delay: 0,
8772
- inViewClass: "uk-scrollspy-inview"
8771
+ delay: 0
8773
8772
  }),
8774
8773
  computed: {
8775
8774
  elements: ({ target }, $el) => target ? $$(target, $el) : [$el]
@@ -8777,7 +8776,7 @@
8777
8776
  watch: {
8778
8777
  elements(elements) {
8779
8778
  if (this.hidden) {
8780
- css(filter$1(elements, `:not(.${this.inViewClass})`), "opacity", 0);
8779
+ css(filter$1(elements, `:not(.${clsInView})`), "opacity", 0);
8781
8780
  }
8782
8781
  }
8783
8782
  },
@@ -8786,7 +8785,7 @@
8786
8785
  },
8787
8786
  disconnected() {
8788
8787
  for (const [el, state] of this.elementData.entries()) {
8789
- removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || "");
8788
+ removeClass(el, clsInView, (state == null ? void 0 : state.cls) || "");
8790
8789
  }
8791
8790
  delete this.elementData;
8792
8791
  },
@@ -8840,10 +8839,11 @@
8840
8839
  }
8841
8840
  (_b = state.off) == null ? void 0 : _b.call(state);
8842
8841
  css(el, "opacity", !inview && this.hidden ? 0 : "");
8843
- toggleClass(el, this.inViewClass, inview);
8842
+ toggleClass(el, clsInView, inview);
8844
8843
  toggleClass(el, state.cls);
8845
- if (/\buk-animation-/.test(state.cls)) {
8846
- const removeAnimationClasses = () => removeClasses(el, "uk-animation-[\\w-]+");
8844
+ let match;
8845
+ if (match = state.cls.match(/\buk-animation-[\w-]+/g)) {
8846
+ const removeAnimationClasses = () => removeClass(el, match);
8847
8847
  if (inview) {
8848
8848
  state.off = once(el, "animationcancel animationend", removeAnimationClasses, {
8849
8849
  self: true