@karta.io/simplebar 0.33.8 → 0.34.0-alpha.1
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.
- package/dist/simplebar.cjs +8 -6
- package/dist/simplebar.mjs +3 -1
- package/package.json +1 -1
- package/src/simplebar.js +3 -1
package/dist/simplebar.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const throttle = require('lodash-es/throttle');
|
|
4
|
+
const debounce = require('lodash-es/debounce');
|
|
5
|
+
const memoize = require('lodash-es/memoize');
|
|
4
6
|
const resizeObserver = require('@juggle/resize-observer');
|
|
5
7
|
const canUseDOM = require('can-use-dom');
|
|
6
8
|
|
|
@@ -237,16 +239,16 @@ const _SimpleBar = class {
|
|
|
237
239
|
if (_SimpleBar.instances.has(this.el)) {
|
|
238
240
|
return;
|
|
239
241
|
}
|
|
240
|
-
this.recalculate =
|
|
241
|
-
this.onMouseMove =
|
|
242
|
-
this.hideScrollbars =
|
|
242
|
+
this.recalculate = throttle(this.recalculate.bind(this), 64);
|
|
243
|
+
this.onMouseMove = throttle(this.onMouseMove.bind(this), 64);
|
|
244
|
+
this.hideScrollbars = debounce(
|
|
243
245
|
this.hideScrollbars.bind(this),
|
|
244
246
|
this.options.timeout
|
|
245
247
|
);
|
|
246
|
-
this.onWindowResize =
|
|
248
|
+
this.onWindowResize = debounce(this.onWindowResize.bind(this), 64, {
|
|
247
249
|
leading: true
|
|
248
250
|
});
|
|
249
|
-
_SimpleBar.getRtlHelpers =
|
|
251
|
+
_SimpleBar.getRtlHelpers = memoize(_SimpleBar.getRtlHelpers);
|
|
250
252
|
this.init();
|
|
251
253
|
}
|
|
252
254
|
static getRtlHelpers() {
|
package/dist/simplebar.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import throttle from 'lodash-es/throttle';
|
|
2
|
+
import debounce from 'lodash-es/debounce';
|
|
3
|
+
import memoize from 'lodash-es/memoize';
|
|
2
4
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
3
5
|
import canUseDOM from 'can-use-dom';
|
|
4
6
|
|
package/package.json
CHANGED
package/src/simplebar.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import throttle from 'lodash-es/throttle';
|
|
2
|
+
import debounce from 'lodash-es/debounce';
|
|
3
|
+
import memoize from 'lodash-es/memoize';
|
|
2
4
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
3
5
|
import canUseDOM from 'can-use-dom';
|
|
4
6
|
import scrollbarWidth from './scrollbar-width';
|