uikit 3.13.11-dev.2c16b47b1 → 3.13.11-dev.77828bb3f

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 (44) hide show
  1. package/dist/css/uikit-core-rtl.css +1 -1
  2. package/dist/css/uikit-core-rtl.min.css +1 -1
  3. package/dist/css/uikit-core.css +1 -1
  4. package/dist/css/uikit-core.min.css +1 -1
  5. package/dist/css/uikit-rtl.css +1 -1
  6. package/dist/css/uikit-rtl.min.css +1 -1
  7. package/dist/css/uikit.css +1 -1
  8. package/dist/css/uikit.min.css +1 -1
  9. package/dist/js/components/countdown.js +1 -1
  10. package/dist/js/components/countdown.min.js +1 -1
  11. package/dist/js/components/filter.js +1 -1
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +1 -1
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +1 -1
  16. package/dist/js/components/lightbox.min.js +1 -1
  17. package/dist/js/components/notification.js +1 -1
  18. package/dist/js/components/notification.min.js +1 -1
  19. package/dist/js/components/parallax.js +1 -1
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +1 -1
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +1 -1
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +1 -1
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +1 -1
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +1 -1
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +1 -1
  32. package/dist/js/components/tooltip.min.js +1 -1
  33. package/dist/js/components/upload.js +1 -1
  34. package/dist/js/components/upload.min.js +1 -1
  35. package/dist/js/uikit-core.js +27 -15
  36. package/dist/js/uikit-core.min.js +1 -1
  37. package/dist/js/uikit-icons.js +1 -1
  38. package/dist/js/uikit-icons.min.js +1 -1
  39. package/dist/js/uikit.js +27 -15
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/core/drop.js +20 -11
  43. package/src/js/util/position.js +6 -3
  44. package/tests/drop.html +26 -7
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uikit",
3
3
  "title": "UIkit",
4
4
  "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
- "version": "3.13.11-dev.2c16b47b1",
5
+ "version": "3.13.11-dev.77828bb3f",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -13,7 +13,7 @@ import {
13
13
  isTouch,
14
14
  matches,
15
15
  MouseTracker,
16
- noop,
16
+ observeResize,
17
17
  offset,
18
18
  offsetViewport,
19
19
  on,
@@ -247,15 +247,23 @@ export default {
247
247
  this.hide(false);
248
248
  }
249
249
  }),
250
- on(window, 'resize', () => this.$emit()),
251
- this.display === 'static'
252
- ? noop
253
- : on(
254
- document,
255
- 'scroll',
256
- ({ target }) => target.contains(this.$el) && this.$emit(),
257
- true
258
- ),
250
+
251
+ ...(this.display === 'static'
252
+ ? []
253
+ : (() => {
254
+ const handler = () => this.$emit();
255
+ return [
256
+ on(window, 'resize', handler),
257
+ on(document, 'scroll', handler, true),
258
+ (() => {
259
+ const observer = observeResize(
260
+ scrollParents(this.$el),
261
+ handler
262
+ );
263
+ return () => observer.disconnect();
264
+ })(),
265
+ ];
266
+ })()),
259
267
  ]) {
260
268
  once(this.$el, 'hide', handler, { self: true });
261
269
  }
@@ -375,7 +383,8 @@ export default {
375
383
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
376
384
 
377
385
  css(this.$el, 'maxWidth', '');
378
- const maxWidth = scrollParentOffset.width - (boundary ? 0 : 2 * this.viewportPadding);
386
+ const maxWidth =
387
+ scrollParentOffset.width - (this.boundaryAlign ? 0 : 2 * this.viewportPadding);
379
388
 
380
389
  if (this.pos[1] === 'justify') {
381
390
  const prop = this.axis === 'y' ? 'width' : 'height';
@@ -52,8 +52,6 @@ function attachTo(element, target, options) {
52
52
  function attachToWithFlip(element, target, options) {
53
53
  const position = attachTo(element, target, options);
54
54
  const targetDim = offset(target);
55
- const viewports = scrollParents(element);
56
- const [scrollElement] = viewports;
57
55
 
58
56
  let {
59
57
  flip,
@@ -64,6 +62,11 @@ function attachToWithFlip(element, target, options) {
64
62
  viewportPadding,
65
63
  } = options;
66
64
 
65
+ let viewports = scrollParents(element);
66
+ if (boundary === target) {
67
+ viewports = viewports.filter((viewport) => viewport !== boundary);
68
+ }
69
+ const [scrollElement] = viewports;
67
70
  viewports.push(viewport);
68
71
 
69
72
  const offsetPosition = { ...position };
@@ -82,7 +85,7 @@ function attachToWithFlip(element, target, options) {
82
85
  viewport[end] -= viewportPadding;
83
86
  }
84
87
 
85
- if (boundary && !(willFlip || position[prop] > offset(boundary)[prop])) {
88
+ if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
86
89
  viewport = getIntersectionArea(viewport, offset(boundary));
87
90
  }
88
91
 
package/tests/drop.html CHANGED
@@ -15,9 +15,7 @@
15
15
  -webkit-overflow-scrolling: touch;
16
16
  }
17
17
 
18
- .boundary-overflow {
19
- width: 200%;
20
- }
18
+ .boundary-overflow { width: 200%; }
21
19
 
22
20
  </style>
23
21
  </head>
@@ -219,11 +217,18 @@
219
217
 
220
218
  <h2>Shift and Flip</h2>
221
219
 
220
+ <div class="uk-margin">
221
+ <select id="js-boundary-overflow-switcher" class="uk-select uk-form-width-small">
222
+ <option value="">Resize</option>
223
+ <option value="boundary-overflow">Scroll</option>
224
+ </select>
225
+ </div>
226
+
222
227
  <div uk-grid>
223
228
  <div class="uk-width-1-2@m">
224
229
 
225
- <div class="boundary uk-height-large uk-margin">
226
- <div class="boundary-overflow uk-flex uk-flex-center">
230
+ <div class="boundary uk-height-large uk-resize-horizontal uk-margin">
231
+ <div class="js-boundary-overflow uk-flex uk-flex-center">
227
232
  <div>
228
233
 
229
234
  <button class="uk-button uk-button-default" type="button">Click</button>
@@ -236,8 +241,8 @@
236
241
  </div>
237
242
  <div class="uk-width-1-2@m">
238
243
 
239
- <div class="boundary uk-height-large uk-margin">
240
- <div class="boundary-overflow uk-flex uk-flex-center">
244
+ <div class="boundary uk-height-large uk-resize-horizontal uk-margin">
245
+ <div class="js-boundary-overflow uk-flex uk-flex-center">
241
246
  <div>
242
247
 
243
248
  <button class="uk-button uk-button-default" style="margin-left: 40px" type="button">Click</button>
@@ -474,5 +479,19 @@
474
479
 
475
480
  </div>
476
481
 
482
+ <script>
483
+
484
+ var options = UIkit.util.$$('#js-boundary-overflow-switcher option').map(function (option) { return option.value; });
485
+
486
+ UIkit.util.on('#js-boundary-overflow-switcher', 'change', function () {
487
+ var value = this.value;
488
+ UIkit.util.$$('.js-boundary-overflow').forEach(function (table) {
489
+ UIkit.util.removeClass(table, options);
490
+ UIkit.util.addClass(table, value);
491
+ });
492
+ });
493
+
494
+ </script>
495
+
477
496
  </body>
478
497
  </html>