uikit 3.25.24-dev.66bb413 → 3.25.24

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 (47) hide show
  1. package/dist/css/uikit-core-rtl.css +1 -1
  2. package/dist/css/uikit-core-rtl.min.css +1 -1
  3. package/dist/css/uikit-core.css +1 -1
  4. package/dist/css/uikit-core.min.css +1 -1
  5. package/dist/css/uikit-rtl.css +1 -1
  6. package/dist/css/uikit-rtl.min.css +1 -1
  7. package/dist/css/uikit.css +1 -1
  8. package/dist/css/uikit.min.css +1 -1
  9. package/dist/js/components/countdown.js +1 -1
  10. package/dist/js/components/countdown.min.js +1 -1
  11. package/dist/js/components/filter.js +18 -16
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +8 -27
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +8 -27
  16. package/dist/js/components/lightbox.min.js +1 -1
  17. package/dist/js/components/notification.js +1 -1
  18. package/dist/js/components/notification.min.js +1 -1
  19. package/dist/js/components/parallax.js +1 -1
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +1 -1
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +15 -16
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +1 -1
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +1 -1
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +18 -16
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +4 -5
  32. package/dist/js/components/tooltip.min.js +1 -1
  33. package/dist/js/components/upload.js +1 -1
  34. package/dist/js/components/upload.min.js +1 -1
  35. package/dist/js/uikit-core.js +64 -75
  36. package/dist/js/uikit-core.min.js +1 -1
  37. package/dist/js/uikit-icons.js +1 -1
  38. package/dist/js/uikit-icons.min.js +1 -1
  39. package/dist/js/uikit.js +95 -105
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/components/internal/slider-transitioner.js +15 -17
  43. package/src/js/core/scrollspy.js +10 -20
  44. package/src/js/mixin/internal/animate-fade.js +20 -18
  45. package/src/js/mixin/modal.js +3 -24
  46. package/src/js/mixin/togglable.js +4 -4
  47. package/src/js/util/animation.js +58 -41
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.24-dev.66bb413 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.24 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -685,39 +685,52 @@
685
685
  }
686
686
  };
687
687
  const clsAnimation = "uk-animation";
688
- const animationEnd = "animationend";
689
- const animationCanceled = "animationcanceled";
688
+ const activeAnimations = /* @__PURE__ */ new WeakMap();
690
689
  function animate$2(element, animation, duration = 200, origin, out) {
691
- return Promise.all(
692
- toNodes(element).map(
693
- (element2) => new Promise((resolve, reject) => {
694
- if (hasClass(element2, clsAnimation)) {
695
- trigger(element2, animationCanceled);
696
- }
697
- const classes = [
698
- animation,
699
- clsAnimation,
700
- `${clsAnimation}-${out ? "leave" : "enter"}`,
701
- origin && `uk-transform-origin-${origin}`,
702
- out && `${clsAnimation}-reverse`
703
- ];
704
- const timer = setTimeout(() => trigger(element2, animationEnd), duration);
705
- once(
706
- element2,
707
- [animationEnd, animationCanceled],
708
- ({ type }) => {
709
- clearTimeout(timer);
710
- type === animationCanceled ? reject() : resolve(element2);
711
- css(element2, "animationDuration", "");
712
- removeClass(element2, classes);
713
- },
714
- { self: true }
715
- );
716
- css(element2, "animationDuration", `${duration}ms`);
717
- addClass(element2, classes);
718
- })
719
- )
720
- );
690
+ const animateFn = async (element2) => {
691
+ if (!Element.prototype.getAnimations) {
692
+ return element2;
693
+ }
694
+ cancel(element2);
695
+ const existingAnimations = element2.getAnimations();
696
+ const classes = [
697
+ animation,
698
+ clsAnimation,
699
+ `${clsAnimation}-${out ? "leave" : "enter"}`,
700
+ origin && `uk-transform-origin-${origin}`,
701
+ out && `${clsAnimation}-reverse`
702
+ ];
703
+ css(element2, "animationDuration", `${duration}ms`);
704
+ addClass(element2, classes);
705
+ const animations = element2.getAnimations().filter((animation2) => !existingAnimations.includes(animation2));
706
+ const data = { animations, classes };
707
+ activeAnimations.set(element2, data);
708
+ try {
709
+ await Promise.all(animations.map(({ finished }) => finished));
710
+ return element2;
711
+ } finally {
712
+ cleanup(element2, data);
713
+ }
714
+ };
715
+ return Promise.all(toNodes(element).map(animateFn));
716
+ }
717
+ function cleanup(element, data) {
718
+ if (activeAnimations.get(element) === data) {
719
+ activeAnimations.delete(element);
720
+ css(element, "animationDuration", "");
721
+ removeClass(element, data.classes);
722
+ }
723
+ }
724
+ function cancel(elements) {
725
+ for (const element of toNodes(elements)) {
726
+ const data = activeAnimations.get(element);
727
+ if (data) {
728
+ for (const animation of data.animations) {
729
+ animation.cancel();
730
+ }
731
+ cleanup(element, data);
732
+ }
733
+ }
721
734
  }
722
735
  const Animation = {
723
736
  in: animate$2,
@@ -725,11 +738,9 @@
725
738
  return animate$2(element, animation, duration, origin, true);
726
739
  },
727
740
  inProgress(element) {
728
- return hasClass(element, clsAnimation);
741
+ return activeAnimations.has(element);
729
742
  },
730
- cancel(element) {
731
- trigger(element, animationCanceled);
732
- }
743
+ cancel
733
744
  };
734
745
 
735
746
  function ready(fn) {
@@ -2170,25 +2181,27 @@
2170
2181
  const newHeight = height(target);
2171
2182
  css(target, "alignContent", "flex-start");
2172
2183
  height(target, oldHeight);
2173
- let transitions = [];
2184
+ const transitions = [];
2174
2185
  let targetDuration = duration / 2;
2175
2186
  if (stagger) {
2176
2187
  const nodes = getTransitionNodes(target);
2177
2188
  css(children(target), propsOut);
2178
- transitions = nodes.reduce(async (promise, child, i, array) => {
2179
- await promise;
2180
- if (!isInView(child) || !isCurrentIndex()) {
2181
- resetProps(child, propsIn);
2182
- return;
2183
- }
2184
- await awaitTimeout(stagger);
2185
- const transition = Transition.start(child, propsIn, duration / 2, "ease").then(
2186
- () => isCurrentIndex() && resetProps(child, propsIn)
2187
- );
2188
- if (array.length - 1 === i) {
2189
- await transition;
2190
- }
2191
- }, Promise.resolve());
2189
+ transitions.push(
2190
+ nodes.reduce(async (promise, child, i, array) => {
2191
+ await promise;
2192
+ if (!isInView(child) || !isCurrentIndex()) {
2193
+ resetProps(child, propsIn);
2194
+ return;
2195
+ }
2196
+ await awaitTimeout(stagger);
2197
+ const transition = Transition.start(child, propsIn, duration / 2, "ease").then(
2198
+ () => isCurrentIndex() && resetProps(child, propsIn)
2199
+ );
2200
+ if (array.length - 1 === i) {
2201
+ await transition;
2202
+ }
2203
+ }, Promise.resolve())
2204
+ );
2192
2205
  targetDuration += nodes.length * stagger;
2193
2206
  }
2194
2207
  if (!stagger || oldHeight !== newHeight) {
@@ -2870,15 +2883,14 @@
2870
2883
  }
2871
2884
  }
2872
2885
  }
2873
- function toggleAnimation(el, show, cmp) {
2886
+ async function toggleAnimation(el, show, cmp) {
2874
2887
  const { animation, duration, _toggle } = cmp;
2875
2888
  if (show) {
2876
2889
  _toggle(el, true);
2877
2890
  return Animation.in(el, animation[0], duration, cmp.origin);
2878
2891
  }
2879
- return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(
2880
- () => _toggle(el, false)
2881
- );
2892
+ await Animation.out(el, animation[1] || animation[0], duration, cmp.origin);
2893
+ _toggle(el, false);
2882
2894
  }
2883
2895
 
2884
2896
  const active$1 = [];
@@ -3040,29 +3052,14 @@
3040
3052
  let rejectAnimation;
3041
3053
  return new Promise(
3042
3054
  (resolve, reject) => once(el, "show hide", () => {
3043
- var _a;
3055
+ var _a, _b, _c;
3044
3056
  (_a = pendingReject.get(el)) == null ? void 0 : _a();
3045
3057
  rejectAnimation = reject;
3046
3058
  pendingReject.set(el, reject);
3047
3059
  _toggle(el, show);
3048
- const off = once(
3049
- transitionElement,
3050
- "transitionstart",
3051
- () => {
3052
- once(transitionElement, "transitionend transitioncancel", resolve, {
3053
- self: true
3054
- });
3055
- clearTimeout(timer);
3056
- },
3057
- { self: true }
3058
- );
3059
- const timer = setTimeout(
3060
- () => {
3061
- off();
3062
- resolve();
3063
- },
3064
- toMs(css(transitionElement, "transitionDuration"))
3065
- );
3060
+ Promise.all(
3061
+ ((_c = (_b = transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) != null ? _c : []).map(({ finished }) => finished)
3062
+ ).then(resolve, reject);
3066
3063
  })
3067
3064
  ).then(() => {
3068
3065
  if (pendingReject.get(el) === rejectAnimation) {
@@ -3070,9 +3067,6 @@
3070
3067
  }
3071
3068
  });
3072
3069
  }
3073
- function toMs(time) {
3074
- return toFloat(time) * (endsWith(time, "ms") ? 1 : 1e3);
3075
- }
3076
3070
  function preventBackgroundFocus(modal) {
3077
3071
  return on(document, "focusin", (e) => {
3078
3072
  if (last(active$1) !== modal || modal.$el.contains(e.target)) {
@@ -3411,7 +3405,7 @@
3411
3405
  return Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180 / Math.PI;
3412
3406
  }
3413
3407
 
3414
- var VERSION = '3.25.24-dev.66bb413';
3408
+ var VERSION = '3.25.24';
3415
3409
 
3416
3410
  function initWatches(instance) {
3417
3411
  instance._watches = [];
@@ -5489,22 +5483,21 @@
5489
5483
  return this.show(duration, percent, true);
5490
5484
  },
5491
5485
  translate(percent) {
5492
- if (percent === this.percent()) {
5493
- return;
5486
+ if (percent !== this.percent()) {
5487
+ const distance = this.getDistance() * dir * (isRtl ? -1 : 1);
5488
+ css(
5489
+ list,
5490
+ "transform",
5491
+ translate(
5492
+ clamp(
5493
+ -to + (distance - distance * percent),
5494
+ -getWidth(list),
5495
+ dimensions$1(list).width
5496
+ ) * (isRtl ? -1 : 1),
5497
+ "px"
5498
+ )
5499
+ );
5494
5500
  }
5495
- const distance = this.getDistance() * dir * (isRtl ? -1 : 1);
5496
- css(
5497
- list,
5498
- "transform",
5499
- translate(
5500
- clamp(
5501
- -to + (distance - distance * percent),
5502
- -getWidth(list),
5503
- dimensions$1(list).width
5504
- ) * (isRtl ? -1 : 1),
5505
- "px"
5506
- )
5507
- );
5508
5501
  const actives = this.getActives();
5509
5502
  const itemIn = this.getItemIn();
5510
5503
  const itemOut = this.getItemIn(true);
@@ -9233,7 +9226,7 @@
9233
9226
  ],
9234
9227
  methods: {
9235
9228
  toggle(el, inview) {
9236
- var _a, _b;
9229
+ var _a, _b, _c;
9237
9230
  const state = (_a = this.elementData) == null ? void 0 : _a.get(el);
9238
9231
  if (!state) {
9239
9232
  return;
@@ -9242,16 +9235,13 @@
9242
9235
  css(el, "opacity", !inview && this.hidden ? 0 : "");
9243
9236
  toggleClass(el, clsInView, inview);
9244
9237
  toggleClass(el, state.cls);
9245
- let match;
9246
- if (match = state.cls.match(/\buk-animation-[\w-]+/g)) {
9247
- const removeAnimationClasses = () => removeClass(el, match);
9248
- if (inview) {
9249
- state.off = once(el, "animationcancel animationend", removeAnimationClasses, {
9250
- self: true
9251
- });
9252
- } else {
9253
- removeAnimationClasses();
9254
- }
9238
+ const match = state.cls.match(/\buk-animation-[\w-]+/g);
9239
+ if (match) {
9240
+ const animations = inview && ((_c = el.getAnimations) == null ? void 0 : _c.call(el)) || [];
9241
+ let active = true;
9242
+ state.off = () => active = false;
9243
+ const cleanup = () => active && removeClass(el, match);
9244
+ Promise.all(animations.map(({ finished }) => finished)).then(cleanup, cleanup);
9255
9245
  }
9256
9246
  trigger(el, inview ? "inview" : "outview");
9257
9247
  state.inview = inview;