uikit 3.13.8-dev.bd666a112 → 3.13.8-dev.ecda751d3

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 +1 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  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 +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  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 +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  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 +1 -1
  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 +14 -54
  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 +50 -57
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/tooltip.js +38 -3
  44. package/src/js/core/accordion.js +1 -1
  45. package/src/js/core/drop.js +6 -5
  46. package/src/js/core/navbar.js +1 -1
  47. package/src/js/mixin/position.js +4 -43
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.bd666a112",
5
+ "version": "3.13.8-dev.ecda751d3",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -6,9 +6,11 @@ import {
6
6
  attr,
7
7
  flipPosition,
8
8
  hasAttr,
9
+ includes,
9
10
  isFocusable,
10
11
  isTouch,
11
12
  matches,
13
+ offset,
12
14
  on,
13
15
  once,
14
16
  pointerDown,
@@ -104,10 +106,12 @@ export default {
104
106
 
105
107
  this.positionAt(this.tooltip, this.$el);
106
108
 
109
+ const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
110
+
107
111
  this.origin =
108
- this.getAxis() === 'y'
109
- ? `${flipPosition(this.dir)}-${this.align}`
110
- : `${this.align}-${flipPosition(this.dir)}`;
112
+ this.axis === 'y'
113
+ ? `${flipPosition(dir)}-${align}`
114
+ : `${align}-${flipPosition(dir)}`;
111
115
  });
112
116
 
113
117
  this.toggleElement(this.tooltip, true);
@@ -143,3 +147,34 @@ function makeFocusable(el) {
143
147
  attr(el, 'tabindex', '0');
144
148
  }
145
149
  }
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
+ }
@@ -48,7 +48,7 @@ export default {
48
48
  computed: {
49
49
  items: {
50
50
  get({ targets }, $el) {
51
- return $$(targets, $el);
51
+ return $$(targets, $el).filter((el) => $(this.content, el));
52
52
  },
53
53
 
54
54
  watch(items, prev) {
@@ -362,17 +362,18 @@ 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}`, '');
365
368
 
366
369
  if (this.pos[1] === 'justify') {
367
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
368
370
  css(this.$el, prop, alignTo[prop]);
369
- } else if (
370
- this.$el.offsetWidth >
371
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left)
372
- ) {
371
+ } else if (this.$el.offsetWidth > boundaryOffset.width) {
373
372
  addClass(this.$el, `${this.clsDrop}-stack`);
374
373
  }
375
374
 
375
+ css(this.$el, `max-${prop}`, boundaryOffset[prop]);
376
+
376
377
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
377
378
  },
378
379
  },
@@ -299,7 +299,7 @@ export default {
299
299
  return this.dropbar;
300
300
  },
301
301
 
302
- handler(_, { $el, dir }) {
302
+ handler(_, { $el, pos: [dir] = [] }) {
303
303
  if (!hasClass($el, this.clsDrop)) {
304
304
  return;
305
305
  }
@@ -25,21 +25,19 @@ export default {
25
25
 
26
26
  connected() {
27
27
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
28
- this.dir = this.pos[0];
29
- this.align = this.pos[1];
28
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
30
29
  },
31
30
 
32
31
  methods: {
33
32
  positionAt(element, target, boundary) {
34
33
  const [dir, align] = this.pos;
35
- const axis = this.getAxis(dir);
36
34
 
37
35
  let { offset } = this;
38
36
  if (!isNumeric(offset)) {
39
37
  const node = $(offset);
40
38
  offset = node
41
- ? getOffset(node)[axis === 'x' ? 'left' : 'top'] -
42
- getOffset(target)[axis === 'x' ? 'right' : 'bottom']
39
+ ? getOffset(node)[this.axis === 'x' ? 'left' : 'top'] -
40
+ getOffset(target)[this.axis === 'x' ? 'right' : 'bottom']
43
41
  : 0;
44
42
  }
45
43
  offset = toPx(offset) + toPx(getCssVar('position-offset', element));
@@ -50,7 +48,7 @@ export default {
50
48
  target: [dir, align],
51
49
  };
52
50
 
53
- if (axis === 'y') {
51
+ if (this.axis === 'y') {
54
52
  for (const prop in attach) {
55
53
  attach[prop] = attach[prop].reverse();
56
54
  }
@@ -63,43 +61,6 @@ export default {
63
61
  boundary,
64
62
  flip: this.flip,
65
63
  });
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';
72
64
  },
73
65
  },
74
66
  };
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
- }