uikit 3.15.24 → 3.15.25-dev.c6f5a4c4e

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 +7 -0
  2. package/build/publishDev.js +3 -3
  3. package/build/release.js +3 -3
  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 +6 -6
  13. package/dist/js/components/countdown.min.js +1 -1
  14. package/dist/js/components/filter.js +5 -1
  15. package/dist/js/components/filter.min.js +1 -1
  16. package/dist/js/components/lightbox-panel.js +59 -76
  17. package/dist/js/components/lightbox-panel.min.js +1 -1
  18. package/dist/js/components/lightbox.js +59 -76
  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 +1 -1
  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 +2 -2
  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 +2 -2
  31. package/dist/js/components/slideshow.min.js +1 -1
  32. package/dist/js/components/sortable.js +8 -5
  33. package/dist/js/components/sortable.min.js +1 -1
  34. package/dist/js/components/tooltip.js +2 -7
  35. package/dist/js/components/tooltip.min.js +1 -1
  36. package/dist/js/components/upload.js +2 -2
  37. package/dist/js/components/upload.min.js +1 -1
  38. package/dist/js/uikit-core.js +127 -138
  39. package/dist/js/uikit-core.min.js +1 -1
  40. package/dist/js/uikit-icons.js +5 -1
  41. package/dist/js/uikit-icons.min.js +1 -1
  42. package/dist/js/uikit.js +149 -173
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +65 -65
  45. package/src/images/icons/android-robot.svg +6 -0
  46. package/src/images/icons/android.svg +3 -0
  47. package/src/images/icons/apple.svg +3 -0
  48. package/src/images/icons/microsoft.svg +3 -0
  49. package/src/js/components/countdown.js +5 -5
  50. package/src/js/components/lightbox-panel.js +6 -18
  51. package/src/js/components/sortable.js +3 -4
  52. package/src/js/components/tooltip.js +3 -8
  53. package/src/js/components/upload.js +1 -1
  54. package/src/js/core/drop.js +62 -50
  55. package/src/js/core/navbar.js +11 -29
  56. package/src/js/mixin/internal/animate-slide.js +5 -0
  57. package/src/js/mixin/modal.js +52 -58
  58. package/src/js/mixin/slider-autoplay.js +1 -1
  59. package/src/js/util/mouse.js +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.15.24 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.15.25-dev.c6f5a4c4e | 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() :
@@ -1397,7 +1397,7 @@
1397
1397
 
1398
1398
  cancel() {var _this$unbind;
1399
1399
  (_this$unbind = this.unbind) == null ? void 0 : _this$unbind.call(this);
1400
- this.interval && clearInterval(this.interval);
1400
+ clearInterval(this.interval);
1401
1401
  },
1402
1402
 
1403
1403
  movesTo(target) {
@@ -2977,7 +2977,7 @@
2977
2977
  UIkit.data = '__uikit__';
2978
2978
  UIkit.prefix = 'uk-';
2979
2979
  UIkit.options = {};
2980
- UIkit.version = '3.15.24';
2980
+ UIkit.version = '3.15.25-dev.c6f5a4c4e';
2981
2981
 
2982
2982
  globalAPI(UIkit);
2983
2983
  hooksAPI(UIkit);
@@ -3899,70 +3899,25 @@
3899
3899
  self: true,
3900
3900
 
3901
3901
  handler() {
3902
- once(
3903
- this.$el,
3904
- 'hide',
3905
- on(document, 'focusin', (e) => {
3906
- if (last(active$1) === this && !within(e.target, this.$el)) {
3907
- this.$el.focus();
3908
- }
3909
- }));
3910
-
3911
-
3912
- if (this.overlay) {
3913
- once(this.$el, 'hidden', preventBackgroundScroll(this.$el), { self: true });
3914
- }
3915
-
3916
3902
  if (this.stack) {
3917
3903
  css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3918
3904
  }
3919
3905
 
3920
- addClass(document.documentElement, this.clsPage);
3921
-
3922
- if (this.bgClose) {
3923
- once(
3924
- this.$el,
3925
- 'hide',
3926
- on(document, pointerDown$1, ({ target }) => {
3927
- if (
3928
- last(active$1) !== this ||
3929
- this.overlay && !within(target, this.$el) ||
3930
- within(target, this.panel))
3931
- {
3932
- return;
3933
- }
3934
-
3935
- once(
3936
- document,
3937
- `${pointerUp$1} ${pointerCancel} scroll`,
3938
- ({ defaultPrevented, type, target: newTarget }) => {
3939
- if (
3940
- !defaultPrevented &&
3941
- type === pointerUp$1 &&
3942
- target === newTarget)
3943
- {
3944
- this.hide();
3945
- }
3946
- },
3947
- true);
3906
+ const handlers = [
3907
+ this.overlay && preventBackgroundFocus(this),
3908
+ this.overlay && preventBackgroundScroll(this.$el),
3909
+ this.bgClose && listenForBackgroundClose(this),
3910
+ this.escClose && listenForEscClose$1(this)];
3948
3911
 
3949
- }),
3950
- { self: true });
3951
3912
 
3952
- }
3913
+ once(
3914
+ this.$el,
3915
+ 'hidden',
3916
+ () => handlers.forEach((handler) => handler && handler()),
3917
+ { self: true });
3953
3918
 
3954
- if (this.escClose) {
3955
- once(
3956
- this.$el,
3957
- 'hide',
3958
- on(document, 'keydown', (e) => {
3959
- if (e.keyCode === 27 && last(active$1) === this) {
3960
- this.hide();
3961
- }
3962
- }),
3963
- { self: true });
3964
3919
 
3965
- }
3920
+ addClass(document.documentElement, this.clsPage);
3966
3921
  }
3967
3922
  },
3968
3923
 
@@ -4053,6 +4008,45 @@
4053
4008
  return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
4054
4009
  }
4055
4010
 
4011
+ function preventBackgroundFocus(modal) {
4012
+ return on(document, 'focusin', (e) => {
4013
+ if (last(active$1) === modal && !within(e.target, modal.$el)) {
4014
+ modal.$el.focus();
4015
+ }
4016
+ });
4017
+ }
4018
+
4019
+ function listenForBackgroundClose(modal) {
4020
+ return on(document, pointerDown$1, ({ target }) => {
4021
+ if (
4022
+ last(active$1) !== modal ||
4023
+ modal.overlay && !within(target, modal.$el) ||
4024
+ within(target, modal.panel))
4025
+ {
4026
+ return;
4027
+ }
4028
+
4029
+ once(
4030
+ document,
4031
+ `${pointerUp$1} ${pointerCancel} scroll`,
4032
+ ({ defaultPrevented, type, target: newTarget }) => {
4033
+ if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {
4034
+ modal.hide();
4035
+ }
4036
+ },
4037
+ true);
4038
+
4039
+ });
4040
+ }
4041
+
4042
+ function listenForEscClose$1(modal) {
4043
+ return on(document, 'keydown', (e) => {
4044
+ if (e.keyCode === 27 && last(active$1) === modal) {
4045
+ modal.hide();
4046
+ }
4047
+ });
4048
+ }
4049
+
4056
4050
  let prevented;
4057
4051
  function preventBackgroundScroll(el) {
4058
4052
  // 'overscroll-behavior: contain' only works consistently if el overflows (Safari)
@@ -4172,12 +4166,7 @@
4172
4166
  addClass(this.$el, this.clsDrop);
4173
4167
 
4174
4168
  if (this.toggle && !this.targetEl) {
4175
- this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4176
- target: this.$el,
4177
- mode: this.mode
4178
- }).$el;
4179
- attr(this.targetEl, 'aria-haspopup', true);
4180
- this.lazyload(this.targetEl);
4169
+ this.targetEl = createToggleComponent(this);
4181
4170
  }
4182
4171
 
4183
4172
  this._style = (({ width, height }) => ({ width, height }))(this.$el.style);
@@ -4326,50 +4315,11 @@
4326
4315
 
4327
4316
  this.tracker.init();
4328
4317
 
4329
- const update = () => this.$emit();
4330
4318
  const handlers = [
4331
- on(
4332
- document,
4333
- pointerDown$1,
4334
- ({ target }) => !within(target, this.$el) &&
4335
- once(
4336
- document,
4337
- `${pointerUp$1} ${pointerCancel} scroll`,
4338
- ({ defaultPrevented, type, target: newTarget }) => {
4339
- if (
4340
- !defaultPrevented &&
4341
- type === pointerUp$1 &&
4342
- target === newTarget &&
4343
- !(this.targetEl && within(target, this.targetEl)))
4344
- {
4345
- this.hide(false);
4346
- }
4347
- },
4348
- true)),
4349
-
4350
-
4351
-
4352
- on(document, 'keydown', (e) => {
4353
- if (e.keyCode === 27) {
4354
- this.hide(false);
4355
- }
4356
- }),
4357
-
4358
- on(window, 'resize', update),
4359
-
4360
- (() => {
4361
- const observer = observeResize(
4362
- overflowParents(this.$el).concat(this.target),
4363
- update);
4364
-
4365
- return () => observer.disconnect();
4366
- })(),
4367
-
4368
- this.autoUpdate &&
4369
- on([document, ...overflowParents(this.$el)], 'scroll', update, {
4370
- passive: true
4371
- }),
4372
-
4319
+ listenForBackgroundClick(this),
4320
+ listenForEscClose(this),
4321
+ listenForResize(this),
4322
+ this.autoUpdate && listenForScroll(this),
4373
4323
  !this.bgScroll && preventBackgroundScroll(this.$el)];
4374
4324
 
4375
4325
 
@@ -4558,6 +4508,63 @@
4558
4508
  return offsetViewport(overflowParents(target).find((parent) => within(el, parent)));
4559
4509
  }
4560
4510
 
4511
+ function createToggleComponent(drop) {
4512
+ const { $el } = drop.$create('toggle', query(drop.toggle, drop.$el), {
4513
+ target: drop.$el,
4514
+ mode: drop.mode
4515
+ });
4516
+ attr($el, 'aria-haspopup', true);
4517
+ drop.lazyload($el);
4518
+
4519
+ return $el;
4520
+ }
4521
+
4522
+ function listenForResize(drop) {
4523
+ const update = () => drop.$emit();
4524
+ const off = on(window, 'resize', update);
4525
+ const observer = observeResize(overflowParents(drop.$el).concat(drop.target), update);
4526
+ return () => {
4527
+ observer.disconnect();
4528
+ off();
4529
+ };
4530
+ }
4531
+
4532
+ function listenForScroll(drop) {
4533
+ return on([document, ...overflowParents(drop.$el)], 'scroll', () => drop.$emit(), {
4534
+ passive: true
4535
+ });
4536
+ }
4537
+
4538
+ function listenForEscClose(drop) {
4539
+ return on(document, 'keydown', (e) => {
4540
+ if (e.keyCode === 27) {
4541
+ drop.hide(false);
4542
+ }
4543
+ });
4544
+ }
4545
+
4546
+ function listenForBackgroundClick(drop) {
4547
+ return on(document, pointerDown$1, ({ target }) => {
4548
+ if (!within(target, drop.$el)) {
4549
+ once(
4550
+ document,
4551
+ `${pointerUp$1} ${pointerCancel} scroll`,
4552
+ ({ defaultPrevented, type, target: newTarget }) => {
4553
+ if (
4554
+ !defaultPrevented &&
4555
+ type === pointerUp$1 &&
4556
+ target === newTarget &&
4557
+ !(drop.targetEl && within(target, drop.targetEl)))
4558
+ {
4559
+ drop.hide(false);
4560
+ }
4561
+ },
4562
+ true);
4563
+
4564
+ }
4565
+ });
4566
+ }
4567
+
4561
4568
  var formCustom = {
4562
4569
  mixins: [Class],
4563
4570
 
@@ -6121,7 +6128,7 @@
6121
6128
  },
6122
6129
 
6123
6130
  {
6124
- name: 'beforeshow',
6131
+ name: 'show',
6125
6132
 
6126
6133
  el() {
6127
6134
  return this.dropContainer;
@@ -6141,27 +6148,9 @@
6141
6148
  }
6142
6149
 
6143
6150
  addClass(target, `${this.clsDrop}-dropbar`);
6144
- }
6145
- },
6146
-
6147
- {
6148
- name: 'show',
6149
-
6150
- el() {
6151
- return this.dropContainer;
6152
- },
6153
-
6154
- filter() {
6155
- return this.dropbar;
6156
- },
6157
-
6158
- handler({ target }) {
6159
- if (!this.isDropbarDrop(target)) {
6160
- return;
6161
- }
6162
6151
 
6163
6152
  const drop = this.getDropdown(target);
6164
- this._observer = observeResize([drop.$el, ...drop.target], () => {
6153
+ const adjustHeight = () => {
6165
6154
  const targetOffsets = parents(target, `.${this.clsDrop}`).
6166
6155
  concat(target).
6167
6156
  map((el) => offset(el));
@@ -6173,7 +6162,9 @@
6173
6162
  maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6174
6163
  target);
6175
6164
 
6176
- });
6165
+ };
6166
+ this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);
6167
+ adjustHeight();
6177
6168
  }
6178
6169
  },
6179
6170
 
@@ -6233,29 +6224,27 @@
6233
6224
  return includes(this.dropdowns, active == null ? void 0 : active.$el) && active;
6234
6225
  },
6235
6226
 
6236
- transitionTo(newHeight, el) {
6227
+ async transitionTo(newHeight, el) {
6237
6228
  const { dropbar } = this;
6238
6229
  const oldHeight = height(dropbar);
6239
6230
 
6240
6231
  el = oldHeight < newHeight && el;
6241
6232
 
6242
- css(el, 'clipPath', `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);
6233
+ await Transition.cancel([el, dropbar]);
6243
6234
 
6235
+ css(el, 'clipPath', `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);
6244
6236
  height(dropbar, oldHeight);
6245
6237
 
6246
- Transition.cancel([el, dropbar]);
6247
- Promise.all([
6238
+ await Promise.all([
6248
6239
  Transition.start(dropbar, { height: newHeight }, this.duration),
6249
6240
  Transition.start(
6250
6241
  el,
6251
6242
  {
6252
6243
  clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)`
6253
6244
  },
6254
- this.duration)]).
6255
-
6256
-
6257
- catch(noop).
6258
- then(() => css(el, { clipPath: '' }));
6245
+ this.duration).
6246
+ finally(() => css(el, { clipPath: '' }))]).
6247
+ catch(noop);
6259
6248
  },
6260
6249
 
6261
6250
  getDropdown(el) {
@@ -7919,14 +7908,14 @@
7919
7908
  };
7920
7909
 
7921
7910
  function getTimeSpan(date) {
7922
- const total = date - Date.now();
7911
+ const total = (date - Date.now()) / 1000;
7923
7912
 
7924
7913
  return {
7925
7914
  total,
7926
- seconds: total / 1000 % 60,
7927
- minutes: total / 1000 / 60 % 60,
7928
- hours: total / 1000 / 60 / 60 % 24,
7929
- days: total / 1000 / 60 / 60 / 24
7915
+ seconds: total % 60,
7916
+ minutes: total / 60 % 60,
7917
+ hours: total / 60 / 60 % 24,
7918
+ days: total / 60 / 60 / 24
7930
7919
  };
7931
7920
  }
7932
7921
 
@@ -8084,6 +8073,10 @@
8084
8073
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
8085
8074
  css(target, targetProps);
8086
8075
 
8076
+ // Trigger update in e.g. parallax component
8077
+ trigger(target, 'scroll');
8078
+ fastdom.flush();
8079
+
8087
8080
  // Start transitions on next frame
8088
8081
  await awaitFrame();
8089
8082
 
@@ -8598,7 +8591,7 @@
8598
8591
  },
8599
8592
 
8600
8593
  stopAutoplay() {
8601
- this.interval && clearInterval(this.interval);
8594
+ clearInterval(this.interval);
8602
8595
  }
8603
8596
  }
8604
8597
  };
@@ -9316,12 +9309,9 @@
9316
9309
  type === 'image' ||
9317
9310
  src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))
9318
9311
  {
9319
- try {
9320
- const { width, height } = await getImage(src, attrs.srcset, attrs.size);
9321
- this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
9322
- } catch (e) {
9323
- this.setError(item);
9324
- }
9312
+ const img = createEl('img', { src, alt, ...attrs });
9313
+ on(img, 'load', () => this.setItem(item, img));
9314
+ on(img, 'error', () => this.setError(item));
9325
9315
 
9326
9316
  // Video
9327
9317
  } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
@@ -9330,17 +9320,11 @@
9330
9320
  poster,
9331
9321
  controls: '',
9332
9322
  playsinline: '',
9333
- 'uk-video': `${this.videoAutoplay}`
9323
+ 'uk-video': `${this.videoAutoplay}`,
9324
+ ...attrs
9334
9325
  });
9335
9326
 
9336
- on(video, 'loadedmetadata', () => {
9337
- attr(video, {
9338
- width: video.videoWidth,
9339
- height: video.videoHeight,
9340
- ...attrs
9341
- });
9342
- this.setItem(item, video);
9343
- });
9327
+ on(video, 'loadedmetadata', () => this.setItem(item, video));
9344
9328
  on(video, 'error', () => this.setError(item));
9345
9329
 
9346
9330
  // Iframe
@@ -9382,9 +9366,7 @@
9382
9366
  `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
9383
9367
  src)
9384
9368
  }`,
9385
- {
9386
- credentials: 'omit'
9387
- })).
9369
+ { credentials: 'omit' })).
9388
9370
 
9389
9371
  json();
9390
9372
 
@@ -11223,10 +11205,9 @@
11223
11205
  [placeholderRect.top, placeholderRect.bottom]);
11224
11206
 
11225
11207
 
11226
- const pointerPos = sameRow ? x : y;
11227
- const lengthProp = sameRow ? 'width' : 'height';
11228
- const startProp = sameRow ? 'left' : 'top';
11229
- const endProp = sameRow ? 'right' : 'bottom';
11208
+ const [pointerPos, lengthProp, startProp, endProp] = sameRow ?
11209
+ [x, 'width', 'left', 'right'] :
11210
+ [y, 'height', 'top', 'bottom'];
11230
11211
 
11231
11212
  const diff =
11232
11213
  placeholderRect[lengthProp] < rect[lengthProp] ?
@@ -11372,14 +11353,9 @@
11372
11353
  passive: true
11373
11354
  })];
11374
11355
 
11375
- once(
11376
- this.tooltip,
11377
- 'hide',
11378
- () => handlers.forEach((handler) => handler && handler()),
11379
- {
11356
+ once(this.tooltip, 'hide', () => handlers.forEach((handler) => handler()), {
11380
11357
  self: true
11381
11358
  });
11382
-
11383
11359
  });
11384
11360
 
11385
11361
  this.toggleElement(this.tooltip, true);
@@ -11583,7 +11559,7 @@
11583
11559
  responseType: this.type,
11584
11560
  beforeSend: (env) => {
11585
11561
  const { xhr } = env;
11586
- xhr.upload && on(xhr.upload, 'progress', this.progress);
11562
+ on(xhr.upload, 'progress', this.progress);
11587
11563
  for (const type of ['loadStart', 'load', 'loadEnd', 'abort']) {
11588
11564
  on(xhr, type.toLowerCase(), this[type]);
11589
11565
  }