loremGem 0.2.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.
Files changed (158) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +14 -0
  3. data/.gitignore +24 -0
  4. data/.travis.yml +17 -0
  5. data/CHANGELOG.md +37 -0
  6. data/CODE_OF_CONDUCT.md +49 -0
  7. data/Gemfile +12 -0
  8. data/LICENSE Bootstrap +21 -0
  9. data/LICENSE Lorem.txt +21 -0
  10. data/README.md +35 -0
  11. data/Rakefile +80 -0
  12. data/assets/javascript/bootstrap/alert.js +177 -0
  13. data/assets/javascript/bootstrap/button.js +166 -0
  14. data/assets/javascript/bootstrap/carousel.js +507 -0
  15. data/assets/javascript/bootstrap/collapse.js +366 -0
  16. data/assets/javascript/bootstrap/dropdown.js +488 -0
  17. data/assets/javascript/bootstrap/modal.js +584 -0
  18. data/assets/javascript/bootstrap/popover.js +205 -0
  19. data/assets/javascript/bootstrap/scrollspy.js +318 -0
  20. data/assets/javascript/bootstrap/tab.js +250 -0
  21. data/assets/javascript/bootstrap/tooltip.js +673 -0
  22. data/assets/javascript/bootstrap/util.js +131 -0
  23. data/assets/javascript/bootstrap-sprockets.js +11 -0
  24. data/assets/javascript/bootstrap.js +3926 -0
  25. data/assets/javascript/bootstrap.min.js +6 -0
  26. data/assets/javascript/lorem.js +24044 -0
  27. data/assets/stylesheets/_bootstrap-grid.scss +32 -0
  28. data/assets/stylesheets/_bootstrap-reboot.scss +12 -0
  29. data/assets/stylesheets/_bootstrap.scss +42 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +51 -0
  31. data/assets/stylesheets/bootstrap/_badge.scss +47 -0
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +41 -0
  33. data/assets/stylesheets/bootstrap/_button-group.scss +172 -0
  34. data/assets/stylesheets/bootstrap/_buttons.scss +144 -0
  35. data/assets/stylesheets/bootstrap/_card.scss +301 -0
  36. data/assets/stylesheets/bootstrap/_carousel.scss +236 -0
  37. data/assets/stylesheets/bootstrap/_close.scss +34 -0
  38. data/assets/stylesheets/bootstrap/_code.scss +48 -0
  39. data/assets/stylesheets/bootstrap/_custom-forms.scss +421 -0
  40. data/assets/stylesheets/bootstrap/_dropdown.scss +166 -0
  41. data/assets/stylesheets/bootstrap/_forms.scss +335 -0
  42. data/assets/stylesheets/bootstrap/_functions.scss +86 -0
  43. data/assets/stylesheets/bootstrap/_grid.scss +52 -0
  44. data/assets/stylesheets/bootstrap/_images.scss +42 -0
  45. data/assets/stylesheets/bootstrap/_input-group.scss +158 -0
  46. data/assets/stylesheets/bootstrap/_jumbotron.scss +16 -0
  47. data/assets/stylesheets/bootstrap/_list-group.scss +115 -0
  48. data/assets/stylesheets/bootstrap/_media.scss +8 -0
  49. data/assets/stylesheets/bootstrap/_mixins.scss +41 -0
  50. data/assets/stylesheets/bootstrap/_modal.scss +168 -0
  51. data/assets/stylesheets/bootstrap/_nav.scss +118 -0
  52. data/assets/stylesheets/bootstrap/_navbar.scss +299 -0
  53. data/assets/stylesheets/bootstrap/_pagination.scss +78 -0
  54. data/assets/stylesheets/bootstrap/_popover.scss +183 -0
  55. data/assets/stylesheets/bootstrap/_print.scss +141 -0
  56. data/assets/stylesheets/bootstrap/_progress.scss +34 -0
  57. data/assets/stylesheets/bootstrap/_reboot.scss +480 -0
  58. data/assets/stylesheets/bootstrap/_root.scss +19 -0
  59. data/assets/stylesheets/bootstrap/_tables.scss +188 -0
  60. data/assets/stylesheets/bootstrap/_tooltip.scss +115 -0
  61. data/assets/stylesheets/bootstrap/_transitions.scss +22 -0
  62. data/assets/stylesheets/bootstrap/_type.scss +125 -0
  63. data/assets/stylesheets/bootstrap/_utilities.scss +15 -0
  64. data/assets/stylesheets/bootstrap/_variables.scss +929 -0
  65. data/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
  66. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +21 -0
  67. data/assets/stylesheets/bootstrap/mixins/_badge.scss +12 -0
  68. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +35 -0
  69. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
  70. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
  71. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +109 -0
  72. data/assets/stylesheets/bootstrap/mixins/_caret.scss +66 -0
  73. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +7 -0
  74. data/assets/stylesheets/bootstrap/mixins/_float.scss +11 -0
  75. data/assets/stylesheets/bootstrap/mixins/_forms.scss +147 -0
  76. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +45 -0
  77. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +67 -0
  78. data/assets/stylesheets/bootstrap/mixins/_grid.scss +52 -0
  79. data/assets/stylesheets/bootstrap/mixins/_hover.scss +37 -0
  80. data/assets/stylesheets/bootstrap/mixins/_image.scss +36 -0
  81. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +21 -0
  82. data/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
  83. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  84. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +22 -0
  85. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
  86. data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  87. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +33 -0
  88. data/assets/stylesheets/bootstrap/mixins/_size.scss +6 -0
  89. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +30 -0
  90. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +14 -0
  91. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +13 -0
  92. data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +8 -0
  93. data/assets/stylesheets/bootstrap/mixins/_transition.scss +13 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +7 -0
  95. data/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
  96. data/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
  97. data/assets/stylesheets/bootstrap/utilities/_borders.scss +59 -0
  98. data/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
  99. data/assets/stylesheets/bootstrap/utilities/_display.scss +38 -0
  100. data/assets/stylesheets/bootstrap/utilities/_embed.scss +52 -0
  101. data/assets/stylesheets/bootstrap/utilities/_flex.scss +51 -0
  102. data/assets/stylesheets/bootstrap/utilities/_float.scss +9 -0
  103. data/assets/stylesheets/bootstrap/utilities/_position.scss +37 -0
  104. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
  105. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +6 -0
  106. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +12 -0
  107. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +51 -0
  108. data/assets/stylesheets/bootstrap/utilities/_text.scss +58 -0
  109. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +11 -0
  110. data/assets/stylesheets/lorem.css +23980 -0
  111. data/bin/console +14 -0
  112. data/bin/setup +8 -0
  113. data/lib/loremGem/engine.rb +12 -0
  114. data/lib/loremGem/version.rb +4 -0
  115. data/lib/loremGem.rb +74 -0
  116. data/loremGem.gemspec +50 -0
  117. data/tasks/updater/js.rb +68 -0
  118. data/tasks/updater/logger.rb +57 -0
  119. data/tasks/updater/network.rb +103 -0
  120. data/tasks/updater/scss.rb +26 -0
  121. data/tasks/updater.rb +67 -0
  122. data/test/dummy_rails/README.rdoc +3 -0
  123. data/test/dummy_rails/Rakefile +6 -0
  124. data/test/dummy_rails/app/assets/images/.keep +0 -0
  125. data/test/dummy_rails/app/assets/javascripts/application.js +7 -0
  126. data/test/dummy_rails/app/assets/stylesheets/application.sass +4 -0
  127. data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
  128. data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
  129. data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
  130. data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
  131. data/test/dummy_rails/app/views/pages/root.html.slim +58 -0
  132. data/test/dummy_rails/config/application.rb +34 -0
  133. data/test/dummy_rails/config/boot.rb +5 -0
  134. data/test/dummy_rails/config/environment.rb +5 -0
  135. data/test/dummy_rails/config/environments/development.rb +23 -0
  136. data/test/dummy_rails/config/environments/production.rb +82 -0
  137. data/test/dummy_rails/config/environments/test.rb +38 -0
  138. data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
  139. data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
  140. data/test/dummy_rails/config/initializers/inflections.rb +16 -0
  141. data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
  142. data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
  143. data/test/dummy_rails/config/initializers/session_store.rb +3 -0
  144. data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
  145. data/test/dummy_rails/config/locales/en.yml +3 -0
  146. data/test/dummy_rails/config/locales/es.yml +3 -0
  147. data/test/dummy_rails/config/routes.rb +3 -0
  148. data/test/dummy_rails/config.ru +4 -0
  149. data/test/dummy_rails/log/.keep +0 -0
  150. data/test/gemfiles/rails_4_2.gemfile +7 -0
  151. data/test/gemfiles/rails_5_0.gemfile +8 -0
  152. data/test/gemfiles/rails_5_1.gemfile +8 -0
  153. data/test/rails_test.rb +24 -0
  154. data/test/support/dummy_rails_integration.rb +29 -0
  155. data/test/support/reporting.rb +27 -0
  156. data/test/test_helper.rb +35 -0
  157. data/test/test_helper_rails.rb +6 -0
  158. metadata +480 -0
@@ -0,0 +1,673 @@
1
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
2
+
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
+
9
+ /**
10
+ * --------------------------------------------------------------------------
11
+ * Bootstrap (v4.1.1): tooltip.js
12
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
13
+ * --------------------------------------------------------------------------
14
+ */
15
+ var Tooltip = function ($) {
16
+ /**
17
+ * ------------------------------------------------------------------------
18
+ * Constants
19
+ * ------------------------------------------------------------------------
20
+ */
21
+ var NAME = 'tooltip';
22
+ var VERSION = '4.1.1';
23
+ var DATA_KEY = 'bs.tooltip';
24
+ var EVENT_KEY = "." + DATA_KEY;
25
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
26
+ var CLASS_PREFIX = 'bs-tooltip';
27
+ var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
28
+ var DefaultType = {
29
+ animation: 'boolean',
30
+ template: 'string',
31
+ title: '(string|element|function)',
32
+ trigger: 'string',
33
+ delay: '(number|object)',
34
+ html: 'boolean',
35
+ selector: '(string|boolean)',
36
+ placement: '(string|function)',
37
+ offset: '(number|string)',
38
+ container: '(string|element|boolean)',
39
+ fallbackPlacement: '(string|array)',
40
+ boundary: '(string|element)'
41
+ };
42
+ var AttachmentMap = {
43
+ AUTO: 'auto',
44
+ TOP: 'top',
45
+ RIGHT: 'right',
46
+ BOTTOM: 'bottom',
47
+ LEFT: 'left'
48
+ };
49
+ var Default = {
50
+ animation: true,
51
+ template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
52
+ trigger: 'hover focus',
53
+ title: '',
54
+ delay: 0,
55
+ html: false,
56
+ selector: false,
57
+ placement: 'top',
58
+ offset: 0,
59
+ container: false,
60
+ fallbackPlacement: 'flip',
61
+ boundary: 'scrollParent'
62
+ };
63
+ var HoverState = {
64
+ SHOW: 'show',
65
+ OUT: 'out'
66
+ };
67
+ var Event = {
68
+ HIDE: "hide" + EVENT_KEY,
69
+ HIDDEN: "hidden" + EVENT_KEY,
70
+ SHOW: "show" + EVENT_KEY,
71
+ SHOWN: "shown" + EVENT_KEY,
72
+ INSERTED: "inserted" + EVENT_KEY,
73
+ CLICK: "click" + EVENT_KEY,
74
+ FOCUSIN: "focusin" + EVENT_KEY,
75
+ FOCUSOUT: "focusout" + EVENT_KEY,
76
+ MOUSEENTER: "mouseenter" + EVENT_KEY,
77
+ MOUSELEAVE: "mouseleave" + EVENT_KEY
78
+ };
79
+ var ClassName = {
80
+ FADE: 'fade',
81
+ SHOW: 'show'
82
+ };
83
+ var Selector = {
84
+ TOOLTIP: '.tooltip',
85
+ TOOLTIP_INNER: '.tooltip-inner',
86
+ ARROW: '.arrow'
87
+ };
88
+ var Trigger = {
89
+ HOVER: 'hover',
90
+ FOCUS: 'focus',
91
+ CLICK: 'click',
92
+ MANUAL: 'manual'
93
+ /**
94
+ * ------------------------------------------------------------------------
95
+ * Class Definition
96
+ * ------------------------------------------------------------------------
97
+ */
98
+
99
+ };
100
+
101
+ var Tooltip =
102
+ /*#__PURE__*/
103
+ function () {
104
+ function Tooltip(element, config) {
105
+ /**
106
+ * Check for Popper dependency
107
+ * Popper - https://popper.js.org
108
+ */
109
+ if (typeof Popper === 'undefined') {
110
+ throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
111
+ } // private
112
+
113
+
114
+ this._isEnabled = true;
115
+ this._timeout = 0;
116
+ this._hoverState = '';
117
+ this._activeTrigger = {};
118
+ this._popper = null; // Protected
119
+
120
+ this.element = element;
121
+ this.config = this._getConfig(config);
122
+ this.tip = null;
123
+
124
+ this._setListeners();
125
+ } // Getters
126
+
127
+
128
+ var _proto = Tooltip.prototype;
129
+
130
+ // Public
131
+ _proto.enable = function enable() {
132
+ this._isEnabled = true;
133
+ };
134
+
135
+ _proto.disable = function disable() {
136
+ this._isEnabled = false;
137
+ };
138
+
139
+ _proto.toggleEnabled = function toggleEnabled() {
140
+ this._isEnabled = !this._isEnabled;
141
+ };
142
+
143
+ _proto.toggle = function toggle(event) {
144
+ if (!this._isEnabled) {
145
+ return;
146
+ }
147
+
148
+ if (event) {
149
+ var dataKey = this.constructor.DATA_KEY;
150
+ var context = $(event.currentTarget).data(dataKey);
151
+
152
+ if (!context) {
153
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
154
+ $(event.currentTarget).data(dataKey, context);
155
+ }
156
+
157
+ context._activeTrigger.click = !context._activeTrigger.click;
158
+
159
+ if (context._isWithActiveTrigger()) {
160
+ context._enter(null, context);
161
+ } else {
162
+ context._leave(null, context);
163
+ }
164
+ } else {
165
+ if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
166
+ this._leave(null, this);
167
+
168
+ return;
169
+ }
170
+
171
+ this._enter(null, this);
172
+ }
173
+ };
174
+
175
+ _proto.dispose = function dispose() {
176
+ clearTimeout(this._timeout);
177
+ $.removeData(this.element, this.constructor.DATA_KEY);
178
+ $(this.element).off(this.constructor.EVENT_KEY);
179
+ $(this.element).closest('.modal').off('hide.bs.modal');
180
+
181
+ if (this.tip) {
182
+ $(this.tip).remove();
183
+ }
184
+
185
+ this._isEnabled = null;
186
+ this._timeout = null;
187
+ this._hoverState = null;
188
+ this._activeTrigger = null;
189
+
190
+ if (this._popper !== null) {
191
+ this._popper.destroy();
192
+ }
193
+
194
+ this._popper = null;
195
+ this.element = null;
196
+ this.config = null;
197
+ this.tip = null;
198
+ };
199
+
200
+ _proto.show = function show() {
201
+ var _this = this;
202
+
203
+ if ($(this.element).css('display') === 'none') {
204
+ throw new Error('Please use show on visible elements');
205
+ }
206
+
207
+ var showEvent = $.Event(this.constructor.Event.SHOW);
208
+
209
+ if (this.isWithContent() && this._isEnabled) {
210
+ $(this.element).trigger(showEvent);
211
+ var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
212
+
213
+ if (showEvent.isDefaultPrevented() || !isInTheDom) {
214
+ return;
215
+ }
216
+
217
+ var tip = this.getTipElement();
218
+ var tipId = Util.getUID(this.constructor.NAME);
219
+ tip.setAttribute('id', tipId);
220
+ this.element.setAttribute('aria-describedby', tipId);
221
+ this.setContent();
222
+
223
+ if (this.config.animation) {
224
+ $(tip).addClass(ClassName.FADE);
225
+ }
226
+
227
+ var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
228
+
229
+ var attachment = this._getAttachment(placement);
230
+
231
+ this.addAttachmentClass(attachment);
232
+ var container = this.config.container === false ? document.body : $(this.config.container);
233
+ $(tip).data(this.constructor.DATA_KEY, this);
234
+
235
+ if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
236
+ $(tip).appendTo(container);
237
+ }
238
+
239
+ $(this.element).trigger(this.constructor.Event.INSERTED);
240
+ this._popper = new Popper(this.element, tip, {
241
+ placement: attachment,
242
+ modifiers: {
243
+ offset: {
244
+ offset: this.config.offset
245
+ },
246
+ flip: {
247
+ behavior: this.config.fallbackPlacement
248
+ },
249
+ arrow: {
250
+ element: Selector.ARROW
251
+ },
252
+ preventOverflow: {
253
+ boundariesElement: this.config.boundary
254
+ }
255
+ },
256
+ onCreate: function onCreate(data) {
257
+ if (data.originalPlacement !== data.placement) {
258
+ _this._handlePopperPlacementChange(data);
259
+ }
260
+ },
261
+ onUpdate: function onUpdate(data) {
262
+ _this._handlePopperPlacementChange(data);
263
+ }
264
+ });
265
+ $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
266
+ // empty mouseover listeners to the body's immediate children;
267
+ // only needed because of broken event delegation on iOS
268
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
269
+
270
+ if ('ontouchstart' in document.documentElement) {
271
+ $(document.body).children().on('mouseover', null, $.noop);
272
+ }
273
+
274
+ var complete = function complete() {
275
+ if (_this.config.animation) {
276
+ _this._fixTransition();
277
+ }
278
+
279
+ var prevHoverState = _this._hoverState;
280
+ _this._hoverState = null;
281
+ $(_this.element).trigger(_this.constructor.Event.SHOWN);
282
+
283
+ if (prevHoverState === HoverState.OUT) {
284
+ _this._leave(null, _this);
285
+ }
286
+ };
287
+
288
+ if ($(this.tip).hasClass(ClassName.FADE)) {
289
+ var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
290
+ $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
291
+ } else {
292
+ complete();
293
+ }
294
+ }
295
+ };
296
+
297
+ _proto.hide = function hide(callback) {
298
+ var _this2 = this;
299
+
300
+ var tip = this.getTipElement();
301
+ var hideEvent = $.Event(this.constructor.Event.HIDE);
302
+
303
+ var complete = function complete() {
304
+ if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
305
+ tip.parentNode.removeChild(tip);
306
+ }
307
+
308
+ _this2._cleanTipClass();
309
+
310
+ _this2.element.removeAttribute('aria-describedby');
311
+
312
+ $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
313
+
314
+ if (_this2._popper !== null) {
315
+ _this2._popper.destroy();
316
+ }
317
+
318
+ if (callback) {
319
+ callback();
320
+ }
321
+ };
322
+
323
+ $(this.element).trigger(hideEvent);
324
+
325
+ if (hideEvent.isDefaultPrevented()) {
326
+ return;
327
+ }
328
+
329
+ $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
330
+ // empty mouseover listeners we added for iOS support
331
+
332
+ if ('ontouchstart' in document.documentElement) {
333
+ $(document.body).children().off('mouseover', null, $.noop);
334
+ }
335
+
336
+ this._activeTrigger[Trigger.CLICK] = false;
337
+ this._activeTrigger[Trigger.FOCUS] = false;
338
+ this._activeTrigger[Trigger.HOVER] = false;
339
+
340
+ if ($(this.tip).hasClass(ClassName.FADE)) {
341
+ var transitionDuration = Util.getTransitionDurationFromElement(tip);
342
+ $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
343
+ } else {
344
+ complete();
345
+ }
346
+
347
+ this._hoverState = '';
348
+ };
349
+
350
+ _proto.update = function update() {
351
+ if (this._popper !== null) {
352
+ this._popper.scheduleUpdate();
353
+ }
354
+ }; // Protected
355
+
356
+
357
+ _proto.isWithContent = function isWithContent() {
358
+ return Boolean(this.getTitle());
359
+ };
360
+
361
+ _proto.addAttachmentClass = function addAttachmentClass(attachment) {
362
+ $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
363
+ };
364
+
365
+ _proto.getTipElement = function getTipElement() {
366
+ this.tip = this.tip || $(this.config.template)[0];
367
+ return this.tip;
368
+ };
369
+
370
+ _proto.setContent = function setContent() {
371
+ var $tip = $(this.getTipElement());
372
+ this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
373
+ $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
374
+ };
375
+
376
+ _proto.setElementContent = function setElementContent($element, content) {
377
+ var html = this.config.html;
378
+
379
+ if (typeof content === 'object' && (content.nodeType || content.jquery)) {
380
+ // Content is a DOM node or a jQuery
381
+ if (html) {
382
+ if (!$(content).parent().is($element)) {
383
+ $element.empty().append(content);
384
+ }
385
+ } else {
386
+ $element.text($(content).text());
387
+ }
388
+ } else {
389
+ $element[html ? 'html' : 'text'](content);
390
+ }
391
+ };
392
+
393
+ _proto.getTitle = function getTitle() {
394
+ var title = this.element.getAttribute('data-original-title');
395
+
396
+ if (!title) {
397
+ title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
398
+ }
399
+
400
+ return title;
401
+ }; // Private
402
+
403
+
404
+ _proto._getAttachment = function _getAttachment(placement) {
405
+ return AttachmentMap[placement.toUpperCase()];
406
+ };
407
+
408
+ _proto._setListeners = function _setListeners() {
409
+ var _this3 = this;
410
+
411
+ var triggers = this.config.trigger.split(' ');
412
+ triggers.forEach(function (trigger) {
413
+ if (trigger === 'click') {
414
+ $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
415
+ return _this3.toggle(event);
416
+ });
417
+ } else if (trigger !== Trigger.MANUAL) {
418
+ var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
419
+ var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
420
+ $(_this3.element).on(eventIn, _this3.config.selector, function (event) {
421
+ return _this3._enter(event);
422
+ }).on(eventOut, _this3.config.selector, function (event) {
423
+ return _this3._leave(event);
424
+ });
425
+ }
426
+
427
+ $(_this3.element).closest('.modal').on('hide.bs.modal', function () {
428
+ return _this3.hide();
429
+ });
430
+ });
431
+
432
+ if (this.config.selector) {
433
+ this.config = _objectSpread({}, this.config, {
434
+ trigger: 'manual',
435
+ selector: ''
436
+ });
437
+ } else {
438
+ this._fixTitle();
439
+ }
440
+ };
441
+
442
+ _proto._fixTitle = function _fixTitle() {
443
+ var titleType = typeof this.element.getAttribute('data-original-title');
444
+
445
+ if (this.element.getAttribute('title') || titleType !== 'string') {
446
+ this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
447
+ this.element.setAttribute('title', '');
448
+ }
449
+ };
450
+
451
+ _proto._enter = function _enter(event, context) {
452
+ var dataKey = this.constructor.DATA_KEY;
453
+ context = context || $(event.currentTarget).data(dataKey);
454
+
455
+ if (!context) {
456
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
457
+ $(event.currentTarget).data(dataKey, context);
458
+ }
459
+
460
+ if (event) {
461
+ context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
462
+ }
463
+
464
+ if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
465
+ context._hoverState = HoverState.SHOW;
466
+ return;
467
+ }
468
+
469
+ clearTimeout(context._timeout);
470
+ context._hoverState = HoverState.SHOW;
471
+
472
+ if (!context.config.delay || !context.config.delay.show) {
473
+ context.show();
474
+ return;
475
+ }
476
+
477
+ context._timeout = setTimeout(function () {
478
+ if (context._hoverState === HoverState.SHOW) {
479
+ context.show();
480
+ }
481
+ }, context.config.delay.show);
482
+ };
483
+
484
+ _proto._leave = function _leave(event, context) {
485
+ var dataKey = this.constructor.DATA_KEY;
486
+ context = context || $(event.currentTarget).data(dataKey);
487
+
488
+ if (!context) {
489
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
490
+ $(event.currentTarget).data(dataKey, context);
491
+ }
492
+
493
+ if (event) {
494
+ context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
495
+ }
496
+
497
+ if (context._isWithActiveTrigger()) {
498
+ return;
499
+ }
500
+
501
+ clearTimeout(context._timeout);
502
+ context._hoverState = HoverState.OUT;
503
+
504
+ if (!context.config.delay || !context.config.delay.hide) {
505
+ context.hide();
506
+ return;
507
+ }
508
+
509
+ context._timeout = setTimeout(function () {
510
+ if (context._hoverState === HoverState.OUT) {
511
+ context.hide();
512
+ }
513
+ }, context.config.delay.hide);
514
+ };
515
+
516
+ _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
517
+ for (var trigger in this._activeTrigger) {
518
+ if (this._activeTrigger[trigger]) {
519
+ return true;
520
+ }
521
+ }
522
+
523
+ return false;
524
+ };
525
+
526
+ _proto._getConfig = function _getConfig(config) {
527
+ config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});
528
+
529
+ if (typeof config.delay === 'number') {
530
+ config.delay = {
531
+ show: config.delay,
532
+ hide: config.delay
533
+ };
534
+ }
535
+
536
+ if (typeof config.title === 'number') {
537
+ config.title = config.title.toString();
538
+ }
539
+
540
+ if (typeof config.content === 'number') {
541
+ config.content = config.content.toString();
542
+ }
543
+
544
+ Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
545
+ return config;
546
+ };
547
+
548
+ _proto._getDelegateConfig = function _getDelegateConfig() {
549
+ var config = {};
550
+
551
+ if (this.config) {
552
+ for (var key in this.config) {
553
+ if (this.constructor.Default[key] !== this.config[key]) {
554
+ config[key] = this.config[key];
555
+ }
556
+ }
557
+ }
558
+
559
+ return config;
560
+ };
561
+
562
+ _proto._cleanTipClass = function _cleanTipClass() {
563
+ var $tip = $(this.getTipElement());
564
+ var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
565
+
566
+ if (tabClass !== null && tabClass.length > 0) {
567
+ $tip.removeClass(tabClass.join(''));
568
+ }
569
+ };
570
+
571
+ _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {
572
+ this._cleanTipClass();
573
+
574
+ this.addAttachmentClass(this._getAttachment(data.placement));
575
+ };
576
+
577
+ _proto._fixTransition = function _fixTransition() {
578
+ var tip = this.getTipElement();
579
+ var initConfigAnimation = this.config.animation;
580
+
581
+ if (tip.getAttribute('x-placement') !== null) {
582
+ return;
583
+ }
584
+
585
+ $(tip).removeClass(ClassName.FADE);
586
+ this.config.animation = false;
587
+ this.hide();
588
+ this.show();
589
+ this.config.animation = initConfigAnimation;
590
+ }; // Static
591
+
592
+
593
+ Tooltip._jQueryInterface = function _jQueryInterface(config) {
594
+ return this.each(function () {
595
+ var data = $(this).data(DATA_KEY);
596
+
597
+ var _config = typeof config === 'object' && config;
598
+
599
+ if (!data && /dispose|hide/.test(config)) {
600
+ return;
601
+ }
602
+
603
+ if (!data) {
604
+ data = new Tooltip(this, _config);
605
+ $(this).data(DATA_KEY, data);
606
+ }
607
+
608
+ if (typeof config === 'string') {
609
+ if (typeof data[config] === 'undefined') {
610
+ throw new TypeError("No method named \"" + config + "\"");
611
+ }
612
+
613
+ data[config]();
614
+ }
615
+ });
616
+ };
617
+
618
+ _createClass(Tooltip, null, [{
619
+ key: "VERSION",
620
+ get: function get() {
621
+ return VERSION;
622
+ }
623
+ }, {
624
+ key: "Default",
625
+ get: function get() {
626
+ return Default;
627
+ }
628
+ }, {
629
+ key: "NAME",
630
+ get: function get() {
631
+ return NAME;
632
+ }
633
+ }, {
634
+ key: "DATA_KEY",
635
+ get: function get() {
636
+ return DATA_KEY;
637
+ }
638
+ }, {
639
+ key: "Event",
640
+ get: function get() {
641
+ return Event;
642
+ }
643
+ }, {
644
+ key: "EVENT_KEY",
645
+ get: function get() {
646
+ return EVENT_KEY;
647
+ }
648
+ }, {
649
+ key: "DefaultType",
650
+ get: function get() {
651
+ return DefaultType;
652
+ }
653
+ }]);
654
+
655
+ return Tooltip;
656
+ }();
657
+ /**
658
+ * ------------------------------------------------------------------------
659
+ * jQuery
660
+ * ------------------------------------------------------------------------
661
+ */
662
+
663
+
664
+ $.fn[NAME] = Tooltip._jQueryInterface;
665
+ $.fn[NAME].Constructor = Tooltip;
666
+
667
+ $.fn[NAME].noConflict = function () {
668
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
669
+ return Tooltip._jQueryInterface;
670
+ };
671
+
672
+ return Tooltip;
673
+ }($, Popper);