uikit 3.15.1 → 3.15.2

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 (47) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/css/uikit-core-rtl.css +1 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -1
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +28 -16
  38. package/dist/js/uikit-core.min.js +2 -2
  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 +28 -16
  42. package/dist/js/uikit.min.js +2 -2
  43. package/package.json +7 -7
  44. package/src/js/core/drop.js +16 -7
  45. package/src/js/core/scroll.js +1 -1
  46. package/src/js/util/position.js +4 -1
  47. package/tests/drop.html +36 -3
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.15.1",
5
+ "version": "3.15.2",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "homepage": "https://getuikit.com",
36
36
  "devDependencies": {
37
- "@babel/core": "^7.18.6",
38
- "@babel/preset-env": "^7.18.6",
37
+ "@babel/core": "^7.18.10",
38
+ "@babel/preset-env": "^7.18.10",
39
39
  "@rollup/plugin-alias": "^3.1.9",
40
40
  "@rollup/plugin-babel": "^5.3.1",
41
41
  "@rollup/plugin-replace": "^4.0.0",
@@ -43,18 +43,18 @@
43
43
  "camelcase": "^7.0.0",
44
44
  "clean-css": "^5.3.1",
45
45
  "dateformat": "^5.0.3",
46
- "esbuild": "^0.14.49",
47
- "eslint": "^8.19.0",
46
+ "esbuild": "^0.14.53",
47
+ "eslint": "^8.21.0",
48
48
  "eslint-config-prettier": "^8.5.0",
49
49
  "fs-extra": "^10.1.0",
50
50
  "glob": "^8.0.3",
51
- "inquirer": "^9.0.0",
51
+ "inquirer": "^9.1.0",
52
52
  "less": "^4.1.3",
53
53
  "minimist": "^1.2.6",
54
54
  "number-precision": "^1.5.2",
55
55
  "p-limit": "^4.0.0",
56
56
  "prettier": "^2.7.1",
57
- "rollup": "^2.77.0",
57
+ "rollup": "^2.77.2",
58
58
  "rollup-plugin-esbuild": "^4.9.1",
59
59
  "rollup-plugin-html": "^0.2.1",
60
60
  "rollup-plugin-modify": "^3.0.0",
@@ -43,6 +43,8 @@ export default {
43
43
  mode: 'list',
44
44
  toggle: Boolean,
45
45
  boundary: Boolean,
46
+ boundaryX: Boolean,
47
+ boundaryY: Boolean,
46
48
  target: Boolean,
47
49
  targetX: Boolean,
48
50
  targetY: Boolean,
@@ -59,6 +61,8 @@ export default {
59
61
  mode: ['click', 'hover'],
60
62
  toggle: '- *',
61
63
  boundary: false,
64
+ boundaryX: false,
65
+ boundaryY: false,
62
66
  target: false,
63
67
  targetX: false,
64
68
  targetY: false,
@@ -75,6 +79,13 @@ export default {
75
79
  },
76
80
 
77
81
  computed: {
82
+ boundary({ boundary, boundaryX, boundaryY }, $el) {
83
+ return [
84
+ query(boundaryX || boundary, $el) || window,
85
+ query(boundaryY || boundary, $el) || window,
86
+ ];
87
+ },
88
+
78
89
  target({ target, targetX, targetY }, $el) {
79
90
  targetX = targetX || target || this.targetEl;
80
91
  targetY = targetY || target || this.targetEl;
@@ -412,8 +423,6 @@ export default {
412
423
  // Ensure none positioned element does not generate scrollbars
413
424
  this.$el.hidden = true;
414
425
 
415
- const boundary = query(this.boundary, this.$el);
416
- const boundaryOffset = offset(boundary || window);
417
426
  const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
418
427
  const viewportOffset = this.getViewportOffset(this.$el);
419
428
 
@@ -426,7 +435,7 @@ export default {
426
435
  if (this.axis !== axis && includes([axis, true], this.stretch)) {
427
436
  css(this.$el, {
428
437
  [prop]: Math.min(
429
- boundaryOffset[prop],
438
+ offset(this.boundary[i])[prop],
430
439
  viewports[i][prop] - 2 * viewportOffset
431
440
  ),
432
441
  [`overflow-${axis}`]: 'auto',
@@ -444,7 +453,7 @@ export default {
444
453
 
445
454
  this.$el.hidden = false;
446
455
 
447
- this.positionAt(this.$el, this.target, boundary);
456
+ this.positionAt(this.$el, this.target, this.boundary);
448
457
 
449
458
  for (const [i, [axis, prop, start, end]] of dirs) {
450
459
  if (this.axis === axis && includes([axis, true], this.stretch)) {
@@ -457,17 +466,17 @@ export default {
457
466
  (targetOffset[start] > elOffset[start]
458
467
  ? targetOffset[start] -
459
468
  Math.max(
460
- boundaryOffset[start],
469
+ offset(this.boundary[i])[start],
461
470
  viewports[i][start] + viewportOffset
462
471
  )
463
472
  : Math.min(
464
- boundaryOffset[end],
473
+ offset(this.boundary[i])[end],
465
474
  viewports[i][end] - viewportOffset
466
475
  ) - targetOffset[end]) - positionOffset,
467
476
  [`overflow-${axis}`]: 'auto',
468
477
  });
469
478
 
470
- this.positionAt(this.$el, this.target, boundary);
479
+ this.positionAt(this.$el, this.target, this.boundary);
471
480
  }
472
481
  }
473
482
  },
@@ -41,7 +41,7 @@ function registerClick(cmp) {
41
41
  function unregisterClick(cmp) {
42
42
  components.delete(cmp);
43
43
 
44
- if (!components.length) {
44
+ if (!components.size) {
45
45
  off(document, 'click', clickHandler);
46
46
  }
47
47
  }
@@ -141,7 +141,10 @@ function getViewport(element, viewportOffset, boundary, i) {
141
141
  }
142
142
 
143
143
  if (boundary) {
144
- viewport = getIntersectionArea(viewport, offset(boundary));
144
+ viewport = getIntersectionArea(
145
+ viewport,
146
+ offset(isArray(boundary) ? boundary[i] : boundary)
147
+ );
145
148
  }
146
149
 
147
150
  return viewport;
package/tests/drop.html CHANGED
@@ -118,8 +118,15 @@
118
118
 
119
119
  <div class="uk-margin uk-form-stacked">
120
120
  <div class="uk-inline">
121
- <label class="uk-form-label" for="js-boundary-switcher">Boundary</label>
122
- <select id="js-boundary-switcher" class="uk-select uk-form-width-small">
121
+ <label class="uk-form-label" for="js-boundary-x-switcher">Boundary X</label>
122
+ <select id="js-boundary-x-switcher" class="uk-select uk-form-width-small">
123
+ <option value="false">Viewport</option>
124
+ <option value="!.test-boundary">Box</option>
125
+ </select>
126
+ </div>
127
+ <div class="uk-inline">
128
+ <label class="uk-form-label" for="js-boundary-y-switcher">Boundary Y</label>
129
+ <select id="js-boundary-y-switcher" class="uk-select uk-form-width-small">
123
130
  <option value="false">Viewport</option>
124
131
  <option value="!.test-boundary">Box</option>
125
132
  </select>
@@ -156,6 +163,20 @@
156
163
  <option value="y">Y</option>
157
164
  </select>
158
165
  </div>
166
+ <div class="uk-inline">
167
+ <label class="uk-form-label" for="js-flip-switcher">Flip</label>
168
+ <select id="js-flip-switcher" class="uk-select uk-form-width-xsmall">
169
+ <option value="false">False</option>
170
+ <option value="true" selected>True</option>
171
+ </select>
172
+ </div>
173
+ <div class="uk-inline">
174
+ <label class="uk-form-label" for="js-shift-switcher">Shift</label>
175
+ <select id="js-shift-switcher" class="uk-select uk-form-width-xsmall">
176
+ <option value="false">False</option>
177
+ <option value="true" selected>True</option>
178
+ </select>
179
+ </div>
159
180
  <div class="uk-inline">
160
181
  <label class="uk-form-label" for="js-animation-switcher">Animation</label>
161
182
  <select id="js-animation-switcher" class="uk-select uk-form-width-small">
@@ -634,6 +655,18 @@
634
655
  <td>false</td>
635
656
  <td>The area the drop can't exceed causing it to flip and shift. By default, the nearest scrolling ancestor.</td>
636
657
  </tr>
658
+ <tr>
659
+ <td><code>boundary-x</code></td>
660
+ <td>Boolean, CSS selector</td>
661
+ <td>false</td>
662
+ <td>The area on the x-axis the drop can't exceed causing it to flip and shift.</td>
663
+ </tr>
664
+ <tr>
665
+ <td><code>boundary-y</code></td>
666
+ <td>Boolean, CSS selector</td>
667
+ <td>false</td>
668
+ <td>The area on the y-axis the drop can't exceed causing it to flip and shift.</td>
669
+ </tr>
637
670
  <tr>
638
671
  <td><code>target</code></td>
639
672
  <td>Boolean, CSS selector</td>
@@ -732,7 +765,7 @@
732
765
  }
733
766
  });
734
767
 
735
- for (const option of ['boundary', 'target-x', 'target-y', 'inset', 'stretch', 'animation', 'animate-out', 'duration']) {
768
+ for (const option of ['boundary-x', 'boundary-y', 'target-x', 'target-y', 'inset', 'stretch', 'flip', 'shift', 'animation', 'animate-out', 'duration']) {
736
769
  on(`#js-${option}-switcher`, 'change', (e) =>
737
770
  attr($$('.js-options'), option, e.target.value)
738
771
  );