administrate-bootstrap-theme 0.1.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +72 -31
- data/app/assets/javascripts/administrate-bootstrap-theme/bootstrap.bundle.js +6780 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +2 -10
- data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +8 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_accordion.scss +4 -2
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_alert.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_badge.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_breadcrumb.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_button-group.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_buttons.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_card.scss +7 -6
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_carousel.scss +2 -2
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_close.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_containers.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_dropdown.scss +11 -17
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_forms.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_functions.scss +94 -3
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +33 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_helpers.scss +2 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_images.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_list-group.scss +5 -5
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_mixins.scss +2 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_modal.scss +7 -35
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_nav.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_navbar.scss +30 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_offcanvas.scss +19 -13
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_pagination.scss +0 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +51 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_popover.scss +10 -10
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_progress.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_reboot.scss +12 -8
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +53 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_spinners.scss +2 -2
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tables.scss +1 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_toasts.scss +3 -3
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tooltip.scss +4 -4
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_transitions.scss +6 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_type.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_utilities.scss +44 -8
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_variables.scss +193 -28
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-grid.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-reboot.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-utilities.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap.scss +2 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_floating-labels.scss +3 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-check.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-control.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-range.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-select.scss +3 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-text.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_input-group.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_labels.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_validation.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_clearfix.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_colored-links.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_position.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_ratio.scss +0 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_stacks.scss +15 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_stretched-link.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_text-truncation.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_visually-hidden.scss +0 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +8 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_alert.scss +0 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_backdrop.scss +14 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_border-radius.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_box-shadow.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_breakpoints.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_buttons.scss +1 -1
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_caret.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_clearfix.scss +0 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_color-scheme.scss +7 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_container.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_deprecate.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_forms.scss +15 -5
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_gradients.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_grid.scss +40 -10
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_image.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_list-group.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_lists.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_pagination.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_reset-text.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_resize.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_table-variants.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_text-truncate.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_transition.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_utilities.scss +27 -6
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_visually-hidden.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/utilities/_api.scss +0 -0
- data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/vendor/_rfs.scss +55 -13
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_autumn.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_default.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_forest.scss +9 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_industrial.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_water.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +21 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +2 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +22 -3
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_lato.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_montserrat.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_open_sans.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_roboto.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_source_sans_pro.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +10 -51
- data/lib/administrate-bootstrap-theme/engine.rb +0 -2
- data/lib/administrate-bootstrap-theme/version.rb +2 -1
- data/lib/generators/administrate_bootstrap_theme/install/USAGE +10 -0
- data/lib/generators/administrate_bootstrap_theme/install/install_generator.rb +33 -0
- data/package.json +10 -0
- metadata +113 -199
- data/Rakefile +0 -16
- data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +0 -2
- data/node_modules/bootstrap/js/src/alert.js +0 -141
- data/node_modules/bootstrap/js/src/base-component.js +0 -46
- data/node_modules/bootstrap/js/src/button.js +0 -95
- data/node_modules/bootstrap/js/src/carousel.js +0 -624
- data/node_modules/bootstrap/js/src/collapse.js +0 -410
- data/node_modules/bootstrap/js/src/dom/data.js +0 -57
- data/node_modules/bootstrap/js/src/dom/event-handler.js +0 -331
- data/node_modules/bootstrap/js/src/dom/manipulator.js +0 -80
- data/node_modules/bootstrap/js/src/dom/selector-engine.js +0 -75
- data/node_modules/bootstrap/js/src/dropdown.js +0 -543
- data/node_modules/bootstrap/js/src/modal.js +0 -582
- data/node_modules/bootstrap/js/src/offcanvas.js +0 -279
- data/node_modules/bootstrap/js/src/popover.js +0 -171
- data/node_modules/bootstrap/js/src/scrollspy.js +0 -319
- data/node_modules/bootstrap/js/src/tab.js +0 -220
- data/node_modules/bootstrap/js/src/toast.js +0 -219
- data/node_modules/bootstrap/js/src/tooltip.js +0 -802
- data/node_modules/bootstrap/js/src/util/index.js +0 -253
- data/node_modules/bootstrap/js/src/util/sanitizer.js +0 -127
- data/node_modules/bootstrap/js/src/util/scrollbar.js +0 -70
- data/node_modules/bootstrap/scss/_grid.scss +0 -22
- data/node_modules/bootstrap/scss/_root.scss +0 -16
@@ -1,219 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* --------------------------------------------------------------------------
|
3
|
-
* Bootstrap (v5.0.0-beta3): toast.js
|
4
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
5
|
-
* --------------------------------------------------------------------------
|
6
|
-
*/
|
7
|
-
|
8
|
-
import {
|
9
|
-
defineJQueryPlugin,
|
10
|
-
emulateTransitionEnd,
|
11
|
-
getTransitionDurationFromElement,
|
12
|
-
reflow,
|
13
|
-
typeCheckConfig
|
14
|
-
} from './util/index'
|
15
|
-
import Data from './dom/data'
|
16
|
-
import EventHandler from './dom/event-handler'
|
17
|
-
import Manipulator from './dom/manipulator'
|
18
|
-
import BaseComponent from './base-component'
|
19
|
-
|
20
|
-
/**
|
21
|
-
* ------------------------------------------------------------------------
|
22
|
-
* Constants
|
23
|
-
* ------------------------------------------------------------------------
|
24
|
-
*/
|
25
|
-
|
26
|
-
const NAME = 'toast'
|
27
|
-
const DATA_KEY = 'bs.toast'
|
28
|
-
const EVENT_KEY = `.${DATA_KEY}`
|
29
|
-
|
30
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
|
31
|
-
const EVENT_HIDE = `hide${EVENT_KEY}`
|
32
|
-
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
33
|
-
const EVENT_SHOW = `show${EVENT_KEY}`
|
34
|
-
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
35
|
-
|
36
|
-
const CLASS_NAME_FADE = 'fade'
|
37
|
-
const CLASS_NAME_HIDE = 'hide'
|
38
|
-
const CLASS_NAME_SHOW = 'show'
|
39
|
-
const CLASS_NAME_SHOWING = 'showing'
|
40
|
-
|
41
|
-
const DefaultType = {
|
42
|
-
animation: 'boolean',
|
43
|
-
autohide: 'boolean',
|
44
|
-
delay: 'number'
|
45
|
-
}
|
46
|
-
|
47
|
-
const Default = {
|
48
|
-
animation: true,
|
49
|
-
autohide: true,
|
50
|
-
delay: 5000
|
51
|
-
}
|
52
|
-
|
53
|
-
const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]'
|
54
|
-
|
55
|
-
/**
|
56
|
-
* ------------------------------------------------------------------------
|
57
|
-
* Class Definition
|
58
|
-
* ------------------------------------------------------------------------
|
59
|
-
*/
|
60
|
-
|
61
|
-
class Toast extends BaseComponent {
|
62
|
-
constructor(element, config) {
|
63
|
-
super(element)
|
64
|
-
|
65
|
-
this._config = this._getConfig(config)
|
66
|
-
this._timeout = null
|
67
|
-
this._setListeners()
|
68
|
-
}
|
69
|
-
|
70
|
-
// Getters
|
71
|
-
|
72
|
-
static get DefaultType() {
|
73
|
-
return DefaultType
|
74
|
-
}
|
75
|
-
|
76
|
-
static get Default() {
|
77
|
-
return Default
|
78
|
-
}
|
79
|
-
|
80
|
-
static get DATA_KEY() {
|
81
|
-
return DATA_KEY
|
82
|
-
}
|
83
|
-
|
84
|
-
// Public
|
85
|
-
|
86
|
-
show() {
|
87
|
-
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)
|
88
|
-
|
89
|
-
if (showEvent.defaultPrevented) {
|
90
|
-
return
|
91
|
-
}
|
92
|
-
|
93
|
-
this._clearTimeout()
|
94
|
-
|
95
|
-
if (this._config.animation) {
|
96
|
-
this._element.classList.add(CLASS_NAME_FADE)
|
97
|
-
}
|
98
|
-
|
99
|
-
const complete = () => {
|
100
|
-
this._element.classList.remove(CLASS_NAME_SHOWING)
|
101
|
-
this._element.classList.add(CLASS_NAME_SHOW)
|
102
|
-
|
103
|
-
EventHandler.trigger(this._element, EVENT_SHOWN)
|
104
|
-
|
105
|
-
if (this._config.autohide) {
|
106
|
-
this._timeout = setTimeout(() => {
|
107
|
-
this.hide()
|
108
|
-
}, this._config.delay)
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
|
-
this._element.classList.remove(CLASS_NAME_HIDE)
|
113
|
-
reflow(this._element)
|
114
|
-
this._element.classList.add(CLASS_NAME_SHOWING)
|
115
|
-
if (this._config.animation) {
|
116
|
-
const transitionDuration = getTransitionDurationFromElement(this._element)
|
117
|
-
|
118
|
-
EventHandler.one(this._element, 'transitionend', complete)
|
119
|
-
emulateTransitionEnd(this._element, transitionDuration)
|
120
|
-
} else {
|
121
|
-
complete()
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
hide() {
|
126
|
-
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
127
|
-
return
|
128
|
-
}
|
129
|
-
|
130
|
-
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)
|
131
|
-
|
132
|
-
if (hideEvent.defaultPrevented) {
|
133
|
-
return
|
134
|
-
}
|
135
|
-
|
136
|
-
const complete = () => {
|
137
|
-
this._element.classList.add(CLASS_NAME_HIDE)
|
138
|
-
EventHandler.trigger(this._element, EVENT_HIDDEN)
|
139
|
-
}
|
140
|
-
|
141
|
-
this._element.classList.remove(CLASS_NAME_SHOW)
|
142
|
-
if (this._config.animation) {
|
143
|
-
const transitionDuration = getTransitionDurationFromElement(this._element)
|
144
|
-
|
145
|
-
EventHandler.one(this._element, 'transitionend', complete)
|
146
|
-
emulateTransitionEnd(this._element, transitionDuration)
|
147
|
-
} else {
|
148
|
-
complete()
|
149
|
-
}
|
150
|
-
}
|
151
|
-
|
152
|
-
dispose() {
|
153
|
-
this._clearTimeout()
|
154
|
-
|
155
|
-
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
156
|
-
this._element.classList.remove(CLASS_NAME_SHOW)
|
157
|
-
}
|
158
|
-
|
159
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS)
|
160
|
-
|
161
|
-
super.dispose()
|
162
|
-
this._config = null
|
163
|
-
}
|
164
|
-
|
165
|
-
// Private
|
166
|
-
|
167
|
-
_getConfig(config) {
|
168
|
-
config = {
|
169
|
-
...Default,
|
170
|
-
...Manipulator.getDataAttributes(this._element),
|
171
|
-
...(typeof config === 'object' && config ? config : {})
|
172
|
-
}
|
173
|
-
|
174
|
-
typeCheckConfig(NAME, config, this.constructor.DefaultType)
|
175
|
-
|
176
|
-
return config
|
177
|
-
}
|
178
|
-
|
179
|
-
_setListeners() {
|
180
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
|
181
|
-
}
|
182
|
-
|
183
|
-
_clearTimeout() {
|
184
|
-
clearTimeout(this._timeout)
|
185
|
-
this._timeout = null
|
186
|
-
}
|
187
|
-
|
188
|
-
// Static
|
189
|
-
|
190
|
-
static jQueryInterface(config) {
|
191
|
-
return this.each(function () {
|
192
|
-
let data = Data.get(this, DATA_KEY)
|
193
|
-
const _config = typeof config === 'object' && config
|
194
|
-
|
195
|
-
if (!data) {
|
196
|
-
data = new Toast(this, _config)
|
197
|
-
}
|
198
|
-
|
199
|
-
if (typeof config === 'string') {
|
200
|
-
if (typeof data[config] === 'undefined') {
|
201
|
-
throw new TypeError(`No method named "${config}"`)
|
202
|
-
}
|
203
|
-
|
204
|
-
data[config](this)
|
205
|
-
}
|
206
|
-
})
|
207
|
-
}
|
208
|
-
}
|
209
|
-
|
210
|
-
/**
|
211
|
-
* ------------------------------------------------------------------------
|
212
|
-
* jQuery
|
213
|
-
* ------------------------------------------------------------------------
|
214
|
-
* add .Toast to jQuery only if jQuery is present
|
215
|
-
*/
|
216
|
-
|
217
|
-
defineJQueryPlugin(NAME, Toast)
|
218
|
-
|
219
|
-
export default Toast
|