@finqu/cool 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build/.eslintrc.json +10 -0
- package/build/banner.js +14 -0
- package/build/build-plugins.js +92 -0
- package/build/rollup.config.js +78 -0
- package/dist/css/cool-grid.css +3672 -0
- package/dist/css/cool-grid.css.map +30 -0
- package/dist/css/cool-grid.min.css +7 -0
- package/dist/css/cool-grid.min.css.map +1 -0
- package/dist/css/cool-reboot.css +281 -0
- package/dist/css/cool-reboot.css.map +58 -0
- package/dist/css/cool-reboot.min.css +7 -0
- package/dist/css/cool-reboot.min.css.map +1 -0
- package/dist/css/cool.css +14841 -0
- package/dist/css/cool.css.map +144 -0
- package/dist/css/cool.min.css +7 -0
- package/dist/css/cool.min.css.map +1 -0
- package/dist/js/cool.bundle.js +15304 -0
- package/dist/js/cool.bundle.js.map +1 -0
- package/dist/js/cool.bundle.min.js +45 -0
- package/dist/js/cool.bundle.min.js.map +1 -0
- package/dist/js/cool.esm.js +4766 -0
- package/dist/js/cool.esm.js.map +1 -0
- package/dist/js/cool.esm.min.js +7 -0
- package/dist/js/cool.esm.min.js.map +1 -0
- package/dist/js/cool.js +4948 -0
- package/dist/js/cool.js.map +1 -0
- package/dist/js/cool.min.js +7 -0
- package/dist/js/cool.min.js.map +1 -0
- package/html/index.html +892 -0
- package/js/dist/collapse.js +321 -0
- package/js/dist/collapse.js.map +1 -0
- package/js/dist/common.js +1474 -0
- package/js/dist/common.js.map +1 -0
- package/js/dist/cooldropdown.js +467 -0
- package/js/dist/cooldropdown.js.map +1 -0
- package/js/dist/coolpopover.js +391 -0
- package/js/dist/coolpopover.js.map +1 -0
- package/js/dist/coolsectiontabs.js +256 -0
- package/js/dist/coolsectiontabs.js.map +1 -0
- package/js/dist/coolselect.js +796 -0
- package/js/dist/coolselect.js.map +1 -0
- package/js/dist/cooltooltip.js +360 -0
- package/js/dist/cooltooltip.js.map +1 -0
- package/js/dist/coolui.js +73 -0
- package/js/dist/coolui.js.map +1 -0
- package/js/dist/dropdown.js +1716 -0
- package/js/dist/dropdown.js.map +1 -0
- package/js/dist/popover.js +587 -0
- package/js/dist/popover.js.map +1 -0
- package/js/dist/sectiontabs.js +263 -0
- package/js/dist/sectiontabs.js.map +1 -0
- package/js/dist/select.js +2029 -0
- package/js/dist/select.js.map +1 -0
- package/js/dist/tooltip.js +555 -0
- package/js/dist/tooltip.js.map +1 -0
- package/js/index.esm.js +21 -0
- package/js/index.umd.js +21 -0
- package/js/src/abstract-ui-component.js +70 -0
- package/js/src/collapse.js +258 -0
- package/js/src/common.js +280 -0
- package/js/src/dialog.js +570 -0
- package/js/src/dropdown.js +443 -0
- package/js/src/popover.js +615 -0
- package/js/src/section-tabs.js +204 -0
- package/js/src/select.js +832 -0
- package/js/src/toast.js +581 -0
- package/js/src/tooltip.js +575 -0
- package/js/src/util/animate-css.js +22 -0
- package/js/src/util/index.js +112 -0
- package/js/src/util/perfect-scrollbar.js +1316 -0
- package/less/alert.less +345 -0
- package/less/badge.less +38 -0
- package/less/bootstrap-noconflict.less +23 -0
- package/less/bootstrap.less +23 -0
- package/less/button-group.less +153 -0
- package/less/buttons.less +287 -0
- package/less/dialog-noconflict.less +174 -0
- package/less/dialog.less +203 -0
- package/less/dropdown.less +209 -0
- package/less/forms.less +770 -0
- package/less/images.less +242 -0
- package/less/input-group.less +163 -0
- package/less/list-group.less +73 -0
- package/less/mixins/aspect-ratio.less +23 -0
- package/less/mixins/border-radius.less +24 -0
- package/less/mixins/box-shadow.less +4 -0
- package/less/mixins/buttons.less +17 -0
- package/less/mixins/caret.less +51 -0
- package/less/mixins/clearfix.less +10 -0
- package/less/mixins/gradients.less +34 -0
- package/less/mixins/nav-divider.less +7 -0
- package/less/mixins/object-fit.less +13 -0
- package/less/mixins/reset-text.less +16 -0
- package/less/mixins.less +11 -0
- package/less/package.json +11 -0
- package/less/pagination.less +69 -0
- package/less/popover.less +143 -0
- package/less/project.sublime-workspace +774 -0
- package/less/reboot.less +235 -0
- package/less/section.less +793 -0
- package/less/select.less +150 -0
- package/less/tables.less +737 -0
- package/less/tabs.less +162 -0
- package/less/tooltip.less +87 -0
- package/less/type.less +71 -0
- package/less/utilities/align.less +27 -0
- package/less/utilities/animate.less +3512 -0
- package/less/utilities/background.less +70 -0
- package/less/utilities/borders.less +16 -0
- package/less/utilities/color.less +70 -0
- package/less/utilities/cursor.less +8 -0
- package/less/utilities/display.less +38 -0
- package/less/utilities/embed.less +61 -0
- package/less/utilities/flex.less +76 -0
- package/less/utilities/jquery-ui.less +116 -0
- package/less/utilities/lazyload.less +29 -0
- package/less/utilities/overflow.less +11 -0
- package/less/utilities/pace.less +25 -0
- package/less/utilities/placeholder.less +60 -0
- package/less/utilities/position.less +42 -0
- package/less/utilities/scrollbar.less +152 -0
- package/less/utilities/spacing.less +197 -0
- package/less/utilities/text.less +68 -0
- package/less/utilities/transform.less +7 -0
- package/less/utilities.less +21 -0
- package/less/variables.less +343 -0
- package/package.json +71 -0
- package/scss/LISENCE +15 -0
- package/scss/_alert.scss +125 -0
- package/scss/_badge.scss +58 -0
- package/scss/_button-group.scss +124 -0
- package/scss/_buttons.scss +206 -0
- package/scss/_custom-forms.scss +423 -0
- package/scss/_dialog.scss +149 -0
- package/scss/_dropdown.scss +234 -0
- package/scss/_forms.scss +257 -0
- package/scss/_frame.scss +523 -0
- package/scss/_functions.scss +114 -0
- package/scss/_grid.scss +35 -0
- package/scss/_images.scss +312 -0
- package/scss/_input-group.scss +245 -0
- package/scss/_list-group.scss +82 -0
- package/scss/_mixins.scss +32 -0
- package/scss/_navbar.scss +214 -0
- package/scss/_pagination.scss +79 -0
- package/scss/_popover.scss +165 -0
- package/scss/_reboot.scss +279 -0
- package/scss/_root.scss +15 -0
- package/scss/_section.scss +851 -0
- package/scss/_select.scss +166 -0
- package/scss/_tables.scss +707 -0
- package/scss/_tabs.scss +175 -0
- package/scss/_toast.scss +182 -0
- package/scss/_tooltip.scss +101 -0
- package/scss/_type.scss +90 -0
- package/scss/_utilities.scss +21 -0
- package/scss/_variables.scss +697 -0
- package/scss/cool-grid.scss +29 -0
- package/scss/cool-reboot.scss +11 -0
- package/scss/cool.scss +36 -0
- package/scss/mixins/_alert-variant.scss +40 -0
- package/scss/mixins/_aspect-ratio.scss +29 -0
- package/scss/mixins/_background-variant.scss +25 -0
- package/scss/mixins/_badge-variant.scss +13 -0
- package/scss/mixins/_breakpoints.scss +102 -0
- package/scss/mixins/_buttons.scss +104 -0
- package/scss/mixins/_caret.scss +80 -0
- package/scss/mixins/_clearfix.scss +10 -0
- package/scss/mixins/_float.scss +14 -0
- package/scss/mixins/_forms.scss +51 -0
- package/scss/mixins/_gradients.scss +40 -0
- package/scss/mixins/_grid-framework.scss +72 -0
- package/scss/mixins/_grid.scss +60 -0
- package/scss/mixins/_nav-divider.scss +9 -0
- package/scss/mixins/_object-fit.scss +16 -0
- package/scss/mixins/_reset-text.scss +19 -0
- package/scss/mixins/_text-emphasis.scss +21 -0
- package/scss/mixins/_text-hide.scss +10 -0
- package/scss/mixins/_text-truncate.scss +8 -0
- package/scss/project.sublime-workspace +491 -0
- package/scss/utilities/_align.scss +41 -0
- package/scss/utilities/_animate.scss +3512 -0
- package/scss/utilities/_background.scss +14 -0
- package/scss/utilities/_borders.scss +146 -0
- package/scss/utilities/_clearfix.scss +6 -0
- package/scss/utilities/_collapse.scss +33 -0
- package/scss/utilities/_cursor.scss +10 -0
- package/scss/utilities/_display.scss +16 -0
- package/scss/utilities/_embed.scss +78 -0
- package/scss/utilities/_flex.scss +50 -0
- package/scss/utilities/_lazyload.scss +31 -0
- package/scss/utilities/_overflow.scss +6 -0
- package/scss/utilities/_perfect-scrollbar.scss +154 -0
- package/scss/utilities/_placeholder.scss +76 -0
- package/scss/utilities/_position.scss +30 -0
- package/scss/utilities/_sizing.scss +32 -0
- package/scss/utilities/_spacing.scss +92 -0
- package/scss/utilities/_text.scss +97 -0
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Cool UI cooldropdown.js v1.0.0 (https://finqu.fi)
|
|
3
|
+
* Copyright 2011-2019 Finqu Oy
|
|
4
|
+
* Licensed under the ISC license - (http://opensource.org/licenses/ISC)
|
|
5
|
+
*/
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = global || self, global.CoolDropdown = factory());
|
|
10
|
+
}(this, function () { 'use strict';
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
jQuery
|
|
14
|
+
} = window;
|
|
15
|
+
|
|
16
|
+
const debounce = function (func, wait, immediate) {
|
|
17
|
+
var timeout;
|
|
18
|
+
return function () {
|
|
19
|
+
var context = this,
|
|
20
|
+
args = arguments;
|
|
21
|
+
|
|
22
|
+
var later = function () {
|
|
23
|
+
timeout = null;
|
|
24
|
+
if (!immediate) func.apply(context, args);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var callNow = immediate && !timeout;
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
timeout = setTimeout(later, wait);
|
|
30
|
+
if (callNow) func.apply(context, args);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const touchEvents = function () {
|
|
35
|
+
if ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
class AbstractUIComponent {
|
|
41
|
+
// Create callback
|
|
42
|
+
onCreate() {
|
|
43
|
+
var onCreate = this.opts.onCreate;
|
|
44
|
+
|
|
45
|
+
if (typeof onCreate === 'function') {
|
|
46
|
+
onCreate.call(this.el);
|
|
47
|
+
}
|
|
48
|
+
} // Update callback
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
onUpdate() {
|
|
52
|
+
var onUpdate = this.opts.onUpdate;
|
|
53
|
+
|
|
54
|
+
if (typeof onUpdate === 'function') {
|
|
55
|
+
onUpdate.call(this.el);
|
|
56
|
+
}
|
|
57
|
+
} // Destroy callback
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
onDestroy() {
|
|
61
|
+
var onDestroy = this.opts.onDestroy;
|
|
62
|
+
|
|
63
|
+
if (typeof onDestroy === 'function') {
|
|
64
|
+
onDestroy.call(this.el);
|
|
65
|
+
}
|
|
66
|
+
} // Show callback
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
onShow() {
|
|
70
|
+
var onShow = this.opts.onShow;
|
|
71
|
+
|
|
72
|
+
if (typeof onShow === 'function') {
|
|
73
|
+
onShow.call(this.el);
|
|
74
|
+
}
|
|
75
|
+
} // Close callback
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
onClose() {
|
|
79
|
+
var onClose = this.opts.onClose;
|
|
80
|
+
|
|
81
|
+
if (typeof onClose === 'function') {
|
|
82
|
+
onClose.call(this.el);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
debug(...args) {
|
|
87
|
+
if (this.opts.debug) {
|
|
88
|
+
if (typeof this.opts.debug === 'function') {
|
|
89
|
+
this.opts.debug(...args);
|
|
90
|
+
} else {
|
|
91
|
+
console.log(...args);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const NAME = 'coolDropdown';
|
|
99
|
+
const DATA_KEY = 'plugin_coolDropdown';
|
|
100
|
+
|
|
101
|
+
class CoolDropdown extends AbstractUIComponent {
|
|
102
|
+
constructor(el, opts) {
|
|
103
|
+
super();
|
|
104
|
+
this.el = el;
|
|
105
|
+
this.opts = jQuery.extend({}, jQuery.fn[NAME].defaults, opts);
|
|
106
|
+
this.init();
|
|
107
|
+
} // Init plugin
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
init() {
|
|
111
|
+
jQuery.when(this.buildCache()).then(() => {
|
|
112
|
+
this.buildScroll();
|
|
113
|
+
this.bindEvents();
|
|
114
|
+
this.onCreate();
|
|
115
|
+
});
|
|
116
|
+
} // Remove plugin instance completely
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
destroy() {
|
|
120
|
+
this.unbindEvents();
|
|
121
|
+
this.$el.removeData();
|
|
122
|
+
this.onDestroy();
|
|
123
|
+
} // Update plugin data
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
update() {
|
|
127
|
+
this.buildCache();
|
|
128
|
+
this.onUpdate();
|
|
129
|
+
} // Cache DOM nodes for performance
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
buildCache() {
|
|
133
|
+
this.$el = jQuery(this.el);
|
|
134
|
+
this.$el.addClass('dropdown-trigger');
|
|
135
|
+
this.$container = this.$el.parent('.dropdown');
|
|
136
|
+
this.id = 'dropdown-' + this.generateUUID();
|
|
137
|
+
this.animation = this.$el.data('animation') ? this.$el.data('animation') : this.opts.animation;
|
|
138
|
+
this.animationIn = this.$el.data('animationIn') ? this.$el.data('animationIn') : this.opts.animationIn;
|
|
139
|
+
this.animationOut = this.$el.data('animationOut') ? this.$el.data('animationOut') : this.opts.animationOut;
|
|
140
|
+
this.animationSpeed = this.$el.data('animationSpeed') ? this.$el.data('animationSpeed') : this.opts.animationSpeed;
|
|
141
|
+
this.offset = this.$el.data('offset') ? this.$el.data('offset') : this.opts.offset;
|
|
142
|
+
this.minWidth = this.$el.data('minWidth') ? this.$el.data('minWidth') : this.opts.minWidth;
|
|
143
|
+
this.template = this.$el.data('template') ? this.$el.data('template') : this.opts.template;
|
|
144
|
+
this.templateAttrs = this.$el.data('templateAttrs') ? this.$el.data('templateAttrs') : this.opts.templateAttrs;
|
|
145
|
+
this.scroll = this.$el.data('scroll') ? this.$el.data('scroll') : this.opts.scroll;
|
|
146
|
+
this.scrollContentHeight = this.$el.data('scrollContentHeight') ? this.$el.data('scrollContentHeight') : this.opts.scrollContentHeight;
|
|
147
|
+
this.closeOnItemClick = this.$el.data('closeOnItemClick') ? this.$el.data('closeOnItemClick') : this.opts.closeOnItemClick;
|
|
148
|
+
this.contentOpen = false;
|
|
149
|
+
|
|
150
|
+
if (this.$container.hasClass('dropup')) {
|
|
151
|
+
this.placement = 'top';
|
|
152
|
+
} else if (this.$container.hasClass('dropright')) {
|
|
153
|
+
this.placement = 'right';
|
|
154
|
+
} else if (this.$container.hasClass('dropbottom')) {
|
|
155
|
+
this.placement = 'bottom';
|
|
156
|
+
} else {
|
|
157
|
+
this.placement = 'left';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (typeof this.opts.template === 'function') {
|
|
161
|
+
let menuRight = this.opts.align === 'end' ? ' dropdown-menu-right' : '';
|
|
162
|
+
this.$dropdown = jQuery(`<div class="dropdown-menu${menuRight}" id="${this.id}">${this.template()}</div>`);
|
|
163
|
+
jQuery.when(this.$el.after(this.$dropdown)).then(() => {
|
|
164
|
+
this.$scrollableContent = this.$dropdown.find('.dropdown-scrollable-content') ? this.$dropdown.find('.dropdown-scrollable-content') : false;
|
|
165
|
+
this.$dropdown.hasClass('dropdown-menu-right') ? this.align = 'end' : this.align = 'start';
|
|
166
|
+
this.$dropdownItem = this.$dropdown.find('.dropdown-item');
|
|
167
|
+
|
|
168
|
+
if (this.minWidth) {
|
|
169
|
+
this.$dropdown.css('min-width', this.minWidth + 'px');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (this.opts.debug) {
|
|
173
|
+
this.debug(this.$el);
|
|
174
|
+
this.debug(this.$container);
|
|
175
|
+
this.debug(this.$dropdown);
|
|
176
|
+
this.debug(this.$scrollableContent);
|
|
177
|
+
this.debug('Id: ' + this.id);
|
|
178
|
+
this.debug('Animation: ' + this.animation);
|
|
179
|
+
this.debug('Animation in: ' + this.animationIn);
|
|
180
|
+
this.debug('Animation out: ' + this.animationOut);
|
|
181
|
+
this.debug('Animation speed: ' + this.animationSpeed);
|
|
182
|
+
this.debug('Offset: ' + this.offset);
|
|
183
|
+
this.debug('Min width: ' + this.minWidth);
|
|
184
|
+
this.debug('Template: ' + this.template);
|
|
185
|
+
this.debug(this.templateAttrs);
|
|
186
|
+
this.debug('Scroll: ' + this.scroll);
|
|
187
|
+
this.debug('Scroll content height: ' + this.scrollContentHeight + 'px');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return true;
|
|
191
|
+
});
|
|
192
|
+
} else {
|
|
193
|
+
this.$dropdown = this.$el.next('.dropdown-menu') ? this.$el.next('.dropdown-menu') : false;
|
|
194
|
+
this.$dropdown.hasClass('dropdown-menu-right') ? this.align = 'end' : this.align = 'start';
|
|
195
|
+
this.$scrollableContent = this.$dropdown.find('.dropdown-scrollable-content') ? this.$dropdown.find('.dropdown-scrollable-content') : false;
|
|
196
|
+
this.$dropdownItem = this.$dropdown.find('.dropdown-item');
|
|
197
|
+
|
|
198
|
+
if (this.minWidth) {
|
|
199
|
+
this.$dropdown.css('min-width', this.minWidth + 'px');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (this.opts.debug) {
|
|
203
|
+
this.debug(this.$el);
|
|
204
|
+
this.debug(this.$container);
|
|
205
|
+
this.debug(this.$dropdown);
|
|
206
|
+
this.debug(this.$scrollableContent);
|
|
207
|
+
this.debug('Id: ' + this.id);
|
|
208
|
+
this.debug('Animation: ' + this.animation);
|
|
209
|
+
this.debug('Animation in: ' + this.animationIn);
|
|
210
|
+
this.debug('Animation out: ' + this.animationOut);
|
|
211
|
+
this.debug('Animation speed: ' + this.animationSpeed);
|
|
212
|
+
this.debug('Offset: ' + this.offset);
|
|
213
|
+
this.debug('Min width: ' + this.minWidth);
|
|
214
|
+
this.debug('Template: ' + this.template);
|
|
215
|
+
this.debug(this.templateAttrs);
|
|
216
|
+
this.debug('Scroll: ' + this.scroll);
|
|
217
|
+
this.debug('Scroll content height: ' + this.scrollContentHeight + 'px');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
} // Build scroll
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
buildScroll() {
|
|
226
|
+
if (this.opts.scroll && this.$scrollableContent.length) {
|
|
227
|
+
this.$scrollableContent.css({
|
|
228
|
+
'max-height': this.scrollContentHeight + 'px'
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
if (touchEvents || typeof this.opts.buildScroll !== 'function') {
|
|
232
|
+
this.$scrollableContent.css({
|
|
233
|
+
'overflow-y': 'auto'
|
|
234
|
+
});
|
|
235
|
+
} else if (typeof this.opts.buildScroll === 'function') {
|
|
236
|
+
this.scroll = this.opts.buildScroll(this.$scrollableContent);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} // Bind events that trigger methods
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
bindEvents() {
|
|
243
|
+
var self = this;
|
|
244
|
+
this.$el.on('click' + '.' + NAME, () => {
|
|
245
|
+
if (this.contentOpen) {
|
|
246
|
+
this.close();
|
|
247
|
+
} else {
|
|
248
|
+
this.show();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
this.$dropdownItem.on('click' + '.' + NAME, function () {
|
|
252
|
+
if (self.closeOnItemClick) {
|
|
253
|
+
self.close();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
self.onItemClick(this);
|
|
257
|
+
});
|
|
258
|
+
jQuery(document).on('touchstart click', e => {
|
|
259
|
+
if (!this.$el.is(e.target) && !this.$dropdown.is(e.target) && this.$dropdown.has(e.target).length === 0 && this.contentOpen) {
|
|
260
|
+
this.close();
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
jQuery(window).on('resize', debounce(() => {
|
|
264
|
+
this.setPosition();
|
|
265
|
+
this.onUpdate();
|
|
266
|
+
}, 250));
|
|
267
|
+
} // Unbind events that trigger methods
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
unbindEvents() {
|
|
271
|
+
this.$el.off('.' + NAME);
|
|
272
|
+
} // Generate UUID
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
generateUUID() {
|
|
276
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
277
|
+
var r = Math.random() * 16 | 0,
|
|
278
|
+
v = c == 'x' ? r : r & 0x3 | 0x8;
|
|
279
|
+
return v.toString(16);
|
|
280
|
+
});
|
|
281
|
+
} // Set positions
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
setPosition(placement) {
|
|
285
|
+
if (typeof str === 'undefined' || str === null) {
|
|
286
|
+
placement = this.placement;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
var dropdownWidth = this.$dropdown.outerWidth(true);
|
|
290
|
+
var dropdownHeight = this.$dropdown.outerHeight(true);
|
|
291
|
+
var dropdownTriggerWidth = this.$el.outerWidth(true);
|
|
292
|
+
var dropdownTriggerHeight = this.$el.outerHeight(true);
|
|
293
|
+
var dropdownTriggerPosX = this.$el.position().left;
|
|
294
|
+
var dropdownTriggerPosY = this.$el.position().top;
|
|
295
|
+
|
|
296
|
+
if (placement === 'top') {
|
|
297
|
+
if (this.align === 'end') {
|
|
298
|
+
var dropdownPosX = dropdownTriggerWidth - dropdownWidth;
|
|
299
|
+
} else {
|
|
300
|
+
var dropdownPosX = dropdownTriggerPosX;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
var dropdownPosY = dropdownTriggerPosY - dropdownHeight;
|
|
304
|
+
} else if (placement === 'right') {
|
|
305
|
+
var dropdownPosX = dropdownTriggerPosX + dropdownTriggerWidth;
|
|
306
|
+
var dropdownPosY = dropdownTriggerPosY;
|
|
307
|
+
} else if (placement === 'bottom') {
|
|
308
|
+
if (this.align === 'end') {
|
|
309
|
+
var dropdownPosX = dropdownTriggerWidth - dropdownWidth;
|
|
310
|
+
} else {
|
|
311
|
+
var dropdownPosX = dropdownTriggerPosX;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
var dropdownPosY = dropdownTriggerPosY + dropdownTriggerHeight;
|
|
315
|
+
} else if (placement === 'left') {
|
|
316
|
+
var dropdownPosX = dropdownTriggerPosX - dropdownWidth;
|
|
317
|
+
var dropdownPosY = dropdownTriggerPosY;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (this.offset) {
|
|
321
|
+
var offsets = this.offset.split(',');
|
|
322
|
+
var offsetX = offsets[0];
|
|
323
|
+
var offsetY = offsets[1];
|
|
324
|
+
dropdownPosX += parseInt(offsetX, 10);
|
|
325
|
+
dropdownPosY += parseInt(offsetY, 10);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
this.$dropdown.css({
|
|
329
|
+
position: 'absolute',
|
|
330
|
+
top: '0px',
|
|
331
|
+
left: '0px',
|
|
332
|
+
transform: 'translate3d(' + Math.round(dropdownPosX) + 'px, ' + Math.round(dropdownPosY) + 'px, 0px)',
|
|
333
|
+
'will-change': 'transform'
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
if (this.opts.debug) {
|
|
337
|
+
this.debug('Dropdown trigger width: ' + dropdownTriggerWidth + 'px');
|
|
338
|
+
this.debug('Dropdown trigger height: ' + dropdownTriggerHeight + 'px');
|
|
339
|
+
this.debug('Dropdown trigger position x: ' + dropdownTriggerPosX + 'px');
|
|
340
|
+
this.debug('Dropdown trigger position Y: ' + dropdownTriggerPosY + 'px');
|
|
341
|
+
this.debug('Dropdown width: ' + dropdownWidth + 'px');
|
|
342
|
+
this.debug('Dropdown height: ' + dropdownHeight + 'px');
|
|
343
|
+
this.debug('Dropdown position x: ' + dropdownPosX + 'px');
|
|
344
|
+
this.debug('Dropdown position y: ' + dropdownPosY + 'px');
|
|
345
|
+
}
|
|
346
|
+
} // Show
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
show() {
|
|
350
|
+
if (!this.$dropdown || this.$dropdown.hasClass('show')) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
this.setPosition();
|
|
355
|
+
|
|
356
|
+
if (this.animation) {
|
|
357
|
+
this.$dropdown.attr('x-placement', this.placement + '-' + this.align);
|
|
358
|
+
this.$dropdown.addClass(this.animationSpeed);
|
|
359
|
+
this.$dropdown.animateCss(this.animationIn);
|
|
360
|
+
this.$dropdown.addClass('show');
|
|
361
|
+
this.$dropdown.attr('id', this.id);
|
|
362
|
+
this.$el.attr('data-dropdown', this.id);
|
|
363
|
+
} else {
|
|
364
|
+
this.$dropdown.attr('x-placement', this.placement + '-' + this.align);
|
|
365
|
+
this.$dropdown.addClass('show');
|
|
366
|
+
this.$dropdown.attr('id', this.id);
|
|
367
|
+
this.$el.attr('data-dropdown', this.id);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (this.scroll && typeof this.scroll.show === 'function') {
|
|
371
|
+
this.scroll.update();
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
this.contentOpen = true;
|
|
375
|
+
this.onShow();
|
|
376
|
+
} // Close
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
close() {
|
|
380
|
+
if (!this.$dropdown) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (this.animation && !this.$dropdown.hasClass('animated')) {
|
|
385
|
+
this.$dropdown.animateCss(this.animationOut, () => {
|
|
386
|
+
this.$dropdown.removeClass('show');
|
|
387
|
+
this.$el.removeAttr('data-dropdown');
|
|
388
|
+
});
|
|
389
|
+
} else {
|
|
390
|
+
this.$dropdown.removeClass('show');
|
|
391
|
+
this.$el.removeAttr('data-dropdown');
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
this.contentOpen = false;
|
|
395
|
+
this.onClose();
|
|
396
|
+
} // Item callback
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
onItemClick(el) {
|
|
400
|
+
var onItemClick = this.opts.onItemClick;
|
|
401
|
+
|
|
402
|
+
if (typeof onItemClick === 'function') {
|
|
403
|
+
onItemClick.call(el);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
static _jQueryInterface(config) {
|
|
408
|
+
return this.each(function () {
|
|
409
|
+
let data = jQuery(this).data(DATA_KEY);
|
|
410
|
+
|
|
411
|
+
const _config = typeof config === 'object' && config;
|
|
412
|
+
|
|
413
|
+
if (!data) {
|
|
414
|
+
data = new CoolDropdown(this, _config);
|
|
415
|
+
jQuery(this).data(DATA_KEY, data);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (typeof config === 'string') {
|
|
419
|
+
if (typeof data[config] === 'undefined') {
|
|
420
|
+
throw new TypeError(`No method named "${config}"`);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
data[config]();
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
if (typeof jQuery !== 'undefined') {
|
|
431
|
+
// jQuery
|
|
432
|
+
const JQUERY_NO_CONFLICT = jQuery.fn[NAME];
|
|
433
|
+
jQuery.fn[NAME] = CoolDropdown._jQueryInterface;
|
|
434
|
+
jQuery.fn[NAME].Constructor = CoolDropdown;
|
|
435
|
+
|
|
436
|
+
jQuery.fn[NAME].noConflict = () => {
|
|
437
|
+
jQuery.fn[NAME] = JQUERY_NO_CONFLICT;
|
|
438
|
+
return CoolDropdown._jQueryInterface;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
jQuery.fn[NAME].defaults = {
|
|
442
|
+
animation: true,
|
|
443
|
+
animationIn: 'zoomIn',
|
|
444
|
+
animationOut: 'zoomOut',
|
|
445
|
+
animationSpeed: 'fastest',
|
|
446
|
+
offset: null,
|
|
447
|
+
minWidth: null,
|
|
448
|
+
align: 'start',
|
|
449
|
+
closeOnItemClick: true,
|
|
450
|
+
template: false,
|
|
451
|
+
templateAttrs: {},
|
|
452
|
+
scroll: true,
|
|
453
|
+
scrollContentHeight: 100,
|
|
454
|
+
onCreate: null,
|
|
455
|
+
onUpdate: null,
|
|
456
|
+
onDestroy: null,
|
|
457
|
+
onShow: null,
|
|
458
|
+
onClose: null,
|
|
459
|
+
onItemClick: null,
|
|
460
|
+
debug: false
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return CoolDropdown;
|
|
465
|
+
|
|
466
|
+
}));
|
|
467
|
+
//# sourceMappingURL=cooldropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cooldropdown.js","sources":["../src/util/index.js","../src/abstract-ui-component.js","../src/dropdown.js"],"sourcesContent":["const { jQuery } = window;\n\nconst debounce = function (func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n};\n\nconst isArrayLike = function(collection) {\n\tvar length = getLength(collection);\n\treturn typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n};\n\nconst optimizeCb = function(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n};\n\nconst each = function(obj, iteratee, context) {\n\titeratee = optimizeCb(iteratee, context);\n\tvar i, length;\n\tif (isArrayLike(obj)) {\n\t\tfor (i = 0, length = obj.length; i < length; i++) {\n\t\t\titeratee(obj[i], i, obj);\n\t\t}\n\t} else {\n\t\tvar keys = _.keys(obj);\n\t\tfor (i = 0, length = keys.length; i < length; i++) {\n\t\t\titeratee(obj[keys[i]], keys[i], obj);\n\t\t}\n\t}\n\treturn obj;\n};\n\nconst touchEvents = function () {\n\tif (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {\n\t\treturn true;\n\t}\n};\n\nexport {\n\tjQuery,\n\tdebounce,\n\ttouchEvents,\n\teach\n}","export default class AbstractUIComponent {\n\t// Create callback\n onCreate() {\n\n var onCreate = this.opts.onCreate;\n\n if (typeof onCreate === 'function') {\n\n onCreate.call(this.el);\n }\n }\n\n // Update callback\n onUpdate() {\n\n var onUpdate = this.opts.onUpdate;\n\n if (typeof onUpdate === 'function') {\n\n onUpdate.call(this.el);\n }\n }\n\n // Destroy callback\n onDestroy() {\n\n var onDestroy = this.opts.onDestroy;\n\n if (typeof onDestroy === 'function') {\n\n onDestroy.call(this.el);\n }\n }\n\n // Show callback\n onShow() {\n\n var onShow = this.opts.onShow;\n\n if (typeof onShow === 'function') {\n\n onShow.call(this.el);\n }\n }\n\n // Close callback\n onClose() {\n\n var onClose = this.opts.onClose;\n\n if (typeof onClose === 'function') {\n\n onClose.call(this.el);\n }\n }\n\n debug(...args) {\n \tif (this.opts.debug) {\n if (typeof this.opts.debug === 'function') {\n this.opts.debug(...args);\n } else {\n \t \tconsole.log(...args);\n }\n \t}\n }\n}","import { jQuery as $, debounce, touchEvents } from './util/index';\nimport AbstractUIComponent from './abstract-ui-component';\n\nconst NAME = 'coolDropdown';\nconst DATA_KEY = 'plugin_coolDropdown';\n\nclass CoolDropdown extends AbstractUIComponent {\n constructor(el, opts) {\n super();\n\n this.el = el;\n this.opts = $.extend({}, $.fn[NAME].defaults, opts);\n this.init();\n }\n\n // Init plugin\n init() {\n $.when(this.buildCache()).then(() => {\n this.buildScroll();\n this.bindEvents();\n this.onCreate();\n });\n }\n\n // Remove plugin instance completely\n destroy() {\n this.unbindEvents();\n this.$el.removeData();\n this.onDestroy();\n }\n\n // Update plugin data\n update() {\n this.buildCache();\n this.onUpdate();\n }\n\n // Cache DOM nodes for performance\n buildCache() {\n this.$el = $(this.el);\n this.$el.addClass('dropdown-trigger');\n this.$container = this.$el.parent('.dropdown');\n this.id = 'dropdown-'+this.generateUUID();\n this.animation = this.$el.data('animation') ? this.$el.data('animation') : this.opts.animation;\n this.animationIn = this.$el.data('animationIn') ? this.$el.data('animationIn') : this.opts.animationIn;\n this.animationOut = this.$el.data('animationOut') ? this.$el.data('animationOut') : this.opts.animationOut;\n this.animationSpeed = this.$el.data('animationSpeed') ? this.$el.data('animationSpeed') : this.opts.animationSpeed;\n this.offset = this.$el.data('offset') ? this.$el.data('offset') : this.opts.offset;\n this.minWidth = this.$el.data('minWidth') ? this.$el.data('minWidth') : this.opts.minWidth;\n this.template = this.$el.data('template') ? this.$el.data('template') : this.opts.template;\n this.templateAttrs = this.$el.data('templateAttrs') ? this.$el.data('templateAttrs') : this.opts.templateAttrs;\n this.scroll = this.$el.data('scroll') ? this.$el.data('scroll') : this.opts.scroll;\n this.scrollContentHeight = this.$el.data('scrollContentHeight') ? this.$el.data('scrollContentHeight') : this.opts.scrollContentHeight;\n this.closeOnItemClick = this.$el.data('closeOnItemClick') ? this.$el.data('closeOnItemClick') : this.opts.closeOnItemClick;\n this.contentOpen = false;\n\n if (this.$container.hasClass('dropup')) {\n this.placement = 'top';\n } else if (this.$container.hasClass('dropright')) {\n this.placement = 'right';\n } else if (this.$container.hasClass('dropbottom')) {\n this.placement = 'bottom';\n } else {\n this.placement = 'left';\n }\n\n if (typeof this.opts.template === 'function') {\n let menuRight = this.opts.align === 'end' ? ' dropdown-menu-right' : '';\n\n this.$dropdown = $(`<div class=\"dropdown-menu${menuRight}\" id=\"${this.id}\">${this.template()}</div>`);\n\n $.when(this.$el.after(this.$dropdown)).then(() => {\n\n this.$scrollableContent = this.$dropdown.find('.dropdown-scrollable-content') ? this.$dropdown.find('.dropdown-scrollable-content') : false;\n this.$dropdown.hasClass('dropdown-menu-right') ? this.align = 'end' : this.align = 'start';\n this.$dropdownItem = this.$dropdown.find('.dropdown-item');\n\n if (this.minWidth) {\n this.$dropdown.css('min-width', this.minWidth+'px');\n }\n\n if (this.opts.debug) {\n this.debug(this.$el);\n this.debug(this.$container);\n this.debug(this.$dropdown);\n this.debug(this.$scrollableContent);\n this.debug('Id: '+this.id);\n this.debug('Animation: '+this.animation);\n this.debug('Animation in: '+this.animationIn);\n this.debug('Animation out: '+this.animationOut);\n this.debug('Animation speed: '+this.animationSpeed);\n this.debug('Offset: '+this.offset);\n this.debug('Min width: '+this.minWidth);\n this.debug('Template: '+this.template);\n this.debug(this.templateAttrs);\n this.debug('Scroll: '+this.scroll);\n this.debug('Scroll content height: '+this.scrollContentHeight+'px');\n }\n\n return true;\n });\n } else {\n this.$dropdown = this.$el.next('.dropdown-menu') ? this.$el.next('.dropdown-menu') : false;\n this.$dropdown.hasClass('dropdown-menu-right') ? this.align = 'end' : this.align = 'start';\n this.$scrollableContent = this.$dropdown.find('.dropdown-scrollable-content') ? this.$dropdown.find('.dropdown-scrollable-content') : false;\n this.$dropdownItem = this.$dropdown.find('.dropdown-item');\n\n if (this.minWidth) {\n this.$dropdown.css('min-width', this.minWidth+'px');\n }\n\n if (this.opts.debug) {\n this.debug(this.$el);\n this.debug(this.$container);\n this.debug(this.$dropdown);\n this.debug(this.$scrollableContent);\n this.debug('Id: '+this.id);\n this.debug('Animation: '+this.animation);\n this.debug('Animation in: '+this.animationIn);\n this.debug('Animation out: '+this.animationOut);\n this.debug('Animation speed: '+this.animationSpeed);\n this.debug('Offset: '+this.offset);\n this.debug('Min width: '+this.minWidth);\n this.debug('Template: '+this.template);\n this.debug(this.templateAttrs);\n this.debug('Scroll: '+this.scroll);\n this.debug('Scroll content height: '+this.scrollContentHeight+'px');\n }\n\n return true;\n }\n }\n\n // Build scroll\n buildScroll() {\n\n if (this.opts.scroll && this.$scrollableContent.length) {\n\n this.$scrollableContent.css({\n 'max-height': this.scrollContentHeight+'px'\n });\n\n if (touchEvents || typeof this.opts.buildScroll !== 'function') {\n this.$scrollableContent.css({\n 'overflow-y': 'auto'\n });\n } else if (typeof this.opts.buildScroll === 'function') {\n this.scroll = this.opts.buildScroll(this.$scrollableContent);\n }\n }\n }\n\n // Bind events that trigger methods\n bindEvents() {\n var self = this;\n\n this.$el.on('click'+'.'+NAME, () => {\n if (this.contentOpen) {\n this.close();\n } else {\n this.show();\n }\n });\n\n this.$dropdownItem.on('click'+'.'+NAME, function() {\n\n if (self.closeOnItemClick) {\n self.close();\n }\n\n self.onItemClick(this);\n });\n\n $(document).on('touchstart click', (e) => {\n if (!this.$el.is(e.target) && !this.$dropdown.is(e.target) && this.$dropdown.has(e.target).length === 0 && this.contentOpen) {\n this.close();\n }\n });\n\n $(window).on('resize', debounce(() => {\n this.setPosition();\n this.onUpdate();\n }, 250));\n }\n\n // Unbind events that trigger methods\n unbindEvents() {\n\n this.$el.off('.'+NAME);\n }\n\n // Generate UUID\n generateUUID() {\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n // Set positions\n setPosition(placement) {\n\n if (typeof str === 'undefined' || str === null) {\n placement = this.placement;\n }\n\n var dropdownWidth = this.$dropdown.outerWidth(true);\n var dropdownHeight = this.$dropdown.outerHeight(true);\n var dropdownTriggerWidth = this.$el.outerWidth(true);\n var dropdownTriggerHeight = this.$el.outerHeight(true);\n var dropdownTriggerPosX = this.$el.position().left;\n var dropdownTriggerPosY = this.$el.position().top;\n\n if (placement === 'top') {\n\n if (this.align === 'end') {\n var dropdownPosX = dropdownTriggerWidth - dropdownWidth;\n } else {\n var dropdownPosX = dropdownTriggerPosX;\n }\n\n var dropdownPosY = dropdownTriggerPosY - dropdownHeight;\n\n } else if (placement === 'right') {\n\n var dropdownPosX = dropdownTriggerPosX + dropdownTriggerWidth;\n var dropdownPosY = dropdownTriggerPosY;\n\n } else if (placement === 'bottom') {\n\n if (this.align === 'end') {\n var dropdownPosX = dropdownTriggerWidth - dropdownWidth;\n } else {\n var dropdownPosX = dropdownTriggerPosX;\n }\n\n var dropdownPosY = dropdownTriggerPosY + dropdownTriggerHeight;\n\n } else if (placement === 'left') {\n\n var dropdownPosX = dropdownTriggerPosX - dropdownWidth;\n var dropdownPosY = dropdownTriggerPosY;\n }\n\n if (this.offset) {\n\n var offsets = this.offset.split(',')\n var offsetX = offsets[0];\n var offsetY = offsets[1];\n\n dropdownPosX += parseInt(offsetX, 10);\n dropdownPosY += parseInt(offsetY, 10);\n }\n\n this.$dropdown.css({\n position: 'absolute',\n top: '0px',\n left: '0px',\n transform: 'translate3d('+Math.round(dropdownPosX)+'px, '+Math.round(dropdownPosY)+'px, 0px)',\n 'will-change': 'transform'\n });\n\n if (this.opts.debug) {\n this.debug('Dropdown trigger width: '+dropdownTriggerWidth+'px');\n this.debug('Dropdown trigger height: '+dropdownTriggerHeight+'px');\n this.debug('Dropdown trigger position x: '+dropdownTriggerPosX+'px');\n this.debug('Dropdown trigger position Y: '+dropdownTriggerPosY+'px');\n this.debug('Dropdown width: '+dropdownWidth+'px');\n this.debug('Dropdown height: '+dropdownHeight+'px');\n this.debug('Dropdown position x: '+dropdownPosX+'px');\n this.debug('Dropdown position y: '+dropdownPosY+'px');\n }\n }\n\n // Show\n show() {\n\n if (!this.$dropdown || this.$dropdown.hasClass('show')) {\n return;\n }\n\n this.setPosition();\n\n if (this.animation) {\n\n this.$dropdown.attr('x-placement', this.placement+'-'+this.align);\n this.$dropdown.addClass(this.animationSpeed);\n this.$dropdown.animateCss(this.animationIn);\n this.$dropdown.addClass('show');\n this.$dropdown.attr('id', this.id);\n this.$el.attr('data-dropdown', this.id);\n\n } else {\n\n this.$dropdown.attr('x-placement', this.placement+'-'+this.align);\n this.$dropdown.addClass('show');\n this.$dropdown.attr('id', this.id);\n this.$el.attr('data-dropdown', this.id);\n }\n\n\n if (this.scroll && typeof this.scroll.show === 'function') {\n this.scroll.update();\n }\n\n this.contentOpen = true;\n this.onShow();\n }\n\n // Close\n close() {\n if (!this.$dropdown) {\n return;\n }\n\n if (this.animation && !this.$dropdown.hasClass('animated')) {\n\n this.$dropdown.animateCss(this.animationOut, () => {\n this.$dropdown.removeClass('show');\n this.$el.removeAttr('data-dropdown');\n });\n\n } else {\n\n this.$dropdown.removeClass('show');\n this.$el.removeAttr('data-dropdown');\n }\n\n this.contentOpen = false;\n this.onClose();\n }\n\n // Item callback\n onItemClick(el) {\n\n var onItemClick = this.opts.onItemClick;\n\n if (typeof onItemClick === 'function') {\n\n onItemClick.call(el);\n }\n }\n\n static _jQueryInterface(config) {\n return this.each(function() {\n let data = $(this).data(DATA_KEY);\n const _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new CoolDropdown(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n });\n }\n}\n\nif (typeof $ !== 'undefined') {\n // jQuery\n const JQUERY_NO_CONFLICT = $.fn[NAME];\n $.fn[NAME] = CoolDropdown._jQueryInterface;\n $.fn[NAME].Constructor = CoolDropdown;\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return CoolDropdown._jQueryInterface\n }\n\n $.fn[NAME].defaults = {\n animation: true,\n animationIn: 'zoomIn',\n animationOut: 'zoomOut',\n animationSpeed: 'fastest',\n offset: null,\n minWidth: null,\n align: 'start',\n closeOnItemClick: true,\n template: false,\n templateAttrs: {},\n scroll: true,\n scrollContentHeight: 100,\n onCreate: null,\n onUpdate: null,\n onDestroy: null,\n onShow: null,\n onClose: null,\n onItemClick: null,\n debug: false\n };\n}\n\nexport default CoolDropdown;"],"names":["jQuery","window","debounce","func","wait","immediate","timeout","context","args","arguments","later","apply","callNow","clearTimeout","setTimeout","touchEvents","DocumentTouch","document","AbstractUIComponent","onCreate","opts","call","el","onUpdate","onDestroy","onShow","onClose","debug","console","log","NAME","DATA_KEY","CoolDropdown","constructor","$","extend","fn","defaults","init","when","buildCache","then","buildScroll","bindEvents","destroy","unbindEvents","$el","removeData","update","addClass","$container","parent","id","generateUUID","animation","data","animationIn","animationOut","animationSpeed","offset","minWidth","template","templateAttrs","scroll","scrollContentHeight","closeOnItemClick","contentOpen","hasClass","placement","menuRight","align","$dropdown","after","$scrollableContent","find","$dropdownItem","css","next","length","self","on","close","show","onItemClick","e","is","target","has","setPosition","off","replace","c","r","Math","random","v","toString","str","dropdownWidth","outerWidth","dropdownHeight","outerHeight","dropdownTriggerWidth","dropdownTriggerHeight","dropdownTriggerPosX","position","left","dropdownTriggerPosY","top","dropdownPosX","dropdownPosY","offsets","split","offsetX","offsetY","parseInt","transform","round","attr","animateCss","removeClass","removeAttr","_jQueryInterface","config","each","_config","TypeError","JQUERY_NO_CONFLICT","Constructor","noConflict"],"mappings":";;;;;;;;;;;CAAA,MAAM;CAAEA,EAAAA;CAAF,IAAaC,MAAnB;;CAEA,MAAMC,QAAQ,GAAG,UAAUC,IAAV,EAAgBC,IAAhB,EAAsBC,SAAtB,EAAiC;CACjD,MAAIC,OAAJ;CACA,SAAO,YAAW;CACjB,QAAIC,OAAO,GAAG,IAAd;CAAA,QAAoBC,IAAI,GAAGC,SAA3B;;CACA,QAAIC,KAAK,GAAG,YAAW;CACtBJ,MAAAA,OAAO,GAAG,IAAV;CACA,UAAI,CAACD,SAAL,EAAgBF,IAAI,CAACQ,KAAL,CAAWJ,OAAX,EAAoBC,IAApB;CAChB,KAHD;;CAIA,QAAII,OAAO,GAAGP,SAAS,IAAI,CAACC,OAA5B;CACAO,IAAAA,YAAY,CAACP,OAAD,CAAZ;CACAA,IAAAA,OAAO,GAAGQ,UAAU,CAACJ,KAAD,EAAQN,IAAR,CAApB;CACA,QAAIQ,OAAJ,EAAaT,IAAI,CAACQ,KAAL,CAAWJ,OAAX,EAAoBC,IAApB;CACb,GAVD;CAWA,CAbD;;CAuDA,MAAMO,WAAW,GAAG,YAAY;CAC/B,MAAK,kBAAkBd,MAAnB,IAA8BA,MAAM,CAACe,aAAP,IAAwBC,QAAQ,YAAYD,aAA9E,EA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