@hi-ui/table 4.3.4 → 4.4.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/BaseTable.js +2 -2
  3. package/lib/cjs/ColGroupContent.js +2 -2
  4. package/lib/cjs/SettingDrawer.js +29 -20
  5. package/lib/cjs/Table.js +7 -5
  6. package/lib/cjs/TableAdvancedFilter.js +4 -4
  7. package/lib/cjs/TableBody.js +5 -5
  8. package/lib/cjs/TableCell.js +2 -2
  9. package/lib/cjs/TableColumnMenu.js +3 -3
  10. package/lib/cjs/TableEmbedRow.js +3 -3
  11. package/lib/cjs/TableHeader.js +2 -2
  12. package/lib/cjs/TableRow.js +7 -4
  13. package/lib/cjs/TableSettingMenu.js +3 -3
  14. package/lib/cjs/TbodyContent.js +5 -3
  15. package/lib/cjs/TheadContent.js +2 -2
  16. package/lib/cjs/hooks/use-async-switch.js +2 -2
  17. package/lib/cjs/hooks/use-check.js +2 -2
  18. package/lib/cjs/hooks/use-col-width.js +46 -17
  19. package/lib/cjs/hooks/use-colgroup.js +2 -2
  20. package/lib/cjs/hooks/use-drag.js +2 -2
  21. package/lib/cjs/hooks/use-embed-expand.js +3 -3
  22. package/lib/cjs/hooks/use-pagination.js +3 -3
  23. package/lib/cjs/icons/index.js +2 -2
  24. package/lib/cjs/node_modules/rc-resize-observer/es/index.js +9 -9
  25. package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/Children/toArray.js +2 -2
  26. package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/Dom/findDOMNode.js +2 -2
  27. package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/ref.js +2 -2
  28. package/lib/cjs/node_modules/rc-util/es/Dom/findDOMNode.js +2 -2
  29. package/lib/cjs/node_modules/rc-util/es/hooks/useLayoutEffect.js +4 -3
  30. package/lib/cjs/node_modules/rc-virtual-list/es/Filler.js +4 -3
  31. package/lib/cjs/node_modules/rc-virtual-list/es/Item.js +4 -3
  32. package/lib/cjs/node_modules/rc-virtual-list/es/List.js +4 -3
  33. package/lib/cjs/node_modules/rc-virtual-list/es/ScrollBar.js +4 -3
  34. package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useChildren.js +4 -3
  35. package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useDiffItem.js +4 -3
  36. package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useHeights.js +7 -17
  37. package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useScrollTo.js +4 -3
  38. package/lib/cjs/styles/index.scss.js +1 -1
  39. package/lib/cjs/use-table.js +8 -4
  40. package/lib/esm/SettingDrawer.js +26 -17
  41. package/lib/esm/Table.js +2 -0
  42. package/lib/esm/TableBody.js +1 -2
  43. package/lib/esm/TableRow.js +5 -2
  44. package/lib/esm/TbodyContent.js +3 -1
  45. package/lib/esm/hooks/use-col-width.js +44 -15
  46. package/lib/esm/node_modules/rc-virtual-list/es/hooks/useHeights.js +3 -14
  47. package/lib/esm/node_modules/rc-virtual-list/es/index.js +1 -1
  48. package/lib/esm/node_modules/react-is/cjs/react-is.development.js +1 -1
  49. package/lib/esm/node_modules/react-is/cjs/react-is.production.min.js +1 -1
  50. package/lib/esm/styles/index.scss.js +1 -1
  51. package/lib/esm/use-table.js +6 -2
  52. package/lib/types/SettingDrawer.d.ts +5 -0
  53. package/lib/types/TableRow.d.ts +4 -0
  54. package/lib/types/context.d.ts +6 -2
  55. package/lib/types/types.d.ts +4 -0
  56. package/lib/types/use-table.d.ts +11 -1
  57. package/package.json +2 -1
  58. package/lib/cjs/node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js +0 -1090
  59. package/lib/cjs/packages/hooks/use-merge-refs/lib/esm/index.js +0 -68
  60. package/lib/cjs/packages/ui/scrollbar/lib/esm/Scrollbar.js +0 -157
  61. package/lib/cjs/packages/ui/scrollbar/lib/esm/styles/index.scss.js +0 -35
  62. package/lib/cjs/packages/ui/scrollbar/lib/esm/utils/index.js +0 -72
  63. package/lib/esm/node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js +0 -1084
  64. package/lib/esm/packages/hooks/use-merge-refs/lib/esm/index.js +0 -62
  65. package/lib/esm/packages/ui/scrollbar/lib/esm/Scrollbar.js +0 -145
  66. package/lib/esm/packages/ui/scrollbar/lib/esm/styles/index.scss.js +0 -23
  67. package/lib/esm/packages/ui/scrollbar/lib/esm/utils/index.js +0 -66
@@ -1,1084 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HiUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- /*!
11
- * perfect-scrollbar v1.5.3
12
- * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors
13
- * Licensed under MIT
14
- */
15
-
16
- function get(element) {
17
- return getComputedStyle(element);
18
- }
19
- function set(element, obj) {
20
- for (var key in obj) {
21
- var val = obj[key];
22
- if (typeof val === 'number') {
23
- val = val + "px";
24
- }
25
- element.style[key] = val;
26
- }
27
- return element;
28
- }
29
- function div(className) {
30
- var div = document.createElement('div');
31
- div.className = className;
32
- return div;
33
- }
34
- var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector);
35
- function matches(element, query) {
36
- if (!elMatches) {
37
- throw new Error('No element matching method supported');
38
- }
39
- return elMatches.call(element, query);
40
- }
41
- function remove(element) {
42
- if (element.remove) {
43
- element.remove();
44
- } else {
45
- if (element.parentNode) {
46
- element.parentNode.removeChild(element);
47
- }
48
- }
49
- }
50
- function queryChildren(element, selector) {
51
- return Array.prototype.filter.call(element.children, function (child) {
52
- return matches(child, selector);
53
- });
54
- }
55
- var cls = {
56
- main: 'ps',
57
- rtl: 'ps__rtl',
58
- element: {
59
- thumb: function thumb(x) {
60
- return "ps__thumb-" + x;
61
- },
62
- rail: function rail(x) {
63
- return "ps__rail-" + x;
64
- },
65
- consuming: 'ps__child--consume'
66
- },
67
- state: {
68
- focus: 'ps--focus',
69
- clicking: 'ps--clicking',
70
- active: function active(x) {
71
- return "ps--active-" + x;
72
- },
73
- scrolling: function scrolling(x) {
74
- return "ps--scrolling-" + x;
75
- }
76
- }
77
- };
78
-
79
- /*
80
- * Helper methods
81
- */
82
- var scrollingClassTimeout = {
83
- x: null,
84
- y: null
85
- };
86
- function addScrollingClass(i, x) {
87
- var classList = i.element.classList;
88
- var className = cls.state.scrolling(x);
89
- if (classList.contains(className)) {
90
- clearTimeout(scrollingClassTimeout[x]);
91
- } else {
92
- classList.add(className);
93
- }
94
- }
95
- function removeScrollingClass(i, x) {
96
- scrollingClassTimeout[x] = setTimeout(function () {
97
- return i.isAlive && i.element.classList.remove(cls.state.scrolling(x));
98
- }, i.settings.scrollingThreshold);
99
- }
100
- function setScrollingClassInstantly(i, x) {
101
- addScrollingClass(i, x);
102
- removeScrollingClass(i, x);
103
- }
104
- var EventElement = function EventElement(element) {
105
- this.element = element;
106
- this.handlers = {};
107
- };
108
- var prototypeAccessors = {
109
- isEmpty: {
110
- configurable: true
111
- }
112
- };
113
- EventElement.prototype.bind = function bind(eventName, handler) {
114
- if (typeof this.handlers[eventName] === 'undefined') {
115
- this.handlers[eventName] = [];
116
- }
117
- this.handlers[eventName].push(handler);
118
- this.element.addEventListener(eventName, handler, false);
119
- };
120
- EventElement.prototype.unbind = function unbind(eventName, target) {
121
- var this$1$1 = this;
122
- this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
123
- if (target && handler !== target) {
124
- return true;
125
- }
126
- this$1$1.element.removeEventListener(eventName, handler, false);
127
- return false;
128
- });
129
- };
130
- EventElement.prototype.unbindAll = function unbindAll() {
131
- for (var name in this.handlers) {
132
- this.unbind(name);
133
- }
134
- };
135
- prototypeAccessors.isEmpty.get = function () {
136
- var this$1$1 = this;
137
- return Object.keys(this.handlers).every(function (key) {
138
- return this$1$1.handlers[key].length === 0;
139
- });
140
- };
141
- Object.defineProperties(EventElement.prototype, prototypeAccessors);
142
- var EventManager = function EventManager() {
143
- this.eventElements = [];
144
- };
145
- EventManager.prototype.eventElement = function eventElement(element) {
146
- var ee = this.eventElements.filter(function (ee) {
147
- return ee.element === element;
148
- })[0];
149
- if (!ee) {
150
- ee = new EventElement(element);
151
- this.eventElements.push(ee);
152
- }
153
- return ee;
154
- };
155
- EventManager.prototype.bind = function bind(element, eventName, handler) {
156
- this.eventElement(element).bind(eventName, handler);
157
- };
158
- EventManager.prototype.unbind = function unbind(element, eventName, handler) {
159
- var ee = this.eventElement(element);
160
- ee.unbind(eventName, handler);
161
- if (ee.isEmpty) {
162
- // remove
163
- this.eventElements.splice(this.eventElements.indexOf(ee), 1);
164
- }
165
- };
166
- EventManager.prototype.unbindAll = function unbindAll() {
167
- this.eventElements.forEach(function (e) {
168
- return e.unbindAll();
169
- });
170
- this.eventElements = [];
171
- };
172
- EventManager.prototype.once = function once(element, eventName, handler) {
173
- var ee = this.eventElement(element);
174
- var onceHandler = function onceHandler(evt) {
175
- ee.unbind(eventName, onceHandler);
176
- handler(evt);
177
- };
178
- ee.bind(eventName, onceHandler);
179
- };
180
- function createEvent(name) {
181
- if (typeof window.CustomEvent === 'function') {
182
- return new CustomEvent(name);
183
- } else {
184
- var evt = document.createEvent('CustomEvent');
185
- evt.initCustomEvent(name, false, false, undefined);
186
- return evt;
187
- }
188
- }
189
- function processScrollDiff(i, axis, diff, useScrollingClass, forceFireReachEvent) {
190
- if (useScrollingClass === void 0) useScrollingClass = true;
191
- if (forceFireReachEvent === void 0) forceFireReachEvent = false;
192
- var fields;
193
- if (axis === 'top') {
194
- fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down'];
195
- } else if (axis === 'left') {
196
- fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right'];
197
- } else {
198
- throw new Error('A proper axis should be provided');
199
- }
200
- processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
201
- }
202
- function processScrollDiff$1(i, diff, ref, useScrollingClass, forceFireReachEvent) {
203
- var contentHeight = ref[0];
204
- var containerHeight = ref[1];
205
- var scrollTop = ref[2];
206
- var y = ref[3];
207
- var up = ref[4];
208
- var down = ref[5];
209
- if (useScrollingClass === void 0) useScrollingClass = true;
210
- if (forceFireReachEvent === void 0) forceFireReachEvent = false;
211
- var element = i.element;
212
-
213
- // reset reach
214
- i.reach[y] = null;
215
-
216
- // 1 for subpixel rounding
217
- if (element[scrollTop] < 1) {
218
- i.reach[y] = 'start';
219
- }
220
-
221
- // 1 for subpixel rounding
222
- if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
223
- i.reach[y] = 'end';
224
- }
225
- if (diff) {
226
- element.dispatchEvent(createEvent("ps-scroll-" + y));
227
- if (diff < 0) {
228
- element.dispatchEvent(createEvent("ps-scroll-" + up));
229
- } else if (diff > 0) {
230
- element.dispatchEvent(createEvent("ps-scroll-" + down));
231
- }
232
- if (useScrollingClass) {
233
- setScrollingClassInstantly(i, y);
234
- }
235
- }
236
- if (i.reach[y] && (diff || forceFireReachEvent)) {
237
- element.dispatchEvent(createEvent("ps-" + y + "-reach-" + i.reach[y]));
238
- }
239
- }
240
- function toInt(x) {
241
- return parseInt(x, 10) || 0;
242
- }
243
- function isEditable(el) {
244
- return matches(el, 'input,[contenteditable]') || matches(el, 'select,[contenteditable]') || matches(el, 'textarea,[contenteditable]') || matches(el, 'button,[contenteditable]');
245
- }
246
- function outerWidth(element) {
247
- var styles = get(element);
248
- return toInt(styles.width) + toInt(styles.paddingLeft) + toInt(styles.paddingRight) + toInt(styles.borderLeftWidth) + toInt(styles.borderRightWidth);
249
- }
250
- var env = {
251
- isWebKit: typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style,
252
- supportsTouch: typeof window !== 'undefined' && ('ontouchstart' in window || 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints > 0 || window.DocumentTouch && document instanceof window.DocumentTouch),
253
- supportsIePointer: typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
254
- isChrome: typeof navigator !== 'undefined' && /Chrome/i.test(navigator && navigator.userAgent)
255
- };
256
- function updateGeometry(i) {
257
- var element = i.element;
258
- var roundedScrollTop = Math.floor(element.scrollTop);
259
- var rect = element.getBoundingClientRect();
260
- i.containerWidth = Math.round(rect.width);
261
- i.containerHeight = Math.round(rect.height);
262
- i.contentWidth = element.scrollWidth;
263
- i.contentHeight = element.scrollHeight;
264
- if (!element.contains(i.scrollbarXRail)) {
265
- // clean up and append
266
- queryChildren(element, cls.element.rail('x')).forEach(function (el) {
267
- return remove(el);
268
- });
269
- element.appendChild(i.scrollbarXRail);
270
- }
271
- if (!element.contains(i.scrollbarYRail)) {
272
- // clean up and append
273
- queryChildren(element, cls.element.rail('y')).forEach(function (el) {
274
- return remove(el);
275
- });
276
- element.appendChild(i.scrollbarYRail);
277
- }
278
- if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) {
279
- i.scrollbarXActive = true;
280
- i.railXWidth = i.containerWidth - i.railXMarginWidth;
281
- i.railXRatio = i.containerWidth / i.railXWidth;
282
- i.scrollbarXWidth = getThumbSize(i, toInt(i.railXWidth * i.containerWidth / i.contentWidth));
283
- i.scrollbarXLeft = toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth));
284
- } else {
285
- i.scrollbarXActive = false;
286
- }
287
- if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) {
288
- i.scrollbarYActive = true;
289
- i.railYHeight = i.containerHeight - i.railYMarginHeight;
290
- i.railYRatio = i.containerHeight / i.railYHeight;
291
- i.scrollbarYHeight = getThumbSize(i, toInt(i.railYHeight * i.containerHeight / i.contentHeight));
292
- i.scrollbarYTop = toInt(roundedScrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight));
293
- } else {
294
- i.scrollbarYActive = false;
295
- }
296
- if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
297
- i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
298
- }
299
- if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
300
- i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
301
- }
302
- updateCss(element, i);
303
- if (i.scrollbarXActive) {
304
- element.classList.add(cls.state.active('x'));
305
- } else {
306
- element.classList.remove(cls.state.active('x'));
307
- i.scrollbarXWidth = 0;
308
- i.scrollbarXLeft = 0;
309
- element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;
310
- }
311
- if (i.scrollbarYActive) {
312
- element.classList.add(cls.state.active('y'));
313
- } else {
314
- element.classList.remove(cls.state.active('y'));
315
- i.scrollbarYHeight = 0;
316
- i.scrollbarYTop = 0;
317
- element.scrollTop = 0;
318
- }
319
- }
320
- function getThumbSize(i, thumbSize) {
321
- if (i.settings.minScrollbarLength) {
322
- thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
323
- }
324
- if (i.settings.maxScrollbarLength) {
325
- thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
326
- }
327
- return thumbSize;
328
- }
329
- function updateCss(element, i) {
330
- var xRailOffset = {
331
- width: i.railXWidth
332
- };
333
- var roundedScrollTop = Math.floor(element.scrollTop);
334
- if (i.isRtl) {
335
- xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
336
- } else {
337
- xRailOffset.left = element.scrollLeft;
338
- }
339
- if (i.isScrollbarXUsingBottom) {
340
- xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
341
- } else {
342
- xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
343
- }
344
- set(i.scrollbarXRail, xRailOffset);
345
- var yRailOffset = {
346
- top: roundedScrollTop,
347
- height: i.railYHeight
348
- };
349
- if (i.isScrollbarYUsingRight) {
350
- if (i.isRtl) {
351
- yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth - 9;
352
- } else {
353
- yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
354
- }
355
- } else {
356
- if (i.isRtl) {
357
- yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth;
358
- } else {
359
- yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
360
- }
361
- }
362
- set(i.scrollbarYRail, yRailOffset);
363
- set(i.scrollbarX, {
364
- left: i.scrollbarXLeft,
365
- width: i.scrollbarXWidth - i.railBorderXWidth
366
- });
367
- set(i.scrollbarY, {
368
- top: i.scrollbarYTop,
369
- height: i.scrollbarYHeight - i.railBorderYWidth
370
- });
371
- }
372
- function clickRail(i) {
373
- i.event.bind(i.scrollbarY, 'mousedown', function (e) {
374
- return e.stopPropagation();
375
- });
376
- i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
377
- var positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top;
378
- var direction = positionTop > i.scrollbarYTop ? 1 : -1;
379
- i.element.scrollTop += direction * i.containerHeight;
380
- updateGeometry(i);
381
- e.stopPropagation();
382
- });
383
- i.event.bind(i.scrollbarX, 'mousedown', function (e) {
384
- return e.stopPropagation();
385
- });
386
- i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
387
- var positionLeft = e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left;
388
- var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
389
- i.element.scrollLeft += direction * i.containerWidth;
390
- updateGeometry(i);
391
- e.stopPropagation();
392
- });
393
- }
394
- function dragThumb(i) {
395
- bindMouseScrollHandler(i, ['containerWidth', 'contentWidth', 'pageX', 'railXWidth', 'scrollbarX', 'scrollbarXWidth', 'scrollLeft', 'x', 'scrollbarXRail']);
396
- bindMouseScrollHandler(i, ['containerHeight', 'contentHeight', 'pageY', 'railYHeight', 'scrollbarY', 'scrollbarYHeight', 'scrollTop', 'y', 'scrollbarYRail']);
397
- }
398
- function bindMouseScrollHandler(i, ref) {
399
- var containerHeight = ref[0];
400
- var contentHeight = ref[1];
401
- var pageY = ref[2];
402
- var railYHeight = ref[3];
403
- var scrollbarY = ref[4];
404
- var scrollbarYHeight = ref[5];
405
- var scrollTop = ref[6];
406
- var y = ref[7];
407
- var scrollbarYRail = ref[8];
408
- var element = i.element;
409
- var startingScrollTop = null;
410
- var startingMousePageY = null;
411
- var scrollBy = null;
412
- function mouseMoveHandler(e) {
413
- if (e.touches && e.touches[0]) {
414
- e[pageY] = e.touches[0].pageY;
415
- }
416
- element[scrollTop] = startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
417
- addScrollingClass(i, y);
418
- updateGeometry(i);
419
- e.stopPropagation();
420
- if (e.type.startsWith('touch') && e.changedTouches.length > 1) {
421
- e.preventDefault();
422
- }
423
- }
424
- function mouseUpHandler() {
425
- removeScrollingClass(i, y);
426
- i[scrollbarYRail].classList.remove(cls.state.clicking);
427
- i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
428
- }
429
- function bindMoves(e, touchMode) {
430
- startingScrollTop = element[scrollTop];
431
- if (touchMode && e.touches) {
432
- e[pageY] = e.touches[0].pageY;
433
- }
434
- startingMousePageY = e[pageY];
435
- scrollBy = (i[contentHeight] - i[containerHeight]) / (i[railYHeight] - i[scrollbarYHeight]);
436
- if (!touchMode) {
437
- i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
438
- i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
439
- e.preventDefault();
440
- } else {
441
- i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);
442
- }
443
- i[scrollbarYRail].classList.add(cls.state.clicking);
444
- e.stopPropagation();
445
- }
446
- i.event.bind(i[scrollbarY], 'mousedown', function (e) {
447
- bindMoves(e);
448
- });
449
- i.event.bind(i[scrollbarY], 'touchstart', function (e) {
450
- bindMoves(e, true);
451
- });
452
- }
453
- function keyboard(i) {
454
- var element = i.element;
455
- var elementHovered = function elementHovered() {
456
- return matches(element, ':hover');
457
- };
458
- var scrollbarFocused = function scrollbarFocused() {
459
- return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus');
460
- };
461
- function shouldPreventDefault(deltaX, deltaY) {
462
- var scrollTop = Math.floor(element.scrollTop);
463
- if (deltaX === 0) {
464
- if (!i.scrollbarYActive) {
465
- return false;
466
- }
467
- if (scrollTop === 0 && deltaY > 0 || scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0) {
468
- return !i.settings.wheelPropagation;
469
- }
470
- }
471
- var scrollLeft = element.scrollLeft;
472
- if (deltaY === 0) {
473
- if (!i.scrollbarXActive) {
474
- return false;
475
- }
476
- if (scrollLeft === 0 && deltaX < 0 || scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0) {
477
- return !i.settings.wheelPropagation;
478
- }
479
- }
480
- return true;
481
- }
482
- i.event.bind(i.ownerDocument, 'keydown', function (e) {
483
- if (e.isDefaultPrevented && e.isDefaultPrevented() || e.defaultPrevented) {
484
- return;
485
- }
486
- if (!elementHovered() && !scrollbarFocused()) {
487
- return;
488
- }
489
- var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
490
- if (activeElement) {
491
- if (activeElement.tagName === 'IFRAME') {
492
- activeElement = activeElement.contentDocument.activeElement;
493
- } else {
494
- // go deeper if element is a webcomponent
495
- while (activeElement.shadowRoot) {
496
- activeElement = activeElement.shadowRoot.activeElement;
497
- }
498
- }
499
- if (isEditable(activeElement)) {
500
- return;
501
- }
502
- }
503
- var deltaX = 0;
504
- var deltaY = 0;
505
- switch (e.which) {
506
- case 37:
507
- // left
508
- if (e.metaKey) {
509
- deltaX = -i.contentWidth;
510
- } else if (e.altKey) {
511
- deltaX = -i.containerWidth;
512
- } else {
513
- deltaX = -30;
514
- }
515
- break;
516
- case 38:
517
- // up
518
- if (e.metaKey) {
519
- deltaY = i.contentHeight;
520
- } else if (e.altKey) {
521
- deltaY = i.containerHeight;
522
- } else {
523
- deltaY = 30;
524
- }
525
- break;
526
- case 39:
527
- // right
528
- if (e.metaKey) {
529
- deltaX = i.contentWidth;
530
- } else if (e.altKey) {
531
- deltaX = i.containerWidth;
532
- } else {
533
- deltaX = 30;
534
- }
535
- break;
536
- case 40:
537
- // down
538
- if (e.metaKey) {
539
- deltaY = -i.contentHeight;
540
- } else if (e.altKey) {
541
- deltaY = -i.containerHeight;
542
- } else {
543
- deltaY = -30;
544
- }
545
- break;
546
- case 32:
547
- // space bar
548
- if (e.shiftKey) {
549
- deltaY = i.containerHeight;
550
- } else {
551
- deltaY = -i.containerHeight;
552
- }
553
- break;
554
- case 33:
555
- // page up
556
- deltaY = i.containerHeight;
557
- break;
558
- case 34:
559
- // page down
560
- deltaY = -i.containerHeight;
561
- break;
562
- case 36:
563
- // home
564
- deltaY = i.contentHeight;
565
- break;
566
- case 35:
567
- // end
568
- deltaY = -i.contentHeight;
569
- break;
570
- default:
571
- return;
572
- }
573
- if (i.settings.suppressScrollX && deltaX !== 0) {
574
- return;
575
- }
576
- if (i.settings.suppressScrollY && deltaY !== 0) {
577
- return;
578
- }
579
- element.scrollTop -= deltaY;
580
- element.scrollLeft += deltaX;
581
- updateGeometry(i);
582
- if (shouldPreventDefault(deltaX, deltaY)) {
583
- e.preventDefault();
584
- }
585
- });
586
- }
587
- function wheel(i) {
588
- var element = i.element;
589
- function shouldPreventDefault(deltaX, deltaY) {
590
- var roundedScrollTop = Math.floor(element.scrollTop);
591
- var isTop = element.scrollTop === 0;
592
- var isBottom = roundedScrollTop + element.offsetHeight === element.scrollHeight;
593
- var isLeft = element.scrollLeft === 0;
594
- var isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth;
595
- var hitsBound;
596
-
597
- // pick axis with primary direction
598
- if (Math.abs(deltaY) > Math.abs(deltaX)) {
599
- hitsBound = isTop || isBottom;
600
- } else {
601
- hitsBound = isLeft || isRight;
602
- }
603
- return hitsBound ? !i.settings.wheelPropagation : true;
604
- }
605
- function getDeltaFromEvent(e) {
606
- var deltaX = e.deltaX;
607
- var deltaY = -1 * e.deltaY;
608
- if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
609
- // OS X Safari
610
- deltaX = -1 * e.wheelDeltaX / 6;
611
- deltaY = e.wheelDeltaY / 6;
612
- }
613
- if (e.deltaMode && e.deltaMode === 1) {
614
- // Firefox in deltaMode 1: Line scrolling
615
- deltaX *= 10;
616
- deltaY *= 10;
617
- }
618
- if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
619
- // IE in some mouse drivers
620
- deltaX = 0;
621
- deltaY = e.wheelDelta;
622
- }
623
- if (e.shiftKey) {
624
- // reverse axis with shift key
625
- return [-deltaY, -deltaX];
626
- }
627
- return [deltaX, deltaY];
628
- }
629
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
630
- // FIXME: this is a workaround for <select> issue in FF and IE #571
631
- if (!env.isWebKit && element.querySelector('select:focus')) {
632
- return true;
633
- }
634
- if (!element.contains(target)) {
635
- return false;
636
- }
637
- var cursor = target;
638
- while (cursor && cursor !== element) {
639
- if (cursor.classList.contains(cls.element.consuming)) {
640
- return true;
641
- }
642
- var style = get(cursor);
643
-
644
- // if deltaY && vertical scrollable
645
- if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
646
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
647
- if (maxScrollTop > 0) {
648
- if (cursor.scrollTop > 0 && deltaY < 0 || cursor.scrollTop < maxScrollTop && deltaY > 0) {
649
- return true;
650
- }
651
- }
652
- }
653
- // if deltaX && horizontal scrollable
654
- if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
655
- var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
656
- if (maxScrollLeft > 0) {
657
- if (cursor.scrollLeft > 0 && deltaX < 0 || cursor.scrollLeft < maxScrollLeft && deltaX > 0) {
658
- return true;
659
- }
660
- }
661
- }
662
- cursor = cursor.parentNode;
663
- }
664
- return false;
665
- }
666
- function mousewheelHandler(e) {
667
- var ref = getDeltaFromEvent(e);
668
- var deltaX = ref[0];
669
- var deltaY = ref[1];
670
- if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
671
- return;
672
- }
673
- var shouldPrevent = false;
674
- if (!i.settings.useBothWheelAxes) {
675
- // deltaX will only be used for horizontal scrolling and deltaY will
676
- // only be used for vertical scrolling - this is the default
677
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
678
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
679
- } else if (i.scrollbarYActive && !i.scrollbarXActive) {
680
- // only vertical scrollbar is active and useBothWheelAxes option is
681
- // active, so let's scroll vertical bar using both mouse wheel axes
682
- if (deltaY) {
683
- element.scrollTop -= deltaY * i.settings.wheelSpeed;
684
- } else {
685
- element.scrollTop += deltaX * i.settings.wheelSpeed;
686
- }
687
- shouldPrevent = true;
688
- } else if (i.scrollbarXActive && !i.scrollbarYActive) {
689
- // useBothWheelAxes and only horizontal bar is active, so use both
690
- // wheel axes for horizontal bar
691
- if (deltaX) {
692
- element.scrollLeft += deltaX * i.settings.wheelSpeed;
693
- } else {
694
- element.scrollLeft -= deltaY * i.settings.wheelSpeed;
695
- }
696
- shouldPrevent = true;
697
- }
698
- updateGeometry(i);
699
- shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
700
- if (shouldPrevent && !e.ctrlKey) {
701
- e.stopPropagation();
702
- e.preventDefault();
703
- }
704
- }
705
- if (typeof window.onwheel !== 'undefined') {
706
- i.event.bind(element, 'wheel', mousewheelHandler);
707
- } else if (typeof window.onmousewheel !== 'undefined') {
708
- i.event.bind(element, 'mousewheel', mousewheelHandler);
709
- }
710
- }
711
- function touch(i) {
712
- if (!env.supportsTouch && !env.supportsIePointer) {
713
- return;
714
- }
715
- var element = i.element;
716
- function shouldPrevent(deltaX, deltaY) {
717
- var scrollTop = Math.floor(element.scrollTop);
718
- var scrollLeft = element.scrollLeft;
719
- var magnitudeX = Math.abs(deltaX);
720
- var magnitudeY = Math.abs(deltaY);
721
- if (magnitudeY > magnitudeX) {
722
- // user is perhaps trying to swipe up/down the page
723
-
724
- if (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight || deltaY > 0 && scrollTop === 0) {
725
- // set prevent for mobile Chrome refresh
726
- return window.scrollY === 0 && deltaY > 0 && env.isChrome;
727
- }
728
- } else if (magnitudeX > magnitudeY) {
729
- // user is perhaps trying to swipe left/right across the page
730
-
731
- if (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth || deltaX > 0 && scrollLeft === 0) {
732
- return true;
733
- }
734
- }
735
- return true;
736
- }
737
- function applyTouchMove(differenceX, differenceY) {
738
- element.scrollTop -= differenceY;
739
- element.scrollLeft -= differenceX;
740
- updateGeometry(i);
741
- }
742
- var startOffset = {};
743
- var startTime = 0;
744
- var speed = {};
745
- var easingLoop = null;
746
- function getTouch(e) {
747
- if (e.targetTouches) {
748
- return e.targetTouches[0];
749
- } else {
750
- // Maybe IE pointer
751
- return e;
752
- }
753
- }
754
- function shouldHandle(e) {
755
- if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
756
- return false;
757
- }
758
- if (e.targetTouches && e.targetTouches.length === 1) {
759
- return true;
760
- }
761
- if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
762
- return true;
763
- }
764
- return false;
765
- }
766
- function touchStart(e) {
767
- if (!shouldHandle(e)) {
768
- return;
769
- }
770
- var touch = getTouch(e);
771
- startOffset.pageX = touch.pageX;
772
- startOffset.pageY = touch.pageY;
773
- startTime = new Date().getTime();
774
- if (easingLoop !== null) {
775
- clearInterval(easingLoop);
776
- }
777
- }
778
- function shouldBeConsumedByChild(target, deltaX, deltaY) {
779
- if (!element.contains(target)) {
780
- return false;
781
- }
782
- var cursor = target;
783
- while (cursor && cursor !== element) {
784
- if (cursor.classList.contains(cls.element.consuming)) {
785
- return true;
786
- }
787
- var style = get(cursor);
788
-
789
- // if deltaY && vertical scrollable
790
- if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
791
- var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
792
- if (maxScrollTop > 0) {
793
- if (cursor.scrollTop > 0 && deltaY < 0 || cursor.scrollTop < maxScrollTop && deltaY > 0) {
794
- return true;
795
- }
796
- }
797
- }
798
- // if deltaX && horizontal scrollable
799
- if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
800
- var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
801
- if (maxScrollLeft > 0) {
802
- if (cursor.scrollLeft > 0 && deltaX < 0 || cursor.scrollLeft < maxScrollLeft && deltaX > 0) {
803
- return true;
804
- }
805
- }
806
- }
807
- cursor = cursor.parentNode;
808
- }
809
- return false;
810
- }
811
- function touchMove(e) {
812
- if (shouldHandle(e)) {
813
- var touch = getTouch(e);
814
- var currentOffset = {
815
- pageX: touch.pageX,
816
- pageY: touch.pageY
817
- };
818
- var differenceX = currentOffset.pageX - startOffset.pageX;
819
- var differenceY = currentOffset.pageY - startOffset.pageY;
820
- if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
821
- return;
822
- }
823
- applyTouchMove(differenceX, differenceY);
824
- startOffset = currentOffset;
825
- var currentTime = new Date().getTime();
826
- var timeGap = currentTime - startTime;
827
- if (timeGap > 0) {
828
- speed.x = differenceX / timeGap;
829
- speed.y = differenceY / timeGap;
830
- startTime = currentTime;
831
- }
832
- if (shouldPrevent(differenceX, differenceY)) {
833
- e.preventDefault();
834
- }
835
- }
836
- }
837
- function touchEnd() {
838
- if (i.settings.swipeEasing) {
839
- clearInterval(easingLoop);
840
- easingLoop = setInterval(function () {
841
- if (i.isInitialized) {
842
- clearInterval(easingLoop);
843
- return;
844
- }
845
- if (!speed.x && !speed.y) {
846
- clearInterval(easingLoop);
847
- return;
848
- }
849
- if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
850
- clearInterval(easingLoop);
851
- return;
852
- }
853
- if (!i.element) {
854
- clearInterval(easingLoop);
855
- return;
856
- }
857
- applyTouchMove(speed.x * 30, speed.y * 30);
858
- speed.x *= 0.8;
859
- speed.y *= 0.8;
860
- }, 10);
861
- }
862
- }
863
- if (env.supportsTouch) {
864
- i.event.bind(element, 'touchstart', touchStart);
865
- i.event.bind(element, 'touchmove', touchMove);
866
- i.event.bind(element, 'touchend', touchEnd);
867
- } else if (env.supportsIePointer) {
868
- if (window.PointerEvent) {
869
- i.event.bind(element, 'pointerdown', touchStart);
870
- i.event.bind(element, 'pointermove', touchMove);
871
- i.event.bind(element, 'pointerup', touchEnd);
872
- } else if (window.MSPointerEvent) {
873
- i.event.bind(element, 'MSPointerDown', touchStart);
874
- i.event.bind(element, 'MSPointerMove', touchMove);
875
- i.event.bind(element, 'MSPointerUp', touchEnd);
876
- }
877
- }
878
- }
879
- var defaultSettings = function defaultSettings() {
880
- return {
881
- handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
882
- maxScrollbarLength: null,
883
- minScrollbarLength: null,
884
- scrollingThreshold: 1000,
885
- scrollXMarginOffset: 0,
886
- scrollYMarginOffset: 0,
887
- suppressScrollX: false,
888
- suppressScrollY: false,
889
- swipeEasing: true,
890
- useBothWheelAxes: false,
891
- wheelPropagation: true,
892
- wheelSpeed: 1
893
- };
894
- };
895
- var handlers = {
896
- 'click-rail': clickRail,
897
- 'drag-thumb': dragThumb,
898
- keyboard: keyboard,
899
- wheel: wheel,
900
- touch: touch
901
- };
902
- var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
903
- var this$1$1 = this;
904
- if (userSettings === void 0) userSettings = {};
905
- if (typeof element === 'string') {
906
- element = document.querySelector(element);
907
- }
908
- if (!element || !element.nodeName) {
909
- throw new Error('no element is specified to initialize PerfectScrollbar');
910
- }
911
- this.element = element;
912
- element.classList.add(cls.main);
913
- this.settings = defaultSettings();
914
- for (var key in userSettings) {
915
- this.settings[key] = userSettings[key];
916
- }
917
- this.containerWidth = null;
918
- this.containerHeight = null;
919
- this.contentWidth = null;
920
- this.contentHeight = null;
921
- var focus = function focus() {
922
- return element.classList.add(cls.state.focus);
923
- };
924
- var blur = function blur() {
925
- return element.classList.remove(cls.state.focus);
926
- };
927
- this.isRtl = get(element).direction === 'rtl';
928
- if (this.isRtl === true) {
929
- element.classList.add(cls.rtl);
930
- }
931
- this.isNegativeScroll = function () {
932
- var originalScrollLeft = element.scrollLeft;
933
- var result = null;
934
- element.scrollLeft = -1;
935
- result = element.scrollLeft < 0;
936
- element.scrollLeft = originalScrollLeft;
937
- return result;
938
- }();
939
- this.negativeScrollAdjustment = this.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
940
- this.event = new EventManager();
941
- this.ownerDocument = element.ownerDocument || document;
942
- this.scrollbarXRail = div(cls.element.rail('x'));
943
- element.appendChild(this.scrollbarXRail);
944
- this.scrollbarX = div(cls.element.thumb('x'));
945
- this.scrollbarXRail.appendChild(this.scrollbarX);
946
- this.scrollbarX.setAttribute('tabindex', 0);
947
- this.event.bind(this.scrollbarX, 'focus', focus);
948
- this.event.bind(this.scrollbarX, 'blur', blur);
949
- this.scrollbarXActive = null;
950
- this.scrollbarXWidth = null;
951
- this.scrollbarXLeft = null;
952
- var railXStyle = get(this.scrollbarXRail);
953
- this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
954
- if (isNaN(this.scrollbarXBottom)) {
955
- this.isScrollbarXUsingBottom = false;
956
- this.scrollbarXTop = toInt(railXStyle.top);
957
- } else {
958
- this.isScrollbarXUsingBottom = true;
959
- }
960
- this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
961
- // Set rail to display:block to calculate margins
962
- set(this.scrollbarXRail, {
963
- display: 'block'
964
- });
965
- this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
966
- set(this.scrollbarXRail, {
967
- display: ''
968
- });
969
- this.railXWidth = null;
970
- this.railXRatio = null;
971
- this.scrollbarYRail = div(cls.element.rail('y'));
972
- element.appendChild(this.scrollbarYRail);
973
- this.scrollbarY = div(cls.element.thumb('y'));
974
- this.scrollbarYRail.appendChild(this.scrollbarY);
975
- this.scrollbarY.setAttribute('tabindex', 0);
976
- this.event.bind(this.scrollbarY, 'focus', focus);
977
- this.event.bind(this.scrollbarY, 'blur', blur);
978
- this.scrollbarYActive = null;
979
- this.scrollbarYHeight = null;
980
- this.scrollbarYTop = null;
981
- var railYStyle = get(this.scrollbarYRail);
982
- this.scrollbarYRight = parseInt(railYStyle.right, 10);
983
- if (isNaN(this.scrollbarYRight)) {
984
- this.isScrollbarYUsingRight = false;
985
- this.scrollbarYLeft = toInt(railYStyle.left);
986
- } else {
987
- this.isScrollbarYUsingRight = true;
988
- }
989
- this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
990
- this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
991
- set(this.scrollbarYRail, {
992
- display: 'block'
993
- });
994
- this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
995
- set(this.scrollbarYRail, {
996
- display: ''
997
- });
998
- this.railYHeight = null;
999
- this.railYRatio = null;
1000
- this.reach = {
1001
- x: element.scrollLeft <= 0 ? 'start' : element.scrollLeft >= this.contentWidth - this.containerWidth ? 'end' : null,
1002
- y: element.scrollTop <= 0 ? 'start' : element.scrollTop >= this.contentHeight - this.containerHeight ? 'end' : null
1003
- };
1004
- this.isAlive = true;
1005
- this.settings.handlers.forEach(function (handlerName) {
1006
- return handlers[handlerName](this$1$1);
1007
- });
1008
- this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
1009
- this.lastScrollLeft = element.scrollLeft; // for onScroll only
1010
- this.event.bind(this.element, 'scroll', function (e) {
1011
- return this$1$1.onScroll(e);
1012
- });
1013
- updateGeometry(this);
1014
- };
1015
- PerfectScrollbar.prototype.update = function update() {
1016
- if (!this.isAlive) {
1017
- return;
1018
- }
1019
-
1020
- // Recalcuate negative scrollLeft adjustment
1021
- this.negativeScrollAdjustment = this.isNegativeScroll ? this.element.scrollWidth - this.element.clientWidth : 0;
1022
-
1023
- // Recalculate rail margins
1024
- set(this.scrollbarXRail, {
1025
- display: 'block'
1026
- });
1027
- set(this.scrollbarYRail, {
1028
- display: 'block'
1029
- });
1030
- this.railXMarginWidth = toInt(get(this.scrollbarXRail).marginLeft) + toInt(get(this.scrollbarXRail).marginRight);
1031
- this.railYMarginHeight = toInt(get(this.scrollbarYRail).marginTop) + toInt(get(this.scrollbarYRail).marginBottom);
1032
-
1033
- // Hide scrollbars not to affect scrollWidth and scrollHeight
1034
- set(this.scrollbarXRail, {
1035
- display: 'none'
1036
- });
1037
- set(this.scrollbarYRail, {
1038
- display: 'none'
1039
- });
1040
- updateGeometry(this);
1041
- processScrollDiff(this, 'top', 0, false, true);
1042
- processScrollDiff(this, 'left', 0, false, true);
1043
- set(this.scrollbarXRail, {
1044
- display: ''
1045
- });
1046
- set(this.scrollbarYRail, {
1047
- display: ''
1048
- });
1049
- };
1050
- PerfectScrollbar.prototype.onScroll = function onScroll(e) {
1051
- if (!this.isAlive) {
1052
- return;
1053
- }
1054
- updateGeometry(this);
1055
- processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
1056
- processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);
1057
- this.lastScrollTop = Math.floor(this.element.scrollTop);
1058
- this.lastScrollLeft = this.element.scrollLeft;
1059
- };
1060
- PerfectScrollbar.prototype.destroy = function destroy() {
1061
- if (!this.isAlive) {
1062
- return;
1063
- }
1064
- this.event.unbindAll();
1065
- remove(this.scrollbarX);
1066
- remove(this.scrollbarY);
1067
- remove(this.scrollbarXRail);
1068
- remove(this.scrollbarYRail);
1069
- this.removePsClasses();
1070
-
1071
- // unset elements
1072
- this.element = null;
1073
- this.scrollbarX = null;
1074
- this.scrollbarY = null;
1075
- this.scrollbarXRail = null;
1076
- this.scrollbarYRail = null;
1077
- this.isAlive = false;
1078
- };
1079
- PerfectScrollbar.prototype.removePsClasses = function removePsClasses() {
1080
- this.element.className = this.element.className.split(' ').filter(function (name) {
1081
- return !name.match(/^ps([-_].+|)$/);
1082
- }).join(' ');
1083
- };
1084
- export { PerfectScrollbar as default };