uikit 3.13.8-dev.2fb6bed58 → 3.13.8-dev.4bb05e5fe

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 (80) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/css/uikit-core-rtl.css +41 -5
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +41 -5
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +41 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +41 -3
  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 +5 -2
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +5 -2
  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 +13 -10
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +13 -10
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +13 -10
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  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 +41 -49
  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 +85 -112
  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 +125 -116
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +5 -5
  43. package/src/js/api/hooks.js +1 -1
  44. package/src/js/components/lightbox-panel.js +4 -1
  45. package/src/js/components/tooltip.js +38 -3
  46. package/src/js/core/accordion.js +1 -1
  47. package/src/js/core/drop.js +6 -5
  48. package/src/js/core/height-match.js +7 -16
  49. package/src/js/core/navbar.js +1 -3
  50. package/src/js/core/scrollspy.js +45 -26
  51. package/src/js/core/sticky.js +2 -2
  52. package/src/js/core/toggle.js +1 -1
  53. package/src/js/mixin/media.js +12 -9
  54. package/src/js/mixin/position.js +4 -43
  55. package/src/js/util/position.js +4 -1
  56. package/src/less/components/dropdown.less +11 -1
  57. package/src/less/components/icon.less +3 -0
  58. package/src/less/components/nav.less +22 -0
  59. package/src/less/components/navbar.less +26 -2
  60. package/src/less/components/search.less +2 -0
  61. package/src/less/theme/dropdown.less +4 -0
  62. package/src/less/theme/nav.less +6 -0
  63. package/src/less/theme/navbar.less +4 -0
  64. package/src/less/theme/search.less +6 -0
  65. package/src/scss/components/dropdown.scss +11 -1
  66. package/src/scss/components/icon.scss +3 -0
  67. package/src/scss/components/nav.scss +22 -0
  68. package/src/scss/components/navbar.scss +26 -2
  69. package/src/scss/components/search.scss +2 -0
  70. package/src/scss/mixins-theme.scss +5 -0
  71. package/src/scss/mixins.scss +5 -0
  72. package/src/scss/theme/dropdown.scss +4 -0
  73. package/src/scss/theme/nav.scss +6 -0
  74. package/src/scss/theme/navbar.scss +4 -0
  75. package/src/scss/theme/search.scss +6 -0
  76. package/src/scss/variables-theme.scss +5 -1
  77. package/src/scss/variables.scss +5 -1
  78. package/tests/dropdown.html +16 -2
  79. package/tests/nav.html +27 -0
  80. package/tests/navbar.html +55 -4
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.8-dev.2fb6bed58 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.8-dev.4bb05e5fe | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1740,11 +1740,11 @@
1740
1740
  }
1741
1741
  }
1742
1742
 
1743
- const stateKey$1 = '_ukPlayer';
1743
+ const stateKey = '_ukPlayer';
1744
1744
  let counter = 0;
1745
1745
  function enableApi(el) {
1746
- if (el[stateKey$1]) {
1747
- return el[stateKey$1];
1746
+ if (el[stateKey]) {
1747
+ return el[stateKey];
1748
1748
  }
1749
1749
 
1750
1750
  const youtube = isYoutube(el);
@@ -1753,7 +1753,7 @@
1753
1753
  const id = ++counter;
1754
1754
  let poller;
1755
1755
 
1756
- return el[stateKey$1] = new Promise((resolve) => {
1756
+ return el[stateKey] = new Promise((resolve) => {
1757
1757
  youtube &&
1758
1758
  once(el, 'load', () => {
1759
1759
  const listener = () => post(el, { event: 'listening', id });
@@ -2006,7 +2006,10 @@
2006
2006
  const willFlip =
2007
2007
  !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2008
2008
 
2009
- viewport = getIntersectionArea(...viewports, willFlip ? null : boundary);
2009
+ viewport = getIntersectionArea(
2010
+ ...viewports,
2011
+ willFlip || position[prop] > offset(boundary)[prop] ? null : boundary);
2012
+
2010
2013
  const isInStartBoundary = position[start] >= viewport[start];
2011
2014
  const isInEndBoundary = position[end] <= viewport[end];
2012
2015
 
@@ -2408,7 +2411,7 @@
2408
2411
  const {
2409
2412
  $options: { computed } } =
2410
2413
  this;
2411
- const values = { ...this._computed };
2414
+ const values = { ...(initial ? {} : this._computed) };
2412
2415
  this._computed = {};
2413
2416
 
2414
2417
  for (const key in computed) {
@@ -2888,7 +2891,7 @@
2888
2891
  UIkit.data = '__uikit__';
2889
2892
  UIkit.prefix = 'uk-';
2890
2893
  UIkit.options = {};
2891
- UIkit.version = '3.13.8-dev.2fb6bed58';
2894
+ UIkit.version = '3.13.8-dev.4bb05e5fe';
2892
2895
 
2893
2896
  globalAPI(UIkit);
2894
2897
  hooksAPI(UIkit);
@@ -3215,7 +3218,7 @@
3215
3218
  computed: {
3216
3219
  items: {
3217
3220
  get(_ref, $el) {let { targets } = _ref;
3218
- return $$(targets, $el);
3221
+ return $$(targets, $el).filter((el) => $(this.content, el));
3219
3222
  },
3220
3223
 
3221
3224
  watch(items, prev) {
@@ -3502,21 +3505,19 @@
3502
3505
 
3503
3506
  connected() {
3504
3507
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3505
- this.dir = this.pos[0];
3506
- this.align = this.pos[1];
3508
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3507
3509
  },
3508
3510
 
3509
3511
  methods: {
3510
3512
  positionAt(element, target, boundary) {
3511
3513
  const [dir, align] = this.pos;
3512
- const axis = this.getAxis(dir);
3513
3514
 
3514
3515
  let { offset: offset$1 } = this;
3515
3516
  if (!isNumeric(offset$1)) {
3516
3517
  const node = $(offset$1);
3517
3518
  offset$1 = node ?
3518
- offset(node)[axis === 'x' ? 'left' : 'top'] -
3519
- offset(target)[axis === 'x' ? 'right' : 'bottom'] :
3519
+ offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3520
+ offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3520
3521
  0;
3521
3522
  }
3522
3523
  offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
@@ -3527,7 +3528,7 @@
3527
3528
  target: [dir, align] };
3528
3529
 
3529
3530
 
3530
- if (axis === 'y') {
3531
+ if (this.axis === 'y') {
3531
3532
  for (const prop in attach) {
3532
3533
  attach[prop] = attach[prop].reverse();
3533
3534
  }
@@ -3540,47 +3541,8 @@
3540
3541
  boundary,
3541
3542
  flip: this.flip });
3542
3543
 
3543
-
3544
- [this.dir, this.align] = getAlignment(element, target, this.pos);
3545
- },
3546
-
3547
- getAxis(dir) {if (dir === void 0) {dir = this.dir;}
3548
- return includes(['top', 'bottom'], dir) ? 'y' : 'x';
3549
3544
  } } };
3550
3545
 
3551
-
3552
-
3553
- function getAlignment(el, target, _ref) {let [dir, align] = _ref;
3554
- const elOffset = offset(el);
3555
- const targetOffset = offset(target);
3556
- const properties = [
3557
- ['left', 'right'],
3558
- ['top', 'bottom']];
3559
-
3560
-
3561
- for (const props of properties) {
3562
- if (elOffset[props[0]] >= targetOffset[props[1]]) {
3563
- dir = props[1];
3564
- break;
3565
- }
3566
- if (elOffset[props[1]] <= targetOffset[props[0]]) {
3567
- dir = props[0];
3568
- break;
3569
- }
3570
- }
3571
-
3572
- const props = includes(properties[0], dir) ? properties[1] : properties[0];
3573
- if (elOffset[props[0]] === targetOffset[props[0]]) {
3574
- align = props[0];
3575
- } else if (elOffset[props[1]] === targetOffset[props[1]]) {
3576
- align = props[1];
3577
- } else {
3578
- align = 'center';
3579
- }
3580
-
3581
- return [dir, align];
3582
- }
3583
-
3584
3546
  let active$1;
3585
3547
 
3586
3548
  var drop = {
@@ -3915,17 +3877,18 @@
3915
3877
  const boundaryOffset = offset(boundary);
3916
3878
  const targetOffset = offset(this.target);
3917
3879
  const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3880
+ const prop = this.axis === 'y' ? 'width' : 'height';
3881
+
3882
+ css(this.$el, "max-" + prop, '');
3918
3883
 
3919
3884
  if (this.pos[1] === 'justify') {
3920
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
3921
3885
  css(this.$el, prop, alignTo[prop]);
3922
- } else if (
3923
- this.$el.offsetWidth >
3924
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
3925
- {
3886
+ } else if (this.$el.offsetWidth > boundaryOffset.width) {
3926
3887
  addClass(this.$el, this.clsDrop + "-stack");
3927
3888
  }
3928
3889
 
3890
+ css(this.$el, "max-" + prop, boundaryOffset[prop]);
3891
+
3929
3892
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
3930
3893
  } } };
3931
3894
 
@@ -4325,8 +4288,7 @@
4325
4288
 
4326
4289
  data: {
4327
4290
  target: '> *',
4328
- row: true,
4329
- forceHeight: true },
4291
+ row: true },
4330
4292
 
4331
4293
 
4332
4294
  computed: {
@@ -4367,22 +4329,14 @@
4367
4329
  return { heights: [''], elements };
4368
4330
  }
4369
4331
 
4332
+ css(elements, 'minHeight', '');
4370
4333
  let heights = elements.map(getHeight);
4371
- let max = Math.max(...heights);
4372
- const hasMinHeight = elements.some((el) => el.style.minHeight);
4373
- const hasShrunk = elements.some((el, i) => !el.style.minHeight && heights[i] < max);
4374
-
4375
- if (hasMinHeight && hasShrunk) {
4376
- css(elements, 'minHeight', '');
4377
- heights = elements.map(getHeight);
4378
- max = Math.max(...heights);
4379
- }
4380
-
4381
- heights = elements.map((el, i) =>
4382
- heights[i] === max && toFloat(el.style.minHeight).toFixed(2) !== max.toFixed(2) ? '' : max);
4334
+ const max = Math.max(...heights);
4383
4335
 
4336
+ return {
4337
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4338
+ elements };
4384
4339
 
4385
- return { heights, elements };
4386
4340
  }
4387
4341
 
4388
4342
  function getHeight(element) {
@@ -5039,16 +4993,19 @@
5039
4993
 
5040
4994
  connected() {
5041
4995
  const media = toMedia(this.media);
5042
- this.mediaObj = window.matchMedia(media);
5043
- const handler = () => {
5044
- this.matchMedia = this.mediaObj.matches;
5045
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5046
- };
5047
- this.offMediaObj = on(this.mediaObj, 'change', () => {
4996
+ this.matchMedia = true;
4997
+ if (media) {
4998
+ this.mediaObj = window.matchMedia(media);
4999
+ const handler = () => {
5000
+ this.matchMedia = this.mediaObj.matches;
5001
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5002
+ };
5003
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5004
+ handler();
5005
+ this.$emit('resize');
5006
+ });
5048
5007
  handler();
5049
- this.$emit('resize');
5050
- });
5051
- handler();
5008
+ }
5052
5009
  },
5053
5010
 
5054
5011
  disconnected() {var _this$offMediaObj;
@@ -5549,8 +5506,6 @@
5549
5506
  dropbar: false,
5550
5507
  dropbarAnchor: false,
5551
5508
  duration: 200,
5552
- forceHeight: true,
5553
- selMinHeight: navItem,
5554
5509
  container: false },
5555
5510
 
5556
5511
 
@@ -5787,7 +5742,7 @@
5787
5742
  return this.dropbar;
5788
5743
  },
5789
5744
 
5790
- handler(_, _ref10) {let { $el, dir } = _ref10;
5745
+ handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5791
5746
  if (!hasClass($el, this.clsDrop)) {
5792
5747
  return;
5793
5748
  }
@@ -6332,7 +6287,6 @@
6332
6287
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
6333
6288
  }
6334
6289
 
6335
- const stateKey = '_ukScrollspy';
6336
6290
  var scrollspy = {
6337
6291
  mixins: [Scroll],
6338
6292
 
@@ -6365,43 +6319,64 @@
6365
6319
  return target ? $$(target, $el) : [$el];
6366
6320
  },
6367
6321
 
6368
- watch(elements) {
6322
+ watch(elements, prev) {
6369
6323
  if (this.hidden) {
6370
6324
  css(filter$1(elements, ":not(." + this.inViewClass + ")"), 'visibility', 'hidden');
6371
6325
  }
6326
+
6327
+ if (prev) {
6328
+ this.$reset();
6329
+ }
6372
6330
  },
6373
6331
 
6374
6332
  immediate: true } },
6375
6333
 
6376
6334
 
6377
6335
 
6378
- disconnected() {
6379
- for (const el of this.elements) {var _el$stateKey;
6380
- removeClass(el, this.inViewClass, ((_el$stateKey = el[stateKey]) == null ? void 0 : _el$stateKey.cls) || '');
6381
- delete el[stateKey];
6382
- }
6383
- },
6336
+ connected() {
6337
+ this._data.elements = new Map();
6338
+ this.registerObserver(
6339
+ observeIntersection(
6340
+ this.elements,
6341
+ (records) => {
6342
+ const elements = this._data.elements;
6343
+ for (const { target: el, isIntersecting } of records) {
6344
+ if (!elements.has(el)) {
6345
+ elements.set(el, {
6346
+ cls: data(el, 'uk-scrollspy-class') || this.cls });
6384
6347
 
6385
- update: [
6386
- {
6387
- read() {
6388
- for (const el of this.elements) {
6389
- if (!el[stateKey]) {
6390
- el[stateKey] = { cls: data(el, 'uk-scrollspy-class') || this.cls };
6391
6348
  }
6392
6349
 
6393
- if (!this.repeat && el[stateKey].show) {
6350
+ const state = elements.get(el);
6351
+ if (!this.repeat && state.show) {
6394
6352
  continue;
6395
6353
  }
6396
6354
 
6397
- el[stateKey].show = isInView(el, this.offsetTop, this.offsetLeft);
6355
+ state.show = isIntersecting;
6398
6356
  }
6357
+
6358
+ this.$emit();
6399
6359
  },
6360
+ {
6361
+ rootMargin: toPx(this.offsetTop, 'height') - 1 + "px " + (
6362
+ toPx(this.offsetLeft, 'width') - 1) + "px" },
6400
6363
 
6401
- write(data) {
6402
- for (const el of this.elements) {
6403
- const state = el[stateKey];
6404
6364
 
6365
+ false));
6366
+
6367
+
6368
+ },
6369
+
6370
+ disconnected() {
6371
+ for (const [el, state] of this._data.elements.entries()) {
6372
+ removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || '');
6373
+ }
6374
+ },
6375
+
6376
+ update: [
6377
+ {
6378
+ write(data) {
6379
+ for (const [el, state] of data.elements.entries()) {
6405
6380
  if (state.show && !state.inview && !state.queued) {
6406
6381
  state.queued = true;
6407
6382
 
@@ -6418,15 +6393,13 @@
6418
6393
  this.toggle(el, false);
6419
6394
  }
6420
6395
  }
6421
- },
6422
-
6423
- events: ['scroll', 'resize'] }],
6396
+ } }],
6424
6397
 
6425
6398
 
6426
6399
 
6427
6400
  methods: {
6428
6401
  toggle(el, inview) {
6429
- const state = el[stateKey];
6402
+ const state = this._data.elements.get(el);
6430
6403
 
6431
6404
  state.off == null ? void 0 : state.off();
6432
6405
 
@@ -6649,13 +6622,13 @@
6649
6622
  return false;
6650
6623
  }
6651
6624
 
6652
- const hide = this.isActive && types.has('resize');
6625
+ const hide = this.active && types.has('resize');
6653
6626
  if (hide) {
6654
6627
  css(this.selTarget, 'transition', '0s');
6655
6628
  this.hide();
6656
6629
  }
6657
6630
 
6658
- if (!this.isActive) {
6631
+ if (!this.active) {
6659
6632
  height$1 = offset(this.$el).height;
6660
6633
  margin = css(this.$el, 'margin');
6661
6634
  }
@@ -7177,7 +7150,7 @@
7177
7150
  }
7178
7151
 
7179
7152
  // Skip if state does not change e.g. hover + focus received
7180
- if (this._showState && show === (expanded !== this._showState)) {
7153
+ if (this._showState && show && expanded !== this._showState) {
7181
7154
  // Ensure reset if state has changed through click
7182
7155
  if (!show) {
7183
7156
  this._showState = null;
@@ -8850,7 +8823,10 @@
8850
8823
 
8851
8824
 
8852
8825
  // Image
8853
- if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
8826
+ if (
8827
+ type === 'image' ||
8828
+ src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i))
8829
+ {
8854
8830
  try {
8855
8831
  const { width, height } = await getImage(src, attrs.srcset, attrs.size);
8856
8832
  this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
@@ -10769,10 +10745,12 @@
10769
10745
 
10770
10746
  this.positionAt(this.tooltip, this.$el);
10771
10747
 
10748
+ const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
10749
+
10772
10750
  this.origin =
10773
- this.getAxis() === 'y' ?
10774
- flipPosition(this.dir) + "-" + this.align :
10775
- this.align + "-" + flipPosition(this.dir);
10751
+ this.axis === 'y' ?
10752
+ flipPosition(dir) + "-" + align :
10753
+ align + "-" + flipPosition(dir);
10776
10754
  });
10777
10755
 
10778
10756
  this.toggleElement(this.tooltip, true);
@@ -10809,6 +10787,37 @@
10809
10787
  }
10810
10788
  }
10811
10789
 
10790
+ function getAlignment(el, target, _ref) {let [dir, align] = _ref;
10791
+ const elOffset = offset(el);
10792
+ const targetOffset = offset(target);
10793
+ const properties = [
10794
+ ['left', 'right'],
10795
+ ['top', 'bottom']];
10796
+
10797
+
10798
+ for (const props of properties) {
10799
+ if (elOffset[props[0]] >= targetOffset[props[1]]) {
10800
+ dir = props[1];
10801
+ break;
10802
+ }
10803
+ if (elOffset[props[1]] <= targetOffset[props[0]]) {
10804
+ dir = props[0];
10805
+ break;
10806
+ }
10807
+ }
10808
+
10809
+ const props = includes(properties[0], dir) ? properties[1] : properties[0];
10810
+ if (elOffset[props[0]] === targetOffset[props[0]]) {
10811
+ align = props[0];
10812
+ } else if (elOffset[props[1]] === targetOffset[props[1]]) {
10813
+ align = props[1];
10814
+ } else {
10815
+ align = 'center';
10816
+ }
10817
+
10818
+ return [dir, align];
10819
+ }
10820
+
10812
10821
  var upload = {
10813
10822
  props: {
10814
10823
  allow: String,