uikit 3.13.6-dev.f130508b6 → 3.13.7-dev.120e5ee9c

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 (61) hide show
  1. package/CHANGELOG.md +15 -4
  2. package/build/util.js +1 -1
  3. package/dist/css/uikit-core-rtl.css +7 -12
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +7 -12
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +7 -12
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +7 -12
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +1 -1
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +1 -1
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +1 -1
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +2 -2
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +1 -1
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +2 -2
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +19 -53
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +146 -228
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +146 -228
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/components/slider-parallax.js +1 -1
  45. package/src/js/core/drop.js +1 -1
  46. package/src/js/core/height-match.js +3 -0
  47. package/src/js/core/height-viewport.js +4 -2
  48. package/src/js/core/img.js +0 -57
  49. package/src/js/mixin/position.js +16 -49
  50. package/src/js/util/position.js +129 -125
  51. package/src/less/components/drop.less +1 -1
  52. package/src/less/components/dropdown.less +1 -1
  53. package/src/less/components/nav.less +1 -5
  54. package/src/less/components/navbar.less +2 -2
  55. package/src/less/components/tooltip.less +1 -1
  56. package/src/scss/components/drop.scss +1 -1
  57. package/src/scss/components/dropdown.scss +1 -1
  58. package/src/scss/components/nav.scss +1 -5
  59. package/src/scss/components/navbar.scss +2 -2
  60. package/src/scss/components/tooltip.scss +1 -1
  61. package/tests/position.html +39 -38
@@ -9,7 +9,7 @@
9
9
  <style>
10
10
 
11
11
  /* JavaScript */
12
- #js-viewport {
12
+ #js-boundary {
13
13
  height: 300px;
14
14
  outline: 1px solid rgba(0,0,0,0.1);
15
15
  position: relative;
@@ -26,6 +26,7 @@
26
26
 
27
27
  #js-element {
28
28
  position: absolute;
29
+ display: none;
29
30
  width: 75px;
30
31
  height: 75px;
31
32
  background: rgba(0,0,0,0.1);
@@ -237,13 +238,13 @@
237
238
 
238
239
  <h2>JavaScript</h2>
239
240
 
240
- <div id="js-viewport" class="uk-margin">
241
+ <div id="js-boundary" class="uk-margin">
241
242
  <div id="js-target" class="uk-flex uk-flex-center uk-flex-middle" draggable="true">Drag me!</div>
242
243
  </div>
243
244
 
244
245
  <div id="js-element"></div>
245
246
 
246
- <div class="uk-grid uk-child-width-auto uk-form-stacked" style="margin-bottom: 100vh">
247
+ <div class="uk-grid uk-child-width-auto uk-form-stacked">
247
248
  <div>
248
249
 
249
250
  <div class="uk-margin">
@@ -326,26 +327,27 @@
326
327
 
327
328
  <script>
328
329
 
329
- const {$, $$, css, getEventPos, on, offset, positionAt} = UIkit.util;
330
- let viewport = $('#js-viewport');
331
- let element = $('#js-element');
332
- let target = $('#js-target');
333
- let offsetX;
334
- let offsetY;
330
+ var util = UIkit.util,
331
+ $ = util.$,
332
+ on = util.on,
333
+ offset = util.offset,
334
+ ticking,
335
+ element = $('#js-element'),
336
+ boundary = $('#js-boundary'),
337
+ target = $('#js-target'),
338
+ offsetX,
339
+ offsetY;
335
340
 
336
341
  function position() {
337
- positionAt(
342
+ util.positionAt(
338
343
  element,
339
344
  target,
340
- {
341
- viewport,
342
- attach:{
343
- element: [$('#js-element_x').value, $('#js-element_y').value],
344
- target: [$('#js-target_x').value, $('#js-target_y').value]
345
- },
346
- offset: [$('#js-offset_x').value, $('#js-offset_y').value],
347
- flip: [$('#js-flip_x').value, $('#js-flip_y').value]
348
- }
345
+ $('#js-element_x').value + ' ' + $('#js-element_y').value,
346
+ $('#js-target_x').value + ' ' + $('#js-target_y').value,
347
+ $('#js-offset_x').value + ' ' + $('#js-offset_y').value,
348
+ null,
349
+ $('#js-flip_x').value + $('#js-flip_y').value,
350
+ boundary
349
351
  );
350
352
  }
351
353
 
@@ -357,34 +359,33 @@
357
359
 
358
360
  });
359
361
 
360
- let lastPos;
361
362
  on(window, 'dragover', function (e) {
362
363
 
363
- const pos = getEventPos(e);
364
+ e.preventDefault();
364
365
 
365
- if (lastPos?.x === pos.x && lastPos?.y === pos.y) {
366
- return;
367
- }
368
- lastPos = pos;
366
+ if (!ticking) {
367
+ requestAnimationFrame(function () {
369
368
 
370
- e.preventDefault();
369
+ util.positionAt(
370
+ target,
371
+ boundary,
372
+ 'left top',
373
+ 'left top',
374
+ (e.pageX - offset(boundary).left - offsetX) + ' ' + (e.pageY - offset(boundary).top - offsetY)
375
+ );
371
376
 
372
- // positions target at mouse cursor
373
- positionAt(
374
- target,
375
- viewport,
376
- {
377
- offset: [e.pageX - offset(viewport).left - offsetX, e.pageY - offset(viewport).top - offsetY]
378
- }
379
- );
377
+ position();
378
+
379
+ ticking = false;
380
+ });
381
+ ticking = true;
382
+ }
380
383
 
381
- // positions element at target
382
- position();
383
384
  });
384
385
 
385
- on($$('select,input'), 'change', position);
386
- on(window, 'scroll', position);
386
+ util.$$('select,input').forEach(el => on(el, 'change', position));
387
387
 
388
+ util.css(element, 'display', 'block');
388
389
  position();
389
390
 
390
391
  </script>