uikit 3.16.4 → 3.16.5-dev.2fd0fea3e

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/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +7 -0
  3. package/build/util.js +2 -1
  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 +1 -1
  15. package/dist/js/components/filter.min.js +1 -1
  16. package/dist/js/components/lightbox-panel.js +14 -6
  17. package/dist/js/components/lightbox-panel.min.js +1 -1
  18. package/dist/js/components/lightbox.js +14 -6
  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 +5 -6
  23. package/dist/js/components/parallax.min.js +1 -1
  24. package/dist/js/components/slider-parallax.js +1 -1
  25. package/dist/js/components/slider-parallax.min.js +1 -1
  26. package/dist/js/components/slider.js +14 -6
  27. package/dist/js/components/slider.min.js +1 -1
  28. package/dist/js/components/slideshow-parallax.js +1 -1
  29. package/dist/js/components/slideshow-parallax.min.js +1 -1
  30. package/dist/js/components/slideshow.js +14 -6
  31. package/dist/js/components/slideshow.min.js +1 -1
  32. package/dist/js/components/sortable.js +1 -1
  33. package/dist/js/components/sortable.min.js +1 -1
  34. package/dist/js/components/tooltip.js +4 -4
  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 +54 -62
  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 +64 -64
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +1 -1
  45. package/src/js/api/component.js +2 -2
  46. package/src/js/api/hooks.js +1 -1
  47. package/src/js/api/observables.js +59 -6
  48. package/src/js/core/offcanvas.js +6 -2
  49. package/src/js/core/switcher.js +8 -8
  50. package/src/js/mixin/slider-autoplay.js +10 -2
  51. package/src/js/mixin/swipe.js +0 -74
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.16.4 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.16.5-dev.2fd0fea3e | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2140,7 +2140,7 @@
2140
2140
  };
2141
2141
  App.util = util;
2142
2142
  App.options = {};
2143
- App.version = "3.16.4";
2143
+ App.version = "3.16.5-dev.2fd0fea3e";
2144
2144
 
2145
2145
  const PREFIX = "uk-";
2146
2146
  const DATA = "__uikit__";
@@ -2165,9 +2165,9 @@
2165
2165
  }
2166
2166
  return components$2[id] = opt;
2167
2167
  }
2168
- function createComponent(name, element, data) {
2168
+ function createComponent(name, element, data, ...args) {
2169
2169
  const Component = component(name);
2170
- return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [...arguments] }) : element ? $$(element).map(init)[0] : init();
2170
+ return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();
2171
2171
  function init(element2) {
2172
2172
  const instance = getComponent(element2, name);
2173
2173
  if (instance) {
@@ -2591,12 +2591,11 @@
2591
2591
  function scroll$1(options) {
2592
2592
  return observe(
2593
2593
  function(target, handler) {
2594
- const off = on(target, "scroll", handler, {
2595
- passive: true,
2596
- capture: true
2597
- });
2598
2594
  return {
2599
- disconnect: off
2595
+ disconnect: on(target, "scroll", handler, {
2596
+ passive: true,
2597
+ capture: true
2598
+ })
2600
2599
  };
2601
2600
  },
2602
2601
  {
@@ -2606,6 +2605,34 @@
2606
2605
  "scroll"
2607
2606
  );
2608
2607
  }
2608
+ function swipe(options) {
2609
+ return {
2610
+ observe(target, handler) {
2611
+ return {
2612
+ observe: noop,
2613
+ unobserve: noop,
2614
+ disconnect: on(target, pointerDown$1, handler, { passive: true })
2615
+ };
2616
+ },
2617
+ handler(e) {
2618
+ if (!isTouch(e)) {
2619
+ return;
2620
+ }
2621
+ const pos = getEventPos(e);
2622
+ const target = "tagName" in e.target ? e.target : parent(e.target);
2623
+ once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {
2624
+ const { x, y } = getEventPos(e2);
2625
+ if (e2.type !== "scroll" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
2626
+ setTimeout(() => {
2627
+ trigger(target, "swipe");
2628
+ trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
2629
+ });
2630
+ }
2631
+ });
2632
+ },
2633
+ ...options
2634
+ };
2635
+ }
2609
2636
  function observe(observe2, options, emit) {
2610
2637
  return {
2611
2638
  observe: observe2,
@@ -2615,6 +2642,9 @@
2615
2642
  ...options
2616
2643
  };
2617
2644
  }
2645
+ function swipeDirection(x1, y1, x2, y2) {
2646
+ return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? "Left" : "Right" : y1 - y2 > 0 ? "Up" : "Down";
2647
+ }
2618
2648
 
2619
2649
  var Accordion = {
2620
2650
  mixins: [Class, Togglable],
@@ -5121,56 +5151,14 @@
5121
5151
  }
5122
5152
  };
5123
5153
 
5124
- var Swipe = {
5125
- props: {
5126
- swiping: Boolean
5127
- },
5128
- data: {
5129
- swiping: true
5130
- },
5131
- computed: {
5132
- swipeTarget(props, $el) {
5133
- return $el;
5134
- }
5135
- },
5136
- connected() {
5137
- if (!this.swiping) {
5138
- return;
5139
- }
5140
- registerEvent(this, {
5141
- el: this.swipeTarget,
5142
- name: pointerDown$1,
5143
- passive: true,
5144
- handler(e) {
5145
- if (!isTouch(e)) {
5146
- return;
5147
- }
5148
- const pos = getEventPos(e);
5149
- const target = "tagName" in e.target ? e.target : parent(e.target);
5150
- once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {
5151
- const { x, y } = getEventPos(e2);
5152
- if (e2.type !== "scroll" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
5153
- setTimeout(() => {
5154
- trigger(target, "swipe");
5155
- trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);
5156
- });
5157
- }
5158
- });
5159
- }
5160
- });
5161
- }
5162
- };
5163
- function swipeDirection(x1, y1, x2, y2) {
5164
- return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? "Left" : "Right" : y1 - y2 > 0 ? "Up" : "Down";
5165
- }
5166
-
5167
5154
  var offcanvas = {
5168
- mixins: [Modal, Swipe],
5155
+ mixins: [Modal],
5169
5156
  args: "mode",
5170
5157
  props: {
5171
5158
  mode: String,
5172
5159
  flip: Boolean,
5173
- overlay: Boolean
5160
+ overlay: Boolean,
5161
+ swiping: Boolean
5174
5162
  },
5175
5163
  data: {
5176
5164
  mode: "slide",
@@ -5185,7 +5173,8 @@
5185
5173
  clsMode: "uk-offcanvas",
5186
5174
  clsOverlay: "uk-offcanvas-overlay",
5187
5175
  selClose: ".uk-offcanvas-close",
5188
- container: false
5176
+ container: false,
5177
+ swiping: true
5189
5178
  },
5190
5179
  computed: {
5191
5180
  clsFlip({ flip, clsFlip }) {
@@ -5207,6 +5196,7 @@
5207
5196
  return mode === "reveal" ? parent(this.panel) : this.panel;
5208
5197
  }
5209
5198
  },
5199
+ observe: swipe({ filter: ({ swiping }) => swiping }),
5210
5200
  update: {
5211
5201
  read() {
5212
5202
  if (this.isToggled() && !isVisible(this.$el)) {
@@ -5948,14 +5938,15 @@
5948
5938
 
5949
5939
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
5950
5940
  var Switcher = {
5951
- mixins: [Swipe, Togglable],
5941
+ mixins: [Togglable],
5952
5942
  args: "connect",
5953
5943
  props: {
5954
5944
  connect: String,
5955
5945
  toggle: String,
5956
5946
  itemNav: String,
5957
5947
  active: Number,
5958
- followFocus: Boolean
5948
+ followFocus: Boolean,
5949
+ swiping: Boolean
5959
5950
  },
5960
5951
  data: {
5961
5952
  connect: "~.uk-switcher",
@@ -5965,7 +5956,8 @@
5965
5956
  cls: "uk-active",
5966
5957
  attrItem: "uk-switcher-item",
5967
5958
  selVertical: ".uk-nav",
5968
- followFocus: false
5959
+ followFocus: false,
5960
+ swiping: true
5969
5961
  },
5970
5962
  computed: {
5971
5963
  connects: {
@@ -6009,15 +6001,15 @@
6009
6001
  return children(this.$el).filter(
6010
6002
  (child) => this.toggles.some((toggle) => within(toggle, child))
6011
6003
  );
6012
- },
6013
- swipeTarget() {
6014
- return this.connects;
6015
6004
  }
6016
6005
  },
6017
6006
  connected() {
6018
6007
  attr(this.$el, "role", "tablist");
6019
6008
  },
6020
- observe: lazyload({ targets: ({ connectChildren }) => connectChildren }),
6009
+ observe: [
6010
+ lazyload({ targets: ({ connectChildren }) => connectChildren }),
6011
+ swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })
6012
+ ],
6021
6013
  events: [
6022
6014
  {
6023
6015
  name: "click keydown",
@@ -7265,14 +7257,22 @@
7265
7257
  filter() {
7266
7258
  return this.autoplay;
7267
7259
  },
7268
- handler: "stopAutoplay"
7260
+ handler(e) {
7261
+ if (e.type !== pointerEnter || this.pauseOnHover) {
7262
+ this.stopAutoplay();
7263
+ }
7264
+ }
7269
7265
  },
7270
7266
  {
7271
7267
  name: `${pointerLeave} focusout`,
7272
7268
  filter() {
7273
7269
  return this.autoplay;
7274
7270
  },
7275
- handler: "startAutoplay"
7271
+ handler(e) {
7272
+ if (e.type !== pointerLeave || this.pauseOnHover) {
7273
+ this.startAutoplay();
7274
+ }
7275
+ }
7276
7276
  }
7277
7277
  ],
7278
7278
  methods: {