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