administrate-bootstrap-theme 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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 +0,0 @@
1
- {"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta3): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","Object","keys","dataset","filter","startsWith","forEach","pureKey","charAt","slice","length","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAEA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsBC,GAAG,IAAK,IAAGA,GAAG,CAACC,WAAJ,EAAkB,EAAnD,CAAP;EACD;;QAEKC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAD,EAAUN,GAAV,EAAeO,KAAf,EAAsB;EACpCD,IAAAA,OAAO,CAACE,YAAR,CAAsB,WAAUT,gBAAgB,CAACC,GAAD,CAAM,EAAtD,EAAyDO,KAAzD;EACD,GAHiB;;EAKlBE,EAAAA,mBAAmB,CAACH,OAAD,EAAUN,GAAV,EAAe;EAChCM,IAAAA,OAAO,CAACI,eAAR,CAAyB,WAAUX,gBAAgB,CAACC,GAAD,CAAM,EAAzD;EACD,GAPiB;;EASlBW,EAAAA,iBAAiB,CAACL,OAAD,EAAU;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,UAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACUhB,GAAG,IAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CADjB,EAEGC,OAFH,CAEWlB,GAAG,IAAI;EACd,UAAImB,OAAO,GAAGnB,GAAG,CAACC,OAAJ,CAAY,KAAZ,EAAmB,EAAnB,CAAd;EACAkB,MAAAA,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,CAAf,EAAkBjB,WAAlB,KAAkCgB,OAAO,CAACE,KAAR,CAAc,CAAd,EAAiBF,OAAO,CAACG,MAAzB,CAA5C;EACAV,MAAAA,UAAU,CAACO,OAAD,CAAV,GAAsBxB,aAAa,CAACW,OAAO,CAACS,OAAR,CAAgBf,GAAhB,CAAD,CAAnC;EACD,KANH;EAQA,WAAOY,UAAP;EACD,GAzBiB;;EA2BlBW,EAAAA,gBAAgB,CAACjB,OAAD,EAAUN,GAAV,EAAe;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,CAAsB,WAAUzB,gBAAgB,CAACC,GAAD,CAAM,EAAtD,CAAD,CAApB;EACD,GA7BiB;;EA+BlByB,EAAAA,MAAM,CAACnB,OAAD,EAAU;EACd,UAAMoB,IAAI,GAAGpB,OAAO,CAACqB,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GAtCiB;;EAwClBC,EAAAA,QAAQ,CAAC5B,OAAD,EAAU;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;;EA7CiB;;;;;;;;"}
@@ -1,86 +0,0 @@
1
- /*!
2
- * Bootstrap selector-engine.js v5.0.0-beta3 (https://getbootstrap.com/)
3
- * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
- typeof define === 'function' && define.amd ? define(factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory());
10
- }(this, (function () { 'use strict';
11
-
12
- /**
13
- * --------------------------------------------------------------------------
14
- * Bootstrap (v5.0.0-beta3): dom/selector-engine.js
15
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16
- * --------------------------------------------------------------------------
17
- */
18
-
19
- /**
20
- * ------------------------------------------------------------------------
21
- * Constants
22
- * ------------------------------------------------------------------------
23
- */
24
- const NODE_TEXT = 3;
25
- const SelectorEngine = {
26
- find(selector, element = document.documentElement) {
27
- return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
28
- },
29
-
30
- findOne(selector, element = document.documentElement) {
31
- return Element.prototype.querySelector.call(element, selector);
32
- },
33
-
34
- children(element, selector) {
35
- return [].concat(...element.children).filter(child => child.matches(selector));
36
- },
37
-
38
- parents(element, selector) {
39
- const parents = [];
40
- let ancestor = element.parentNode;
41
-
42
- while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
43
- if (ancestor.matches(selector)) {
44
- parents.push(ancestor);
45
- }
46
-
47
- ancestor = ancestor.parentNode;
48
- }
49
-
50
- return parents;
51
- },
52
-
53
- prev(element, selector) {
54
- let previous = element.previousElementSibling;
55
-
56
- while (previous) {
57
- if (previous.matches(selector)) {
58
- return [previous];
59
- }
60
-
61
- previous = previous.previousElementSibling;
62
- }
63
-
64
- return [];
65
- },
66
-
67
- next(element, selector) {
68
- let next = element.nextElementSibling;
69
-
70
- while (next) {
71
- if (next.matches(selector)) {
72
- return [next];
73
- }
74
-
75
- next = next.nextElementSibling;
76
- }
77
-
78
- return [];
79
- }
80
-
81
- };
82
-
83
- return SelectorEngine;
84
-
85
- })));
86
- //# sourceMappingURL=selector-engine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta3): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children)\n .filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","find","selector","element","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","matches","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,SAAS,GAAG,CAAlB;QAEMC,cAAc,GAAG;EACrBC,EAAAA,IAAI,CAACC,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACjD,WAAO,GAAGC,MAAH,CAAU,GAAGC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCP,OAAxC,EAAiDD,QAAjD,CAAb,CAAP;EACD,GAHoB;;EAKrBS,EAAAA,OAAO,CAACT,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCP,OAArC,EAA8CD,QAA9C,CAAP;EACD,GAPoB;;EASrBW,EAAAA,QAAQ,CAACV,OAAD,EAAUD,QAAV,EAAoB;EAC1B,WAAO,GAAGI,MAAH,CAAU,GAAGH,OAAO,CAACU,QAArB,EACJC,MADI,CACGC,KAAK,IAAIA,KAAK,CAACC,OAAN,CAAcd,QAAd,CADZ,CAAP;EAED,GAZoB;;EAcrBe,EAAAA,OAAO,CAACd,OAAD,EAAUD,QAAV,EAAoB;EACzB,UAAMe,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGf,OAAO,CAACgB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAImB,QAAQ,CAACF,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9Be,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GA5BoB;;EA8BrBO,EAAAA,IAAI,CAACrB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIuB,QAAQ,GAAGtB,OAAO,CAACuB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACT,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACuB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA1CoB;;EA4CrBC,EAAAA,IAAI,CAACxB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIyB,IAAI,GAAGxB,OAAO,CAACyB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAIA,IAAI,CAACX,OAAL,CAAad,QAAb,CAAJ,EAA4B;EAC1B,eAAO,CAACyB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;;EAxDoB;;;;;;;;"}
@@ -1,662 +0,0 @@
1
- /*!
2
- * Bootstrap dropdown.js v5.0.0-beta3 (https://getbootstrap.com/)
3
- * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
- typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
- }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- function _interopNamespace(e) {
15
- if (e && e.__esModule) return e;
16
- var n = Object.create(null);
17
- if (e) {
18
- Object.keys(e).forEach(function (k) {
19
- if (k !== 'default') {
20
- var d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: function () {
24
- return e[k];
25
- }
26
- });
27
- }
28
- });
29
- }
30
- n['default'] = e;
31
- return Object.freeze(n);
32
- }
33
-
34
- var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
- var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
- var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
- var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
- var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
39
- var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
40
-
41
- /**
42
- * --------------------------------------------------------------------------
43
- * Bootstrap (v5.0.0-beta3): util/index.js
44
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
45
- * --------------------------------------------------------------------------
46
- */
47
-
48
- const toType = obj => {
49
- if (obj === null || obj === undefined) {
50
- return `${obj}`;
51
- }
52
-
53
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
54
- };
55
-
56
- const getSelector = element => {
57
- let selector = element.getAttribute('data-bs-target');
58
-
59
- if (!selector || selector === '#') {
60
- let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
61
- // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
62
- // `document.querySelector` will rightfully complain it is invalid.
63
- // See https://github.com/twbs/bootstrap/issues/32273
64
-
65
- if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
66
- return null;
67
- } // Just in case some CMS puts out a full URL with the anchor appended
68
-
69
-
70
- if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
71
- hrefAttr = '#' + hrefAttr.split('#')[1];
72
- }
73
-
74
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
75
- }
76
-
77
- return selector;
78
- };
79
-
80
- const getElementFromSelector = element => {
81
- const selector = getSelector(element);
82
- return selector ? document.querySelector(selector) : null;
83
- };
84
-
85
- const isElement = obj => (obj[0] || obj).nodeType;
86
-
87
- const typeCheckConfig = (componentName, config, configTypes) => {
88
- Object.keys(configTypes).forEach(property => {
89
- const expectedTypes = configTypes[property];
90
- const value = config[property];
91
- const valueType = value && isElement(value) ? 'element' : toType(value);
92
-
93
- if (!new RegExp(expectedTypes).test(valueType)) {
94
- throw new TypeError(`${componentName.toUpperCase()}: ` + `Option "${property}" provided type "${valueType}" ` + `but expected type "${expectedTypes}".`);
95
- }
96
- });
97
- };
98
-
99
- const isVisible = element => {
100
- if (!element) {
101
- return false;
102
- }
103
-
104
- if (element.style && element.parentNode && element.parentNode.style) {
105
- const elementStyle = getComputedStyle(element);
106
- const parentNodeStyle = getComputedStyle(element.parentNode);
107
- return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
108
- }
109
-
110
- return false;
111
- };
112
-
113
- const noop = () => function () {};
114
-
115
- const getjQuery = () => {
116
- const {
117
- jQuery
118
- } = window;
119
-
120
- if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
121
- return jQuery;
122
- }
123
-
124
- return null;
125
- };
126
-
127
- const onDOMContentLoaded = callback => {
128
- if (document.readyState === 'loading') {
129
- document.addEventListener('DOMContentLoaded', callback);
130
- } else {
131
- callback();
132
- }
133
- };
134
-
135
- const isRTL = () => document.documentElement.dir === 'rtl';
136
-
137
- const defineJQueryPlugin = (name, plugin) => {
138
- onDOMContentLoaded(() => {
139
- const $ = getjQuery();
140
- /* istanbul ignore if */
141
-
142
- if ($) {
143
- const JQUERY_NO_CONFLICT = $.fn[name];
144
- $.fn[name] = plugin.jQueryInterface;
145
- $.fn[name].Constructor = plugin;
146
-
147
- $.fn[name].noConflict = () => {
148
- $.fn[name] = JQUERY_NO_CONFLICT;
149
- return plugin.jQueryInterface;
150
- };
151
- }
152
- });
153
- };
154
-
155
- /**
156
- * --------------------------------------------------------------------------
157
- * Bootstrap (v5.0.0-beta3): dropdown.js
158
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
159
- * --------------------------------------------------------------------------
160
- */
161
- /**
162
- * ------------------------------------------------------------------------
163
- * Constants
164
- * ------------------------------------------------------------------------
165
- */
166
-
167
- const NAME = 'dropdown';
168
- const DATA_KEY = 'bs.dropdown';
169
- const EVENT_KEY = `.${DATA_KEY}`;
170
- const DATA_API_KEY = '.data-api';
171
- const ESCAPE_KEY = 'Escape';
172
- const SPACE_KEY = 'Space';
173
- const TAB_KEY = 'Tab';
174
- const ARROW_UP_KEY = 'ArrowUp';
175
- const ARROW_DOWN_KEY = 'ArrowDown';
176
- const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
177
-
178
- const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY}`);
179
- const EVENT_HIDE = `hide${EVENT_KEY}`;
180
- const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
181
- const EVENT_SHOW = `show${EVENT_KEY}`;
182
- const EVENT_SHOWN = `shown${EVENT_KEY}`;
183
- const EVENT_CLICK = `click${EVENT_KEY}`;
184
- const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
185
- const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`;
186
- const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`;
187
- const CLASS_NAME_DISABLED = 'disabled';
188
- const CLASS_NAME_SHOW = 'show';
189
- const CLASS_NAME_DROPUP = 'dropup';
190
- const CLASS_NAME_DROPEND = 'dropend';
191
- const CLASS_NAME_DROPSTART = 'dropstart';
192
- const CLASS_NAME_NAVBAR = 'navbar';
193
- const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]';
194
- const SELECTOR_MENU = '.dropdown-menu';
195
- const SELECTOR_NAVBAR_NAV = '.navbar-nav';
196
- const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
197
- const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';
198
- const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';
199
- const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';
200
- const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
201
- const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
202
- const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
203
- const Default = {
204
- offset: [0, 2],
205
- boundary: 'clippingParents',
206
- reference: 'toggle',
207
- display: 'dynamic',
208
- popperConfig: null
209
- };
210
- const DefaultType = {
211
- offset: '(array|string|function)',
212
- boundary: '(string|element)',
213
- reference: '(string|element|object)',
214
- display: 'string',
215
- popperConfig: '(null|object|function)'
216
- };
217
- /**
218
- * ------------------------------------------------------------------------
219
- * Class Definition
220
- * ------------------------------------------------------------------------
221
- */
222
-
223
- class Dropdown extends BaseComponent__default['default'] {
224
- constructor(element, config) {
225
- super(element);
226
- this._popper = null;
227
- this._config = this._getConfig(config);
228
- this._menu = this._getMenuElement();
229
- this._inNavbar = this._detectNavbar();
230
-
231
- this._addEventListeners();
232
- } // Getters
233
-
234
-
235
- static get Default() {
236
- return Default;
237
- }
238
-
239
- static get DefaultType() {
240
- return DefaultType;
241
- }
242
-
243
- static get DATA_KEY() {
244
- return DATA_KEY;
245
- } // Public
246
-
247
-
248
- toggle() {
249
- if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED)) {
250
- return;
251
- }
252
-
253
- const isActive = this._element.classList.contains(CLASS_NAME_SHOW);
254
-
255
- Dropdown.clearMenus();
256
-
257
- if (isActive) {
258
- return;
259
- }
260
-
261
- this.show();
262
- }
263
-
264
- show() {
265
- if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED) || this._menu.classList.contains(CLASS_NAME_SHOW)) {
266
- return;
267
- }
268
-
269
- const parent = Dropdown.getParentFromElement(this._element);
270
- const relatedTarget = {
271
- relatedTarget: this._element
272
- };
273
- const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, relatedTarget);
274
-
275
- if (showEvent.defaultPrevented) {
276
- return;
277
- } // Totally disable Popper for Dropdowns in Navbar
278
-
279
-
280
- if (this._inNavbar) {
281
- Manipulator__default['default'].setDataAttribute(this._menu, 'popper', 'none');
282
- } else {
283
- if (typeof Popper__namespace === 'undefined') {
284
- throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
285
- }
286
-
287
- let referenceElement = this._element;
288
-
289
- if (this._config.reference === 'parent') {
290
- referenceElement = parent;
291
- } else if (isElement(this._config.reference)) {
292
- referenceElement = this._config.reference; // Check if it's jQuery element
293
-
294
- if (typeof this._config.reference.jquery !== 'undefined') {
295
- referenceElement = this._config.reference[0];
296
- }
297
- } else if (typeof this._config.reference === 'object') {
298
- referenceElement = this._config.reference;
299
- }
300
-
301
- const popperConfig = this._getPopperConfig();
302
-
303
- const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
304
- this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig);
305
-
306
- if (isDisplayStatic) {
307
- Manipulator__default['default'].setDataAttribute(this._menu, 'popper', 'static');
308
- }
309
- } // If this is a touch-enabled device we add extra
310
- // empty mouseover listeners to the body's immediate children;
311
- // only needed because of broken event delegation on iOS
312
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
313
-
314
-
315
- if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
316
- [].concat(...document.body.children).forEach(elem => EventHandler__default['default'].on(elem, 'mouseover', null, noop()));
317
- }
318
-
319
- this._element.focus();
320
-
321
- this._element.setAttribute('aria-expanded', true);
322
-
323
- this._menu.classList.toggle(CLASS_NAME_SHOW);
324
-
325
- this._element.classList.toggle(CLASS_NAME_SHOW);
326
-
327
- EventHandler__default['default'].trigger(this._element, EVENT_SHOWN, relatedTarget);
328
- }
329
-
330
- hide() {
331
- if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED) || !this._menu.classList.contains(CLASS_NAME_SHOW)) {
332
- return;
333
- }
334
-
335
- const relatedTarget = {
336
- relatedTarget: this._element
337
- };
338
- const hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE, relatedTarget);
339
-
340
- if (hideEvent.defaultPrevented) {
341
- return;
342
- }
343
-
344
- if (this._popper) {
345
- this._popper.destroy();
346
- }
347
-
348
- this._menu.classList.toggle(CLASS_NAME_SHOW);
349
-
350
- this._element.classList.toggle(CLASS_NAME_SHOW);
351
-
352
- Manipulator__default['default'].removeDataAttribute(this._menu, 'popper');
353
- EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN, relatedTarget);
354
- }
355
-
356
- dispose() {
357
- EventHandler__default['default'].off(this._element, EVENT_KEY);
358
- this._menu = null;
359
-
360
- if (this._popper) {
361
- this._popper.destroy();
362
-
363
- this._popper = null;
364
- }
365
-
366
- super.dispose();
367
- }
368
-
369
- update() {
370
- this._inNavbar = this._detectNavbar();
371
-
372
- if (this._popper) {
373
- this._popper.update();
374
- }
375
- } // Private
376
-
377
-
378
- _addEventListeners() {
379
- EventHandler__default['default'].on(this._element, EVENT_CLICK, event => {
380
- event.preventDefault();
381
- this.toggle();
382
- });
383
- }
384
-
385
- _getConfig(config) {
386
- config = { ...this.constructor.Default,
387
- ...Manipulator__default['default'].getDataAttributes(this._element),
388
- ...config
389
- };
390
- typeCheckConfig(NAME, config, this.constructor.DefaultType);
391
-
392
- if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
393
- // Popper virtual elements require a getBoundingClientRect method
394
- throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
395
- }
396
-
397
- return config;
398
- }
399
-
400
- _getMenuElement() {
401
- return SelectorEngine__default['default'].next(this._element, SELECTOR_MENU)[0];
402
- }
403
-
404
- _getPlacement() {
405
- const parentDropdown = this._element.parentNode;
406
-
407
- if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
408
- return PLACEMENT_RIGHT;
409
- }
410
-
411
- if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
412
- return PLACEMENT_LEFT;
413
- } // We need to trim the value because custom properties can also include spaces
414
-
415
-
416
- const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
417
-
418
- if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
419
- return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
420
- }
421
-
422
- return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
423
- }
424
-
425
- _detectNavbar() {
426
- return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;
427
- }
428
-
429
- _getOffset() {
430
- const {
431
- offset
432
- } = this._config;
433
-
434
- if (typeof offset === 'string') {
435
- return offset.split(',').map(val => Number.parseInt(val, 10));
436
- }
437
-
438
- if (typeof offset === 'function') {
439
- return popperData => offset(popperData, this._element);
440
- }
441
-
442
- return offset;
443
- }
444
-
445
- _getPopperConfig() {
446
- const defaultBsPopperConfig = {
447
- placement: this._getPlacement(),
448
- modifiers: [{
449
- name: 'preventOverflow',
450
- options: {
451
- boundary: this._config.boundary
452
- }
453
- }, {
454
- name: 'offset',
455
- options: {
456
- offset: this._getOffset()
457
- }
458
- }]
459
- }; // Disable Popper if we have a static display
460
-
461
- if (this._config.display === 'static') {
462
- defaultBsPopperConfig.modifiers = [{
463
- name: 'applyStyles',
464
- enabled: false
465
- }];
466
- }
467
-
468
- return { ...defaultBsPopperConfig,
469
- ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
470
- };
471
- } // Static
472
-
473
-
474
- static dropdownInterface(element, config) {
475
- let data = Data__default['default'].get(element, DATA_KEY);
476
-
477
- const _config = typeof config === 'object' ? config : null;
478
-
479
- if (!data) {
480
- data = new Dropdown(element, _config);
481
- }
482
-
483
- if (typeof config === 'string') {
484
- if (typeof data[config] === 'undefined') {
485
- throw new TypeError(`No method named "${config}"`);
486
- }
487
-
488
- data[config]();
489
- }
490
- }
491
-
492
- static jQueryInterface(config) {
493
- return this.each(function () {
494
- Dropdown.dropdownInterface(this, config);
495
- });
496
- }
497
-
498
- static clearMenus(event) {
499
- if (event) {
500
- if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) {
501
- return;
502
- }
503
-
504
- if (/input|select|textarea|form/i.test(event.target.tagName)) {
505
- return;
506
- }
507
- }
508
-
509
- const toggles = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
510
-
511
- for (let i = 0, len = toggles.length; i < len; i++) {
512
- const context = Data__default['default'].get(toggles[i], DATA_KEY);
513
- const relatedTarget = {
514
- relatedTarget: toggles[i]
515
- };
516
-
517
- if (event && event.type === 'click') {
518
- relatedTarget.clickEvent = event;
519
- }
520
-
521
- if (!context) {
522
- continue;
523
- }
524
-
525
- const dropdownMenu = context._menu;
526
-
527
- if (!toggles[i].classList.contains(CLASS_NAME_SHOW)) {
528
- continue;
529
- }
530
-
531
- if (event) {
532
- // Don't close the menu if the clicked element or one of its parents is the dropdown button
533
- if ([context._element].some(element => event.composedPath().includes(element))) {
534
- continue;
535
- } // Tab navigation through the dropdown menu shouldn't close the menu
536
-
537
-
538
- if (event.type === 'keyup' && event.key === TAB_KEY && dropdownMenu.contains(event.target)) {
539
- continue;
540
- }
541
- }
542
-
543
- const hideEvent = EventHandler__default['default'].trigger(toggles[i], EVENT_HIDE, relatedTarget);
544
-
545
- if (hideEvent.defaultPrevented) {
546
- continue;
547
- } // If this is a touch-enabled device we remove the extra
548
- // empty mouseover listeners we added for iOS support
549
-
550
-
551
- if ('ontouchstart' in document.documentElement) {
552
- [].concat(...document.body.children).forEach(elem => EventHandler__default['default'].off(elem, 'mouseover', null, noop()));
553
- }
554
-
555
- toggles[i].setAttribute('aria-expanded', 'false');
556
-
557
- if (context._popper) {
558
- context._popper.destroy();
559
- }
560
-
561
- dropdownMenu.classList.remove(CLASS_NAME_SHOW);
562
- toggles[i].classList.remove(CLASS_NAME_SHOW);
563
- Manipulator__default['default'].removeDataAttribute(dropdownMenu, 'popper');
564
- EventHandler__default['default'].trigger(toggles[i], EVENT_HIDDEN, relatedTarget);
565
- }
566
- }
567
-
568
- static getParentFromElement(element) {
569
- return getElementFromSelector(element) || element.parentNode;
570
- }
571
-
572
- static dataApiKeydownHandler(event) {
573
- // If not input/textarea:
574
- // - And not a key in REGEXP_KEYDOWN => not a dropdown command
575
- // If input/textarea:
576
- // - If space key => not a dropdown command
577
- // - If key is other than escape
578
- // - If key is not up or down => not a dropdown command
579
- // - If trigger inside the menu => not a dropdown command
580
- if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {
581
- return;
582
- }
583
-
584
- event.preventDefault();
585
- event.stopPropagation();
586
-
587
- if (this.disabled || this.classList.contains(CLASS_NAME_DISABLED)) {
588
- return;
589
- }
590
-
591
- const parent = Dropdown.getParentFromElement(this);
592
- const isActive = this.classList.contains(CLASS_NAME_SHOW);
593
-
594
- if (event.key === ESCAPE_KEY) {
595
- const button = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default['default'].prev(this, SELECTOR_DATA_TOGGLE)[0];
596
- button.focus();
597
- Dropdown.clearMenus();
598
- return;
599
- }
600
-
601
- if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
602
- const button = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default['default'].prev(this, SELECTOR_DATA_TOGGLE)[0];
603
- button.click();
604
- return;
605
- }
606
-
607
- if (!isActive || event.key === SPACE_KEY) {
608
- Dropdown.clearMenus();
609
- return;
610
- }
611
-
612
- const items = SelectorEngine__default['default'].find(SELECTOR_VISIBLE_ITEMS, parent).filter(isVisible);
613
-
614
- if (!items.length) {
615
- return;
616
- }
617
-
618
- let index = items.indexOf(event.target); // Up
619
-
620
- if (event.key === ARROW_UP_KEY && index > 0) {
621
- index--;
622
- } // Down
623
-
624
-
625
- if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
626
- index++;
627
- } // index is -1 if the first keydown is an ArrowUp
628
-
629
-
630
- index = index === -1 ? 0 : index;
631
- items[index].focus();
632
- }
633
-
634
- }
635
- /**
636
- * ------------------------------------------------------------------------
637
- * Data Api implementation
638
- * ------------------------------------------------------------------------
639
- */
640
-
641
-
642
- EventHandler__default['default'].on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
643
- EventHandler__default['default'].on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
644
- EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
645
- EventHandler__default['default'].on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
646
- EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
647
- event.preventDefault();
648
- Dropdown.dropdownInterface(this);
649
- });
650
- /**
651
- * ------------------------------------------------------------------------
652
- * jQuery
653
- * ------------------------------------------------------------------------
654
- * add .Dropdown to jQuery only if jQuery is present
655
- */
656
-
657
- defineJQueryPlugin(NAME, Dropdown);
658
-
659
- return Dropdown;
660
-
661
- })));
662
- //# sourceMappingURL=dropdown.js.map