administrate-bootstrap-theme 0.1.4 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -12
  3. data/app/assets/config/administrate-bootstrap-theme_manifest.js +1 -0
  4. data/app/assets/javascripts/administrate-bootstrap-theme/bootstrap/bootstrap.bundle.js +6727 -0
  5. data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +2673 -0
  6. data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +22 -0
  7. data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +7 -1
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -1
  9. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_accordion.scss +4 -2
  10. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_alert.scss +0 -0
  11. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_badge.scss +0 -0
  12. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_breadcrumb.scss +0 -0
  13. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_button-group.scss +0 -0
  14. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_buttons.scss +0 -0
  15. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_card.scss +0 -0
  16. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_carousel.scss +0 -0
  17. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_close.scss +0 -0
  18. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_containers.scss +0 -0
  19. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_dropdown.scss +7 -13
  20. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_forms.scss +0 -0
  21. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_functions.scss +0 -0
  22. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_grid.scss +0 -0
  23. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_helpers.scss +0 -0
  24. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_images.scss +0 -0
  25. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_list-group.scss +5 -5
  26. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_mixins.scss +1 -0
  27. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_modal.scss +2 -20
  28. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_nav.scss +0 -0
  29. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_navbar.scss +0 -0
  30. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_offcanvas.scss +11 -11
  31. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_pagination.scss +0 -0
  32. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_popover.scss +0 -0
  33. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_progress.scss +0 -0
  34. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_reboot.scss +0 -0
  35. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_root.scss +0 -0
  36. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_spinners.scss +2 -2
  37. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tables.scss +1 -0
  38. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_toasts.scss +0 -0
  39. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tooltip.scss +0 -0
  40. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_transitions.scss +0 -0
  41. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_type.scss +0 -0
  42. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_utilities.scss +0 -0
  43. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_variables.scss +7 -7
  44. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-grid.scss +1 -1
  45. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-reboot.scss +1 -1
  46. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-utilities.scss +1 -1
  47. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap.scss +1 -1
  48. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_floating-labels.scss +0 -0
  49. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-check.scss +0 -0
  50. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-control.scss +0 -0
  51. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-range.scss +0 -0
  52. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-select.scss +0 -0
  53. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-text.scss +0 -0
  54. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_input-group.scss +0 -0
  55. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_labels.scss +0 -0
  56. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_validation.scss +0 -0
  57. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_clearfix.scss +0 -0
  58. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_colored-links.scss +0 -0
  59. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_position.scss +0 -0
  60. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_ratio.scss +0 -0
  61. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_stretched-link.scss +0 -0
  62. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_text-truncation.scss +0 -0
  63. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_visually-hidden.scss +0 -0
  64. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_alert.scss +0 -0
  65. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_border-radius.scss +0 -0
  66. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_box-shadow.scss +0 -0
  67. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_breakpoints.scss +0 -0
  68. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_buttons.scss +0 -0
  69. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_caret.scss +0 -0
  70. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_clearfix.scss +0 -0
  71. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_color-scheme.scss +7 -0
  72. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_container.scss +0 -0
  73. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_deprecate.scss +0 -0
  74. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_forms.scss +15 -5
  75. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_gradients.scss +0 -0
  76. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_grid.scss +8 -3
  77. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_image.scss +0 -0
  78. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_list-group.scss +0 -0
  79. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_lists.scss +0 -0
  80. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_pagination.scss +0 -0
  81. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_reset-text.scss +0 -0
  82. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_resize.scss +0 -0
  83. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_table-variants.scss +0 -0
  84. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_text-truncate.scss +0 -0
  85. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_transition.scss +0 -0
  86. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_utilities.scss +0 -0
  87. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_visually-hidden.scss +0 -0
  88. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/utilities/_api.scss +0 -0
  89. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/vendor/_rfs.scss +0 -0
  90. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +1 -3
  91. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +46 -26
  92. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +1 -5
  93. data/app/assets/stylesheets/administrate-bootstrap-theme/flatpickr/flatpickr.scss +791 -0
  94. data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +11 -1
  95. data/lib/administrate-bootstrap-theme/version.rb +1 -1
  96. data/package.json +11 -0
  97. metadata +91 -120
  98. data/Rakefile +0 -20
  99. data/node_modules/bootstrap/js/src/alert.js +0 -141
  100. data/node_modules/bootstrap/js/src/base-component.js +0 -46
  101. data/node_modules/bootstrap/js/src/button.js +0 -95
  102. data/node_modules/bootstrap/js/src/carousel.js +0 -624
  103. data/node_modules/bootstrap/js/src/collapse.js +0 -410
  104. data/node_modules/bootstrap/js/src/dom/data.js +0 -57
  105. data/node_modules/bootstrap/js/src/dom/event-handler.js +0 -331
  106. data/node_modules/bootstrap/js/src/dom/manipulator.js +0 -80
  107. data/node_modules/bootstrap/js/src/dom/selector-engine.js +0 -75
  108. data/node_modules/bootstrap/js/src/dropdown.js +0 -543
  109. data/node_modules/bootstrap/js/src/modal.js +0 -582
  110. data/node_modules/bootstrap/js/src/offcanvas.js +0 -279
  111. data/node_modules/bootstrap/js/src/popover.js +0 -171
  112. data/node_modules/bootstrap/js/src/scrollspy.js +0 -319
  113. data/node_modules/bootstrap/js/src/tab.js +0 -220
  114. data/node_modules/bootstrap/js/src/toast.js +0 -219
  115. data/node_modules/bootstrap/js/src/tooltip.js +0 -802
  116. data/node_modules/bootstrap/js/src/util/index.js +0 -253
  117. data/node_modules/bootstrap/js/src/util/sanitizer.js +0 -127
  118. data/node_modules/bootstrap/js/src/util/scrollbar.js +0 -70
@@ -1,279 +0,0 @@
1
- /**
2
- * --------------------------------------------------------------------------
3
- * Bootstrap (v5.0.0-beta3): offcanvas.js
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- * --------------------------------------------------------------------------
6
- */
7
-
8
- import {
9
- defineJQueryPlugin,
10
- getElementFromSelector,
11
- getSelectorFromElement,
12
- getTransitionDurationFromElement,
13
- isDisabled,
14
- isVisible,
15
- typeCheckConfig
16
- } from './util/index'
17
- import { hide as scrollBarHide, reset as scrollBarReset } from './util/scrollbar'
18
- import Data from './dom/data'
19
- import EventHandler from './dom/event-handler'
20
- import BaseComponent from './base-component'
21
- import SelectorEngine from './dom/selector-engine'
22
- import Manipulator from './dom/manipulator'
23
-
24
- /**
25
- * ------------------------------------------------------------------------
26
- * Constants
27
- * ------------------------------------------------------------------------
28
- */
29
-
30
- const NAME = 'offcanvas'
31
- const DATA_KEY = 'bs.offcanvas'
32
- const EVENT_KEY = `.${DATA_KEY}`
33
- const DATA_API_KEY = '.data-api'
34
- const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
35
- const ESCAPE_KEY = 'Escape'
36
-
37
- const Default = {
38
- backdrop: true,
39
- keyboard: true,
40
- scroll: false
41
- }
42
-
43
- const DefaultType = {
44
- backdrop: 'boolean',
45
- keyboard: 'boolean',
46
- scroll: 'boolean'
47
- }
48
-
49
- const CLASS_NAME_BACKDROP_BODY = 'offcanvas-backdrop'
50
- const CLASS_NAME_SHOW = 'show'
51
- const CLASS_NAME_TOGGLING = 'offcanvas-toggling'
52
- const OPEN_SELECTOR = '.offcanvas.show'
53
- const ACTIVE_SELECTOR = `${OPEN_SELECTOR}, .${CLASS_NAME_TOGGLING}`
54
-
55
- const EVENT_SHOW = `show${EVENT_KEY}`
56
- const EVENT_SHOWN = `shown${EVENT_KEY}`
57
- const EVENT_HIDE = `hide${EVENT_KEY}`
58
- const EVENT_HIDDEN = `hidden${EVENT_KEY}`
59
- const EVENT_FOCUSIN = `focusin${EVENT_KEY}`
60
- const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
61
- const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
62
-
63
- const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="offcanvas"]'
64
- const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]'
65
-
66
- /**
67
- * ------------------------------------------------------------------------
68
- * Class Definition
69
- * ------------------------------------------------------------------------
70
- */
71
-
72
- class Offcanvas extends BaseComponent {
73
- constructor(element, config) {
74
- super(element)
75
-
76
- this._config = this._getConfig(config)
77
- this._isShown = false
78
- this._addEventListeners()
79
- }
80
-
81
- // Getters
82
-
83
- static get Default() {
84
- return Default
85
- }
86
-
87
- static get DATA_KEY() {
88
- return DATA_KEY
89
- }
90
-
91
- // Public
92
-
93
- toggle(relatedTarget) {
94
- return this._isShown ? this.hide() : this.show(relatedTarget)
95
- }
96
-
97
- show(relatedTarget) {
98
- if (this._isShown) {
99
- return
100
- }
101
-
102
- const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })
103
-
104
- if (showEvent.defaultPrevented) {
105
- return
106
- }
107
-
108
- this._isShown = true
109
- this._element.style.visibility = 'visible'
110
-
111
- if (this._config.backdrop) {
112
- document.body.classList.add(CLASS_NAME_BACKDROP_BODY)
113
- }
114
-
115
- if (!this._config.scroll) {
116
- scrollBarHide()
117
- }
118
-
119
- this._element.classList.add(CLASS_NAME_TOGGLING)
120
- this._element.removeAttribute('aria-hidden')
121
- this._element.setAttribute('aria-modal', true)
122
- this._element.setAttribute('role', 'dialog')
123
- this._element.classList.add(CLASS_NAME_SHOW)
124
-
125
- const completeCallBack = () => {
126
- this._element.classList.remove(CLASS_NAME_TOGGLING)
127
- EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })
128
- this._enforceFocusOnElement(this._element)
129
- }
130
-
131
- setTimeout(completeCallBack, getTransitionDurationFromElement(this._element))
132
- }
133
-
134
- hide() {
135
- if (!this._isShown) {
136
- return
137
- }
138
-
139
- const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)
140
-
141
- if (hideEvent.defaultPrevented) {
142
- return
143
- }
144
-
145
- this._element.classList.add(CLASS_NAME_TOGGLING)
146
- EventHandler.off(document, EVENT_FOCUSIN)
147
- this._element.blur()
148
- this._isShown = false
149
- this._element.classList.remove(CLASS_NAME_SHOW)
150
-
151
- const completeCallback = () => {
152
- this._element.setAttribute('aria-hidden', true)
153
- this._element.removeAttribute('aria-modal')
154
- this._element.removeAttribute('role')
155
- this._element.style.visibility = 'hidden'
156
-
157
- if (this._config.backdrop) {
158
- document.body.classList.remove(CLASS_NAME_BACKDROP_BODY)
159
- }
160
-
161
- if (!this._config.scroll) {
162
- scrollBarReset()
163
- }
164
-
165
- EventHandler.trigger(this._element, EVENT_HIDDEN)
166
- this._element.classList.remove(CLASS_NAME_TOGGLING)
167
- }
168
-
169
- setTimeout(completeCallback, getTransitionDurationFromElement(this._element))
170
- }
171
-
172
- // Private
173
-
174
- _getConfig(config) {
175
- config = {
176
- ...Default,
177
- ...Manipulator.getDataAttributes(this._element),
178
- ...(typeof config === 'object' ? config : {})
179
- }
180
- typeCheckConfig(NAME, config, DefaultType)
181
- return config
182
- }
183
-
184
- _enforceFocusOnElement(element) {
185
- EventHandler.off(document, EVENT_FOCUSIN) // guard against infinite focus loop
186
- EventHandler.on(document, EVENT_FOCUSIN, event => {
187
- if (document !== event.target &&
188
- element !== event.target &&
189
- !element.contains(event.target)) {
190
- element.focus()
191
- }
192
- })
193
- element.focus()
194
- }
195
-
196
- _addEventListeners() {
197
- EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
198
-
199
- EventHandler.on(document, 'keydown', event => {
200
- if (this._config.keyboard && event.key === ESCAPE_KEY) {
201
- this.hide()
202
- }
203
- })
204
-
205
- EventHandler.on(document, EVENT_CLICK_DATA_API, event => {
206
- const target = SelectorEngine.findOne(getSelectorFromElement(event.target))
207
- if (!this._element.contains(event.target) && target !== this._element) {
208
- this.hide()
209
- }
210
- })
211
- }
212
-
213
- // Static
214
-
215
- static jQueryInterface(config) {
216
- return this.each(function () {
217
- const data = Data.get(this, DATA_KEY) || new Offcanvas(this, typeof config === 'object' ? config : {})
218
-
219
- if (typeof config !== 'string') {
220
- return
221
- }
222
-
223
- if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
224
- throw new TypeError(`No method named "${config}"`)
225
- }
226
-
227
- data[config](this)
228
- })
229
- }
230
- }
231
-
232
- /**
233
- * ------------------------------------------------------------------------
234
- * Data Api implementation
235
- * ------------------------------------------------------------------------
236
- */
237
-
238
- EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
239
- const target = getElementFromSelector(this)
240
-
241
- if (['A', 'AREA'].includes(this.tagName)) {
242
- event.preventDefault()
243
- }
244
-
245
- if (isDisabled(this)) {
246
- return
247
- }
248
-
249
- EventHandler.one(target, EVENT_HIDDEN, () => {
250
- // focus on trigger when it is closed
251
- if (isVisible(this)) {
252
- this.focus()
253
- }
254
- })
255
-
256
- // avoid conflict when clicking a toggler of an offcanvas, while another is open
257
- const allReadyOpen = SelectorEngine.findOne(ACTIVE_SELECTOR)
258
- if (allReadyOpen && allReadyOpen !== target) {
259
- return
260
- }
261
-
262
- const data = Data.get(target, DATA_KEY) || new Offcanvas(target)
263
-
264
- data.toggle(this)
265
- })
266
-
267
- EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
268
- SelectorEngine.find(OPEN_SELECTOR).forEach(el => (Data.get(el, DATA_KEY) || new Offcanvas(el)).show())
269
- })
270
-
271
- /**
272
- * ------------------------------------------------------------------------
273
- * jQuery
274
- * ------------------------------------------------------------------------
275
- */
276
-
277
- defineJQueryPlugin(NAME, Offcanvas)
278
-
279
- export default Offcanvas
@@ -1,171 +0,0 @@
1
- /**
2
- * --------------------------------------------------------------------------
3
- * Bootstrap (v5.0.0-beta3): popover.js
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
- * --------------------------------------------------------------------------
6
- */
7
-
8
- import { defineJQueryPlugin } from './util/index'
9
- import Data from './dom/data'
10
- import SelectorEngine from './dom/selector-engine'
11
- import Tooltip from './tooltip'
12
-
13
- /**
14
- * ------------------------------------------------------------------------
15
- * Constants
16
- * ------------------------------------------------------------------------
17
- */
18
-
19
- const NAME = 'popover'
20
- const DATA_KEY = 'bs.popover'
21
- const EVENT_KEY = `.${DATA_KEY}`
22
- const CLASS_PREFIX = 'bs-popover'
23
- const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
24
-
25
- const Default = {
26
- ...Tooltip.Default,
27
- placement: 'right',
28
- offset: [0, 8],
29
- trigger: 'click',
30
- content: '',
31
- template: '<div class="popover" role="tooltip">' +
32
- '<div class="popover-arrow"></div>' +
33
- '<h3 class="popover-header"></h3>' +
34
- '<div class="popover-body"></div>' +
35
- '</div>'
36
- }
37
-
38
- const DefaultType = {
39
- ...Tooltip.DefaultType,
40
- content: '(string|element|function)'
41
- }
42
-
43
- const Event = {
44
- HIDE: `hide${EVENT_KEY}`,
45
- HIDDEN: `hidden${EVENT_KEY}`,
46
- SHOW: `show${EVENT_KEY}`,
47
- SHOWN: `shown${EVENT_KEY}`,
48
- INSERTED: `inserted${EVENT_KEY}`,
49
- CLICK: `click${EVENT_KEY}`,
50
- FOCUSIN: `focusin${EVENT_KEY}`,
51
- FOCUSOUT: `focusout${EVENT_KEY}`,
52
- MOUSEENTER: `mouseenter${EVENT_KEY}`,
53
- MOUSELEAVE: `mouseleave${EVENT_KEY}`
54
- }
55
-
56
- const CLASS_NAME_FADE = 'fade'
57
- const CLASS_NAME_SHOW = 'show'
58
-
59
- const SELECTOR_TITLE = '.popover-header'
60
- const SELECTOR_CONTENT = '.popover-body'
61
-
62
- /**
63
- * ------------------------------------------------------------------------
64
- * Class Definition
65
- * ------------------------------------------------------------------------
66
- */
67
-
68
- class Popover extends Tooltip {
69
- // Getters
70
-
71
- static get Default() {
72
- return Default
73
- }
74
-
75
- static get NAME() {
76
- return NAME
77
- }
78
-
79
- static get DATA_KEY() {
80
- return DATA_KEY
81
- }
82
-
83
- static get Event() {
84
- return Event
85
- }
86
-
87
- static get EVENT_KEY() {
88
- return EVENT_KEY
89
- }
90
-
91
- static get DefaultType() {
92
- return DefaultType
93
- }
94
-
95
- // Overrides
96
-
97
- isWithContent() {
98
- return this.getTitle() || this._getContent()
99
- }
100
-
101
- setContent() {
102
- const tip = this.getTipElement()
103
-
104
- // we use append for html objects to maintain js events
105
- this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle())
106
- let content = this._getContent()
107
- if (typeof content === 'function') {
108
- content = content.call(this._element)
109
- }
110
-
111
- this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
112
-
113
- tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
114
- }
115
-
116
- // Private
117
-
118
- _addAttachmentClass(attachment) {
119
- this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`)
120
- }
121
-
122
- _getContent() {
123
- return this._element.getAttribute('data-bs-content') || this.config.content
124
- }
125
-
126
- _cleanTipClass() {
127
- const tip = this.getTipElement()
128
- const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX)
129
- if (tabClass !== null && tabClass.length > 0) {
130
- tabClass.map(token => token.trim())
131
- .forEach(tClass => tip.classList.remove(tClass))
132
- }
133
- }
134
-
135
- // Static
136
-
137
- static jQueryInterface(config) {
138
- return this.each(function () {
139
- let data = Data.get(this, DATA_KEY)
140
- const _config = typeof config === 'object' ? config : null
141
-
142
- if (!data && /dispose|hide/.test(config)) {
143
- return
144
- }
145
-
146
- if (!data) {
147
- data = new Popover(this, _config)
148
- Data.set(this, DATA_KEY, data)
149
- }
150
-
151
- if (typeof config === 'string') {
152
- if (typeof data[config] === 'undefined') {
153
- throw new TypeError(`No method named "${config}"`)
154
- }
155
-
156
- data[config]()
157
- }
158
- })
159
- }
160
- }
161
-
162
- /**
163
- * ------------------------------------------------------------------------
164
- * jQuery
165
- * ------------------------------------------------------------------------
166
- * add .Popover to jQuery only if jQuery is present
167
- */
168
-
169
- defineJQueryPlugin(NAME, Popover)
170
-
171
- export default Popover