administrate-bootstrap-theme 0.1.2 → 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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -11
  3. data/Rakefile +10 -14
  4. data/app/assets/config/administrate-bootstrap-theme_manifest.js +1 -0
  5. data/{node_modules/bootstrap/dist/js → app/assets/javascripts/administrate-bootstrap-theme/bootstrap}/bootstrap.bundle.js +0 -0
  6. data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +2673 -0
  7. data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +22 -0
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +7 -1
  9. data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -1
  10. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_accordion.scss +0 -0
  11. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_alert.scss +0 -0
  12. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_badge.scss +0 -0
  13. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_breadcrumb.scss +0 -0
  14. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_button-group.scss +0 -0
  15. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_buttons.scss +0 -0
  16. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_card.scss +0 -0
  17. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_carousel.scss +0 -0
  18. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_close.scss +0 -0
  19. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_containers.scss +0 -0
  20. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_dropdown.scss +0 -0
  21. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_forms.scss +0 -0
  22. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_functions.scss +0 -0
  23. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_grid.scss +0 -0
  24. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_helpers.scss +0 -0
  25. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_images.scss +0 -0
  26. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_list-group.scss +0 -0
  27. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_mixins.scss +0 -0
  28. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_modal.scss +0 -0
  29. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_nav.scss +0 -0
  30. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_navbar.scss +0 -0
  31. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_offcanvas.scss +0 -0
  32. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_pagination.scss +0 -0
  33. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_popover.scss +0 -0
  34. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_progress.scss +0 -0
  35. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_reboot.scss +0 -0
  36. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_root.scss +0 -0
  37. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_spinners.scss +0 -0
  38. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tables.scss +0 -0
  39. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_toasts.scss +0 -0
  40. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_tooltip.scss +0 -0
  41. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_transitions.scss +0 -0
  42. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_type.scss +0 -0
  43. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_utilities.scss +0 -0
  44. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/_variables.scss +0 -0
  45. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-grid.scss +0 -0
  46. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-reboot.scss +0 -0
  47. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap-utilities.scss +0 -0
  48. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/bootstrap.scss +0 -0
  49. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_floating-labels.scss +0 -0
  50. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-check.scss +0 -0
  51. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-control.scss +0 -0
  52. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-range.scss +0 -0
  53. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-select.scss +0 -0
  54. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_form-text.scss +0 -0
  55. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_input-group.scss +0 -0
  56. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_labels.scss +0 -0
  57. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/forms/_validation.scss +0 -0
  58. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_clearfix.scss +0 -0
  59. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_colored-links.scss +0 -0
  60. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_position.scss +0 -0
  61. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_ratio.scss +0 -0
  62. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_stretched-link.scss +0 -0
  63. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_text-truncation.scss +0 -0
  64. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/helpers/_visually-hidden.scss +0 -0
  65. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_alert.scss +0 -0
  66. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_border-radius.scss +0 -0
  67. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_box-shadow.scss +0 -0
  68. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_breakpoints.scss +0 -0
  69. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_buttons.scss +0 -0
  70. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_caret.scss +0 -0
  71. data/{node_modules/bootstrap/scss → app/assets/stylesheets/administrate-bootstrap-theme/bootstrap}/mixins/_clearfix.scss +0 -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 +0 -0
  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 +0 -0
  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 +17 -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.css +791 -0
  94. data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +23 -1
  95. data/lib/administrate-bootstrap-theme/version.rb +1 -1
  96. metadata +92 -203
  97. data/node_modules/bootstrap/LICENSE +0 -22
  98. data/node_modules/bootstrap/README.md +0 -239
  99. data/node_modules/bootstrap/dist/css/bootstrap-grid.css +0 -4997
  100. data/node_modules/bootstrap/dist/css/bootstrap-grid.css.map +0 -1
  101. data/node_modules/bootstrap/dist/css/bootstrap-grid.min.css +0 -7
  102. data/node_modules/bootstrap/dist/css/bootstrap-grid.min.css.map +0 -1
  103. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.css +0 -4996
  104. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.css.map +0 -1
  105. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.min.css +0 -7
  106. data/node_modules/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map +0 -1
  107. data/node_modules/bootstrap/dist/css/bootstrap-reboot.css +0 -426
  108. data/node_modules/bootstrap/dist/css/bootstrap-reboot.css.map +0 -1
  109. data/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css +0 -8
  110. data/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css.map +0 -1
  111. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.css +0 -423
  112. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.css.map +0 -1
  113. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.min.css +0 -8
  114. data/node_modules/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map +0 -1
  115. data/node_modules/bootstrap/dist/css/bootstrap-utilities.css +0 -4752
  116. data/node_modules/bootstrap/dist/css/bootstrap-utilities.css.map +0 -1
  117. data/node_modules/bootstrap/dist/css/bootstrap-utilities.min.css +0 -7
  118. data/node_modules/bootstrap/dist/css/bootstrap-utilities.min.css.map +0 -1
  119. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.css +0 -4743
  120. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.css.map +0 -1
  121. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.min.css +0 -7
  122. data/node_modules/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map +0 -1
  123. data/node_modules/bootstrap/dist/css/bootstrap.css +0 -10819
  124. data/node_modules/bootstrap/dist/css/bootstrap.css.map +0 -1
  125. data/node_modules/bootstrap/dist/css/bootstrap.min.css +0 -7
  126. data/node_modules/bootstrap/dist/css/bootstrap.min.css.map +0 -1
  127. data/node_modules/bootstrap/dist/css/bootstrap.rtl.css +0 -10795
  128. data/node_modules/bootstrap/dist/css/bootstrap.rtl.css.map +0 -1
  129. data/node_modules/bootstrap/dist/css/bootstrap.rtl.min.css +0 -7
  130. data/node_modules/bootstrap/dist/css/bootstrap.rtl.min.css.map +0 -1
  131. data/node_modules/bootstrap/dist/js/bootstrap.bundle.js.map +0 -1
  132. data/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js +0 -7
  133. data/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map +0 -1
  134. data/node_modules/bootstrap/dist/js/bootstrap.esm.js +0 -4944
  135. data/node_modules/bootstrap/dist/js/bootstrap.esm.js.map +0 -1
  136. data/node_modules/bootstrap/dist/js/bootstrap.esm.min.js +0 -7
  137. data/node_modules/bootstrap/dist/js/bootstrap.esm.min.js.map +0 -1
  138. data/node_modules/bootstrap/dist/js/bootstrap.js +0 -4993
  139. data/node_modules/bootstrap/dist/js/bootstrap.js.map +0 -1
  140. data/node_modules/bootstrap/dist/js/bootstrap.min.js +0 -7
  141. data/node_modules/bootstrap/dist/js/bootstrap.min.js.map +0 -1
  142. data/node_modules/bootstrap/js/dist/alert.js +0 -264
  143. data/node_modules/bootstrap/js/dist/alert.js.map +0 -1
  144. data/node_modules/bootstrap/js/dist/base-component.js +0 -62
  145. data/node_modules/bootstrap/js/dist/base-component.js.map +0 -1
  146. data/node_modules/bootstrap/js/dist/button.js +0 -146
  147. data/node_modules/bootstrap/js/dist/button.js.map +0 -1
  148. data/node_modules/bootstrap/js/dist/carousel.js +0 -757
  149. data/node_modules/bootstrap/js/dist/carousel.js.map +0 -1
  150. data/node_modules/bootstrap/js/dist/collapse.js +0 -551
  151. data/node_modules/bootstrap/js/dist/collapse.js.map +0 -1
  152. data/node_modules/bootstrap/js/dist/dom/data.js +0 -69
  153. data/node_modules/bootstrap/js/dist/dom/data.js.map +0 -1
  154. data/node_modules/bootstrap/js/dist/dom/event-handler.js +0 -305
  155. data/node_modules/bootstrap/js/dist/dom/event-handler.js.map +0 -1
  156. data/node_modules/bootstrap/js/dist/dom/manipulator.js +0 -89
  157. data/node_modules/bootstrap/js/dist/dom/manipulator.js.map +0 -1
  158. data/node_modules/bootstrap/js/dist/dom/selector-engine.js +0 -86
  159. data/node_modules/bootstrap/js/dist/dom/selector-engine.js.map +0 -1
  160. data/node_modules/bootstrap/js/dist/dropdown.js +0 -662
  161. data/node_modules/bootstrap/js/dist/dropdown.js.map +0 -1
  162. data/node_modules/bootstrap/js/dist/modal.js +0 -752
  163. data/node_modules/bootstrap/js/dist/modal.js.map +0 -1
  164. data/node_modules/bootstrap/js/dist/offcanvas.js +0 -509
  165. data/node_modules/bootstrap/js/dist/offcanvas.js.map +0 -1
  166. data/node_modules/bootstrap/js/dist/popover.js +0 -216
  167. data/node_modules/bootstrap/js/dist/popover.js.map +0 -1
  168. data/node_modules/bootstrap/js/dist/scrollspy.js +0 -400
  169. data/node_modules/bootstrap/js/dist/scrollspy.js.map +0 -1
  170. data/node_modules/bootstrap/js/dist/tab.js +0 -347
  171. data/node_modules/bootstrap/js/dist/tab.js.map +0 -1
  172. data/node_modules/bootstrap/js/dist/toast.js +0 -335
  173. data/node_modules/bootstrap/js/dist/toast.js.map +0 -1
  174. data/node_modules/bootstrap/js/dist/tooltip.js +0 -1055
  175. data/node_modules/bootstrap/js/dist/tooltip.js.map +0 -1
  176. data/node_modules/bootstrap/js/src/alert.js +0 -141
  177. data/node_modules/bootstrap/js/src/base-component.js +0 -46
  178. data/node_modules/bootstrap/js/src/button.js +0 -95
  179. data/node_modules/bootstrap/js/src/carousel.js +0 -624
  180. data/node_modules/bootstrap/js/src/collapse.js +0 -410
  181. data/node_modules/bootstrap/js/src/dom/data.js +0 -57
  182. data/node_modules/bootstrap/js/src/dom/event-handler.js +0 -331
  183. data/node_modules/bootstrap/js/src/dom/manipulator.js +0 -80
  184. data/node_modules/bootstrap/js/src/dom/selector-engine.js +0 -75
  185. data/node_modules/bootstrap/js/src/dropdown.js +0 -543
  186. data/node_modules/bootstrap/js/src/modal.js +0 -582
  187. data/node_modules/bootstrap/js/src/offcanvas.js +0 -279
  188. data/node_modules/bootstrap/js/src/popover.js +0 -171
  189. data/node_modules/bootstrap/js/src/scrollspy.js +0 -319
  190. data/node_modules/bootstrap/js/src/tab.js +0 -220
  191. data/node_modules/bootstrap/js/src/toast.js +0 -219
  192. data/node_modules/bootstrap/js/src/tooltip.js +0 -802
  193. data/node_modules/bootstrap/js/src/util/index.js +0 -253
  194. data/node_modules/bootstrap/js/src/util/sanitizer.js +0 -127
  195. data/node_modules/bootstrap/js/src/util/scrollbar.js +0 -70
  196. data/node_modules/bootstrap/package.json +0 -177
@@ -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