bootstrap 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bootstrap might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/javascripts/bootstrap-sprockets.js +5 -5
- data/assets/javascripts/bootstrap.js +23 -23
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/javascripts/bootstrap/alert.js +159 -133
- data/assets/javascripts/bootstrap/button.js +149 -124
- data/assets/javascripts/bootstrap/carousel.js +463 -407
- data/assets/javascripts/bootstrap/collapse.js +338 -282
- data/assets/javascripts/bootstrap/dropdown.js +439 -382
- data/assets/javascripts/bootstrap/modal.js +502 -446
- data/assets/javascripts/bootstrap/popover.js +223 -163
- data/assets/javascripts/bootstrap/scrollspy.js +307 -251
- data/assets/javascripts/bootstrap/tab.js +217 -191
- data/assets/javascripts/bootstrap/tooltip.js +582 -525
- data/assets/javascripts/bootstrap/util.js +129 -116
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +1 -1
- data/assets/stylesheets/bootstrap/_buttons.scss +0 -1
- data/assets/stylesheets/bootstrap/_custom-forms.scss +13 -19
- data/assets/stylesheets/bootstrap/_forms.scss +13 -15
- data/assets/stylesheets/bootstrap/_input-group.scss +15 -2
- data/assets/stylesheets/bootstrap/_modal.scss +18 -6
- data/assets/stylesheets/bootstrap/_reboot.scss +4 -2
- data/assets/stylesheets/bootstrap/_tables.scss +0 -1
- data/assets/stylesheets/bootstrap/_variables.scss +10 -9
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +7 -7
- data/lib/bootstrap/version.rb +2 -2
- metadata +2 -2
@@ -1,166 +1,191 @@
|
|
1
|
-
function
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4
|
+
(global.Button = factory(global.jQuery));
|
5
|
+
}(this, (function ($) { 'use strict';
|
6
|
+
|
7
|
+
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
8
|
+
|
9
|
+
function _defineProperties(target, props) {
|
10
|
+
for (var i = 0; i < props.length; i++) {
|
11
|
+
var descriptor = props[i];
|
12
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
13
|
+
descriptor.configurable = true;
|
14
|
+
if ("value" in descriptor) descriptor.writable = true;
|
15
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
16
|
+
}
|
17
|
+
}
|
2
18
|
|
3
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
20
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
21
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
22
|
+
return Constructor;
|
23
|
+
}
|
4
24
|
|
5
|
-
/**
|
6
|
-
* --------------------------------------------------------------------------
|
7
|
-
* Bootstrap (v4.1.2): button.js
|
8
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
9
|
-
* --------------------------------------------------------------------------
|
10
|
-
*/
|
11
|
-
var Button = function ($) {
|
12
25
|
/**
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
26
|
+
* --------------------------------------------------------------------------
|
27
|
+
* Bootstrap (v4.1.3): button.js
|
28
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
29
|
+
* --------------------------------------------------------------------------
|
16
30
|
*/
|
17
|
-
|
18
|
-
var
|
19
|
-
var DATA_KEY = 'bs.button';
|
20
|
-
var EVENT_KEY = "." + DATA_KEY;
|
21
|
-
var DATA_API_KEY = '.data-api';
|
22
|
-
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
23
|
-
var ClassName = {
|
24
|
-
ACTIVE: 'active',
|
25
|
-
BUTTON: 'btn',
|
26
|
-
FOCUS: 'focus'
|
27
|
-
};
|
28
|
-
var Selector = {
|
29
|
-
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
30
|
-
DATA_TOGGLE: '[data-toggle="buttons"]',
|
31
|
-
INPUT: 'input',
|
32
|
-
ACTIVE: '.active',
|
33
|
-
BUTTON: '.btn'
|
34
|
-
};
|
35
|
-
var Event = {
|
36
|
-
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
37
|
-
FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
|
31
|
+
|
32
|
+
var Button = function ($$$1) {
|
38
33
|
/**
|
39
34
|
* ------------------------------------------------------------------------
|
40
|
-
*
|
35
|
+
* Constants
|
41
36
|
* ------------------------------------------------------------------------
|
42
37
|
*/
|
38
|
+
var NAME = 'button';
|
39
|
+
var VERSION = '4.1.3';
|
40
|
+
var DATA_KEY = 'bs.button';
|
41
|
+
var EVENT_KEY = "." + DATA_KEY;
|
42
|
+
var DATA_API_KEY = '.data-api';
|
43
|
+
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
|
44
|
+
var ClassName = {
|
45
|
+
ACTIVE: 'active',
|
46
|
+
BUTTON: 'btn',
|
47
|
+
FOCUS: 'focus'
|
48
|
+
};
|
49
|
+
var Selector = {
|
50
|
+
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
51
|
+
DATA_TOGGLE: '[data-toggle="buttons"]',
|
52
|
+
INPUT: 'input',
|
53
|
+
ACTIVE: '.active',
|
54
|
+
BUTTON: '.btn'
|
55
|
+
};
|
56
|
+
var Event = {
|
57
|
+
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
58
|
+
FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
|
59
|
+
/**
|
60
|
+
* ------------------------------------------------------------------------
|
61
|
+
* Class Definition
|
62
|
+
* ------------------------------------------------------------------------
|
63
|
+
*/
|
43
64
|
|
44
|
-
|
65
|
+
};
|
45
66
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
67
|
+
var Button =
|
68
|
+
/*#__PURE__*/
|
69
|
+
function () {
|
70
|
+
function Button(element) {
|
71
|
+
this._element = element;
|
72
|
+
} // Getters
|
52
73
|
|
53
74
|
|
54
|
-
|
75
|
+
var _proto = Button.prototype;
|
55
76
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
77
|
+
// Public
|
78
|
+
_proto.toggle = function toggle() {
|
79
|
+
var triggerChangeEvent = true;
|
80
|
+
var addAriaPressed = true;
|
81
|
+
var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
|
61
82
|
|
62
|
-
|
63
|
-
|
83
|
+
if (rootElement) {
|
84
|
+
var input = this._element.querySelector(Selector.INPUT);
|
64
85
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
86
|
+
if (input) {
|
87
|
+
if (input.type === 'radio') {
|
88
|
+
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
|
89
|
+
triggerChangeEvent = false;
|
90
|
+
} else {
|
91
|
+
var activeElement = rootElement.querySelector(Selector.ACTIVE);
|
71
92
|
|
72
|
-
|
73
|
-
|
93
|
+
if (activeElement) {
|
94
|
+
$$$1(activeElement).removeClass(ClassName.ACTIVE);
|
95
|
+
}
|
74
96
|
}
|
75
97
|
}
|
76
|
-
}
|
77
98
|
|
78
|
-
|
79
|
-
|
80
|
-
|
99
|
+
if (triggerChangeEvent) {
|
100
|
+
if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
|
101
|
+
return;
|
102
|
+
}
|
103
|
+
|
104
|
+
input.checked = !this._element.classList.contains(ClassName.ACTIVE);
|
105
|
+
$$$1(input).trigger('change');
|
81
106
|
}
|
82
107
|
|
83
|
-
input.
|
84
|
-
|
108
|
+
input.focus();
|
109
|
+
addAriaPressed = false;
|
85
110
|
}
|
111
|
+
}
|
86
112
|
|
87
|
-
|
88
|
-
|
113
|
+
if (addAriaPressed) {
|
114
|
+
this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
|
89
115
|
}
|
90
|
-
}
|
91
116
|
|
92
|
-
|
93
|
-
|
94
|
-
|
117
|
+
if (triggerChangeEvent) {
|
118
|
+
$$$1(this._element).toggleClass(ClassName.ACTIVE);
|
119
|
+
}
|
120
|
+
};
|
95
121
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
122
|
+
_proto.dispose = function dispose() {
|
123
|
+
$$$1.removeData(this._element, DATA_KEY);
|
124
|
+
this._element = null;
|
125
|
+
}; // Static
|
100
126
|
|
101
|
-
_proto.dispose = function dispose() {
|
102
|
-
$.removeData(this._element, DATA_KEY);
|
103
|
-
this._element = null;
|
104
|
-
}; // Static
|
105
127
|
|
128
|
+
Button._jQueryInterface = function _jQueryInterface(config) {
|
129
|
+
return this.each(function () {
|
130
|
+
var data = $$$1(this).data(DATA_KEY);
|
106
131
|
|
107
|
-
|
108
|
-
|
109
|
-
|
132
|
+
if (!data) {
|
133
|
+
data = new Button(this);
|
134
|
+
$$$1(this).data(DATA_KEY, data);
|
135
|
+
}
|
110
136
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
}
|
137
|
+
if (config === 'toggle') {
|
138
|
+
data[config]();
|
139
|
+
}
|
140
|
+
});
|
141
|
+
};
|
115
142
|
|
116
|
-
|
117
|
-
|
143
|
+
_createClass(Button, null, [{
|
144
|
+
key: "VERSION",
|
145
|
+
get: function get() {
|
146
|
+
return VERSION;
|
118
147
|
}
|
119
|
-
});
|
120
|
-
};
|
148
|
+
}]);
|
121
149
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
150
|
+
return Button;
|
151
|
+
}();
|
152
|
+
/**
|
153
|
+
* ------------------------------------------------------------------------
|
154
|
+
* Data Api implementation
|
155
|
+
* ------------------------------------------------------------------------
|
156
|
+
*/
|
128
157
|
|
129
|
-
return Button;
|
130
|
-
}();
|
131
|
-
/**
|
132
|
-
* ------------------------------------------------------------------------
|
133
|
-
* Data Api implementation
|
134
|
-
* ------------------------------------------------------------------------
|
135
|
-
*/
|
136
158
|
|
159
|
+
$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
160
|
+
event.preventDefault();
|
161
|
+
var button = event.target;
|
137
162
|
|
138
|
-
|
139
|
-
|
140
|
-
|
163
|
+
if (!$$$1(button).hasClass(ClassName.BUTTON)) {
|
164
|
+
button = $$$1(button).closest(Selector.BUTTON);
|
165
|
+
}
|
141
166
|
|
142
|
-
|
143
|
-
|
144
|
-
|
167
|
+
Button._jQueryInterface.call($$$1(button), 'toggle');
|
168
|
+
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
169
|
+
var button = $$$1(event.target).closest(Selector.BUTTON)[0];
|
170
|
+
$$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
171
|
+
});
|
172
|
+
/**
|
173
|
+
* ------------------------------------------------------------------------
|
174
|
+
* jQuery
|
175
|
+
* ------------------------------------------------------------------------
|
176
|
+
*/
|
145
177
|
|
146
|
-
Button._jQueryInterface
|
147
|
-
|
148
|
-
var button = $(event.target).closest(Selector.BUTTON)[0];
|
149
|
-
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
150
|
-
});
|
151
|
-
/**
|
152
|
-
* ------------------------------------------------------------------------
|
153
|
-
* jQuery
|
154
|
-
* ------------------------------------------------------------------------
|
155
|
-
*/
|
178
|
+
$$$1.fn[NAME] = Button._jQueryInterface;
|
179
|
+
$$$1.fn[NAME].Constructor = Button;
|
156
180
|
|
157
|
-
|
158
|
-
|
181
|
+
$$$1.fn[NAME].noConflict = function () {
|
182
|
+
$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
|
183
|
+
return Button._jQueryInterface;
|
184
|
+
};
|
159
185
|
|
160
|
-
|
161
|
-
|
162
|
-
return Button._jQueryInterface;
|
163
|
-
};
|
186
|
+
return Button;
|
187
|
+
}($);
|
164
188
|
|
165
189
|
return Button;
|
166
|
-
|
190
|
+
|
191
|
+
})));
|
@@ -1,510 +1,566 @@
|
|
1
|
-
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
4
|
+
(global.Carousel = factory(global.jQuery,global.Util));
|
5
|
+
}(this, (function ($,Util) { 'use strict';
|
6
|
+
|
7
|
+
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
8
|
+
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
9
|
+
|
10
|
+
function _defineProperties(target, props) {
|
11
|
+
for (var i = 0; i < props.length; i++) {
|
12
|
+
var descriptor = props[i];
|
13
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
14
|
+
descriptor.configurable = true;
|
15
|
+
if ("value" in descriptor) descriptor.writable = true;
|
16
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
21
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
22
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
23
|
+
return Constructor;
|
24
|
+
}
|
25
|
+
|
26
|
+
function _defineProperty(obj, key, value) {
|
27
|
+
if (key in obj) {
|
28
|
+
Object.defineProperty(obj, key, {
|
29
|
+
value: value,
|
30
|
+
enumerable: true,
|
31
|
+
configurable: true,
|
32
|
+
writable: true
|
33
|
+
});
|
34
|
+
} else {
|
35
|
+
obj[key] = value;
|
36
|
+
}
|
2
37
|
|
3
|
-
|
38
|
+
return obj;
|
39
|
+
}
|
4
40
|
|
5
|
-
function
|
41
|
+
function _objectSpread(target) {
|
42
|
+
for (var i = 1; i < arguments.length; i++) {
|
43
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
44
|
+
var ownKeys = Object.keys(source);
|
6
45
|
|
7
|
-
|
46
|
+
if (typeof Object.getOwnPropertySymbols === 'function') {
|
47
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
48
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
49
|
+
}));
|
50
|
+
}
|
51
|
+
|
52
|
+
ownKeys.forEach(function (key) {
|
53
|
+
_defineProperty(target, key, source[key]);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
|
57
|
+
return target;
|
58
|
+
}
|
8
59
|
|
9
|
-
/**
|
10
|
-
* --------------------------------------------------------------------------
|
11
|
-
* Bootstrap (v4.1.2): carousel.js
|
12
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
13
|
-
* --------------------------------------------------------------------------
|
14
|
-
*/
|
15
|
-
var Carousel = function ($) {
|
16
60
|
/**
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
61
|
+
* --------------------------------------------------------------------------
|
62
|
+
* Bootstrap (v4.1.3): carousel.js
|
63
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
64
|
+
* --------------------------------------------------------------------------
|
20
65
|
*/
|
21
|
-
|
22
|
-
var
|
23
|
-
var DATA_KEY = 'bs.carousel';
|
24
|
-
var EVENT_KEY = "." + DATA_KEY;
|
25
|
-
var DATA_API_KEY = '.data-api';
|
26
|
-
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
27
|
-
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
28
|
-
|
29
|
-
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
30
|
-
|
31
|
-
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
32
|
-
|
33
|
-
var Default = {
|
34
|
-
interval: 5000,
|
35
|
-
keyboard: true,
|
36
|
-
slide: false,
|
37
|
-
pause: 'hover',
|
38
|
-
wrap: true
|
39
|
-
};
|
40
|
-
var DefaultType = {
|
41
|
-
interval: '(number|boolean)',
|
42
|
-
keyboard: 'boolean',
|
43
|
-
slide: '(boolean|string)',
|
44
|
-
pause: '(string|boolean)',
|
45
|
-
wrap: 'boolean'
|
46
|
-
};
|
47
|
-
var Direction = {
|
48
|
-
NEXT: 'next',
|
49
|
-
PREV: 'prev',
|
50
|
-
LEFT: 'left',
|
51
|
-
RIGHT: 'right'
|
52
|
-
};
|
53
|
-
var Event = {
|
54
|
-
SLIDE: "slide" + EVENT_KEY,
|
55
|
-
SLID: "slid" + EVENT_KEY,
|
56
|
-
KEYDOWN: "keydown" + EVENT_KEY,
|
57
|
-
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
58
|
-
MOUSELEAVE: "mouseleave" + EVENT_KEY,
|
59
|
-
TOUCHEND: "touchend" + EVENT_KEY,
|
60
|
-
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
|
61
|
-
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
62
|
-
};
|
63
|
-
var ClassName = {
|
64
|
-
CAROUSEL: 'carousel',
|
65
|
-
ACTIVE: 'active',
|
66
|
-
SLIDE: 'slide',
|
67
|
-
RIGHT: 'carousel-item-right',
|
68
|
-
LEFT: 'carousel-item-left',
|
69
|
-
NEXT: 'carousel-item-next',
|
70
|
-
PREV: 'carousel-item-prev',
|
71
|
-
ITEM: 'carousel-item'
|
72
|
-
};
|
73
|
-
var Selector = {
|
74
|
-
ACTIVE: '.active',
|
75
|
-
ACTIVE_ITEM: '.active.carousel-item',
|
76
|
-
ITEM: '.carousel-item',
|
77
|
-
NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
|
78
|
-
INDICATORS: '.carousel-indicators',
|
79
|
-
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
80
|
-
DATA_RIDE: '[data-ride="carousel"]'
|
66
|
+
|
67
|
+
var Carousel = function ($$$1) {
|
81
68
|
/**
|
82
69
|
* ------------------------------------------------------------------------
|
83
|
-
*
|
70
|
+
* Constants
|
84
71
|
* ------------------------------------------------------------------------
|
85
72
|
*/
|
73
|
+
var NAME = 'carousel';
|
74
|
+
var VERSION = '4.1.3';
|
75
|
+
var DATA_KEY = 'bs.carousel';
|
76
|
+
var EVENT_KEY = "." + DATA_KEY;
|
77
|
+
var DATA_API_KEY = '.data-api';
|
78
|
+
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
|
79
|
+
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
80
|
+
|
81
|
+
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
82
|
+
|
83
|
+
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
84
|
+
|
85
|
+
var Default = {
|
86
|
+
interval: 5000,
|
87
|
+
keyboard: true,
|
88
|
+
slide: false,
|
89
|
+
pause: 'hover',
|
90
|
+
wrap: true
|
91
|
+
};
|
92
|
+
var DefaultType = {
|
93
|
+
interval: '(number|boolean)',
|
94
|
+
keyboard: 'boolean',
|
95
|
+
slide: '(boolean|string)',
|
96
|
+
pause: '(string|boolean)',
|
97
|
+
wrap: 'boolean'
|
98
|
+
};
|
99
|
+
var Direction = {
|
100
|
+
NEXT: 'next',
|
101
|
+
PREV: 'prev',
|
102
|
+
LEFT: 'left',
|
103
|
+
RIGHT: 'right'
|
104
|
+
};
|
105
|
+
var Event = {
|
106
|
+
SLIDE: "slide" + EVENT_KEY,
|
107
|
+
SLID: "slid" + EVENT_KEY,
|
108
|
+
KEYDOWN: "keydown" + EVENT_KEY,
|
109
|
+
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
110
|
+
MOUSELEAVE: "mouseleave" + EVENT_KEY,
|
111
|
+
TOUCHEND: "touchend" + EVENT_KEY,
|
112
|
+
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
|
113
|
+
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
114
|
+
};
|
115
|
+
var ClassName = {
|
116
|
+
CAROUSEL: 'carousel',
|
117
|
+
ACTIVE: 'active',
|
118
|
+
SLIDE: 'slide',
|
119
|
+
RIGHT: 'carousel-item-right',
|
120
|
+
LEFT: 'carousel-item-left',
|
121
|
+
NEXT: 'carousel-item-next',
|
122
|
+
PREV: 'carousel-item-prev',
|
123
|
+
ITEM: 'carousel-item'
|
124
|
+
};
|
125
|
+
var Selector = {
|
126
|
+
ACTIVE: '.active',
|
127
|
+
ACTIVE_ITEM: '.active.carousel-item',
|
128
|
+
ITEM: '.carousel-item',
|
129
|
+
NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
|
130
|
+
INDICATORS: '.carousel-indicators',
|
131
|
+
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
132
|
+
DATA_RIDE: '[data-ride="carousel"]'
|
133
|
+
/**
|
134
|
+
* ------------------------------------------------------------------------
|
135
|
+
* Class Definition
|
136
|
+
* ------------------------------------------------------------------------
|
137
|
+
*/
|
86
138
|
|
87
|
-
|
88
|
-
|
89
|
-
var Carousel =
|
90
|
-
/*#__PURE__*/
|
91
|
-
function () {
|
92
|
-
function Carousel(element, config) {
|
93
|
-
this._items = null;
|
94
|
-
this._interval = null;
|
95
|
-
this._activeElement = null;
|
96
|
-
this._isPaused = false;
|
97
|
-
this._isSliding = false;
|
98
|
-
this.touchTimeout = null;
|
99
|
-
this._config = this._getConfig(config);
|
100
|
-
this._element = $(element)[0];
|
101
|
-
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
|
102
|
-
|
103
|
-
this._addEventListeners();
|
104
|
-
} // Getters
|
139
|
+
};
|
105
140
|
|
141
|
+
var Carousel =
|
142
|
+
/*#__PURE__*/
|
143
|
+
function () {
|
144
|
+
function Carousel(element, config) {
|
145
|
+
this._items = null;
|
146
|
+
this._interval = null;
|
147
|
+
this._activeElement = null;
|
148
|
+
this._isPaused = false;
|
149
|
+
this._isSliding = false;
|
150
|
+
this.touchTimeout = null;
|
151
|
+
this._config = this._getConfig(config);
|
152
|
+
this._element = $$$1(element)[0];
|
153
|
+
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
|
106
154
|
|
107
|
-
|
155
|
+
this._addEventListeners();
|
156
|
+
} // Getters
|
108
157
|
|
109
|
-
// Public
|
110
|
-
_proto.next = function next() {
|
111
|
-
if (!this._isSliding) {
|
112
|
-
this._slide(Direction.NEXT);
|
113
|
-
}
|
114
|
-
};
|
115
158
|
|
116
|
-
|
117
|
-
// Don't call next when the page isn't visible
|
118
|
-
// or the carousel or its parent isn't visible
|
119
|
-
if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
|
120
|
-
this.next();
|
121
|
-
}
|
122
|
-
};
|
159
|
+
var _proto = Carousel.prototype;
|
123
160
|
|
124
|
-
|
125
|
-
|
126
|
-
this.
|
127
|
-
|
128
|
-
|
161
|
+
// Public
|
162
|
+
_proto.next = function next() {
|
163
|
+
if (!this._isSliding) {
|
164
|
+
this._slide(Direction.NEXT);
|
165
|
+
}
|
166
|
+
};
|
129
167
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
168
|
+
_proto.nextWhenVisible = function nextWhenVisible() {
|
169
|
+
// Don't call next when the page isn't visible
|
170
|
+
// or the carousel or its parent isn't visible
|
171
|
+
if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
|
172
|
+
this.next();
|
173
|
+
}
|
174
|
+
};
|
134
175
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
176
|
+
_proto.prev = function prev() {
|
177
|
+
if (!this._isSliding) {
|
178
|
+
this._slide(Direction.PREV);
|
179
|
+
}
|
180
|
+
};
|
139
181
|
|
140
|
-
|
141
|
-
|
142
|
-
|
182
|
+
_proto.pause = function pause(event) {
|
183
|
+
if (!event) {
|
184
|
+
this._isPaused = true;
|
185
|
+
}
|
143
186
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
187
|
+
if (this._element.querySelector(Selector.NEXT_PREV)) {
|
188
|
+
Util.triggerTransitionEnd(this._element);
|
189
|
+
this.cycle(true);
|
190
|
+
}
|
148
191
|
|
149
|
-
if (this._interval) {
|
150
192
|
clearInterval(this._interval);
|
151
193
|
this._interval = null;
|
152
|
-
}
|
194
|
+
};
|
153
195
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
196
|
+
_proto.cycle = function cycle(event) {
|
197
|
+
if (!event) {
|
198
|
+
this._isPaused = false;
|
199
|
+
}
|
158
200
|
|
159
|
-
|
160
|
-
|
201
|
+
if (this._interval) {
|
202
|
+
clearInterval(this._interval);
|
203
|
+
this._interval = null;
|
204
|
+
}
|
161
205
|
|
162
|
-
|
206
|
+
if (this._config.interval && !this._isPaused) {
|
207
|
+
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
|
208
|
+
}
|
209
|
+
};
|
163
210
|
|
164
|
-
|
211
|
+
_proto.to = function to(index) {
|
212
|
+
var _this = this;
|
165
213
|
|
166
|
-
|
167
|
-
return;
|
168
|
-
}
|
214
|
+
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
169
215
|
|
170
|
-
|
171
|
-
$(this._element).one(Event.SLID, function () {
|
172
|
-
return _this.to(index);
|
173
|
-
});
|
174
|
-
return;
|
175
|
-
}
|
216
|
+
var activeIndex = this._getItemIndex(this._activeElement);
|
176
217
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
return;
|
181
|
-
}
|
218
|
+
if (index > this._items.length - 1 || index < 0) {
|
219
|
+
return;
|
220
|
+
}
|
182
221
|
|
183
|
-
|
222
|
+
if (this._isSliding) {
|
223
|
+
$$$1(this._element).one(Event.SLID, function () {
|
224
|
+
return _this.to(index);
|
225
|
+
});
|
226
|
+
return;
|
227
|
+
}
|
184
228
|
|
185
|
-
|
186
|
-
|
229
|
+
if (activeIndex === index) {
|
230
|
+
this.pause();
|
231
|
+
this.cycle();
|
232
|
+
return;
|
233
|
+
}
|
187
234
|
|
188
|
-
|
189
|
-
$(this._element).off(EVENT_KEY);
|
190
|
-
$.removeData(this._element, DATA_KEY);
|
191
|
-
this._items = null;
|
192
|
-
this._config = null;
|
193
|
-
this._element = null;
|
194
|
-
this._interval = null;
|
195
|
-
this._isPaused = null;
|
196
|
-
this._isSliding = null;
|
197
|
-
this._activeElement = null;
|
198
|
-
this._indicatorsElement = null;
|
199
|
-
}; // Private
|
200
|
-
|
201
|
-
|
202
|
-
_proto._getConfig = function _getConfig(config) {
|
203
|
-
config = _objectSpread({}, Default, config);
|
204
|
-
Util.typeCheckConfig(NAME, config, DefaultType);
|
205
|
-
return config;
|
206
|
-
};
|
235
|
+
var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
|
207
236
|
|
208
|
-
|
209
|
-
|
237
|
+
this._slide(direction, this._items[index]);
|
238
|
+
};
|
210
239
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
240
|
+
_proto.dispose = function dispose() {
|
241
|
+
$$$1(this._element).off(EVENT_KEY);
|
242
|
+
$$$1.removeData(this._element, DATA_KEY);
|
243
|
+
this._items = null;
|
244
|
+
this._config = null;
|
245
|
+
this._element = null;
|
246
|
+
this._interval = null;
|
247
|
+
this._isPaused = null;
|
248
|
+
this._isSliding = null;
|
249
|
+
this._activeElement = null;
|
250
|
+
this._indicatorsElement = null;
|
251
|
+
}; // Private
|
216
252
|
|
217
|
-
if (this._config.pause === 'hover') {
|
218
|
-
$(this._element).on(Event.MOUSEENTER, function (event) {
|
219
|
-
return _this2.pause(event);
|
220
|
-
}).on(Event.MOUSELEAVE, function (event) {
|
221
|
-
return _this2.cycle(event);
|
222
|
-
});
|
223
253
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
$(this._element).on(Event.TOUCHEND, function () {
|
233
|
-
_this2.pause();
|
234
|
-
|
235
|
-
if (_this2.touchTimeout) {
|
236
|
-
clearTimeout(_this2.touchTimeout);
|
237
|
-
}
|
254
|
+
_proto._getConfig = function _getConfig(config) {
|
255
|
+
config = _objectSpread({}, Default, config);
|
256
|
+
Util.typeCheckConfig(NAME, config, DefaultType);
|
257
|
+
return config;
|
258
|
+
};
|
259
|
+
|
260
|
+
_proto._addEventListeners = function _addEventListeners() {
|
261
|
+
var _this2 = this;
|
238
262
|
|
239
|
-
|
240
|
-
|
241
|
-
|
263
|
+
if (this._config.keyboard) {
|
264
|
+
$$$1(this._element).on(Event.KEYDOWN, function (event) {
|
265
|
+
return _this2._keydown(event);
|
242
266
|
});
|
243
267
|
}
|
244
|
-
}
|
245
|
-
};
|
246
268
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
269
|
+
if (this._config.pause === 'hover') {
|
270
|
+
$$$1(this._element).on(Event.MOUSEENTER, function (event) {
|
271
|
+
return _this2.pause(event);
|
272
|
+
}).on(Event.MOUSELEAVE, function (event) {
|
273
|
+
return _this2.cycle(event);
|
274
|
+
});
|
251
275
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
276
|
+
if ('ontouchstart' in document.documentElement) {
|
277
|
+
// If it's a touch-enabled device, mouseenter/leave are fired as
|
278
|
+
// part of the mouse compatibility events on first tap - the carousel
|
279
|
+
// would stop cycling until user tapped out of it;
|
280
|
+
// here, we listen for touchend, explicitly pause the carousel
|
281
|
+
// (as if it's the second time we tap on it, mouseenter compat event
|
282
|
+
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
283
|
+
// events to fire) we explicitly restart cycling
|
284
|
+
$$$1(this._element).on(Event.TOUCHEND, function () {
|
285
|
+
_this2.pause();
|
286
|
+
|
287
|
+
if (_this2.touchTimeout) {
|
288
|
+
clearTimeout(_this2.touchTimeout);
|
289
|
+
}
|
290
|
+
|
291
|
+
_this2.touchTimeout = setTimeout(function (event) {
|
292
|
+
return _this2.cycle(event);
|
293
|
+
}, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
|
294
|
+
});
|
295
|
+
}
|
296
|
+
}
|
297
|
+
};
|
257
298
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
299
|
+
_proto._keydown = function _keydown(event) {
|
300
|
+
if (/input|textarea/i.test(event.target.tagName)) {
|
301
|
+
return;
|
302
|
+
}
|
262
303
|
|
263
|
-
|
264
|
-
|
265
|
-
|
304
|
+
switch (event.which) {
|
305
|
+
case ARROW_LEFT_KEYCODE:
|
306
|
+
event.preventDefault();
|
307
|
+
this.prev();
|
308
|
+
break;
|
266
309
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
310
|
+
case ARROW_RIGHT_KEYCODE:
|
311
|
+
event.preventDefault();
|
312
|
+
this.next();
|
313
|
+
break;
|
271
314
|
|
272
|
-
|
273
|
-
|
274
|
-
|
315
|
+
default:
|
316
|
+
}
|
317
|
+
};
|
275
318
|
|
276
|
-
|
319
|
+
_proto._getItemIndex = function _getItemIndex(element) {
|
320
|
+
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
|
321
|
+
return this._items.indexOf(element);
|
322
|
+
};
|
277
323
|
|
278
|
-
|
279
|
-
|
324
|
+
_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
325
|
+
var isNextDirection = direction === Direction.NEXT;
|
326
|
+
var isPrevDirection = direction === Direction.PREV;
|
280
327
|
|
281
|
-
|
282
|
-
return activeElement;
|
283
|
-
}
|
328
|
+
var activeIndex = this._getItemIndex(activeElement);
|
284
329
|
|
285
|
-
|
286
|
-
|
287
|
-
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
288
|
-
};
|
330
|
+
var lastItemIndex = this._items.length - 1;
|
331
|
+
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
289
332
|
|
290
|
-
|
291
|
-
|
333
|
+
if (isGoingToWrap && !this._config.wrap) {
|
334
|
+
return activeElement;
|
335
|
+
}
|
292
336
|
|
293
|
-
|
337
|
+
var delta = direction === Direction.PREV ? -1 : 1;
|
338
|
+
var itemIndex = (activeIndex + delta) % this._items.length;
|
339
|
+
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
340
|
+
};
|
294
341
|
|
295
|
-
|
296
|
-
|
297
|
-
direction: eventDirectionName,
|
298
|
-
from: fromIndex,
|
299
|
-
to: targetIndex
|
300
|
-
});
|
301
|
-
$(this._element).trigger(slideEvent);
|
302
|
-
return slideEvent;
|
303
|
-
};
|
342
|
+
_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
343
|
+
var targetIndex = this._getItemIndex(relatedTarget);
|
304
344
|
|
305
|
-
|
306
|
-
if (this._indicatorsElement) {
|
307
|
-
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
|
308
|
-
$(indicators).removeClass(ClassName.ACTIVE);
|
345
|
+
var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
|
309
346
|
|
310
|
-
var
|
347
|
+
var slideEvent = $$$1.Event(Event.SLIDE, {
|
348
|
+
relatedTarget: relatedTarget,
|
349
|
+
direction: eventDirectionName,
|
350
|
+
from: fromIndex,
|
351
|
+
to: targetIndex
|
352
|
+
});
|
353
|
+
$$$1(this._element).trigger(slideEvent);
|
354
|
+
return slideEvent;
|
355
|
+
};
|
356
|
+
|
357
|
+
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
358
|
+
if (this._indicatorsElement) {
|
359
|
+
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
|
360
|
+
$$$1(indicators).removeClass(ClassName.ACTIVE);
|
311
361
|
|
312
|
-
|
313
|
-
|
362
|
+
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
363
|
+
|
364
|
+
if (nextIndicator) {
|
365
|
+
$$$1(nextIndicator).addClass(ClassName.ACTIVE);
|
366
|
+
}
|
314
367
|
}
|
315
|
-
}
|
316
|
-
};
|
368
|
+
};
|
317
369
|
|
318
|
-
|
319
|
-
|
370
|
+
_proto._slide = function _slide(direction, element) {
|
371
|
+
var _this3 = this;
|
320
372
|
|
321
|
-
|
373
|
+
var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
322
374
|
|
323
|
-
|
375
|
+
var activeElementIndex = this._getItemIndex(activeElement);
|
324
376
|
|
325
|
-
|
377
|
+
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
326
378
|
|
327
|
-
|
379
|
+
var nextElementIndex = this._getItemIndex(nextElement);
|
328
380
|
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
381
|
+
var isCycling = Boolean(this._interval);
|
382
|
+
var directionalClassName;
|
383
|
+
var orderClassName;
|
384
|
+
var eventDirectionName;
|
333
385
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
386
|
+
if (direction === Direction.NEXT) {
|
387
|
+
directionalClassName = ClassName.LEFT;
|
388
|
+
orderClassName = ClassName.NEXT;
|
389
|
+
eventDirectionName = Direction.LEFT;
|
390
|
+
} else {
|
391
|
+
directionalClassName = ClassName.RIGHT;
|
392
|
+
orderClassName = ClassName.PREV;
|
393
|
+
eventDirectionName = Direction.RIGHT;
|
394
|
+
}
|
343
395
|
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
396
|
+
if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
|
397
|
+
this._isSliding = false;
|
398
|
+
return;
|
399
|
+
}
|
348
400
|
|
349
|
-
|
401
|
+
var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
|
350
402
|
|
351
|
-
|
352
|
-
|
353
|
-
|
403
|
+
if (slideEvent.isDefaultPrevented()) {
|
404
|
+
return;
|
405
|
+
}
|
354
406
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
407
|
+
if (!activeElement || !nextElement) {
|
408
|
+
// Some weirdness is happening, so we bail
|
409
|
+
return;
|
410
|
+
}
|
359
411
|
|
360
|
-
|
412
|
+
this._isSliding = true;
|
361
413
|
|
362
|
-
|
363
|
-
|
364
|
-
|
414
|
+
if (isCycling) {
|
415
|
+
this.pause();
|
416
|
+
}
|
365
417
|
|
366
|
-
|
418
|
+
this._setActiveIndicatorElement(nextElement);
|
367
419
|
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
420
|
+
var slidEvent = $$$1.Event(Event.SLID, {
|
421
|
+
relatedTarget: nextElement,
|
422
|
+
direction: eventDirectionName,
|
423
|
+
from: activeElementIndex,
|
424
|
+
to: nextElementIndex
|
425
|
+
});
|
374
426
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
427
|
+
if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
|
428
|
+
$$$1(nextElement).addClass(orderClassName);
|
429
|
+
Util.reflow(nextElement);
|
430
|
+
$$$1(activeElement).addClass(directionalClassName);
|
431
|
+
$$$1(nextElement).addClass(directionalClassName);
|
432
|
+
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
|
433
|
+
$$$1(activeElement).one(Util.TRANSITION_END, function () {
|
434
|
+
$$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
|
435
|
+
$$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
|
436
|
+
_this3._isSliding = false;
|
437
|
+
setTimeout(function () {
|
438
|
+
return $$$1(_this3._element).trigger(slidEvent);
|
439
|
+
}, 0);
|
440
|
+
}).emulateTransitionEnd(transitionDuration);
|
441
|
+
} else {
|
442
|
+
$$$1(activeElement).removeClass(ClassName.ACTIVE);
|
443
|
+
$$$1(nextElement).addClass(ClassName.ACTIVE);
|
444
|
+
this._isSliding = false;
|
445
|
+
$$$1(this._element).trigger(slidEvent);
|
446
|
+
}
|
395
447
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
448
|
+
if (isCycling) {
|
449
|
+
this.cycle();
|
450
|
+
}
|
451
|
+
}; // Static
|
400
452
|
|
401
453
|
|
402
|
-
|
403
|
-
|
404
|
-
|
454
|
+
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
455
|
+
return this.each(function () {
|
456
|
+
var data = $$$1(this).data(DATA_KEY);
|
405
457
|
|
406
|
-
|
458
|
+
var _config = _objectSpread({}, Default, $$$1(this).data());
|
407
459
|
|
408
|
-
|
409
|
-
|
410
|
-
|
460
|
+
if (typeof config === 'object') {
|
461
|
+
_config = _objectSpread({}, _config, config);
|
462
|
+
}
|
411
463
|
|
412
|
-
|
464
|
+
var action = typeof config === 'string' ? config : _config.slide;
|
413
465
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
466
|
+
if (!data) {
|
467
|
+
data = new Carousel(this, _config);
|
468
|
+
$$$1(this).data(DATA_KEY, data);
|
469
|
+
}
|
470
|
+
|
471
|
+
if (typeof config === 'number') {
|
472
|
+
data.to(config);
|
473
|
+
} else if (typeof action === 'string') {
|
474
|
+
if (typeof data[action] === 'undefined') {
|
475
|
+
throw new TypeError("No method named \"" + action + "\"");
|
476
|
+
}
|
418
477
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
throw new TypeError("No method named \"" + action + "\"");
|
478
|
+
data[action]();
|
479
|
+
} else if (_config.interval) {
|
480
|
+
data.pause();
|
481
|
+
data.cycle();
|
424
482
|
}
|
483
|
+
});
|
484
|
+
};
|
485
|
+
|
486
|
+
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
487
|
+
var selector = Util.getSelectorFromElement(this);
|
425
488
|
|
426
|
-
|
427
|
-
|
428
|
-
data.pause();
|
429
|
-
data.cycle();
|
489
|
+
if (!selector) {
|
490
|
+
return;
|
430
491
|
}
|
431
|
-
});
|
432
|
-
};
|
433
492
|
|
434
|
-
|
435
|
-
var selector = Util.getSelectorFromElement(this);
|
493
|
+
var target = $$$1(selector)[0];
|
436
494
|
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
var target = $(selector)[0];
|
495
|
+
if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
|
496
|
+
return;
|
497
|
+
}
|
442
498
|
|
443
|
-
|
444
|
-
return;
|
445
|
-
}
|
499
|
+
var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
|
446
500
|
|
447
|
-
|
501
|
+
var slideIndex = this.getAttribute('data-slide-to');
|
448
502
|
|
449
|
-
|
503
|
+
if (slideIndex) {
|
504
|
+
config.interval = false;
|
505
|
+
}
|
450
506
|
|
451
|
-
|
452
|
-
config.interval = false;
|
453
|
-
}
|
507
|
+
Carousel._jQueryInterface.call($$$1(target), config);
|
454
508
|
|
455
|
-
|
509
|
+
if (slideIndex) {
|
510
|
+
$$$1(target).data(DATA_KEY).to(slideIndex);
|
511
|
+
}
|
456
512
|
|
457
|
-
|
458
|
-
|
459
|
-
}
|
513
|
+
event.preventDefault();
|
514
|
+
};
|
460
515
|
|
461
|
-
|
462
|
-
|
516
|
+
_createClass(Carousel, null, [{
|
517
|
+
key: "VERSION",
|
518
|
+
get: function get() {
|
519
|
+
return VERSION;
|
520
|
+
}
|
521
|
+
}, {
|
522
|
+
key: "Default",
|
523
|
+
get: function get() {
|
524
|
+
return Default;
|
525
|
+
}
|
526
|
+
}]);
|
463
527
|
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
get: function get() {
|
472
|
-
return Default;
|
473
|
-
}
|
474
|
-
}]);
|
528
|
+
return Carousel;
|
529
|
+
}();
|
530
|
+
/**
|
531
|
+
* ------------------------------------------------------------------------
|
532
|
+
* Data Api implementation
|
533
|
+
* ------------------------------------------------------------------------
|
534
|
+
*/
|
475
535
|
|
476
|
-
return Carousel;
|
477
|
-
}();
|
478
|
-
/**
|
479
|
-
* ------------------------------------------------------------------------
|
480
|
-
* Data Api implementation
|
481
|
-
* ------------------------------------------------------------------------
|
482
|
-
*/
|
483
536
|
|
537
|
+
$$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
538
|
+
$$$1(window).on(Event.LOAD_DATA_API, function () {
|
539
|
+
var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
|
484
540
|
|
485
|
-
|
486
|
-
|
487
|
-
var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
|
541
|
+
for (var i = 0, len = carousels.length; i < len; i++) {
|
542
|
+
var $carousel = $$$1(carousels[i]);
|
488
543
|
|
489
|
-
|
490
|
-
|
544
|
+
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
545
|
+
}
|
546
|
+
});
|
547
|
+
/**
|
548
|
+
* ------------------------------------------------------------------------
|
549
|
+
* jQuery
|
550
|
+
* ------------------------------------------------------------------------
|
551
|
+
*/
|
491
552
|
|
492
|
-
|
493
|
-
|
494
|
-
});
|
495
|
-
/**
|
496
|
-
* ------------------------------------------------------------------------
|
497
|
-
* jQuery
|
498
|
-
* ------------------------------------------------------------------------
|
499
|
-
*/
|
553
|
+
$$$1.fn[NAME] = Carousel._jQueryInterface;
|
554
|
+
$$$1.fn[NAME].Constructor = Carousel;
|
500
555
|
|
501
|
-
|
502
|
-
|
556
|
+
$$$1.fn[NAME].noConflict = function () {
|
557
|
+
$$$1.fn[NAME] = JQUERY_NO_CONFLICT;
|
558
|
+
return Carousel._jQueryInterface;
|
559
|
+
};
|
503
560
|
|
504
|
-
|
505
|
-
|
506
|
-
return Carousel._jQueryInterface;
|
507
|
-
};
|
561
|
+
return Carousel;
|
562
|
+
}($);
|
508
563
|
|
509
564
|
return Carousel;
|
510
|
-
|
565
|
+
|
566
|
+
})));
|