uikit 3.13.7-dev.04818b8b8 → 3.13.8-dev.06ac04d2b

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 (71) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/dist/css/uikit-core-rtl.css +34 -5
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +34 -5
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +34 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +34 -3
  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 +12 -10
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +12 -10
  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 +12 -10
  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 +59 -29
  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 +172 -176
  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 +209 -180
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +5 -5
  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 +10 -6
  46. package/src/js/core/height-match.js +10 -15
  47. package/src/js/core/navbar.js +1 -1
  48. package/src/js/mixin/media.js +11 -9
  49. package/src/js/mixin/position.js +22 -24
  50. package/src/js/util/position.js +128 -129
  51. package/src/less/components/dropdown.less +11 -1
  52. package/src/less/components/nav.less +22 -0
  53. package/src/less/components/navbar.less +22 -2
  54. package/src/less/theme/dropdown.less +2 -0
  55. package/src/less/theme/nav.less +4 -0
  56. package/src/less/theme/navbar.less +2 -0
  57. package/src/scss/components/dropdown.scss +11 -1
  58. package/src/scss/components/nav.scss +22 -0
  59. package/src/scss/components/navbar.scss +22 -2
  60. package/src/scss/mixins-theme.scss +4 -0
  61. package/src/scss/mixins.scss +4 -0
  62. package/src/scss/theme/dropdown.scss +2 -0
  63. package/src/scss/theme/nav.scss +4 -0
  64. package/src/scss/theme/navbar.scss +2 -0
  65. package/src/scss/variables-theme.scss +5 -1
  66. package/src/scss/variables.scss +5 -1
  67. package/tests/drop.html +0 -6
  68. package/tests/dropdown.html +18 -10
  69. package/tests/nav.html +27 -0
  70. package/tests/navbar.html +18 -4
  71. package/tests/position.html +38 -39
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.7-dev.04818b8b8",
5
+ "version": "3.13.8-dev.06ac04d2b",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -41,9 +41,9 @@
41
41
  "@rollup/plugin-replace": "^4.0.0",
42
42
  "archiver": "^5.3.0",
43
43
  "camelcase": "^6.3.0",
44
- "clean-css": "^5.2.4",
44
+ "clean-css": "^5.3.0",
45
45
  "dateformat": "^5.0.3",
46
- "esbuild": "^0.14.28",
46
+ "esbuild": "^0.14.32",
47
47
  "eslint": "^8.12.0",
48
48
  "eslint-config-prettier": "^8.5.0",
49
49
  "fs-extra": "^10.0.1",
@@ -53,9 +53,9 @@
53
53
  "minimist": "^1.2.6",
54
54
  "number-precision": "^1.5.2",
55
55
  "p-limit": "^4.0.0",
56
- "prettier": "^2.6.1",
56
+ "prettier": "^2.6.2",
57
57
  "rollup": "^2.70.1",
58
- "rollup-plugin-esbuild": "^4.8.2",
58
+ "rollup-plugin-esbuild": "^4.9.1",
59
59
  "rollup-plugin-html": "^0.2.1",
60
60
  "rollup-plugin-modify": "^3.0.0",
61
61
  "rtlcss": "^3.5.0",
@@ -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) {
@@ -62,8 +62,11 @@ export default {
62
62
  this.tracker = new MouseTracker();
63
63
  },
64
64
 
65
- connected() {
65
+ beforeConnect() {
66
66
  this.clsDrop = this.$props.clsDrop || `uk-${this.$options.name}`;
67
+ },
68
+
69
+ connected() {
67
70
  addClass(this.$el, this.clsDrop);
68
71
 
69
72
  if (this.toggle && !this.target) {
@@ -359,17 +362,18 @@ export default {
359
362
  const boundaryOffset = offset(boundary);
360
363
  const targetOffset = offset(this.target);
361
364
  const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
365
+ const prop = this.axis === 'y' ? 'width' : 'height';
366
+
367
+ css(this.$el, `max-${prop}`, '');
362
368
 
363
369
  if (this.pos[1] === 'justify') {
364
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
365
370
  css(this.$el, prop, alignTo[prop]);
366
- } else if (
367
- this.$el.offsetWidth >
368
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left)
369
- ) {
371
+ } else if (this.$el.offsetWidth > boundaryOffset.width) {
370
372
  addClass(this.$el, `${this.clsDrop}-stack`);
371
373
  }
372
374
 
375
+ css(this.$el, `max-${prop}`, boundaryOffset[prop]);
376
+
373
377
  this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
374
378
  },
375
379
  },
@@ -1,7 +1,10 @@
1
+ import Resize from '../mixin/resize';
1
2
  import { getRows } from './margin';
2
- import { $$, boxModelAdjust, css, dimensions, isVisible, toFloat } from 'uikit-util';
3
+ import { $$, boxModelAdjust, css, dimensions, isVisible } from 'uikit-util';
3
4
 
4
5
  export default {
6
+ mixins: [Resize],
7
+
5
8
  args: 'target',
6
9
 
7
10
  props: {
@@ -53,22 +56,14 @@ function match(elements) {
53
56
  return { heights: [''], elements };
54
57
  }
55
58
 
59
+ css(elements, 'minHeight', '');
56
60
  let heights = elements.map(getHeight);
57
- let max = Math.max(...heights);
58
- const hasMinHeight = elements.some((el) => el.style.minHeight);
59
- const hasShrunk = elements.some((el, i) => !el.style.minHeight && heights[i] < max);
60
-
61
- if (hasMinHeight && hasShrunk) {
62
- css(elements, 'minHeight', '');
63
- heights = elements.map(getHeight);
64
- max = Math.max(...heights);
65
- }
66
-
67
- heights = elements.map((el, i) =>
68
- heights[i] === max && toFloat(el.style.minHeight).toFixed(2) !== max.toFixed(2) ? '' : max
69
- );
61
+ const max = Math.max(...heights);
70
62
 
71
- return { heights, elements };
63
+ return {
64
+ heights: elements.map((el, i) => (heights[i].toFixed(2) === max.toFixed(2) ? '' : max)),
65
+ elements,
66
+ };
72
67
  }
73
68
 
74
69
  function getHeight(element) {
@@ -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
  }
@@ -20,16 +20,18 @@ export default {
20
20
 
21
21
  connected() {
22
22
  const media = toMedia(this.media);
23
- this.mediaObj = window.matchMedia(media);
24
- const handler = () => {
25
- this.matchMedia = this.mediaObj.matches;
26
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
27
- };
28
- this.offMediaObj = on(this.mediaObj, 'change', () => {
23
+ if (media) {
24
+ this.mediaObj = window.matchMedia(media);
25
+ const handler = () => {
26
+ this.matchMedia = this.mediaObj.matches;
27
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
28
+ };
29
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
30
+ handler();
31
+ this.$emit('resize');
32
+ });
29
33
  handler();
30
- this.$emit('resize');
31
- });
32
- handler();
34
+ }
33
35
  },
34
36
 
35
37
  disconnected() {
@@ -3,6 +3,7 @@ import {
3
3
  flipPosition,
4
4
  getCssVar,
5
5
  offset as getOffset,
6
+ includes,
6
7
  isNumeric,
7
8
  isRtl,
8
9
  positionAt,
@@ -24,45 +25,42 @@ export default {
24
25
 
25
26
  connected() {
26
27
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
27
- this.dir = this.pos[0];
28
- this.align = this.pos[1];
28
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
29
29
  },
30
30
 
31
31
  methods: {
32
32
  positionAt(element, target, boundary) {
33
- const axis = this.getAxis();
34
- const dir = this.pos[0];
35
- const align = this.pos[1];
33
+ const [dir, align] = this.pos;
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));
44
+ offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
46
45
 
47
- const { x, y } = positionAt(
48
- element,
49
- target,
50
- axis === 'x' ? `${flipPosition(dir)} ${align}` : `${align} ${flipPosition(dir)}`,
51
- axis === 'x' ? `${dir} ${align}` : `${align} ${dir}`,
52
- axis === 'x'
53
- ? `${dir === 'left' ? -offset : offset}`
54
- : ` ${dir === 'top' ? -offset : offset}`,
55
- null,
56
- this.flip,
57
- boundary
58
- ).target;
46
+ const attach = {
47
+ element: [flipPosition(dir), align],
48
+ target: [dir, align],
49
+ };
59
50
 
60
- this.dir = axis === 'x' ? x : y;
61
- this.align = axis === 'x' ? y : x;
62
- },
51
+ if (this.axis === 'y') {
52
+ for (const prop in attach) {
53
+ attach[prop] = attach[prop].reverse();
54
+ }
55
+ offset = offset.reverse();
56
+ }
63
57
 
64
- getAxis() {
65
- return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
58
+ positionAt(element, target, {
59
+ attach,
60
+ offset,
61
+ boundary,
62
+ flip: this.flip,
63
+ });
66
64
  },
67
65
  },
68
66
  };
@@ -1,156 +1,155 @@
1
1
  import { offset } from './dimensions';
2
- import { each, endsWith, includes, toFloat } from './lang';
2
+ import { clamp, includes } from './lang';
3
3
  import { getViewport, scrollParents } from './viewport';
4
4
 
5
- const dirs = {
6
- width: ['x', 'left', 'right'],
7
- height: ['y', 'top', 'bottom'],
8
- };
9
-
10
- export function positionAt(
11
- element,
12
- target,
13
- elAttach,
14
- targetAttach,
15
- elOffset,
16
- targetOffset,
17
- flip,
18
- boundary
19
- ) {
20
- elAttach = getPos(elAttach);
21
- targetAttach = getPos(targetAttach);
22
-
23
- const flipped = { element: elAttach, target: targetAttach };
24
-
25
- if (!element || !target) {
26
- return flipped;
5
+ const dirs = [
6
+ ['width', 'x', 'left', 'right'],
7
+ ['height', 'y', 'top', 'bottom'],
8
+ ];
9
+
10
+ export function positionAt(element, target, options) {
11
+ options = {
12
+ attach: {
13
+ element: ['left', 'top'],
14
+ target: ['left', 'top'],
15
+ ...options.attach,
16
+ },
17
+ offset: [0, 0],
18
+ ...options,
19
+ };
20
+
21
+ const dim = options.flip
22
+ ? attachToWithFlip(element, target, options)
23
+ : attachTo(element, target, options);
24
+
25
+ offset(element, dim);
26
+ }
27
+
28
+ function attachTo(element, target, options) {
29
+ let { attach, offset: offsetBy } = {
30
+ attach: {
31
+ element: ['left', 'top'],
32
+ target: ['left', 'top'],
33
+ ...options.attach,
34
+ },
35
+ offset: [0, 0],
36
+ ...options,
37
+ };
38
+
39
+ const position = offset(element);
40
+ const targetOffset = offset(target);
41
+ for (const i in dirs) {
42
+ const [prop, dir, start, end] = dirs[i];
43
+ position[start] = position[dir] =
44
+ targetOffset[start] +
45
+ moveBy(attach.target[i], end, targetOffset[prop]) -
46
+ moveBy(attach.element[i], end, position[prop]) +
47
+ +offsetBy[i];
48
+ position[end] = position[start] + position[prop];
27
49
  }
50
+ return position;
51
+ }
28
52
 
29
- const dim = offset(element);
53
+ function attachToWithFlip(element, target, options) {
54
+ const position = attachTo(element, target, options);
30
55
  const targetDim = offset(target);
31
- const position = targetDim;
56
+ const viewports = scrollParents(element).map(getViewport);
57
+
58
+ let {
59
+ flip,
60
+ attach: { element: elAttach, target: targetAttach },
61
+ offset: elOffset,
62
+ boundary,
63
+ viewport,
64
+ } = options;
32
65
 
33
- moveTo(position, elAttach, dim, -1);
34
- moveTo(position, targetAttach, targetDim, 1);
66
+ viewports.push(viewport);
35
67
 
36
- elOffset = getOffsets(elOffset, dim.width, dim.height);
37
- targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
68
+ for (const i in dirs) {
69
+ const [prop, dir, start, end] = dirs[i];
38
70
 
39
- elOffset['x'] += targetOffset['x'];
40
- elOffset['y'] += targetOffset['y'];
71
+ if (flip !== true && !includes(flip, dir)) {
72
+ continue;
73
+ }
41
74
 
42
- position.left += elOffset['x'];
43
- position.top += elOffset['y'];
75
+ const willFlip =
76
+ !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
44
77
 
45
- if (flip) {
46
- let boundaries = scrollParents(element).map(getViewport);
78
+ viewport = getIntersectionArea(
79
+ ...viewports,
80
+ willFlip || position[prop] > offset(boundary)[prop] ? null : boundary
81
+ );
82
+ const isInStartBoundary = position[start] >= viewport[start];
83
+ const isInEndBoundary = position[end] <= viewport[end];
47
84
 
48
- if (boundary && !includes(boundaries, boundary)) {
49
- boundaries.unshift(boundary);
85
+ if (isInStartBoundary && isInEndBoundary) {
86
+ continue;
50
87
  }
51
88
 
52
- boundaries = boundaries.map((el) => offset(el));
89
+ let offsetBy;
53
90
 
54
- each(dirs, ([dir, align, alignFlip], prop) => {
55
- if (!(flip === true || includes(flip, dir))) {
56
- return;
91
+ // Flip
92
+ if (willFlip) {
93
+ if (
94
+ (elAttach[i] === end && isInStartBoundary) ||
95
+ (elAttach[i] === start && isInEndBoundary)
96
+ ) {
97
+ continue;
57
98
  }
58
99
 
59
- boundaries.some((boundary) => {
60
- const elemOffset =
61
- elAttach[dir] === align
62
- ? -dim[prop]
63
- : elAttach[dir] === alignFlip
64
- ? dim[prop]
65
- : 0;
66
-
67
- const targetOffset =
68
- targetAttach[dir] === align
69
- ? targetDim[prop]
70
- : targetAttach[dir] === alignFlip
71
- ? -targetDim[prop]
72
- : 0;
73
-
74
- if (
75
- position[align] < boundary[align] ||
76
- position[align] + dim[prop] > boundary[alignFlip]
77
- ) {
78
- const centerOffset = dim[prop] / 2;
79
- const centerTargetOffset =
80
- targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
81
-
82
- return (
83
- (elAttach[dir] === 'center' &&
84
- (apply(centerOffset, centerTargetOffset) ||
85
- apply(-centerOffset, -centerTargetOffset))) ||
86
- apply(elemOffset, targetOffset)
87
- );
88
- }
89
-
90
- function apply(elemOffset, targetOffset) {
91
- const newVal = toFloat(
92
- (position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4)
93
- );
94
-
95
- if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
96
- position[align] = newVal;
97
-
98
- for (const el of ['element', 'target']) {
99
- if (elemOffset) {
100
- flipped[el][dir] =
101
- flipped[el][dir] === dirs[prop][1]
102
- ? dirs[prop][2]
103
- : dirs[prop][1];
104
- }
105
- }
106
-
107
- return true;
108
- }
109
- }
110
- });
111
- });
112
- }
100
+ offsetBy =
101
+ (elAttach[i] === start
102
+ ? -position[prop]
103
+ : elAttach[i] === end
104
+ ? position[prop]
105
+ : 0) +
106
+ (targetAttach[i] === start
107
+ ? targetDim[prop]
108
+ : targetAttach[i] === end
109
+ ? -targetDim[prop]
110
+ : 0) -
111
+ elOffset[i] * 2;
112
+
113
+ // Move
114
+ } else {
115
+ offsetBy =
116
+ clamp(
117
+ clamp(position[start], viewport[start], viewport[end] - position[prop]),
118
+ targetDim[start] - position[prop] + elOffset[i],
119
+ targetDim[end] - elOffset[i]
120
+ ) - position[start];
121
+ }
113
122
 
114
- offset(element, position);
123
+ position[start] = position[dir] = position[start] + offsetBy;
124
+ position[end] += offsetBy;
125
+ }
115
126
 
116
- return flipped;
127
+ return position;
117
128
  }
118
129
 
119
- function moveTo(position, attach, dim, factor) {
120
- each(dirs, ([dir, align, alignFlip], prop) => {
121
- if (attach[dir] === alignFlip) {
122
- position[align] += dim[prop] * factor;
123
- } else if (attach[dir] === 'center') {
124
- position[align] += (dim[prop] * factor) / 2;
125
- }
126
- });
130
+ function moveBy(start, end, dim) {
131
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
127
132
  }
128
133
 
129
- function getPos(pos) {
130
- const x = /left|center|right/;
131
- const y = /top|center|bottom/;
132
-
133
- pos = (pos || '').split(' ');
134
-
135
- if (pos.length === 1) {
136
- pos = x.test(pos[0])
137
- ? pos.concat('center')
138
- : y.test(pos[0])
139
- ? ['center'].concat(pos)
140
- : ['center', 'center'];
134
+ function getIntersectionArea(...elements) {
135
+ let intersection;
136
+ for (const el of elements.filter(Boolean)) {
137
+ const rect = offset(el);
138
+ if (!intersection) {
139
+ intersection = rect;
140
+ continue;
141
+ }
142
+ for (const prop of ['left', 'top']) {
143
+ intersection[prop] = Math.max(rect[prop], intersection[prop]);
144
+ }
145
+ for (const prop of ['right', 'bottom']) {
146
+ intersection[prop] = Math.min(rect[prop], intersection[prop]);
147
+ }
141
148
  }
142
-
143
- return {
144
- x: x.test(pos[0]) ? pos[0] : 'center',
145
- y: y.test(pos[1]) ? pos[1] : 'center',
146
- };
149
+ return intersection;
147
150
  }
148
151
 
149
- function getOffsets(offsets, width, height) {
150
- const [x, y] = (offsets || '').split(' ');
151
-
152
- return {
153
- x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
154
- y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0,
155
- };
152
+ function intersectLine(dimA, dimB, dir) {
153
+ const [, , start, end] = dirs[dir];
154
+ return dimA[end] > dimB[start] && dimB[end] > dimA[start];
156
155
  }
@@ -29,6 +29,7 @@
29
29
 
30
30
  @dropdown-nav-item-color: @global-muted-color;
31
31
  @dropdown-nav-item-hover-color: @global-color;
32
+ @dropdown-nav-subtitle-font-size: @global-small-font-size;
32
33
  @dropdown-nav-header-color: @global-emphasis-color;
33
34
  @dropdown-nav-divider-border-width: @global-border-width;
34
35
  @dropdown-nav-divider-border: @global-border;
@@ -74,7 +75,6 @@
74
75
  ========================================================================== */
75
76
 
76
77
  .uk-dropdown-nav {
77
- white-space: nowrap;
78
78
  .hook-dropdown-nav();
79
79
  }
80
80
 
@@ -94,6 +94,15 @@
94
94
  .hook-dropdown-nav-item-hover();
95
95
  }
96
96
 
97
+ /*
98
+ * Subtitle
99
+ */
100
+
101
+ .uk-dropdown-nav .uk-nav-subtitle {
102
+ font-size: @dropdown-nav-subtitle-font-size;
103
+ .hook-dropdown-nav-subtitle();
104
+ }
105
+
97
106
  /*
98
107
  * Header
99
108
  */
@@ -138,6 +147,7 @@
138
147
  .hook-dropdown-nav() {}
139
148
  .hook-dropdown-nav-item() {}
140
149
  .hook-dropdown-nav-item-hover() {}
150
+ .hook-dropdown-nav-subtitle() {}
141
151
  .hook-dropdown-nav-header() {}
142
152
  .hook-dropdown-nav-divider() {}
143
153
  .hook-dropdown-misc() {}