uikit 3.11.2-dev.57792c7e7 → 3.11.2-dev.78e397546

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 (53) hide show
  1. package/CHANGELOG.md +10 -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 +37 -41
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +32 -25
  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 +32 -25
  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 +2 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  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 +127 -67
  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 +190 -135
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/parallax.js +5 -16
  44. package/src/js/components/sortable.js +1 -2
  45. package/src/js/core/core.js +2 -2
  46. package/src/js/core/height-viewport.js +2 -2
  47. package/src/js/core/sticky.js +68 -42
  48. package/src/js/mixin/parallax.js +32 -21
  49. package/src/js/util/dimensions.js +28 -12
  50. package/src/js/util/fastdom.js +2 -2
  51. package/src/js/util/viewport.js +7 -3
  52. package/tests/sticky-parallax.html +43 -40
  53. package/tests/sticky.html +45 -24
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.11.2-dev.57792c7e7",
5
+ "version": "3.11.2-dev.78e397546",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -28,13 +28,15 @@ export default {
28
28
  },
29
29
 
30
30
  start({start}) {
31
- return parseCalc(start, this.target);
31
+ return toPx(start, 'height', this.target, true);
32
32
  },
33
33
 
34
34
  end({end, viewport}) {
35
- return parseCalc(
35
+ return toPx(
36
36
  end || (viewport = (1 - viewport) * 100) && `${viewport}vh+${viewport}%`,
37
- this.target
37
+ 'height',
38
+ this.target,
39
+ true
38
40
  );
39
41
  }
40
42
 
@@ -77,19 +79,6 @@ export default {
77
79
 
78
80
  };
79
81
 
80
- const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
81
- function parseCalc(calc, el) {
82
- let match;
83
- let result = 0;
84
- calc = calc.toString().replace(/\s/g, '');
85
- calcRe.lastIndex = 0;
86
- while ((match = calcRe.exec(calc)) !== null) {
87
- result += toPx(match[0], 'height', el, true);
88
- }
89
-
90
- return result;
91
- }
92
-
93
82
  function ease(percent, easing) {
94
83
  return easing >= 0
95
84
  ? Math.pow(percent, easing + 1)
@@ -218,7 +218,6 @@ export default {
218
218
 
219
219
  off(document, pointerMove, this.move);
220
220
  off(document, pointerUp, this.end);
221
- off(window, 'scroll', this.scroll);
222
221
 
223
222
  if (!this.drag) {
224
223
  return;
@@ -295,7 +294,7 @@ function trackScroll(pos) {
295
294
  trackTimer = setInterval(() => {
296
295
 
297
296
  let {x, y} = pos;
298
- y += window.pageYOffset;
297
+ y += scrollTop(window);
299
298
 
300
299
  const dist = (Date.now() - last) * .3;
301
300
  last = Date.now();
@@ -13,7 +13,7 @@ export default function (UIkit) {
13
13
  return;
14
14
  }
15
15
  pendingResize = true;
16
- fastdom.write(() => pendingResize = false);
16
+ fastdom.read(() => pendingResize = false);
17
17
  UIkit.update(null, 'resize');
18
18
  };
19
19
 
@@ -32,7 +32,7 @@ export default function (UIkit) {
32
32
  return;
33
33
  }
34
34
  pending = true;
35
- fastdom.write(() => pending = false);
35
+ fastdom.read(() => pending = false);
36
36
 
37
37
  UIkit.update(null, e.type);
38
38
 
@@ -1,5 +1,5 @@
1
1
  import FlexBug from '../mixin/flex-bug';
2
- import {boxModelAdjust, css, dimensions, endsWith, height, isNumeric, isString, isVisible, offset, query, toFloat} from 'uikit-util';
2
+ import {boxModelAdjust, css, dimensions, endsWith, height, isNumeric, isString, isVisible, offset, query, toFloat, trigger} from 'uikit-util';
3
3
 
4
4
  export default {
5
5
 
@@ -76,7 +76,7 @@ export default {
76
76
  css(this.$el, {minHeight});
77
77
 
78
78
  if (minHeight !== prev) {
79
- this.$update(this.$el, 'resize');
79
+ trigger(this.$el, 'resize');
80
80
  }
81
81
 
82
82
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
@@ -1,12 +1,13 @@
1
1
  import Class from '../mixin/class';
2
2
  import Media from '../mixin/media';
3
- import {$, addClass, after, Animation, assign, css, dimensions, fastdom, height as getHeight, hasClass, isNumeric, isString, isVisible, noop, offset, offsetPosition, parent, query, remove, removeClass, replaceClass, scrollTop, toFloat, toggleClass, toPx, trigger, within} from 'uikit-util';
3
+ import {$, addClass, after, Animation, assign, clamp, css, dimensions, fastdom, height as getHeight, getScrollingElement, hasClass, isNumeric, isString, isVisible, noop, offset, offsetPosition, parent, query, remove, removeClass, replaceClass, scrollTop, toggleClass, toPx, trigger, within} from 'uikit-util';
4
4
 
5
5
  export default {
6
6
 
7
7
  mixins: [Class, Media],
8
8
 
9
9
  props: {
10
+ position: String,
10
11
  top: null,
11
12
  bottom: Boolean,
12
13
  offset: String,
@@ -22,6 +23,7 @@ export default {
22
23
  },
23
24
 
24
25
  data: {
26
+ position: 'top',
25
27
  top: 0,
26
28
  bottom: false,
27
29
  offset: 0,
@@ -38,8 +40,19 @@ export default {
38
40
 
39
41
  computed: {
40
42
 
41
- offset({offset}) {
42
- return toPx(offset);
43
+ position({position}, $el) {
44
+ return position === 'auto'
45
+ ? (this.isFixed ? this.placeholder : $el).offsetHeight > getHeight(window)
46
+ ? 'bottom'
47
+ : 'top'
48
+ : position;
49
+ },
50
+
51
+ offset({offset}, $el) {
52
+ if (this.position === 'bottom') {
53
+ offset += '+100vh-100%';
54
+ }
55
+ return toPx(offset, 'height', $el);
43
56
  },
44
57
 
45
58
  selTarget({selTarget}, $el) {
@@ -100,7 +113,7 @@ export default {
100
113
 
101
114
  handler() {
102
115
 
103
- if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
116
+ if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
104
117
  return;
105
118
  }
106
119
 
@@ -146,24 +159,28 @@ export default {
146
159
 
147
160
  height = this.isActive ? height : this.$el.offsetHeight;
148
161
 
149
- if (height + this.offset > getHeight(window)) {
150
- this.inactive = true;
151
- return false;
152
- }
162
+ const overflow = Math.max(0, height + this.offset - getHeight(window));
153
163
 
154
164
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
155
- this.topOffset = offset(referenceElement).top;
156
- this.bottomOffset = this.topOffset + height;
157
- this.offsetParentTop = offset(referenceElement.offsetParent).top;
165
+ const topOffset = offset(referenceElement).top;
166
+ const offsetParentTop = offset(referenceElement.offsetParent).top;
158
167
 
159
- const bottom = parseProp('bottom', this);
168
+ const top = parseProp(this.top, this.$el, topOffset);
169
+ const bottom = parseProp(this.bottom, this.$el, topOffset + height);
160
170
 
161
- this.top = Math.max(toFloat(parseProp('top', this)), this.topOffset) - this.offset;
162
- this.bottom = bottom && bottom - this.$el.offsetHeight;
163
- this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
171
+ const start = Math.max(top, topOffset) - this.offset;
172
+ const end = bottom
173
+ ? bottom - this.$el.offsetHeight + overflow - this.offset
174
+ : getScrollingElement(this.$el).scrollHeight - getHeight(window);
164
175
 
165
176
  return {
177
+ start,
178
+ end,
179
+ overflow,
180
+ topOffset,
181
+ offsetParentTop,
166
182
  height,
183
+ width: dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
167
184
  top: offsetPosition(this.placeholder)[0],
168
185
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
169
186
  };
@@ -190,42 +207,48 @@ export default {
190
207
 
191
208
  {
192
209
 
193
- read({scroll = 0}) {
210
+ read({scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end}) {
194
211
 
195
- this.scroll = window.pageYOffset;
212
+ const scroll = scrollTop(window);
213
+ const dir = prevScroll <= scroll ? 'down' : 'up';
196
214
 
197
215
  return {
198
- dir: scroll <= this.scroll ? 'down' : 'up',
199
- scroll: this.scroll
216
+ dir,
217
+ prevDir,
218
+ scroll,
219
+ prevScroll,
220
+ overflowScroll: clamp(
221
+ overflowScroll
222
+ + clamp(scroll, start, end)
223
+ - clamp(prevScroll, start, end),
224
+ 0,
225
+ overflow
226
+ )
200
227
  };
201
228
  },
202
229
 
203
230
  write(data, types) {
204
231
 
205
- const now = Date.now();
206
232
  const isScrollUpdate = types.has('scroll');
207
- const {initTimestamp = 0, dir, lastDir, lastScroll, scroll, top} = data;
233
+ const {initTimestamp = 0, dir, prevDir, scroll, prevScroll = 0, top, start, topOffset, height} = data;
208
234
 
209
- data.lastScroll = scroll;
210
-
211
- if (scroll < 0 || scroll === lastScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
235
+ if (scroll < 0 || scroll === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
212
236
  return;
213
237
  }
214
238
 
215
- if (now - initTimestamp > 300 || dir !== lastDir) {
239
+ const now = Date.now();
240
+ if (now - initTimestamp > 300 || dir !== prevDir) {
216
241
  data.initScroll = scroll;
217
242
  data.initTimestamp = now;
218
243
  }
219
244
 
220
- data.lastDir = dir;
221
-
222
- if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
245
+ if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(prevScroll - scroll) <= 10) {
223
246
  return;
224
247
  }
225
248
 
226
249
  if (this.inactive
227
- || scroll < this.top
228
- || this.showOnUp && (scroll <= this.top || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= this.bottomOffset)
250
+ || scroll < start
251
+ || this.showOnUp && (scroll <= start || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= topOffset + height)
229
252
  ) {
230
253
 
231
254
  if (!this.isFixed) {
@@ -240,7 +263,7 @@ export default {
240
263
 
241
264
  this.isFixed = false;
242
265
 
243
- if (this.animation && scroll > this.topOffset) {
266
+ if (this.animation && scroll > topOffset) {
244
267
  Animation.cancel(this.$el);
245
268
  Animation.out(this.$el, this.animation).then(() => this.hide(), noop);
246
269
  } else {
@@ -290,23 +313,28 @@ export default {
290
313
 
291
314
  update() {
292
315
 
293
- const active = this.top !== 0 || this.scroll > this.top;
294
- let top = Math.max(0, this.offset);
316
+ const {width, scroll = 0, overflow, overflowScroll = 0, start, end, topOffset, height, offsetParentTop} = this._data;
317
+ const active = start !== 0 || scroll > start;
318
+ let top = this.offset;
295
319
  let position = 'fixed';
296
320
 
297
- if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
298
- top = this.bottom - this.offsetParentTop;
321
+ if (scroll > end) {
322
+ top = end + this.offset - offsetParentTop;
299
323
  position = 'absolute';
300
324
  }
301
325
 
326
+ if (overflow) {
327
+ top -= overflowScroll;
328
+ }
329
+
302
330
  css(this.$el, {
303
331
  position,
304
332
  top: `${top}px`,
305
- width: this.width
333
+ width
306
334
  });
307
335
 
308
336
  this.isActive = active;
309
- toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
337
+ toggleClass(this.$el, this.clsBelow, scroll > topOffset + height);
310
338
  addClass(this.$el, this.clsFixed);
311
339
 
312
340
  }
@@ -315,12 +343,10 @@ export default {
315
343
 
316
344
  };
317
345
 
318
- function parseProp(prop, {$props, $el, [`${prop}Offset`]: propOffset}) {
319
-
320
- const value = $props[prop];
346
+ function parseProp(value, el, propOffset) {
321
347
 
322
348
  if (!value) {
323
- return;
349
+ return 0;
324
350
  }
325
351
 
326
352
  if (isString(value) && value.match(/^-?\d/)) {
@@ -329,7 +355,7 @@ function parseProp(prop, {$props, $el, [`${prop}Offset`]: propOffset}) {
329
355
 
330
356
  } else {
331
357
 
332
- return offset(value === true ? parent($el) : query(value, $el)).bottom;
358
+ return offset(value === true ? parent(el) : query(value, el)).bottom;
333
359
 
334
360
  }
335
361
  }
@@ -1,6 +1,6 @@
1
1
  import Media from '../mixin/media';
2
2
  import {getMaxPathLength} from '../core/svg';
3
- import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, ucfirst} from 'uikit-util';
3
+ import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, trigger, ucfirst} from 'uikit-util';
4
4
 
5
5
  const props = {
6
6
  x: transformFn,
@@ -38,7 +38,7 @@ export default {
38
38
  props(properties, $el) {
39
39
  return keys(props).reduce((result, prop) => {
40
40
  if (!isUndefined(properties[prop])) {
41
- result[prop] = props[prop].call(this, prop, $el, properties[prop].slice());
41
+ result[prop] = props[prop](prop, $el, properties[prop].slice());
42
42
  }
43
43
  return result;
44
44
  }, {});
@@ -46,6 +46,12 @@ export default {
46
46
 
47
47
  },
48
48
 
49
+ events: {
50
+ bgimageload() {
51
+ this.$emit();
52
+ }
53
+ },
54
+
49
55
  methods: {
50
56
 
51
57
  reset() {
@@ -186,15 +192,15 @@ function backgroundFn(prop, el, steps) {
186
192
  const bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
187
193
 
188
194
  return getCssValue(el, 'backgroundSize', '') === 'cover'
189
- ? backgroundCoverFn.call(this, prop, el, steps, bgPos, attr)
195
+ ? backgroundCoverFn(prop, el, steps, bgPos, attr)
190
196
  : setBackgroundPosFn(prop, steps, bgPos);
191
197
  }
192
198
 
193
199
  function backgroundCoverFn(prop, el, steps, bgPos, attr) {
194
200
 
195
- const image = getBackgroundImage.call(this, el);
201
+ const dimImage = getBackgroundImageDimensions(el);
196
202
 
197
- if (!image.naturalWidth) {
203
+ if (!dimImage.width) {
198
204
  return noop;
199
205
  }
200
206
 
@@ -210,11 +216,6 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
210
216
  height: el.offsetHeight
211
217
  };
212
218
 
213
- const dimImage = {
214
- width: image.naturalWidth,
215
- height: image.naturalHeight
216
- };
217
-
218
219
  const baseDim = Dimensions.cover(dimImage, dimEl);
219
220
  const span = baseDim[attr] - dimEl[attr];
220
221
 
@@ -245,24 +246,34 @@ function setBackgroundPosFn(prop, steps, pos) {
245
246
  };
246
247
  }
247
248
 
248
- function getBackgroundImage(el) {
249
+ const dimensions = {};
250
+ function getBackgroundImageDimensions(el) {
249
251
  const src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
250
252
 
251
- const data = this._data;
252
-
253
- if (data[src]) {
254
- return data[src];
253
+ if (dimensions[src]) {
254
+ return dimensions[src];
255
255
  }
256
256
 
257
+ const image = new Image();
257
258
  if (src) {
258
- const img = new Image();
259
- img.src = src;
260
- if (!img.naturalWidth) {
261
- img.onload = () => this.$update();
262
- }
259
+ image.src = src;
263
260
 
264
- return data[src] = img;
261
+ if (!image.naturalWidth) {
262
+ image.onload = () => {
263
+ dimensions[src] = toDimensions(image);
264
+ trigger(el, 'bgimageload');
265
+ };
266
+ }
265
267
  }
268
+
269
+ return dimensions[src] = toDimensions(image);
270
+ }
271
+
272
+ function toDimensions(image) {
273
+ return {
274
+ width: image.naturalWidth,
275
+ height: image.naturalHeight
276
+ };
266
277
  }
267
278
 
268
279
  function getStep(steps, percent) {
@@ -1,5 +1,5 @@
1
1
  import {css} from './style';
2
- import {each, endsWith, isDocument, isElement, isNumeric, isUndefined, isWindow, toFloat, toNode, toWindow, ucfirst} from './lang';
2
+ import {each, isDocument, isElement, isString, isUndefined, isWindow, memoize, toFloat, toNode, toWindow, ucfirst} from './lang';
3
3
 
4
4
  const dirs = {
5
5
  width: ['left', 'right'],
@@ -157,19 +157,35 @@ export function flipPosition(pos) {
157
157
  }
158
158
 
159
159
  export function toPx(value, property = 'width', element = window, offsetDim = false) {
160
- return isNumeric(value)
161
- ? +value
162
- : endsWith(value, 'vh')
163
- ? percent(height(toWindow(element)), value)
164
- : endsWith(value, 'vw')
165
- ? percent(width(toWindow(element)), value)
166
- : endsWith(value, '%')
167
- ? percent(offsetDim
168
- ? element[`offset${ucfirst(property)}`]
169
- : dimensions(element)[property], value)
170
- : toFloat(value);
160
+
161
+ if (!isString(value)) {
162
+ return toFloat(value);
163
+ }
164
+
165
+ return parseCalc(value).reduce((result, value) => {
166
+ const unit = parseUnit(value);
167
+ if (unit) {
168
+ value = percent(
169
+ unit === 'vh'
170
+ ? height(toWindow(element))
171
+ : unit === 'vw'
172
+ ? width(toWindow(element))
173
+ : offsetDim
174
+ ? element[`offset${ucfirst(property)}`]
175
+ : dimensions(element)[property],
176
+ value
177
+ );
178
+ }
179
+
180
+ return result + toFloat(value);
181
+ }, 0);
171
182
  }
172
183
 
184
+ const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
185
+ const parseCalc = memoize(calc => calc.toString().replace(/\s/g, '').match(calcRe) || []);
186
+ const unitRe = /(?:v[hw]|%)$/;
187
+ const parseUnit = memoize(str => (str.match(unitRe) || [])[0]);
188
+
173
189
  function percent(base, value) {
174
190
  return base * toFloat(value) / 100;
175
191
  }
@@ -31,7 +31,7 @@ export const fastdom = {
31
31
 
32
32
  };
33
33
 
34
- function flush(recursion = 1) {
34
+ function flush(recursion) {
35
35
  runTasks(fastdom.reads);
36
36
  runTasks(fastdom.writes.splice(0));
37
37
 
@@ -53,7 +53,7 @@ function scheduleFlush(recursion) {
53
53
  if (recursion && recursion < RECURSION_LIMIT) {
54
54
  Promise.resolve().then(() => flush(recursion));
55
55
  } else {
56
- requestAnimationFrame(() => flush());
56
+ requestAnimationFrame(() => flush(1));
57
57
  }
58
58
 
59
59
  }
@@ -2,7 +2,7 @@ import {css} from './style';
2
2
  import {Promise} from './promise';
3
3
  import {isVisible, parents} from './filter';
4
4
  import {offset, offsetPosition} from './dimensions';
5
- import {clamp, findIndex, intersectRect, isDocument, isWindow, toNode, toWindow} from './lang';
5
+ import {clamp, findIndex, intersectRect, isDocument, isUndefined, isWindow, toNode, toWindow} from './lang';
6
6
 
7
7
  export function isInView(element, offsetTop = 0, offsetLeft = 0) {
8
8
 
@@ -31,7 +31,11 @@ export function scrollTop(element, top) {
31
31
  element = toNode(element);
32
32
  }
33
33
 
34
- element.scrollTop = top;
34
+ if (isUndefined(top)) {
35
+ return element.scrollTop;
36
+ } else {
37
+ element.scrollTop = top;
38
+ }
35
39
  }
36
40
 
37
41
  export function scrollIntoView(element, {offset: offsetBy = 0} = {}) {
@@ -145,7 +149,7 @@ export function getViewportClientHeight(scrollElement) {
145
149
  return (scrollElement === getScrollingElement(scrollElement) ? document.documentElement : scrollElement).clientHeight;
146
150
  }
147
151
 
148
- function getScrollingElement(element) {
152
+ export function getScrollingElement(element) {
149
153
  const {document} = toWindow(element);
150
154
  return document.scrollingElement || document.documentElement;
151
155
  }