uikit 3.20.10 → 3.20.11-dev.3a41e0fa6

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 (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/release.js +1 -1
  3. package/build/scope.js +4 -9
  4. package/dist/css/uikit-core-rtl.css +1 -1
  5. package/dist/css/uikit-core-rtl.min.css +1 -1
  6. package/dist/css/uikit-core.css +1 -1
  7. package/dist/css/uikit-core.min.css +1 -1
  8. package/dist/css/uikit-rtl.css +1 -1
  9. package/dist/css/uikit-rtl.min.css +1 -1
  10. package/dist/css/uikit.css +1 -1
  11. package/dist/css/uikit.min.css +1 -1
  12. package/dist/js/components/countdown.js +1 -1
  13. package/dist/js/components/countdown.min.js +1 -1
  14. package/dist/js/components/filter.js +2 -7
  15. package/dist/js/components/filter.min.js +1 -1
  16. package/dist/js/components/lightbox-panel.js +1 -1
  17. package/dist/js/components/lightbox-panel.min.js +1 -1
  18. package/dist/js/components/lightbox.js +1 -1
  19. package/dist/js/components/lightbox.min.js +1 -1
  20. package/dist/js/components/notification.js +1 -1
  21. package/dist/js/components/notification.min.js +1 -1
  22. package/dist/js/components/parallax.js +6 -6
  23. package/dist/js/components/parallax.min.js +1 -1
  24. package/dist/js/components/slider-parallax.js +6 -6
  25. package/dist/js/components/slider-parallax.min.js +1 -1
  26. package/dist/js/components/slider.js +9 -6
  27. package/dist/js/components/slider.min.js +1 -1
  28. package/dist/js/components/slideshow-parallax.js +6 -6
  29. package/dist/js/components/slideshow-parallax.min.js +1 -1
  30. package/dist/js/components/slideshow.js +9 -6
  31. package/dist/js/components/slideshow.min.js +1 -1
  32. package/dist/js/components/sortable.js +5 -8
  33. package/dist/js/components/sortable.min.js +1 -1
  34. package/dist/js/components/tooltip.js +1 -1
  35. package/dist/js/components/tooltip.min.js +1 -1
  36. package/dist/js/components/upload.js +1 -1
  37. package/dist/js/components/upload.min.js +1 -1
  38. package/dist/js/uikit-core.js +115 -111
  39. package/dist/js/uikit-core.min.js +1 -1
  40. package/dist/js/uikit-icons.js +1 -1
  41. package/dist/js/uikit-icons.min.js +1 -1
  42. package/dist/js/uikit.js +121 -122
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +4 -3
  45. package/src/js/api/observer.js +2 -2
  46. package/src/js/components/filter.js +1 -8
  47. package/src/js/components/sortable.js +7 -9
  48. package/src/js/core/icon.js +2 -1
  49. package/src/js/core/svg.js +7 -3
  50. package/src/js/mixin/media.js +1 -1
  51. package/src/js/mixin/parallax.js +2 -2
  52. package/src/js/mixin/slider-parallax.js +5 -0
  53. package/src/js/util/filter.js +3 -3
  54. package/src/js/util/selector.js +2 -2
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.20.10 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.20.11-dev.3a41e0fa6 | 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() :
@@ -348,9 +348,9 @@
348
348
  }
349
349
  function getTargetedElement(el) {
350
350
  if (isSameSiteAnchor(el)) {
351
- el = toNode(el);
352
- const id = decodeURIComponent(el.hash).substring(1);
353
- return document.getElementById(id) || document.getElementsByName(id)[0];
351
+ const { hash, ownerDocument } = toNode(el);
352
+ const id = decodeURIComponent(hash).slice(1);
353
+ return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];
354
354
  }
355
355
  }
356
356
 
@@ -389,9 +389,9 @@
389
389
  };
390
390
  });
391
391
  const parsePositionSelector = memoize((selector) => {
392
- selector = selector.substr(1).trim();
392
+ selector = selector.slice(1).trim();
393
393
  const index2 = selector.indexOf(" ");
394
- return ~index2 ? [selector.substring(0, index2), selector.substring(index2 + 1)] : [selector, ""];
394
+ return ~index2 ? [selector.slice(0, index2), selector.slice(index2 + 1)] : [selector, ""];
395
395
  });
396
396
  function _query(selector, context = document, queryFn) {
397
397
  if (!selector || !isString(selector)) {
@@ -2395,7 +2395,7 @@
2395
2395
  return ["filter", "sort"].every((prop) => isEqual(stateA[prop], stateB[prop]));
2396
2396
  }
2397
2397
  function applyState(state, target, children) {
2398
- const selector = getSelector(state);
2398
+ const selector = Object.values(state.filter).join("");
2399
2399
  for (const el of children) {
2400
2400
  css(el, "display", selector && !matches(el, selector) ? "none" : "");
2401
2401
  }
@@ -2433,11 +2433,6 @@
2433
2433
  const { filter = "", group = "", sort, order = "asc" } = getFilter(el, attr2);
2434
2434
  return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[""] : stateSort === sort && stateOrder === order;
2435
2435
  }
2436
- function getSelector({ filter }) {
2437
- let selector = "";
2438
- each(filter, (value) => selector += value || "");
2439
- return selector;
2440
- }
2441
2436
  function sortItems(nodes, sort, order) {
2442
2437
  return [...nodes].sort(
2443
2438
  (a, b) => data(a, sort).localeCompare(data(b, sort), void 0, { numeric: true }) * (order === "asc" || -1)
@@ -3348,7 +3343,7 @@
3348
3343
  }
3349
3344
  const key = `_observe${instance._observers.length}`;
3350
3345
  if (isFunction(target) && !hasOwn(instance, key)) {
3351
- registerComputed(instance, key, () => target.call(instance, instance));
3346
+ registerComputed(instance, key, () => toNodes(target.call(instance, instance)));
3352
3347
  }
3353
3348
  handler = isString(handler) ? instance[handler] : handler.bind(instance);
3354
3349
  if (isFunction(options)) {
@@ -3539,7 +3534,7 @@
3539
3534
  };
3540
3535
  App.util = util;
3541
3536
  App.options = {};
3542
- App.version = "3.20.10";
3537
+ App.version = "3.20.11-dev.3a41e0fa6";
3543
3538
 
3544
3539
  const PREFIX = "uk-";
3545
3540
  const DATA = "__uikit__";
@@ -4522,7 +4517,7 @@
4522
4517
  function toMedia(value, element) {
4523
4518
  if (isString(value)) {
4524
4519
  if (startsWith(value, "@")) {
4525
- value = toFloat(css(element, `--uk-breakpoint-${value.substr(1)}`));
4520
+ value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
4526
4521
  } else if (isNaN(value)) {
4527
4522
  return value;
4528
4523
  }
@@ -4725,13 +4720,13 @@
4725
4720
  };
4726
4721
  }
4727
4722
  function getBackgroundPos(el, prop) {
4728
- return getCssValue(el, `background-position-${prop.substr(-1)}`, "");
4723
+ return getCssValue(el, `background-position-${prop.slice(-1)}`, "");
4729
4724
  }
4730
4725
  function setBackgroundPosFn(bgProps, positions, props2) {
4731
4726
  return function(css2, percent) {
4732
4727
  for (const prop of bgProps) {
4733
4728
  const value = getValue(props2[prop], percent);
4734
- css2[`background-position-${prop.substr(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
4729
+ css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
4735
4730
  }
4736
4731
  };
4737
4732
  }
@@ -4938,6 +4933,9 @@
4938
4933
  return false;
4939
4934
  }
4940
4935
  const target = this.parallaxTarget;
4936
+ if (!target) {
4937
+ return false;
4938
+ }
4941
4939
  const start = toPx(this.parallaxStart, "height", target, true);
4942
4940
  const end = toPx(this.parallaxEnd, "height", target, true);
4943
4941
  const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
@@ -5741,11 +5739,10 @@
5741
5739
  },
5742
5740
  move: throttle(function(e) {
5743
5741
  assign(this.pos, getEventPos(e));
5744
- if (this.drag) {
5745
- this.$emit("move");
5746
- } else if (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold) {
5742
+ if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {
5747
5743
  this.start(e);
5748
5744
  }
5745
+ this.$emit("move");
5749
5746
  }),
5750
5747
  end() {
5751
5748
  off(document, pointerMove$1, this.move);
@@ -5905,10 +5902,8 @@
5905
5902
  return function(...args) {
5906
5903
  if (!throttled) {
5907
5904
  throttled = true;
5908
- requestAnimationFrame(() => {
5909
- throttled = false;
5910
- fn.call(this, ...args);
5911
- });
5905
+ fn.call(this, ...args);
5906
+ requestAnimationFrame(() => throttled = false);
5912
5907
  }
5913
5908
  };
5914
5909
  }
@@ -7891,6 +7886,107 @@
7891
7886
  dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
7892
7887
  }
7893
7888
 
7889
+ var svg = {
7890
+ mixins: [Svg],
7891
+ args: "src",
7892
+ props: {
7893
+ src: String,
7894
+ icon: String,
7895
+ attributes: "list",
7896
+ strokeAnimation: Boolean
7897
+ },
7898
+ data: {
7899
+ strokeAnimation: false
7900
+ },
7901
+ observe: [
7902
+ mutation({
7903
+ async handler() {
7904
+ const svg = await this.svg;
7905
+ if (svg) {
7906
+ applyAttributes.call(this, svg);
7907
+ }
7908
+ },
7909
+ options: {
7910
+ attributes: true,
7911
+ attributeFilter: ["id", "class", "style"]
7912
+ }
7913
+ })
7914
+ ],
7915
+ async connected() {
7916
+ if (includes(this.src, "#")) {
7917
+ [this.src, this.icon] = this.src.split("#");
7918
+ }
7919
+ const svg = await this.svg;
7920
+ if (svg) {
7921
+ applyAttributes.call(this, svg);
7922
+ if (this.strokeAnimation) {
7923
+ applyAnimation(svg);
7924
+ }
7925
+ }
7926
+ },
7927
+ methods: {
7928
+ async getSvg() {
7929
+ if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
7930
+ await new Promise((resolve) => once(this.$el, "load", resolve));
7931
+ }
7932
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
7933
+ }
7934
+ }
7935
+ };
7936
+ function applyAttributes(el) {
7937
+ const { $el } = this;
7938
+ addClass(el, attr($el, "class"), "uk-svg");
7939
+ for (let i = 0; i < $el.style.length; i++) {
7940
+ const prop = $el.style[i];
7941
+ css(el, prop, css($el, prop));
7942
+ }
7943
+ for (const attribute in this.attributes) {
7944
+ const [prop, value] = this.attributes[attribute].split(":", 2);
7945
+ attr(el, prop, value);
7946
+ }
7947
+ if (!this.$el.id) {
7948
+ removeAttr(el, "id");
7949
+ }
7950
+ }
7951
+ const loadSVG = memoize(async (src) => {
7952
+ if (src) {
7953
+ if (startsWith(src, "data:")) {
7954
+ return decodeURIComponent(src.split(",")[1]);
7955
+ } else {
7956
+ return (await fetch(src)).text();
7957
+ }
7958
+ } else {
7959
+ return Promise.reject();
7960
+ }
7961
+ });
7962
+ function parseSVG(svg, icon) {
7963
+ if (icon && includes(svg, "<symbol")) {
7964
+ svg = parseSymbols(svg)[icon] || svg;
7965
+ }
7966
+ return stringToSvg(svg);
7967
+ }
7968
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
7969
+ const parseSymbols = memoize(function(svg) {
7970
+ const symbols = {};
7971
+ symbolRe.lastIndex = 0;
7972
+ let match;
7973
+ while (match = symbolRe.exec(svg)) {
7974
+ symbols[match[3]] = `<svg ${match[1]}svg>`;
7975
+ }
7976
+ return symbols;
7977
+ });
7978
+ function applyAnimation(el) {
7979
+ const length = getMaxPathLength(el);
7980
+ if (length) {
7981
+ css(el, "--uk-animation-stroke", length);
7982
+ }
7983
+ }
7984
+ function stringToSvg(string) {
7985
+ const container = document.createElement("template");
7986
+ container.innerHTML = string;
7987
+ return container.content.firstElementChild;
7988
+ }
7989
+
7894
7990
  const icons = {
7895
7991
  spinner,
7896
7992
  totop,
@@ -8061,7 +8157,7 @@
8061
8157
  return null;
8062
8158
  }
8063
8159
  if (!parsed[icon]) {
8064
- parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
8160
+ parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);
8065
8161
  }
8066
8162
  return parsed[icon].cloneNode(true);
8067
8163
  }
@@ -9280,103 +9376,6 @@
9280
9376
  }
9281
9377
  }
9282
9378
 
9283
- var svg = {
9284
- mixins: [Svg],
9285
- args: "src",
9286
- props: {
9287
- src: String,
9288
- icon: String,
9289
- attributes: "list",
9290
- strokeAnimation: Boolean
9291
- },
9292
- data: {
9293
- strokeAnimation: false
9294
- },
9295
- observe: [
9296
- mutation({
9297
- async handler() {
9298
- const svg = await this.svg;
9299
- if (svg) {
9300
- applyAttributes.call(this, svg);
9301
- }
9302
- },
9303
- options: {
9304
- attributes: true,
9305
- attributeFilter: ["id", "class", "style"]
9306
- }
9307
- })
9308
- ],
9309
- async connected() {
9310
- if (includes(this.src, "#")) {
9311
- [this.src, this.icon] = this.src.split("#");
9312
- }
9313
- const svg = await this.svg;
9314
- if (svg) {
9315
- applyAttributes.call(this, svg);
9316
- if (this.strokeAnimation) {
9317
- applyAnimation(svg);
9318
- }
9319
- }
9320
- },
9321
- methods: {
9322
- async getSvg() {
9323
- if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
9324
- await new Promise((resolve) => once(this.$el, "load", resolve));
9325
- }
9326
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
9327
- }
9328
- }
9329
- };
9330
- function applyAttributes(el) {
9331
- const { $el } = this;
9332
- addClass(el, attr($el, "class"), "uk-svg");
9333
- for (let i = 0; i < $el.style.length; i++) {
9334
- const prop = $el.style[i];
9335
- css(el, prop, css($el, prop));
9336
- }
9337
- for (const attribute in this.attributes) {
9338
- const [prop, value] = this.attributes[attribute].split(":", 2);
9339
- attr(el, prop, value);
9340
- }
9341
- if (!this.$el.id) {
9342
- removeAttr(el, "id");
9343
- }
9344
- }
9345
- const loadSVG = memoize(async (src) => {
9346
- if (src) {
9347
- if (startsWith(src, "data:")) {
9348
- return decodeURIComponent(src.split(",")[1]);
9349
- } else {
9350
- return (await fetch(src)).text();
9351
- }
9352
- } else {
9353
- return Promise.reject();
9354
- }
9355
- });
9356
- function parseSVG(svg, icon) {
9357
- if (icon && includes(svg, "<symbol")) {
9358
- svg = parseSymbols(svg)[icon] || svg;
9359
- }
9360
- svg = $(svg.substr(svg.indexOf("<svg")));
9361
- return (svg == null ? void 0 : svg.hasChildNodes()) && svg;
9362
- }
9363
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
9364
- const parseSymbols = memoize(function(svg) {
9365
- const symbols = {};
9366
- symbolRe.lastIndex = 0;
9367
- let match;
9368
- while (match = symbolRe.exec(svg)) {
9369
- symbols[match[3]] = `<svg ${match[1]}svg>`;
9370
- }
9371
- return symbols;
9372
- });
9373
- function applyAnimation(el) {
9374
- const length = getMaxPathLength(el);
9375
- if (length) {
9376
- css(el, "--uk-animation-stroke", length);
9377
- }
9378
- }
9379
-
9380
9379
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
9381
9380
  var Switcher = {
9382
9381
  mixins: [Togglable],