uikit 3.25.28-dev.fcd5185 → 3.25.29-dev.3bc1304

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 (59) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/ci-release.js +1 -4
  3. package/dist/css/uikit-core-rtl.css +1 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -1
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -1
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +11 -10
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +13 -12
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +13 -12
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +5 -2
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +10 -9
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +1 -1
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +11 -10
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +1 -1
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +11 -10
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +10 -9
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +1 -1
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +35 -48
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +40 -44
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +74 -91
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/component.js +1 -1
  45. package/src/js/api/computed.js +1 -1
  46. package/src/js/api/log.js +1 -1
  47. package/src/js/api/observables.js +5 -4
  48. package/src/js/api/observer.js +3 -4
  49. package/src/js/api/update.js +10 -9
  50. package/src/js/components/upload.js +38 -49
  51. package/src/js/core/alert.js +6 -3
  52. package/src/js/core/drop.js +4 -4
  53. package/src/js/core/form-custom.js +3 -8
  54. package/src/js/core/icon.js +3 -11
  55. package/src/js/core/svg.js +1 -1
  56. package/src/js/core/toggle.js +0 -2
  57. package/src/js/mixin/event.js +4 -1
  58. package/src/js/mixin/modal.js +1 -1
  59. package/tests/alert.html +2 -2
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.28-dev.fcd5185 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.29-dev.3bc1304 | 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() :
@@ -1912,22 +1912,23 @@
1912
1912
  if (!instance._updates.length) {
1913
1913
  return;
1914
1914
  }
1915
- if (!instance._updateCount) {
1916
- instance._updateCount = 0;
1917
- requestAnimationFrame(() => instance._updateCount = 0);
1918
- }
1919
1915
  if (!instance._queued) {
1920
1916
  instance._queued = /* @__PURE__ */ new Set();
1921
1917
  fastdom.read(() => {
1922
1918
  if (instance._connected) {
1923
- runUpdates(instance, instance._queued);
1919
+ if (!instance._updateCount) {
1920
+ instance._updateCount = 0;
1921
+ requestAnimationFrame(() => instance._updateCount = 0);
1922
+ }
1923
+ if (instance._updateCount < 10) {
1924
+ instance._updateCount++;
1925
+ runUpdates(instance, instance._queued);
1926
+ }
1924
1927
  }
1925
1928
  instance._queued = null;
1926
1929
  });
1927
1930
  }
1928
- if (instance._updateCount++ < 20) {
1929
- instance._queued.add(e.type || e);
1930
- }
1931
+ instance._queued.add(e.type || e);
1931
1932
  }
1932
1933
  function runUpdates(instance, types) {
1933
1934
  for (const { read, write, events = [] } of instance._updates) {
@@ -2002,8 +2003,11 @@
2002
2003
  const pos = getEventPos(e);
2003
2004
  const target = "tagName" in e.target ? e.target : parent(e.target);
2004
2005
  once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {
2006
+ if (e2.type !== pointerUp$1 || !target) {
2007
+ return;
2008
+ }
2005
2009
  const { x, y } = getEventPos(e2);
2006
- if (e2.type !== "scroll" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
2010
+ if (x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
2007
2011
  setTimeout(() => {
2008
2012
  trigger(target, "swipe");
2009
2013
  trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
@@ -2369,7 +2373,7 @@
2369
2373
  }
2370
2374
 
2371
2375
  function maybeDefaultPreventClick(e) {
2372
- if (e.target.closest('a[href="#"],a[href=""]')) {
2376
+ if (e.type === "keydown" && e.keyCode === keyMap.SPACE || e.target.closest('a[href="#"],a[href=""]')) {
2373
2377
  e.preventDefault();
2374
2378
  }
2375
2379
  }
@@ -3065,13 +3069,13 @@
3065
3069
  let rejectAnimation;
3066
3070
  return new Promise(
3067
3071
  (resolve, reject) => once(el, "show hide", () => {
3068
- var _a, _b, _c;
3072
+ var _a, _b;
3069
3073
  (_a = pendingReject.get(el)) == null ? void 0 : _a();
3070
3074
  rejectAnimation = reject;
3071
3075
  pendingReject.set(el, reject);
3072
3076
  _toggle(el, show);
3073
3077
  Promise.all(
3074
- ((_c = (_b = transitionElement == null ? void 0 : transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) != null ? _c : []).map(({ finished }) => finished)
3078
+ (((_b = transitionElement == null ? void 0 : transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) || []).map(({ finished }) => finished)
3075
3079
  ).then(resolve, reject);
3076
3080
  })
3077
3081
  ).then(() => {
@@ -3419,7 +3423,7 @@
3419
3423
  return Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180 / Math.PI;
3420
3424
  }
3421
3425
 
3422
- var VERSION = '3.25.28-dev.fcd5185';
3426
+ var VERSION = '3.25.29-dev.3bc1304';
3423
3427
 
3424
3428
  function initWatches(instance) {
3425
3429
  instance._watches = [];
@@ -3502,7 +3506,7 @@
3502
3506
  });
3503
3507
  }
3504
3508
  function resetComputed(instance) {
3505
- const values = { ...instance._computed };
3509
+ const values = instance._computed;
3506
3510
  instance._computed = {};
3507
3511
  return values;
3508
3512
  }
@@ -3538,16 +3542,15 @@
3538
3542
  }
3539
3543
 
3540
3544
  function initObservers(instance) {
3541
- for (const observer of instance.$options.observe || []) {
3542
- registerObservable(instance, observer);
3545
+ for (const [index, observer] of (instance.$options.observe || []).entries()) {
3546
+ registerObservable(instance, observer, `_observe${index}`);
3543
3547
  }
3544
3548
  }
3545
- function registerObservable(instance, observable) {
3549
+ function registerObservable(instance, observable, key) {
3546
3550
  let { observe, target = instance.$el, handler, options, filter, args } = observable;
3547
3551
  if (filter && !filter.call(instance, instance)) {
3548
3552
  return;
3549
3553
  }
3550
- const key = `_observe${instance._disconnect.length}`;
3551
3554
  if (isFunction(target) && !hasOwn(instance, key)) {
3552
3555
  registerComputed(instance, key, () => {
3553
3556
  const targets2 = target.call(instance, instance);
@@ -3748,7 +3751,7 @@
3748
3751
  const elementComponents = /* @__PURE__ */ new WeakMap();
3749
3752
  const components$2 = {};
3750
3753
  function component(name, options) {
3751
- var _a, _b;
3754
+ var _a;
3752
3755
  const id = PREFIX + hyphenate(name);
3753
3756
  if (!options) {
3754
3757
  if (!components$2[id].options) {
@@ -3758,10 +3761,10 @@
3758
3761
  }
3759
3762
  name = camelize(name);
3760
3763
  App[name] = (element, data) => createComponent(name, element, data);
3761
- const opt = (_a = options.options) != null ? _a : { ...options };
3764
+ const opt = options.options || { ...options };
3762
3765
  opt.id = id;
3763
3766
  opt.name = name;
3764
- (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
3767
+ (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
3765
3768
  if (App._initialized && !opt.functional) {
3766
3769
  requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
3767
3770
  }
@@ -6518,37 +6521,37 @@
6518
6521
  },
6519
6522
  methods: {
6520
6523
  async upload(files) {
6521
- files = toArray(files);
6522
- if (!files.length) {
6523
- return;
6524
- }
6525
- if (!this.multiple) {
6526
- files = files.slice(0, 1);
6527
- }
6528
- trigger(this.$el, "upload", [files]);
6529
- for (const file of files) {
6530
- if (this.maxSize && this.maxSize * 1e3 < file.size) {
6531
- this.fail(this.t("invalidSize", this.maxSize));
6532
- return;
6533
- }
6534
- if (this.allow && !match$1(this.allow, file.name)) {
6535
- this.fail(this.t("invalidName", this.allow));
6524
+ try {
6525
+ files = toArray(files);
6526
+ if (!files.length) {
6536
6527
  return;
6537
6528
  }
6538
- if (this.mime && !match$1(this.mime, file.type)) {
6539
- this.fail(this.t("invalidMime", this.mime));
6540
- return;
6529
+ if (!this.multiple) {
6530
+ files = files.slice(0, 1);
6541
6531
  }
6542
- }
6543
- this.beforeAll(this, files);
6544
- const chunks = chunk(files, this.concurrent);
6545
- const upload = async (files2) => {
6546
- const data = new FormData();
6547
- files2.forEach((file) => data.append(this.name, file));
6548
- for (const key in this.params) {
6549
- data.append(key, this.params[key]);
6532
+ trigger(this.$el, "upload", [files]);
6533
+ for (const file of files) {
6534
+ if (this.maxSize && this.maxSize * 1e3 < file.size) {
6535
+ this.fail(this.t("invalidSize", this.maxSize));
6536
+ return;
6537
+ }
6538
+ if (this.allow && !match$1(this.allow, file.name)) {
6539
+ this.fail(this.t("invalidName", this.allow));
6540
+ return;
6541
+ }
6542
+ if (this.mime && !match$1(this.mime, file.type)) {
6543
+ this.fail(this.t("invalidMime", this.mime));
6544
+ return;
6545
+ }
6550
6546
  }
6551
- try {
6547
+ await this.beforeAll(this, files);
6548
+ const size = this.concurrent;
6549
+ for (let i = 0; i < files.length; i += size) {
6550
+ const data = new FormData();
6551
+ files.slice(i, i + size).forEach((file) => data.append(this.name, file));
6552
+ for (const key in this.params) {
6553
+ data.append(key, this.params[key]);
6554
+ }
6552
6555
  const xhr = await ajax(this.url, {
6553
6556
  data,
6554
6557
  method: this.method,
@@ -6563,38 +6566,25 @@
6563
6566
  }
6564
6567
  });
6565
6568
  this.complete(xhr);
6566
- if (chunks.length) {
6567
- await upload(chunks.shift());
6568
- } else {
6569
+ if (i + size >= files.length) {
6569
6570
  this.completeAll(xhr);
6570
6571
  }
6571
- } catch (e) {
6572
- if (e.name !== "AbortError") {
6573
- this.error(e);
6574
- }
6575
6572
  }
6576
- };
6577
- await upload(chunks.shift());
6573
+ } catch (e) {
6574
+ if ((e == null ? void 0 : e.name) !== "AbortError") {
6575
+ this.error(e);
6576
+ }
6577
+ }
6578
6578
  }
6579
6579
  }
6580
6580
  };
6581
6581
  function match$1(pattern, path) {
6582
6582
  const expression = pattern.replace(
6583
6583
  /\*\*|[.*+?^${}()|[\]\\]/g,
6584
- (s) => {
6585
- var _a;
6586
- return (_a = { "**": ".*", "*": "[^/]+", "?": "[^/]", "|": "|" }[s]) != null ? _a : `\\${s}`;
6587
- }
6584
+ (s) => ({ "**": ".*", "*": "[^/]+", "?": "[^/]", "|": "|" })[s] || `\\${s}`
6588
6585
  );
6589
6586
  return new RegExp(`^(?:${expression})$`, "i").test(path);
6590
6587
  }
6591
- function chunk(files, size) {
6592
- const chunks = [];
6593
- for (let i = 0; i < files.length; i += size) {
6594
- chunks.push(files.slice(i, i + size));
6595
- }
6596
- return chunks;
6597
- }
6598
6588
  function stop(e) {
6599
6589
  e.preventDefault();
6600
6590
  e.stopPropagation();
@@ -6923,11 +6913,10 @@
6923
6913
  mixins: [Class, Togglable],
6924
6914
  args: "animation",
6925
6915
  props: {
6926
- animation: Boolean,
6927
6916
  close: String
6928
6917
  },
6929
6918
  data: {
6930
- animation: true,
6919
+ animation: [true],
6931
6920
  selClose: ".uk-alert-close",
6932
6921
  duration: 150
6933
6922
  },
@@ -6941,7 +6930,11 @@
6941
6930
  },
6942
6931
  methods: {
6943
6932
  async close() {
6944
- await this.toggleElement(this.$el, false, this.animation ? animate : false);
6933
+ await this.toggleElement(
6934
+ this.$el,
6935
+ false,
6936
+ this.animation[0] === true || this.animation[0] === 1 ? animate : true
6937
+ );
6945
6938
  this.$destroy(true);
6946
6939
  }
6947
6940
  }
@@ -7173,11 +7166,10 @@
7173
7166
  attr(this.targetEl, "aria-expanded", false);
7174
7167
  this._style = pick(this.$el.style, ["width", "height"]);
7175
7168
  },
7169
+ beforeDisconnect() {
7170
+ this.hide(false, false);
7171
+ },
7176
7172
  disconnected() {
7177
- if (this.isActive()) {
7178
- this.hide(false);
7179
- active = null;
7180
- }
7181
7173
  css(this.$el, this._style);
7182
7174
  },
7183
7175
  events: [
@@ -7803,15 +7795,14 @@
7803
7795
  }
7804
7796
  },
7805
7797
  update() {
7806
- var _a;
7798
+ var _a, _b, _c, _d, _e, _f;
7807
7799
  const { target, input } = this;
7808
7800
  if (!target) {
7809
7801
  return;
7810
7802
  }
7811
- let option;
7812
7803
  const prop = isInput(target) ? "value" : "textContent";
7813
7804
  const prev = target[prop];
7814
- const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, "select") && (option = $$("option", input).find((el) => el.selected)) ? option.textContent : input.value;
7805
+ const value = (_f = (_e = (_b = (_a = input.files) == null ? void 0 : _a[0]) == null ? void 0 : _b.name) != null ? _e : (_d = (_c = input.selectedOptions) == null ? void 0 : _c[0]) == null ? void 0 : _d.label) != null ? _f : input.value;
7815
7806
  if (prev !== value) {
7816
7807
  target[prop] = value;
7817
7808
  }
@@ -8343,16 +8334,9 @@
8343
8334
  beforeConnect() {
8344
8335
  const isToggle = hasClass(this.$el, "uk-search-toggle") || hasClass(this.$el, "uk-navbar-toggle");
8345
8336
  this.icon = isToggle ? "search-toggle-icon" : hasClass(this.$el, "uk-search-icon") && this.$el.closest(".uk-search-large") ? "search-large" : this.$el.closest(".uk-search-medium") ? "search-medium" : this.$props.icon;
8346
- if (hasAttr(this.$el, "aria-label")) {
8347
- return;
8348
- }
8349
- if (isToggle) {
8350
- this.$el.ariaLabel = this.t("toggle");
8351
- } else {
8352
- const button = this.$el.closest("a,button");
8353
- if (button) {
8354
- button.ariaLabel = this.t("submit");
8355
- }
8337
+ const target = isToggle ? this.$el : this.$el.closest("a,button");
8338
+ if (target && !hasAttr(target, "aria-label")) {
8339
+ target.ariaLabel = this.t(isToggle ? "toggle" : "submit");
8356
8340
  }
8357
8341
  }
8358
8342
  };
@@ -9750,7 +9734,7 @@
9750
9734
  const loadSVG = memoize(async (src) => {
9751
9735
  if (src) {
9752
9736
  const response = await fetch(src);
9753
- if (response.headers.get("Content-Type") === "image/svg+xml") {
9737
+ if (/^image\/svg\+xml\s*(;|$)/i.test(response.headers.get("Content-Type"))) {
9754
9738
  return response.text();
9755
9739
  }
9756
9740
  }
@@ -10072,7 +10056,6 @@
10072
10056
  {
10073
10057
  name: "mediachange",
10074
10058
  filter: ({ mode }) => includes(mode, "media"),
10075
- el: ({ target }) => target,
10076
10059
  handler(e, mediaObj) {
10077
10060
  if (mediaObj.matches ^ this.isToggled(this.target)) {
10078
10061
  this.toggle();