mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Dist
This commit is contained in:
parent
bc4272531b
commit
63f3d939ea
@ -68,12 +68,12 @@ params:
|
||||
cdn:
|
||||
# See https://www.srihash.org for info on how to generate the hashes
|
||||
css: "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css"
|
||||
css_hash: "sha384-xNSaKzL9Rjah2RV0MGhtlyVs2areDxovNJCBVnI5Jmo4fWjMx5mx1zyOiddHs4kQ"
|
||||
css_hash: "sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1"
|
||||
css_rtl: "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.rtl.min.css"
|
||||
css_rtl_hash: "sha384-eWxmXwoY7jtZGBMpINmwuxW6Bfzjqsh1pjhGbl58bWpKmsbpGOFaMIthSFY2izhq"
|
||||
css_rtl_hash: "sha384-mUkCBeyHPdg0tqB6JDd+65Gpw5h/l8DKcCTV2D2UpaMMFd7Jo8A+mDAosaWgFBPl"
|
||||
js: "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.min.js"
|
||||
js_hash: "sha384-supZtwqjyYg6XvvTCi4/w6J6Hm6IKqXaaeoyGhIhonCdkSvA70sSucW7OqXIo4lZ"
|
||||
js_hash: "sha384-pQQkAEnwaBkjpqZ8RU1fF1AKtTcHJwFl3pblpTlHXybJjHpMYo79HY3hIi4NKxyj"
|
||||
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"
|
||||
js_bundle_hash: "sha384-G/J8d6sz9bTod37AsZzNtTwT77J24FKjJEO1YsU2vW7iPcmYP3/tznu+LcK824t9"
|
||||
js_bundle_hash: "sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
|
||||
popper: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"
|
||||
popper_hash: "sha384-q2kxQ16AaE6UbzuKqyBE9/u/KzioAlnx2maXQHiDX9d4/zp8Ok3f+M7DPm+Ib6IU"
|
||||
|
2
dist/css/bootstrap-grid.css
vendored
2
dist/css/bootstrap-grid.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Grid v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Grid v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-grid.css.map
vendored
2
dist/css/bootstrap-grid.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-grid.min.css
vendored
2
dist/css/bootstrap-grid.min.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Grid v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Grid v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-grid.min.css.map
vendored
2
dist/css/bootstrap-grid.min.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-grid.rtl.css
vendored
2
dist/css/bootstrap-grid.rtl.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Grid v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Grid v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-grid.rtl.css.map
vendored
2
dist/css/bootstrap-grid.rtl.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-grid.rtl.min.css
vendored
2
dist/css/bootstrap-grid.rtl.min.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Grid v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Grid v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-grid.rtl.min.css.map
vendored
2
dist/css/bootstrap-grid.rtl.min.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-reboot.css
vendored
2
dist/css/bootstrap-reboot.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Reboot v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-reboot.css.map
vendored
2
dist/css/bootstrap-reboot.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-reboot.min.css
vendored
2
dist/css/bootstrap-reboot.min.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Reboot v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-reboot.min.css.map
vendored
2
dist/css/bootstrap-reboot.min.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-reboot.rtl.css
vendored
2
dist/css/bootstrap-reboot.rtl.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Reboot v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-reboot.rtl.css.map
vendored
2
dist/css/bootstrap-reboot.rtl.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-reboot.rtl.min.css
vendored
2
dist/css/bootstrap-reboot.rtl.min.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Reboot v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
|
2
dist/css/bootstrap-reboot.rtl.min.css.map
vendored
2
dist/css/bootstrap-reboot.rtl.min.css.map
vendored
File diff suppressed because one or more lines are too long
12
dist/css/bootstrap-utilities.css
vendored
12
dist/css/bootstrap-utilities.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Utilities v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Utilities v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
@ -182,7 +182,15 @@
|
||||
}
|
||||
|
||||
.translate-middle {
|
||||
transform: translateX(-50%) translateY(-50%) !important;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-x {
|
||||
transform: translateX(-50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-y {
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
|
||||
.border {
|
||||
|
2
dist/css/bootstrap-utilities.css.map
vendored
2
dist/css/bootstrap-utilities.css.map
vendored
File diff suppressed because one or more lines are too long
4
dist/css/bootstrap-utilities.min.css
vendored
4
dist/css/bootstrap-utilities.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-utilities.min.css.map
vendored
2
dist/css/bootstrap-utilities.min.css.map
vendored
File diff suppressed because one or more lines are too long
12
dist/css/bootstrap-utilities.rtl.css
vendored
12
dist/css/bootstrap-utilities.rtl.css
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Utilities v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap Utilities v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
@ -182,7 +182,15 @@
|
||||
}
|
||||
|
||||
.translate-middle {
|
||||
transform: translateX(50%) translateY(-50%) !important;
|
||||
transform: translate(50%, -50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-x {
|
||||
transform: translateX(50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-y {
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
|
||||
.border {
|
||||
|
2
dist/css/bootstrap-utilities.rtl.css.map
vendored
2
dist/css/bootstrap-utilities.rtl.css.map
vendored
File diff suppressed because one or more lines are too long
4
dist/css/bootstrap-utilities.rtl.min.css
vendored
4
dist/css/bootstrap-utilities.rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-utilities.rtl.min.css.map
vendored
2
dist/css/bootstrap-utilities.rtl.min.css.map
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
@ -3443,68 +3443,83 @@ textarea.form-control-lg {
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
.dropdown-menu[style] {
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
.dropdown-menu-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.dropdown-menu-sm-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-sm-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.dropdown-menu-md-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-md-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.dropdown-menu-lg-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-lg-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.dropdown-menu-xl-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-xl-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1400px) {
|
||||
.dropdown-menu-xxl-start {
|
||||
--bs-position: start;
|
||||
right: auto /* rtl:ignore */;
|
||||
left: 0 /* rtl:ignore */;
|
||||
}
|
||||
|
||||
.dropdown-menu-xxl-end {
|
||||
--bs-position: end;
|
||||
right: 0 /* rtl:ignore */;
|
||||
left: auto /* rtl:ignore */;
|
||||
}
|
||||
@ -3585,12 +3600,6 @@ textarea.form-control-lg {
|
||||
vertical-align: 0;
|
||||
}
|
||||
|
||||
.dropdown-menu[x-placement^=top], .dropdown-menu[x-placement^=right], .dropdown-menu[x-placement^=bottom], .dropdown-menu[x-placement^=left] {
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.dropdown-divider {
|
||||
height: 0;
|
||||
margin: 0.5rem 0;
|
||||
@ -5045,29 +5054,34 @@ textarea.form-control-lg {
|
||||
}
|
||||
|
||||
.toast {
|
||||
max-width: 350px;
|
||||
width: 350px;
|
||||
max-width: 100%;
|
||||
font-size: 0.875rem;
|
||||
pointer-events: auto;
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
background-clip: padding-box;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
opacity: 0;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
.toast:not(:last-child) {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.toast.showing {
|
||||
opacity: 1;
|
||||
}
|
||||
.toast.show {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
.toast:not(.showing):not(.show) {
|
||||
opacity: 0;
|
||||
}
|
||||
.toast.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toast-container {
|
||||
width: -webkit-max-content;
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
.toast-container > :not(:last-child) {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.toast-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -5424,56 +5438,56 @@ textarea.form-control-lg {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.bs-tooltip-top, .bs-tooltip-auto[x-placement^=top] {
|
||||
.bs-tooltip-top, .bs-tooltip-auto[data-popper-placement^=top] {
|
||||
padding: 0.4rem 0;
|
||||
}
|
||||
.bs-tooltip-top .tooltip-arrow, .bs-tooltip-auto[x-placement^=top] .tooltip-arrow {
|
||||
.bs-tooltip-top .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow {
|
||||
bottom: 0;
|
||||
}
|
||||
.bs-tooltip-top .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=top] .tooltip-arrow::before {
|
||||
top: 0;
|
||||
.bs-tooltip-top .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
|
||||
top: -1px;
|
||||
border-width: 0.4rem 0.4rem 0;
|
||||
border-top-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-end, .bs-tooltip-auto[x-placement^=right] {
|
||||
.bs-tooltip-end, .bs-tooltip-auto[data-popper-placement^=right] {
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
.bs-tooltip-end .tooltip-arrow, .bs-tooltip-auto[x-placement^=right] .tooltip-arrow {
|
||||
left: 0 /* rtl:ignore */;
|
||||
.bs-tooltip-end .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow {
|
||||
left: 0;
|
||||
width: 0.4rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.bs-tooltip-end .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=right] .tooltip-arrow::before {
|
||||
right: 0 /* rtl:ignore */;
|
||||
border-width: 0.4rem 0.4rem 0.4rem 0 /* rtl:ignore */;
|
||||
border-right-color: #000 /* rtl:ignore */;
|
||||
.bs-tooltip-end .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
|
||||
right: -1px;
|
||||
border-width: 0.4rem 0.4rem 0.4rem 0;
|
||||
border-right-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=bottom] {
|
||||
.bs-tooltip-bottom, .bs-tooltip-auto[data-popper-placement^=bottom] {
|
||||
padding: 0.4rem 0;
|
||||
}
|
||||
.bs-tooltip-bottom .tooltip-arrow, .bs-tooltip-auto[x-placement^=bottom] .tooltip-arrow {
|
||||
.bs-tooltip-bottom .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow {
|
||||
top: 0;
|
||||
}
|
||||
.bs-tooltip-bottom .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=bottom] .tooltip-arrow::before {
|
||||
bottom: 0;
|
||||
.bs-tooltip-bottom .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
|
||||
bottom: -1px;
|
||||
border-width: 0 0.4rem 0.4rem;
|
||||
border-bottom-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-start, .bs-tooltip-auto[x-placement^=left] {
|
||||
.bs-tooltip-start, .bs-tooltip-auto[data-popper-placement^=left] {
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
.bs-tooltip-start .tooltip-arrow, .bs-tooltip-auto[x-placement^=left] .tooltip-arrow {
|
||||
right: 0 /* rtl:ignore */;
|
||||
.bs-tooltip-start .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow {
|
||||
right: 0;
|
||||
width: 0.4rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.bs-tooltip-start .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=left] .tooltip-arrow::before {
|
||||
left: 0 /* rtl:ignore */;
|
||||
border-width: 0.4rem 0 0.4rem 0.4rem /* rtl:ignore */;
|
||||
border-left-color: #000 /* rtl:ignore */;
|
||||
.bs-tooltip-start .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
|
||||
left: -1px;
|
||||
border-width: 0.4rem 0 0.4rem 0.4rem;
|
||||
border-left-color: #000;
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
@ -5528,60 +5542,60 @@ textarea.form-control-lg {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.bs-popover-top, .bs-popover-auto[x-placement^=top] {
|
||||
margin-bottom: 0.5rem;
|
||||
.bs-popover-top, .bs-popover-auto[data-popper-placement^=top] {
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-top > .popover-arrow, .bs-popover-auto[x-placement^=top] > .popover-arrow {
|
||||
.bs-popover-top > .popover-arrow, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow {
|
||||
bottom: calc(-0.5rem - 1px);
|
||||
}
|
||||
.bs-popover-top > .popover-arrow::before, .bs-popover-auto[x-placement^=top] > .popover-arrow::before {
|
||||
.bs-popover-top > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow::before {
|
||||
bottom: 0;
|
||||
border-width: 0.5rem 0.5rem 0;
|
||||
border-top-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-top > .popover-arrow::after, .bs-popover-auto[x-placement^=top] > .popover-arrow::after {
|
||||
.bs-popover-top > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow::after {
|
||||
bottom: 1px;
|
||||
border-width: 0.5rem 0.5rem 0;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.bs-popover-end, .bs-popover-auto[x-placement^=right] {
|
||||
margin-left: 0.5rem /* rtl:ignore */;
|
||||
.bs-popover-end, .bs-popover-auto[data-popper-placement^=right] {
|
||||
margin-left: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-end > .popover-arrow, .bs-popover-auto[x-placement^=right] > .popover-arrow {
|
||||
left: calc(-0.5rem - 1px) /* rtl:ignore */;
|
||||
.bs-popover-end > .popover-arrow, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow {
|
||||
left: calc(-0.5rem - 1px);
|
||||
width: 0.5rem;
|
||||
height: 1rem;
|
||||
margin: 0.3rem 0;
|
||||
}
|
||||
.bs-popover-end > .popover-arrow::before, .bs-popover-auto[x-placement^=right] > .popover-arrow::before {
|
||||
left: 0 /* rtl:ignore */;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0 /* rtl:ignore */;
|
||||
border-right-color: rgba(0, 0, 0, 0.25) /* rtl:ignore */;
|
||||
.bs-popover-end > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow::before {
|
||||
left: 0;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0;
|
||||
border-right-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-end > .popover-arrow::after, .bs-popover-auto[x-placement^=right] > .popover-arrow::after {
|
||||
left: 1px /* rtl:ignore */;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0 /* rtl:ignore */;
|
||||
border-right-color: #fff /* rtl:ignore */;
|
||||
.bs-popover-end > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow::after {
|
||||
left: 1px;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
|
||||
.bs-popover-bottom, .bs-popover-auto[x-placement^=bottom] {
|
||||
margin-top: 0.5rem;
|
||||
.bs-popover-bottom, .bs-popover-auto[data-popper-placement^=bottom] {
|
||||
margin-top: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow, .bs-popover-auto[x-placement^=bottom] > .popover-arrow {
|
||||
.bs-popover-bottom > .popover-arrow, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow {
|
||||
top: calc(-0.5rem - 1px);
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[x-placement^=bottom] > .popover-arrow::before {
|
||||
.bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::before {
|
||||
top: 0;
|
||||
border-width: 0 0.5rem 0.5rem 0.5rem;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[x-placement^=bottom] > .popover-arrow::after {
|
||||
.bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::after {
|
||||
top: 1px;
|
||||
border-width: 0 0.5rem 0.5rem 0.5rem;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^=bottom] .popover-header::before {
|
||||
.bs-popover-bottom .popover-header::before, .bs-popover-auto[data-popper-placement^=bottom] .popover-header::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
@ -5592,24 +5606,24 @@ textarea.form-control-lg {
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.bs-popover-start, .bs-popover-auto[x-placement^=left] {
|
||||
margin-right: 0.5rem /* rtl:ignore */;
|
||||
.bs-popover-start, .bs-popover-auto[data-popper-placement^=left] {
|
||||
margin-right: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-start > .popover-arrow, .bs-popover-auto[x-placement^=left] > .popover-arrow {
|
||||
right: calc(-0.5rem - 1px) /* rtl:ignore */;
|
||||
.bs-popover-start > .popover-arrow, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow {
|
||||
right: calc(-0.5rem - 1px);
|
||||
width: 0.5rem;
|
||||
height: 1rem;
|
||||
margin: 0.3rem 0;
|
||||
}
|
||||
.bs-popover-start > .popover-arrow::before, .bs-popover-auto[x-placement^=left] > .popover-arrow::before {
|
||||
right: 0 /* rtl:ignore */;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem /* rtl:ignore */;
|
||||
border-left-color: rgba(0, 0, 0, 0.25) /* rtl:ignore */;
|
||||
.bs-popover-start > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow::before {
|
||||
right: 0;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem;
|
||||
border-left-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-start > .popover-arrow::after, .bs-popover-auto[x-placement^=left] > .popover-arrow::after {
|
||||
right: 1px /* rtl:ignore */;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem /* rtl:ignore */;
|
||||
border-left-color: #fff /* rtl:ignore */;
|
||||
.bs-popover-start > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow::after {
|
||||
right: 1px;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
|
||||
.popover-header {
|
||||
@ -6268,7 +6282,15 @@ textarea.form-control-lg {
|
||||
}
|
||||
|
||||
.translate-middle {
|
||||
transform: translateX(-50%) translateY(-50%) !important;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-x {
|
||||
transform: translateX(-50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-y {
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
|
||||
.border {
|
||||
|
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
4
dist/css/bootstrap.min.css
vendored
4
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css.map
vendored
2
dist/css/bootstrap.min.css.map
vendored
File diff suppressed because one or more lines are too long
174
dist/css/bootstrap.rtl.css
vendored
174
dist/css/bootstrap.rtl.css
vendored
@ -1,6 +1,6 @@
|
||||
@charset "UTF-8";
|
||||
/*!
|
||||
* Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors
|
||||
* Copyright 2011-2020 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
@ -3441,68 +3441,83 @@ textarea.form-control-lg {
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
.dropdown-menu[style] {
|
||||
left: auto !important;
|
||||
}
|
||||
|
||||
.dropdown-menu-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.dropdown-menu-sm-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-sm-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.dropdown-menu-md-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-md-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.dropdown-menu-lg-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-lg-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.dropdown-menu-xl-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-xl-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1400px) {
|
||||
.dropdown-menu-xxl-start {
|
||||
--bs-position: start;
|
||||
right: auto ;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
.dropdown-menu-xxl-end {
|
||||
--bs-position: end;
|
||||
right: 0 ;
|
||||
left: auto ;
|
||||
}
|
||||
@ -3583,12 +3598,6 @@ textarea.form-control-lg {
|
||||
vertical-align: 0;
|
||||
}
|
||||
|
||||
.dropdown-menu[x-placement^=top], .dropdown-menu[x-placement^=right], .dropdown-menu[x-placement^=bottom], .dropdown-menu[x-placement^=left] {
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.dropdown-divider {
|
||||
height: 0;
|
||||
margin: 0.5rem 0;
|
||||
@ -5043,29 +5052,34 @@ textarea.form-control-lg {
|
||||
}
|
||||
|
||||
.toast {
|
||||
max-width: 350px;
|
||||
width: 350px;
|
||||
max-width: 100%;
|
||||
font-size: 0.875rem;
|
||||
pointer-events: auto;
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
background-clip: padding-box;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
opacity: 0;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
.toast:not(:last-child) {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.toast.showing {
|
||||
opacity: 1;
|
||||
}
|
||||
.toast.show {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
.toast:not(.showing):not(.show) {
|
||||
opacity: 0;
|
||||
}
|
||||
.toast.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toast-container {
|
||||
width: -webkit-max-content;
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
.toast-container > :not(:last-child) {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.toast-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -5422,56 +5436,56 @@ textarea.form-control-lg {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.bs-tooltip-top, .bs-tooltip-auto[x-placement^=top] {
|
||||
.bs-tooltip-top, .bs-tooltip-auto[data-popper-placement^=top] {
|
||||
padding: 0.4rem 0;
|
||||
}
|
||||
.bs-tooltip-top .tooltip-arrow, .bs-tooltip-auto[x-placement^=top] .tooltip-arrow {
|
||||
.bs-tooltip-top .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow {
|
||||
bottom: 0;
|
||||
}
|
||||
.bs-tooltip-top .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=top] .tooltip-arrow::before {
|
||||
top: 0;
|
||||
.bs-tooltip-top .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
|
||||
top: -1px;
|
||||
border-width: 0.4rem 0.4rem 0;
|
||||
border-top-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-end, .bs-tooltip-auto[x-placement^=right] {
|
||||
.bs-tooltip-end, .bs-tooltip-auto[data-popper-placement^=right] {
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
.bs-tooltip-end .tooltip-arrow, .bs-tooltip-auto[x-placement^=right] .tooltip-arrow {
|
||||
left: 0 ;
|
||||
.bs-tooltip-end .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow {
|
||||
right: 0;
|
||||
width: 0.4rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.bs-tooltip-end .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=right] .tooltip-arrow::before {
|
||||
right: 0 ;
|
||||
border-width: 0.4rem 0.4rem 0.4rem 0 ;
|
||||
border-right-color: #000 ;
|
||||
.bs-tooltip-end .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
|
||||
left: -1px;
|
||||
border-width: 0.4rem 0 0.4rem 0.4rem;
|
||||
border-left-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=bottom] {
|
||||
.bs-tooltip-bottom, .bs-tooltip-auto[data-popper-placement^=bottom] {
|
||||
padding: 0.4rem 0;
|
||||
}
|
||||
.bs-tooltip-bottom .tooltip-arrow, .bs-tooltip-auto[x-placement^=bottom] .tooltip-arrow {
|
||||
.bs-tooltip-bottom .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow {
|
||||
top: 0;
|
||||
}
|
||||
.bs-tooltip-bottom .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=bottom] .tooltip-arrow::before {
|
||||
bottom: 0;
|
||||
.bs-tooltip-bottom .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
|
||||
bottom: -1px;
|
||||
border-width: 0 0.4rem 0.4rem;
|
||||
border-bottom-color: #000;
|
||||
}
|
||||
|
||||
.bs-tooltip-start, .bs-tooltip-auto[x-placement^=left] {
|
||||
.bs-tooltip-start, .bs-tooltip-auto[data-popper-placement^=left] {
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
.bs-tooltip-start .tooltip-arrow, .bs-tooltip-auto[x-placement^=left] .tooltip-arrow {
|
||||
right: 0 ;
|
||||
.bs-tooltip-start .tooltip-arrow, .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow {
|
||||
left: 0;
|
||||
width: 0.4rem;
|
||||
height: 0.8rem;
|
||||
}
|
||||
.bs-tooltip-start .tooltip-arrow::before, .bs-tooltip-auto[x-placement^=left] .tooltip-arrow::before {
|
||||
left: 0 ;
|
||||
border-width: 0.4rem 0 0.4rem 0.4rem ;
|
||||
border-left-color: #000 ;
|
||||
.bs-tooltip-start .tooltip-arrow::before, .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
|
||||
right: -1px;
|
||||
border-width: 0.4rem 0.4rem 0.4rem 0;
|
||||
border-right-color: #000;
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
@ -5526,60 +5540,60 @@ textarea.form-control-lg {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.bs-popover-top, .bs-popover-auto[x-placement^=top] {
|
||||
margin-bottom: 0.5rem;
|
||||
.bs-popover-top, .bs-popover-auto[data-popper-placement^=top] {
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-top > .popover-arrow, .bs-popover-auto[x-placement^=top] > .popover-arrow {
|
||||
.bs-popover-top > .popover-arrow, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow {
|
||||
bottom: calc(-0.5rem - 1px);
|
||||
}
|
||||
.bs-popover-top > .popover-arrow::before, .bs-popover-auto[x-placement^=top] > .popover-arrow::before {
|
||||
.bs-popover-top > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow::before {
|
||||
bottom: 0;
|
||||
border-width: 0.5rem 0.5rem 0;
|
||||
border-top-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-top > .popover-arrow::after, .bs-popover-auto[x-placement^=top] > .popover-arrow::after {
|
||||
.bs-popover-top > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow::after {
|
||||
bottom: 1px;
|
||||
border-width: 0.5rem 0.5rem 0;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.bs-popover-end, .bs-popover-auto[x-placement^=right] {
|
||||
margin-left: 0.5rem ;
|
||||
.bs-popover-end, .bs-popover-auto[data-popper-placement^=right] {
|
||||
margin-right: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-end > .popover-arrow, .bs-popover-auto[x-placement^=right] > .popover-arrow {
|
||||
left: calc(-0.5rem - 1px) ;
|
||||
.bs-popover-end > .popover-arrow, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow {
|
||||
right: calc(-0.5rem - 1px);
|
||||
width: 0.5rem;
|
||||
height: 1rem;
|
||||
margin: 0.3rem 0;
|
||||
}
|
||||
.bs-popover-end > .popover-arrow::before, .bs-popover-auto[x-placement^=right] > .popover-arrow::before {
|
||||
left: 0 ;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0 ;
|
||||
border-right-color: rgba(0, 0, 0, 0.25) ;
|
||||
.bs-popover-end > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow::before {
|
||||
right: 0;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem;
|
||||
border-left-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-end > .popover-arrow::after, .bs-popover-auto[x-placement^=right] > .popover-arrow::after {
|
||||
left: 1px ;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0 ;
|
||||
border-right-color: #fff ;
|
||||
.bs-popover-end > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=right] > .popover-arrow::after {
|
||||
right: 1px;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
|
||||
.bs-popover-bottom, .bs-popover-auto[x-placement^=bottom] {
|
||||
margin-top: 0.5rem;
|
||||
.bs-popover-bottom, .bs-popover-auto[data-popper-placement^=bottom] {
|
||||
margin-top: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow, .bs-popover-auto[x-placement^=bottom] > .popover-arrow {
|
||||
.bs-popover-bottom > .popover-arrow, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow {
|
||||
top: calc(-0.5rem - 1px);
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[x-placement^=bottom] > .popover-arrow::before {
|
||||
.bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::before {
|
||||
top: 0;
|
||||
border-width: 0 0.5rem 0.5rem 0.5rem;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[x-placement^=bottom] > .popover-arrow::after {
|
||||
.bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::after {
|
||||
top: 1px;
|
||||
border-width: 0 0.5rem 0.5rem 0.5rem;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^=bottom] .popover-header::before {
|
||||
.bs-popover-bottom .popover-header::before, .bs-popover-auto[data-popper-placement^=bottom] .popover-header::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 50%;
|
||||
@ -5590,24 +5604,24 @@ textarea.form-control-lg {
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.bs-popover-start, .bs-popover-auto[x-placement^=left] {
|
||||
margin-right: 0.5rem ;
|
||||
.bs-popover-start, .bs-popover-auto[data-popper-placement^=left] {
|
||||
margin-left: 0.5rem !important;
|
||||
}
|
||||
.bs-popover-start > .popover-arrow, .bs-popover-auto[x-placement^=left] > .popover-arrow {
|
||||
right: calc(-0.5rem - 1px) ;
|
||||
.bs-popover-start > .popover-arrow, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow {
|
||||
left: calc(-0.5rem - 1px);
|
||||
width: 0.5rem;
|
||||
height: 1rem;
|
||||
margin: 0.3rem 0;
|
||||
}
|
||||
.bs-popover-start > .popover-arrow::before, .bs-popover-auto[x-placement^=left] > .popover-arrow::before {
|
||||
right: 0 ;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem ;
|
||||
border-left-color: rgba(0, 0, 0, 0.25) ;
|
||||
.bs-popover-start > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow::before {
|
||||
left: 0;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0;
|
||||
border-right-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.bs-popover-start > .popover-arrow::after, .bs-popover-auto[x-placement^=left] > .popover-arrow::after {
|
||||
right: 1px ;
|
||||
border-width: 0.5rem 0 0.5rem 0.5rem ;
|
||||
border-left-color: #fff ;
|
||||
.bs-popover-start > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=left] > .popover-arrow::after {
|
||||
left: 1px;
|
||||
border-width: 0.5rem 0.5rem 0.5rem 0;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
|
||||
.popover-header {
|
||||
@ -6253,7 +6267,15 @@ textarea.form-control-lg {
|
||||
}
|
||||
|
||||
.translate-middle {
|
||||
transform: translateX(50%) translateY(-50%) !important;
|
||||
transform: translate(50%, -50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-x {
|
||||
transform: translateX(50%) !important;
|
||||
}
|
||||
|
||||
.translate-middle-y {
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
|
||||
.border {
|
||||
|
2
dist/css/bootstrap.rtl.css.map
vendored
2
dist/css/bootstrap.rtl.css.map
vendored
File diff suppressed because one or more lines are too long
4
dist/css/bootstrap.rtl.min.css
vendored
4
dist/css/bootstrap.rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.rtl.min.css.map
vendored
2
dist/css/bootstrap.rtl.min.css.map
vendored
File diff suppressed because one or more lines are too long
4248
dist/js/bootstrap.bundle.js
vendored
4248
dist/js/bootstrap.bundle.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -236,7 +236,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/data.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -303,7 +303,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/event-handler.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -582,7 +582,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
@ -865,7 +865,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/manipulator.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -937,7 +937,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/selector-engine.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2030,2619 +2030,1720 @@
|
||||
}
|
||||
});
|
||||
|
||||
/**!
|
||||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||||
* @version 1.16.1
|
||||
* @license
|
||||
* Copyright (c) 2016 Federico Zivolo and contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
|
||||
var top = 'top';
|
||||
var bottom = 'bottom';
|
||||
var right = 'right';
|
||||
var left = 'left';
|
||||
var auto = 'auto';
|
||||
var basePlacements = [top, bottom, right, left];
|
||||
var start = 'start';
|
||||
var end = 'end';
|
||||
var clippingParents = 'clippingParents';
|
||||
var viewport = 'viewport';
|
||||
var popper = 'popper';
|
||||
var reference = 'reference';
|
||||
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
||||
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
||||
}, []);
|
||||
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
||||
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
||||
}, []); // modifiers that need to read the DOM
|
||||
|
||||
var timeoutDuration = function () {
|
||||
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
||||
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
||||
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}();
|
||||
var beforeRead = 'beforeRead';
|
||||
var read = 'read';
|
||||
var afterRead = 'afterRead'; // pure-logic modifiers
|
||||
|
||||
function microtaskDebounce(fn) {
|
||||
var called = false;
|
||||
return function () {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
called = true;
|
||||
window.Promise.resolve().then(function () {
|
||||
called = false;
|
||||
fn();
|
||||
});
|
||||
};
|
||||
var beforeMain = 'beforeMain';
|
||||
var main = 'main';
|
||||
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
||||
|
||||
var beforeWrite = 'beforeWrite';
|
||||
var write = 'write';
|
||||
var afterWrite = 'afterWrite';
|
||||
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
||||
|
||||
function getNodeName(element) {
|
||||
return element ? (element.nodeName || '').toLowerCase() : null;
|
||||
}
|
||||
|
||||
function taskDebounce(fn) {
|
||||
var scheduled = false;
|
||||
return function () {
|
||||
if (!scheduled) {
|
||||
scheduled = true;
|
||||
setTimeout(function () {
|
||||
scheduled = false;
|
||||
fn();
|
||||
}, timeoutDuration);
|
||||
}
|
||||
};
|
||||
}
|
||||
/*:: import type { Window } from '../types'; */
|
||||
|
||||
var supportsMicroTasks = isBrowser && window.Promise;
|
||||
|
||||
/**
|
||||
* Create a debounced version of a method, that's asynchronously deferred
|
||||
* but called in the minimum time possible.
|
||||
*
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Function} fn
|
||||
* @returns {Function}
|
||||
*/
|
||||
var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
|
||||
|
||||
/**
|
||||
* Check if the given variable is a function
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Any} functionToCheck - variable to check
|
||||
* @returns {Boolean} answer to: is a function?
|
||||
*/
|
||||
function isFunction(functionToCheck) {
|
||||
var getType = {};
|
||||
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get CSS computed property of the given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Eement} element
|
||||
* @argument {String} property
|
||||
*/
|
||||
function getStyleComputedProperty(element, property) {
|
||||
if (element.nodeType !== 1) {
|
||||
return [];
|
||||
}
|
||||
// NOTE: 1 DOM access here
|
||||
var window = element.ownerDocument.defaultView;
|
||||
var css = window.getComputedStyle(element, null);
|
||||
return property ? css[property] : css;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parentNode or the host of the element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @returns {Element} parent
|
||||
*/
|
||||
function getParentNode(element) {
|
||||
if (element.nodeName === 'HTML') {
|
||||
return element;
|
||||
}
|
||||
return element.parentNode || element.host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the scrolling parent of the given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @returns {Element} scroll parent
|
||||
*/
|
||||
function getScrollParent(element) {
|
||||
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
|
||||
if (!element) {
|
||||
return document.body;
|
||||
}
|
||||
|
||||
switch (element.nodeName) {
|
||||
case 'HTML':
|
||||
case 'BODY':
|
||||
return element.ownerDocument.body;
|
||||
case '#document':
|
||||
return element.body;
|
||||
}
|
||||
|
||||
// Firefox want us to check `-x` and `-y` variations as well
|
||||
|
||||
var _getStyleComputedProp = getStyleComputedProperty(element),
|
||||
overflow = _getStyleComputedProp.overflow,
|
||||
overflowX = _getStyleComputedProp.overflowX,
|
||||
overflowY = _getStyleComputedProp.overflowY;
|
||||
|
||||
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
||||
return element;
|
||||
}
|
||||
|
||||
return getScrollParent(getParentNode(element));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the reference node of the reference object, or the reference object itself.
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Element|Object} reference - the reference element (the popper will be relative to this)
|
||||
* @returns {Element} parent
|
||||
*/
|
||||
function getReferenceNode(reference) {
|
||||
return reference && reference.referenceNode ? reference.referenceNode : reference;
|
||||
}
|
||||
|
||||
var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
||||
var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
|
||||
|
||||
/**
|
||||
* Determines if the browser is Internet Explorer
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Number} version to check
|
||||
* @returns {Boolean} isIE
|
||||
*/
|
||||
function isIE(version) {
|
||||
if (version === 11) {
|
||||
return isIE11;
|
||||
}
|
||||
if (version === 10) {
|
||||
return isIE10;
|
||||
}
|
||||
return isIE11 || isIE10;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the offset parent of the given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @returns {Element} offset parent
|
||||
*/
|
||||
function getOffsetParent(element) {
|
||||
if (!element) {
|
||||
return document.documentElement;
|
||||
}
|
||||
|
||||
var noOffsetParent = isIE(10) ? document.body : null;
|
||||
|
||||
// NOTE: 1 DOM access here
|
||||
var offsetParent = element.offsetParent || null;
|
||||
// Skip hidden elements which don't have an offsetParent
|
||||
while (offsetParent === noOffsetParent && element.nextElementSibling) {
|
||||
offsetParent = (element = element.nextElementSibling).offsetParent;
|
||||
}
|
||||
|
||||
var nodeName = offsetParent && offsetParent.nodeName;
|
||||
|
||||
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
|
||||
return element ? element.ownerDocument.documentElement : document.documentElement;
|
||||
}
|
||||
|
||||
// .offsetParent will return the closest TH, TD or TABLE in case
|
||||
// no offsetParent is present, I hate this job...
|
||||
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
|
||||
return getOffsetParent(offsetParent);
|
||||
}
|
||||
|
||||
return offsetParent;
|
||||
}
|
||||
|
||||
function isOffsetContainer(element) {
|
||||
var nodeName = element.nodeName;
|
||||
|
||||
if (nodeName === 'BODY') {
|
||||
return false;
|
||||
}
|
||||
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the root node (document, shadowDOM root) of the given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} node
|
||||
* @returns {Element} root node
|
||||
*/
|
||||
function getRoot(node) {
|
||||
if (node.parentNode !== null) {
|
||||
return getRoot(node.parentNode);
|
||||
/*:: declare function getWindow(node: Node | Window): Window; */
|
||||
function getWindow(node) {
|
||||
if (node.toString() !== '[object Window]') {
|
||||
var ownerDocument = node.ownerDocument;
|
||||
return ownerDocument ? ownerDocument.defaultView || window : window;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the offset parent common to the two provided nodes
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element1
|
||||
* @argument {Element} element2
|
||||
* @returns {Element} common offset parent
|
||||
*/
|
||||
function findCommonOffsetParent(element1, element2) {
|
||||
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
|
||||
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
|
||||
return document.documentElement;
|
||||
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
|
||||
Element); */
|
||||
|
||||
function isElement$1(node) {
|
||||
var OwnElement = getWindow(node).Element;
|
||||
return node instanceof OwnElement || node instanceof Element;
|
||||
}
|
||||
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
|
||||
HTMLElement); */
|
||||
|
||||
|
||||
function isHTMLElement(node) {
|
||||
var OwnElement = getWindow(node).HTMLElement;
|
||||
return node instanceof OwnElement || node instanceof HTMLElement;
|
||||
}
|
||||
/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
|
||||
ShadowRoot); */
|
||||
|
||||
|
||||
function isShadowRoot(node) {
|
||||
var OwnElement = getWindow(node).ShadowRoot;
|
||||
return node instanceof OwnElement || node instanceof ShadowRoot;
|
||||
}
|
||||
|
||||
// and applies them to the HTMLElements such as popper and arrow
|
||||
|
||||
function applyStyles(_ref) {
|
||||
var state = _ref.state;
|
||||
Object.keys(state.elements).forEach(function (name) {
|
||||
var style = state.styles[name] || {};
|
||||
var attributes = state.attributes[name] || {};
|
||||
var element = state.elements[name]; // arrow is optional + virtual elements
|
||||
|
||||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||||
return;
|
||||
} // Flow doesn't support to extend this property, but it's the most
|
||||
// effective way to apply styles to an HTMLElement
|
||||
// $FlowFixMe
|
||||
|
||||
|
||||
Object.assign(element.style, style);
|
||||
Object.keys(attributes).forEach(function (name) {
|
||||
var value = attributes[name];
|
||||
|
||||
if (value === false) {
|
||||
element.removeAttribute(name);
|
||||
} else {
|
||||
element.setAttribute(name, value === true ? '' : value);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function effect(_ref2) {
|
||||
var state = _ref2.state;
|
||||
var initialStyles = {
|
||||
popper: {
|
||||
position: state.options.strategy,
|
||||
left: '0',
|
||||
top: '0',
|
||||
margin: '0'
|
||||
},
|
||||
arrow: {
|
||||
position: 'absolute'
|
||||
},
|
||||
reference: {}
|
||||
};
|
||||
Object.assign(state.elements.popper.style, initialStyles.popper);
|
||||
|
||||
if (state.elements.arrow) {
|
||||
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
||||
}
|
||||
|
||||
// Here we make sure to give as "start" the element that comes first in the DOM
|
||||
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
|
||||
var start = order ? element1 : element2;
|
||||
var end = order ? element2 : element1;
|
||||
return function () {
|
||||
Object.keys(state.elements).forEach(function (name) {
|
||||
var element = state.elements[name];
|
||||
var attributes = state.attributes[name] || {};
|
||||
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
||||
|
||||
// Get common ancestor container
|
||||
var range = document.createRange();
|
||||
range.setStart(start, 0);
|
||||
range.setEnd(end, 0);
|
||||
var commonAncestorContainer = range.commonAncestorContainer;
|
||||
var style = styleProperties.reduce(function (style, property) {
|
||||
style[property] = '';
|
||||
return style;
|
||||
}, {}); // arrow is optional + virtual elements
|
||||
|
||||
// Both nodes are inside #document
|
||||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||||
return;
|
||||
} // Flow doesn't support to extend this property, but it's the most
|
||||
// effective way to apply styles to an HTMLElement
|
||||
// $FlowFixMe
|
||||
|
||||
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
|
||||
if (isOffsetContainer(commonAncestorContainer)) {
|
||||
return commonAncestorContainer;
|
||||
}
|
||||
|
||||
return getOffsetParent(commonAncestorContainer);
|
||||
}
|
||||
Object.assign(element.style, style);
|
||||
Object.keys(attributes).forEach(function (attribute) {
|
||||
element.removeAttribute(attribute);
|
||||
});
|
||||
});
|
||||
};
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
// one of the nodes is inside shadowDOM, find which one
|
||||
var element1root = getRoot(element1);
|
||||
if (element1root.host) {
|
||||
return findCommonOffsetParent(element1root.host, element2);
|
||||
} else {
|
||||
return findCommonOffsetParent(element1, getRoot(element2).host);
|
||||
}
|
||||
|
||||
var applyStyles$1 = {
|
||||
name: 'applyStyles',
|
||||
enabled: true,
|
||||
phase: 'write',
|
||||
fn: applyStyles,
|
||||
effect: effect,
|
||||
requires: ['computeStyles']
|
||||
};
|
||||
|
||||
function getBasePlacement(placement) {
|
||||
return placement.split('-')[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the scroll value of the given element in the given side (top and left)
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @argument {String} side `top` or `left`
|
||||
* @returns {number} amount of scrolled pixels
|
||||
*/
|
||||
function getScroll(element) {
|
||||
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
||||
|
||||
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
|
||||
var nodeName = element.nodeName;
|
||||
|
||||
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
||||
var html = element.ownerDocument.documentElement;
|
||||
var scrollingElement = element.ownerDocument.scrollingElement || html;
|
||||
return scrollingElement[upperSide];
|
||||
}
|
||||
|
||||
return element[upperSide];
|
||||
}
|
||||
|
||||
/*
|
||||
* Sum or subtract the element scroll values (left and top) from a given rect object
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Object} rect - Rect object you want to change
|
||||
* @param {HTMLElement} element - The element from the function reads the scroll values
|
||||
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
|
||||
* @return {Object} rect - The modifier rect object
|
||||
*/
|
||||
function includeScroll(rect, element) {
|
||||
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
|
||||
var scrollTop = getScroll(element, 'top');
|
||||
var scrollLeft = getScroll(element, 'left');
|
||||
var modifier = subtract ? -1 : 1;
|
||||
rect.top += scrollTop * modifier;
|
||||
rect.bottom += scrollTop * modifier;
|
||||
rect.left += scrollLeft * modifier;
|
||||
rect.right += scrollLeft * modifier;
|
||||
return rect;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper to detect borders of a given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {CSSStyleDeclaration} styles
|
||||
* Result of `getStyleComputedProperty` on the given element
|
||||
* @param {String} axis - `x` or `y`
|
||||
* @return {number} borders - The borders size of the given axis
|
||||
*/
|
||||
|
||||
function getBordersSize(styles, axis) {
|
||||
var sideA = axis === 'x' ? 'Left' : 'Top';
|
||||
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
||||
|
||||
return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
|
||||
}
|
||||
|
||||
function getSize(axis, body, html, computedStyle) {
|
||||
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
||||
}
|
||||
|
||||
function getWindowSizes(document) {
|
||||
var body = document.body;
|
||||
var html = document.documentElement;
|
||||
var computedStyle = isIE(10) && getComputedStyle(html);
|
||||
|
||||
// Returns the layout rect of an element relative to its offsetParent. Layout
|
||||
// means it doesn't take into account transforms.
|
||||
function getLayoutRect(element) {
|
||||
return {
|
||||
height: getSize('Height', body, html, computedStyle),
|
||||
width: getSize('Width', body, html, computedStyle)
|
||||
x: element.offsetLeft,
|
||||
y: element.offsetTop,
|
||||
width: element.offsetWidth,
|
||||
height: element.offsetHeight
|
||||
};
|
||||
}
|
||||
|
||||
var classCallCheck = function (instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
};
|
||||
function contains(parent, child) {
|
||||
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
||||
|
||||
var createClass = function () {
|
||||
function defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
return function (Constructor, protoProps, staticProps) {
|
||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
};
|
||||
}();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var defineProperty = function (obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var _extends$1 = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
/**
|
||||
* Given element offsets, generate an output similar to getBoundingClientRect
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Object} offsets
|
||||
* @returns {Object} ClientRect like output
|
||||
*/
|
||||
function getClientRect(offsets) {
|
||||
return _extends$1({}, offsets, {
|
||||
right: offsets.left + offsets.width,
|
||||
bottom: offsets.top + offsets.height
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bounding client rect of given element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {HTMLElement} element
|
||||
* @return {Object} client rect
|
||||
*/
|
||||
function getBoundingClientRect(element) {
|
||||
var rect = {};
|
||||
|
||||
// IE10 10 FIX: Please, don't ask, the element isn't
|
||||
// considered in DOM in some circumstances...
|
||||
// This isn't reproducible in IE10 compatibility mode of IE11
|
||||
try {
|
||||
if (isIE(10)) {
|
||||
rect = element.getBoundingClientRect();
|
||||
var scrollTop = getScroll(element, 'top');
|
||||
var scrollLeft = getScroll(element, 'left');
|
||||
rect.top += scrollTop;
|
||||
rect.left += scrollLeft;
|
||||
rect.bottom += scrollTop;
|
||||
rect.right += scrollLeft;
|
||||
} else {
|
||||
rect = element.getBoundingClientRect();
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
var result = {
|
||||
left: rect.left,
|
||||
top: rect.top,
|
||||
width: rect.right - rect.left,
|
||||
height: rect.bottom - rect.top
|
||||
};
|
||||
|
||||
// subtract scrollbar size from sizes
|
||||
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
||||
var width = sizes.width || element.clientWidth || result.width;
|
||||
var height = sizes.height || element.clientHeight || result.height;
|
||||
|
||||
var horizScrollbar = element.offsetWidth - width;
|
||||
var vertScrollbar = element.offsetHeight - height;
|
||||
|
||||
// if an hypothetical scrollbar is detected, we must be sure it's not a `border`
|
||||
// we make this check conditional for performance reasons
|
||||
if (horizScrollbar || vertScrollbar) {
|
||||
var styles = getStyleComputedProperty(element);
|
||||
horizScrollbar -= getBordersSize(styles, 'x');
|
||||
vertScrollbar -= getBordersSize(styles, 'y');
|
||||
|
||||
result.width -= horizScrollbar;
|
||||
result.height -= vertScrollbar;
|
||||
}
|
||||
|
||||
return getClientRect(result);
|
||||
}
|
||||
|
||||
function getOffsetRectRelativeToArbitraryNode(children, parent) {
|
||||
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
||||
|
||||
var isIE10 = isIE(10);
|
||||
var isHTML = parent.nodeName === 'HTML';
|
||||
var childrenRect = getBoundingClientRect(children);
|
||||
var parentRect = getBoundingClientRect(parent);
|
||||
var scrollParent = getScrollParent(children);
|
||||
|
||||
var styles = getStyleComputedProperty(parent);
|
||||
var borderTopWidth = parseFloat(styles.borderTopWidth);
|
||||
var borderLeftWidth = parseFloat(styles.borderLeftWidth);
|
||||
|
||||
// In cases where the parent is fixed, we must ignore negative scroll in offset calc
|
||||
if (fixedPosition && isHTML) {
|
||||
parentRect.top = Math.max(parentRect.top, 0);
|
||||
parentRect.left = Math.max(parentRect.left, 0);
|
||||
}
|
||||
var offsets = getClientRect({
|
||||
top: childrenRect.top - parentRect.top - borderTopWidth,
|
||||
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
||||
width: childrenRect.width,
|
||||
height: childrenRect.height
|
||||
});
|
||||
offsets.marginTop = 0;
|
||||
offsets.marginLeft = 0;
|
||||
|
||||
// Subtract margins of documentElement in case it's being used as parent
|
||||
// we do this only on HTML because it's the only element that behaves
|
||||
// differently when margins are applied to it. The margins are included in
|
||||
// the box of the documentElement, in the other cases not.
|
||||
if (!isIE10 && isHTML) {
|
||||
var marginTop = parseFloat(styles.marginTop);
|
||||
var marginLeft = parseFloat(styles.marginLeft);
|
||||
|
||||
offsets.top -= borderTopWidth - marginTop;
|
||||
offsets.bottom -= borderTopWidth - marginTop;
|
||||
offsets.left -= borderLeftWidth - marginLeft;
|
||||
offsets.right -= borderLeftWidth - marginLeft;
|
||||
|
||||
// Attach marginTop and marginLeft because in some circumstances we may need them
|
||||
offsets.marginTop = marginTop;
|
||||
offsets.marginLeft = marginLeft;
|
||||
}
|
||||
|
||||
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
|
||||
offsets = includeScroll(offsets, parent);
|
||||
}
|
||||
|
||||
return offsets;
|
||||
}
|
||||
|
||||
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
|
||||
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
|
||||
var html = element.ownerDocument.documentElement;
|
||||
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
|
||||
var width = Math.max(html.clientWidth, window.innerWidth || 0);
|
||||
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
||||
|
||||
var scrollTop = !excludeScroll ? getScroll(html) : 0;
|
||||
var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
|
||||
|
||||
var offset = {
|
||||
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
||||
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
return getClientRect(offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given element is fixed or is inside a fixed parent
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @argument {Element} customContainer
|
||||
* @returns {Boolean} answer to "isFixed?"
|
||||
*/
|
||||
function isFixed(element) {
|
||||
var nodeName = element.nodeName;
|
||||
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
||||
return false;
|
||||
}
|
||||
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
||||
if (parent.contains(child)) {
|
||||
return true;
|
||||
}
|
||||
var parentNode = getParentNode(element);
|
||||
if (!parentNode) {
|
||||
return false;
|
||||
}
|
||||
return isFixed(parentNode);
|
||||
} // then fallback to custom implementation with Shadow DOM support
|
||||
else if (rootNode && isShadowRoot(rootNode)) {
|
||||
var next = child;
|
||||
|
||||
do {
|
||||
if (next && parent.isSameNode(next)) {
|
||||
return true;
|
||||
} // $FlowFixMe: need a better way to handle this...
|
||||
|
||||
|
||||
next = next.parentNode || next.host;
|
||||
} while (next);
|
||||
} // Give up, the result is false
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the first parent of an element that has a transformed property defined
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @returns {Element} first transformed parent or documentElement
|
||||
*/
|
||||
|
||||
function getFixedPositionOffsetParent(element) {
|
||||
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
|
||||
if (!element || !element.parentElement || isIE()) {
|
||||
return document.documentElement;
|
||||
}
|
||||
var el = element.parentElement;
|
||||
while (el && getStyleComputedProperty(el, 'transform') === 'none') {
|
||||
el = el.parentElement;
|
||||
}
|
||||
return el || document.documentElement;
|
||||
function getComputedStyle$1(element) {
|
||||
return getWindow(element).getComputedStyle(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computed the boundaries limits and return them
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {HTMLElement} popper
|
||||
* @param {HTMLElement} reference
|
||||
* @param {number} padding
|
||||
* @param {HTMLElement} boundariesElement - Element used to define the boundaries
|
||||
* @param {Boolean} fixedPosition - Is in fixed position mode
|
||||
* @returns {Object} Coordinates of the boundaries
|
||||
*/
|
||||
function getBoundaries(popper, reference, padding, boundariesElement) {
|
||||
var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
||||
function isTableElement(element) {
|
||||
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
||||
}
|
||||
|
||||
// NOTE: 1 DOM access here
|
||||
function getDocumentElement(element) {
|
||||
// $FlowFixMe: assume body is always available
|
||||
return ((isElement$1(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
||||
}
|
||||
|
||||
var boundaries = { top: 0, left: 0 };
|
||||
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
|
||||
function getParentNode(element) {
|
||||
if (getNodeName(element) === 'html') {
|
||||
return element;
|
||||
}
|
||||
|
||||
// Handle viewport case
|
||||
if (boundariesElement === 'viewport') {
|
||||
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
|
||||
} else {
|
||||
// Handle other cases based on DOM element used as boundaries
|
||||
var boundariesNode = void 0;
|
||||
if (boundariesElement === 'scrollParent') {
|
||||
boundariesNode = getScrollParent(getParentNode(reference));
|
||||
if (boundariesNode.nodeName === 'BODY') {
|
||||
boundariesNode = popper.ownerDocument.documentElement;
|
||||
}
|
||||
} else if (boundariesElement === 'window') {
|
||||
boundariesNode = popper.ownerDocument.documentElement;
|
||||
return (// $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
||||
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
||||
element.parentNode || // DOM Element detected
|
||||
// $FlowFixMe: need a better way to handle this...
|
||||
element.host || // ShadowRoot detected
|
||||
// $FlowFixMe: HTMLElement is a Node
|
||||
getDocumentElement(element) // fallback
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
function getTrueOffsetParent(element) {
|
||||
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
||||
getComputedStyle$1(element).position === 'fixed') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var offsetParent = element.offsetParent;
|
||||
|
||||
if (offsetParent) {
|
||||
var html = getDocumentElement(offsetParent);
|
||||
|
||||
if (getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && getComputedStyle$1(html).position !== 'static') {
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
||||
return offsetParent;
|
||||
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
||||
// return the containing block
|
||||
|
||||
|
||||
function getContainingBlock(element) {
|
||||
var currentNode = getParentNode(element);
|
||||
|
||||
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
||||
var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
||||
// create a containing block.
|
||||
|
||||
if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== 'auto') {
|
||||
return currentNode;
|
||||
} else {
|
||||
boundariesNode = boundariesElement;
|
||||
}
|
||||
|
||||
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
|
||||
|
||||
// In case of HTML, we need a different computation
|
||||
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
|
||||
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
|
||||
height = _getWindowSizes.height,
|
||||
width = _getWindowSizes.width;
|
||||
|
||||
boundaries.top += offsets.top - offsets.marginTop;
|
||||
boundaries.bottom = height + offsets.top;
|
||||
boundaries.left += offsets.left - offsets.marginLeft;
|
||||
boundaries.right = width + offsets.left;
|
||||
} else {
|
||||
// for all the other DOM elements, this one is good
|
||||
boundaries = offsets;
|
||||
currentNode = currentNode.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
// Add paddings
|
||||
padding = padding || 0;
|
||||
var isPaddingNumber = typeof padding === 'number';
|
||||
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
|
||||
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
||||
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
||||
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
||||
return null;
|
||||
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
||||
// such as table ancestors and cross browser bugs.
|
||||
|
||||
return boundaries;
|
||||
}
|
||||
|
||||
function getArea(_ref) {
|
||||
var width = _ref.width,
|
||||
height = _ref.height;
|
||||
function getOffsetParent(element) {
|
||||
var window = getWindow(element);
|
||||
var offsetParent = getTrueOffsetParent(element);
|
||||
|
||||
return width * height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility used to transform the `auto` placement to the placement with more
|
||||
* available space.
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
|
||||
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
||||
|
||||
if (placement.indexOf('auto') === -1) {
|
||||
return placement;
|
||||
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
||||
offsetParent = getTrueOffsetParent(offsetParent);
|
||||
}
|
||||
|
||||
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
|
||||
if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static') {
|
||||
return window;
|
||||
}
|
||||
|
||||
var rects = {
|
||||
top: {
|
||||
width: boundaries.width,
|
||||
height: refRect.top - boundaries.top
|
||||
},
|
||||
right: {
|
||||
width: boundaries.right - refRect.right,
|
||||
height: boundaries.height
|
||||
},
|
||||
bottom: {
|
||||
width: boundaries.width,
|
||||
height: boundaries.bottom - refRect.bottom
|
||||
},
|
||||
left: {
|
||||
width: refRect.left - boundaries.left,
|
||||
height: boundaries.height
|
||||
return offsetParent || getContainingBlock(element) || window;
|
||||
}
|
||||
|
||||
function getMainAxisFromPlacement(placement) {
|
||||
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
||||
}
|
||||
|
||||
function within(min, value, max) {
|
||||
return Math.max(min, Math.min(value, max));
|
||||
}
|
||||
|
||||
function getFreshSideObject() {
|
||||
return {
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
};
|
||||
}
|
||||
|
||||
function mergePaddingObject(paddingObject) {
|
||||
return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);
|
||||
}
|
||||
|
||||
function expandToHashMap(value, keys) {
|
||||
return keys.reduce(function (hashMap, key) {
|
||||
hashMap[key] = value;
|
||||
return hashMap;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function arrow(_ref) {
|
||||
var _state$modifiersData$;
|
||||
|
||||
var state = _ref.state,
|
||||
name = _ref.name;
|
||||
var arrowElement = state.elements.arrow;
|
||||
var popperOffsets = state.modifiersData.popperOffsets;
|
||||
var basePlacement = getBasePlacement(state.placement);
|
||||
var axis = getMainAxisFromPlacement(basePlacement);
|
||||
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
||||
var len = isVertical ? 'height' : 'width';
|
||||
|
||||
if (!arrowElement || !popperOffsets) {
|
||||
return;
|
||||
}
|
||||
|
||||
var paddingObject = state.modifiersData[name + "#persistent"].padding;
|
||||
var arrowRect = getLayoutRect(arrowElement);
|
||||
var minProp = axis === 'y' ? top : left;
|
||||
var maxProp = axis === 'y' ? bottom : right;
|
||||
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
||||
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
||||
var arrowOffsetParent = getOffsetParent(arrowElement);
|
||||
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
||||
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
||||
// outside of the popper bounds
|
||||
|
||||
var min = paddingObject[minProp];
|
||||
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
||||
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
||||
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
||||
|
||||
var axisProp = axis;
|
||||
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
||||
}
|
||||
|
||||
function effect$1(_ref2) {
|
||||
var state = _ref2.state,
|
||||
options = _ref2.options,
|
||||
name = _ref2.name;
|
||||
var _options$element = options.element,
|
||||
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element,
|
||||
_options$padding = options.padding,
|
||||
padding = _options$padding === void 0 ? 0 : _options$padding;
|
||||
|
||||
if (arrowElement == null) {
|
||||
return;
|
||||
} // CSS selector
|
||||
|
||||
|
||||
if (typeof arrowElement === 'string') {
|
||||
arrowElement = state.elements.popper.querySelector(arrowElement);
|
||||
|
||||
if (!arrowElement) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!contains(state.elements.popper, arrowElement)) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
state.elements.arrow = arrowElement;
|
||||
state.modifiersData[name + "#persistent"] = {
|
||||
padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))
|
||||
};
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var arrow$1 = {
|
||||
name: 'arrow',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: arrow,
|
||||
effect: effect$1,
|
||||
requires: ['popperOffsets'],
|
||||
requiresIfExists: ['preventOverflow']
|
||||
};
|
||||
|
||||
var unsetSides = {
|
||||
top: 'auto',
|
||||
right: 'auto',
|
||||
bottom: 'auto',
|
||||
left: 'auto'
|
||||
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
||||
// Zooming can change the DPR, but it seems to report a value that will
|
||||
// cleanly divide the values into the appropriate subpixels.
|
||||
|
||||
function roundOffsets(_ref) {
|
||||
var x = _ref.x,
|
||||
y = _ref.y;
|
||||
var win = window;
|
||||
var dpr = win.devicePixelRatio || 1;
|
||||
return {
|
||||
x: Math.round(x * dpr) / dpr || 0,
|
||||
y: Math.round(y * dpr) / dpr || 0
|
||||
};
|
||||
}
|
||||
|
||||
function mapToStyles(_ref2) {
|
||||
var _Object$assign2;
|
||||
|
||||
var popper = _ref2.popper,
|
||||
popperRect = _ref2.popperRect,
|
||||
placement = _ref2.placement,
|
||||
offsets = _ref2.offsets,
|
||||
position = _ref2.position,
|
||||
gpuAcceleration = _ref2.gpuAcceleration,
|
||||
adaptive = _ref2.adaptive;
|
||||
|
||||
var _roundOffsets = roundOffsets(offsets),
|
||||
x = _roundOffsets.x,
|
||||
y = _roundOffsets.y;
|
||||
|
||||
var hasX = offsets.hasOwnProperty('x');
|
||||
var hasY = offsets.hasOwnProperty('y');
|
||||
var sideX = left;
|
||||
var sideY = top;
|
||||
var win = window;
|
||||
|
||||
if (adaptive) {
|
||||
var offsetParent = getOffsetParent(popper);
|
||||
|
||||
if (offsetParent === getWindow(popper)) {
|
||||
offsetParent = getDocumentElement(popper);
|
||||
} // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
||||
|
||||
/*:: offsetParent = (offsetParent: Element); */
|
||||
|
||||
|
||||
if (placement === top) {
|
||||
sideY = bottom;
|
||||
y -= offsetParent.clientHeight - popperRect.height;
|
||||
y *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
|
||||
if (placement === left) {
|
||||
sideX = right;
|
||||
x -= offsetParent.clientWidth - popperRect.width;
|
||||
x *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
var commonStyles = Object.assign({
|
||||
position: position
|
||||
}, adaptive && unsetSides);
|
||||
|
||||
if (gpuAcceleration) {
|
||||
var _Object$assign;
|
||||
|
||||
return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
||||
}
|
||||
|
||||
return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
||||
}
|
||||
|
||||
function computeStyles(_ref3) {
|
||||
var state = _ref3.state,
|
||||
options = _ref3.options;
|
||||
var _options$gpuAccelerat = options.gpuAcceleration,
|
||||
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
||||
_options$adaptive = options.adaptive,
|
||||
adaptive = _options$adaptive === void 0 ? true : _options$adaptive;
|
||||
|
||||
var commonStyles = {
|
||||
placement: getBasePlacement(state.placement),
|
||||
popper: state.elements.popper,
|
||||
popperRect: state.rects.popper,
|
||||
gpuAcceleration: gpuAcceleration
|
||||
};
|
||||
|
||||
var sortedAreas = Object.keys(rects).map(function (key) {
|
||||
return _extends$1({
|
||||
key: key
|
||||
}, rects[key], {
|
||||
area: getArea(rects[key])
|
||||
if (state.modifiersData.popperOffsets != null) {
|
||||
state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
|
||||
offsets: state.modifiersData.popperOffsets,
|
||||
position: state.options.strategy,
|
||||
adaptive: adaptive
|
||||
})));
|
||||
}
|
||||
|
||||
if (state.modifiersData.arrow != null) {
|
||||
state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {
|
||||
offsets: state.modifiersData.arrow,
|
||||
position: 'absolute',
|
||||
adaptive: false
|
||||
})));
|
||||
}
|
||||
|
||||
state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
|
||||
'data-popper-placement': state.placement
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var computeStyles$1 = {
|
||||
name: 'computeStyles',
|
||||
enabled: true,
|
||||
phase: 'beforeWrite',
|
||||
fn: computeStyles,
|
||||
data: {}
|
||||
};
|
||||
|
||||
var passive = {
|
||||
passive: true
|
||||
};
|
||||
|
||||
function effect$2(_ref) {
|
||||
var state = _ref.state,
|
||||
instance = _ref.instance,
|
||||
options = _ref.options;
|
||||
var _options$scroll = options.scroll,
|
||||
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
||||
_options$resize = options.resize,
|
||||
resize = _options$resize === void 0 ? true : _options$resize;
|
||||
var window = getWindow(state.elements.popper);
|
||||
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
||||
|
||||
if (scroll) {
|
||||
scrollParents.forEach(function (scrollParent) {
|
||||
scrollParent.addEventListener('scroll', instance.update, passive);
|
||||
});
|
||||
}).sort(function (a, b) {
|
||||
return b.area - a.area;
|
||||
});
|
||||
}
|
||||
|
||||
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
||||
var width = _ref2.width,
|
||||
height = _ref2.height;
|
||||
return width >= popper.clientWidth && height >= popper.clientHeight;
|
||||
});
|
||||
if (resize) {
|
||||
window.addEventListener('resize', instance.update, passive);
|
||||
}
|
||||
|
||||
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
|
||||
return function () {
|
||||
if (scroll) {
|
||||
scrollParents.forEach(function (scrollParent) {
|
||||
scrollParent.removeEventListener('scroll', instance.update, passive);
|
||||
});
|
||||
}
|
||||
|
||||
var variation = placement.split('-')[1];
|
||||
|
||||
return computedPlacement + (variation ? '-' + variation : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get offsets to the reference element
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Object} state
|
||||
* @param {Element} popper - the popper element
|
||||
* @param {Element} reference - the reference element (the popper will be relative to this)
|
||||
* @param {Element} fixedPosition - is in fixed position mode
|
||||
* @returns {Object} An object containing the offsets which will be applied to the popper
|
||||
*/
|
||||
function getReferenceOffsets(state, popper, reference) {
|
||||
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
||||
|
||||
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
|
||||
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the outer sizes of the given element (offset size + margins)
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element
|
||||
* @returns {Object} object containing width and height properties
|
||||
*/
|
||||
function getOuterSizes(element) {
|
||||
var window = element.ownerDocument.defaultView;
|
||||
var styles = window.getComputedStyle(element);
|
||||
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
|
||||
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
|
||||
var result = {
|
||||
width: element.offsetWidth + y,
|
||||
height: element.offsetHeight + x
|
||||
if (resize) {
|
||||
window.removeEventListener('resize', instance.update, passive);
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
/**
|
||||
* Get the opposite placement of the given one
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {String} placement
|
||||
* @returns {String} flipped placement
|
||||
*/
|
||||
|
||||
var eventListeners = {
|
||||
name: 'eventListeners',
|
||||
enabled: true,
|
||||
phase: 'write',
|
||||
fn: function fn() {},
|
||||
effect: effect$2,
|
||||
data: {}
|
||||
};
|
||||
|
||||
var hash = {
|
||||
left: 'right',
|
||||
right: 'left',
|
||||
bottom: 'top',
|
||||
top: 'bottom'
|
||||
};
|
||||
function getOppositePlacement(placement) {
|
||||
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
||||
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
||||
return hash[matched];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get offsets to the popper
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Object} position - CSS position the Popper will get applied
|
||||
* @param {HTMLElement} popper - the popper element
|
||||
* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
|
||||
* @param {String} placement - one of the valid placement options
|
||||
* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
|
||||
*/
|
||||
function getPopperOffsets(popper, referenceOffsets, placement) {
|
||||
placement = placement.split('-')[0];
|
||||
var hash$1 = {
|
||||
start: 'end',
|
||||
end: 'start'
|
||||
};
|
||||
function getOppositeVariationPlacement(placement) {
|
||||
return placement.replace(/start|end/g, function (matched) {
|
||||
return hash$1[matched];
|
||||
});
|
||||
}
|
||||
|
||||
// Get popper node sizes
|
||||
var popperRect = getOuterSizes(popper);
|
||||
|
||||
// Add position, width and height to our offsets object
|
||||
var popperOffsets = {
|
||||
width: popperRect.width,
|
||||
height: popperRect.height
|
||||
function getBoundingClientRect(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
return {
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
top: rect.top,
|
||||
right: rect.right,
|
||||
bottom: rect.bottom,
|
||||
left: rect.left,
|
||||
x: rect.left,
|
||||
y: rect.top
|
||||
};
|
||||
|
||||
// depending by the popper placement we have to compute its offsets slightly differently
|
||||
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
|
||||
var mainSide = isHoriz ? 'top' : 'left';
|
||||
var secondarySide = isHoriz ? 'left' : 'top';
|
||||
var measurement = isHoriz ? 'height' : 'width';
|
||||
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
||||
|
||||
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
|
||||
if (placement === secondarySide) {
|
||||
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
||||
} else {
|
||||
popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
|
||||
}
|
||||
|
||||
return popperOffsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mimics the `find` method of Array
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Array} arr
|
||||
* @argument prop
|
||||
* @argument value
|
||||
* @returns index or -1
|
||||
*/
|
||||
function find(arr, check) {
|
||||
// use native find if supported
|
||||
if (Array.prototype.find) {
|
||||
return arr.find(check);
|
||||
}
|
||||
|
||||
// use `filter` to obtain the same behavior of `find`
|
||||
return arr.filter(check)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the index of the matching object
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Array} arr
|
||||
* @argument prop
|
||||
* @argument value
|
||||
* @returns index or -1
|
||||
*/
|
||||
function findIndex(arr, prop, value) {
|
||||
// use native findIndex if supported
|
||||
if (Array.prototype.findIndex) {
|
||||
return arr.findIndex(function (cur) {
|
||||
return cur[prop] === value;
|
||||
});
|
||||
}
|
||||
|
||||
// use `find` + `indexOf` if `findIndex` isn't supported
|
||||
var match = find(arr, function (obj) {
|
||||
return obj[prop] === value;
|
||||
});
|
||||
return arr.indexOf(match);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop trough the list of modifiers and run them in order,
|
||||
* each of them will then edit the data object.
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {dataObject} data
|
||||
* @param {Array} modifiers
|
||||
* @param {String} ends - Optional modifier name used as stopper
|
||||
* @returns {dataObject}
|
||||
*/
|
||||
function runModifiers(modifiers, data, ends) {
|
||||
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
|
||||
|
||||
modifiersToRun.forEach(function (modifier) {
|
||||
if (modifier['function']) {
|
||||
// eslint-disable-line dot-notation
|
||||
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
||||
}
|
||||
var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
|
||||
if (modifier.enabled && isFunction(fn)) {
|
||||
// Add properties to offsets to make them a complete clientRect object
|
||||
// we do this before each modifier to make sure the previous one doesn't
|
||||
// mess with these values
|
||||
data.offsets.popper = getClientRect(data.offsets.popper);
|
||||
data.offsets.reference = getClientRect(data.offsets.reference);
|
||||
|
||||
data = fn(data, modifier);
|
||||
}
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the position of the popper, computing the new offsets and applying
|
||||
* the new style.<br />
|
||||
* Prefer `scheduleUpdate` over `update` because of performance reasons.
|
||||
* @method
|
||||
* @memberof Popper
|
||||
*/
|
||||
function update() {
|
||||
// if popper is destroyed, don't perform any further update
|
||||
if (this.state.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = {
|
||||
instance: this,
|
||||
styles: {},
|
||||
arrowStyles: {},
|
||||
attributes: {},
|
||||
flipped: false,
|
||||
offsets: {}
|
||||
function getWindowScroll(node) {
|
||||
var win = getWindow(node);
|
||||
var scrollLeft = win.pageXOffset;
|
||||
var scrollTop = win.pageYOffset;
|
||||
return {
|
||||
scrollLeft: scrollLeft,
|
||||
scrollTop: scrollTop
|
||||
};
|
||||
|
||||
// compute reference element offsets
|
||||
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
|
||||
|
||||
// compute auto placement, store placement inside the data object,
|
||||
// modifiers will be able to edit `placement` if needed
|
||||
// and refer to originalPlacement to know the original value
|
||||
data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
|
||||
|
||||
// store the computed placement inside `originalPlacement`
|
||||
data.originalPlacement = data.placement;
|
||||
|
||||
data.positionFixed = this.options.positionFixed;
|
||||
|
||||
// compute the popper offsets
|
||||
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
|
||||
|
||||
data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
|
||||
|
||||
// run the modifiers
|
||||
data = runModifiers(this.modifiers, data);
|
||||
|
||||
// the first `update` will call `onCreate` callback
|
||||
// the other ones will call `onUpdate` callback
|
||||
if (!this.state.isCreated) {
|
||||
this.state.isCreated = true;
|
||||
this.options.onCreate(data);
|
||||
} else {
|
||||
this.options.onUpdate(data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper used to know if the given modifier is enabled.
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function isModifierEnabled(modifiers, modifierName) {
|
||||
return modifiers.some(function (_ref) {
|
||||
var name = _ref.name,
|
||||
enabled = _ref.enabled;
|
||||
return enabled && name === modifierName;
|
||||
});
|
||||
function getWindowScrollBarX(element) {
|
||||
// If <html> has a CSS width greater than the viewport, then this will be
|
||||
// incorrect for RTL.
|
||||
// Popper 1 is broken in this case and never had a bug report so let's assume
|
||||
// it's not an issue. I don't think anyone ever specifies width on <html>
|
||||
// anyway.
|
||||
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
||||
// this (e.g. Edge 2019, IE11, Safari)
|
||||
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the prefixed supported property name
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {String} property (camelCase)
|
||||
* @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
|
||||
*/
|
||||
function getSupportedPropertyName(property) {
|
||||
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
|
||||
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
|
||||
function getViewportRect(element) {
|
||||
var win = getWindow(element);
|
||||
var html = getDocumentElement(element);
|
||||
var visualViewport = win.visualViewport;
|
||||
var width = html.clientWidth;
|
||||
var height = html.clientHeight;
|
||||
var x = 0;
|
||||
var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
|
||||
// can be obscured underneath it.
|
||||
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
|
||||
// if it isn't open, so if this isn't available, the popper will be detected
|
||||
// to overflow the bottom of the screen too early.
|
||||
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
var prefix = prefixes[i];
|
||||
var toCheck = prefix ? '' + prefix + upperProp : property;
|
||||
if (typeof document.body.style[toCheck] !== 'undefined') {
|
||||
return toCheck;
|
||||
if (visualViewport) {
|
||||
width = visualViewport.width;
|
||||
height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
|
||||
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
|
||||
// errors due to floating point numbers, so we need to check precision.
|
||||
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
|
||||
// Feature detection fails in mobile emulation mode in Chrome.
|
||||
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
|
||||
// 0.001
|
||||
// Fallback here: "Not Safari" userAgent
|
||||
|
||||
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
||||
x = visualViewport.offsetLeft;
|
||||
y = visualViewport.offsetTop;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the popper.
|
||||
* @method
|
||||
* @memberof Popper
|
||||
*/
|
||||
function destroy() {
|
||||
this.state.isDestroyed = true;
|
||||
|
||||
// touch DOM only if `applyStyle` modifier is enabled
|
||||
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
|
||||
this.popper.removeAttribute('x-placement');
|
||||
this.popper.style.position = '';
|
||||
this.popper.style.top = '';
|
||||
this.popper.style.left = '';
|
||||
this.popper.style.right = '';
|
||||
this.popper.style.bottom = '';
|
||||
this.popper.style.willChange = '';
|
||||
this.popper.style[getSupportedPropertyName('transform')] = '';
|
||||
}
|
||||
|
||||
this.disableEventListeners();
|
||||
|
||||
// remove the popper if user explicitly asked for the deletion on destroy
|
||||
// do not use `remove` because IE11 doesn't support it
|
||||
if (this.options.removeOnDestroy) {
|
||||
this.popper.parentNode.removeChild(this.popper);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the window associated with the element
|
||||
* @argument {Element} element
|
||||
* @returns {Window}
|
||||
*/
|
||||
function getWindow(element) {
|
||||
var ownerDocument = element.ownerDocument;
|
||||
return ownerDocument ? ownerDocument.defaultView : window;
|
||||
}
|
||||
|
||||
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
|
||||
var isBody = scrollParent.nodeName === 'BODY';
|
||||
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
|
||||
target.addEventListener(event, callback, { passive: true });
|
||||
|
||||
if (!isBody) {
|
||||
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
|
||||
}
|
||||
scrollParents.push(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup needed event listeners used to update the popper position
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @private
|
||||
*/
|
||||
function setupEventListeners(reference, options, state, updateBound) {
|
||||
// Resize event listener on window
|
||||
state.updateBound = updateBound;
|
||||
getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
|
||||
|
||||
// Scroll event listener on scroll parents
|
||||
var scrollElement = getScrollParent(reference);
|
||||
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
||||
state.scrollElement = scrollElement;
|
||||
state.eventsEnabled = true;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* It will add resize/scroll events and start recalculating
|
||||
* position of the popper element when they are triggered.
|
||||
* @method
|
||||
* @memberof Popper
|
||||
*/
|
||||
function enableEventListeners() {
|
||||
if (!this.state.eventsEnabled) {
|
||||
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove event listeners used to update the popper position
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @private
|
||||
*/
|
||||
function removeEventListeners(reference, state) {
|
||||
// Remove resize event listener on window
|
||||
getWindow(reference).removeEventListener('resize', state.updateBound);
|
||||
|
||||
// Remove scroll event listener on scroll parents
|
||||
state.scrollParents.forEach(function (target) {
|
||||
target.removeEventListener('scroll', state.updateBound);
|
||||
});
|
||||
|
||||
// Reset state
|
||||
state.updateBound = null;
|
||||
state.scrollParents = [];
|
||||
state.scrollElement = null;
|
||||
state.eventsEnabled = false;
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* It will remove resize/scroll events and won't recalculate popper position
|
||||
* when they are triggered. It also won't trigger `onUpdate` callback anymore,
|
||||
* unless you call `update` method manually.
|
||||
* @method
|
||||
* @memberof Popper
|
||||
*/
|
||||
function disableEventListeners() {
|
||||
if (this.state.eventsEnabled) {
|
||||
cancelAnimationFrame(this.scheduleUpdate);
|
||||
this.state = removeEventListeners(this.reference, this.state);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells if a given input is a number
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {*} input to check
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function isNumeric(n) {
|
||||
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the style to the given popper
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element - Element to apply the style to
|
||||
* @argument {Object} styles
|
||||
* Object with a list of properties and values which will be applied to the element
|
||||
*/
|
||||
function setStyles(element, styles) {
|
||||
Object.keys(styles).forEach(function (prop) {
|
||||
var unit = '';
|
||||
// add unit if the value is numeric and is one of the following
|
||||
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
|
||||
unit = 'px';
|
||||
}
|
||||
element.style[prop] = styles[prop] + unit;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the attributes to the given popper
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Element} element - Element to apply the attributes to
|
||||
* @argument {Object} styles
|
||||
* Object with a list of properties and values which will be applied to the element
|
||||
*/
|
||||
function setAttributes(element, attributes) {
|
||||
Object.keys(attributes).forEach(function (prop) {
|
||||
var value = attributes[prop];
|
||||
if (value !== false) {
|
||||
element.setAttribute(prop, attributes[prop]);
|
||||
} else {
|
||||
element.removeAttribute(prop);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Object} data.styles - List of style properties - values to apply to popper element
|
||||
* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The same data object
|
||||
*/
|
||||
function applyStyle(data) {
|
||||
// any property present in `data.styles` will be applied to the popper,
|
||||
// in this way we can make the 3rd party modifiers add custom styles to it
|
||||
// Be aware, modifiers could override the properties defined in the previous
|
||||
// lines of this modifier!
|
||||
setStyles(data.instance.popper, data.styles);
|
||||
|
||||
// any property present in `data.attributes` will be applied to the popper,
|
||||
// they will be set as HTML attributes of the element
|
||||
setAttributes(data.instance.popper, data.attributes);
|
||||
|
||||
// if arrowElement is defined and arrowStyles has some properties
|
||||
if (data.arrowElement && Object.keys(data.arrowStyles).length) {
|
||||
setStyles(data.arrowElement, data.arrowStyles);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the x-placement attribute before everything else because it could be used
|
||||
* to add margins to the popper margins needs to be calculated to get the
|
||||
* correct popper offsets.
|
||||
* @method
|
||||
* @memberof Popper.modifiers
|
||||
* @param {HTMLElement} reference - The reference element used to position the popper
|
||||
* @param {HTMLElement} popper - The HTML element used as popper
|
||||
* @param {Object} options - Popper.js options
|
||||
*/
|
||||
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
|
||||
// compute reference element offsets
|
||||
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
||||
|
||||
// compute auto placement, store placement inside the data object,
|
||||
// modifiers will be able to edit `placement` if needed
|
||||
// and refer to originalPlacement to know the original value
|
||||
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
||||
|
||||
popper.setAttribute('x-placement', placement);
|
||||
|
||||
// Apply `position` to popper before anything else because
|
||||
// without the position applied we can't guarantee correct computations
|
||||
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Popper.Utils
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Boolean} shouldRound - If the offsets should be rounded at all
|
||||
* @returns {Object} The popper's position offsets rounded
|
||||
*
|
||||
* The tale of pixel-perfect positioning. It's still not 100% perfect, but as
|
||||
* good as it can be within reason.
|
||||
* Discussion here: https://github.com/FezVrasta/popper.js/pull/715
|
||||
*
|
||||
* Low DPI screens cause a popper to be blurry if not using full pixels (Safari
|
||||
* as well on High DPI screens).
|
||||
*
|
||||
* Firefox prefers no rounding for positioning and does not have blurriness on
|
||||
* high DPI screens.
|
||||
*
|
||||
* Only horizontal placement and left/right values need to be considered.
|
||||
*/
|
||||
function getRoundedOffsets(data, shouldRound) {
|
||||
var _data$offsets = data.offsets,
|
||||
popper = _data$offsets.popper,
|
||||
reference = _data$offsets.reference;
|
||||
var round = Math.round,
|
||||
floor = Math.floor;
|
||||
|
||||
var noRound = function noRound(v) {
|
||||
return v;
|
||||
};
|
||||
|
||||
var referenceWidth = round(reference.width);
|
||||
var popperWidth = round(popper.width);
|
||||
|
||||
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
||||
var isVariation = data.placement.indexOf('-') !== -1;
|
||||
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
||||
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
||||
|
||||
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
||||
var verticalToInteger = !shouldRound ? noRound : round;
|
||||
|
||||
return {
|
||||
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
||||
top: verticalToInteger(popper.top),
|
||||
bottom: verticalToInteger(popper.bottom),
|
||||
right: horizontalToInteger(popper.right)
|
||||
width: width,
|
||||
height: height,
|
||||
x: x + getWindowScrollBarX(element),
|
||||
y: y
|
||||
};
|
||||
}
|
||||
|
||||
var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
|
||||
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function computeStyle(data, options) {
|
||||
var x = options.x,
|
||||
y = options.y;
|
||||
var popper = data.offsets.popper;
|
||||
function getDocumentRect(element) {
|
||||
var html = getDocumentElement(element);
|
||||
var winScroll = getWindowScroll(element);
|
||||
var body = element.ownerDocument.body;
|
||||
var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
||||
var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
||||
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
||||
var y = -winScroll.scrollTop;
|
||||
|
||||
// Remove this legacy support in Popper.js v2
|
||||
|
||||
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
|
||||
return modifier.name === 'applyStyle';
|
||||
}).gpuAcceleration;
|
||||
if (legacyGpuAccelerationOption !== undefined) {
|
||||
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
||||
if (getComputedStyle$1(body || html).direction === 'rtl') {
|
||||
x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
||||
}
|
||||
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
||||
|
||||
var offsetParent = getOffsetParent(data.instance.popper);
|
||||
var offsetParentRect = getBoundingClientRect(offsetParent);
|
||||
|
||||
// Styles
|
||||
var styles = {
|
||||
position: popper.position
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
|
||||
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
||||
|
||||
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
||||
var sideB = y === 'right' ? 'left' : 'right';
|
||||
|
||||
// if gpuAcceleration is set to `true` and transform is supported,
|
||||
// we use `translate3d` to apply the position to the popper we
|
||||
// automatically use the supported prefixed version if needed
|
||||
var prefixedProperty = getSupportedPropertyName('transform');
|
||||
|
||||
// now, let's make a step back and look at this code closely (wtf?)
|
||||
// If the content of the popper grows once it's been positioned, it
|
||||
// may happen that the popper gets misplaced because of the new content
|
||||
// overflowing its reference element
|
||||
// To avoid this problem, we provide two options (x and y), which allow
|
||||
// the consumer to define the offset origin.
|
||||
// If we position a popper on top of a reference element, we can set
|
||||
// `x` to `top` to make the popper grow towards its top instead of
|
||||
// its bottom.
|
||||
var left = void 0,
|
||||
top = void 0;
|
||||
if (sideA === 'bottom') {
|
||||
// when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
|
||||
// and not the bottom of the html element
|
||||
if (offsetParent.nodeName === 'HTML') {
|
||||
top = -offsetParent.clientHeight + offsets.bottom;
|
||||
} else {
|
||||
top = -offsetParentRect.height + offsets.bottom;
|
||||
}
|
||||
} else {
|
||||
top = offsets.top;
|
||||
}
|
||||
if (sideB === 'right') {
|
||||
if (offsetParent.nodeName === 'HTML') {
|
||||
left = -offsetParent.clientWidth + offsets.right;
|
||||
} else {
|
||||
left = -offsetParentRect.width + offsets.right;
|
||||
}
|
||||
} else {
|
||||
left = offsets.left;
|
||||
}
|
||||
if (gpuAcceleration && prefixedProperty) {
|
||||
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
||||
styles[sideA] = 0;
|
||||
styles[sideB] = 0;
|
||||
styles.willChange = 'transform';
|
||||
} else {
|
||||
// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
|
||||
var invertTop = sideA === 'bottom' ? -1 : 1;
|
||||
var invertLeft = sideB === 'right' ? -1 : 1;
|
||||
styles[sideA] = top * invertTop;
|
||||
styles[sideB] = left * invertLeft;
|
||||
styles.willChange = sideA + ', ' + sideB;
|
||||
}
|
||||
|
||||
// Attributes
|
||||
var attributes = {
|
||||
'x-placement': data.placement
|
||||
};
|
||||
|
||||
// Update `data` attributes, styles and arrowStyles
|
||||
data.attributes = _extends$1({}, attributes, data.attributes);
|
||||
data.styles = _extends$1({}, styles, data.styles);
|
||||
data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper used to know if the given modifier depends from another one.<br />
|
||||
* It checks if the needed modifier is listed and enabled.
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @param {Array} modifiers - list of modifiers
|
||||
* @param {String} requestingName - name of requesting modifier
|
||||
* @param {String} requestedName - name of requested modifier
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function isModifierRequired(modifiers, requestingName, requestedName) {
|
||||
var requesting = find(modifiers, function (_ref) {
|
||||
var name = _ref.name;
|
||||
return name === requestingName;
|
||||
function isScrollParent(element) {
|
||||
// Firefox wants us to check `-x` and `-y` variations as well
|
||||
var _getComputedStyle = getComputedStyle$1(element),
|
||||
overflow = _getComputedStyle.overflow,
|
||||
overflowX = _getComputedStyle.overflowX,
|
||||
overflowY = _getComputedStyle.overflowY;
|
||||
|
||||
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
||||
}
|
||||
|
||||
function getScrollParent(node) {
|
||||
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
||||
// $FlowFixMe: assume body is always available
|
||||
return node.ownerDocument.body;
|
||||
}
|
||||
|
||||
if (isHTMLElement(node) && isScrollParent(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
return getScrollParent(getParentNode(node));
|
||||
}
|
||||
|
||||
/*
|
||||
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
||||
until we get to the top window object. This list is what we attach scroll listeners
|
||||
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
||||
reference element's position.
|
||||
*/
|
||||
|
||||
function listScrollParents(element, list) {
|
||||
if (list === void 0) {
|
||||
list = [];
|
||||
}
|
||||
|
||||
var scrollParent = getScrollParent(element);
|
||||
var isBody = getNodeName(scrollParent) === 'body';
|
||||
var win = getWindow(scrollParent);
|
||||
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
||||
var updatedList = list.concat(target);
|
||||
return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here
|
||||
updatedList.concat(listScrollParents(getParentNode(target)));
|
||||
}
|
||||
|
||||
function rectToClientRect(rect) {
|
||||
return Object.assign(Object.assign({}, rect), {}, {
|
||||
left: rect.x,
|
||||
top: rect.y,
|
||||
right: rect.x + rect.width,
|
||||
bottom: rect.y + rect.height
|
||||
});
|
||||
}
|
||||
|
||||
var isRequired = !!requesting && modifiers.some(function (modifier) {
|
||||
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
|
||||
function getInnerBoundingClientRect(element) {
|
||||
var rect = getBoundingClientRect(element);
|
||||
rect.top = rect.top + element.clientTop;
|
||||
rect.left = rect.left + element.clientLeft;
|
||||
rect.bottom = rect.top + element.clientHeight;
|
||||
rect.right = rect.left + element.clientWidth;
|
||||
rect.width = element.clientWidth;
|
||||
rect.height = element.clientHeight;
|
||||
rect.x = rect.left;
|
||||
rect.y = rect.top;
|
||||
return rect;
|
||||
}
|
||||
|
||||
function getClientRectFromMixedType(element, clippingParent) {
|
||||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||||
} // A "clipping parent" is an overflowable container with the characteristic of
|
||||
// clipping (or hiding) overflowing elements with a position different from
|
||||
// `initial`
|
||||
|
||||
|
||||
function getClippingParents(element) {
|
||||
var clippingParents = listScrollParents(getParentNode(element));
|
||||
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;
|
||||
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
||||
|
||||
if (!isElement$1(clipperElement)) {
|
||||
return [];
|
||||
} // $FlowFixMe: https://github.com/facebook/flow/issues/1414
|
||||
|
||||
|
||||
return clippingParents.filter(function (clippingParent) {
|
||||
return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
||||
});
|
||||
} // Gets the maximum area that the element is visible in due to any number of
|
||||
// clipping parents
|
||||
|
||||
if (!isRequired) {
|
||||
var _requesting = '`' + requestingName + '`';
|
||||
var requested = '`' + requestedName + '`';
|
||||
console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
|
||||
}
|
||||
return isRequired;
|
||||
|
||||
function getClippingRect(element, boundary, rootBoundary) {
|
||||
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
||||
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
||||
var firstClippingParent = clippingParents[0];
|
||||
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
||||
var rect = getClientRectFromMixedType(element, clippingParent);
|
||||
accRect.top = Math.max(rect.top, accRect.top);
|
||||
accRect.right = Math.min(rect.right, accRect.right);
|
||||
accRect.bottom = Math.min(rect.bottom, accRect.bottom);
|
||||
accRect.left = Math.max(rect.left, accRect.left);
|
||||
return accRect;
|
||||
}, getClientRectFromMixedType(element, firstClippingParent));
|
||||
clippingRect.width = clippingRect.right - clippingRect.left;
|
||||
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
||||
clippingRect.x = clippingRect.left;
|
||||
clippingRect.y = clippingRect.top;
|
||||
return clippingRect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function arrow(data, options) {
|
||||
var _data$offsets$arrow;
|
||||
|
||||
// arrow depends on keepTogether in order to work
|
||||
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
|
||||
return data;
|
||||
}
|
||||
|
||||
var arrowElement = options.element;
|
||||
|
||||
// if arrowElement is a string, suppose it's a CSS selector
|
||||
if (typeof arrowElement === 'string') {
|
||||
arrowElement = data.instance.popper.querySelector(arrowElement);
|
||||
|
||||
// if arrowElement is not found, don't run the modifier
|
||||
if (!arrowElement) {
|
||||
return data;
|
||||
}
|
||||
} else {
|
||||
// if the arrowElement isn't a query selector we must check that the
|
||||
// provided DOM node is child of its popper node
|
||||
if (!data.instance.popper.contains(arrowElement)) {
|
||||
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
var placement = data.placement.split('-')[0];
|
||||
var _data$offsets = data.offsets,
|
||||
popper = _data$offsets.popper,
|
||||
reference = _data$offsets.reference;
|
||||
|
||||
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
||||
|
||||
var len = isVertical ? 'height' : 'width';
|
||||
var sideCapitalized = isVertical ? 'Top' : 'Left';
|
||||
var side = sideCapitalized.toLowerCase();
|
||||
var altSide = isVertical ? 'left' : 'top';
|
||||
var opSide = isVertical ? 'bottom' : 'right';
|
||||
var arrowElementSize = getOuterSizes(arrowElement)[len];
|
||||
|
||||
//
|
||||
// extends keepTogether behavior making sure the popper and its
|
||||
// reference have enough pixels in conjunction
|
||||
//
|
||||
|
||||
// top/left side
|
||||
if (reference[opSide] - arrowElementSize < popper[side]) {
|
||||
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
|
||||
}
|
||||
// bottom/right side
|
||||
if (reference[side] + arrowElementSize > popper[opSide]) {
|
||||
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
|
||||
}
|
||||
data.offsets.popper = getClientRect(data.offsets.popper);
|
||||
|
||||
// compute center of the popper
|
||||
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
|
||||
|
||||
// Compute the sideValue using the updated popper offsets
|
||||
// take popper margin in account because we don't have this info available
|
||||
var css = getStyleComputedProperty(data.instance.popper);
|
||||
var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
|
||||
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
|
||||
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
||||
|
||||
// prevent arrowElement from being placed not contiguously to its popper
|
||||
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
|
||||
|
||||
data.arrowElement = arrowElement;
|
||||
data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
|
||||
|
||||
return data;
|
||||
function getVariation(placement) {
|
||||
return placement.split('-')[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the opposite placement variation of the given one
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {String} placement variation
|
||||
* @returns {String} flipped placement variation
|
||||
*/
|
||||
function getOppositeVariation(variation) {
|
||||
if (variation === 'end') {
|
||||
return 'start';
|
||||
} else if (variation === 'start') {
|
||||
return 'end';
|
||||
}
|
||||
return variation;
|
||||
}
|
||||
function computeOffsets(_ref) {
|
||||
var reference = _ref.reference,
|
||||
element = _ref.element,
|
||||
placement = _ref.placement;
|
||||
var basePlacement = placement ? getBasePlacement(placement) : null;
|
||||
var variation = placement ? getVariation(placement) : null;
|
||||
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
||||
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
||||
var offsets;
|
||||
|
||||
/**
|
||||
* List of accepted placements to use as values of the `placement` option.<br />
|
||||
* Valid placements are:
|
||||
* - `auto`
|
||||
* - `top`
|
||||
* - `right`
|
||||
* - `bottom`
|
||||
* - `left`
|
||||
*
|
||||
* Each placement can have a variation from this list:
|
||||
* - `-start`
|
||||
* - `-end`
|
||||
*
|
||||
* Variations are interpreted easily if you think of them as the left to right
|
||||
* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
|
||||
* is right.<br />
|
||||
* Vertically (`left` and `right`), `start` is top and `end` is bottom.
|
||||
*
|
||||
* Some valid examples are:
|
||||
* - `top-end` (on top of reference, right aligned)
|
||||
* - `right-start` (on right of reference, top aligned)
|
||||
* - `bottom` (on bottom, centered)
|
||||
* - `auto-end` (on the side with more space available, alignment depends by placement)
|
||||
*
|
||||
* @static
|
||||
* @type {Array}
|
||||
* @enum {String}
|
||||
* @readonly
|
||||
* @method placements
|
||||
* @memberof Popper
|
||||
*/
|
||||
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
||||
|
||||
// Get rid of `auto` `auto-start` and `auto-end`
|
||||
var validPlacements = placements.slice(3);
|
||||
|
||||
/**
|
||||
* Given an initial placement, returns all the subsequent placements
|
||||
* clockwise (or counter-clockwise).
|
||||
*
|
||||
* @method
|
||||
* @memberof Popper.Utils
|
||||
* @argument {String} placement - A valid placement (it accepts variations)
|
||||
* @argument {Boolean} counter - Set to true to walk the placements counterclockwise
|
||||
* @returns {Array} placements including their variations
|
||||
*/
|
||||
function clockwise(placement) {
|
||||
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
|
||||
var index = validPlacements.indexOf(placement);
|
||||
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
||||
return counter ? arr.reverse() : arr;
|
||||
}
|
||||
|
||||
var BEHAVIORS = {
|
||||
FLIP: 'flip',
|
||||
CLOCKWISE: 'clockwise',
|
||||
COUNTERCLOCKWISE: 'counterclockwise'
|
||||
};
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function flip(data, options) {
|
||||
// if `inner` modifier is enabled, we can't use the `flip` modifier
|
||||
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
||||
return data;
|
||||
}
|
||||
|
||||
if (data.flipped && data.placement === data.originalPlacement) {
|
||||
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
||||
return data;
|
||||
}
|
||||
|
||||
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
||||
|
||||
var placement = data.placement.split('-')[0];
|
||||
var placementOpposite = getOppositePlacement(placement);
|
||||
var variation = data.placement.split('-')[1] || '';
|
||||
|
||||
var flipOrder = [];
|
||||
|
||||
switch (options.behavior) {
|
||||
case BEHAVIORS.FLIP:
|
||||
flipOrder = [placement, placementOpposite];
|
||||
switch (basePlacement) {
|
||||
case top:
|
||||
offsets = {
|
||||
x: commonX,
|
||||
y: reference.y - element.height
|
||||
};
|
||||
break;
|
||||
case BEHAVIORS.CLOCKWISE:
|
||||
flipOrder = clockwise(placement);
|
||||
|
||||
case bottom:
|
||||
offsets = {
|
||||
x: commonX,
|
||||
y: reference.y + reference.height
|
||||
};
|
||||
break;
|
||||
case BEHAVIORS.COUNTERCLOCKWISE:
|
||||
flipOrder = clockwise(placement, true);
|
||||
|
||||
case right:
|
||||
offsets = {
|
||||
x: reference.x + reference.width,
|
||||
y: commonY
|
||||
};
|
||||
break;
|
||||
|
||||
case left:
|
||||
offsets = {
|
||||
x: reference.x - element.width,
|
||||
y: commonY
|
||||
};
|
||||
break;
|
||||
|
||||
default:
|
||||
flipOrder = options.behavior;
|
||||
offsets = {
|
||||
x: reference.x,
|
||||
y: reference.y
|
||||
};
|
||||
}
|
||||
|
||||
flipOrder.forEach(function (step, index) {
|
||||
if (placement !== step || flipOrder.length === index + 1) {
|
||||
return data;
|
||||
}
|
||||
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
||||
|
||||
placement = data.placement.split('-')[0];
|
||||
placementOpposite = getOppositePlacement(placement);
|
||||
if (mainAxis != null) {
|
||||
var len = mainAxis === 'y' ? 'height' : 'width';
|
||||
|
||||
var popperOffsets = data.offsets.popper;
|
||||
var refOffsets = data.offsets.reference;
|
||||
|
||||
// using floor because the reference offsets may contain decimals we are not going to consider here
|
||||
var floor = Math.floor;
|
||||
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
|
||||
|
||||
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
|
||||
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
|
||||
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
|
||||
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
|
||||
|
||||
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
||||
|
||||
// flip the variation if required
|
||||
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
||||
|
||||
// flips variation if reference element overflows boundaries
|
||||
var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
|
||||
|
||||
// flips variation if popper content overflows boundaries
|
||||
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
||||
|
||||
var flippedVariation = flippedVariationByRef || flippedVariationByContent;
|
||||
|
||||
if (overlapsRef || overflowsBoundaries || flippedVariation) {
|
||||
// this boolean to detect any flip loop
|
||||
data.flipped = true;
|
||||
|
||||
if (overlapsRef || overflowsBoundaries) {
|
||||
placement = flipOrder[index + 1];
|
||||
}
|
||||
|
||||
if (flippedVariation) {
|
||||
variation = getOppositeVariation(variation);
|
||||
}
|
||||
|
||||
data.placement = placement + (variation ? '-' + variation : '');
|
||||
|
||||
// this object contains `position`, we want to preserve it along with
|
||||
// any additional property we may add in the future
|
||||
data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
||||
|
||||
data = runModifiers(data.instance.modifiers, data, 'flip');
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function keepTogether(data) {
|
||||
var _data$offsets = data.offsets,
|
||||
popper = _data$offsets.popper,
|
||||
reference = _data$offsets.reference;
|
||||
|
||||
var placement = data.placement.split('-')[0];
|
||||
var floor = Math.floor;
|
||||
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
||||
var side = isVertical ? 'right' : 'bottom';
|
||||
var opSide = isVertical ? 'left' : 'top';
|
||||
var measurement = isVertical ? 'width' : 'height';
|
||||
|
||||
if (popper[side] < floor(reference[opSide])) {
|
||||
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
|
||||
}
|
||||
if (popper[opSide] > floor(reference[side])) {
|
||||
data.offsets.popper[opSide] = floor(reference[side]);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string containing value + unit into a px value number
|
||||
* @function
|
||||
* @memberof {modifiers~offset}
|
||||
* @private
|
||||
* @argument {String} str - Value + unit string
|
||||
* @argument {String} measurement - `height` or `width`
|
||||
* @argument {Object} popperOffsets
|
||||
* @argument {Object} referenceOffsets
|
||||
* @returns {Number|String}
|
||||
* Value in pixels, or original string if no values were extracted
|
||||
*/
|
||||
function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
||||
// separate value from unit
|
||||
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
|
||||
var value = +split[1];
|
||||
var unit = split[2];
|
||||
|
||||
// If it's not a number it's an operator, I guess
|
||||
if (!value) {
|
||||
return str;
|
||||
}
|
||||
|
||||
if (unit.indexOf('%') === 0) {
|
||||
var element = void 0;
|
||||
switch (unit) {
|
||||
case '%p':
|
||||
element = popperOffsets;
|
||||
switch (variation) {
|
||||
case start:
|
||||
offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference[len] / 2 - element[len] / 2);
|
||||
break;
|
||||
|
||||
case end:
|
||||
offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference[len] / 2 - element[len] / 2);
|
||||
break;
|
||||
case '%':
|
||||
case '%r':
|
||||
default:
|
||||
element = referenceOffsets;
|
||||
}
|
||||
|
||||
var rect = getClientRect(element);
|
||||
return rect[measurement] / 100 * value;
|
||||
} else if (unit === 'vh' || unit === 'vw') {
|
||||
// if is a vh or vw, we calculate the size based on the viewport
|
||||
var size = void 0;
|
||||
if (unit === 'vh') {
|
||||
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
||||
} else {
|
||||
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
||||
}
|
||||
return size / 100 * value;
|
||||
} else {
|
||||
// if is an explicit pixel unit, we get rid of the unit and keep the value
|
||||
// if is an implicit unit, it's px, and we return just the value
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
|
||||
* @function
|
||||
* @memberof {modifiers~offset}
|
||||
* @private
|
||||
* @argument {String} offset
|
||||
* @argument {Object} popperOffsets
|
||||
* @argument {Object} referenceOffsets
|
||||
* @argument {String} basePlacement
|
||||
* @returns {Array} a two cells array with x and y offsets in numbers
|
||||
*/
|
||||
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
||||
var offsets = [0, 0];
|
||||
|
||||
// Use height if placement is left or right and index is 0 otherwise use width
|
||||
// in this way the first offset will use an axis and the second one
|
||||
// will use the other one
|
||||
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
|
||||
|
||||
// Split the offset string to obtain a list of values and operands
|
||||
// The regex addresses values with the plus or minus sign in front (+10, -20, etc)
|
||||
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
||||
return frag.trim();
|
||||
});
|
||||
|
||||
// Detect if the offset string contains a pair of values or a single one
|
||||
// they could be separated by comma or space
|
||||
var divider = fragments.indexOf(find(fragments, function (frag) {
|
||||
return frag.search(/,|\s/) !== -1;
|
||||
}));
|
||||
|
||||
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
|
||||
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
||||
}
|
||||
|
||||
// If divider is found, we divide the list of values and operands to divide
|
||||
// them by ofset X and Y.
|
||||
var splitRegex = /\s*,\s*|\s+/;
|
||||
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
|
||||
|
||||
// Convert the values with units to absolute pixels to allow our computations
|
||||
ops = ops.map(function (op, index) {
|
||||
// Most of the units rely on the orientation of the popper
|
||||
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
|
||||
var mergeWithPrevious = false;
|
||||
return op
|
||||
// This aggregates any `+` or `-` sign that aren't considered operators
|
||||
// e.g.: 10 + +5 => [10, +, +5]
|
||||
.reduce(function (a, b) {
|
||||
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
|
||||
a[a.length - 1] = b;
|
||||
mergeWithPrevious = true;
|
||||
return a;
|
||||
} else if (mergeWithPrevious) {
|
||||
a[a.length - 1] += b;
|
||||
mergeWithPrevious = false;
|
||||
return a;
|
||||
} else {
|
||||
return a.concat(b);
|
||||
}
|
||||
}, [])
|
||||
// Here we convert the string values into number values (in px)
|
||||
.map(function (str) {
|
||||
return toValue(str, measurement, popperOffsets, referenceOffsets);
|
||||
});
|
||||
});
|
||||
|
||||
// Loop trough the offsets arrays and execute the operations
|
||||
ops.forEach(function (op, index) {
|
||||
op.forEach(function (frag, index2) {
|
||||
if (isNumeric(frag)) {
|
||||
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
return offsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @argument {Number|String} options.offset=0
|
||||
* The offset value as described in the modifier description
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function offset(data, _ref) {
|
||||
var offset = _ref.offset;
|
||||
var placement = data.placement,
|
||||
_data$offsets = data.offsets,
|
||||
popper = _data$offsets.popper,
|
||||
reference = _data$offsets.reference;
|
||||
|
||||
var basePlacement = placement.split('-')[0];
|
||||
|
||||
var offsets = void 0;
|
||||
if (isNumeric(+offset)) {
|
||||
offsets = [+offset, 0];
|
||||
} else {
|
||||
offsets = parseOffset(offset, popper, reference, basePlacement);
|
||||
function detectOverflow(state, options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (basePlacement === 'left') {
|
||||
popper.top += offsets[0];
|
||||
popper.left -= offsets[1];
|
||||
} else if (basePlacement === 'right') {
|
||||
popper.top += offsets[0];
|
||||
popper.left += offsets[1];
|
||||
} else if (basePlacement === 'top') {
|
||||
popper.left += offsets[0];
|
||||
popper.top -= offsets[1];
|
||||
} else if (basePlacement === 'bottom') {
|
||||
popper.left += offsets[0];
|
||||
popper.top += offsets[1];
|
||||
var _options = options,
|
||||
_options$placement = _options.placement,
|
||||
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
||||
_options$boundary = _options.boundary,
|
||||
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
||||
_options$rootBoundary = _options.rootBoundary,
|
||||
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
||||
_options$elementConte = _options.elementContext,
|
||||
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
||||
_options$altBoundary = _options.altBoundary,
|
||||
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
||||
_options$padding = _options.padding,
|
||||
padding = _options$padding === void 0 ? 0 : _options$padding;
|
||||
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
||||
var altContext = elementContext === popper ? reference : popper;
|
||||
var referenceElement = state.elements.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var element = state.elements[altBoundary ? altContext : elementContext];
|
||||
var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
||||
var referenceClientRect = getBoundingClientRect(referenceElement);
|
||||
var popperOffsets = computeOffsets({
|
||||
reference: referenceClientRect,
|
||||
element: popperRect,
|
||||
strategy: 'absolute',
|
||||
placement: placement
|
||||
});
|
||||
var popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets));
|
||||
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
||||
// 0 or negative = within the clipping rect
|
||||
|
||||
var overflowOffsets = {
|
||||
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
||||
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
||||
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
||||
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
||||
};
|
||||
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
||||
|
||||
if (elementContext === popper && offsetData) {
|
||||
var offset = offsetData[placement];
|
||||
Object.keys(overflowOffsets).forEach(function (key) {
|
||||
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
||||
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
||||
overflowOffsets[key] += offset[axis] * multiply;
|
||||
});
|
||||
}
|
||||
|
||||
data.popper = popper;
|
||||
return data;
|
||||
return overflowOffsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function preventOverflow(data, options) {
|
||||
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
|
||||
/*:: type OverflowsMap = { [ComputedPlacement]: number }; */
|
||||
|
||||
// If offsetParent is the reference element, we really want to
|
||||
// go one step up and use the next offsetParent as reference to
|
||||
// avoid to make this modifier completely useless and look like broken
|
||||
if (data.instance.reference === boundariesElement) {
|
||||
boundariesElement = getOffsetParent(boundariesElement);
|
||||
/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
|
||||
function computeAutoPlacement(state, options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
// NOTE: DOM access here
|
||||
// resets the popper's position so that the document size can be calculated excluding
|
||||
// the size of the popper element itself
|
||||
var transformProp = getSupportedPropertyName('transform');
|
||||
var popperStyles = data.instance.popper.style; // assignment to help minification
|
||||
var top = popperStyles.top,
|
||||
left = popperStyles.left,
|
||||
transform = popperStyles[transformProp];
|
||||
var _options = options,
|
||||
placement = _options.placement,
|
||||
boundary = _options.boundary,
|
||||
rootBoundary = _options.rootBoundary,
|
||||
padding = _options.padding,
|
||||
flipVariations = _options.flipVariations,
|
||||
_options$allowedAutoP = _options.allowedAutoPlacements,
|
||||
allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
||||
var variation = getVariation(placement);
|
||||
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
||||
return getVariation(placement) === variation;
|
||||
}) : basePlacements; // $FlowFixMe
|
||||
|
||||
popperStyles.top = '';
|
||||
popperStyles.left = '';
|
||||
popperStyles[transformProp] = '';
|
||||
|
||||
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
|
||||
|
||||
// NOTE: DOM access here
|
||||
// restores the original style properties after the offsets have been computed
|
||||
popperStyles.top = top;
|
||||
popperStyles.left = left;
|
||||
popperStyles[transformProp] = transform;
|
||||
|
||||
options.boundaries = boundaries;
|
||||
|
||||
var order = options.priority;
|
||||
var popper = data.offsets.popper;
|
||||
|
||||
var check = {
|
||||
primary: function primary(placement) {
|
||||
var value = popper[placement];
|
||||
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
|
||||
value = Math.max(popper[placement], boundaries[placement]);
|
||||
}
|
||||
return defineProperty({}, placement, value);
|
||||
},
|
||||
secondary: function secondary(placement) {
|
||||
var mainSide = placement === 'right' ? 'left' : 'top';
|
||||
var value = popper[mainSide];
|
||||
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
|
||||
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
|
||||
}
|
||||
return defineProperty({}, mainSide, value);
|
||||
}
|
||||
};
|
||||
|
||||
order.forEach(function (placement) {
|
||||
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
||||
popper = _extends$1({}, popper, check[side](placement));
|
||||
var allowedPlacements = placements$1.filter(function (placement) {
|
||||
return allowedAutoPlacements.indexOf(placement) >= 0;
|
||||
});
|
||||
|
||||
data.offsets.popper = popper;
|
||||
if (allowedPlacements.length === 0) {
|
||||
allowedPlacements = placements$1;
|
||||
} // $FlowFixMe: Flow seems to have problems with two array unions...
|
||||
|
||||
return data;
|
||||
|
||||
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
||||
acc[placement] = detectOverflow(state, {
|
||||
placement: placement,
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
padding: padding
|
||||
})[getBasePlacement(placement)];
|
||||
return acc;
|
||||
}, {});
|
||||
return Object.keys(overflows).sort(function (a, b) {
|
||||
return overflows[a] - overflows[b];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function shift(data) {
|
||||
var placement = data.placement;
|
||||
var basePlacement = placement.split('-')[0];
|
||||
var shiftvariation = placement.split('-')[1];
|
||||
|
||||
// if shift shiftvariation is specified, run the modifier
|
||||
if (shiftvariation) {
|
||||
var _data$offsets = data.offsets,
|
||||
reference = _data$offsets.reference,
|
||||
popper = _data$offsets.popper;
|
||||
|
||||
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
|
||||
var side = isVertical ? 'left' : 'top';
|
||||
var measurement = isVertical ? 'width' : 'height';
|
||||
|
||||
var shiftOffsets = {
|
||||
start: defineProperty({}, side, reference[side]),
|
||||
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
||||
};
|
||||
|
||||
data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
|
||||
function getExpandedFallbackPlacements(placement) {
|
||||
if (getBasePlacement(placement) === auto) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return data;
|
||||
var oppositePlacement = getOppositePlacement(placement);
|
||||
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by update method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function hide(data) {
|
||||
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
|
||||
return data;
|
||||
function flip(_ref) {
|
||||
var state = _ref.state,
|
||||
options = _ref.options,
|
||||
name = _ref.name;
|
||||
|
||||
if (state.modifiersData[name]._skip) {
|
||||
return;
|
||||
}
|
||||
|
||||
var refRect = data.offsets.reference;
|
||||
var bound = find(data.instance.modifiers, function (modifier) {
|
||||
return modifier.name === 'preventOverflow';
|
||||
}).boundaries;
|
||||
var _options$mainAxis = options.mainAxis,
|
||||
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
||||
_options$altAxis = options.altAxis,
|
||||
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
||||
specifiedFallbackPlacements = options.fallbackPlacements,
|
||||
padding = options.padding,
|
||||
boundary = options.boundary,
|
||||
rootBoundary = options.rootBoundary,
|
||||
altBoundary = options.altBoundary,
|
||||
_options$flipVariatio = options.flipVariations,
|
||||
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
||||
allowedAutoPlacements = options.allowedAutoPlacements;
|
||||
var preferredPlacement = state.options.placement;
|
||||
var basePlacement = getBasePlacement(preferredPlacement);
|
||||
var isBasePlacement = basePlacement === preferredPlacement;
|
||||
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
||||
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
||||
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
||||
placement: placement,
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
padding: padding,
|
||||
flipVariations: flipVariations,
|
||||
allowedAutoPlacements: allowedAutoPlacements
|
||||
}) : placement);
|
||||
}, []);
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var checksMap = new Map();
|
||||
var makeFallbackChecks = true;
|
||||
var firstFittingPlacement = placements[0];
|
||||
|
||||
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
|
||||
// Avoid unnecessary DOM access if visibility hasn't changed
|
||||
if (data.hide === true) {
|
||||
return data;
|
||||
for (var i = 0; i < placements.length; i++) {
|
||||
var placement = placements[i];
|
||||
|
||||
var _basePlacement = getBasePlacement(placement);
|
||||
|
||||
var isStartVariation = getVariation(placement) === start;
|
||||
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
||||
var len = isVertical ? 'width' : 'height';
|
||||
var overflow = detectOverflow(state, {
|
||||
placement: placement,
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
altBoundary: altBoundary,
|
||||
padding: padding
|
||||
});
|
||||
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
||||
|
||||
if (referenceRect[len] > popperRect[len]) {
|
||||
mainVariationSide = getOppositePlacement(mainVariationSide);
|
||||
}
|
||||
|
||||
data.hide = true;
|
||||
data.attributes['x-out-of-boundaries'] = '';
|
||||
var altVariationSide = getOppositePlacement(mainVariationSide);
|
||||
var checks = [];
|
||||
|
||||
if (checkMainAxis) {
|
||||
checks.push(overflow[_basePlacement] <= 0);
|
||||
}
|
||||
|
||||
if (checkAltAxis) {
|
||||
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
||||
}
|
||||
|
||||
if (checks.every(function (check) {
|
||||
return check;
|
||||
})) {
|
||||
firstFittingPlacement = placement;
|
||||
makeFallbackChecks = false;
|
||||
break;
|
||||
}
|
||||
|
||||
checksMap.set(placement, checks);
|
||||
}
|
||||
|
||||
if (makeFallbackChecks) {
|
||||
// `2` may be desired in some cases – research later
|
||||
var numberOfChecks = flipVariations ? 3 : 1;
|
||||
|
||||
var _loop = function _loop(_i) {
|
||||
var fittingPlacement = placements.find(function (placement) {
|
||||
var checks = checksMap.get(placement);
|
||||
|
||||
if (checks) {
|
||||
return checks.slice(0, _i).every(function (check) {
|
||||
return check;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (fittingPlacement) {
|
||||
firstFittingPlacement = fittingPlacement;
|
||||
return "break";
|
||||
}
|
||||
};
|
||||
|
||||
for (var _i = numberOfChecks; _i > 0; _i--) {
|
||||
var _ret = _loop(_i);
|
||||
|
||||
if (_ret === "break") break;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.placement !== firstFittingPlacement) {
|
||||
state.modifiersData[name]._skip = true;
|
||||
state.placement = firstFittingPlacement;
|
||||
state.reset = true;
|
||||
}
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var flip$1 = {
|
||||
name: 'flip',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: flip,
|
||||
requiresIfExists: ['offset'],
|
||||
data: {
|
||||
_skip: false
|
||||
}
|
||||
};
|
||||
|
||||
function getSideOffsets(overflow, rect, preventedOffsets) {
|
||||
if (preventedOffsets === void 0) {
|
||||
preventedOffsets = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
top: overflow.top - rect.height - preventedOffsets.y,
|
||||
right: overflow.right - rect.width + preventedOffsets.x,
|
||||
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
||||
left: overflow.left - rect.width - preventedOffsets.x
|
||||
};
|
||||
}
|
||||
|
||||
function isAnySideFullyClipped(overflow) {
|
||||
return [top, right, bottom, left].some(function (side) {
|
||||
return overflow[side] >= 0;
|
||||
});
|
||||
}
|
||||
|
||||
function hide(_ref) {
|
||||
var state = _ref.state,
|
||||
name = _ref.name;
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var preventedOffsets = state.modifiersData.preventOverflow;
|
||||
var referenceOverflow = detectOverflow(state, {
|
||||
elementContext: 'reference'
|
||||
});
|
||||
var popperAltOverflow = detectOverflow(state, {
|
||||
altBoundary: true
|
||||
});
|
||||
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
||||
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
||||
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
||||
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
||||
state.modifiersData[name] = {
|
||||
referenceClippingOffsets: referenceClippingOffsets,
|
||||
popperEscapeOffsets: popperEscapeOffsets,
|
||||
isReferenceHidden: isReferenceHidden,
|
||||
hasPopperEscaped: hasPopperEscaped
|
||||
};
|
||||
state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {
|
||||
'data-popper-reference-hidden': isReferenceHidden,
|
||||
'data-popper-escaped': hasPopperEscaped
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var hide$1 = {
|
||||
name: 'hide',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
requiresIfExists: ['preventOverflow'],
|
||||
fn: hide
|
||||
};
|
||||
|
||||
function distanceAndSkiddingToXY(placement, rects, offset) {
|
||||
var basePlacement = getBasePlacement(placement);
|
||||
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
||||
|
||||
var _ref = typeof offset === 'function' ? offset(Object.assign(Object.assign({}, rects), {}, {
|
||||
placement: placement
|
||||
})) : offset,
|
||||
skidding = _ref[0],
|
||||
distance = _ref[1];
|
||||
|
||||
skidding = skidding || 0;
|
||||
distance = (distance || 0) * invertDistance;
|
||||
return [left, right].indexOf(basePlacement) >= 0 ? {
|
||||
x: distance,
|
||||
y: skidding
|
||||
} : {
|
||||
x: skidding,
|
||||
y: distance
|
||||
};
|
||||
}
|
||||
|
||||
function offset(_ref2) {
|
||||
var state = _ref2.state,
|
||||
options = _ref2.options,
|
||||
name = _ref2.name;
|
||||
var _options$offset = options.offset,
|
||||
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
||||
var data = placements.reduce(function (acc, placement) {
|
||||
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
||||
return acc;
|
||||
}, {});
|
||||
var _data$state$placement = data[state.placement],
|
||||
x = _data$state$placement.x,
|
||||
y = _data$state$placement.y;
|
||||
|
||||
if (state.modifiersData.popperOffsets != null) {
|
||||
state.modifiersData.popperOffsets.x += x;
|
||||
state.modifiersData.popperOffsets.y += y;
|
||||
}
|
||||
|
||||
state.modifiersData[name] = data;
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var offset$1 = {
|
||||
name: 'offset',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
requires: ['popperOffsets'],
|
||||
fn: offset
|
||||
};
|
||||
|
||||
function popperOffsets(_ref) {
|
||||
var state = _ref.state,
|
||||
name = _ref.name;
|
||||
// Offsets are the actual position the popper needs to have to be
|
||||
// properly positioned near its reference element
|
||||
// This is the most basic placement, and will be adjusted by
|
||||
// the modifiers in the next step
|
||||
state.modifiersData[name] = computeOffsets({
|
||||
reference: state.rects.reference,
|
||||
element: state.rects.popper,
|
||||
strategy: 'absolute',
|
||||
placement: state.placement
|
||||
});
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var popperOffsets$1 = {
|
||||
name: 'popperOffsets',
|
||||
enabled: true,
|
||||
phase: 'read',
|
||||
fn: popperOffsets,
|
||||
data: {}
|
||||
};
|
||||
|
||||
function getAltAxis(axis) {
|
||||
return axis === 'x' ? 'y' : 'x';
|
||||
}
|
||||
|
||||
function preventOverflow(_ref) {
|
||||
var state = _ref.state,
|
||||
options = _ref.options,
|
||||
name = _ref.name;
|
||||
var _options$mainAxis = options.mainAxis,
|
||||
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
||||
_options$altAxis = options.altAxis,
|
||||
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
||||
boundary = options.boundary,
|
||||
rootBoundary = options.rootBoundary,
|
||||
altBoundary = options.altBoundary,
|
||||
padding = options.padding,
|
||||
_options$tether = options.tether,
|
||||
tether = _options$tether === void 0 ? true : _options$tether,
|
||||
_options$tetherOffset = options.tetherOffset,
|
||||
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
||||
var overflow = detectOverflow(state, {
|
||||
boundary: boundary,
|
||||
rootBoundary: rootBoundary,
|
||||
padding: padding,
|
||||
altBoundary: altBoundary
|
||||
});
|
||||
var basePlacement = getBasePlacement(state.placement);
|
||||
var variation = getVariation(state.placement);
|
||||
var isBasePlacement = !variation;
|
||||
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
||||
var altAxis = getAltAxis(mainAxis);
|
||||
var popperOffsets = state.modifiersData.popperOffsets;
|
||||
var referenceRect = state.rects.reference;
|
||||
var popperRect = state.rects.popper;
|
||||
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(Object.assign({}, state.rects), {}, {
|
||||
placement: state.placement
|
||||
})) : tetherOffset;
|
||||
var data = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
if (!popperOffsets) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkMainAxis) {
|
||||
var mainSide = mainAxis === 'y' ? top : left;
|
||||
var altSide = mainAxis === 'y' ? bottom : right;
|
||||
var len = mainAxis === 'y' ? 'height' : 'width';
|
||||
var offset = popperOffsets[mainAxis];
|
||||
var min = popperOffsets[mainAxis] + overflow[mainSide];
|
||||
var max = popperOffsets[mainAxis] - overflow[altSide];
|
||||
var additive = tether ? -popperRect[len] / 2 : 0;
|
||||
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
||||
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
||||
// outside the reference bounds
|
||||
|
||||
var arrowElement = state.elements.arrow;
|
||||
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
||||
width: 0,
|
||||
height: 0
|
||||
};
|
||||
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
||||
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
||||
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
||||
// to include its full size in the calculation. If the reference is small
|
||||
// and near the edge of a boundary, the popper can overflow even if the
|
||||
// reference is not overflowing as well (e.g. virtual elements with no
|
||||
// width or height)
|
||||
|
||||
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
||||
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
|
||||
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
|
||||
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
||||
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
||||
var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
|
||||
var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
|
||||
var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
|
||||
var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);
|
||||
popperOffsets[mainAxis] = preventedOffset;
|
||||
data[mainAxis] = preventedOffset - offset;
|
||||
}
|
||||
|
||||
if (checkAltAxis) {
|
||||
var _mainSide = mainAxis === 'x' ? top : left;
|
||||
|
||||
var _altSide = mainAxis === 'x' ? bottom : right;
|
||||
|
||||
var _offset = popperOffsets[altAxis];
|
||||
|
||||
var _min = _offset + overflow[_mainSide];
|
||||
|
||||
var _max = _offset - overflow[_altSide];
|
||||
|
||||
var _preventedOffset = within(_min, _offset, _max);
|
||||
|
||||
popperOffsets[altAxis] = _preventedOffset;
|
||||
data[altAxis] = _preventedOffset - _offset;
|
||||
}
|
||||
|
||||
state.modifiersData[name] = data;
|
||||
} // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
|
||||
var preventOverflow$1 = {
|
||||
name: 'preventOverflow',
|
||||
enabled: true,
|
||||
phase: 'main',
|
||||
fn: preventOverflow,
|
||||
requiresIfExists: ['offset']
|
||||
};
|
||||
|
||||
function getHTMLElementScroll(element) {
|
||||
return {
|
||||
scrollLeft: element.scrollLeft,
|
||||
scrollTop: element.scrollTop
|
||||
};
|
||||
}
|
||||
|
||||
function getNodeScroll(node) {
|
||||
if (node === getWindow(node) || !isHTMLElement(node)) {
|
||||
return getWindowScroll(node);
|
||||
} else {
|
||||
// Avoid unnecessary DOM access if visibility hasn't changed
|
||||
if (data.hide === false) {
|
||||
return data;
|
||||
return getHTMLElementScroll(node);
|
||||
}
|
||||
}
|
||||
|
||||
// Composite means it takes into account transforms as well as layout.
|
||||
|
||||
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
if (isFixed === void 0) {
|
||||
isFixed = false;
|
||||
}
|
||||
|
||||
var documentElement = getDocumentElement(offsetParent);
|
||||
var rect = getBoundingClientRect(elementOrVirtualElement);
|
||||
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
||||
var scroll = {
|
||||
scrollLeft: 0,
|
||||
scrollTop: 0
|
||||
};
|
||||
var offsets = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
||||
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
||||
isScrollParent(documentElement)) {
|
||||
scroll = getNodeScroll(offsetParent);
|
||||
}
|
||||
|
||||
data.hide = false;
|
||||
data.attributes['x-out-of-boundaries'] = false;
|
||||
if (isHTMLElement(offsetParent)) {
|
||||
offsets = getBoundingClientRect(offsetParent);
|
||||
offsets.x += offsetParent.clientLeft;
|
||||
offsets.y += offsetParent.clientTop;
|
||||
} else if (documentElement) {
|
||||
offsets.x = getWindowScrollBarX(documentElement);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
return {
|
||||
x: rect.left + scroll.scrollLeft - offsets.x,
|
||||
y: rect.top + scroll.scrollTop - offsets.y,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @memberof Modifiers
|
||||
* @argument {Object} data - The data object generated by `update` method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {Object} The data object, properly modified
|
||||
*/
|
||||
function inner(data) {
|
||||
var placement = data.placement;
|
||||
var basePlacement = placement.split('-')[0];
|
||||
var _data$offsets = data.offsets,
|
||||
popper = _data$offsets.popper,
|
||||
reference = _data$offsets.reference;
|
||||
function order(modifiers) {
|
||||
var map = new Map();
|
||||
var visited = new Set();
|
||||
var result = [];
|
||||
modifiers.forEach(function (modifier) {
|
||||
map.set(modifier.name, modifier);
|
||||
}); // On visiting object, check for its dependencies and visit them recursively
|
||||
|
||||
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
|
||||
function sort(modifier) {
|
||||
visited.add(modifier.name);
|
||||
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
||||
requires.forEach(function (dep) {
|
||||
if (!visited.has(dep)) {
|
||||
var depModifier = map.get(dep);
|
||||
|
||||
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
|
||||
|
||||
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
|
||||
|
||||
data.placement = getOppositePlacement(placement);
|
||||
data.offsets.popper = getClientRect(popper);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifier function, each modifier can have a function of this type assigned
|
||||
* to its `fn` property.<br />
|
||||
* These functions will be called on each update, this means that you must
|
||||
* make sure they are performant enough to avoid performance bottlenecks.
|
||||
*
|
||||
* @function ModifierFn
|
||||
* @argument {dataObject} data - The data object generated by `update` method
|
||||
* @argument {Object} options - Modifiers configuration and options
|
||||
* @returns {dataObject} The data object, properly modified
|
||||
*/
|
||||
|
||||
/**
|
||||
* Modifiers are plugins used to alter the behavior of your poppers.<br />
|
||||
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities
|
||||
* needed by the library.
|
||||
*
|
||||
* Usually you don't want to override the `order`, `fn` and `onLoad` props.
|
||||
* All the other properties are configurations that could be tweaked.
|
||||
* @namespace modifiers
|
||||
*/
|
||||
var modifiers = {
|
||||
/**
|
||||
* Modifier used to shift the popper on the start or end of its reference
|
||||
* element.<br />
|
||||
* It will read the variation of the `placement` property.<br />
|
||||
* It can be one either `-end` or `-start`.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
shift: {
|
||||
/** @prop {number} order=100 - Index used to define the order of execution */
|
||||
order: 100,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: shift
|
||||
},
|
||||
|
||||
/**
|
||||
* The `offset` modifier can shift your popper on both its axis.
|
||||
*
|
||||
* It accepts the following units:
|
||||
* - `px` or unit-less, interpreted as pixels
|
||||
* - `%` or `%r`, percentage relative to the length of the reference element
|
||||
* - `%p`, percentage relative to the length of the popper element
|
||||
* - `vw`, CSS viewport width unit
|
||||
* - `vh`, CSS viewport height unit
|
||||
*
|
||||
* For length is intended the main axis relative to the placement of the popper.<br />
|
||||
* This means that if the placement is `top` or `bottom`, the length will be the
|
||||
* `width`. In case of `left` or `right`, it will be the `height`.
|
||||
*
|
||||
* You can provide a single value (as `Number` or `String`), or a pair of values
|
||||
* as `String` divided by a comma or one (or more) white spaces.<br />
|
||||
* The latter is a deprecated method because it leads to confusion and will be
|
||||
* removed in v2.<br />
|
||||
* Additionally, it accepts additions and subtractions between different units.
|
||||
* Note that multiplications and divisions aren't supported.
|
||||
*
|
||||
* Valid examples are:
|
||||
* ```
|
||||
* 10
|
||||
* '10%'
|
||||
* '10, 10'
|
||||
* '10%, 10'
|
||||
* '10 + 10%'
|
||||
* '10 - 5vh + 3%'
|
||||
* '-10px + 5vh, 5px - 6%'
|
||||
* ```
|
||||
* > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
|
||||
* > with their reference element, unfortunately, you will have to disable the `flip` modifier.
|
||||
* > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
|
||||
*
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
offset: {
|
||||
/** @prop {number} order=200 - Index used to define the order of execution */
|
||||
order: 200,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: offset,
|
||||
/** @prop {Number|String} offset=0
|
||||
* The offset value as described in the modifier description
|
||||
*/
|
||||
offset: 0
|
||||
},
|
||||
|
||||
/**
|
||||
* Modifier used to prevent the popper from being positioned outside the boundary.
|
||||
*
|
||||
* A scenario exists where the reference itself is not within the boundaries.<br />
|
||||
* We can say it has "escaped the boundaries" — or just "escaped".<br />
|
||||
* In this case we need to decide whether the popper should either:
|
||||
*
|
||||
* - detach from the reference and remain "trapped" in the boundaries, or
|
||||
* - if it should ignore the boundary and "escape with its reference"
|
||||
*
|
||||
* When `escapeWithReference` is set to`true` and reference is completely
|
||||
* outside its boundaries, the popper will overflow (or completely leave)
|
||||
* the boundaries in order to remain attached to the edge of the reference.
|
||||
*
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
preventOverflow: {
|
||||
/** @prop {number} order=300 - Index used to define the order of execution */
|
||||
order: 300,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: preventOverflow,
|
||||
/**
|
||||
* @prop {Array} [priority=['left','right','top','bottom']]
|
||||
* Popper will try to prevent overflow following these priorities by default,
|
||||
* then, it could overflow on the left and on top of the `boundariesElement`
|
||||
*/
|
||||
priority: ['left', 'right', 'top', 'bottom'],
|
||||
/**
|
||||
* @prop {number} padding=5
|
||||
* Amount of pixel used to define a minimum distance between the boundaries
|
||||
* and the popper. This makes sure the popper always has a little padding
|
||||
* between the edges of its container
|
||||
*/
|
||||
padding: 5,
|
||||
/**
|
||||
* @prop {String|HTMLElement} boundariesElement='scrollParent'
|
||||
* Boundaries used by the modifier. Can be `scrollParent`, `window`,
|
||||
* `viewport` or any DOM element.
|
||||
*/
|
||||
boundariesElement: 'scrollParent'
|
||||
},
|
||||
|
||||
/**
|
||||
* Modifier used to make sure the reference and its popper stay near each other
|
||||
* without leaving any gap between the two. Especially useful when the arrow is
|
||||
* enabled and you want to ensure that it points to its reference element.
|
||||
* It cares only about the first axis. You can still have poppers with margin
|
||||
* between the popper and its reference element.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
keepTogether: {
|
||||
/** @prop {number} order=400 - Index used to define the order of execution */
|
||||
order: 400,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: keepTogether
|
||||
},
|
||||
|
||||
/**
|
||||
* This modifier is used to move the `arrowElement` of the popper to make
|
||||
* sure it is positioned between the reference element and its popper element.
|
||||
* It will read the outer size of the `arrowElement` node to detect how many
|
||||
* pixels of conjunction are needed.
|
||||
*
|
||||
* It has no effect if no `arrowElement` is provided.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
arrow: {
|
||||
/** @prop {number} order=500 - Index used to define the order of execution */
|
||||
order: 500,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: arrow,
|
||||
/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
|
||||
element: '[x-arrow]'
|
||||
},
|
||||
|
||||
/**
|
||||
* Modifier used to flip the popper's placement when it starts to overlap its
|
||||
* reference element.
|
||||
*
|
||||
* Requires the `preventOverflow` modifier before it in order to work.
|
||||
*
|
||||
* **NOTE:** this modifier will interrupt the current update cycle and will
|
||||
* restart it if it detects the need to flip the placement.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
flip: {
|
||||
/** @prop {number} order=600 - Index used to define the order of execution */
|
||||
order: 600,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: flip,
|
||||
/**
|
||||
* @prop {String|Array} behavior='flip'
|
||||
* The behavior used to change the popper's placement. It can be one of
|
||||
* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
|
||||
* placements (with optional variations)
|
||||
*/
|
||||
behavior: 'flip',
|
||||
/**
|
||||
* @prop {number} padding=5
|
||||
* The popper will flip if it hits the edges of the `boundariesElement`
|
||||
*/
|
||||
padding: 5,
|
||||
/**
|
||||
* @prop {String|HTMLElement} boundariesElement='viewport'
|
||||
* The element which will define the boundaries of the popper position.
|
||||
* The popper will never be placed outside of the defined boundaries
|
||||
* (except if `keepTogether` is enabled)
|
||||
*/
|
||||
boundariesElement: 'viewport',
|
||||
/**
|
||||
* @prop {Boolean} flipVariations=false
|
||||
* The popper will switch placement variation between `-start` and `-end` when
|
||||
* the reference element overlaps its boundaries.
|
||||
*
|
||||
* The original placement should have a set variation.
|
||||
*/
|
||||
flipVariations: false,
|
||||
/**
|
||||
* @prop {Boolean} flipVariationsByContent=false
|
||||
* The popper will switch placement variation between `-start` and `-end` when
|
||||
* the popper element overlaps its reference boundaries.
|
||||
*
|
||||
* The original placement should have a set variation.
|
||||
*/
|
||||
flipVariationsByContent: false
|
||||
},
|
||||
|
||||
/**
|
||||
* Modifier used to make the popper flow toward the inner of the reference element.
|
||||
* By default, when this modifier is disabled, the popper will be placed outside
|
||||
* the reference element.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
inner: {
|
||||
/** @prop {number} order=700 - Index used to define the order of execution */
|
||||
order: 700,
|
||||
/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
|
||||
enabled: false,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: inner
|
||||
},
|
||||
|
||||
/**
|
||||
* Modifier used to hide the popper when its reference element is outside of the
|
||||
* popper boundaries. It will set a `x-out-of-boundaries` attribute which can
|
||||
* be used to hide with a CSS selector the popper when its reference is
|
||||
* out of boundaries.
|
||||
*
|
||||
* Requires the `preventOverflow` modifier before it in order to work.
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
hide: {
|
||||
/** @prop {number} order=800 - Index used to define the order of execution */
|
||||
order: 800,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: hide
|
||||
},
|
||||
|
||||
/**
|
||||
* Computes the style that will be applied to the popper element to gets
|
||||
* properly positioned.
|
||||
*
|
||||
* Note that this modifier will not touch the DOM, it just prepares the styles
|
||||
* so that `applyStyle` modifier can apply it. This separation is useful
|
||||
* in case you need to replace `applyStyle` with a custom implementation.
|
||||
*
|
||||
* This modifier has `850` as `order` value to maintain backward compatibility
|
||||
* with previous versions of Popper.js. Expect the modifiers ordering method
|
||||
* to change in future major versions of the library.
|
||||
*
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
computeStyle: {
|
||||
/** @prop {number} order=850 - Index used to define the order of execution */
|
||||
order: 850,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: computeStyle,
|
||||
/**
|
||||
* @prop {Boolean} gpuAcceleration=true
|
||||
* If true, it uses the CSS 3D transformation to position the popper.
|
||||
* Otherwise, it will use the `top` and `left` properties
|
||||
*/
|
||||
gpuAcceleration: true,
|
||||
/**
|
||||
* @prop {string} [x='bottom']
|
||||
* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
|
||||
* Change this if your popper should grow in a direction different from `bottom`
|
||||
*/
|
||||
x: 'bottom',
|
||||
/**
|
||||
* @prop {string} [x='left']
|
||||
* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
|
||||
* Change this if your popper should grow in a direction different from `right`
|
||||
*/
|
||||
y: 'right'
|
||||
},
|
||||
|
||||
/**
|
||||
* Applies the computed styles to the popper element.
|
||||
*
|
||||
* All the DOM manipulations are limited to this modifier. This is useful in case
|
||||
* you want to integrate Popper.js inside a framework or view library and you
|
||||
* want to delegate all the DOM manipulations to it.
|
||||
*
|
||||
* Note that if you disable this modifier, you must make sure the popper element
|
||||
* has its position set to `absolute` before Popper.js can do its work!
|
||||
*
|
||||
* Just disable this modifier and define your own to achieve the desired effect.
|
||||
*
|
||||
* @memberof modifiers
|
||||
* @inner
|
||||
*/
|
||||
applyStyle: {
|
||||
/** @prop {number} order=900 - Index used to define the order of execution */
|
||||
order: 900,
|
||||
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
||||
enabled: true,
|
||||
/** @prop {ModifierFn} */
|
||||
fn: applyStyle,
|
||||
/** @prop {Function} */
|
||||
onLoad: applyStyleOnLoad,
|
||||
/**
|
||||
* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
|
||||
* @prop {Boolean} gpuAcceleration=true
|
||||
* If true, it uses the CSS 3D transformation to position the popper.
|
||||
* Otherwise, it will use the `top` and `left` properties
|
||||
*/
|
||||
gpuAcceleration: undefined
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The `dataObject` is an object containing all the information used by Popper.js.
|
||||
* This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
|
||||
* @name dataObject
|
||||
* @property {Object} data.instance The Popper.js instance
|
||||
* @property {String} data.placement Placement applied to popper
|
||||
* @property {String} data.originalPlacement Placement originally defined on init
|
||||
* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
|
||||
* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
|
||||
* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
|
||||
* @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
||||
* @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
||||
* @property {Object} data.boundaries Offsets of the popper boundaries
|
||||
* @property {Object} data.offsets The measurements of popper, reference and arrow elements
|
||||
* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
|
||||
* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
|
||||
* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Default options provided to Popper.js constructor.<br />
|
||||
* These can be overridden using the `options` argument of Popper.js.<br />
|
||||
* To override an option, simply pass an object with the same
|
||||
* structure of the `options` object, as the 3rd argument. For example:
|
||||
* ```
|
||||
* new Popper(ref, pop, {
|
||||
* modifiers: {
|
||||
* preventOverflow: { enabled: false }
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
* @type {Object}
|
||||
* @static
|
||||
* @memberof Popper
|
||||
*/
|
||||
var Defaults = {
|
||||
/**
|
||||
* Popper's placement.
|
||||
* @prop {Popper.placements} placement='bottom'
|
||||
*/
|
||||
placement: 'bottom',
|
||||
|
||||
/**
|
||||
* Set this to true if you want popper to position it self in 'fixed' mode
|
||||
* @prop {Boolean} positionFixed=false
|
||||
*/
|
||||
positionFixed: false,
|
||||
|
||||
/**
|
||||
* Whether events (resize, scroll) are initially enabled.
|
||||
* @prop {Boolean} eventsEnabled=true
|
||||
*/
|
||||
eventsEnabled: true,
|
||||
|
||||
/**
|
||||
* Set to true if you want to automatically remove the popper when
|
||||
* you call the `destroy` method.
|
||||
* @prop {Boolean} removeOnDestroy=false
|
||||
*/
|
||||
removeOnDestroy: false,
|
||||
|
||||
/**
|
||||
* Callback called when the popper is created.<br />
|
||||
* By default, it is set to no-op.<br />
|
||||
* Access Popper.js instance with `data.instance`.
|
||||
* @prop {onCreate}
|
||||
*/
|
||||
onCreate: function onCreate() {},
|
||||
|
||||
/**
|
||||
* Callback called when the popper is updated. This callback is not called
|
||||
* on the initialization/creation of the popper, but only on subsequent
|
||||
* updates.<br />
|
||||
* By default, it is set to no-op.<br />
|
||||
* Access Popper.js instance with `data.instance`.
|
||||
* @prop {onUpdate}
|
||||
*/
|
||||
onUpdate: function onUpdate() {},
|
||||
|
||||
/**
|
||||
* List of modifiers used to modify the offsets before they are applied to the popper.
|
||||
* They provide most of the functionalities of Popper.js.
|
||||
* @prop {modifiers}
|
||||
*/
|
||||
modifiers: modifiers
|
||||
};
|
||||
|
||||
/**
|
||||
* @callback onCreate
|
||||
* @param {dataObject} data
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback onUpdate
|
||||
* @param {dataObject} data
|
||||
*/
|
||||
|
||||
// Utils
|
||||
// Methods
|
||||
var Popper = function () {
|
||||
/**
|
||||
* Creates a new Popper.js instance.
|
||||
* @class Popper
|
||||
* @param {Element|referenceObject} reference - The reference element used to position the popper
|
||||
* @param {Element} popper - The HTML / XML element used as the popper
|
||||
* @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
|
||||
* @return {Object} instance - The generated Popper.js instance
|
||||
*/
|
||||
function Popper(reference, popper) {
|
||||
var _this = this;
|
||||
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
classCallCheck(this, Popper);
|
||||
|
||||
this.scheduleUpdate = function () {
|
||||
return requestAnimationFrame(_this.update);
|
||||
};
|
||||
|
||||
// make update() debounced, so that it only runs at most once-per-tick
|
||||
this.update = debounce(this.update.bind(this));
|
||||
|
||||
// with {} we create a new object with the options inside it
|
||||
this.options = _extends$1({}, Popper.Defaults, options);
|
||||
|
||||
// init state
|
||||
this.state = {
|
||||
isDestroyed: false,
|
||||
isCreated: false,
|
||||
scrollParents: []
|
||||
};
|
||||
|
||||
// get reference and popper elements (allow jQuery wrappers)
|
||||
this.reference = reference && reference.jquery ? reference[0] : reference;
|
||||
this.popper = popper && popper.jquery ? popper[0] : popper;
|
||||
|
||||
// Deep merge modifiers options
|
||||
this.options.modifiers = {};
|
||||
Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
||||
_this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
||||
});
|
||||
|
||||
// Refactoring modifiers' list (Object => Array)
|
||||
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
|
||||
return _extends$1({
|
||||
name: name
|
||||
}, _this.options.modifiers[name]);
|
||||
})
|
||||
// sort the modifiers by order
|
||||
.sort(function (a, b) {
|
||||
return a.order - b.order;
|
||||
});
|
||||
|
||||
// modifiers have the ability to execute arbitrary code when Popper.js get inited
|
||||
// such code is executed in the same order of its modifier
|
||||
// they could add new properties to their options configuration
|
||||
// BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
|
||||
this.modifiers.forEach(function (modifierOptions) {
|
||||
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
|
||||
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
|
||||
if (depModifier) {
|
||||
sort(depModifier);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// fire the first update to position the popper in the right place
|
||||
this.update();
|
||||
|
||||
var eventsEnabled = this.options.eventsEnabled;
|
||||
if (eventsEnabled) {
|
||||
// setup event listeners, they will take care of update the position in specific situations
|
||||
this.enableEventListeners();
|
||||
}
|
||||
|
||||
this.state.eventsEnabled = eventsEnabled;
|
||||
result.push(modifier);
|
||||
}
|
||||
|
||||
// We can't use class properties because they don't get listed in the
|
||||
// class prototype and break stuff like Sinon stubs
|
||||
modifiers.forEach(function (modifier) {
|
||||
if (!visited.has(modifier.name)) {
|
||||
// check for visited object
|
||||
sort(modifier);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function orderModifiers(modifiers) {
|
||||
// order based on dependencies
|
||||
var orderedModifiers = order(modifiers); // order based on phase
|
||||
|
||||
createClass(Popper, [{
|
||||
key: 'update',
|
||||
value: function update$$1() {
|
||||
return update.call(this);
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function destroy$$1() {
|
||||
return destroy.call(this);
|
||||
}
|
||||
}, {
|
||||
key: 'enableEventListeners',
|
||||
value: function enableEventListeners$$1() {
|
||||
return enableEventListeners.call(this);
|
||||
}
|
||||
}, {
|
||||
key: 'disableEventListeners',
|
||||
value: function disableEventListeners$$1() {
|
||||
return disableEventListeners.call(this);
|
||||
return modifierPhases.reduce(function (acc, phase) {
|
||||
return acc.concat(orderedModifiers.filter(function (modifier) {
|
||||
return modifier.phase === phase;
|
||||
}));
|
||||
}, []);
|
||||
}
|
||||
|
||||
function debounce(fn) {
|
||||
var pending;
|
||||
return function () {
|
||||
if (!pending) {
|
||||
pending = new Promise(function (resolve) {
|
||||
Promise.resolve().then(function () {
|
||||
pending = undefined;
|
||||
resolve(fn());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules an update. It will run on the next UI update available.
|
||||
* @method scheduleUpdate
|
||||
* @memberof Popper
|
||||
*/
|
||||
return pending;
|
||||
};
|
||||
}
|
||||
|
||||
function mergeByName(modifiers) {
|
||||
var merged = modifiers.reduce(function (merged, current) {
|
||||
var existing = merged[current.name];
|
||||
merged[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), {}, {
|
||||
options: Object.assign(Object.assign({}, existing.options), current.options),
|
||||
data: Object.assign(Object.assign({}, existing.data), current.data)
|
||||
}) : current;
|
||||
return merged;
|
||||
}, {}); // IE11 does not support Object.values
|
||||
|
||||
return Object.keys(merged).map(function (key) {
|
||||
return merged[key];
|
||||
});
|
||||
}
|
||||
|
||||
var DEFAULT_OPTIONS = {
|
||||
placement: 'bottom',
|
||||
modifiers: [],
|
||||
strategy: 'absolute'
|
||||
};
|
||||
|
||||
function areValidElements() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return !args.some(function (element) {
|
||||
return !(element && typeof element.getBoundingClientRect === 'function');
|
||||
});
|
||||
}
|
||||
|
||||
function popperGenerator(generatorOptions) {
|
||||
if (generatorOptions === void 0) {
|
||||
generatorOptions = {};
|
||||
}
|
||||
|
||||
var _generatorOptions = generatorOptions,
|
||||
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
||||
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
||||
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
||||
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
||||
return function createPopper(reference, popper, options) {
|
||||
if (options === void 0) {
|
||||
options = defaultOptions;
|
||||
}
|
||||
|
||||
var state = {
|
||||
placement: 'bottom',
|
||||
orderedModifiers: [],
|
||||
options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),
|
||||
modifiersData: {},
|
||||
elements: {
|
||||
reference: reference,
|
||||
popper: popper
|
||||
},
|
||||
attributes: {},
|
||||
styles: {}
|
||||
};
|
||||
var effectCleanupFns = [];
|
||||
var isDestroyed = false;
|
||||
var instance = {
|
||||
state: state,
|
||||
setOptions: function setOptions(options) {
|
||||
cleanupModifierEffects();
|
||||
state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options);
|
||||
state.scrollParents = {
|
||||
reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
||||
popper: listScrollParents(popper)
|
||||
}; // Orders the modifiers based on their dependencies and `phase`
|
||||
// properties
|
||||
|
||||
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
||||
|
||||
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
||||
return m.enabled;
|
||||
}); // Validate the provided modifiers so that the consumer will get warned
|
||||
|
||||
runModifierEffects();
|
||||
return instance.update();
|
||||
},
|
||||
// Sync update – it will always be executed, even if not necessary. This
|
||||
// is useful for low frequency updates where sync behavior simplifies the
|
||||
// logic.
|
||||
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
||||
// prefer the async Popper#update method
|
||||
forceUpdate: function forceUpdate() {
|
||||
if (isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _state$elements = state.elements,
|
||||
reference = _state$elements.reference,
|
||||
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
||||
// anymore
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
|
||||
return;
|
||||
} // Store the reference and popper rects to be read by modifiers
|
||||
|
||||
|
||||
/**
|
||||
* Collection of utilities useful when writing custom modifiers.
|
||||
* Starting from version 1.7, this method is available only if you
|
||||
* include `popper-utils.js` before `popper.js`.
|
||||
*
|
||||
* **DEPRECATION**: This way to access PopperUtils is deprecated
|
||||
* and will be removed in v2! Use the PopperUtils module directly instead.
|
||||
* Due to the high instability of the methods contained in Utils, we can't
|
||||
* guarantee them to follow semver. Use them at your own risk!
|
||||
* @static
|
||||
* @private
|
||||
* @type {Object}
|
||||
* @deprecated since version 1.8
|
||||
* @member Utils
|
||||
* @memberof Popper
|
||||
*/
|
||||
state.rects = {
|
||||
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
||||
popper: getLayoutRect(popper)
|
||||
}; // Modifiers have the ability to reset the current update cycle. The
|
||||
// most common use case for this is the `flip` modifier changing the
|
||||
// placement, which then needs to re-run all the modifiers, because the
|
||||
// logic was previously ran for the previous placement and is therefore
|
||||
// stale/incorrect
|
||||
|
||||
}]);
|
||||
return Popper;
|
||||
}();
|
||||
state.reset = false;
|
||||
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
||||
// is filled with the initial data specified by the modifier. This means
|
||||
// it doesn't persist and is fresh on each update.
|
||||
// To ensure persistent data, use `${name}#persistent`
|
||||
|
||||
/**
|
||||
* The `referenceObject` is an object that provides an interface compatible with Popper.js
|
||||
* and lets you use it as replacement of a real DOM node.<br />
|
||||
* You can use this method to position a popper relatively to a set of coordinates
|
||||
* in case you don't have a DOM node to use as reference.
|
||||
*
|
||||
* ```
|
||||
* new Popper(referenceObject, popperNode);
|
||||
* ```
|
||||
*
|
||||
* NB: This feature isn't supported in Internet Explorer 10.
|
||||
* @name referenceObject
|
||||
* @property {Function} data.getBoundingClientRect
|
||||
* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
|
||||
* @property {number} data.clientWidth
|
||||
* An ES6 getter that will return the width of the virtual reference element.
|
||||
* @property {number} data.clientHeight
|
||||
* An ES6 getter that will return the height of the virtual reference element.
|
||||
*/
|
||||
state.orderedModifiers.forEach(function (modifier) {
|
||||
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
||||
});
|
||||
|
||||
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
||||
|
||||
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
|
||||
Popper.placements = placements;
|
||||
Popper.Defaults = Defaults;
|
||||
if (state.reset === true) {
|
||||
state.reset = false;
|
||||
index = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
var _state$orderedModifie = state.orderedModifiers[index],
|
||||
fn = _state$orderedModifie.fn,
|
||||
_state$orderedModifie2 = _state$orderedModifie.options,
|
||||
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
||||
name = _state$orderedModifie.name;
|
||||
|
||||
if (typeof fn === 'function') {
|
||||
state = fn({
|
||||
state: state,
|
||||
options: _options,
|
||||
name: name,
|
||||
instance: instance
|
||||
}) || state;
|
||||
}
|
||||
}
|
||||
},
|
||||
// Async and optimistically optimized update – it will not be executed if
|
||||
// not necessary (debounced to run at most once-per-tick)
|
||||
update: debounce(function () {
|
||||
return new Promise(function (resolve) {
|
||||
instance.forceUpdate();
|
||||
resolve(state);
|
||||
});
|
||||
}),
|
||||
destroy: function destroy() {
|
||||
cleanupModifierEffects();
|
||||
isDestroyed = true;
|
||||
}
|
||||
};
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
instance.setOptions(options).then(function (state) {
|
||||
if (!isDestroyed && options.onFirstUpdate) {
|
||||
options.onFirstUpdate(state);
|
||||
}
|
||||
}); // Modifiers have the ability to execute arbitrary code before the first
|
||||
// update cycle runs. They will be executed in the same order as the update
|
||||
// cycle. This is useful when a modifier adds some persistent data that
|
||||
// other modifiers need to use, but the modifier is run after the dependent
|
||||
// one.
|
||||
|
||||
function runModifierEffects() {
|
||||
state.orderedModifiers.forEach(function (_ref3) {
|
||||
var name = _ref3.name,
|
||||
_ref3$options = _ref3.options,
|
||||
options = _ref3$options === void 0 ? {} : _ref3$options,
|
||||
effect = _ref3.effect;
|
||||
|
||||
if (typeof effect === 'function') {
|
||||
var cleanupFn = effect({
|
||||
state: state,
|
||||
name: name,
|
||||
instance: instance,
|
||||
options: options
|
||||
});
|
||||
|
||||
var noopFn = function noopFn() {};
|
||||
|
||||
effectCleanupFns.push(cleanupFn || noopFn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleanupModifierEffects() {
|
||||
effectCleanupFns.forEach(function (fn) {
|
||||
return fn();
|
||||
});
|
||||
effectCleanupFns = [];
|
||||
}
|
||||
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
||||
var createPopper$1 = /*#__PURE__*/popperGenerator({
|
||||
defaultModifiers: defaultModifiers
|
||||
}); // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
||||
var createPopper$2 = /*#__PURE__*/popperGenerator({
|
||||
defaultModifiers: defaultModifiers$1
|
||||
}); // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
var Popper = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
popperGenerator: popperGenerator,
|
||||
detectOverflow: detectOverflow,
|
||||
createPopperBase: createPopper,
|
||||
createPopper: createPopper$2,
|
||||
createPopperLite: createPopper$1,
|
||||
top: top,
|
||||
bottom: bottom,
|
||||
right: right,
|
||||
left: left,
|
||||
auto: auto,
|
||||
basePlacements: basePlacements,
|
||||
start: start,
|
||||
end: end,
|
||||
clippingParents: clippingParents,
|
||||
viewport: viewport,
|
||||
popper: popper,
|
||||
reference: reference,
|
||||
variationPlacements: variationPlacements,
|
||||
placements: placements,
|
||||
beforeRead: beforeRead,
|
||||
read: read,
|
||||
afterRead: afterRead,
|
||||
beforeMain: beforeMain,
|
||||
main: main,
|
||||
afterMain: afterMain,
|
||||
beforeWrite: beforeWrite,
|
||||
write: write,
|
||||
afterWrite: afterWrite,
|
||||
modifierPhases: modifierPhases,
|
||||
applyStyles: applyStyles$1,
|
||||
arrow: arrow$1,
|
||||
computeStyles: computeStyles$1,
|
||||
eventListeners: eventListeners,
|
||||
flip: flip$1,
|
||||
hide: hide$1,
|
||||
offset: offset$1,
|
||||
popperOffsets: popperOffsets$1,
|
||||
preventOverflow: preventOverflow$1
|
||||
});
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
@ -4675,9 +3776,7 @@
|
||||
var CLASS_NAME_DROPUP = 'dropup';
|
||||
var CLASS_NAME_DROPEND = 'dropend';
|
||||
var CLASS_NAME_DROPSTART = 'dropstart';
|
||||
var CLASS_NAME_MENUEND = 'dropdown-menu-end';
|
||||
var CLASS_NAME_NAVBAR = 'navbar';
|
||||
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||
var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="dropdown"]';
|
||||
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||
var SELECTOR_MENU = '.dropdown-menu';
|
||||
@ -4692,7 +3791,7 @@
|
||||
var Default$2 = {
|
||||
offset: 0,
|
||||
flip: true,
|
||||
boundary: 'scrollParent',
|
||||
boundary: 'clippingParents',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic',
|
||||
popperConfig: null
|
||||
@ -4779,16 +3878,9 @@
|
||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||
referenceElement = this._config.reference[0];
|
||||
}
|
||||
} // If boundary is not `scrollParent`, then set position to `static`
|
||||
// to allow the menu to "escape" the scroll parent's boundaries
|
||||
// https://github.com/twbs/bootstrap/issues/24251
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
parent.classList.add(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = createPopper$2(referenceElement, this._menu, this._getPopperConfig());
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@ -4857,7 +3949,7 @@
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Private
|
||||
;
|
||||
@ -4885,60 +3977,46 @@
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var parentDropdown = this._element.parentNode;
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
placement = this._menu.classList.contains(CLASS_NAME_MENUEND) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
placement = PLACEMENT_RIGHT;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
placement = PLACEMENT_LEFT;
|
||||
} else if (this._menu.classList.contains(CLASS_NAME_MENUEND)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
return PLACEMENT_RIGHT;
|
||||
}
|
||||
|
||||
return placement;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
return PLACEMENT_LEFT;
|
||||
} // We need to trim the value because custom properties can also include spaces
|
||||
|
||||
|
||||
var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
}
|
||||
|
||||
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
|
||||
};
|
||||
|
||||
_proto._detectNavbar = function _detectNavbar() {
|
||||
return Boolean(this._element.closest("." + CLASS_NAME_NAVBAR));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this._config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
|
||||
};
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig() {
|
||||
var popperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
enabled: this._config.flip
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this._config.boundary
|
||||
modifiers: [{
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
altBoundary: this._config.flip,
|
||||
rootBoundary: this._config.boundary
|
||||
}
|
||||
}
|
||||
}]
|
||||
}; // Disable Popper if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
popperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
@ -5779,7 +4857,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/sanitizer.js
|
||||
* Bootstrap (v5.0.0-beta1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -5925,9 +5003,8 @@
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
fallbackPlacements: '(null|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
@ -5951,10 +5028,9 @@
|
||||
html: false,
|
||||
selector: false,
|
||||
placement: 'top',
|
||||
offset: 0,
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
fallbackPlacements: null,
|
||||
boundary: 'clippingParents',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
@ -6131,7 +5207,7 @@
|
||||
}
|
||||
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this._element, tip, this._getPopperConfig(attachment));
|
||||
this._popper = createPopper$2(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
@ -6154,10 +5230,6 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
@ -6197,7 +5269,11 @@
|
||||
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this3._popper.destroy();
|
||||
if (_this3._popper) {
|
||||
_this3._popper.destroy();
|
||||
|
||||
_this3._popper = null;
|
||||
}
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
@ -6234,7 +5310,7 @@
|
||||
|
||||
_proto.update = function update() {
|
||||
if (this._popper !== null) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Protected
|
||||
;
|
||||
@ -6320,27 +5396,41 @@
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this4 = this;
|
||||
|
||||
var flipModifier = {
|
||||
name: 'flip',
|
||||
options: {
|
||||
altBoundary: true
|
||||
}
|
||||
};
|
||||
|
||||
if (this.config.fallbackPlacements) {
|
||||
flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
|
||||
}
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
modifiers: [flipModifier, {
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
rootBoundary: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
}, {
|
||||
name: 'arrow',
|
||||
options: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
}
|
||||
}, {
|
||||
name: 'onChange',
|
||||
enabled: true,
|
||||
phase: 'afterWrite',
|
||||
fn: function fn(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
}],
|
||||
onFirstUpdate: function onFirstUpdate(data) {
|
||||
if (data.options.placement !== data.placement) {
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -6350,23 +5440,6 @@
|
||||
this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this.config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
};
|
||||
|
||||
_proto._getContainer = function _getContainer() {
|
||||
if (this.config.container === false) {
|
||||
return document.body;
|
||||
@ -6384,29 +5457,29 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this6 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
EventHandler.on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5._element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
});
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
EventHandler.on(_this5._element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
if (_this5._element) {
|
||||
_this5.hide();
|
||||
}
|
||||
};
|
||||
|
||||
@ -6579,26 +5652,17 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
this.tip = popperData.instance.popper;
|
||||
var state = popperData.state;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(popperData.placement));
|
||||
};
|
||||
|
||||
_proto._fixTransition = function _fixTransition() {
|
||||
var tip = this.getTipElement();
|
||||
var initConfigAnimation = this.config.animation;
|
||||
|
||||
if (tip.getAttribute('x-placement') !== null) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
tip.classList.remove(CLASS_NAME_FADE$1);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
this.config.animation = initConfigAnimation;
|
||||
this.tip = state.elements.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -7613,7 +6677,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): index.umd.js
|
||||
* Bootstrap (v5.0.0-beta1): index.umd.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
dist/js/bootstrap.bundle.js.map
vendored
2
dist/js/bootstrap.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/js/bootstrap.bundle.min.js
vendored
4
dist/js/bootstrap.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.bundle.min.js.map
vendored
2
dist/js/bootstrap.bundle.min.js.map
vendored
File diff suppressed because one or more lines are too long
226
dist/js/bootstrap.esm.js
vendored
226
dist/js/bootstrap.esm.js
vendored
@ -1,9 +1,10 @@
|
||||
/*!
|
||||
* Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
import Popper from 'popper.js';
|
||||
import * as Popper from '@popperjs/core';
|
||||
import { createPopper } from '@popperjs/core';
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@ -47,7 +48,7 @@ function _inheritsLoose(subClass, superClass) {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -232,7 +233,7 @@ var isRTL = document.documentElement.dir === 'rtl';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/data.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -299,7 +300,7 @@ var Data = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/event-handler.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -578,7 +579,7 @@ var EventHandler = {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
@ -861,7 +862,7 @@ onDOMContentLoaded(function () {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/manipulator.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -933,7 +934,7 @@ var Manipulator = {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/selector-engine.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2057,9 +2058,7 @@ var CLASS_NAME_SHOW$1 = 'show';
|
||||
var CLASS_NAME_DROPUP = 'dropup';
|
||||
var CLASS_NAME_DROPEND = 'dropend';
|
||||
var CLASS_NAME_DROPSTART = 'dropstart';
|
||||
var CLASS_NAME_MENUEND = 'dropdown-menu-end';
|
||||
var CLASS_NAME_NAVBAR = 'navbar';
|
||||
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||
var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="dropdown"]';
|
||||
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||
var SELECTOR_MENU = '.dropdown-menu';
|
||||
@ -2074,7 +2073,7 @@ var PLACEMENT_LEFT = isRTL ? 'right-start' : 'left-start';
|
||||
var Default$2 = {
|
||||
offset: 0,
|
||||
flip: true,
|
||||
boundary: 'scrollParent',
|
||||
boundary: 'clippingParents',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic',
|
||||
popperConfig: null
|
||||
@ -2161,16 +2160,9 @@ var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||
referenceElement = this._config.reference[0];
|
||||
}
|
||||
} // If boundary is not `scrollParent`, then set position to `static`
|
||||
// to allow the menu to "escape" the scroll parent's boundaries
|
||||
// https://github.com/twbs/bootstrap/issues/24251
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
parent.classList.add(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = createPopper(referenceElement, this._menu, this._getPopperConfig());
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@ -2239,7 +2231,7 @@ var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Private
|
||||
;
|
||||
@ -2267,60 +2259,46 @@ var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var parentDropdown = this._element.parentNode;
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
placement = this._menu.classList.contains(CLASS_NAME_MENUEND) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
placement = PLACEMENT_RIGHT;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
placement = PLACEMENT_LEFT;
|
||||
} else if (this._menu.classList.contains(CLASS_NAME_MENUEND)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
return PLACEMENT_RIGHT;
|
||||
}
|
||||
|
||||
return placement;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
return PLACEMENT_LEFT;
|
||||
} // We need to trim the value because custom properties can also include spaces
|
||||
|
||||
|
||||
var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
}
|
||||
|
||||
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
|
||||
};
|
||||
|
||||
_proto._detectNavbar = function _detectNavbar() {
|
||||
return Boolean(this._element.closest("." + CLASS_NAME_NAVBAR));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this._config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
|
||||
};
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig() {
|
||||
var popperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
enabled: this._config.flip
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this._config.boundary
|
||||
modifiers: [{
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
altBoundary: this._config.flip,
|
||||
rootBoundary: this._config.boundary
|
||||
}
|
||||
}
|
||||
}]
|
||||
}; // Disable Popper if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
popperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
@ -3161,7 +3139,7 @@ onDOMContentLoaded(function () {
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/sanitizer.js
|
||||
* Bootstrap (v5.0.0-beta1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3307,9 +3285,8 @@ var DefaultType$4 = {
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
fallbackPlacements: '(null|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
@ -3333,10 +3310,9 @@ var Default$4 = {
|
||||
html: false,
|
||||
selector: false,
|
||||
placement: 'top',
|
||||
offset: 0,
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
fallbackPlacements: null,
|
||||
boundary: 'clippingParents',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
@ -3513,7 +3489,7 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
}
|
||||
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this._element, tip, this._getPopperConfig(attachment));
|
||||
this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
@ -3536,10 +3512,6 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
@ -3579,7 +3551,11 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this3._popper.destroy();
|
||||
if (_this3._popper) {
|
||||
_this3._popper.destroy();
|
||||
|
||||
_this3._popper = null;
|
||||
}
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
@ -3616,7 +3592,7 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
|
||||
_proto.update = function update() {
|
||||
if (this._popper !== null) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Protected
|
||||
;
|
||||
@ -3702,27 +3678,41 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this4 = this;
|
||||
|
||||
var flipModifier = {
|
||||
name: 'flip',
|
||||
options: {
|
||||
altBoundary: true
|
||||
}
|
||||
};
|
||||
|
||||
if (this.config.fallbackPlacements) {
|
||||
flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
|
||||
}
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
modifiers: [flipModifier, {
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
rootBoundary: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
}, {
|
||||
name: 'arrow',
|
||||
options: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
}
|
||||
}, {
|
||||
name: 'onChange',
|
||||
enabled: true,
|
||||
phase: 'afterWrite',
|
||||
fn: function fn(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
}],
|
||||
onFirstUpdate: function onFirstUpdate(data) {
|
||||
if (data.options.placement !== data.placement) {
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -3732,23 +3722,6 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this.config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
};
|
||||
|
||||
_proto._getContainer = function _getContainer() {
|
||||
if (this.config.container === false) {
|
||||
return document.body;
|
||||
@ -3766,29 +3739,29 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this6 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
EventHandler.on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5._element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
});
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
EventHandler.on(_this5._element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
if (_this5._element) {
|
||||
_this5.hide();
|
||||
}
|
||||
};
|
||||
|
||||
@ -3961,26 +3934,17 @@ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
this.tip = popperData.instance.popper;
|
||||
var state = popperData.state;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(popperData.placement));
|
||||
};
|
||||
|
||||
_proto._fixTransition = function _fixTransition() {
|
||||
var tip = this.getTipElement();
|
||||
var initConfigAnimation = this.config.animation;
|
||||
|
||||
if (tip.getAttribute('x-placement') !== null) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
tip.classList.remove(CLASS_NAME_FADE$1);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
this.config.animation = initConfigAnimation;
|
||||
this.tip = state.elements.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
} // Static
|
||||
;
|
||||
|
||||
|
2
dist/js/bootstrap.esm.js.map
vendored
2
dist/js/bootstrap.esm.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/js/bootstrap.esm.min.js
vendored
4
dist/js/bootstrap.esm.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.esm.min.js.map
vendored
2
dist/js/bootstrap.esm.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,17 +1,35 @@
|
||||
/*!
|
||||
* Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('popper.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['popper.js'], factory) :
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper));
|
||||
}(this, (function (Popper) { 'use strict';
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return e[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n['default'] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@ -55,7 +73,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -240,7 +258,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/data.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -307,7 +325,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/event-handler.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -586,7 +604,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
@ -869,7 +887,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/manipulator.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -941,7 +959,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/selector-engine.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2065,9 +2083,7 @@
|
||||
var CLASS_NAME_DROPUP = 'dropup';
|
||||
var CLASS_NAME_DROPEND = 'dropend';
|
||||
var CLASS_NAME_DROPSTART = 'dropstart';
|
||||
var CLASS_NAME_MENUEND = 'dropdown-menu-end';
|
||||
var CLASS_NAME_NAVBAR = 'navbar';
|
||||
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||
var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="dropdown"]';
|
||||
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||
var SELECTOR_MENU = '.dropdown-menu';
|
||||
@ -2082,7 +2098,7 @@
|
||||
var Default$2 = {
|
||||
offset: 0,
|
||||
flip: true,
|
||||
boundary: 'scrollParent',
|
||||
boundary: 'clippingParents',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic',
|
||||
popperConfig: null
|
||||
@ -2155,7 +2171,7 @@
|
||||
|
||||
|
||||
if (!this._inNavbar) {
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
if (typeof Popper__namespace === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
@ -2169,16 +2185,9 @@
|
||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||
referenceElement = this._config.reference[0];
|
||||
}
|
||||
} // If boundary is not `scrollParent`, then set position to `static`
|
||||
// to allow the menu to "escape" the scroll parent's boundaries
|
||||
// https://github.com/twbs/bootstrap/issues/24251
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
parent.classList.add(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = Popper.createPopper(referenceElement, this._menu, this._getPopperConfig());
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@ -2247,7 +2256,7 @@
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Private
|
||||
;
|
||||
@ -2275,60 +2284,46 @@
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var parentDropdown = this._element.parentNode;
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
placement = this._menu.classList.contains(CLASS_NAME_MENUEND) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
placement = PLACEMENT_RIGHT;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
placement = PLACEMENT_LEFT;
|
||||
} else if (this._menu.classList.contains(CLASS_NAME_MENUEND)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
return PLACEMENT_RIGHT;
|
||||
}
|
||||
|
||||
return placement;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
return PLACEMENT_LEFT;
|
||||
} // We need to trim the value because custom properties can also include spaces
|
||||
|
||||
|
||||
var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
}
|
||||
|
||||
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
|
||||
};
|
||||
|
||||
_proto._detectNavbar = function _detectNavbar() {
|
||||
return Boolean(this._element.closest("." + CLASS_NAME_NAVBAR));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this._config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
|
||||
};
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig() {
|
||||
var popperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
enabled: this._config.flip
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this._config.boundary
|
||||
modifiers: [{
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
altBoundary: this._config.flip,
|
||||
rootBoundary: this._config.boundary
|
||||
}
|
||||
}
|
||||
}]
|
||||
}; // Disable Popper if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
popperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
@ -3169,7 +3164,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/sanitizer.js
|
||||
* Bootstrap (v5.0.0-beta1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3315,9 +3310,8 @@
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
fallbackPlacements: '(null|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
@ -3341,10 +3335,9 @@
|
||||
html: false,
|
||||
selector: false,
|
||||
placement: 'top',
|
||||
offset: 0,
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
fallbackPlacements: null,
|
||||
boundary: 'clippingParents',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
@ -3385,7 +3378,7 @@
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
if (typeof Popper__namespace === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
@ -3521,7 +3514,7 @@
|
||||
}
|
||||
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this._element, tip, this._getPopperConfig(attachment));
|
||||
this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
@ -3544,10 +3537,6 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
@ -3587,7 +3576,11 @@
|
||||
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this3._popper.destroy();
|
||||
if (_this3._popper) {
|
||||
_this3._popper.destroy();
|
||||
|
||||
_this3._popper = null;
|
||||
}
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
@ -3624,7 +3617,7 @@
|
||||
|
||||
_proto.update = function update() {
|
||||
if (this._popper !== null) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Protected
|
||||
;
|
||||
@ -3710,27 +3703,41 @@
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this4 = this;
|
||||
|
||||
var flipModifier = {
|
||||
name: 'flip',
|
||||
options: {
|
||||
altBoundary: true
|
||||
}
|
||||
};
|
||||
|
||||
if (this.config.fallbackPlacements) {
|
||||
flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
|
||||
}
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
modifiers: [flipModifier, {
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
rootBoundary: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
}, {
|
||||
name: 'arrow',
|
||||
options: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
}
|
||||
}, {
|
||||
name: 'onChange',
|
||||
enabled: true,
|
||||
phase: 'afterWrite',
|
||||
fn: function fn(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
}],
|
||||
onFirstUpdate: function onFirstUpdate(data) {
|
||||
if (data.options.placement !== data.placement) {
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -3740,23 +3747,6 @@
|
||||
this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this.config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
};
|
||||
|
||||
_proto._getContainer = function _getContainer() {
|
||||
if (this.config.container === false) {
|
||||
return document.body;
|
||||
@ -3774,29 +3764,29 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this6 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
EventHandler.on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5._element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
});
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
EventHandler.on(_this5._element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
if (_this5._element) {
|
||||
_this5.hide();
|
||||
}
|
||||
};
|
||||
|
||||
@ -3969,26 +3959,17 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
this.tip = popperData.instance.popper;
|
||||
var state = popperData.state;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(popperData.placement));
|
||||
};
|
||||
|
||||
_proto._fixTransition = function _fixTransition() {
|
||||
var tip = this.getTipElement();
|
||||
var initConfigAnimation = this.config.animation;
|
||||
|
||||
if (tip.getAttribute('x-placement') !== null) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
tip.classList.remove(CLASS_NAME_FADE$1);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
this.config.animation = initConfigAnimation;
|
||||
this.tip = state.elements.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -5003,7 +4984,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): index.umd.js
|
||||
* Bootstrap (v5.0.0-beta1): index.umd.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
dist/js/bootstrap.js.map
vendored
2
dist/js/bootstrap.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/js/bootstrap.min.js
vendored
4
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.min.js.map
vendored
2
dist/js/bootstrap.min.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/alert.js
vendored
6
js/dist/alert.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap alert.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap alert.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -114,7 +114,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/alert.js.map
vendored
2
js/dist/alert.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/button.js
vendored
6
js/dist/button.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap button.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap button.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -51,7 +51,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/button.js.map
vendored
2
js/dist/button.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/carousel.js
vendored
6
js/dist/carousel.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap carousel.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap carousel.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -158,7 +158,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/carousel.js.map
vendored
2
js/dist/carousel.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/collapse.js
vendored
6
js/dist/collapse.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap collapse.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap collapse.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -154,7 +154,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/collapse.js.map
vendored
2
js/dist/collapse.js.map
vendored
File diff suppressed because one or more lines are too long
4
js/dist/dom/data.js
vendored
4
js/dist/dom/data.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap data.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap data.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/data.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
js/dist/dom/data.js.map
vendored
2
js/dist/dom/data.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha3): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst mapData = (() => {\n const storeData = {}\n let id = 1\n return {\n set(element, key, data) {\n if (typeof element.bsKey === 'undefined') {\n element.bsKey = {\n key,\n id\n }\n id++\n }\n\n storeData[element.bsKey.id] = data\n },\n get(element, key) {\n if (!element || typeof element.bsKey === 'undefined') {\n return null\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n return storeData[keyProperties.id]\n }\n\n return null\n },\n delete(element, key) {\n if (typeof element.bsKey === 'undefined') {\n return\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n delete storeData[keyProperties.id]\n delete element.bsKey\n }\n }\n }\n})()\n\nconst Data = {\n setData(instance, key, data) {\n mapData.set(instance, key, data)\n },\n getData(instance, key) {\n return mapData.get(instance, key)\n },\n removeData(instance, key) {\n mapData.delete(instance, key)\n }\n}\n\nexport default Data\n"],"names":["mapData","storeData","id","set","element","key","data","bsKey","get","keyProperties","delete","Data","setData","instance","getData","removeData"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,IAAMA,OAAO,GAAI,YAAM;EACrB,MAAMC,SAAS,GAAG,EAAlB;EACA,MAAIC,EAAE,GAAG,CAAT;EACA,SAAO;EACLC,IAAAA,GADK,eACDC,OADC,EACQC,GADR,EACaC,IADb,EACmB;EACtB,UAAI,OAAOF,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxCH,QAAAA,OAAO,CAACG,KAAR,GAAgB;EACdF,UAAAA,GAAG,EAAHA,GADc;EAEdH,UAAAA,EAAE,EAAFA;EAFc,SAAhB;EAIAA,QAAAA,EAAE;EACH;;EAEDD,MAAAA,SAAS,CAACG,OAAO,CAACG,KAAR,CAAcL,EAAf,CAAT,GAA8BI,IAA9B;EACD,KAXI;EAYLE,IAAAA,GAZK,eAYDJ,OAZC,EAYQC,GAZR,EAYa;EAChB,UAAI,CAACD,OAAD,IAAY,OAAOA,OAAO,CAACG,KAAf,KAAyB,WAAzC,EAAsD;EACpD,eAAO,IAAP;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACD;;EAED,aAAO,IAAP;EACD,KAvBI;EAwBLQ,IAAAA,MAxBK,mBAwBEN,OAxBF,EAwBWC,GAxBX,EAwBgB;EACnB,UAAI,OAAOD,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxC;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACA,eAAOE,OAAO,CAACG,KAAf;EACD;EACF;EAlCI,GAAP;EAoCD,CAvCe,EAAhB;;MAyCMI,IAAI,GAAG;EACXC,EAAAA,OADW,mBACHC,QADG,EACOR,GADP,EACYC,IADZ,EACkB;EAC3BN,IAAAA,OAAO,CAACG,GAAR,CAAYU,QAAZ,EAAsBR,GAAtB,EAA2BC,IAA3B;EACD,GAHU;EAIXQ,EAAAA,OAJW,mBAIHD,QAJG,EAIOR,GAJP,EAIY;EACrB,WAAOL,OAAO,CAACQ,GAAR,CAAYK,QAAZ,EAAsBR,GAAtB,CAAP;EACD,GANU;EAOXU,EAAAA,UAPW,sBAOAF,QAPA,EAOUR,GAPV,EAOe;EACxBL,IAAAA,OAAO,CAACU,MAAR,CAAeG,QAAf,EAAyBR,GAAzB;EACD;EATU;;;;;;;;"}
|
||||
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst mapData = (() => {\n const storeData = {}\n let id = 1\n return {\n set(element, key, data) {\n if (typeof element.bsKey === 'undefined') {\n element.bsKey = {\n key,\n id\n }\n id++\n }\n\n storeData[element.bsKey.id] = data\n },\n get(element, key) {\n if (!element || typeof element.bsKey === 'undefined') {\n return null\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n return storeData[keyProperties.id]\n }\n\n return null\n },\n delete(element, key) {\n if (typeof element.bsKey === 'undefined') {\n return\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n delete storeData[keyProperties.id]\n delete element.bsKey\n }\n }\n }\n})()\n\nconst Data = {\n setData(instance, key, data) {\n mapData.set(instance, key, data)\n },\n getData(instance, key) {\n return mapData.get(instance, key)\n },\n removeData(instance, key) {\n mapData.delete(instance, key)\n }\n}\n\nexport default Data\n"],"names":["mapData","storeData","id","set","element","key","data","bsKey","get","keyProperties","delete","Data","setData","instance","getData","removeData"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,IAAMA,OAAO,GAAI,YAAM;EACrB,MAAMC,SAAS,GAAG,EAAlB;EACA,MAAIC,EAAE,GAAG,CAAT;EACA,SAAO;EACLC,IAAAA,GADK,eACDC,OADC,EACQC,GADR,EACaC,IADb,EACmB;EACtB,UAAI,OAAOF,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxCH,QAAAA,OAAO,CAACG,KAAR,GAAgB;EACdF,UAAAA,GAAG,EAAHA,GADc;EAEdH,UAAAA,EAAE,EAAFA;EAFc,SAAhB;EAIAA,QAAAA,EAAE;EACH;;EAEDD,MAAAA,SAAS,CAACG,OAAO,CAACG,KAAR,CAAcL,EAAf,CAAT,GAA8BI,IAA9B;EACD,KAXI;EAYLE,IAAAA,GAZK,eAYDJ,OAZC,EAYQC,GAZR,EAYa;EAChB,UAAI,CAACD,OAAD,IAAY,OAAOA,OAAO,CAACG,KAAf,KAAyB,WAAzC,EAAsD;EACpD,eAAO,IAAP;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACD;;EAED,aAAO,IAAP;EACD,KAvBI;EAwBLQ,IAAAA,MAxBK,mBAwBEN,OAxBF,EAwBWC,GAxBX,EAwBgB;EACnB,UAAI,OAAOD,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxC;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACA,eAAOE,OAAO,CAACG,KAAf;EACD;EACF;EAlCI,GAAP;EAoCD,CAvCe,EAAhB;;MAyCMI,IAAI,GAAG;EACXC,EAAAA,OADW,mBACHC,QADG,EACOR,GADP,EACYC,IADZ,EACkB;EAC3BN,IAAAA,OAAO,CAACG,GAAR,CAAYU,QAAZ,EAAsBR,GAAtB,EAA2BC,IAA3B;EACD,GAHU;EAIXQ,EAAAA,OAJW,mBAIHD,QAJG,EAIOR,GAJP,EAIY;EACrB,WAAOL,OAAO,CAACQ,GAAR,CAAYK,QAAZ,EAAsBR,GAAtB,CAAP;EACD,GANU;EAOXU,EAAAA,UAPW,sBAOAF,QAPA,EAOUR,GAPV,EAOe;EACxBL,IAAAA,OAAO,CAACU,MAAR,CAAeG,QAAf,EAAyBR,GAAzB;EACD;EATU;;;;;;;;"}
|
6
js/dist/dom/event-handler.js
vendored
6
js/dist/dom/event-handler.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap event-handler.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap event-handler.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/event-handler.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
js/dist/dom/event-handler.js.map
vendored
2
js/dist/dom/event-handler.js.map
vendored
File diff suppressed because one or more lines are too long
4
js/dist/dom/manipulator.js
vendored
4
js/dist/dom/manipulator.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap manipulator.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap manipulator.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/manipulator.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
js/dist/dom/manipulator.js.map
vendored
2
js/dist/dom/manipulator.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha3): 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,EAAsB,UAAAC,GAAG;EAAA,iBAAQA,GAAG,CAACC,WAAJ,EAAR;EAAA,GAAzB,CAAP;EACD;;MAEKC,WAAW,GAAG;EAClBC,EAAAA,gBADkB,4BACDC,OADC,EACQN,GADR,EACaO,KADb,EACoB;EACpCD,IAAAA,OAAO,CAACE,YAAR,cAAgCT,gBAAgB,CAACC,GAAD,CAAhD,EAAyDO,KAAzD;EACD,GAHiB;EAKlBE,EAAAA,mBALkB,+BAKEH,OALF,EAKWN,GALX,EAKgB;EAChCM,IAAAA,OAAO,CAACI,eAAR,cAAmCX,gBAAgB,CAACC,GAAD,CAAnD;EACD,GAPiB;EASlBW,EAAAA,iBATkB,6BASAL,OATA,EASS;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,QAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACU,UAAAhB,GAAG;EAAA,aAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CAAJ;EAAA,KADb,EAEGC,OAFH,CAEW,UAAAlB,GAAG,EAAI;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,gBA3BkB,4BA2BDjB,OA3BC,EA2BQN,GA3BR,EA2Ba;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,cAAgCzB,gBAAgB,CAACC,GAAD,CAAhD,CAAD,CAApB;EACD,GA7BiB;EA+BlByB,EAAAA,MA/BkB,kBA+BXnB,OA/BW,EA+BF;EACd,QAAMoB,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,QAxCkB,oBAwCT5B,OAxCS,EAwCA;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;EA7CiB;;;;;;;;"}
|
||||
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta1): 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,EAAsB,UAAAC,GAAG;EAAA,iBAAQA,GAAG,CAACC,WAAJ,EAAR;EAAA,GAAzB,CAAP;EACD;;MAEKC,WAAW,GAAG;EAClBC,EAAAA,gBADkB,4BACDC,OADC,EACQN,GADR,EACaO,KADb,EACoB;EACpCD,IAAAA,OAAO,CAACE,YAAR,cAAgCT,gBAAgB,CAACC,GAAD,CAAhD,EAAyDO,KAAzD;EACD,GAHiB;EAKlBE,EAAAA,mBALkB,+BAKEH,OALF,EAKWN,GALX,EAKgB;EAChCM,IAAAA,OAAO,CAACI,eAAR,cAAmCX,gBAAgB,CAACC,GAAD,CAAnD;EACD,GAPiB;EASlBW,EAAAA,iBATkB,6BASAL,OATA,EASS;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,QAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACU,UAAAhB,GAAG;EAAA,aAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CAAJ;EAAA,KADb,EAEGC,OAFH,CAEW,UAAAlB,GAAG,EAAI;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,gBA3BkB,4BA2BDjB,OA3BC,EA2BQN,GA3BR,EA2Ba;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,cAAgCzB,gBAAgB,CAACC,GAAD,CAAhD,CAAD,CAApB;EACD,GA7BiB;EA+BlByB,EAAAA,MA/BkB,kBA+BXnB,OA/BW,EA+BF;EACd,QAAMoB,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,QAxCkB,oBAwCT5B,OAxCS,EAwCA;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;EA7CiB;;;;;;;;"}
|
4
js/dist/dom/selector-engine.js
vendored
4
js/dist/dom/selector-engine.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap selector-engine.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap selector-engine.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): dom/selector-engine.js
|
||||
* Bootstrap (v5.0.0-beta1): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
js/dist/dom/selector-engine.js.map
vendored
2
js/dist/dom/selector-engine.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha3): 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 matches(element, selector) {\n return element.matches(selector)\n },\n\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 const children = [].concat(...element.children)\n\n return children.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 (this.matches(ancestor, 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 (this.matches(next, 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","matches","element","selector","find","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","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,IAAMA,SAAS,GAAG,CAAlB;MAEMC,cAAc,GAAG;EACrBC,EAAAA,OADqB,mBACbC,OADa,EACJC,QADI,EACM;EACzB,WAAOD,OAAO,CAACD,OAAR,CAAgBE,QAAhB,CAAP;EACD,GAHoB;EAKrBC,EAAAA,IALqB,gBAKhBD,QALgB,EAKND,OALM,EAK8B;EAAA;;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACjD,WAAO,YAAGC,MAAH,aAAaC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCT,OAAxC,EAAiDC,QAAjD,CAAb,CAAP;EACD,GAPoB;EASrBS,EAAAA,OATqB,mBASbT,QATa,EASHD,OATG,EASiC;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCT,OAArC,EAA8CC,QAA9C,CAAP;EACD,GAXoB;EAarBW,EAAAA,QAbqB,oBAaZZ,OAbY,EAaHC,QAbG,EAaO;EAAA;;EAC1B,QAAMW,QAAQ,GAAG,aAAGP,MAAH,cAAaL,OAAO,CAACY,QAArB,CAAjB;;EAEA,WAAOA,QAAQ,CAACC,MAAT,CAAgB,UAAAC,KAAK;EAAA,aAAIA,KAAK,CAACf,OAAN,CAAcE,QAAd,CAAJ;EAAA,KAArB,CAAP;EACD,GAjBoB;EAmBrBc,EAAAA,OAnBqB,mBAmBbf,OAnBa,EAmBJC,QAnBI,EAmBM;EACzB,QAAMc,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGhB,OAAO,CAACiB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAI,KAAKE,OAAL,CAAaiB,QAAb,EAAuBf,QAAvB,CAAJ,EAAsC;EACpCc,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GAjCoB;EAmCrBO,EAAAA,IAnCqB,gBAmChBtB,OAnCgB,EAmCPC,QAnCO,EAmCG;EACtB,QAAIsB,QAAQ,GAAGvB,OAAO,CAACwB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACxB,OAAT,CAAiBE,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACsB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA/CoB;EAiDrBC,EAAAA,IAjDqB,gBAiDhBzB,OAjDgB,EAiDPC,QAjDO,EAiDG;EACtB,QAAIwB,IAAI,GAAGzB,OAAO,CAAC0B,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAI,KAAK1B,OAAL,CAAa0B,IAAb,EAAmBxB,QAAnB,CAAJ,EAAkC;EAChC,eAAO,CAACwB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;EA7DoB;;;;;;;;"}
|
||||
{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-beta1): 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 matches(element, selector) {\n return element.matches(selector)\n },\n\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 const children = [].concat(...element.children)\n\n return children.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 (this.matches(ancestor, 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 (this.matches(next, 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","matches","element","selector","find","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","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,IAAMA,SAAS,GAAG,CAAlB;MAEMC,cAAc,GAAG;EACrBC,EAAAA,OADqB,mBACbC,OADa,EACJC,QADI,EACM;EACzB,WAAOD,OAAO,CAACD,OAAR,CAAgBE,QAAhB,CAAP;EACD,GAHoB;EAKrBC,EAAAA,IALqB,gBAKhBD,QALgB,EAKND,OALM,EAK8B;EAAA;;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACjD,WAAO,YAAGC,MAAH,aAAaC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCT,OAAxC,EAAiDC,QAAjD,CAAb,CAAP;EACD,GAPoB;EASrBS,EAAAA,OATqB,mBASbT,QATa,EASHD,OATG,EASiC;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCT,OAArC,EAA8CC,QAA9C,CAAP;EACD,GAXoB;EAarBW,EAAAA,QAbqB,oBAaZZ,OAbY,EAaHC,QAbG,EAaO;EAAA;;EAC1B,QAAMW,QAAQ,GAAG,aAAGP,MAAH,cAAaL,OAAO,CAACY,QAArB,CAAjB;;EAEA,WAAOA,QAAQ,CAACC,MAAT,CAAgB,UAAAC,KAAK;EAAA,aAAIA,KAAK,CAACf,OAAN,CAAcE,QAAd,CAAJ;EAAA,KAArB,CAAP;EACD,GAjBoB;EAmBrBc,EAAAA,OAnBqB,mBAmBbf,OAnBa,EAmBJC,QAnBI,EAmBM;EACzB,QAAMc,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGhB,OAAO,CAACiB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAI,KAAKE,OAAL,CAAaiB,QAAb,EAAuBf,QAAvB,CAAJ,EAAsC;EACpCc,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GAjCoB;EAmCrBO,EAAAA,IAnCqB,gBAmChBtB,OAnCgB,EAmCPC,QAnCO,EAmCG;EACtB,QAAIsB,QAAQ,GAAGvB,OAAO,CAACwB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACxB,OAAT,CAAiBE,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACsB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA/CoB;EAiDrBC,EAAAA,IAjDqB,gBAiDhBzB,OAjDgB,EAiDPC,QAjDO,EAiDG;EACtB,QAAIwB,IAAI,GAAGzB,OAAO,CAAC0B,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAI,KAAK1B,OAAL,CAAa0B,IAAb,EAAmBxB,QAAnB,CAAJ,EAAkC;EAChC,eAAO,CAACwB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;EA7DoB;;;;;;;;"}
|
115
js/dist/dropdown.js
vendored
115
js/dist/dropdown.js
vendored
@ -1,25 +1,45 @@
|
||||
/*!
|
||||
* Bootstrap dropdown.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap dropdown.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', 'popper.js', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
|
||||
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')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return e[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n['default'] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
||||
var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -112,7 +132,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
@ -185,9 +205,7 @@
|
||||
var CLASS_NAME_DROPUP = 'dropup';
|
||||
var CLASS_NAME_DROPEND = 'dropend';
|
||||
var CLASS_NAME_DROPSTART = 'dropstart';
|
||||
var CLASS_NAME_MENUEND = 'dropdown-menu-end';
|
||||
var CLASS_NAME_NAVBAR = 'navbar';
|
||||
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||
var SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]';
|
||||
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||
var SELECTOR_MENU = '.dropdown-menu';
|
||||
@ -202,7 +220,7 @@
|
||||
var Default = {
|
||||
offset: 0,
|
||||
flip: true,
|
||||
boundary: 'scrollParent',
|
||||
boundary: 'clippingParents',
|
||||
reference: 'toggle',
|
||||
display: 'dynamic',
|
||||
popperConfig: null
|
||||
@ -275,7 +293,7 @@
|
||||
|
||||
|
||||
if (!this._inNavbar) {
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
if (typeof Popper__namespace === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
@ -289,16 +307,9 @@
|
||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||
referenceElement = this._config.reference[0];
|
||||
}
|
||||
} // If boundary is not `scrollParent`, then set position to `static`
|
||||
// to allow the menu to "escape" the scroll parent's boundaries
|
||||
// https://github.com/twbs/bootstrap/issues/24251
|
||||
|
||||
|
||||
if (this._config.boundary !== 'scrollParent') {
|
||||
parent.classList.add(CLASS_NAME_POSITION_STATIC);
|
||||
}
|
||||
|
||||
this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
|
||||
this._popper = Popper.createPopper(referenceElement, this._menu, this._getPopperConfig());
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
@ -367,7 +378,7 @@
|
||||
this._inNavbar = this._detectNavbar();
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Private
|
||||
;
|
||||
@ -395,60 +406,46 @@
|
||||
|
||||
_proto._getPlacement = function _getPlacement() {
|
||||
var parentDropdown = this._element.parentNode;
|
||||
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
placement = this._menu.classList.contains(CLASS_NAME_MENUEND) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
placement = PLACEMENT_RIGHT;
|
||||
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
placement = PLACEMENT_LEFT;
|
||||
} else if (this._menu.classList.contains(CLASS_NAME_MENUEND)) {
|
||||
placement = PLACEMENT_BOTTOMEND;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
|
||||
return PLACEMENT_RIGHT;
|
||||
}
|
||||
|
||||
return placement;
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
|
||||
return PLACEMENT_LEFT;
|
||||
} // We need to trim the value because custom properties can also include spaces
|
||||
|
||||
|
||||
var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
|
||||
|
||||
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
|
||||
return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||
}
|
||||
|
||||
return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
|
||||
};
|
||||
|
||||
_proto._detectNavbar = function _detectNavbar() {
|
||||
return Boolean(this._element.closest("." + CLASS_NAME_NAVBAR));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this._config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
return this._element.closest("." + CLASS_NAME_NAVBAR) !== null;
|
||||
};
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig() {
|
||||
var popperConfig = {
|
||||
placement: this._getPlacement(),
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
enabled: this._config.flip
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this._config.boundary
|
||||
modifiers: [{
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
altBoundary: this._config.flip,
|
||||
rootBoundary: this._config.boundary
|
||||
}
|
||||
}
|
||||
}]
|
||||
}; // Disable Popper if we have a static display
|
||||
|
||||
if (this._config.display === 'static') {
|
||||
popperConfig.modifiers.applyStyle = {
|
||||
popperConfig.modifiers = [{
|
||||
name: 'applyStyles',
|
||||
enabled: false
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
||||
return _extends({}, popperConfig, this._config.popperConfig);
|
||||
|
2
js/dist/dropdown.js.map
vendored
2
js/dist/dropdown.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/modal.js
vendored
6
js/dist/modal.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap modal.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap modal.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -158,7 +158,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/modal.js.map
vendored
2
js/dist/modal.js.map
vendored
File diff suppressed because one or more lines are too long
4
js/dist/popover.js
vendored
4
js/dist/popover.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap popover.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap popover.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
2
js/dist/popover.js.map
vendored
2
js/dist/popover.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/scrollspy.js
vendored
6
js/dist/scrollspy.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap scrollspy.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap scrollspy.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -113,7 +113,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/scrollspy.js.map
vendored
2
js/dist/scrollspy.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/tab.js
vendored
6
js/dist/tab.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap tab.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap tab.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -119,7 +119,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/tab.js.map
vendored
2
js/dist/tab.js.map
vendored
File diff suppressed because one or more lines are too long
6
js/dist/toast.js
vendored
6
js/dist/toast.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap toast.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap toast.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -127,7 +127,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
|
2
js/dist/toast.js.map
vendored
2
js/dist/toast.js.map
vendored
File diff suppressed because one or more lines are too long
170
js/dist/tooltip.js
vendored
170
js/dist/tooltip.js
vendored
@ -1,25 +1,45 @@
|
||||
/*!
|
||||
* Bootstrap tooltip.js v5.0.0-alpha3 (https://getbootstrap.com/)
|
||||
* Bootstrap tooltip.js v5.0.0-beta1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', 'popper.js', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
|
||||
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')) :
|
||||
typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return e[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n['default'] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
||||
var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
||||
var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
||||
var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
||||
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||
var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/index.js
|
||||
* Bootstrap (v5.0.0-beta1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -160,7 +180,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-alpha3): util/sanitizer.js
|
||||
* Bootstrap (v5.0.0-beta1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@ -294,7 +314,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var VERSION = '5.0.0-beta1';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
@ -357,9 +377,8 @@
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: '(number|string|function)',
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
fallbackPlacements: '(null|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
@ -383,10 +402,9 @@
|
||||
html: false,
|
||||
selector: false,
|
||||
placement: 'top',
|
||||
offset: 0,
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
fallbackPlacements: null,
|
||||
boundary: 'clippingParents',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
@ -427,7 +445,7 @@
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
if (typeof Popper__namespace === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
}
|
||||
|
||||
@ -563,7 +581,7 @@
|
||||
}
|
||||
|
||||
EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this._element, tip, this._getPopperConfig(attachment));
|
||||
this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
@ -586,10 +604,6 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler__default['default'].trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
@ -629,7 +643,11 @@
|
||||
|
||||
EventHandler__default['default'].trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this3._popper.destroy();
|
||||
if (_this3._popper) {
|
||||
_this3._popper.destroy();
|
||||
|
||||
_this3._popper = null;
|
||||
}
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
|
||||
@ -666,7 +684,7 @@
|
||||
|
||||
_proto.update = function update() {
|
||||
if (this._popper !== null) {
|
||||
this._popper.scheduleUpdate();
|
||||
this._popper.update();
|
||||
}
|
||||
} // Protected
|
||||
;
|
||||
@ -752,27 +770,41 @@
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this4 = this;
|
||||
|
||||
var flipModifier = {
|
||||
name: 'flip',
|
||||
options: {
|
||||
altBoundary: true
|
||||
}
|
||||
};
|
||||
|
||||
if (this.config.fallbackPlacements) {
|
||||
flipModifier.options.fallbackPlacements = this.config.fallbackPlacements;
|
||||
}
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
modifiers: {
|
||||
offset: this._getOffset(),
|
||||
flip: {
|
||||
behavior: this.config.fallbackPlacement
|
||||
},
|
||||
arrow: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
},
|
||||
preventOverflow: {
|
||||
boundariesElement: this.config.boundary
|
||||
modifiers: [flipModifier, {
|
||||
name: 'preventOverflow',
|
||||
options: {
|
||||
rootBoundary: this.config.boundary
|
||||
}
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
}, {
|
||||
name: 'arrow',
|
||||
options: {
|
||||
element: "." + this.constructor.NAME + "-arrow"
|
||||
}
|
||||
}, {
|
||||
name: 'onChange',
|
||||
enabled: true,
|
||||
phase: 'afterWrite',
|
||||
fn: function fn(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
}],
|
||||
onFirstUpdate: function onFirstUpdate(data) {
|
||||
if (data.options.placement !== data.placement) {
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -782,23 +814,6 @@
|
||||
this.getTipElement().classList.add(CLASS_PREFIX + "-" + this.updateAttachment(attachment));
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
offset.offset = this.config.offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
};
|
||||
|
||||
_proto._getContainer = function _getContainer() {
|
||||
if (this.config.container === false) {
|
||||
return document.body;
|
||||
@ -816,29 +831,29 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this6 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler__default['default'].on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
EventHandler__default['default'].on(_this5._element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler__default['default'].on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler__default['default'].on(_this5._element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
});
|
||||
EventHandler__default['default'].on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
EventHandler__default['default'].on(_this5._element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
if (_this5._element) {
|
||||
_this5.hide();
|
||||
}
|
||||
};
|
||||
|
||||
@ -1011,26 +1026,17 @@
|
||||
};
|
||||
|
||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||
this.tip = popperData.instance.popper;
|
||||
var state = popperData.state;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(popperData.placement));
|
||||
};
|
||||
|
||||
_proto._fixTransition = function _fixTransition() {
|
||||
var tip = this.getTipElement();
|
||||
var initConfigAnimation = this.config.animation;
|
||||
|
||||
if (tip.getAttribute('x-placement') !== null) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
tip.classList.remove(CLASS_NAME_FADE);
|
||||
this.config.animation = false;
|
||||
this.hide();
|
||||
this.show();
|
||||
this.config.animation = initConfigAnimation;
|
||||
this.tip = state.elements.popper;
|
||||
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
} // Static
|
||||
;
|
||||
|
||||
|
2
js/dist/tooltip.js.map
vendored
2
js/dist/tooltip.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user