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