@ilo-org/twig 1.1.6 → 1.2.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/LICENSE +183 -183
- package/dist/components/accordion/accordion.behavior.js +10 -1
- package/dist/components/breadcrumb/breadcrumb.behavior.js +10 -1
- package/dist/components/breadcrumb/breadcrumb.twig +2 -3
- package/dist/components/button/button.behavior.js +6 -0
- package/dist/components/button/button.twig +11 -6
- package/dist/components/callout/callout.behavior.js +10 -1
- package/{src/patterns/components/callout/callout.wingsuit.yml → dist/components/callout/callout.component.yml} +6 -7
- package/dist/components/callout/callout.wingsuit.yml +6 -7
- package/{src/patterns/components/checkbox/checkbox.wingsuit.yml → dist/components/checkbox/checkbox.component.yml} +6 -6
- package/dist/components/checkbox/checkbox.wingsuit.yml +6 -6
- package/{src/patterns/components/datepicker/datepicker.wingsuit.yml → dist/components/datepicker/datepicker.component.yml} +5 -5
- package/dist/components/datepicker/datepicker.wingsuit.yml +5 -5
- package/{src/patterns/components/dropdown/dropdown.wingsuit.yml → dist/components/dropdown/dropdown.component.yml} +7 -7
- package/dist/components/dropdown/dropdown.wingsuit.yml +7 -7
- package/dist/components/fileupload/fileupload.behavior.js +10 -1
- package/{src/patterns/components/fileupload/fileupload.wingsuit.yml → dist/components/fileupload/fileupload.component.yml} +7 -7
- package/dist/components/fileupload/fileupload.wingsuit.yml +7 -7
- package/{src/patterns/components/footer/footer.wingsuit.yml → dist/components/footer/footer.component.yml} +1 -1
- package/dist/components/footer/footer.wingsuit.yml +1 -1
- package/dist/components/icon/icon.behavior.js +687 -1
- package/dist/components/icon/icon.twig +1 -4
- package/dist/components/linklist/linklist.behavior.js +8 -1
- package/{src/patterns/components/list/list-item.wingsuit.yml → dist/components/list/list-item.component.yml} +2 -4
- package/dist/components/{list-item → list}/list-item.wingsuit.yml +2 -4
- package/{src/patterns/components/list/list.wingsuit.yml → dist/components/list/list.component.yml} +1 -1
- package/dist/components/list/list.wingsuit.yml +1 -1
- package/dist/components/loading/loading.behavior.js +10 -1
- package/{src/patterns/components/loading/loading.wingsuit.yml → dist/components/loading/loading.component.yml} +1 -1
- package/dist/components/loading/loading.wingsuit.yml +1 -1
- package/{src/patterns/components/localnav/localnav.wingsuit.yml → dist/components/localnav/localnav.component.yml} +1 -1
- package/dist/components/localnav/localnav.wingsuit.yml +1 -1
- package/dist/components/modal/modal.behavior.js +10 -1
- package/{src/patterns/components/modal/modal.wingsuit.yml → dist/components/modal/modal.component.yml} +1 -1
- package/dist/components/modal/modal.wingsuit.yml +1 -1
- package/dist/components/navigation/navigation.behavior.js +10 -1
- package/{src/patterns/components/navigation/navigation.wingsuit.yml → dist/components/navigation/navigation.component.yml} +2 -2
- package/dist/components/navigation/navigation.wingsuit.yml +2 -2
- package/dist/components/notification/notification.behavior.js +10 -1
- package/{src/patterns/components/numberpicker/numberpicker.wingsuit.yml → dist/components/numberpicker/numberpicker.component.yml} +6 -6
- package/dist/components/numberpicker/numberpicker.wingsuit.yml +6 -6
- package/{src/patterns/components/pagination/pagination.wingsuit.yml → dist/components/pagination/pagination.component.yml} +6 -6
- package/dist/components/pagination/pagination.wingsuit.yml +6 -6
- package/{src/patterns/components/radio/radio.wingsuit.yml → dist/components/radio/radio.component.yml} +6 -6
- package/dist/components/radio/radio.wingsuit.yml +6 -6
- package/dist/components/readmore/readmore.behavior.js +10 -1
- package/{src/patterns/components/readmore/readmore.wingsuit.yml → dist/components/readmore/readmore.component.yml} +1 -1
- package/dist/components/readmore/readmore.wingsuit.yml +1 -1
- package/dist/components/search/search.behavior.js +10 -1
- package/{src/patterns/components/search/search.wingsuit.yml → dist/components/search/search.component.yml} +8 -8
- package/dist/components/search/search.wingsuit.yml +8 -8
- package/dist/components/table/table.behavior.js +10 -1
- package/dist/components/tableofcontents/tableofcontents.behavior.js +10 -1
- package/dist/components/tabs/tabs.behavior.js +120 -1
- package/dist/components/tags/tag.behavior.js +10 -0
- package/{src/patterns/components/tags/tag.wingsuit.yml → dist/components/tags/tag.component.yml} +3 -6
- package/dist/components/{tag → tags}/tag.wingsuit.yml +3 -6
- package/{src/patterns/components/textarea/textarea.wingsuit.yml → dist/components/textarea/textarea.component.yml} +9 -9
- package/dist/components/textarea/textarea.wingsuit.yml +9 -9
- package/{src/patterns/components/textinput/textinput.wingsuit.yml → dist/components/textinput/textinput.component.yml} +7 -7
- package/dist/components/textinput/textinput.wingsuit.yml +7 -7
- package/{src/patterns/components/toggle/toggle.wingsuit.yml → dist/components/toggle/toggle.component.yml} +5 -5
- package/dist/components/toggle/toggle.wingsuit.yml +5 -5
- package/dist/components/tooltip/tooltip.behavior.js +116 -1
- package/dist/components/video/video.behavior.js +192 -16
- package/dist/styles/global.css +2 -0
- package/dist/styles/global.css.map +1 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/monorepo.css +9 -0
- package/dist/styles/monorepo.css.map +1 -0
- package/package.json +46 -78
- package/README.md +0 -218
- package/dist/components/polyfill/polyfill.twig +0 -10
- package/dist/components/tag/tag.behavior.js +0 -1
- package/src/namespaces.js +0 -14
- package/src/patterns/components/accordion/accordion-item.twig +0 -22
- package/src/patterns/components/accordion/accordion.behavior.js +0 -16
- package/src/patterns/components/accordion/accordion.js +0 -200
- package/src/patterns/components/accordion/accordion.stories.jsx +0 -9
- package/src/patterns/components/accordion/accordion.twig +0 -16
- package/src/patterns/components/accordion/index.js +0 -7
- package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +0 -16
- package/src/patterns/components/breadcrumb/breadcrumb.js +0 -280
- package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +0 -9
- package/src/patterns/components/breadcrumb/breadcrumb.twig +0 -55
- package/src/patterns/components/breadcrumb/index.js +0 -7
- package/src/patterns/components/button/button.stories.jsx +0 -9
- package/src/patterns/components/button/button.twig +0 -23
- package/src/patterns/components/button/index.js +0 -6
- package/src/patterns/components/callout/callout.behavior.js +0 -16
- package/src/patterns/components/callout/callout.js +0 -149
- package/src/patterns/components/callout/callout.stories.jsx +0 -9
- package/src/patterns/components/callout/callout.twig +0 -41
- package/src/patterns/components/callout/index.js +0 -7
- package/src/patterns/components/card/card.stories.jsx +0 -9
- package/src/patterns/components/card/card.twig +0 -24
- package/src/patterns/components/card/index.js +0 -6
- package/src/patterns/components/card_data/card_data.stories.jsx +0 -9
- package/src/patterns/components/card_data/card_data.twig +0 -101
- package/src/patterns/components/card_data/index.js +0 -9
- package/src/patterns/components/card_detail/card_detail.stories.jsx +0 -9
- package/src/patterns/components/card_detail/card_detail.twig +0 -37
- package/src/patterns/components/card_detail/index.js +0 -9
- package/src/patterns/components/card_factlist/card_factlist.stories.jsx +0 -9
- package/src/patterns/components/card_factlist/card_factlist.twig +0 -21
- package/src/patterns/components/card_factlist/index.js +0 -9
- package/src/patterns/components/card_feature/card_feature.stories.jsx +0 -9
- package/src/patterns/components/card_feature/card_feature.twig +0 -39
- package/src/patterns/components/card_feature/index.js +0 -9
- package/src/patterns/components/card_multilink/card_multilink.stories.jsx +0 -9
- package/src/patterns/components/card_multilink/card_multilink.twig +0 -45
- package/src/patterns/components/card_multilink/index.js +0 -9
- package/src/patterns/components/card_promo/card_promo.stories.jsx +0 -9
- package/src/patterns/components/card_promo/card_promo.twig +0 -35
- package/src/patterns/components/card_promo/index.js +0 -9
- package/src/patterns/components/card_stat/card_stat.stories.jsx +0 -9
- package/src/patterns/components/card_stat/card_stat.twig +0 -24
- package/src/patterns/components/card_stat/index.js +0 -9
- package/src/patterns/components/card_text/card_text.stories.jsx +0 -9
- package/src/patterns/components/card_text/card_text.twig +0 -35
- package/src/patterns/components/card_text/index.js +0 -9
- package/src/patterns/components/cardgroup/cardgroup.stories.jsx +0 -9
- package/src/patterns/components/cardgroup/cardgroup.twig +0 -44
- package/src/patterns/components/cardgroup/index.js +0 -6
- package/src/patterns/components/checkbox/checkbox.stories.jsx +0 -10
- package/src/patterns/components/checkbox/checkbox.twig +0 -17
- package/src/patterns/components/checkbox/index.js +0 -7
- package/src/patterns/components/contextmenu/contextmenu.stories.jsx +0 -9
- package/src/patterns/components/contextmenu/contextmenu.twig +0 -12
- package/src/patterns/components/contextmenu/index.js +0 -6
- package/src/patterns/components/datepicker/datepicker.stories.jsx +0 -9
- package/src/patterns/components/datepicker/datepicker.twig +0 -20
- package/src/patterns/components/datepicker/index.js +0 -7
- package/src/patterns/components/dropdown/dropdown.stories.jsx +0 -9
- package/src/patterns/components/dropdown/dropdown.twig +0 -22
- package/src/patterns/components/dropdown/index.js +0 -6
- package/src/patterns/components/fileupload/fileupload.behavior.js +0 -12
- package/src/patterns/components/fileupload/fileupload.js +0 -147
- package/src/patterns/components/fileupload/fileupload.stories.jsx +0 -9
- package/src/patterns/components/fileupload/fileupload.twig +0 -20
- package/src/patterns/components/fileupload/index.js +0 -8
- package/src/patterns/components/footer/footer.stories.jsx +0 -9
- package/src/patterns/components/footer/footer.twig +0 -63
- package/src/patterns/components/footer/index.js +0 -6
- package/src/patterns/components/form/fieldset.twig +0 -70
- package/src/patterns/components/form/form.stories.jsx +0 -9
- package/src/patterns/components/form/form.twig +0 -19
- package/src/patterns/components/form/formcontrol.twig +0 -89
- package/src/patterns/components/form/index.js +0 -6
- package/src/patterns/components/form/input.twig +0 -10
- package/src/patterns/components/hero/hero.stories.jsx +0 -9
- package/src/patterns/components/hero/hero.twig +0 -65
- package/src/patterns/components/hero/index.js +0 -7
- package/src/patterns/components/herocard/herocard.stories.jsx +0 -9
- package/src/patterns/components/herocard/herocard.twig +0 -30
- package/src/patterns/components/herocard/index.js +0 -6
- package/src/patterns/components/icon/icon.behavior.js +0 -16
- package/src/patterns/components/icon/icon.js +0 -128
- package/src/patterns/components/icon/icon.stories.jsx +0 -10
- package/src/patterns/components/icon/icon.twig +0 -4
- package/src/patterns/components/icon/index.js +0 -6
- package/src/patterns/components/image/image.stories.jsx +0 -9
- package/src/patterns/components/image/image.twig +0 -29
- package/src/patterns/components/image/index.js +0 -6
- package/src/patterns/components/link/index.js +0 -6
- package/src/patterns/components/link/link.stories.jsx +0 -9
- package/src/patterns/components/link/link.twig +0 -8
- package/src/patterns/components/linklist/index.js +0 -7
- package/src/patterns/components/linklist/linklist.behavior.js +0 -15
- package/src/patterns/components/linklist/linklist.js +0 -55
- package/src/patterns/components/linklist/linklist.stories.jsx +0 -14
- package/src/patterns/components/linklist/linklist.twig +0 -26
- package/src/patterns/components/list/index.js +0 -6
- package/src/patterns/components/list/list-item.twig +0 -6
- package/src/patterns/components/list/list.stories.jsx +0 -9
- package/src/patterns/components/list/list.twig +0 -35
- package/src/patterns/components/loading/index.js +0 -7
- package/src/patterns/components/loading/loading.behavior.js +0 -16
- package/src/patterns/components/loading/loading.js +0 -102
- package/src/patterns/components/loading/loading.stories.jsx +0 -9
- package/src/patterns/components/loading/loading.twig +0 -8
- package/src/patterns/components/localnav/index.js +0 -7
- package/src/patterns/components/localnav/localnav.stories.jsx +0 -9
- package/src/patterns/components/localnav/localnav.twig +0 -86
- package/src/patterns/components/logogrid/index.js +0 -6
- package/src/patterns/components/logogrid/logogrid.stories.jsx +0 -9
- package/src/patterns/components/logogrid/logogrid.twig +0 -17
- package/src/patterns/components/modal/index.js +0 -7
- package/src/patterns/components/modal/modal.behavior.js +0 -16
- package/src/patterns/components/modal/modal.js +0 -134
- package/src/patterns/components/modal/modal.stories.jsx +0 -10
- package/src/patterns/components/modal/modal.twig +0 -20
- package/src/patterns/components/navigation/index.js +0 -7
- package/src/patterns/components/navigation/navigation.behavior.js +0 -16
- package/src/patterns/components/navigation/navigation.js +0 -552
- package/src/patterns/components/navigation/navigation.stories.jsx +0 -10
- package/src/patterns/components/navigation/navigation.twig +0 -171
- package/src/patterns/components/notification/index.js +0 -7
- package/src/patterns/components/notification/notification.behavior.js +0 -16
- package/src/patterns/components/notification/notification.js +0 -97
- package/src/patterns/components/notification/notification.stories.jsx +0 -10
- package/src/patterns/components/notification/notification.twig +0 -18
- package/src/patterns/components/numberpicker/index.js +0 -7
- package/src/patterns/components/numberpicker/numberpicker.stories.jsx +0 -9
- package/src/patterns/components/numberpicker/numberpicker.twig +0 -16
- package/src/patterns/components/pagination/Pagination.stories.jsx +0 -9
- package/src/patterns/components/pagination/index.js +0 -6
- package/src/patterns/components/pagination/pagination.twig +0 -49
- package/src/patterns/components/picture/index.js +0 -6
- package/src/patterns/components/picture/picture.twig +0 -21
- package/src/patterns/components/polyfill/index.js +0 -6
- package/src/patterns/components/polyfill/polyfill.twig +0 -10
- package/src/patterns/components/profile/index.js +0 -6
- package/src/patterns/components/profile/profile.stories.jsx +0 -10
- package/src/patterns/components/profile/profile.twig +0 -26
- package/src/patterns/components/radio/index.js +0 -7
- package/src/patterns/components/radio/radio.stories.jsx +0 -10
- package/src/patterns/components/radio/radio.twig +0 -23
- package/src/patterns/components/readmore/index.js +0 -7
- package/src/patterns/components/readmore/readmore.behavior.js +0 -16
- package/src/patterns/components/readmore/readmore.js +0 -121
- package/src/patterns/components/readmore/readmore.stories.jsx +0 -10
- package/src/patterns/components/readmore/readmore.twig +0 -16
- package/src/patterns/components/richtext/index.js +0 -6
- package/src/patterns/components/richtext/richtext.stories.jsx +0 -10
- package/src/patterns/components/richtext/richtext.twig +0 -6
- package/src/patterns/components/search/index.js +0 -7
- package/src/patterns/components/search/search.behavior.js +0 -15
- package/src/patterns/components/search/search.js +0 -103
- package/src/patterns/components/search/search.stories.jsx +0 -10
- package/src/patterns/components/search/search.twig +0 -31
- package/src/patterns/components/socialmedia/index.js +0 -6
- package/src/patterns/components/socialmedia/socialmedia.mdx +0 -48
- package/src/patterns/components/socialmedia/socialmedia.stories.jsx +0 -15
- package/src/patterns/components/socialmedia/socialmedia.twig +0 -17
- package/src/patterns/components/table/index.js +0 -7
- package/src/patterns/components/table/table.behavior.js +0 -16
- package/src/patterns/components/table/table.js +0 -305
- package/src/patterns/components/table/table.stories.jsx +0 -10
- package/src/patterns/components/table/table.twig +0 -39
- package/src/patterns/components/tableofcontents/index.js +0 -7
- package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +0 -16
- package/src/patterns/components/tableofcontents/tableofcontents.js +0 -172
- package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +0 -10
- package/src/patterns/components/tableofcontents/tableofcontents.twig +0 -47
- package/src/patterns/components/tabs/index.js +0 -7
- package/src/patterns/components/tabs/tabs.behavior.js +0 -27
- package/src/patterns/components/tabs/tabs.js +0 -212
- package/src/patterns/components/tabs/tabs.stories.jsx +0 -10
- package/src/patterns/components/tabs/tabs.twig +0 -29
- package/src/patterns/components/tags/index.js +0 -7
- package/src/patterns/components/tags/tag.behavior.js +0 -16
- package/src/patterns/components/tags/tag.js +0 -159
- package/src/patterns/components/tags/tag.stories.jsx +0 -10
- package/src/patterns/components/tags/tag.twig +0 -30
- package/src/patterns/components/tags/tags.twig +0 -15
- package/src/patterns/components/textarea/index.js +0 -7
- package/src/patterns/components/textarea/textarea.stories.jsx +0 -9
- package/src/patterns/components/textarea/textarea.twig +0 -14
- package/src/patterns/components/textinput/index.js +0 -7
- package/src/patterns/components/textinput/textinput.stories.jsx +0 -10
- package/src/patterns/components/textinput/textinput.twig +0 -14
- package/src/patterns/components/toggle/index.js +0 -7
- package/src/patterns/components/toggle/toggle.stories.jsx +0 -10
- package/src/patterns/components/toggle/toggle.twig +0 -36
- package/src/patterns/components/tooltip/index.js +0 -7
- package/src/patterns/components/tooltip/tooltip.behavior.js +0 -16
- package/src/patterns/components/tooltip/tooltip.js +0 -156
- package/src/patterns/components/tooltip/tooltip.stories.jsx +0 -10
- package/src/patterns/components/tooltip/tooltip.twig +0 -14
- package/src/patterns/components/video/index.js +0 -7
- package/src/patterns/components/video/video.behavior.js +0 -16
- package/src/patterns/components/video/video.js +0 -120
- package/src/patterns/components/video/video.stories.jsx +0 -10
- package/src/patterns/components/video/video.twig +0 -18
- package/src/patterns/components/video/videoplayer.twig +0 -8
- package/src/tokens/exports/_colors.scss +0 -7
- package/src/tokens/exports/_font-sizes-heading.scss +0 -10
- package/src/tokens/index.scss +0 -7
- package/src/vendorjs/lib.vendor.js +0 -1
- /package/{src/patterns/components/accordion/accordion.wingsuit.yml → dist/components/accordion/accordion.component.yml} +0 -0
- /package/{src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml → dist/components/breadcrumb/breadcrumb.component.yml} +0 -0
- /package/{src/patterns/components/button/button.wingsuit.yml → dist/components/button/button.component.yml} +0 -0
- /package/{src/patterns/components/card/card.wingsuit.yml → dist/components/card/card.component.yml} +0 -0
- /package/{src/patterns/components/card_data/card_data.wingsuit.yml → dist/components/card_data/card_data.component.yml} +0 -0
- /package/{src/patterns/components/card_detail/card_detail.wingsuit.yml → dist/components/card_detail/card_detail.component.yml} +0 -0
- /package/{src/patterns/components/card_factlist/card_factlist.wingsuit.yml → dist/components/card_factlist/card_factlist.component.yml} +0 -0
- /package/{src/patterns/components/card_feature/card_feature.wingsuit.yml → dist/components/card_feature/card_feature.component.yml} +0 -0
- /package/{src/patterns/components/card_multilink/card_multilink.wingsuit.yml → dist/components/card_multilink/card_multilink.component.yml} +0 -0
- /package/{src/patterns/components/card_promo/card_promo.wingsuit.yml → dist/components/card_promo/card_promo.component.yml} +0 -0
- /package/{src/patterns/components/card_stat/card_stat.wingsuit.yml → dist/components/card_stat/card_stat.component.yml} +0 -0
- /package/{src/patterns/components/card_text/card_text.wingsuit.yml → dist/components/card_text/card_text.component.yml} +0 -0
- /package/{src/patterns/components/cardgroup/cardgroup.wingsuit.yml → dist/components/cardgroup/cardgroup.component.yml} +0 -0
- /package/{src/patterns/components/contextmenu/contextmenu.wingsuit.yml → dist/components/contextmenu/contextmenu.component.yml} +0 -0
- /package/{src/patterns/components/form/form.wingsuit.yml → dist/components/form/form.component.yml} +0 -0
- /package/{src/patterns/components/hero/hero.wingsuit.yml → dist/components/hero/hero.component.yml} +0 -0
- /package/{src/patterns/components/herocard/herocard.wingsuit.yml → dist/components/herocard/herocard.component.yml} +0 -0
- /package/{src/patterns/components/icon/icon.wingsuit.yml → dist/components/icon/icon.component.yml} +0 -0
- /package/{src/patterns/components/image/image.wingsuit.yml → dist/components/image/image.component.yml} +0 -0
- /package/{src/patterns/components/link/link.wingsuit.yml → dist/components/link/link.component.yml} +0 -0
- /package/{src/patterns/components/linklist/linklist.wingsuit.yml → dist/components/linklist/linklist.component.yml} +0 -0
- /package/{src/patterns/components/logogrid/logogrid.wingsuit.yml → dist/components/logogrid/logogrid.component.yml} +0 -0
- /package/{src/patterns/components/notification/notification.wingsuit.yml → dist/components/notification/notification.component.yml} +0 -0
- /package/{src/patterns/components/profile/profile.wingsuit.yml → dist/components/profile/profile.component.yml} +0 -0
- /package/{src/patterns/components/richtext/richtext.wingsuit.yml → dist/components/richtext/richtext.component.yml} +0 -0
- /package/{src/patterns/components/socialmedia/socialmedia.wingsuit.yml → dist/components/socialmedia/socialmedia.component.yml} +0 -0
- /package/{src/patterns/components/table/table.wingsuit.yml → dist/components/table/table.component.yml} +0 -0
- /package/{src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml → dist/components/tableofcontents/tableofcontents.component.yml} +0 -0
- /package/{src/patterns/components/tabs/tabs.wingsuit.yml → dist/components/tabs/tabs.component.yml} +0 -0
- /package/{src/patterns/components/tags/tags.wingsuit.yml → dist/components/tags/tags.component.yml} +0 -0
- /package/{src/patterns/components/tooltip/tooltip.wingsuit.yml → dist/components/tooltip/tooltip.component.yml} +0 -0
- /package/{src/patterns/components/video/video.wingsuit.yml → dist/components/video/video.component.yml} +0 -0
- /package/dist/{components/accordion → styles/components}/accordion.css +0 -0
- /package/dist/{components/breadcrumb → styles/components}/breadcrumb.css +0 -0
- /package/dist/{components/button → styles/components}/button.css +0 -0
- /package/dist/{components/callout → styles/components}/callout.css +0 -0
- /package/dist/{components/card → styles/components}/card.css +0 -0
- /package/dist/{components/cardgroup → styles/components}/cardgroup.css +0 -0
- /package/dist/{components/checkbox → styles/components}/checkbox.css +0 -0
- /package/dist/{components/container → styles/components}/container.css +0 -0
- /package/dist/{components/contextmenu → styles/components}/contextmenu.css +0 -0
- /package/dist/{components/credit → styles/components}/credit.css +0 -0
- /package/dist/{components/datacard → styles/components}/datacard.css +0 -0
- /package/dist/{components/datepicker → styles/components}/datepicker.css +0 -0
- /package/dist/{components/detailcard → styles/components}/detailcard.css +0 -0
- /package/dist/{components/dropdown → styles/components}/dropdown.css +0 -0
- /package/dist/{components/empty → styles/components}/empty.css +0 -0
- /package/dist/{components/factlistcard → styles/components}/factlistcard.css +0 -0
- /package/dist/{components/featurecard → styles/components}/featurecard.css +0 -0
- /package/dist/{components/fieldset → styles/components}/fieldset.css +0 -0
- /package/dist/{components/file-upload → styles/components}/file-upload.css +0 -0
- /package/dist/{components/footer → styles/components}/footer.css +0 -0
- /package/dist/{components/form → styles/components}/form.css +0 -0
- /package/dist/{components/formcontrol → styles/components}/formcontrol.css +0 -0
- /package/dist/{components/heading → styles/components}/heading.css +0 -0
- /package/dist/{components/hero → styles/components}/hero.css +0 -0
- /package/dist/{components/herocard → styles/components}/herocard.css +0 -0
- /package/dist/{components/image → styles/components}/image.css +0 -0
- /package/dist/{components/input → styles/components}/input.css +0 -0
- /package/dist/{components/link → styles/components}/link.css +0 -0
- /package/dist/{components/linklist → styles/components}/linklist.css +0 -0
- /package/dist/{components/list → styles/components}/list.css +0 -0
- /package/dist/{components/loading → styles/components}/loading.css +0 -0
- /package/dist/{components/logo → styles/components}/logo.css +0 -0
- /package/dist/{components/logogrid → styles/components}/logogrid.css +0 -0
- /package/dist/{components/modal → styles/components}/modal.css +0 -0
- /package/dist/{components/multilinkcard → styles/components}/multilinkcard.css +0 -0
- /package/dist/{components/navigation → styles/components}/navigation.css +0 -0
- /package/dist/{components/notification → styles/components}/notification.css +0 -0
- /package/dist/{components/pagination → styles/components}/pagination.css +0 -0
- /package/dist/{components/profile → styles/components}/profile.css +0 -0
- /package/dist/{components/promocard → styles/components}/promocard.css +0 -0
- /package/dist/{components/radio → styles/components}/radio.css +0 -0
- /package/dist/{components/readmore → styles/components}/readmore.css +0 -0
- /package/dist/{components/richtext → styles/components}/richtext.css +0 -0
- /package/dist/{components/searchfield → styles/components}/searchfield.css +0 -0
- /package/dist/{components/socialmedia → styles/components}/socialmedia.css +0 -0
- /package/dist/{components/statcard → styles/components}/statcard.css +0 -0
- /package/dist/{components/table → styles/components}/table.css +0 -0
- /package/dist/{components/tableofcontents → styles/components}/tableofcontents.css +0 -0
- /package/dist/{components/tabs → styles/components}/tabs.css +0 -0
- /package/dist/{components/tag → styles/components}/tag.css +0 -0
- /package/dist/{components/textarea → styles/components}/textarea.css +0 -0
- /package/dist/{components/textcard → styles/components}/textcard.css +0 -0
- /package/dist/{components/textinput → styles/components}/textinput.css +0 -0
- /package/dist/{components/toggle → styles/components}/toggle.css +0 -0
- /package/dist/{components/tooltip → styles/components}/tooltip.css +0 -0
- /package/dist/{components/video → styles/components}/video.css +0 -0
- /package/dist/{global/styles.css → styles/index.css} +0 -0
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { EVENTS, ARIA, MISC } from "@ilo-org/utils";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The Table module which handles rendering field labels inline on a form.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @class Table
|
|
8
|
-
*/
|
|
9
|
-
export default class Table {
|
|
10
|
-
/**
|
|
11
|
-
* Table constructor which assigns the element passed into the constructor
|
|
12
|
-
* to the `this.element` property for later reference
|
|
13
|
-
*
|
|
14
|
-
* @param {HTMLElement} element - REQUIRED - the module's container
|
|
15
|
-
*/
|
|
16
|
-
constructor(element) {
|
|
17
|
-
/**
|
|
18
|
-
* Reference to the DOM element that is the root of the component
|
|
19
|
-
* @property {Object}
|
|
20
|
-
*/
|
|
21
|
-
this.element = element;
|
|
22
|
-
|
|
23
|
-
// get the theme prefix
|
|
24
|
-
this.prefix = this.element.dataset.prefix;
|
|
25
|
-
|
|
26
|
-
this.sortlist = [];
|
|
27
|
-
|
|
28
|
-
// Initialize the view
|
|
29
|
-
this.init();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Initializes the view by calling the functions to
|
|
34
|
-
* create DOM references, setup event handlers and
|
|
35
|
-
* then create the event listeners
|
|
36
|
-
*
|
|
37
|
-
* @return {Object} Table A reference to the instance of the class
|
|
38
|
-
* @chainable
|
|
39
|
-
*/
|
|
40
|
-
init() {
|
|
41
|
-
this.cacheDomReferences().setupHandlers().setUpSorting().enable();
|
|
42
|
-
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Find all necessary DOM elements used in the view and cache them
|
|
48
|
-
*
|
|
49
|
-
* @return {Object} ReadMore A reference to the instance of the class
|
|
50
|
-
* @chainable
|
|
51
|
-
*/
|
|
52
|
-
cacheDomReferences() {
|
|
53
|
-
/**
|
|
54
|
-
* The button for toggling Read More state
|
|
55
|
-
* @type {Object}
|
|
56
|
-
*/
|
|
57
|
-
this.thCells = this.element.querySelectorAll(
|
|
58
|
-
`.${this.prefix}--table--head--cell`
|
|
59
|
-
);
|
|
60
|
-
this.tdCells = this.element.querySelectorAll(
|
|
61
|
-
`.${this.prefix}--table--body--cell`
|
|
62
|
-
);
|
|
63
|
-
this.rows = this.element.querySelectorAll(`[class~="--row"]`);
|
|
64
|
-
this.thRows = this.element.querySelectorAll(
|
|
65
|
-
`.${this.prefix}--table--head--row`
|
|
66
|
-
);
|
|
67
|
-
this.tdRows = this.element.querySelectorAll(
|
|
68
|
-
`.${this.prefix}--table--body--row`
|
|
69
|
-
);
|
|
70
|
-
this.tBody = this.element.querySelector(`.${this.prefix}--table--body`);
|
|
71
|
-
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Bind event handlers with the proper context of `this`.
|
|
77
|
-
*
|
|
78
|
-
* @return {Object} Table A reference to the current instance of the class
|
|
79
|
-
* @chainable
|
|
80
|
-
*/
|
|
81
|
-
setupHandlers() {
|
|
82
|
-
this.ClickThHandler = this.onClickTh.bind(this);
|
|
83
|
-
this.ClickTdHandler = this.onClickTd.bind(this);
|
|
84
|
-
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Evaluates which columns are sortable and adds class to th of sortable columns
|
|
90
|
-
*
|
|
91
|
-
* @return {Object} Table A reference to the current instance of the class
|
|
92
|
-
* @chainable
|
|
93
|
-
*/
|
|
94
|
-
setUpSorting() {
|
|
95
|
-
Array.from(this.tdRows).forEach((tdrow) => {
|
|
96
|
-
Array.from(
|
|
97
|
-
tdrow.querySelectorAll(`.${this.prefix}--table--body--cell`)
|
|
98
|
-
).forEach((cell, index) => {
|
|
99
|
-
const sortablecontent = cell.textContent.toLowerCase();
|
|
100
|
-
if (typeof this.sortlist[index] === "undefined") {
|
|
101
|
-
this.sortlist[index] = [];
|
|
102
|
-
}
|
|
103
|
-
if (cell.classList.contains("numeric")) {
|
|
104
|
-
if (this.isDate(sortablecontent)) {
|
|
105
|
-
this.sortlist[index].push({
|
|
106
|
-
value: sortablecontent,
|
|
107
|
-
node: tdrow,
|
|
108
|
-
type: "date",
|
|
109
|
-
});
|
|
110
|
-
} else {
|
|
111
|
-
this.sortlist[index].push({
|
|
112
|
-
value: sortablecontent,
|
|
113
|
-
node: tdrow,
|
|
114
|
-
type: "numeric",
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
} else if (cell.innerHTML.match(/^([^0-9]*)$/)) {
|
|
118
|
-
this.sortlist[index].push({
|
|
119
|
-
value: sortablecontent,
|
|
120
|
-
node: tdrow,
|
|
121
|
-
type: "string",
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
this.sortlist.forEach((column, index) => {
|
|
127
|
-
if (this.sortlist[index].length === this.tdRows.length) {
|
|
128
|
-
this.thCells[index].classList.add("sortable");
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
return this;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Creates event listeners to enable interaction with view
|
|
137
|
-
*
|
|
138
|
-
* @return {Object} Table A reference to the instance of the class
|
|
139
|
-
* @chainable
|
|
140
|
-
*/
|
|
141
|
-
enable() {
|
|
142
|
-
this.element.classList.add("table--js");
|
|
143
|
-
|
|
144
|
-
Array.from(this.thCells).forEach((thcell) => {
|
|
145
|
-
thcell.addEventListener(EVENTS.CLICK, (e) => this.ClickThHandler(e));
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
Array.from(this.tdCells).forEach((tdcell) => {
|
|
149
|
-
tdcell.addEventListener(EVENTS.CLICK, (e) => this.ClickTdHandler(e));
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
return this;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Actions performed on click of a tab
|
|
157
|
-
*
|
|
158
|
-
* @return {Object} Modal A reference to the instance of the class
|
|
159
|
-
* @chainable
|
|
160
|
-
*/
|
|
161
|
-
onClickTh(e) {
|
|
162
|
-
e.preventDefault();
|
|
163
|
-
Array.from(this.thCells).forEach((thcell, index) => {
|
|
164
|
-
// set/remove aria-sort attribute
|
|
165
|
-
if (thcell === e.target) {
|
|
166
|
-
if (
|
|
167
|
-
typeof thcell.getAttribute(ARIA.SORT) === "undefined" ||
|
|
168
|
-
thcell.getAttribute(ARIA.SORT) === MISC.DESCENDING
|
|
169
|
-
) {
|
|
170
|
-
thcell.setAttribute(ARIA.SORT, MISC.ASCENDING);
|
|
171
|
-
this.sortColumn(index, MISC.ASCENDING);
|
|
172
|
-
} else {
|
|
173
|
-
thcell.setAttribute(ARIA.SORT, MISC.DESCENDING);
|
|
174
|
-
this.sortColumn(index, MISC.DESCENDING);
|
|
175
|
-
}
|
|
176
|
-
} else {
|
|
177
|
-
thcell.removeAttribute(ARIA.SORT);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
return this;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Actions performed on click of a tab
|
|
186
|
-
*
|
|
187
|
-
* @return {Object} Modal A reference to the instance of the class
|
|
188
|
-
* @chainable
|
|
189
|
-
*/
|
|
190
|
-
onClickTd(e) {
|
|
191
|
-
e.preventDefault();
|
|
192
|
-
let currentindex = null;
|
|
193
|
-
|
|
194
|
-
Array.from(this.tdRows).forEach((tdrow) => {
|
|
195
|
-
tdrow.classList.remove("selected");
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
e.target.parentElement.classList.add("selected");
|
|
199
|
-
|
|
200
|
-
Array.from(this.tdCells).forEach((tdcell) => {
|
|
201
|
-
tdcell.classList.remove("selected");
|
|
202
|
-
tdcell.classList.remove("column--selected");
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
Array.from(
|
|
206
|
-
e.target.parentElement.querySelectorAll(
|
|
207
|
-
`.${this.prefix}--table--body--cell`
|
|
208
|
-
)
|
|
209
|
-
).forEach((tdcell, index) => {
|
|
210
|
-
if (tdcell === e.target) {
|
|
211
|
-
tdcell.classList.add("selected");
|
|
212
|
-
currentindex = index;
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
Array.from(this.tdRows).forEach((tdrow) => {
|
|
217
|
-
Array.from(
|
|
218
|
-
tdrow.querySelectorAll(`.${this.prefix}--table--body--cell`)
|
|
219
|
-
).forEach((tdcell, index) => {
|
|
220
|
-
if (index === currentindex && tdcell !== e.target) {
|
|
221
|
-
tdcell.classList.add("column--selected");
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
if (e.target.hasAttribute("href")) {
|
|
227
|
-
window.location.href = e.target.getAttribute("href");
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return this;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Sort a column
|
|
235
|
-
*
|
|
236
|
-
* @return {Object} Modal A reference to the instance of the class
|
|
237
|
-
* @chainable
|
|
238
|
-
*/
|
|
239
|
-
sortColumn(column, sortdirection) {
|
|
240
|
-
const sorted = this.sortlist[column].sort(this.compare(sortdirection));
|
|
241
|
-
|
|
242
|
-
while (this.tBody.firstChild) {
|
|
243
|
-
this.tBody.removeChild(this.tBody.lastChild);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
sorted.forEach((row) => {
|
|
247
|
-
this.tBody.appendChild(row.node);
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
return this;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* compare
|
|
255
|
-
*
|
|
256
|
-
* @return {Function} a compare function
|
|
257
|
-
*/
|
|
258
|
-
compare(sortdirection) {
|
|
259
|
-
return function (a, b) {
|
|
260
|
-
if (sortdirection === MISC.ASCENDING) {
|
|
261
|
-
if (a.value === b.value) {
|
|
262
|
-
return 0;
|
|
263
|
-
} else {
|
|
264
|
-
if (a.type === "numeric") {
|
|
265
|
-
return a.value - b.value;
|
|
266
|
-
} else if (a.type === "date") {
|
|
267
|
-
return new Date(a.value) - new Date(b.value);
|
|
268
|
-
} else {
|
|
269
|
-
return a.value < b.value ? -1 : 1;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
if (a.value === b.value) {
|
|
274
|
-
return 0;
|
|
275
|
-
} else {
|
|
276
|
-
if (a.type === "numeric") {
|
|
277
|
-
return b.value - a.value;
|
|
278
|
-
} else if (a.type === "date") {
|
|
279
|
-
return new Date(b.value) - new Date(a.value);
|
|
280
|
-
} else {
|
|
281
|
-
return a.value > b.value ? -1 : 1;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* isDate
|
|
290
|
-
* tests is the passed string is a date
|
|
291
|
-
*
|
|
292
|
-
* @return {Boolean} is it a date?
|
|
293
|
-
*/
|
|
294
|
-
isDate(date) {
|
|
295
|
-
let isdate = false;
|
|
296
|
-
if (date.match(/^[0-3]?[0-9]\/[0-3]?[0-9]\/(?:[0-9]{2})?[0-9]{2}$/)) {
|
|
297
|
-
isdate = true;
|
|
298
|
-
}
|
|
299
|
-
if (date.match(/^[0-3]?[0-9]-[0-3]?[0-9]-(?:[0-9]{2})?[0-9]{2}$/)) {
|
|
300
|
-
isdate = true;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return isdate;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{#
|
|
2
|
-
TABLE COMPONENT
|
|
3
|
-
#}
|
|
4
|
-
<div class="{{prefix}}--table{% if zebra|boolval %} {{prefix}}--table--zebra{% endif %}{% if smallrows|boolval %} {{prefix}}--table--small{% endif %}" data-prefix="{{prefix}}" data-loadcomponent="Table">
|
|
5
|
-
<header class="{{prefix}}--table--header">
|
|
6
|
-
<h3 class="{{prefix}}--table--headline">
|
|
7
|
-
{{headline}}
|
|
8
|
-
{% if tooltip %}
|
|
9
|
-
{% include '@components/tooltip/tooltip.twig' with tooltip %}
|
|
10
|
-
{% endif %}
|
|
11
|
-
</h3>
|
|
12
|
-
{% if description is defined %}
|
|
13
|
-
<p class="{{prefix}}--table--description">
|
|
14
|
-
{{description}}
|
|
15
|
-
</p>
|
|
16
|
-
{% endif %}
|
|
17
|
-
</header>
|
|
18
|
-
<div class="{{prefix}}--table--wrapper">
|
|
19
|
-
<table class="{{prefix}}--table--content">
|
|
20
|
-
<thead class="{{prefix}}--table--head">
|
|
21
|
-
<tr class="{{prefix}}--table--head--row">
|
|
22
|
-
{% for column in tableheadings %}
|
|
23
|
-
<th class="{{prefix}}--table--head--cell">{{column}}</th>
|
|
24
|
-
{% endfor %}
|
|
25
|
-
</tr>
|
|
26
|
-
</thead>
|
|
27
|
-
<tbody class="{{prefix}}--table--body">
|
|
28
|
-
{% for row in tabledata %}
|
|
29
|
-
<tr class="{{prefix}}--table--body--row">
|
|
30
|
-
{% for cell in row %}
|
|
31
|
-
{% set evaluate = cell|striptags|replace({'/': '', '-':'','_':'','.':'',}) %}
|
|
32
|
-
<td class="{{prefix}}--table--body--cell{% if evaluate matches '/^[0-9]+$/' %} numeric{% endif %}">{{cell}}</td>
|
|
33
|
-
{% endfor %}
|
|
34
|
-
</tr>
|
|
35
|
-
{% endfor %}
|
|
36
|
-
</tbody>
|
|
37
|
-
</table>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import TableOfContents from "./tableofcontents";
|
|
2
|
-
|
|
3
|
-
Drupal.behaviors.tableofcontents = {
|
|
4
|
-
attach() {
|
|
5
|
-
Array.prototype.forEach.call(
|
|
6
|
-
document.querySelectorAll(`[data-loadcomponent="TableOfContents"]`),
|
|
7
|
-
(element) => {
|
|
8
|
-
if (!element.dataset.jsProcessed) {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
|
-
new TableOfContents(element);
|
|
11
|
-
element.dataset.jsProcessed = true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { EVENTS } from "@ilo-org/utils";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The TableOfContents module which handles control and display of a TableOfContents dialog
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @class TableOfContents
|
|
8
|
-
*/
|
|
9
|
-
export default class TableOfContents {
|
|
10
|
-
/**
|
|
11
|
-
* TableOfContents constructor which assigns the element passed into the constructor
|
|
12
|
-
* to the `this.element` property for later reference
|
|
13
|
-
*
|
|
14
|
-
* @param {HTMLElement} element - REQUIRED - the module's container
|
|
15
|
-
*/
|
|
16
|
-
constructor(element) {
|
|
17
|
-
/**
|
|
18
|
-
* Reference to the DOM element that is the root of the component
|
|
19
|
-
* @property {Object}
|
|
20
|
-
*/
|
|
21
|
-
this.element = element;
|
|
22
|
-
|
|
23
|
-
// get the theme prefix
|
|
24
|
-
this.prefix = this.element.dataset.prefix;
|
|
25
|
-
|
|
26
|
-
// Initialize the view
|
|
27
|
-
this.init();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Initializes the view by calling the functions to
|
|
32
|
-
* create DOM references, setup event handlers and
|
|
33
|
-
* then create the event listeners
|
|
34
|
-
*
|
|
35
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
36
|
-
* @chainable
|
|
37
|
-
*/
|
|
38
|
-
init() {
|
|
39
|
-
this.cacheDomReferences().setupHandlers().enable();
|
|
40
|
-
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Find all necessary DOM elements used in the view and cache them
|
|
46
|
-
*
|
|
47
|
-
* @return {Object} ReadMore A reference to the instance of the class
|
|
48
|
-
* @chainable
|
|
49
|
-
*/
|
|
50
|
-
cacheDomReferences() {
|
|
51
|
-
/**
|
|
52
|
-
* The button for toggling Read More state
|
|
53
|
-
* @type {Object}
|
|
54
|
-
*/
|
|
55
|
-
this.OpenButton = this.element.querySelector(`.toc--modal--open`);
|
|
56
|
-
this.CloseButton = this.element.querySelector(`.toc--modal--close`);
|
|
57
|
-
this.trigger = this.element.querySelector(
|
|
58
|
-
`.${this.prefix}--table-of-contents--trigger`
|
|
59
|
-
);
|
|
60
|
-
this.modalUx = this.element.querySelector(
|
|
61
|
-
`.${this.prefix}--table-of-contents--modal`
|
|
62
|
-
);
|
|
63
|
-
this.toc = this.element.querySelector(`.${this.prefix}--table-of-contents`);
|
|
64
|
-
this.tocItems = this.element.querySelectorAll(
|
|
65
|
-
`.${this.prefix}--table-of-contents--link`
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Bind event handlers with the proper context of `this`.
|
|
73
|
-
*
|
|
74
|
-
* @return {Object} TableOfContents A reference to the current instance of the class
|
|
75
|
-
* @chainable
|
|
76
|
-
*/
|
|
77
|
-
setupHandlers() {
|
|
78
|
-
this.OpenButtonHandler = this.openButtonClick.bind(this);
|
|
79
|
-
this.CloseHandler = this.closeButtonClick.bind(this);
|
|
80
|
-
this.KeyPressHandler = this.keyPress.bind(this);
|
|
81
|
-
this.linkClickHandler = this.linkClick.bind(this);
|
|
82
|
-
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Creates event listeners to enable interaction with view
|
|
88
|
-
*
|
|
89
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
90
|
-
* @chainable
|
|
91
|
-
*/
|
|
92
|
-
enable() {
|
|
93
|
-
this.OpenButton.addEventListener(EVENTS.CLICK, () =>
|
|
94
|
-
this.OpenButtonHandler()
|
|
95
|
-
);
|
|
96
|
-
this.CloseButton.addEventListener(EVENTS.CLICK, () => this.CloseHandler());
|
|
97
|
-
|
|
98
|
-
if (this.tocItems.length > 0) {
|
|
99
|
-
this.tocItems.forEach((link) => {
|
|
100
|
-
link.addEventListener(EVENTS.CLICK, () => this.linkClickHandler());
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return this;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Actions performed on click of the open button
|
|
109
|
-
*
|
|
110
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
111
|
-
* @chainable
|
|
112
|
-
*/
|
|
113
|
-
openButtonClick() {
|
|
114
|
-
this.trigger.classList.add("hide");
|
|
115
|
-
this.element.classList.add("show");
|
|
116
|
-
this.modalUx.classList.add("show");
|
|
117
|
-
this.toc.classList.add("show");
|
|
118
|
-
setTimeout(() => {
|
|
119
|
-
this.modalUx.classList.add("fadein");
|
|
120
|
-
this.toc.classList.add("fadein");
|
|
121
|
-
}, 125);
|
|
122
|
-
window.addEventListener(EVENTS.KEY_DOWN, (e) => this.KeyPressHandler(e));
|
|
123
|
-
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Actions performed on click of the close button
|
|
129
|
-
*
|
|
130
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
131
|
-
* @chainable
|
|
132
|
-
*/
|
|
133
|
-
closeButtonClick() {
|
|
134
|
-
this.modalUx.classList.remove("fadein");
|
|
135
|
-
this.toc.classList.remove("fadein");
|
|
136
|
-
setTimeout(() => {
|
|
137
|
-
this.modalUx.classList.remove("show");
|
|
138
|
-
this.toc.classList.remove("show");
|
|
139
|
-
this.element.classList.remove("show");
|
|
140
|
-
this.trigger.classList.remove("hide");
|
|
141
|
-
}, 125);
|
|
142
|
-
window.removeEventListener(EVENTS.KEY_DOWN, (e) => this.KeyPressHandler(e));
|
|
143
|
-
|
|
144
|
-
return this;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Actions performed on click of any link
|
|
149
|
-
*
|
|
150
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
151
|
-
* @chainable
|
|
152
|
-
*/
|
|
153
|
-
linkClick() {
|
|
154
|
-
this.closeButtonClick();
|
|
155
|
-
|
|
156
|
-
return this;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Actions performed on key press
|
|
161
|
-
*
|
|
162
|
-
* @return {Object} TableOfContents A reference to the instance of the class
|
|
163
|
-
* @chainable
|
|
164
|
-
*/
|
|
165
|
-
keyPress(e) {
|
|
166
|
-
if (e.key === "Escape") {
|
|
167
|
-
this.closeButtonClick();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return this;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{# tableofcontents.twig #}
|
|
2
|
-
|
|
3
|
-
{% set openbutton_size = openbutton.size|default("medium") %}
|
|
4
|
-
{% set openbutton_type = openbutton.type|default("secondary") %}
|
|
5
|
-
{% set openbutton_label = openbutton.label|default("Open") %}
|
|
6
|
-
{% set openbutton_label = openbutton.label|default("Open") %}
|
|
7
|
-
{% set closebutton_label = closebutton.label|default("Close") %}
|
|
8
|
-
|
|
9
|
-
{% if items %}
|
|
10
|
-
<div class="{{prefix}}--table-of-contents--wrapper" data-loadcomponent="TableOfContents" data-prefix="{{prefix}}">
|
|
11
|
-
<div class="{{prefix}}--table-of-contents--trigger">
|
|
12
|
-
{% include '@components/button/button.twig' with {
|
|
13
|
-
prefix: prefix,
|
|
14
|
-
size: openbutton_size,
|
|
15
|
-
type: openbutton_type,
|
|
16
|
-
label: openbutton_label,
|
|
17
|
-
opensmodal: true,
|
|
18
|
-
className: "toc--modal--open"
|
|
19
|
-
} only %}
|
|
20
|
-
</div>
|
|
21
|
-
<div class="{{prefix}}--table-of-contents--modal">
|
|
22
|
-
<h3 class="{{prefix}}--table-of-contents--headline">{{headline}}</h3>
|
|
23
|
-
{% include '@components/button/button.twig' with {
|
|
24
|
-
prefix: prefix,
|
|
25
|
-
size: "large",
|
|
26
|
-
type: "tertiary",
|
|
27
|
-
label: closebutton_label,
|
|
28
|
-
icon: {
|
|
29
|
-
name: "close",
|
|
30
|
-
size: 24,
|
|
31
|
-
},
|
|
32
|
-
iconPos: "center",
|
|
33
|
-
icononly: true,
|
|
34
|
-
className: "toc--modal--close"
|
|
35
|
-
} only %}
|
|
36
|
-
</div>
|
|
37
|
-
<nav class="{{prefix}}--table-of-contents">
|
|
38
|
-
<ul class="{{prefix}}--table-of-contents--list">
|
|
39
|
-
{% for item in items %}
|
|
40
|
-
<li class="{{prefix}}--table-of-contents--list--item">
|
|
41
|
-
<a class="{{prefix}}--table-of-contents--link" href="{{item.href}}">{{item.label}}</a>
|
|
42
|
-
</li>
|
|
43
|
-
{% endfor %}
|
|
44
|
-
</ul>
|
|
45
|
-
</nav>
|
|
46
|
-
</div>
|
|
47
|
-
{% endif %}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Tabs from "./tabs";
|
|
2
|
-
import Tooltip from "../tooltip/tooltip";
|
|
3
|
-
|
|
4
|
-
Drupal.behaviors.tabs = {
|
|
5
|
-
attach() {
|
|
6
|
-
Array.prototype.forEach.call(
|
|
7
|
-
document.querySelectorAll(`[data-loadcomponent="Tabs"]`),
|
|
8
|
-
(element) => {
|
|
9
|
-
if (!element.dataset.jsProcessed) {
|
|
10
|
-
// eslint-disable-next-line no-console
|
|
11
|
-
new Tabs(element);
|
|
12
|
-
element.dataset.jsProcessed = true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
Array.prototype.forEach.call(
|
|
17
|
-
document.querySelectorAll(`[data-loadcomponent="Tooltip"]`),
|
|
18
|
-
(element) => {
|
|
19
|
-
if (!element.dataset.jsProcessed) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
new Tooltip(element);
|
|
22
|
-
element.dataset.jsProcessed = true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
},
|
|
27
|
-
};
|