uikit 3.16.16-dev.1d3cd4b76 → 3.16.16-dev.7b3ba4436

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 (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  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 +3 -3
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +26 -25
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +26 -25
  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 +2 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +2 -2
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +26 -25
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +2 -2
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +26 -25
  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 +1 -1
  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 +21 -30
  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 +63 -69
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +7 -7
  43. package/src/js/api/global.js +1 -1
  44. package/src/js/components/filter.js +2 -2
  45. package/src/js/components/internal/slider-transitioner.js +15 -15
  46. package/src/js/components/slider.js +2 -1
  47. package/src/js/core/drop.js +2 -2
  48. package/src/js/core/modal.js +19 -21
  49. package/src/js/mixin/internal/slideshow-transitioner.js +16 -14
  50. package/src/js/mixin/parallax.js +2 -1
  51. package/src/js/mixin/slider-drag.js +12 -6
  52. package/src/js/mixin/slider-nav.js +1 -1
  53. package/src/js/mixin/slider.js +3 -17
  54. package/src/js/util/lang.js +0 -9
  55. package/tests/modal.html +16 -15
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.16.16-dev.1d3cd4b76 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.16.16-dev.7b3ba4436 | 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() :
@@ -191,14 +191,6 @@
191
191
  const cache = /* @__PURE__ */ Object.create(null);
192
192
  return (key) => cache[key] || (cache[key] = fn(key));
193
193
  }
194
- class Deferred {
195
- constructor() {
196
- this.promise = new Promise((resolve, reject) => {
197
- this.reject = reject;
198
- this.resolve = resolve;
199
- });
200
- }
201
- }
202
194
 
203
195
  function attr(element, name, value) {
204
196
  var _a;
@@ -1529,7 +1521,6 @@
1529
1521
  $: $,
1530
1522
  $$: $$,
1531
1523
  Animation: Animation,
1532
- Deferred: Deferred,
1533
1524
  Dimensions: Dimensions,
1534
1525
  MouseTracker: MouseTracker,
1535
1526
  Transition: Transition,
@@ -2159,7 +2150,7 @@
2159
2150
  };
2160
2151
  App.util = util;
2161
2152
  App.options = {};
2162
- App.version = "3.16.16-dev.1d3cd4b76";
2153
+ App.version = "3.16.16-dev.7b3ba4436";
2163
2154
 
2164
2155
  const PREFIX = "uk-";
2165
2156
  const DATA = "__uikit__";
@@ -2237,7 +2228,7 @@
2237
2228
  component2.options = mergeOptions(component2.options, mixin);
2238
2229
  };
2239
2230
  App.extend = function(options) {
2240
- options = options || {};
2231
+ options || (options = {});
2241
2232
  const Super = this;
2242
2233
  const Sub = function UIkitComponent(options2) {
2243
2234
  init$1(this, options2);
@@ -3189,8 +3180,8 @@
3189
3180
  ];
3190
3181
  },
3191
3182
  target({ target, targetX, targetY }, $el) {
3192
- targetX = targetX || target || this.targetEl;
3193
- targetY = targetY || target || this.targetEl;
3183
+ targetX || (targetX = target || this.targetEl);
3184
+ targetY || (targetY = target || this.targetEl);
3194
3185
  return [
3195
3186
  targetX === true ? window : query(targetX, $el),
3196
3187
  targetY === true ? window : query(targetY, $el)
@@ -4971,22 +4962,21 @@
4971
4962
  modal.alert = function(message, options) {
4972
4963
  return openDialog(
4973
4964
  ({ i18n }) => `<div class="uk-modal-body">${isString(message) ? message : html(message)}</div> <div class="uk-modal-footer uk-text-right"> <button class="uk-button uk-button-primary uk-modal-close" autofocus>${i18n.ok}</button> </div>`,
4974
- options,
4975
- (deferred) => deferred.resolve()
4965
+ options
4976
4966
  );
4977
4967
  };
4978
4968
  modal.confirm = function(message, options) {
4979
4969
  return openDialog(
4980
4970
  ({ i18n }) => `<form> <div class="uk-modal-body">${isString(message) ? message : html(message)}</div> <div class="uk-modal-footer uk-text-right"> <button class="uk-button uk-button-default uk-modal-close" type="button">${i18n.cancel}</button> <button class="uk-button uk-button-primary" autofocus>${i18n.ok}</button> </div> </form>`,
4981
4971
  options,
4982
- (deferred) => deferred.reject()
4972
+ () => Promise.reject()
4983
4973
  );
4984
4974
  };
4985
4975
  modal.prompt = function(message, value, options) {
4986
4976
  return openDialog(
4987
4977
  ({ i18n }) => `<form class="uk-form-stacked"> <div class="uk-modal-body"> <label>${isString(message) ? message : html(message)}</label> <input class="uk-input" value="${value || ""}" autofocus> </div> <div class="uk-modal-footer uk-text-right"> <button class="uk-button uk-button-default uk-modal-close" type="button">${i18n.cancel}</button> <button class="uk-button uk-button-primary">${i18n.ok}</button> </div> </form>`,
4988
4978
  options,
4989
- (deferred) => deferred.resolve(null),
4979
+ () => null,
4990
4980
  (dialog) => $("input", dialog.$el).value
4991
4981
  );
4992
4982
  };
@@ -4994,7 +4984,7 @@
4994
4984
  ok: "Ok",
4995
4985
  cancel: "Cancel"
4996
4986
  };
4997
- function openDialog(tmpl, options, hideFn, submitFn) {
4987
+ function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {
4998
4988
  options = {
4999
4989
  bgClose: false,
5000
4990
  escClose: true,
@@ -5003,17 +4993,18 @@
5003
4993
  i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }
5004
4994
  };
5005
4995
  const dialog = modal.dialog(tmpl(options), options);
5006
- const deferred = new Deferred();
5007
- let resolved = false;
5008
- on(dialog.$el, "submit", "form", (e) => {
5009
- e.preventDefault();
5010
- deferred.resolve(submitFn == null ? void 0 : submitFn(dialog));
5011
- resolved = true;
5012
- dialog.hide();
5013
- });
5014
- on(dialog.$el, "hide", () => !resolved && hideFn(deferred));
5015
- deferred.promise.dialog = dialog;
5016
- return deferred.promise;
4996
+ return assign(
4997
+ new Promise((resolve) => {
4998
+ const off = on(dialog.$el, "hide", () => resolve(hideFn()));
4999
+ on(dialog.$el, "submit", "form", (e) => {
5000
+ e.preventDefault();
5001
+ resolve(submitFn(dialog));
5002
+ off();
5003
+ dialog.hide();
5004
+ });
5005
+ }),
5006
+ { dialog }
5007
+ );
5017
5008
  }
5018
5009
  }
5019
5010
 
@@ -6651,11 +6642,11 @@
6651
6642
  mixins: [Animate],
6652
6643
  args: "target",
6653
6644
  props: {
6654
- target: Boolean,
6645
+ target: String,
6655
6646
  selActive: Boolean
6656
6647
  },
6657
6648
  data: {
6658
- target: null,
6649
+ target: "",
6659
6650
  selActive: false,
6660
6651
  attrItem: "uk-filter-control",
6661
6652
  cls: "uk-active",
@@ -6859,7 +6850,7 @@
6859
6850
  function Transitioner$1(prev, next, dir, { animation, easing }) {
6860
6851
  const { percent, translate, show = noop } = animation;
6861
6852
  const props = show(dir);
6862
- const deferred = new Deferred();
6853
+ let resolve;
6863
6854
  return {
6864
6855
  dir,
6865
6856
  show(duration, percent2 = 0, linear) {
@@ -6868,25 +6859,27 @@
6868
6859
  this.translate(percent2);
6869
6860
  triggerUpdate$1(next, "itemin", { percent: percent2, duration, timing, dir });
6870
6861
  triggerUpdate$1(prev, "itemout", { percent: 1 - percent2, duration, timing, dir });
6871
- Promise.all([
6872
- Transition.start(next, props[1], duration, timing),
6873
- Transition.start(prev, props[0], duration, timing)
6874
- ]).then(() => {
6875
- this.reset();
6876
- deferred.resolve();
6877
- }, noop);
6878
- return deferred.promise;
6862
+ return new Promise((res) => {
6863
+ resolve || (resolve = res);
6864
+ Promise.all([
6865
+ Transition.start(next, props[1], duration, timing),
6866
+ Transition.start(prev, props[0], duration, timing)
6867
+ ]).then(() => {
6868
+ this.reset();
6869
+ resolve();
6870
+ }, noop);
6871
+ });
6879
6872
  },
6880
6873
  cancel() {
6881
- Transition.cancel([next, prev]);
6874
+ return Transition.cancel([next, prev]);
6882
6875
  },
6883
6876
  reset() {
6884
6877
  for (const prop in props[0]) {
6885
6878
  css([next, prev], prop, "");
6886
6879
  }
6887
6880
  },
6888
- forward(duration, percent2 = this.percent()) {
6889
- Transition.cancel([next, prev]);
6881
+ async forward(duration, percent2 = this.percent()) {
6882
+ await this.cancel();
6890
6883
  return this.show(duration, percent2, true);
6891
6884
  },
6892
6885
  translate(percent2) {
@@ -7069,7 +7062,7 @@
7069
7062
  if (active) {
7070
7063
  focusEl = button;
7071
7064
  }
7072
- focus = focus || matches(button, ":focus");
7065
+ focus || (focus = matches(button, ":focus"));
7073
7066
  } else {
7074
7067
  toggleClass(
7075
7068
  el,
@@ -7165,17 +7158,16 @@
7165
7158
  e.cancelable && e.preventDefault();
7166
7159
  this.dragging = true;
7167
7160
  this.dir = distance < 0 ? 1 : -1;
7168
- const { slides } = this;
7169
- let { prevIndex } = this;
7161
+ let { slides, prevIndex } = this;
7170
7162
  let dis = Math.abs(distance);
7171
- let nextIndex = this.getIndex(prevIndex + this.dir, prevIndex);
7172
- let width = this._getDistance(prevIndex, nextIndex) || slides[prevIndex].offsetWidth;
7163
+ let nextIndex = this.getIndex(prevIndex + this.dir);
7164
+ let width = this._getDistance(prevIndex, nextIndex);
7173
7165
  while (nextIndex !== prevIndex && dis > width) {
7174
7166
  this.drag -= width * this.dir;
7175
7167
  prevIndex = nextIndex;
7176
7168
  dis -= width;
7177
- nextIndex = this.getIndex(prevIndex + this.dir, prevIndex);
7178
- width = this._getDistance(prevIndex, nextIndex) || slides[prevIndex].offsetWidth;
7169
+ nextIndex = this.getIndex(prevIndex + this.dir);
7170
+ width = this._getDistance(prevIndex, nextIndex);
7179
7171
  }
7180
7172
  this.percent = dis / width;
7181
7173
  const prev = slides[prevIndex];
@@ -7231,6 +7223,9 @@
7231
7223
  }
7232
7224
  css(this.list, { userSelect: "", pointerEvents: "" });
7233
7225
  this.drag = this.percent = null;
7226
+ },
7227
+ _getDistance(prev, next) {
7228
+ return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;
7234
7229
  }
7235
7230
  }
7236
7231
  };
@@ -7420,9 +7415,6 @@
7420
7415
  this.percent
7421
7416
  );
7422
7417
  },
7423
- _getDistance(prev, next) {
7424
- return this._getTransitioner(prev, prev !== next && next).getDistance();
7425
- },
7426
7418
  _translate(percent, prev = this.prevIndex, next = this.index) {
7427
7419
  const transitioner = this._getTransitioner(prev === next ? false : prev, next);
7428
7420
  transitioner.translate(percent);
@@ -7430,8 +7422,8 @@
7430
7422
  },
7431
7423
  _getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {
7432
7424
  return new this.Transitioner(
7433
- isNumber(prev) ? this.slides[prev] : prev,
7434
- isNumber(next) ? this.slides[next] : next,
7425
+ this.slides[prev] || prev,
7426
+ this.slides[next] || next,
7435
7427
  dir * (isRtl ? -1 : 1),
7436
7428
  options
7437
7429
  );
@@ -7936,7 +7928,7 @@
7936
7928
  getCss(percent) {
7937
7929
  const css2 = { transform: "", filter: "" };
7938
7930
  for (const prop in this.props) {
7939
- this.props[prop](css2, percent);
7931
+ this.props[prop](css2, clamp(percent));
7940
7932
  }
7941
7933
  css2.willChange = Object.keys(css2).filter((key) => css2[key] !== "").map(propName).join(",");
7942
7934
  return css2;
@@ -8276,9 +8268,9 @@
8276
8268
  };
8277
8269
 
8278
8270
  function Transitioner(prev, next, dir, { center, easing, list }) {
8279
- const deferred = new Deferred();
8280
8271
  const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;
8281
8272
  const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);
8273
+ let resolve;
8282
8274
  return {
8283
8275
  dir,
8284
8276
  show(duration, percent = 0, linear) {
@@ -8293,22 +8285,24 @@
8293
8285
  timing,
8294
8286
  dir
8295
8287
  });
8296
- Transition.start(
8297
- list,
8298
- { transform: translate(-to * (isRtl ? -1 : 1), "px") },
8299
- duration,
8300
- timing
8301
- ).then(deferred.resolve, noop);
8302
- return deferred.promise;
8288
+ return new Promise((res) => {
8289
+ resolve || (resolve = res);
8290
+ Transition.start(
8291
+ list,
8292
+ { transform: translate(-to * (isRtl ? -1 : 1), "px") },
8293
+ duration,
8294
+ timing
8295
+ ).then(resolve, noop);
8296
+ });
8303
8297
  },
8304
8298
  cancel() {
8305
- Transition.cancel(list);
8299
+ return Transition.cancel(list);
8306
8300
  },
8307
8301
  reset() {
8308
8302
  css(list, "transform", "");
8309
8303
  },
8310
- forward(duration, percent = this.percent()) {
8311
- Transition.cancel(list);
8304
+ async forward(duration, percent = this.percent()) {
8305
+ await this.cancel();
8312
8306
  return this.show(duration, percent, true);
8313
8307
  },
8314
8308
  translate(percent) {
@@ -8445,7 +8439,7 @@
8445
8439
  left = 0;
8446
8440
  }
8447
8441
  if (this.center) {
8448
- if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[+i + 1]).width / 2 > width / 2) {
8442
+ if (left < width / 2 && left + slideWidth + dimensions$1(getIndex(+i + 1, this.slides)).width / 2 > width / 2) {
8449
8443
  sets.push(+i);
8450
8444
  left = width / 2 - slideWidth / 2;
8451
8445
  }