uikit 3.21.14-dev.60ed95dfb → 3.21.14-dev.b1911d7ca

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 (98) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/css/uikit-core-rtl.css +216 -85
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +216 -85
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +220 -81
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +220 -81
  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 +406 -109
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +423 -114
  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 +15 -20
  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 +20 -26
  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 +5 -2
  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 +125 -130
  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 +478 -368
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +2 -2
  43. package/src/js/api/instance.js +1 -1
  44. package/src/js/components/internal/lightbox-animations.js +2 -1
  45. package/src/js/components/internal/slideshow-animations.js +5 -5
  46. package/src/js/components/lightbox-panel.js +172 -31
  47. package/src/js/components/lightbox.js +59 -6
  48. package/src/js/components/slideshow.js +1 -2
  49. package/src/js/core/icon.js +2 -2
  50. package/src/js/core/img.js +3 -5
  51. package/src/js/core/svg.js +8 -10
  52. package/src/js/core/video.js +4 -3
  53. package/src/js/mixin/internal/slideshow-animations.js +1 -6
  54. package/src/js/mixin/modal.js +1 -4
  55. package/src/js/mixin/slider-drag.js +5 -6
  56. package/src/js/mixin/slider-nav.js +1 -1
  57. package/src/js/mixin/slider.js +11 -13
  58. package/src/js/mixin/slideshow.js +1 -1
  59. package/src/js/mixin/togglable.js +4 -2
  60. package/src/js/util/dom.js +3 -1
  61. package/src/js/util/player.js +0 -4
  62. package/src/less/components/background.less +1 -9
  63. package/src/less/components/breadcrumb.less +6 -2
  64. package/src/less/components/button.less +1 -1
  65. package/src/less/components/form-range.less +52 -0
  66. package/src/less/components/form.less +1 -1
  67. package/src/less/components/lightbox.less +57 -89
  68. package/src/less/components/search.less +49 -23
  69. package/src/less/components/sticky.less +1 -10
  70. package/src/less/components/totop.less +1 -1
  71. package/src/less/components/transition.less +4 -4
  72. package/src/less/components/visibility.less +3 -2
  73. package/src/less/theme/form-range.less +12 -0
  74. package/src/less/theme/lightbox.less +2 -20
  75. package/src/less/theme/search.less +24 -10
  76. package/src/scss/components/background.scss +1 -9
  77. package/src/scss/components/breadcrumb.scss +6 -2
  78. package/src/scss/components/button.scss +1 -1
  79. package/src/scss/components/form-range.scss +12 -0
  80. package/src/scss/components/form.scss +1 -1
  81. package/src/scss/components/lightbox.scss +49 -77
  82. package/src/scss/components/search.scss +30 -12
  83. package/src/scss/components/sticky.scss +1 -10
  84. package/src/scss/components/totop.scss +1 -1
  85. package/src/scss/components/transition.scss +4 -4
  86. package/src/scss/components/visibility.scss +3 -2
  87. package/src/scss/mixins-theme.scss +51 -12
  88. package/src/scss/mixins.scss +45 -6
  89. package/src/scss/theme/form-range.scss +10 -0
  90. package/src/scss/theme/lightbox.scss +2 -20
  91. package/src/scss/theme/search.scss +10 -6
  92. package/src/scss/variables-theme.scss +32 -20
  93. package/src/scss/variables.scss +29 -24
  94. package/tests/breadcrumb.html +23 -5
  95. package/tests/lightbox.html +345 -30
  96. package/tests/navbar.html +19 -19
  97. package/tests/slideshow.html +1 -1
  98. package/tests/transition.html +2 -1
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.21.14-dev.60ed95dfb | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.21.14-dev.b1911d7ca | 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() :
@@ -746,7 +746,9 @@
746
746
  }
747
747
  function empty(element) {
748
748
  element = $(element);
749
- element.innerHTML = "";
749
+ if (element) {
750
+ element.innerHTML = "";
751
+ }
750
752
  return element;
751
753
  }
752
754
  function html(parent2, html2) {
@@ -1138,9 +1140,6 @@
1138
1140
  el.muted = true;
1139
1141
  }
1140
1142
  }
1141
- function isVideo(el) {
1142
- return isHTML5(el) || isIFrame(el);
1143
- }
1144
1143
  function isHTML5(el) {
1145
1144
  return isTag(el, "video");
1146
1145
  }
@@ -1606,7 +1605,6 @@
1606
1605
  isTag: isTag,
1607
1606
  isTouch: isTouch,
1608
1607
  isUndefined: isUndefined,
1609
- isVideo: isVideo,
1610
1608
  isVisible: isVisible,
1611
1609
  isVoidElement: isVoidElement,
1612
1610
  isWindow: isWindow,
@@ -2154,7 +2152,7 @@
2154
2152
  };
2155
2153
  App.util = util;
2156
2154
  App.options = {};
2157
- App.version = "3.21.14-dev.60ed95dfb";
2155
+ App.version = "3.21.14-dev.b1911d7ca";
2158
2156
 
2159
2157
  const PREFIX = "uk-";
2160
2158
  const DATA = "__uikit__";
@@ -2342,7 +2340,7 @@
2342
2340
  const instance = this;
2343
2341
  attachToElement(el, instance);
2344
2342
  instance.$options.el = el;
2345
- if (document.contains(el)) {
2343
+ if (el.isConnected) {
2346
2344
  callConnected(instance);
2347
2345
  }
2348
2346
  };
@@ -2513,8 +2511,12 @@
2513
2511
  addClass(el, cls);
2514
2512
  trigger(el, show ? "show" : "hide", [this]);
2515
2513
  const done = () => {
2514
+ var _a;
2516
2515
  removeClass(el, cls);
2517
2516
  trigger(el, show ? "shown" : "hidden", [this]);
2517
+ if (show) {
2518
+ (_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus();
2519
+ }
2518
2520
  };
2519
2521
  return promise ? promise.then(done, () => {
2520
2522
  removeClass(el, cls);
@@ -2547,7 +2549,6 @@
2547
2549
  if (changed) {
2548
2550
  trigger(el, "toggled", [toggled, this]);
2549
2551
  }
2550
- $$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
2551
2552
  }
2552
2553
  }
2553
2554
  };
@@ -2940,7 +2941,7 @@
2940
2941
  ],
2941
2942
  observe: [
2942
2943
  intersection({
2943
- filter: ({ $el, autoplay }) => autoplay !== "hover" && isVideo($el),
2944
+ filter: ({ autoplay }) => autoplay !== "hover",
2944
2945
  handler([{ isIntersecting }]) {
2945
2946
  if (!document.fullscreenElement) {
2946
2947
  if (isIntersecting) {
@@ -2953,7 +2954,9 @@
2953
2954
  }
2954
2955
  },
2955
2956
  args: { intersecting: false },
2956
- options: ({ $el, autoplay }) => ({ root: autoplay === "inview" ? null : parent($el) })
2957
+ options: ({ $el, autoplay }) => ({
2958
+ root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
2959
+ })
2957
2960
  })
2958
2961
  ]
2959
2962
  };
@@ -4405,116 +4408,6 @@
4405
4408
  dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4406
4409
  }
4407
4410
 
4408
- function getMaxPathLength(el) {
4409
- return isVisible(el) ? Math.ceil(
4410
- Math.max(0, ...$$("[stroke]", el).map((stroke) => {
4411
- var _a;
4412
- return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
4413
- }))
4414
- ) : 0;
4415
- }
4416
-
4417
- var svg = {
4418
- mixins: [Svg],
4419
- args: "src",
4420
- props: {
4421
- src: String,
4422
- icon: String,
4423
- attributes: "list",
4424
- strokeAnimation: Boolean
4425
- },
4426
- data: {
4427
- strokeAnimation: false
4428
- },
4429
- observe: [
4430
- mutation({
4431
- async handler() {
4432
- const svg = await this.svg;
4433
- if (svg) {
4434
- applyAttributes.call(this, svg);
4435
- }
4436
- },
4437
- options: {
4438
- attributes: true,
4439
- attributeFilter: ["id", "class", "style"]
4440
- }
4441
- })
4442
- ],
4443
- async connected() {
4444
- if (includes(this.src, "#")) {
4445
- [this.src, this.icon] = this.src.split("#");
4446
- }
4447
- const svg = await this.svg;
4448
- if (svg) {
4449
- applyAttributes.call(this, svg);
4450
- if (this.strokeAnimation) {
4451
- applyAnimation(svg);
4452
- }
4453
- }
4454
- },
4455
- methods: {
4456
- async getSvg() {
4457
- if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
4458
- await new Promise((resolve) => once(this.$el, "load", resolve));
4459
- }
4460
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
4461
- }
4462
- }
4463
- };
4464
- function applyAttributes(el) {
4465
- const { $el } = this;
4466
- addClass(el, attr($el, "class"), "uk-svg");
4467
- for (let i = 0; i < $el.style.length; i++) {
4468
- const prop = $el.style[i];
4469
- css(el, prop, css($el, prop));
4470
- }
4471
- for (const attribute in this.attributes) {
4472
- const [prop, value] = this.attributes[attribute].split(":", 2);
4473
- attr(el, prop, value);
4474
- }
4475
- if (!this.$el.id) {
4476
- removeAttr(el, "id");
4477
- }
4478
- }
4479
- const loadSVG = memoize(async (src) => {
4480
- if (src) {
4481
- if (startsWith(src, "data:")) {
4482
- return decodeURIComponent(src.split(",")[1]);
4483
- } else {
4484
- return (await fetch(src)).text();
4485
- }
4486
- } else {
4487
- return Promise.reject();
4488
- }
4489
- });
4490
- function parseSVG(svg, icon) {
4491
- if (icon && includes(svg, "<symbol")) {
4492
- svg = parseSymbols(svg)[icon] || svg;
4493
- }
4494
- return stringToSvg(svg);
4495
- }
4496
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4497
- const parseSymbols = memoize(function(svg) {
4498
- const symbols = {};
4499
- symbolRe.lastIndex = 0;
4500
- let match;
4501
- while (match = symbolRe.exec(svg)) {
4502
- symbols[match[3]] = `<svg ${match[1]}svg>`;
4503
- }
4504
- return symbols;
4505
- });
4506
- function applyAnimation(el) {
4507
- const length = getMaxPathLength(el);
4508
- if (length) {
4509
- css(el, "--uk-animation-stroke", length);
4510
- }
4511
- }
4512
- function stringToSvg(string) {
4513
- const container = document.createElement("template");
4514
- container.innerHTML = string;
4515
- return container.content.firstElementChild;
4516
- }
4517
-
4518
4411
  const icons = {
4519
4412
  spinner,
4520
4413
  totop,
@@ -4685,7 +4578,7 @@
4685
4578
  return null;
4686
4579
  }
4687
4580
  if (!parsed[icon]) {
4688
- parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);
4581
+ parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
4689
4582
  }
4690
4583
  return parsed[icon].cloneNode(true);
4691
4584
  }
@@ -4762,7 +4655,7 @@
4762
4655
  for (const prop of srcProps) {
4763
4656
  const value = data(sourceEl, prop);
4764
4657
  if (value) {
4765
- attr(targetEl, prop.replace(/^(data-)+/, ""), value);
4658
+ attr(targetEl, prop.replace(/data-/g, ""), value);
4766
4659
  }
4767
4660
  }
4768
4661
  }
@@ -4770,9 +4663,7 @@
4770
4663
  const img = new Image();
4771
4664
  wrapInPicture(img, sources);
4772
4665
  setSourceProps(el, img);
4773
- img.onload = () => {
4774
- setSrcAttrs(el, img.currentSrc);
4775
- };
4666
+ img.onload = () => setSrcAttrs(el, img.currentSrc);
4776
4667
  attr(img, "src", src);
4777
4668
  return img;
4778
4669
  }
@@ -5026,9 +4917,6 @@
5026
4917
  panel: ({ selPanel }, $el) => $(selPanel, $el),
5027
4918
  transitionElement() {
5028
4919
  return this.panel;
5029
- },
5030
- bgClose({ bgClose }) {
5031
- return bgClose && this.panel;
5032
4920
  }
5033
4921
  },
5034
4922
  connected() {
@@ -5191,7 +5079,7 @@
5191
5079
  }
5192
5080
  function listenForBackgroundClose(modal) {
5193
5081
  return on(document, pointerDown, ({ target }) => {
5194
- if (last(active) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
5082
+ if (last(active) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
5195
5083
  return;
5196
5084
  }
5197
5085
  once(
@@ -6162,6 +6050,113 @@
6162
6050
  }
6163
6051
  }
6164
6052
 
6053
+ function getMaxPathLength(el) {
6054
+ return isVisible(el) ? Math.ceil(
6055
+ Math.max(0, ...$$("[stroke]", el).map((stroke) => {
6056
+ var _a;
6057
+ return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
6058
+ }))
6059
+ ) : 0;
6060
+ }
6061
+
6062
+ var svg = {
6063
+ mixins: [Svg],
6064
+ args: "src",
6065
+ props: {
6066
+ src: String,
6067
+ icon: String,
6068
+ attributes: "list",
6069
+ strokeAnimation: Boolean
6070
+ },
6071
+ data: {
6072
+ strokeAnimation: false
6073
+ },
6074
+ observe: [
6075
+ mutation({
6076
+ async handler() {
6077
+ const svg = await this.svg;
6078
+ if (svg) {
6079
+ applyAttributes.call(this, svg);
6080
+ }
6081
+ },
6082
+ options: {
6083
+ attributes: true,
6084
+ attributeFilter: ["id", "class", "style"]
6085
+ }
6086
+ })
6087
+ ],
6088
+ async connected() {
6089
+ if (includes(this.src, "#")) {
6090
+ [this.src, this.icon] = this.src.split("#");
6091
+ }
6092
+ const svg = await this.svg;
6093
+ if (svg) {
6094
+ applyAttributes.call(this, svg);
6095
+ if (this.strokeAnimation) {
6096
+ applyAnimation(svg);
6097
+ }
6098
+ }
6099
+ },
6100
+ methods: {
6101
+ async getSvg() {
6102
+ if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
6103
+ await new Promise((resolve) => once(this.$el, "load", resolve));
6104
+ }
6105
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
6106
+ }
6107
+ }
6108
+ };
6109
+ function applyAttributes(el) {
6110
+ const { $el } = this;
6111
+ addClass(el, attr($el, "class"), "uk-svg");
6112
+ for (let i = 0; i < $el.style.length; i++) {
6113
+ const prop = $el.style[i];
6114
+ css(el, prop, css($el, prop));
6115
+ }
6116
+ for (const attribute in this.attributes) {
6117
+ const [prop, value] = this.attributes[attribute].split(":", 2);
6118
+ attr(el, prop, value);
6119
+ }
6120
+ if (!this.$el.id) {
6121
+ removeAttr(el, "id");
6122
+ }
6123
+ }
6124
+ const loadSVG = memoize(async (src) => {
6125
+ if (src) {
6126
+ if (startsWith(src, "data:")) {
6127
+ return decodeURIComponent(src.split(",")[1]);
6128
+ } else {
6129
+ const response = await fetch(src);
6130
+ if (response.headers.get("Content-Type") === "image/svg+xml") {
6131
+ return response.text();
6132
+ }
6133
+ }
6134
+ }
6135
+ return Promise.reject();
6136
+ });
6137
+ function parseSVG(svg, icon) {
6138
+ if (icon && includes(svg, "<symbol")) {
6139
+ svg = parseSymbols(svg)[icon] || svg;
6140
+ }
6141
+ return fragment(svg);
6142
+ }
6143
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
6144
+ const parseSymbols = memoize(function(svg) {
6145
+ const symbols = {};
6146
+ symbolRe.lastIndex = 0;
6147
+ let match;
6148
+ while (match = symbolRe.exec(svg)) {
6149
+ symbols[match[3]] = `<svg ${match[1]}svg>`;
6150
+ }
6151
+ return symbols;
6152
+ });
6153
+ function applyAnimation(el) {
6154
+ const length = getMaxPathLength(el);
6155
+ if (length) {
6156
+ css(el, "--uk-animation-stroke", length);
6157
+ }
6158
+ }
6159
+
6165
6160
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
6166
6161
  var Switcher = {
6167
6162
  mixins: [Togglable],