bootstrap-italia 2.12.1 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.EN.md +1 -1
- package/README.md +1 -1
- package/dist/bootstrap-italia.esm.js +1 -1
- package/dist/css/bootstrap-italia.min.css +9 -1
- package/dist/css/bootstrap-italia.min.css.map +1 -1
- package/dist/js/bootstrap-italia.bundle.min.js +19 -23
- package/dist/js/bootstrap-italia.min.js +18 -2
- package/dist/plugins/accept-overlay.js +19 -9
- package/dist/plugins/accept-overlay.js.map +1 -1
- package/dist/plugins/accordion.js +19 -24
- package/dist/plugins/accordion.js.map +1 -1
- package/dist/plugins/alert.js +67 -2
- package/dist/plugins/alert.js.map +1 -1
- package/dist/plugins/{backToTop.js → back-to-top.js} +14 -5
- package/dist/plugins/back-to-top.js.map +1 -0
- package/dist/plugins/base-component.js +91 -0
- package/dist/plugins/base-component.js.map +1 -0
- package/dist/plugins/button.js +58 -2
- package/dist/plugins/button.js.map +1 -1
- package/dist/plugins/carousel-bi.js +19 -9
- package/dist/plugins/carousel-bi.js.map +1 -1
- package/dist/plugins/carousel.js +445 -2
- package/dist/plugins/carousel.js.map +1 -1
- package/dist/plugins/collapse.js +273 -2
- package/dist/plugins/collapse.js.map +1 -1
- package/dist/plugins/cookiebar.js +39 -52
- package/dist/plugins/cookiebar.js.map +1 -1
- package/dist/plugins/dimmer.js +19 -8
- package/dist/plugins/dimmer.js.map +1 -1
- package/dist/plugins/dom/data.js +61 -0
- package/dist/plugins/dom/data.js.map +1 -0
- package/dist/plugins/dom/event-handler.js +296 -0
- package/dist/plugins/dom/event-handler.js.map +1 -0
- package/dist/plugins/dom/manipulator.js +76 -0
- package/dist/plugins/dom/manipulator.js.map +1 -0
- package/dist/plugins/dom/selector-engine.js +82 -0
- package/dist/plugins/dom/selector-engine.js.map +1 -0
- package/dist/plugins/dropdown.js +433 -2
- package/dist/plugins/dropdown.js.map +1 -1
- package/dist/plugins/fonts-loader.js +9 -1
- package/dist/plugins/fonts-loader.js.map +1 -1
- package/dist/plugins/form-validate.js +22 -8
- package/dist/plugins/form-validate.js.map +1 -1
- package/dist/plugins/forward.js +21 -18
- package/dist/plugins/forward.js.map +1 -1
- package/dist/plugins/header-sticky.js +11 -2
- package/dist/plugins/header-sticky.js.map +1 -1
- package/dist/plugins/history-back.js +17 -17
- package/dist/plugins/history-back.js.map +1 -1
- package/dist/plugins/init.js +9 -0
- package/dist/plugins/init.js.map +1 -1
- package/dist/plugins/input-label.js +14 -3
- package/dist/plugins/input-label.js.map +1 -1
- package/dist/plugins/input-number.js +13 -4
- package/dist/plugins/input-number.js.map +1 -1
- package/dist/plugins/input-password.js +48 -37
- package/dist/plugins/input-password.js.map +1 -1
- package/dist/plugins/input-search-autocomplete.js +9 -11
- package/dist/plugins/input-search-autocomplete.js.map +1 -1
- package/dist/plugins/input.js +12 -3
- package/dist/plugins/input.js.map +1 -1
- package/dist/plugins/list.js +23 -12
- package/dist/plugins/list.js.map +1 -1
- package/dist/plugins/masonry.js +29 -29
- package/dist/plugins/masonry.js.map +1 -1
- package/dist/plugins/modal.js +358 -2
- package/dist/plugins/modal.js.map +1 -1
- package/dist/plugins/navbar-collapsible.js +55 -45
- package/dist/plugins/navbar-collapsible.js.map +1 -1
- package/dist/plugins/navscroll.js +16 -23
- package/dist/plugins/navscroll.js.map +1 -1
- package/dist/plugins/notification.js +34 -23
- package/dist/plugins/notification.js.map +1 -1
- package/dist/plugins/offcanvas.js +259 -2
- package/dist/plugins/offcanvas.js.map +1 -1
- package/dist/plugins/popover.js +76 -2
- package/dist/plugins/popover.js.map +1 -1
- package/dist/plugins/progress-donut.js +19 -12
- package/dist/plugins/progress-donut.js.map +1 -1
- package/dist/plugins/scrollspy.js +273 -2
- package/dist/plugins/scrollspy.js.map +1 -1
- package/dist/plugins/select-autocomplete.js +10 -1
- package/dist/plugins/select-autocomplete.js.map +1 -1
- package/dist/plugins/sticky.js +21 -18
- package/dist/plugins/sticky.js.map +1 -1
- package/dist/plugins/tab.js +244 -27
- package/dist/plugins/tab.js.map +1 -1
- package/dist/plugins/toast.js +203 -2
- package/dist/plugins/toast.js.map +1 -1
- package/dist/plugins/tooltip.js +602 -2
- package/dist/plugins/tooltip.js.map +1 -1
- package/dist/plugins/track-focus.js +8 -0
- package/dist/plugins/track-focus.js.map +1 -1
- package/dist/plugins/transfer.js +11 -16
- package/dist/plugins/transfer.js.map +1 -1
- package/dist/plugins/upload-dragdrop.js +13 -4
- package/dist/plugins/upload-dragdrop.js.map +1 -1
- package/dist/plugins/util/backdrop.js +155 -0
- package/dist/plugins/util/backdrop.js.map +1 -0
- package/dist/plugins/util/component-functions.js +38 -0
- package/dist/plugins/util/component-functions.js.map +1 -0
- package/dist/plugins/util/config.js +70 -0
- package/dist/plugins/util/config.js.map +1 -0
- package/dist/plugins/util/cookies.js +8 -0
- package/dist/plugins/util/cookies.js.map +1 -1
- package/dist/plugins/util/device.js +0 -3
- package/dist/plugins/util/device.js.map +1 -1
- package/dist/plugins/util/dom.js +8 -0
- package/dist/plugins/util/dom.js.map +1 -1
- package/dist/plugins/util/focustrap.js +121 -0
- package/dist/plugins/util/focustrap.js.map +1 -0
- package/dist/plugins/util/index.js +280 -0
- package/dist/plugins/util/index.js.map +1 -0
- package/dist/plugins/util/observer.js +8 -0
- package/dist/plugins/util/observer.js.map +1 -1
- package/dist/plugins/util/on-document-scroll.js +20 -9
- package/dist/plugins/util/on-document-scroll.js.map +1 -1
- package/dist/plugins/util/pageScroll.js +8 -0
- package/dist/plugins/util/pageScroll.js.map +1 -1
- package/dist/plugins/util/sanitizer.js +115 -0
- package/dist/plugins/util/sanitizer.js.map +1 -0
- package/dist/plugins/util/scrollbar.js +120 -0
- package/dist/plugins/util/scrollbar.js.map +1 -0
- package/dist/plugins/util/swipe.js +150 -0
- package/dist/plugins/util/swipe.js.map +1 -0
- package/dist/plugins/util/template-factory.js +166 -0
- package/dist/plugins/util/template-factory.js.map +1 -0
- package/dist/plugins/util/tween.js +10 -1
- package/dist/plugins/util/tween.js.map +1 -1
- package/dist/plugins/util/youtube-video.js +12 -21
- package/dist/plugins/util/youtube-video.js.map +1 -1
- package/dist/plugins/videoplayer.js +19 -8
- package/dist/plugins/videoplayer.js.map +1 -1
- package/dist/version.js +10 -3
- package/dist/version.js.map +1 -1
- package/package.json +6 -7
- package/src/js/bootstrap-italia.entry.js +8 -0
- package/src/js/bootstrap-italia.esm.js +9 -1
- package/src/js/icons.js +8 -0
- package/src/js/load-plugin.js +8 -0
- package/src/js/plugins/accept-overlay.js +18 -10
- package/src/js/plugins/accordion.js +16 -22
- package/src/js/plugins/alert.js +66 -2
- package/src/js/plugins/{backToTop.js → back-to-top.js} +12 -4
- package/src/js/plugins/base-component.js +89 -0
- package/src/js/plugins/button.js +57 -2
- package/src/js/plugins/carousel-bi.js +18 -9
- package/src/js/plugins/carousel.js +444 -2
- package/src/js/plugins/collapse.js +272 -2
- package/src/js/plugins/cookiebar.js +37 -60
- package/src/js/plugins/dimmer.js +18 -8
- package/src/js/plugins/dom/data.js +58 -0
- package/src/js/plugins/dom/event-handler.js +301 -0
- package/src/js/plugins/dom/manipulator.js +75 -0
- package/src/js/plugins/dom/selector-engine.js +80 -0
- package/src/js/plugins/dropdown.js +432 -2
- package/src/js/plugins/fonts-loader.js +9 -1
- package/src/js/plugins/form-validate.js +21 -8
- package/src/js/plugins/form.js +11 -3
- package/src/js/plugins/forward.js +18 -16
- package/src/js/plugins/header-sticky.js +10 -2
- package/src/js/plugins/history-back.js +14 -14
- package/src/js/plugins/init.js +8 -0
- package/src/js/plugins/input-label.js +13 -3
- package/src/js/plugins/input-number.js +12 -4
- package/src/js/plugins/input-password.js +46 -36
- package/src/js/plugins/input-search-autocomplete.js +9 -13
- package/src/js/plugins/input.js +11 -3
- package/src/js/plugins/list.js +22 -12
- package/src/js/plugins/masonry.js +26 -27
- package/src/js/plugins/modal.js +357 -2
- package/src/js/plugins/navbar-collapsible.js +55 -53
- package/src/js/plugins/navscroll.js +16 -23
- package/src/js/plugins/notification.js +33 -23
- package/src/js/plugins/offcanvas.js +258 -2
- package/src/js/plugins/popover.js +75 -2
- package/src/js/plugins/progress-donut.js +17 -13
- package/src/js/plugins/scrollspy.js +272 -2
- package/src/js/plugins/select-autocomplete.js +9 -1
- package/src/js/plugins/sticky.js +21 -23
- package/src/js/plugins/tab.js +243 -27
- package/src/js/plugins/toast.js +206 -2
- package/src/js/plugins/tooltip.js +601 -2
- package/src/js/plugins/track-focus.js +8 -0
- package/src/js/plugins/transfer.js +12 -24
- package/src/js/plugins/upload-dragdrop.js +12 -4
- package/src/js/plugins/util/backdrop.js +153 -0
- package/src/js/plugins/util/component-functions.js +36 -0
- package/src/js/plugins/util/config.js +68 -0
- package/src/js/plugins/util/cookies.js +8 -0
- package/src/js/plugins/util/device.js +0 -3
- package/src/js/plugins/util/dom.js +8 -0
- package/src/js/plugins/util/focustrap.js +119 -0
- package/src/js/plugins/util/index.js +317 -0
- package/src/js/plugins/util/observer.js +8 -0
- package/src/js/plugins/util/on-document-scroll.js +19 -9
- package/src/js/plugins/util/pageScroll.js +8 -0
- package/src/js/plugins/util/sanitizer.js +112 -0
- package/src/js/plugins/util/scrollbar.js +118 -0
- package/src/js/plugins/util/swipe.js +148 -0
- package/src/js/plugins/util/template-factory.js +164 -0
- package/src/js/plugins/util/tween.js +9 -1
- package/src/js/plugins/util/youtube-video.js +12 -21
- package/src/js/plugins/videoplayer.js +18 -8
- package/src/js/version.js +10 -3
- package/src/scss/base/_containers.scss +41 -0
- package/src/scss/base/_functions.scss +373 -0
- package/src/scss/base/_helpers.scss +10 -0
- package/src/scss/base/_maps.scss +54 -0
- package/src/scss/base/_mixins.scss +44 -0
- package/src/scss/base/_reboot.scss +590 -0
- package/src/scss/base/_root.scss +73 -0
- package/src/scss/base/_transitions.scss +27 -0
- package/src/scss/base/_utilities.scss +742 -0
- package/src/scss/base/_variables.scss +2123 -0
- package/src/scss/base/_version.scss +3 -0
- package/src/scss/base/helpers/_clearfix.scss +3 -0
- package/src/scss/base/helpers/_color-bg.scss +10 -0
- package/src/scss/base/helpers/_colored-links.scss +16 -0
- package/src/scss/base/helpers/_position.scss +36 -0
- package/src/scss/base/helpers/_ratio.scss +26 -0
- package/src/scss/base/helpers/_stacks.scss +15 -0
- package/src/scss/base/helpers/_stretched-link.scss +15 -0
- package/src/scss/base/helpers/_text-truncation.scss +7 -0
- package/src/scss/base/helpers/_visually-hidden.scss +8 -0
- package/src/scss/base/helpers/_vr.scss +8 -0
- package/src/scss/base/mixins/_alert.scss +15 -0
- package/src/scss/base/mixins/_backdrop.scss +18 -0
- package/src/scss/base/mixins/_banner.scss +11 -0
- package/src/scss/base/mixins/_border-radius.scss +77 -0
- package/src/scss/base/mixins/_box-shadow.scss +18 -0
- package/src/scss/base/mixins/_breakpoints.scss +127 -0
- package/src/scss/base/mixins/_buttons.scss +141 -0
- package/src/scss/base/mixins/_caret.scss +64 -0
- package/src/scss/base/mixins/_clearfix.scss +9 -0
- package/src/scss/base/mixins/_color-scheme.scss +7 -0
- package/src/scss/base/mixins/_container.scss +11 -0
- package/src/scss/base/mixins/_deprecate.scss +10 -0
- package/src/scss/base/mixins/_forms.scss +152 -0
- package/src/scss/base/mixins/_gradients.scss +47 -0
- package/src/scss/base/mixins/_grid.scss +151 -0
- package/src/scss/base/mixins/_image.scss +15 -0
- package/src/scss/base/mixins/_list-group.scss +24 -0
- package/src/scss/base/mixins/_lists.scss +7 -0
- package/src/scss/base/mixins/_pagination.scss +10 -0
- package/src/scss/base/mixins/_reset-text.scss +17 -0
- package/src/scss/base/mixins/_resize.scss +6 -0
- package/src/scss/base/mixins/_table-variants.scss +24 -0
- package/src/scss/base/mixins/_text-truncate.scss +8 -0
- package/src/scss/base/mixins/_transition.scss +26 -0
- package/src/scss/base/mixins/_utilities.scss +96 -0
- package/src/scss/base/mixins/_visually-hidden.scss +29 -0
- package/src/scss/base/utilities/_api.scss +45 -0
- package/src/scss/base/vendor/_rfs.scss +337 -0
- package/src/scss/bootstrap-italia.scss +137 -156
- package/src/scss/{custom → components}/_accept-overlay.scss +2 -1
- package/src/scss/components/_accordion.scss +297 -0
- package/src/scss/components/_badge.scss +60 -0
- package/src/scss/components/_breadcrumb.scss +95 -0
- package/src/scss/components/_button-group.scss +143 -0
- package/src/scss/components/_buttons.scss +467 -0
- package/src/scss/{custom → components}/_card.scss +228 -0
- package/src/scss/{custom → components}/_carousel.scss +225 -3
- package/src/scss/components/_dropdown.scss +480 -0
- package/src/scss/{custom → components}/_grid.scss +33 -0
- package/src/scss/{custom → components}/_gridlist.scss +7 -0
- package/src/scss/{custom → components}/_hero.scss +23 -57
- package/src/scss/components/_images.scss +48 -0
- package/src/scss/{custom → components}/_linklist.scss +0 -1
- package/src/scss/components/_list-group.scss +190 -0
- package/src/scss/components/_modal.scss +475 -0
- package/src/scss/components/_nav.scss +169 -0
- package/src/scss/components/_navbar.scss +274 -0
- package/src/scss/components/_offcanvas.scss +144 -0
- package/src/scss/components/_pagination.scss +108 -0
- package/src/scss/components/_placeholders.scss +51 -0
- package/src/scss/components/_popover.scss +298 -0
- package/src/scss/components/_progress-bars.scss +126 -0
- package/src/scss/{custom → components}/_steppers.scss +2 -2
- package/src/scss/{custom → components}/_tab.scss +3 -7
- package/src/scss/components/_tables.scss +171 -0
- package/src/scss/components/_toasts.scss +73 -0
- package/src/scss/{custom → components}/_toolbar.scss +19 -12
- package/src/scss/components/_tooltip.scss +139 -0
- package/src/scss/{custom → components}/_type.scss +92 -0
- package/src/scss/forms/_accessible-autocomplete.scss +188 -0
- package/src/scss/forms/_floating-labels.scss +75 -0
- package/src/scss/forms/_form-check.scss +163 -0
- package/src/scss/forms/_form-control.scss +201 -0
- package/src/scss/forms/_form-range.scss +95 -0
- package/src/scss/{custom → forms}/_form-select.scss +72 -0
- package/src/scss/forms/_form-text.scss +11 -0
- package/src/scss/{custom → forms}/_forms.scss +8 -12
- package/src/scss/forms/_input-group.scss +129 -0
- package/src/scss/forms/_labels.scss +36 -0
- package/src/scss/forms/_validation.scss +12 -0
- package/src/scss/utilities/icons.scss +5 -5
- package/types/index.d.ts +4 -1
- package/types/plugins/video.ts +33 -0
- package/dist/plugins/backToTop.js.map +0 -1
- package/src/scss/_functions.scss +0 -38
- package/src/scss/_variables.scss +0 -639
- package/src/scss/custom/_accessible-autocomplete.scss +0 -30
- package/src/scss/custom/_accordion.scss +0 -176
- package/src/scss/custom/_badge.scss +0 -29
- package/src/scss/custom/_breadcrumb.scss +0 -51
- package/src/scss/custom/_buttons.scss +0 -235
- package/src/scss/custom/_componente-base.scss +0 -6
- package/src/scss/custom/_dropdown.scss +0 -248
- package/src/scss/custom/_form-datepicker.scss +0 -604
- package/src/scss/custom/_images.scss +0 -10
- package/src/scss/custom/_modal.scss +0 -248
- package/src/scss/custom/_popover.scss +0 -106
- package/src/scss/custom/_progress-bars.scss +0 -70
- package/src/scss/custom/_tables.scss +0 -11
- package/src/scss/custom/_timepicker.scss +0 -252
- package/src/scss/custom/_tooltip.scss +0 -33
- package/src/scss/custom/_version.scss +0 -3
- package/src/scss/custom/mixins/_buttons.scss +0 -67
- package/src/scss/utilities/colors_vars.scss +0 -426
- /package/src/scss/{custom → base}/mixins/_text-emphasis.scss +0 -0
- /package/src/scss/{custom → components}/_affix.scss +0 -0
- /package/src/scss/{custom → components}/_alert.scss +0 -0
- /package/src/scss/{custom → components}/_anchor.scss +0 -0
- /package/src/scss/{custom → components}/_avatar.scss +0 -0
- /package/src/scss/{custom → components}/_back-to-top.scss +0 -0
- /package/src/scss/{custom → components}/_bottomnav.scss +0 -0
- /package/src/scss/{custom → components}/_calendar.scss +0 -0
- /package/src/scss/{custom → components}/_callout.scss +0 -0
- /package/src/scss/{custom → components}/_chips.scss +0 -0
- /package/src/scss/{custom → components}/_code.scss +0 -0
- /package/src/scss/{custom → components}/_cookiebar.scss +0 -0
- /package/src/scss/{custom → components}/_dimmer.scss +0 -0
- /package/src/scss/{custom → components}/_figcaption.scss +0 -0
- /package/src/scss/{custom → components}/_font.scss +0 -0
- /package/src/scss/{custom → components}/_footer.scss +0 -0
- /package/src/scss/{custom → components}/_forward.scss +0 -0
- /package/src/scss/{custom → components}/_header.scss +0 -0
- /package/src/scss/{custom → components}/_headercenter.scss +0 -0
- /package/src/scss/{custom → components}/_headercentertheme.scss +0 -0
- /package/src/scss/{custom → components}/_headernavbar.scss +0 -0
- /package/src/scss/{custom → components}/_headernavbartheme.scss +0 -0
- /package/src/scss/{custom → components}/_headerslim.scss +0 -0
- /package/src/scss/{custom → components}/_headerslimtheme.scss +0 -0
- /package/src/scss/{custom → components}/_imgresponsive.scss +0 -0
- /package/src/scss/{custom → components}/_list.scss +0 -0
- /package/src/scss/{custom → components}/_map.scss +0 -0
- /package/src/scss/{custom → components}/_masonry-loader.scss +0 -0
- /package/src/scss/{custom → components}/_megamenu.scss +0 -0
- /package/src/scss/{custom → components}/_navigation.scss +0 -0
- /package/src/scss/{custom → components}/_navigationtheme.scss +0 -0
- /package/src/scss/{custom → components}/_navscroll.scss +0 -0
- /package/src/scss/{custom → components}/_navscrolltheme.scss +0 -0
- /package/src/scss/{custom → components}/_notifications.scss +0 -0
- /package/src/scss/{custom → components}/_overlay-panel.scss +0 -0
- /package/src/scss/{custom → components}/_page-scroll.scss +0 -0
- /package/src/scss/{custom → components}/_pager.scss +0 -0
- /package/src/scss/{custom → components}/_point-list.scss +0 -0
- /package/src/scss/{custom → components}/_print.scss +0 -0
- /package/src/scss/{custom → components}/_progress-donuts.scss +0 -0
- /package/src/scss/{custom → components}/_progress-spinners.scss +0 -0
- /package/src/scss/{custom → components}/_rating-list.scss +0 -0
- /package/src/scss/{custom → components}/_rating.scss +0 -0
- /package/src/scss/{custom → components}/_sections.scss +0 -0
- /package/src/scss/{custom → components}/_sidebar.scss +0 -0
- /package/src/scss/{custom → components}/_sidebarthemes.scss +0 -0
- /package/src/scss/{custom → components}/_skiplinks.scss +0 -0
- /package/src/scss/{custom → components}/_sticky.scss +0 -0
- /package/src/scss/{custom → components}/_thumbnav.scss +0 -0
- /package/src/scss/{custom → components}/_timeline.scss +0 -0
- /package/src/scss/{custom → components}/_videoplayer.scss +0 -0
- /package/src/scss/{custom → forms}/_autocomplete.scss +0 -0
- /package/src/scss/{custom → forms}/_form-input-file.scss +0 -0
- /package/src/scss/{custom → forms}/_form-input-number.scss +0 -0
- /package/src/scss/{custom → forms}/_form-input-upload.scss +0 -0
- /package/src/scss/{custom → forms}/_form-password.scss +0 -0
- /package/src/scss/{custom → forms}/_form-toggles.scss +0 -0
- /package/src/scss/{custom → forms}/_form-transfer.scss +0 -0
- /package/src/scss/{custom → forms}/_just-validate.scss +0 -0
- /package/types/plugins/{backToTop.d.ts → back-to-top.d.ts} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
|
|
4
|
+
* Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
|
|
5
|
+
* Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
|
|
6
|
+
* --------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import BaseComponent from './base-component.js'
|
|
10
|
+
|
|
11
|
+
import { getElementFromSelector, isVisible, reflow } from './util/index'
|
|
12
|
+
import EventHandler from './dom/event-handler'
|
|
13
|
+
import SelectorEngine from './dom/selector-engine'
|
|
13
14
|
|
|
14
15
|
import { isScreenMobile } from './util/device'
|
|
15
16
|
import { getElementIndex } from './util/dom'
|
|
@@ -139,33 +140,36 @@ class NavBarCollapsible extends BaseComponent {
|
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
dispose() {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
144
|
+
EventHandler.off(window, EVENT_RESIZE)
|
|
145
|
+
super.dispose()
|
|
146
|
+
}
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
// Private
|
|
148
150
|
|
|
149
151
|
_bindEvents() {
|
|
150
|
-
|
|
152
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
153
|
+
EventHandler.on(window, EVENT_RESIZE, () => this._onResize())
|
|
151
154
|
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
if (this._overlay) {
|
|
156
|
+
EventHandler.on(this._overlay, EVENT_CLICK, () => this.hide())
|
|
157
|
+
}
|
|
158
|
+
EventHandler.on(this._btnClose, EVENT_CLICK, (evt) => {
|
|
159
|
+
evt.preventDefault()
|
|
160
|
+
this.hide()
|
|
161
|
+
})
|
|
162
|
+
EventHandler.on(this._btnBack, EVENT_CLICK, (evt) => {
|
|
163
|
+
evt.preventDefault()
|
|
164
|
+
this.hide()
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
this._menuItems.forEach((item) => {
|
|
168
|
+
EventHandler.on(item, EVENT_KEYDOWN, (evt) => this._isMobile && this._onMenuItemKeyDown(evt))
|
|
169
|
+
EventHandler.on(item, EVENT_KEYUP, (evt) => this._isMobile && this._onMenuItemKeyUp(evt))
|
|
170
|
+
EventHandler.on(item, EVENT_CLICK, (evt) => this._isMobile && this._onMenuItemClick(evt))
|
|
171
|
+
})
|
|
154
172
|
}
|
|
155
|
-
EventHandler.on(this._btnClose, EVENT_CLICK, (evt) => {
|
|
156
|
-
evt.preventDefault()
|
|
157
|
-
this.hide()
|
|
158
|
-
})
|
|
159
|
-
EventHandler.on(this._btnBack, EVENT_CLICK, (evt) => {
|
|
160
|
-
evt.preventDefault()
|
|
161
|
-
this.hide()
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
this._menuItems.forEach((item) => {
|
|
165
|
-
EventHandler.on(item, EVENT_KEYDOWN, (evt) => this._isMobile && this._onMenuItemKeyDown(evt))
|
|
166
|
-
EventHandler.on(item, EVENT_KEYUP, (evt) => this._isMobile && this._onMenuItemKeyUp(evt))
|
|
167
|
-
EventHandler.on(item, EVENT_CLICK, (evt) => this._isMobile && this._onMenuItemClick(evt))
|
|
168
|
-
})
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
_onResize() {
|
|
@@ -313,34 +317,32 @@ class NavBarCollapsible extends BaseComponent {
|
|
|
313
317
|
* Data Api implementation
|
|
314
318
|
* ------------------------------------------------------------------------
|
|
315
319
|
*/
|
|
316
|
-
/*const navs = SelectorEngine.find(SELECTOR_NAVBAR)
|
|
317
|
-
navs.forEach((nav) => {
|
|
318
|
-
NavBarCollapsible.getOrCreateInstance(nav)
|
|
319
|
-
})*/
|
|
320
320
|
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
322
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
|
323
|
+
const target = getElementFromSelector(this)
|
|
323
324
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
EventHandler.one(target, EVENT_SHOW, (showEvent) => {
|
|
329
|
-
if (showEvent.defaultPrevented) {
|
|
330
|
-
// only register focus restorer if modal will actually get shown
|
|
331
|
-
return
|
|
325
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
326
|
+
event.preventDefault()
|
|
332
327
|
}
|
|
333
328
|
|
|
334
|
-
EventHandler.one(target,
|
|
335
|
-
if (
|
|
336
|
-
|
|
329
|
+
EventHandler.one(target, EVENT_SHOW, (showEvent) => {
|
|
330
|
+
if (showEvent.defaultPrevented) {
|
|
331
|
+
// only register focus restorer if modal will actually get shown
|
|
332
|
+
return
|
|
337
333
|
}
|
|
334
|
+
|
|
335
|
+
EventHandler.one(target, EVENT_HIDDEN, () => {
|
|
336
|
+
if (isVisible(this)) {
|
|
337
|
+
this.focus()
|
|
338
|
+
}
|
|
339
|
+
})
|
|
338
340
|
})
|
|
339
|
-
})
|
|
340
341
|
|
|
341
|
-
|
|
342
|
+
const data = NavBarCollapsible.getOrCreateInstance(target)
|
|
342
343
|
|
|
343
|
-
|
|
344
|
-
})
|
|
344
|
+
data.toggle(this)
|
|
345
|
+
})
|
|
346
|
+
}
|
|
345
347
|
|
|
346
348
|
export default NavBarCollapsible
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import BaseComponent from '
|
|
1
|
+
import BaseComponent from './base-component.js'
|
|
2
2
|
|
|
3
|
-
import EventHandler from '
|
|
4
|
-
import SelectorEngine from '
|
|
5
|
-
import Manipulator from '
|
|
3
|
+
import EventHandler from './dom/event-handler'
|
|
4
|
+
import SelectorEngine from './dom/selector-engine'
|
|
5
|
+
import Manipulator from './dom/manipulator'
|
|
6
6
|
|
|
7
7
|
import onDocumentScroll from './util/on-document-scroll'
|
|
8
8
|
import NavBarCollapsible from './navbar-collapsible'
|
|
@@ -10,17 +10,11 @@ import NavBarCollapsible from './navbar-collapsible'
|
|
|
10
10
|
import { documentScrollTo } from './util/tween'
|
|
11
11
|
|
|
12
12
|
const NAME = 'navscroll'
|
|
13
|
-
//const DATA_KEY = 'bs.navscroll'
|
|
14
|
-
//const EVENT_KEY = `.${DATA_KEY}`
|
|
15
|
-
//const DATA_API_KEY = '.data-api'
|
|
16
|
-
|
|
17
|
-
//const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
|
18
13
|
|
|
19
14
|
const CLASS_NAME_ACTIVE = 'active'
|
|
20
15
|
|
|
21
16
|
const SELECTOR_NAVSCROLL = '[data-bs-navscroll]' //'.it-navscroll-wrapper'
|
|
22
17
|
const SELECTOR_LIST = 'ul.link-list'
|
|
23
|
-
//const SELECTOR_ITEM = '.nav-item'
|
|
24
18
|
const SELECTOR_LINK_CONTAINER = 'li.nav-link, li.nav-item'
|
|
25
19
|
const SELECTOR_LINK = 'a.nav-link'
|
|
26
20
|
const SELECTOR_LINK_ACTIVE = `${SELECTOR_LINK}.${CLASS_NAME_ACTIVE}`
|
|
@@ -64,11 +58,9 @@ class NavScroll extends BaseComponent {
|
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
dispose() {
|
|
67
|
-
//EventHandler.off(window, EVENT_SCROLL, this._onScroll)
|
|
68
61
|
if (this._scrollCb) {
|
|
69
62
|
this._scrollCb.dispose()
|
|
70
63
|
}
|
|
71
|
-
|
|
72
64
|
super.dispose()
|
|
73
65
|
}
|
|
74
66
|
|
|
@@ -83,8 +75,6 @@ class NavScroll extends BaseComponent {
|
|
|
83
75
|
}
|
|
84
76
|
|
|
85
77
|
_bindEvents() {
|
|
86
|
-
//EventHandler.on(window, EVENT_SCROLL, this._onScroll)
|
|
87
|
-
|
|
88
78
|
this._scrollCb = onDocumentScroll(() => this._onScroll())
|
|
89
79
|
|
|
90
80
|
if (this._collapsible) {
|
|
@@ -103,11 +93,12 @@ class NavScroll extends BaseComponent {
|
|
|
103
93
|
}
|
|
104
94
|
})
|
|
105
95
|
})
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
97
|
+
EventHandler.on(window, 'load', () => {
|
|
98
|
+
//if page is already scrolled
|
|
99
|
+
setTimeout(() => this._onScroll(), 150)
|
|
100
|
+
})
|
|
101
|
+
}
|
|
111
102
|
}
|
|
112
103
|
|
|
113
104
|
_onCollapseOpened() {
|
|
@@ -247,9 +238,11 @@ class NavScroll extends BaseComponent {
|
|
|
247
238
|
* ------------------------------------------------------------------------
|
|
248
239
|
*/
|
|
249
240
|
|
|
250
|
-
|
|
251
|
-
navs.
|
|
252
|
-
|
|
253
|
-
|
|
241
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
242
|
+
const navs = SelectorEngine.find(SELECTOR_NAVSCROLL)
|
|
243
|
+
navs.map((nav) => {
|
|
244
|
+
NavScroll.getOrCreateInstance(nav)
|
|
245
|
+
})
|
|
246
|
+
}
|
|
254
247
|
|
|
255
248
|
export default NavScroll
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
|
|
4
|
+
* Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
|
|
5
|
+
* Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
|
|
6
|
+
* --------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import BaseComponent from './base-component.js'
|
|
10
|
+
import { getElementFromSelector, isVisible, reflow } from './util/index'
|
|
11
|
+
import Manipulator from './dom/manipulator'
|
|
12
|
+
import EventHandler from './dom/event-handler'
|
|
13
|
+
import { enableDismissTrigger } from './util/component-functions'
|
|
6
14
|
|
|
7
15
|
const NAME = 'notification'
|
|
8
16
|
const DATA_KEY = 'bs.notification'
|
|
@@ -155,31 +163,33 @@ class Notification extends BaseComponent {
|
|
|
155
163
|
* ------------------------------------------------------------------------
|
|
156
164
|
*/
|
|
157
165
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (['A', 'AREA'].includes(this.tagName)) {
|
|
162
|
-
event.preventDefault()
|
|
163
|
-
}
|
|
166
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
167
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
|
168
|
+
const target = getElementFromSelector(this)
|
|
164
169
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// only register focus restorer if modal will actually get shown
|
|
168
|
-
return
|
|
170
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
171
|
+
event.preventDefault()
|
|
169
172
|
}
|
|
170
173
|
|
|
171
|
-
EventHandler.one(target,
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
+
EventHandler.one(target, EVENT_SHOW, (showEvent) => {
|
|
175
|
+
if (showEvent.defaultPrevented) {
|
|
176
|
+
// only register focus restorer if modal will actually get shown
|
|
177
|
+
return
|
|
174
178
|
}
|
|
179
|
+
|
|
180
|
+
EventHandler.one(target, EVENT_HIDDEN, () => {
|
|
181
|
+
if (isVisible(this)) {
|
|
182
|
+
this.focus()
|
|
183
|
+
}
|
|
184
|
+
})
|
|
175
185
|
})
|
|
176
|
-
})
|
|
177
186
|
|
|
178
|
-
|
|
187
|
+
const data = Notification.getOrCreateInstance(target)
|
|
179
188
|
|
|
180
|
-
|
|
181
|
-
})
|
|
189
|
+
data.toggle(this)
|
|
190
|
+
})
|
|
182
191
|
|
|
183
|
-
enableDismissTrigger(Notification)
|
|
192
|
+
enableDismissTrigger(Notification)
|
|
193
|
+
}
|
|
184
194
|
|
|
185
195
|
export default Notification
|
|
@@ -1,5 +1,261 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
|
|
4
|
+
* Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
|
|
5
|
+
* Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
|
|
6
|
+
* This a fork of Bootstrap: Initial license and original file name below
|
|
7
|
+
* Bootstrap (v5.2.3): offcanvas.js
|
|
8
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
9
|
+
* --------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
import { getElementFromSelector, isDisabled, isVisible } from './util/index'
|
|
13
|
+
import ScrollBarHelper from './util/scrollbar'
|
|
14
|
+
import EventHandler from './dom/event-handler'
|
|
15
|
+
import BaseComponent from './base-component'
|
|
16
|
+
import SelectorEngine from './dom/selector-engine'
|
|
17
|
+
import Backdrop from './util/backdrop'
|
|
18
|
+
import FocusTrap from './util/focustrap'
|
|
19
|
+
import { enableDismissTrigger } from './util/component-functions'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Constants
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const NAME = 'offcanvas'
|
|
26
|
+
const DATA_KEY = 'bs.offcanvas'
|
|
27
|
+
const EVENT_KEY = `.${DATA_KEY}`
|
|
28
|
+
const DATA_API_KEY = '.data-api'
|
|
29
|
+
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
|
30
|
+
const ESCAPE_KEY = 'Escape'
|
|
31
|
+
|
|
32
|
+
const CLASS_NAME_SHOW = 'show'
|
|
33
|
+
const CLASS_NAME_SHOWING = 'showing'
|
|
34
|
+
const CLASS_NAME_HIDING = 'hiding'
|
|
35
|
+
const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'
|
|
36
|
+
const OPEN_SELECTOR = '.offcanvas.show'
|
|
37
|
+
|
|
38
|
+
const EVENT_SHOW = `show${EVENT_KEY}`
|
|
39
|
+
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
|
40
|
+
const EVENT_HIDE = `hide${EVENT_KEY}`
|
|
41
|
+
const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`
|
|
42
|
+
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
|
43
|
+
const EVENT_RESIZE = `resize${EVENT_KEY}`
|
|
44
|
+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
|
45
|
+
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
|
|
46
|
+
|
|
47
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]'
|
|
48
|
+
|
|
49
|
+
const Default = {
|
|
50
|
+
backdrop: true,
|
|
51
|
+
keyboard: true,
|
|
52
|
+
scroll: false,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const DefaultType = {
|
|
56
|
+
backdrop: '(boolean|string)',
|
|
57
|
+
keyboard: 'boolean',
|
|
58
|
+
scroll: 'boolean',
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Class definition
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
class Offcanvas extends BaseComponent {
|
|
66
|
+
constructor(element, config) {
|
|
67
|
+
super(element, config)
|
|
68
|
+
|
|
69
|
+
this._isShown = false
|
|
70
|
+
this._backdrop = this._initializeBackDrop()
|
|
71
|
+
this._focustrap = this._initializeFocusTrap()
|
|
72
|
+
this._addEventListeners()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Getters
|
|
76
|
+
static get Default() {
|
|
77
|
+
return Default
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static get DefaultType() {
|
|
81
|
+
return DefaultType
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static get NAME() {
|
|
85
|
+
return NAME
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Public
|
|
89
|
+
toggle(relatedTarget) {
|
|
90
|
+
return this._isShown ? this.hide() : this.show(relatedTarget)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
show(relatedTarget) {
|
|
94
|
+
if (this._isShown) {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })
|
|
99
|
+
|
|
100
|
+
if (showEvent.defaultPrevented) {
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
this._isShown = true
|
|
105
|
+
this._backdrop.show()
|
|
106
|
+
|
|
107
|
+
if (!this._config.scroll) {
|
|
108
|
+
new ScrollBarHelper().hide()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
this._element.setAttribute('aria-modal', true)
|
|
112
|
+
this._element.setAttribute('role', 'dialog')
|
|
113
|
+
this._element.classList.add(CLASS_NAME_SHOWING)
|
|
114
|
+
|
|
115
|
+
const completeCallBack = () => {
|
|
116
|
+
if (!this._config.scroll || this._config.backdrop) {
|
|
117
|
+
this._focustrap.activate()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
this._element.classList.add(CLASS_NAME_SHOW)
|
|
121
|
+
this._element.classList.remove(CLASS_NAME_SHOWING)
|
|
122
|
+
EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this._queueCallback(completeCallBack, this._element, true)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
hide() {
|
|
129
|
+
if (!this._isShown) {
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)
|
|
134
|
+
|
|
135
|
+
if (hideEvent.defaultPrevented) {
|
|
136
|
+
return
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
this._focustrap.deactivate()
|
|
140
|
+
this._element.blur()
|
|
141
|
+
this._isShown = false
|
|
142
|
+
this._element.classList.add(CLASS_NAME_HIDING)
|
|
143
|
+
this._backdrop.hide()
|
|
144
|
+
|
|
145
|
+
const completeCallback = () => {
|
|
146
|
+
this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)
|
|
147
|
+
this._element.removeAttribute('aria-modal')
|
|
148
|
+
this._element.removeAttribute('role')
|
|
149
|
+
|
|
150
|
+
if (!this._config.scroll) {
|
|
151
|
+
new ScrollBarHelper().reset()
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
EventHandler.trigger(this._element, EVENT_HIDDEN)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
this._queueCallback(completeCallback, this._element, true)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
dispose() {
|
|
161
|
+
this._backdrop.dispose()
|
|
162
|
+
this._focustrap.deactivate()
|
|
163
|
+
super.dispose()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Private
|
|
167
|
+
_initializeBackDrop() {
|
|
168
|
+
const clickCallback = () => {
|
|
169
|
+
if (this._config.backdrop === 'static') {
|
|
170
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
this.hide()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 'static' option will be translated to true, and booleans will keep their value
|
|
178
|
+
const isVisible = Boolean(this._config.backdrop)
|
|
179
|
+
|
|
180
|
+
return new Backdrop({
|
|
181
|
+
className: CLASS_NAME_BACKDROP,
|
|
182
|
+
isVisible,
|
|
183
|
+
isAnimated: true,
|
|
184
|
+
rootElement: this._element.parentNode,
|
|
185
|
+
clickCallback: isVisible ? clickCallback : null,
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
_initializeFocusTrap() {
|
|
190
|
+
return new FocusTrap({
|
|
191
|
+
trapElement: this._element,
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
_addEventListeners() {
|
|
196
|
+
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, (event) => {
|
|
197
|
+
if (event.key !== ESCAPE_KEY) {
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (!this._config.keyboard) {
|
|
202
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
this.hide()
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Data API implementation
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
216
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
|
217
|
+
const target = getElementFromSelector(this)
|
|
218
|
+
|
|
219
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
220
|
+
event.preventDefault()
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (isDisabled(this)) {
|
|
224
|
+
return
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
EventHandler.one(target, EVENT_HIDDEN, () => {
|
|
228
|
+
// focus on trigger when it is closed
|
|
229
|
+
if (isVisible(this)) {
|
|
230
|
+
this.focus()
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
// avoid conflict when clicking a toggler of an offcanvas, while another is open
|
|
235
|
+
const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)
|
|
236
|
+
if (alreadyOpen && alreadyOpen !== target) {
|
|
237
|
+
Offcanvas.getInstance(alreadyOpen).hide()
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const data = Offcanvas.getOrCreateInstance(target)
|
|
241
|
+
data.toggle(this)
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
|
245
|
+
for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {
|
|
246
|
+
Offcanvas.getOrCreateInstance(selector).show()
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
EventHandler.on(window, EVENT_RESIZE, () => {
|
|
251
|
+
for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {
|
|
252
|
+
if (getComputedStyle(element).position !== 'fixed') {
|
|
253
|
+
Offcanvas.getOrCreateInstance(element).hide()
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
enableDismissTrigger(Offcanvas)
|
|
259
|
+
}
|
|
4
260
|
|
|
5
261
|
export default Offcanvas
|
|
@@ -1,5 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
|
|
4
|
+
* Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
|
|
5
|
+
* Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
|
|
6
|
+
* This a fork of Bootstrap: Initial license and original file name below
|
|
7
|
+
* Bootstrap (v5.2.3): popover.js
|
|
8
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
9
|
+
* --------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
import Tooltip from './tooltip'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Constants
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const NAME = 'popover'
|
|
19
|
+
|
|
20
|
+
const SELECTOR_TITLE = '.popover-header'
|
|
21
|
+
const SELECTOR_CONTENT = '.popover-body'
|
|
22
|
+
|
|
23
|
+
const Default = {
|
|
24
|
+
...Tooltip.Default,
|
|
25
|
+
content: '',
|
|
26
|
+
offset: [0, 8],
|
|
27
|
+
placement: 'right',
|
|
28
|
+
template:
|
|
29
|
+
'<div class="popover" role="tooltip">' +
|
|
30
|
+
'<div class="popover-arrow"></div>' +
|
|
31
|
+
'<h3 class="popover-header"></h3>' +
|
|
32
|
+
'<div class="popover-body"></div>' +
|
|
33
|
+
'</div>',
|
|
34
|
+
trigger: 'click',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DefaultType = {
|
|
38
|
+
...Tooltip.DefaultType,
|
|
39
|
+
content: '(null|string|element|function)',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Class definition
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
class Popover extends Tooltip {
|
|
47
|
+
// Getters
|
|
48
|
+
static get Default() {
|
|
49
|
+
return Default
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static get DefaultType() {
|
|
53
|
+
return DefaultType
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static get NAME() {
|
|
57
|
+
return NAME
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Overrides
|
|
61
|
+
_isWithContent() {
|
|
62
|
+
return this._getTitle() || this._getContent()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Private
|
|
66
|
+
_getContentForTemplate() {
|
|
67
|
+
return {
|
|
68
|
+
[SELECTOR_TITLE]: this._getTitle(),
|
|
69
|
+
[SELECTOR_CONTENT]: this._getContent(),
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
_getContent() {
|
|
74
|
+
return this._resolvePossibleFunction(this._config.content)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
4
77
|
|
|
5
78
|
export default Popover
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
|
|
4
|
+
* Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
|
|
5
|
+
* Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
|
|
6
|
+
* --------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
3
8
|
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
9
|
+
import Circle from 'progressbar.js/src/circle.js'
|
|
10
|
+
import BaseComponent from './base-component.js'
|
|
11
|
+
import SelectorEngine from './dom/selector-engine'
|
|
12
|
+
import Manipulator from './dom/manipulator'
|
|
7
13
|
|
|
8
14
|
const NAME = 'progressdonut'
|
|
9
|
-
//const DATA_KEY = 'bs.progressdonut'
|
|
10
|
-
//const EVENT_KEY = `.${DATA_KEY}`
|
|
11
|
-
//const DATA_API_KEY = '.data-api'
|
|
12
|
-
|
|
13
15
|
const SELECTOR_DONUT = '[data-bs-progress-donut]'
|
|
14
16
|
|
|
15
17
|
const Default = {
|
|
@@ -89,7 +91,7 @@ class ProgressDonut extends BaseComponent {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
_init() {
|
|
92
|
-
this._bar = new
|
|
94
|
+
this._bar = new Circle(this._element, this._config)
|
|
93
95
|
|
|
94
96
|
if (this._config.value > 0) {
|
|
95
97
|
this.set(this._config.value)
|
|
@@ -103,8 +105,10 @@ class ProgressDonut extends BaseComponent {
|
|
|
103
105
|
* ------------------------------------------------------------------------
|
|
104
106
|
*/
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
109
|
+
SelectorEngine.find(SELECTOR_DONUT).forEach((donut) => {
|
|
110
|
+
ProgressDonut.getOrCreateInstance(donut)
|
|
111
|
+
})
|
|
112
|
+
}
|
|
109
113
|
|
|
110
114
|
export default ProgressDonut
|