uikit 3.25.26 → 3.25.27-dev.9e97c1f

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 (226) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/build/prefix.js +1 -1
  3. package/build/publishDev.js +1 -1
  4. package/build/scope.js +1 -1
  5. package/build/scss.js +1 -1
  6. package/build/util.js +0 -2
  7. package/dist/css/uikit-core-rtl.css +1327 -1204
  8. package/dist/css/uikit-core-rtl.min.css +1 -1
  9. package/dist/css/uikit-core.css +1327 -1204
  10. package/dist/css/uikit-core.min.css +1 -1
  11. package/dist/css/uikit-rtl.css +1339 -1223
  12. package/dist/css/uikit-rtl.min.css +1 -1
  13. package/dist/css/uikit.css +1339 -1223
  14. package/dist/css/uikit.min.css +1 -1
  15. package/dist/js/components/countdown.js +1 -1
  16. package/dist/js/components/countdown.min.js +1 -1
  17. package/dist/js/components/filter.js +1 -1
  18. package/dist/js/components/filter.min.js +1 -1
  19. package/dist/js/components/lightbox-panel.js +149 -146
  20. package/dist/js/components/lightbox-panel.min.js +1 -1
  21. package/dist/js/components/lightbox.js +150 -147
  22. package/dist/js/components/lightbox.min.js +1 -1
  23. package/dist/js/components/marquee.js +215 -0
  24. package/dist/js/components/marquee.min.js +1 -0
  25. package/dist/js/components/notification.js +8 -6
  26. package/dist/js/components/notification.min.js +1 -1
  27. package/dist/js/components/parallax.js +8 -12
  28. package/dist/js/components/parallax.min.js +1 -1
  29. package/dist/js/components/slider-parallax.js +8 -12
  30. package/dist/js/components/slider-parallax.min.js +1 -1
  31. package/dist/js/components/slider.js +65 -26
  32. package/dist/js/components/slider.min.js +1 -1
  33. package/dist/js/components/slideshow-parallax.js +8 -12
  34. package/dist/js/components/slideshow-parallax.min.js +1 -1
  35. package/dist/js/components/slideshow.js +95 -103
  36. package/dist/js/components/slideshow.min.js +1 -1
  37. package/dist/js/components/sortable.js +1 -1
  38. package/dist/js/components/sortable.min.js +1 -1
  39. package/dist/js/components/tooltip.js +15 -17
  40. package/dist/js/components/tooltip.min.js +1 -1
  41. package/dist/js/components/upload.js +1 -1
  42. package/dist/js/components/upload.min.js +1 -1
  43. package/dist/js/uikit-core.js +888 -337
  44. package/dist/js/uikit-core.min.js +1 -1
  45. package/dist/js/uikit-icons.js +1 -1
  46. package/dist/js/uikit-icons.min.js +1 -1
  47. package/dist/js/uikit.js +766 -433
  48. package/dist/js/uikit.min.js +1 -1
  49. package/package.json +1 -1
  50. package/src/js/api/component.js +2 -3
  51. package/src/js/api/observables.js +16 -4
  52. package/src/js/api/options.js +6 -3
  53. package/src/js/api/props.js +1 -3
  54. package/src/js/api/state.js +7 -8
  55. package/src/js/components/index.js +1 -0
  56. package/src/js/components/internal/lightbox-animations.js +7 -26
  57. package/src/js/components/internal/slider-preload.js +1 -0
  58. package/src/js/components/internal/slideshow-animations.js +15 -62
  59. package/src/js/components/lightbox-panel.js +123 -109
  60. package/src/js/components/lightbox.js +5 -8
  61. package/src/js/components/marquee.js +156 -0
  62. package/src/js/components/notification.js +7 -5
  63. package/src/js/core/accordion.js +62 -31
  64. package/src/js/core/alert.js +1 -1
  65. package/src/js/core/drop.js +4 -3
  66. package/src/js/core/dropnav.js +13 -32
  67. package/src/js/core/grid.js +5 -19
  68. package/src/js/core/margin.js +3 -0
  69. package/src/js/core/overflow-auto.js +5 -1
  70. package/src/js/core/sticky.js +1 -1
  71. package/src/js/core/switcher.js +18 -62
  72. package/src/js/core/video.js +236 -21
  73. package/src/js/mixin/connect.js +90 -0
  74. package/src/js/mixin/internal/slideshow-animations.js +5 -13
  75. package/src/js/mixin/internal/slideshow-transitioner.js +2 -2
  76. package/src/js/mixin/parallax.js +1 -4
  77. package/src/js/mixin/position.js +1 -1
  78. package/src/js/mixin/scroll-driven.js +57 -0
  79. package/src/js/mixin/slider-nav.js +2 -12
  80. package/src/js/mixin/slider-parallax.js +9 -38
  81. package/src/js/mixin/togglable.js +13 -14
  82. package/src/js/util/attr.js +7 -7
  83. package/src/js/util/dom.js +3 -4
  84. package/src/js/util/keys.js +14 -0
  85. package/src/js/util/lang.js +2 -2
  86. package/src/js/util/player.js +4 -2
  87. package/src/js/util/style.js +12 -13
  88. package/src/js/util/viewport.js +22 -25
  89. package/src/less/components/_import.less +8 -3
  90. package/src/less/components/animation.less +1 -1
  91. package/src/less/components/base.less +1 -1
  92. package/src/less/components/button.less +1 -1
  93. package/src/less/components/card.less +8 -8
  94. package/src/less/components/dropcap.less +71 -0
  95. package/src/less/components/floating-shadow.less +66 -0
  96. package/src/less/components/form.less +15 -15
  97. package/src/less/components/grid.less +58 -65
  98. package/src/less/components/lightbox.less +2 -8
  99. package/src/less/components/logo.less +94 -0
  100. package/src/less/components/margin.less +155 -124
  101. package/src/less/components/marquee.less +133 -0
  102. package/src/less/components/modal.less +1 -4
  103. package/src/less/components/nav.less +1 -1
  104. package/src/less/components/navbar.less +1 -1
  105. package/src/less/components/padding.less +9 -9
  106. package/src/less/components/position.less +9 -4
  107. package/src/less/components/search.less +1 -1
  108. package/src/less/components/slideshow.less +1 -4
  109. package/src/less/components/switcher.less +5 -2
  110. package/src/less/components/table.less +4 -4
  111. package/src/less/components/text.less +10 -4
  112. package/src/less/components/utility.less +0 -163
  113. package/src/less/components/visibility.less +4 -4
  114. package/src/less/theme/_import.less +6 -2
  115. package/src/less/theme/alert.less +0 -5
  116. package/src/less/theme/dropcap.less +29 -0
  117. package/src/less/theme/floating-shadow.less +20 -0
  118. package/src/less/theme/logo.less +29 -0
  119. package/src/less/theme/marquee.less +14 -0
  120. package/src/less/theme/thumbnav.less +1 -4
  121. package/src/less/theme/utility.less +0 -32
  122. package/src/scss/components/_import.scss +8 -3
  123. package/src/scss/components/animation.scss +1 -1
  124. package/src/scss/components/base.scss +1 -1
  125. package/src/scss/components/button.scss +1 -1
  126. package/src/scss/components/card.scss +8 -8
  127. package/src/scss/components/dropcap.scss +63 -0
  128. package/src/scss/components/floating-shadow.scss +63 -0
  129. package/src/scss/components/form.scss +14 -14
  130. package/src/scss/components/grid.scss +57 -64
  131. package/src/scss/components/lightbox.scss +2 -8
  132. package/src/scss/components/logo.scss +75 -0
  133. package/src/scss/components/margin.scss +155 -124
  134. package/src/scss/components/marquee.scss +136 -0
  135. package/src/scss/components/modal.scss +1 -4
  136. package/src/scss/components/nav.scss +1 -1
  137. package/src/scss/components/navbar.scss +1 -1
  138. package/src/scss/components/padding.scss +9 -9
  139. package/src/scss/components/position.scss +9 -4
  140. package/src/scss/components/search.scss +1 -1
  141. package/src/scss/components/slideshow.scss +1 -4
  142. package/src/scss/components/switcher.scss +5 -2
  143. package/src/scss/components/table.scss +4 -4
  144. package/src/scss/components/text.scss +10 -4
  145. package/src/scss/components/utility.scss +0 -129
  146. package/src/scss/components/visibility.scss +4 -4
  147. package/src/scss/mixins-theme.scss +44 -43
  148. package/src/scss/mixins.scss +40 -31
  149. package/src/scss/variables-theme.scss +14 -14
  150. package/src/scss/variables.scss +14 -14
  151. package/tests/accordion.html +77 -10
  152. package/tests/alert.html +1 -1
  153. package/tests/align.html +5 -5
  154. package/tests/animation.html +4 -4
  155. package/tests/article.html +7 -7
  156. package/tests/background.html +2 -2
  157. package/tests/badge.html +1 -1
  158. package/tests/base.html +2 -2
  159. package/tests/button.html +1 -1
  160. package/tests/card.html +15 -15
  161. package/tests/close.html +2 -2
  162. package/tests/comment.html +9 -9
  163. package/tests/container.html +2 -2
  164. package/tests/countdown.html +21 -21
  165. package/tests/cover.html +3 -3
  166. package/tests/description-list.html +1 -1
  167. package/tests/divider.html +3 -3
  168. package/tests/dotnav.html +1 -1
  169. package/tests/drop.html +7 -7
  170. package/tests/dropbar.html +5 -5
  171. package/tests/dropcap.html +26 -0
  172. package/tests/dropdown.html +1 -1
  173. package/tests/dropnav.html +18 -18
  174. package/tests/filter.html +3 -3
  175. package/tests/floating-shadow.html +44 -0
  176. package/tests/form.html +14 -14
  177. package/tests/grid.html +41 -47
  178. package/tests/heading.html +2 -2
  179. package/tests/height-viewport.html +4 -4
  180. package/tests/height.html +5 -5
  181. package/tests/icon.html +8 -8
  182. package/tests/image.html +6 -6
  183. package/tests/index.html +13 -13
  184. package/tests/js/index.js +1 -1
  185. package/tests/leader.html +5 -5
  186. package/tests/lightbox.html +6 -6
  187. package/tests/link.html +1 -1
  188. package/tests/list.html +4 -4
  189. package/tests/logo.html +84 -0
  190. package/tests/margin.html +59 -7
  191. package/tests/marker.html +3 -3
  192. package/tests/marquee.html +617 -0
  193. package/tests/modal.html +3 -3
  194. package/tests/nav.html +5 -5
  195. package/tests/navbar.html +27 -27
  196. package/tests/notification.html +8 -2
  197. package/tests/offcanvas.html +12 -12
  198. package/tests/overlay.html +3 -3
  199. package/tests/padding.html +1 -1
  200. package/tests/pagination.html +3 -3
  201. package/tests/parallax.html +1 -1
  202. package/tests/position.html +6 -6
  203. package/tests/scrollspy.html +13 -13
  204. package/tests/search.html +5 -5
  205. package/tests/section.html +17 -17
  206. package/tests/slidenav.html +3 -3
  207. package/tests/slider.html +5 -5
  208. package/tests/slideshow.html +33 -3
  209. package/tests/sortable.html +15 -15
  210. package/tests/sticky-navbar.html +4 -4
  211. package/tests/sticky-parallax.html +3 -3
  212. package/tests/sticky.html +3 -3
  213. package/tests/svg.html +3 -2
  214. package/tests/switcher.html +7 -7
  215. package/tests/tab.html +5 -5
  216. package/tests/text.html +9 -3
  217. package/tests/tile.html +4 -4
  218. package/tests/toggle.html +1 -1
  219. package/tests/tooltip.html +3 -3
  220. package/tests/totop.html +2 -2
  221. package/tests/transition.html +1 -1
  222. package/tests/upload.html +5 -5
  223. package/tests/utility.html +16 -116
  224. package/tests/video.html +224 -24
  225. package/tests/visibility.html +4 -4
  226. package/tests/width.html +12 -12
@@ -0,0 +1,156 @@
1
+ import {
2
+ $,
3
+ children,
4
+ css,
5
+ dimensions,
6
+ getIndex,
7
+ hasClass,
8
+ inBrowser,
9
+ isRtl,
10
+ pointerEnter,
11
+ pointerLeave,
12
+ toggleClass,
13
+ toPx,
14
+ } from 'uikit-util';
15
+ import { intersection, preloadMedia, resize } from '../api/observables';
16
+ import Class from '../mixin/class';
17
+
18
+ const hasAnimationApi = inBrowser && window.Animation;
19
+
20
+ export default {
21
+ mixins: [Class],
22
+
23
+ props: {
24
+ velocity: Number,
25
+ start: Number,
26
+ reverse: Boolean,
27
+ pause: Boolean,
28
+ pauseVelocity: Number,
29
+ fadeSize: null,
30
+ },
31
+
32
+ data: {
33
+ velocity: 25,
34
+ start: 0,
35
+ reverse: false,
36
+ pause: false,
37
+ pauseVelocity: 10,
38
+ selList: '.uk-marquee-items',
39
+ fadeSize: 0,
40
+ },
41
+
42
+ computed: {
43
+ list: ({ selList }, $el) => $(selList, $el),
44
+ items() {
45
+ return children(this.list);
46
+ },
47
+ },
48
+
49
+ watch: {
50
+ items() {
51
+ this.$emit();
52
+ },
53
+ },
54
+
55
+ observe: [
56
+ resize({
57
+ target: ({ $el, items }) => [$el, ...items],
58
+ }),
59
+ intersection({
60
+ handler(entries) {
61
+ let active;
62
+ for (const entry of entries) {
63
+ entry.target.inert = !entry.isIntersecting;
64
+ active ||= entry.isIntersecting && entry.target;
65
+ }
66
+
67
+ if (!active) {
68
+ return;
69
+ }
70
+
71
+ const { items } = this;
72
+ const index = items.indexOf(active);
73
+ if (!~index) {
74
+ return;
75
+ }
76
+
77
+ const direction = this.reverse ? 1 : -1;
78
+ for (let offset = 1; offset < items.length; offset++) {
79
+ const item = items[getIndex(index + direction * offset, items)];
80
+ if (item.inert) {
81
+ preloadMedia(item);
82
+ break;
83
+ }
84
+ }
85
+ },
86
+ target: ({ items }) => items,
87
+ args: { intersecting: false },
88
+ options: ({ $el }) => ({ root: $el }),
89
+ }),
90
+ ],
91
+
92
+ methods: {
93
+ vertical() {
94
+ return hasClass(this.$el, `${this.$options.id}-vertical`);
95
+ },
96
+ },
97
+
98
+ events: {
99
+ name: [pointerEnter, pointerLeave],
100
+ el: ({ $el }) => $el,
101
+ self: true,
102
+ filter: ({ pause }) => hasAnimationApi && pause,
103
+ handler(e) {
104
+ for (const el of this.items) {
105
+ for (const animation of el.getAnimations()) {
106
+ animation.playbackRate =
107
+ e.type === pointerEnter ? this.pauseVelocity / this.velocity : 1;
108
+ }
109
+ }
110
+ },
111
+ },
112
+
113
+ update: {
114
+ write() {
115
+ const prefix = this.$options.id;
116
+ const items = this.items;
117
+ const vertical = this.vertical();
118
+
119
+ css(items, 'offset', 'none');
120
+
121
+ const dir = vertical ? ['top', 'bottom'] : ['left', 'right'];
122
+ if (!vertical && isRtl) {
123
+ dir.reverse();
124
+ }
125
+
126
+ const listStart = dimensions(this.list)[dir[0]];
127
+ const itemEnds = items.map((el) => dimensions(el)[dir[1]]);
128
+ const listEnd = Math[!vertical && isRtl ? 'min' : 'max'](...itemEnds);
129
+
130
+ for (const [index, el] of items.entries()) {
131
+ const elEnd = itemEnds[index];
132
+ const line1 = listEnd - elEnd;
133
+ const line2 = elEnd - listStart;
134
+ const path = vertical
135
+ ? `"M0 0 v${line1}M0 ${-line2} v${line2}"`
136
+ : `"M0 0 h${line1}M${-line2} 0 h${line2}"`;
137
+ css(el, `--${prefix}-path`, path);
138
+ }
139
+
140
+ css(this.$el, {
141
+ [`--${prefix}-duration`]: `${Math.abs(listStart - listEnd) / this.velocity}s`,
142
+ [`--${prefix}-start`]: this.start,
143
+ [`--${prefix}-direction`]: this.reverse ? 'reverse' : 'normal',
144
+ '--uk-overflow-fade-size': this.fadeSize
145
+ ? `${toPx(this.fadeSize, vertical ? 'height' : 'width', this.$el, true)}px`
146
+ : '',
147
+ });
148
+
149
+ toggleClass(this.$el, `${prefix}-fade`, this.fadeSize);
150
+
151
+ css(items, 'offset', '');
152
+ },
153
+
154
+ events: ['resize'],
155
+ },
156
+ };
@@ -25,6 +25,7 @@ export default {
25
25
  message: '',
26
26
  status: '',
27
27
  timeout: 5000,
28
+ duration: 400,
28
29
  group: '',
29
30
  pos: 'top-center',
30
31
  clsContainer: 'uk-notification',
@@ -67,10 +68,11 @@ export default {
67
68
 
68
69
  async connected() {
69
70
  const margin = toFloat(css(this.$el, this.marginProp));
70
- await Transition.start(css(this.$el, this.startProps), {
71
- opacity: 1,
72
- [this.marginProp]: margin,
73
- });
71
+ await Transition.start(
72
+ css(this.$el, this.startProps),
73
+ { opacity: 1, [this.marginProp]: margin },
74
+ this.duration,
75
+ );
74
76
 
75
77
  if (this.timeout) {
76
78
  this.timer = setTimeout(this.close, this.timeout);
@@ -114,7 +116,7 @@ export default {
114
116
  }
115
117
 
116
118
  if (!immediate) {
117
- await Transition.start(this.$el, this.startProps);
119
+ await Transition.start(this.$el, this.startProps, this.duration);
118
120
  }
119
121
 
120
122
  removeFn(this.$el);
@@ -6,6 +6,7 @@ import {
6
6
  css,
7
7
  dimensions,
8
8
  filter,
9
+ findIndex,
9
10
  getIndex,
10
11
  hasClass,
11
12
  includes,
@@ -22,17 +23,16 @@ import {
22
23
  import { generateId } from '../api/instance';
23
24
  import { lazyload } from '../api/observables';
24
25
  import Class from '../mixin/class';
26
+ import Connect from '../mixin/connect';
25
27
  import { maybeDefaultPreventClick } from '../mixin/event';
26
- import Togglable from '../mixin/togglable';
27
28
  import { keyMap } from '../util/keys';
28
29
 
29
30
  const wrappers = new WeakMap();
30
31
 
31
32
  export default {
32
- mixins: [Class, Togglable],
33
+ mixins: [Class, Connect],
33
34
 
34
35
  props: {
35
- animation: Boolean,
36
36
  targets: String,
37
37
  active: null,
38
38
  collapsible: Boolean,
@@ -40,18 +40,25 @@ export default {
40
40
  toggle: String,
41
41
  content: String,
42
42
  offset: Number,
43
+ switcherConnect: String,
43
44
  },
44
45
 
45
46
  data: {
46
47
  targets: '> *',
47
48
  active: false,
48
- animation: true,
49
+ animation: [true],
49
50
  collapsible: true,
50
51
  multiple: false,
51
52
  clsOpen: 'uk-open',
53
+ cls: 'uk-active',
52
54
  toggle: '.uk-accordion-title',
53
55
  content: '.uk-accordion-content',
54
56
  offset: 0,
57
+ switcherConnect: '',
58
+ },
59
+
60
+ beforeConnect() {
61
+ this.connect = this.$props.connect = this.switcherConnect;
55
62
  },
56
63
 
57
64
  computed: {
@@ -83,6 +90,13 @@ export default {
83
90
  }
84
91
  },
85
92
 
93
+ connectChildren() {
94
+ this.showConnects(
95
+ findIndex(this.items, (el) => hasClass(el, this.clsOpen)),
96
+ false,
97
+ );
98
+ },
99
+
86
100
  toggles() {
87
101
  this.$emit();
88
102
  },
@@ -149,52 +163,69 @@ export default {
149
163
  continue;
150
164
  }
151
165
 
152
- toggle.id = generateId(this, toggle);
153
- content.id = generateId(this, content);
154
-
155
166
  const active = includes(activeItems, this.items[index]);
167
+
168
+ attr(content, {
169
+ id: generateId(this, content),
170
+ role: 'region',
171
+ 'aria-labelledby': toggle.id,
172
+ });
173
+ if (isTag(content, 'ul')) {
174
+ attr(children(content), 'role', 'presentation');
175
+ }
176
+
177
+ const controls = [
178
+ content.id,
179
+ ...this.connects.map(({ children }) => children[index]?.id).filter(Boolean),
180
+ ];
181
+
156
182
  attr(toggle, {
157
183
  role: isTag(toggle, 'a') ? 'button' : null,
158
- 'aria-controls': content.id,
184
+ 'aria-controls': controls.join(' '),
159
185
  'aria-expanded': active,
160
186
  'aria-disabled': !this.collapsible && activeItems.length < 2 && active,
161
187
  });
162
-
163
- attr(content, { role: 'region', 'aria-labelledby': toggle.id });
164
- if (isTag(content, 'ul')) {
165
- attr(children(content), 'role', 'presentation');
166
- }
167
188
  }
168
189
  },
169
190
 
170
191
  methods: {
171
- toggle(item, animate) {
172
- item = this.items[getIndex(item, this.items)];
192
+ async toggle(item, animate) {
193
+ animate = animate !== false;
194
+
195
+ const next = getIndex(item, this.items);
196
+
197
+ item = this.items[next];
173
198
  let items = [item];
174
199
  const activeItems = filter(this.items, `.${this.clsOpen}`);
200
+ const isActive = includes(activeItems, item);
175
201
 
176
- if (!this.multiple && !includes(activeItems, items[0])) {
177
- items = items.concat(activeItems);
202
+ if (isActive && !this.collapsible && activeItems.length < 2) {
203
+ return;
178
204
  }
179
205
 
180
- if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
181
- items = [];
206
+ if (!isActive && !this.multiple) {
207
+ items.push(...activeItems);
182
208
  }
183
209
 
184
- return Promise.all(
185
- items.map((el) =>
186
- this.toggleElement(el, !includes(activeItems, el), (el, show) => {
187
- toggleClass(el, this.clsOpen, show);
210
+ const toggle = (el) =>
211
+ this.toggleElement(el, !includes(activeItems, el), (el, show) => {
212
+ toggleClass(el, this.clsOpen, show);
188
213
 
189
- if (animate === false || !this.animation) {
190
- hide($(this.content, el), !show);
191
- return;
192
- }
214
+ if (!animate || !this.hasAnimation) {
215
+ hide($(this.content, el), !show);
216
+ return;
217
+ }
193
218
 
194
- return transition(el, show, this);
195
- }),
196
- ),
197
- );
219
+ return transition(el, show, this);
220
+ });
221
+
222
+ const hideIndex = () =>
223
+ findIndex(this.items, (i) => i !== item && includes(activeItems, i));
224
+
225
+ return Promise.all([
226
+ ...items.map(toggle),
227
+ this.showConnects(isActive ? hideIndex() : next, animate),
228
+ ]);
198
229
  },
199
230
  },
200
231
  };
@@ -32,7 +32,7 @@ export default {
32
32
 
33
33
  methods: {
34
34
  async close() {
35
- await this.toggleElement(this.$el, false, animate);
35
+ await this.toggleElement(this.$el, false, this.animation ? animate : false);
36
36
  this.$destroy(true);
37
37
  },
38
38
  },
@@ -391,6 +391,7 @@ export default {
391
391
  this.$el.hidden = true;
392
392
 
393
393
  const viewports = this.target.map((target) => getViewport(this.$el, target));
394
+ const boundaryOffsets = this.boundary.map((el) => offset(el));
394
395
  const viewportOffset = this.getViewportOffset(this.$el);
395
396
 
396
397
  const dirs = [
@@ -402,7 +403,7 @@ export default {
402
403
  if (this.axis !== axis && includes([axis, true], this.stretch)) {
403
404
  css(this.$el, {
404
405
  [prop]: Math.min(
405
- offset(this.boundary[i])[prop],
406
+ boundaryOffsets[i][prop],
406
407
  viewports[i][prop] - 2 * viewportOffset,
407
408
  ),
408
409
  [`overflow-${axis}`]: 'auto',
@@ -435,11 +436,11 @@ export default {
435
436
  (targetOffset[start] > elOffset[start]
436
437
  ? targetOffset[this.inset ? end : start] -
437
438
  Math.max(
438
- offset(this.boundary[i])[start],
439
+ boundaryOffsets[i][start],
439
440
  viewports[i][start] + viewportOffset,
440
441
  )
441
442
  : Math.min(
442
- offset(this.boundary[i])[end],
443
+ boundaryOffsets[i][end],
443
444
  viewports[i][end] - viewportOffset,
444
445
  ) - targetOffset[this.inset ? start : end]) - positionOffset,
445
446
  [`overflow-${axis}`]: 'auto',
@@ -29,7 +29,7 @@ import {
29
29
  } from 'uikit-util';
30
30
  import Class from '../mixin/class';
31
31
  import Container from '../mixin/container';
32
- import { keyMap } from '../util/keys';
32
+ import { getNavigationIndex, keyMap } from '../util/keys';
33
33
  import { active } from './drop';
34
34
 
35
35
  export default {
@@ -200,20 +200,7 @@ export default {
200
200
  }
201
201
 
202
202
  const active = this.getActive();
203
- let next = -1;
204
-
205
- if (keyCode === keyMap.HOME) {
206
- next = 0;
207
- } else if (keyCode === keyMap.END) {
208
- next = 'last';
209
- } else if (keyCode === keyMap.UP) {
210
- next = 'previous';
211
- } else if (keyCode === keyMap.DOWN) {
212
- next = 'next';
213
- } else if (keyCode === keyMap.ESC) {
214
- active.targetEl?.focus();
215
- }
216
-
203
+ const next = getNavigationIndex(keyCode, keyMap.UP, keyMap.DOWN);
217
204
  if (~next) {
218
205
  e.preventDefault();
219
206
  const elements = $$(selFocusable, current);
@@ -227,6 +214,10 @@ export default {
227
214
  return;
228
215
  }
229
216
 
217
+ if (keyCode === keyMap.ESC) {
218
+ active.targetEl?.focus();
219
+ }
220
+
230
221
  handleNavItemNavigation(e, this.items, active);
231
222
  },
232
223
  },
@@ -286,9 +277,9 @@ export default {
286
277
  const drop = this.getDropdown(target);
287
278
  const adjustHeight = () => {
288
279
  const maxBottom = Math.max(
289
- ...parents(target, `.${this.clsDrop}`)
290
- .concat(target)
291
- .map((el) => offset(el).bottom),
280
+ ...[...parents(target, `.${this.clsDrop}`), target].map(
281
+ (el) => offset(el).bottom,
282
+ ),
292
283
  );
293
284
 
294
285
  offset(this.dropbar, {
@@ -417,25 +408,15 @@ export default {
417
408
 
418
409
  function handleNavItemNavigation(e, toggles, active) {
419
410
  const { current, keyCode } = e;
420
- let next = -1;
421
-
422
- if (keyCode === keyMap.HOME) {
423
- next = 0;
424
- } else if (keyCode === keyMap.END) {
425
- next = 'last';
426
- } else if (keyCode === keyMap.LEFT) {
427
- next = 'previous';
428
- } else if (keyCode === keyMap.RIGHT) {
429
- next = 'next';
430
- } else if (keyCode === keyMap.TAB) {
431
- active.targetEl?.focus();
432
- active.hide?.(false);
433
- }
411
+ const next = getNavigationIndex(keyCode);
434
412
 
435
413
  if (~next) {
436
414
  e.preventDefault();
437
415
  active.hide?.(false);
438
416
  toggles[getIndex(next, toggles, toggles.indexOf(active.targetEl || current))].focus();
417
+ } else if (keyCode === keyMap.TAB) {
418
+ active.targetEl?.focus();
419
+ active.hide?.(false);
439
420
  }
440
421
  }
441
422
 
@@ -1,14 +1,4 @@
1
- import {
2
- addClass,
3
- css,
4
- hasClass,
5
- isRtl,
6
- scrolledOver,
7
- sumBy,
8
- toFloat,
9
- toggleClass,
10
- toPx,
11
- } from 'uikit-util';
1
+ import { addClass, css, isRtl, scrolledOver, sumBy, toFloat, toggleClass, toPx } from 'uikit-util';
12
2
  import { scroll } from '../api/observables';
13
3
  import Class from '../mixin/class';
14
4
  import Margin from './margin';
@@ -29,7 +19,8 @@ export default {
29
19
  },
30
20
 
31
21
  data: {
32
- margin: 'uk-grid-margin',
22
+ margin: '',
23
+ firstRow: 'uk-first-row',
33
24
  clsStack: 'uk-grid-stack',
34
25
  masonry: false,
35
26
  parallax: 0,
@@ -56,7 +47,7 @@ export default {
56
47
  {
57
48
  read(data) {
58
49
  const { rows } = data;
59
- let { masonry, parallax, parallaxJustify, margin } = this;
50
+ let { masonry, parallax, parallaxJustify } = this;
60
51
 
61
52
  parallax = Math.max(0, toPx(parallax));
62
53
 
@@ -71,7 +62,7 @@ export default {
71
62
  return (data.translates = data.scrollColumns = false);
72
63
  }
73
64
 
74
- let gutter = getGutter(rows, margin);
65
+ let gutter = toFloat(css(this.$el, 'row-gap'));
75
66
 
76
67
  let columns;
77
68
  let translates;
@@ -185,11 +176,6 @@ function applyMasonry(rows, gutter, next) {
185
176
  return [columns, translates];
186
177
  }
187
178
 
188
- function getGutter(rows, cls) {
189
- const node = rows.flat().find((el) => hasClass(el, cls));
190
- return toFloat(node ? css(node, 'marginTop') : css(rows[0][0], 'paddingLeft'));
191
- }
192
-
193
179
  function transpose(rows) {
194
180
  const columns = [];
195
181
  for (const row of rows) {
@@ -4,11 +4,13 @@ import { mutation, resize } from '../api/observables';
4
4
  export default {
5
5
  props: {
6
6
  margin: String,
7
+ firstRow: Boolean,
7
8
  firstColumn: Boolean,
8
9
  },
9
10
 
10
11
  data: {
11
12
  margin: 'uk-margin-small-top',
13
+ firstRow: false,
12
14
  firstColumn: 'uk-first-column',
13
15
  },
14
16
 
@@ -52,6 +54,7 @@ export default {
52
54
  for (const row of rows) {
53
55
  for (const el of row) {
54
56
  toggleClass(el, this.margin, rows[0] !== row);
57
+ toggleClass(el, this.firstRow, rows[0] === row);
55
58
  toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);
56
59
  }
57
60
  }
@@ -1,4 +1,4 @@
1
- import { css, dimensions, height, isVisible } from 'uikit-util';
1
+ import { boxModelAdjust, css, dimensions, isVisible } from 'uikit-util';
2
2
  import { resize } from '../api/observables';
3
3
  import Class from '../mixin/class';
4
4
 
@@ -48,3 +48,7 @@ export default {
48
48
  events: ['resize'],
49
49
  },
50
50
  };
51
+
52
+ function height(el) {
53
+ return dimensions(el).height - boxModelAdjust(el, 'height', css(el, 'boxSizing'));
54
+ }
@@ -464,7 +464,7 @@ function parseProp(value, el, propOffset, padding) {
464
464
  return 0;
465
465
  }
466
466
 
467
- if (isNumeric(value) || (isString(value) && value.match(/^-?\d/))) {
467
+ if (isNumeric(value) || (isString(value) && /^-?\d/.test(value))) {
468
468
  return propOffset + toPx(value, 'height', el, true);
469
469
  } else {
470
470
  const refElement = value === true ? getVisibleParent(el) : query(value, el);