uikit 3.13.8-dev.7605e7963 → 3.13.8-dev.bd666a112

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 +49 -41
  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 +52 -12
  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 +55 -48
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/components/tooltip.js +3 -38
  43. package/src/js/core/drop.js +5 -6
  44. package/src/js/mixin/position.js +43 -4
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.8-dev.7605e7963",
5
+ "version": "3.13.8-dev.bd666a112",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -6,11 +6,9 @@ import {
6
6
  attr,
7
7
  flipPosition,
8
8
  hasAttr,
9
- includes,
10
9
  isFocusable,
11
10
  isTouch,
12
11
  matches,
13
- offset,
14
12
  on,
15
13
  once,
16
14
  pointerDown,
@@ -106,12 +104,10 @@ export default {
106
104
 
107
105
  this.positionAt(this.tooltip, this.$el);
108
106
 
109
- const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
110
-
111
107
  this.origin =
112
- this.axis === 'y'
113
- ? `${flipPosition(dir)}-${align}`
114
- : `${align}-${flipPosition(dir)}`;
108
+ this.getAxis() === 'y'
109
+ ? `${flipPosition(this.dir)}-${this.align}`
110
+ : `${this.align}-${flipPosition(this.dir)}`;
115
111
  });
116
112
 
117
113
  this.toggleElement(this.tooltip, true);
@@ -147,34 +143,3 @@ function makeFocusable(el) {
147
143
  attr(el, 'tabindex', '0');
148
144
  }
149
145
  }
150
-
151
- function getAlignment(el, target, [dir, align]) {
152
- const elOffset = offset(el);
153
- const targetOffset = offset(target);
154
- const properties = [
155
- ['left', 'right'],
156
- ['top', 'bottom'],
157
- ];
158
-
159
- for (const props of properties) {
160
- if (elOffset[props[0]] >= targetOffset[props[1]]) {
161
- dir = props[1];
162
- break;
163
- }
164
- if (elOffset[props[1]] <= targetOffset[props[0]]) {
165
- dir = props[0];
166
- break;
167
- }
168
- }
169
-
170
- const props = includes(properties[0], dir) ? properties[1] : properties[0];
171
- if (elOffset[props[0]] === targetOffset[props[0]]) {
172
- align = props[0];
173
- } else if (elOffset[props[1]] === targetOffset[props[1]]) {
174
- align = props[1];
175
- } else {
176
- align = 'center';
177
- }
178
-
179
- return [dir, align];
180
- }
@@ -362,18 +362,17 @@ export default {
362
362
  const boundaryOffset = offset(boundary);
363
363
  const targetOffset = offset(this.target);
364
364
  const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
365
- const prop = this.axis === 'y' ? 'width' : 'height';
366
-
367
- css(this.$el, `max-${prop}`, '');
368
365
 
369
366
  if (this.pos[1] === 'justify') {
367
+ const prop = this.getAxis() === 'y' ? 'width' : 'height';
370
368
  css(this.$el, prop, alignTo[prop]);
371
- } else if (this.$el.offsetWidth > boundaryOffset.width) {
369
+ } else if (
370
+ this.$el.offsetWidth >
371
+ Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left)
372
+ ) {
372
373
  addClass(this.$el, `${this.clsDrop}-stack`);
373
374
  }
374
375
 
375
- css(this.$el, `max-${prop}`, boundaryOffset[prop]);
376
-
377
376
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
378
377
  },
379
378
  },
@@ -25,19 +25,21 @@ export default {
25
25
 
26
26
  connected() {
27
27
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
28
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
28
+ this.dir = this.pos[0];
29
+ this.align = this.pos[1];
29
30
  },
30
31
 
31
32
  methods: {
32
33
  positionAt(element, target, boundary) {
33
34
  const [dir, align] = this.pos;
35
+ const axis = this.getAxis(dir);
34
36
 
35
37
  let { offset } = this;
36
38
  if (!isNumeric(offset)) {
37
39
  const node = $(offset);
38
40
  offset = node
39
- ? getOffset(node)[this.axis === 'x' ? 'left' : 'top'] -
40
- getOffset(target)[this.axis === 'x' ? 'right' : 'bottom']
41
+ ? getOffset(node)[axis === 'x' ? 'left' : 'top'] -
42
+ getOffset(target)[axis === 'x' ? 'right' : 'bottom']
41
43
  : 0;
42
44
  }
43
45
  offset = toPx(offset) + toPx(getCssVar('position-offset', element));
@@ -48,7 +50,7 @@ export default {
48
50
  target: [dir, align],
49
51
  };
50
52
 
51
- if (this.axis === 'y') {
53
+ if (axis === 'y') {
52
54
  for (const prop in attach) {
53
55
  attach[prop] = attach[prop].reverse();
54
56
  }
@@ -61,6 +63,43 @@ export default {
61
63
  boundary,
62
64
  flip: this.flip,
63
65
  });
66
+
67
+ [this.dir, this.align] = getAlignment(element, target, this.pos);
68
+ },
69
+
70
+ getAxis(dir = this.dir) {
71
+ return includes(['top', 'bottom'], dir) ? 'y' : 'x';
64
72
  },
65
73
  },
66
74
  };
75
+
76
+ function getAlignment(el, target, [dir, align]) {
77
+ const elOffset = getOffset(el);
78
+ const targetOffset = getOffset(target);
79
+ const properties = [
80
+ ['left', 'right'],
81
+ ['top', 'bottom'],
82
+ ];
83
+
84
+ for (const props of properties) {
85
+ if (elOffset[props[0]] >= targetOffset[props[1]]) {
86
+ dir = props[1];
87
+ break;
88
+ }
89
+ if (elOffset[props[1]] <= targetOffset[props[0]]) {
90
+ dir = props[0];
91
+ break;
92
+ }
93
+ }
94
+
95
+ const props = includes(properties[0], dir) ? properties[1] : properties[0];
96
+ if (elOffset[props[0]] === targetOffset[props[0]]) {
97
+ align = props[0];
98
+ } else if (elOffset[props[1]] === targetOffset[props[1]]) {
99
+ align = props[1];
100
+ } else {
101
+ align = 'center';
102
+ }
103
+
104
+ return [dir, align];
105
+ }