@ebrains/components 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components-section.cjs.entry.js +1 -1
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/eds-accordion.cjs.entry.js +2 -2
- package/dist/cjs/eds-alert.cjs.entry.js +2 -2
- package/dist/cjs/{eds-avatar_34.cjs.entry.js → eds-avatar_28.cjs.entry.js} +494 -523
- package/dist/cjs/eds-breadcrumb.cjs.entry.js +145 -0
- package/dist/cjs/eds-card-desc_2.cjs.entry.js +77 -0
- package/dist/cjs/eds-card-generic.cjs.entry.js +92 -0
- package/dist/cjs/eds-card-project.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-tags.cjs.entry.js +1 -1
- package/dist/cjs/eds-card-tool.cjs.entry.js +1 -1
- package/dist/cjs/eds-code-block.cjs.entry.js +1 -1
- package/dist/cjs/eds-gauge.cjs.entry.js +60 -0
- package/dist/cjs/eds-icon-arrow-diagonal.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-arrow-right.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-bluesky.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-bookmark.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-down.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-left.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-right.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-chevron-up.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-close.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-copy.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-eu.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-external.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-facebook.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-gitlab.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-linkedin.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-loader.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-mastodon.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-menu.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-minus.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-more.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-paper.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-plus.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-portal.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-private.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-public.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-search.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-star.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-success.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-thumbs-down.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-thumbs-up.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-tutorial.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-twitter.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-unknown.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-updown.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-user.cjs.entry.js +1 -1
- package/dist/cjs/eds-icon-youtube.cjs.entry.js +1 -1
- package/dist/cjs/eds-pie.cjs.entry.js +106 -0
- package/dist/cjs/eds-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/eds-rating.cjs.entry.js +1 -1
- package/dist/cjs/eds-section-core_2.cjs.entry.js +3 -3
- package/dist/cjs/eds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/eds-switch.cjs.entry.js +2 -2
- package/dist/cjs/eds-tooltip.cjs.entry.js +32 -0
- package/dist/cjs/index-88c8039f.js +28 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/token-spacing.cjs.entry.js +16 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/eds-accordion/eds-accordion.js +2 -2
- package/dist/collection/components/eds-alert/eds-alert.js +2 -2
- package/dist/collection/components/eds-avatar/eds-avatar.js +1 -1
- package/dist/collection/components/eds-block-break/eds-block-break.js +1 -1
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +1 -1
- package/dist/collection/components/eds-button/eds-button.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-project/eds-card-project.js +1 -1
- package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.js +1 -1
- package/dist/collection/components/eds-charts/eds-gauge/eds-gauge.js +1 -1
- package/dist/collection/components/eds-code-block/eds-code-block.js +1 -1
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +2 -2
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-down/eds-icon-chevron-down.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-left/eds-icon-chevron-left.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-right/eds-icon-chevron-right.js +1 -1
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-up/eds-icon-chevron-up.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-arrow-diagonal/eds-icon-arrow-diagonal.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-arrow-right/eds-icon-arrow-right.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-bookmark/eds-icon-bookmark.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-close/eds-icon-close.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-copy/eds-icon-copy.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-eu/eds-icon-eu.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-external/eds-icon-external.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-gitlab/eds-icon-gitlab.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-loader/eds-icon-loader.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-menu/eds-icon-menu.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-minus/eds-icon-minus.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-more/eds-icon-more.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-paper/eds-icon-paper.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-plus/eds-icon-plus.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-portal/eds-icon-portal.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-private/eds-icon-private.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-public/eds-icon-public.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-search/eds-icon-search.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-star/eds-icon-star.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-success/eds-icon-success.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-thumbs-down/eds-icon-thumbs-down.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-thumbs-up/eds-icon-thumbs-up.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-tutorial/eds-icon-tutorial.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-unknown/eds-icon-unknown.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-updown/eds-icon-updown.js +1 -1
- package/dist/collection/components/eds-icons/eds-icon-user/eds-icon-user.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-bluesky/eds-icon-bluesky.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-facebook/eds-icon-facebook.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-linkedin/eds-icon-linkedin.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-mastodon/eds-icon-mastodon.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-twitter/eds-icon-twitter.js +1 -1
- package/dist/collection/components/eds-icons/social/eds-icon-youtube/eds-icon-youtube.js +1 -1
- package/dist/collection/components/eds-img/eds-img.js +2 -2
- package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +2 -2
- package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-range/eds-input-range.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +2 -2
- package/dist/collection/components/eds-input-field/eds-input-field.js +121 -109
- package/dist/collection/components/eds-link/eds-link.js +1 -1
- package/dist/collection/components/eds-logo/eds-logo.js +1 -1
- package/dist/collection/components/eds-modal/eds-modal.js +2 -2
- package/dist/collection/components/eds-pagination/eds-pagination.js +1 -1
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +1 -1
- package/dist/collection/components/eds-rating/eds-rating.js +1 -1
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +1 -1
- package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +2 -2
- package/dist/collection/components/eds-spinner/eds-spinner.js +1 -1
- package/dist/collection/components/eds-switch/eds-switch.js +2 -2
- package/dist/collection/components/eds-table/eds-table.css +5 -0
- package/dist/collection/components/eds-table/eds-table.js +171 -22
- package/dist/collection/eds-docs-ui/components-section/functional/react.js +1 -1
- package/dist/collection/shared-ui/eds-footer/eds-footer.js +2 -2
- package/dist/collection/shared-ui/eds-form/eds-form.js +35 -3
- package/dist/collection/shared-ui/eds-steps/eds-steps.js +2 -2
- package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.css +17 -0
- package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.js +20 -2
- package/dist/collection/shared-ui/eds-user/eds-user.js +1 -1
- package/dist/components/components-section.js +1 -1
- package/dist/components/components.css +7 -0
- package/dist/components/components.esm.js +1 -1
- package/dist/components/eds-accordion2.js +2 -2
- package/dist/components/eds-alert2.js +2 -2
- package/dist/components/eds-avatar2.js +1 -1
- package/dist/components/eds-block-break2.js +1 -1
- package/dist/components/eds-breadcrumb.js +1 -1
- package/dist/components/eds-button2.js +1 -1
- package/dist/components/eds-card-desc2.js +1 -1
- package/dist/components/eds-card-project.js +1 -1
- package/dist/components/eds-card-tags.js +1 -1
- package/dist/components/eds-card-title2.js +1 -1
- package/dist/components/eds-card-tool.js +1 -1
- package/dist/components/eds-code-block2.js +1 -1
- package/dist/components/eds-dropdown2.js +2 -2
- package/dist/components/eds-footer2.js +2 -2
- package/dist/components/eds-form.js +15 -3
- package/dist/components/eds-gauge.js +1 -1
- package/dist/components/eds-icon-arrow-diagonal.js +1 -1
- package/dist/components/eds-icon-arrow-right.js +1 -1
- package/dist/components/eds-icon-bluesky.js +1 -1
- package/dist/components/eds-icon-bookmark.js +1 -1
- package/dist/components/eds-icon-chevron-down.js +1 -1
- package/dist/components/eds-icon-chevron-left.js +1 -1
- package/dist/components/eds-icon-chevron-right.js +1 -1
- package/dist/components/eds-icon-chevron-up.js +1 -1
- package/dist/components/eds-icon-close.js +1 -1
- package/dist/components/eds-icon-copy.js +1 -1
- package/dist/components/eds-icon-eu.js +1 -1
- package/dist/components/eds-icon-external.js +1 -1
- package/dist/components/eds-icon-facebook.js +1 -1
- package/dist/components/eds-icon-gitlab.js +1 -1
- package/dist/components/eds-icon-linkedin.js +1 -1
- package/dist/components/eds-icon-loader.js +1 -1
- package/dist/components/eds-icon-mastodon.js +1 -1
- package/dist/components/eds-icon-menu.js +1 -1
- package/dist/components/eds-icon-minus.js +1 -1
- package/dist/components/eds-icon-more.js +1 -1
- package/dist/components/eds-icon-paper.js +1 -1
- package/dist/components/eds-icon-plus.js +1 -1
- package/dist/components/eds-icon-portal.js +1 -1
- package/dist/components/eds-icon-private.js +1 -1
- package/dist/components/eds-icon-public.js +1 -1
- package/dist/components/eds-icon-search.js +1 -1
- package/dist/components/eds-icon-star.js +1 -1
- package/dist/components/eds-icon-success.js +1 -1
- package/dist/components/eds-icon-thumbs-down.js +1 -1
- package/dist/components/eds-icon-thumbs-up.js +1 -1
- package/dist/components/eds-icon-tutorial.js +1 -1
- package/dist/components/eds-icon-twitter.js +1 -1
- package/dist/components/eds-icon-unknown.js +1 -1
- package/dist/components/eds-icon-updown.js +1 -1
- package/dist/components/eds-icon-user.js +1 -1
- package/dist/components/eds-icon-youtube.js +1 -1
- package/dist/components/eds-img2.js +2 -2
- package/dist/components/eds-input-field2.js +18 -27
- package/dist/components/eds-input-footer2.js +1 -1
- package/dist/components/eds-input-label2.js +1 -1
- package/dist/components/eds-input-range2.js +1 -1
- package/dist/components/eds-input-search2.js +1 -1
- package/dist/components/eds-input-select2.js +2 -2
- package/dist/components/eds-input2.js +2 -2
- package/dist/components/eds-link2.js +1 -1
- package/dist/components/eds-logo2.js +1 -1
- package/dist/components/eds-modal.js +2 -2
- package/dist/components/eds-pagination2.js +1 -1
- package/dist/components/eds-progress-bar2.js +1 -1
- package/dist/components/eds-rating2.js +1 -1
- package/dist/components/eds-section-core2.js +1 -1
- package/dist/components/eds-section-heading2.js +2 -2
- package/dist/components/eds-spinner2.js +1 -1
- package/dist/components/eds-steps-v2.js +5 -3
- package/dist/components/eds-steps2.js +2 -2
- package/dist/components/eds-switch.js +2 -2
- package/dist/components/eds-table2.js +85 -25
- package/dist/components/eds-user.js +1 -1
- package/dist/components/p-023bc47c.entry.js +1 -0
- package/dist/components/p-11efb1d1.entry.js +1 -0
- package/dist/components/p-14679a86.entry.js +1 -0
- package/dist/components/p-158c95bc.entry.js +1 -0
- package/dist/components/p-177103fd.entry.js +1 -0
- package/dist/components/{p-bfc62d3e.entry.js → p-17d39d66.entry.js} +1 -1
- package/dist/components/p-19d586e6.entry.js +1 -0
- package/dist/components/p-1de8401b.entry.js +1 -0
- package/dist/components/{p-8ad05566.entry.js → p-1f5c19b9.entry.js} +1 -1
- package/dist/components/p-233d3577.entry.js +1 -0
- package/dist/components/p-321a950b.entry.js +1 -0
- package/dist/components/p-38c9aee7.entry.js +1 -0
- package/dist/components/p-42295abe.entry.js +1 -0
- package/dist/components/p-424e91b3.entry.js +1 -0
- package/dist/components/p-43cff423.entry.js +1 -0
- package/dist/components/p-45f21238.entry.js +1 -0
- package/dist/components/p-4bdf1589.entry.js +1 -0
- package/dist/components/p-4dcdd4d9.entry.js +1 -0
- package/dist/components/p-4fad9296.entry.js +1 -0
- package/dist/components/p-50f43dfd.entry.js +1 -0
- package/dist/components/p-563d56c0.entry.js +1 -0
- package/dist/components/p-5827fd52.entry.js +1 -0
- package/dist/components/{p-7af6b832.entry.js → p-590fb0e7.entry.js} +1 -1
- package/dist/components/p-5c5dfc4a.entry.js +1 -0
- package/dist/components/p-66f4cdd9.entry.js +1 -0
- package/dist/components/p-6dc6f729.entry.js +1 -0
- package/dist/components/p-6f9ab63c.entry.js +1 -0
- package/dist/components/p-7502b8b4.entry.js +1 -0
- package/dist/components/p-750e3ec8.entry.js +1 -0
- package/dist/components/p-8c0b0121.entry.js +1 -0
- package/dist/components/p-95518776.entry.js +1 -0
- package/dist/components/p-99d9bb29.entry.js +1 -0
- package/dist/components/p-9a4b5746.entry.js +1 -0
- package/dist/components/p-9c823b5e.entry.js +1 -0
- package/dist/components/p-9d64d1fd.entry.js +1 -0
- package/dist/components/p-ab4447f6.entry.js +1 -0
- package/dist/components/p-b073d78f.entry.js +1 -0
- package/dist/components/{p-8b016d76.entry.js → p-b5e64725.entry.js} +1 -1
- package/dist/components/p-b630e51a.entry.js +1 -0
- package/dist/components/p-c91b4eec.entry.js +1 -0
- package/dist/components/{p-0eeddc13.entry.js → p-d05a09df.entry.js} +1 -1
- package/dist/components/{p-84fd3e40.entry.js → p-d0b1e963.entry.js} +1 -1
- package/dist/components/p-d25364db.entry.js +1 -0
- package/dist/components/p-d3bb444a.entry.js +1 -0
- package/dist/components/p-d4f239d7.entry.js +1 -0
- package/dist/components/{p-a81cba86.entry.js → p-deb9bbed.entry.js} +1 -1
- package/dist/components/p-df772a35.entry.js +1 -0
- package/dist/components/p-e5113509.entry.js +1 -0
- package/dist/components/p-e8f0d7fc.entry.js +1 -0
- package/dist/components/{p-abb2ad00.entry.js → p-f189be4f.entry.js} +1 -1
- package/dist/components/p-f221eca2.entry.js +1 -0
- package/dist/components/p-f2416727.entry.js +1 -0
- package/dist/components/{p-50ea5b07.entry.js → p-f7716080.entry.js} +1 -1
- package/dist/components/p-fd85675b.entry.js +1 -0
- package/dist/components/{p-ea97a94e.entry.js → p-fe167c78.entry.js} +2 -2
- package/dist/components/p-ffccfeb6.entry.js +1 -0
- package/dist/esm/components-section.entry.js +1 -1
- package/dist/esm/components.js +1 -1
- package/dist/esm/eds-accordion.entry.js +2 -2
- package/dist/esm/eds-alert.entry.js +2 -2
- package/dist/esm/{eds-avatar_34.entry.js → eds-avatar_28.entry.js} +494 -517
- package/dist/esm/eds-breadcrumb.entry.js +141 -0
- package/dist/esm/eds-card-desc_2.entry.js +72 -0
- package/dist/esm/eds-card-generic.entry.js +88 -0
- package/dist/esm/eds-card-project.entry.js +1 -1
- package/dist/esm/eds-card-tags.entry.js +1 -1
- package/dist/esm/eds-card-tool.entry.js +1 -1
- package/dist/esm/eds-code-block.entry.js +1 -1
- package/dist/esm/eds-gauge.entry.js +56 -0
- package/dist/esm/eds-icon-arrow-diagonal.entry.js +1 -1
- package/dist/esm/eds-icon-arrow-right.entry.js +1 -1
- package/dist/esm/eds-icon-bluesky.entry.js +1 -1
- package/dist/esm/eds-icon-bookmark.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-down.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-left.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-right.entry.js +1 -1
- package/dist/esm/eds-icon-chevron-up.entry.js +1 -1
- package/dist/esm/eds-icon-close.entry.js +1 -1
- package/dist/esm/eds-icon-copy.entry.js +1 -1
- package/dist/esm/eds-icon-eu.entry.js +1 -1
- package/dist/esm/eds-icon-external.entry.js +1 -1
- package/dist/esm/eds-icon-facebook.entry.js +1 -1
- package/dist/esm/eds-icon-gitlab.entry.js +1 -1
- package/dist/esm/eds-icon-linkedin.entry.js +1 -1
- package/dist/esm/eds-icon-loader.entry.js +1 -1
- package/dist/esm/eds-icon-mastodon.entry.js +1 -1
- package/dist/esm/eds-icon-menu.entry.js +1 -1
- package/dist/esm/eds-icon-minus.entry.js +1 -1
- package/dist/esm/eds-icon-more.entry.js +1 -1
- package/dist/esm/eds-icon-paper.entry.js +1 -1
- package/dist/esm/eds-icon-plus.entry.js +1 -1
- package/dist/esm/eds-icon-portal.entry.js +1 -1
- package/dist/esm/eds-icon-private.entry.js +1 -1
- package/dist/esm/eds-icon-public.entry.js +1 -1
- package/dist/esm/eds-icon-search.entry.js +1 -1
- package/dist/esm/eds-icon-star.entry.js +1 -1
- package/dist/esm/eds-icon-success.entry.js +1 -1
- package/dist/esm/eds-icon-thumbs-down.entry.js +1 -1
- package/dist/esm/eds-icon-thumbs-up.entry.js +1 -1
- package/dist/esm/eds-icon-tutorial.entry.js +1 -1
- package/dist/esm/eds-icon-twitter.entry.js +1 -1
- package/dist/esm/eds-icon-unknown.entry.js +1 -1
- package/dist/esm/eds-icon-updown.entry.js +1 -1
- package/dist/esm/eds-icon-user.entry.js +1 -1
- package/dist/esm/eds-icon-youtube.entry.js +1 -1
- package/dist/esm/eds-pie.entry.js +102 -0
- package/dist/esm/eds-progress-bar.entry.js +1 -1
- package/dist/esm/eds-rating.entry.js +1 -1
- package/dist/esm/eds-section-core_2.entry.js +3 -3
- package/dist/esm/eds-spinner.entry.js +1 -1
- package/dist/esm/eds-switch.entry.js +2 -2
- package/dist/esm/eds-tooltip.entry.js +28 -0
- package/dist/esm/index-fdb33359.js +28 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/token-spacing.entry.js +12 -0
- package/dist/hydrate/index.js +201 -148
- package/dist/hydrate/index.mjs +201 -148
- package/dist/types/components/eds-input-field/eds-input-field.d.ts +47 -72
- package/dist/types/components/eds-table/eds-table.d.ts +69 -0
- package/dist/types/components.d.ts +114 -78
- package/dist/types/shared-ui/eds-form/eds-form.d.ts +3 -0
- package/dist/types/shared-ui/eds-steps-v2/eds-steps-v2.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/eds-pagination_2.cjs.entry.js +0 -403
- package/dist/components/p-04b4e9d0.entry.js +0 -1
- package/dist/components/p-0863352c.entry.js +0 -1
- package/dist/components/p-0d6434e1.entry.js +0 -1
- package/dist/components/p-0e94a89f.entry.js +0 -1
- package/dist/components/p-100909ce.entry.js +0 -1
- package/dist/components/p-124b8747.entry.js +0 -1
- package/dist/components/p-14a223fe.entry.js +0 -1
- package/dist/components/p-18ceadd2.entry.js +0 -1
- package/dist/components/p-26d6679b.entry.js +0 -1
- package/dist/components/p-2b1b2026.entry.js +0 -1
- package/dist/components/p-3c642a30.entry.js +0 -1
- package/dist/components/p-46619042.entry.js +0 -1
- package/dist/components/p-511b23ec.entry.js +0 -1
- package/dist/components/p-5462923d.entry.js +0 -1
- package/dist/components/p-6199b8c0.entry.js +0 -1
- package/dist/components/p-624e653e.entry.js +0 -1
- package/dist/components/p-6ba42d02.entry.js +0 -1
- package/dist/components/p-6e929acb.entry.js +0 -1
- package/dist/components/p-6ede7101.entry.js +0 -1
- package/dist/components/p-70bac015.entry.js +0 -1
- package/dist/components/p-822ac246.entry.js +0 -1
- package/dist/components/p-848506b8.entry.js +0 -1
- package/dist/components/p-85634ad2.entry.js +0 -1
- package/dist/components/p-8bdf5841.entry.js +0 -1
- package/dist/components/p-8ff39cef.entry.js +0 -1
- package/dist/components/p-affe2b55.entry.js +0 -1
- package/dist/components/p-b31591db.entry.js +0 -1
- package/dist/components/p-b7efd666.entry.js +0 -1
- package/dist/components/p-ba784274.entry.js +0 -1
- package/dist/components/p-c0b22803.entry.js +0 -1
- package/dist/components/p-cdd491f5.entry.js +0 -1
- package/dist/components/p-d268c96b.entry.js +0 -1
- package/dist/components/p-d437bae2.entry.js +0 -1
- package/dist/components/p-d456e649.entry.js +0 -1
- package/dist/components/p-dae8f66a.entry.js +0 -1
- package/dist/components/p-e1791844.entry.js +0 -1
- package/dist/components/p-e82edd4a.entry.js +0 -1
- package/dist/components/p-e9f608a8.entry.js +0 -1
- package/dist/components/p-f26fd186.entry.js +0 -1
- package/dist/components/p-fe1cba17.entry.js +0 -1
- package/dist/esm/eds-pagination_2.entry.js +0 -398
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-fdb33359.js';
|
|
2
|
-
import { s as sendAnalytics } from './analytics-d99780e3.js';
|
|
3
|
-
import { p as parseData } from './sharedUtils-a550989c.js';
|
|
4
|
-
|
|
5
|
-
const edsPaginationCss = "ul,menu{list-style:none;margin:0;padding:0}.f-ui-03{font-family:var(--f-ui-03-fontFamily);font-weight:var(--f-ui-03-fontWeight);font-size:var(--f-ui-03-fontSize);line-height:var(--f-ui-03-lineHeight);letter-spacing:var(--f-ui-03-letterSpacing)}.f-ui-03-light{font-family:var(--f-ui-03-light-fontFamily);font-weight:var(--f-ui-03-light-fontWeight);font-size:var(--f-ui-03-light-fontSize);line-height:var(--f-ui-03-light-lineHeight);letter-spacing:var(--f-ui-03-light-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.f-ui-02-light{font-family:var(--f-ui-02-light-fontFamily);font-weight:var(--f-ui-02-light-fontWeight);font-size:var(--f-ui-02-light-fontSize);line-height:var(--f-ui-02-light-lineHeight);letter-spacing:var(--f-ui-02-light-letterSpacing)}.text-lightest{color:var(--grey-500)}.mb-28{margin-bottom:1.75rem}.w-full{width:100%}.w-20{width:1.25rem}.h-20{height:1.25rem}.h-28{height:1.75rem}.h-32{height:2rem}.h-36{height:2.25rem}.text-center{text-align:center}.flex{display:flex}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.mr-auto{margin-right:auto}.ml-auto{margin-left:auto}.\\!p-8{padding:0.5rem !important}.ml-4{margin-left:0.25rem}.mr-4{margin-right:0.25rem}.hidden{display:none}.gap-1{gap:0.0625rem}.py-4{padding-top:0.25rem;padding-bottom:0.25rem}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}@media (min-width: 900px){.lg\\:\\!pr-12{padding-right:0.75rem !important}.lg\\:flex{display:flex}}";
|
|
6
|
-
const EdsPaginationStyle0 = edsPaginationCss;
|
|
7
|
-
|
|
8
|
-
const EdsPagination = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.currentPage = undefined;
|
|
12
|
-
this.lastPage = undefined;
|
|
13
|
-
this.perPage = 10;
|
|
14
|
-
this.total = 0;
|
|
15
|
-
this.url = '';
|
|
16
|
-
this.mode = 'default';
|
|
17
|
-
this.prevLabel = 'Prev';
|
|
18
|
-
this.nextLabel = 'Next';
|
|
19
|
-
this.prevUrl = '';
|
|
20
|
-
this.nextUrl = '';
|
|
21
|
-
this.links = [];
|
|
22
|
-
}
|
|
23
|
-
/** Lifecycle hook to generate pagination links on component load */
|
|
24
|
-
componentWillLoad() {
|
|
25
|
-
if (this.mode === 'default') {
|
|
26
|
-
this.generateLinks();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
componentDidLoad() {
|
|
30
|
-
// Emit context for each eds-link element after the component is fully loaded
|
|
31
|
-
const links = this.hostEl.shadowRoot.querySelectorAll('eds-link');
|
|
32
|
-
links.forEach((lnk) => {
|
|
33
|
-
this.emitContext(lnk);
|
|
34
|
-
});
|
|
35
|
-
/*if (links.length > 0) {
|
|
36
|
-
// Emit context for the first link
|
|
37
|
-
this.emitContext(links[0]);
|
|
38
|
-
|
|
39
|
-
// Emit context for the last link, if it's different from the first
|
|
40
|
-
if (links.length > 1) {
|
|
41
|
-
this.emitContext(links[links.length - 1]);
|
|
42
|
-
}
|
|
43
|
-
}*/
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Emits a custom event called `parentContext` for a given link element.
|
|
47
|
-
* This event provides context information about the breadcrumb component.
|
|
48
|
-
*
|
|
49
|
-
* @param linkElement - The link element to which the event will be dispatched.
|
|
50
|
-
*/
|
|
51
|
-
emitContext(linkElement) {
|
|
52
|
-
const event = new CustomEvent('parentContext', {
|
|
53
|
-
detail: {
|
|
54
|
-
componentName: this.hostEl.tagName.toLowerCase(),
|
|
55
|
-
identifier: null
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
linkElement.dispatchEvent(event);
|
|
59
|
-
}
|
|
60
|
-
onPageOrLastPageChange() {
|
|
61
|
-
if (this.mode === 'default') {
|
|
62
|
-
this.generateLinks();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Checks if the current page is the first page
|
|
67
|
-
* @returns {boolean} - true if current page is the first page
|
|
68
|
-
*/
|
|
69
|
-
isFirstPage() {
|
|
70
|
-
return this.currentPage === 1;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Checks if the current page is the last page
|
|
74
|
-
* @returns {boolean} - true if current page is the last page
|
|
75
|
-
*/
|
|
76
|
-
isLastPage() {
|
|
77
|
-
return this.currentPage === this.lastPage;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Generates a pagination link object
|
|
81
|
-
* @param {number} page - Page number for the link
|
|
82
|
-
* @returns {Link} - Link object with page details
|
|
83
|
-
*/
|
|
84
|
-
generateLink(page) {
|
|
85
|
-
const urlHasQuery = this.url.includes('?');
|
|
86
|
-
return {
|
|
87
|
-
ariaLabel: `Page ${page}`,
|
|
88
|
-
url: `${this.url}${urlHasQuery ? '&' : '?'}page=${page}`,
|
|
89
|
-
label: page.toString(),
|
|
90
|
-
current: this.currentPage === page,
|
|
91
|
-
disabled: false
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
/** Generates pagination links based on the last page and current page */
|
|
95
|
-
generateLinks() {
|
|
96
|
-
if (this.lastPage && this.lastPage > 5) {
|
|
97
|
-
this.links = this.getPaginationGenerator(this.currentPage || 1, this.lastPage).map((page) => typeof page === 'number' ? this.generateLink(page) : page);
|
|
98
|
-
}
|
|
99
|
-
else if (this.lastPage) {
|
|
100
|
-
this.links = Array.from({ length: this.lastPage }).map((_, i) => this.generateLink(i + 1));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Creates a pagination range based on delta, current, and total pages
|
|
105
|
-
* @param {number} current - Current page number
|
|
106
|
-
* @param {number} total - Total number of pages
|
|
107
|
-
* @param {number} delta - Range of pages to display around the current page
|
|
108
|
-
* @returns {(number | string)[]} - Range of page numbers or ellipses
|
|
109
|
-
*/
|
|
110
|
-
getPaginationGenerator(current, total) {
|
|
111
|
-
const delta = 1; // Show one page before and one after the current page
|
|
112
|
-
const range = [];
|
|
113
|
-
if (total <= 5) {
|
|
114
|
-
// If total pages are 5 or less, show all pages
|
|
115
|
-
for (let i = 1; i <= total; i++) {
|
|
116
|
-
range.push(i);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
// Always show the first page
|
|
121
|
-
range.push(1);
|
|
122
|
-
// Add ellipsis if there’s a gap between the first page and the current range start
|
|
123
|
-
if (current - delta > 2) {
|
|
124
|
-
range.push('...');
|
|
125
|
-
}
|
|
126
|
-
// Determine range for pages around the current page
|
|
127
|
-
for (let i = Math.max(2, current - delta); i <= Math.min(total - 1, current + delta); i++) {
|
|
128
|
-
range.push(i);
|
|
129
|
-
}
|
|
130
|
-
// Add ellipsis if there’s a gap between the current range end and the last page
|
|
131
|
-
if (current + delta < total - 1) {
|
|
132
|
-
range.push('...');
|
|
133
|
-
}
|
|
134
|
-
// Always show the last page
|
|
135
|
-
range.push(total);
|
|
136
|
-
}
|
|
137
|
-
return range;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Formats the current page results information for display
|
|
141
|
-
* @returns {string} - Formatted page result information
|
|
142
|
-
*/
|
|
143
|
-
pageResults() {
|
|
144
|
-
if (this.total > 0) {
|
|
145
|
-
return this.total > this.perPage
|
|
146
|
-
? `${this.perPage * ((this.currentPage || 1) - 1) + 1} - ${this.perPage * (this.currentPage || 1) >= this.total ? this.total : this.perPage * (this.currentPage || 1)} of ${this.total}`
|
|
147
|
-
: `${this.total}`;
|
|
148
|
-
}
|
|
149
|
-
return '';
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Handles a page click event, updating the current page and dispatching an event
|
|
153
|
-
* @param {MouseEvent} event - Click event
|
|
154
|
-
* @param {number} newPage - New page number
|
|
155
|
-
*/
|
|
156
|
-
handlePageClick(event, newPage) {
|
|
157
|
-
if (this.mode === 'navigator') {
|
|
158
|
-
return; // No page clicking logic for navigator mode
|
|
159
|
-
}
|
|
160
|
-
event.preventDefault(); // Prevent default link navigation
|
|
161
|
-
if (newPage !== this.currentPage) {
|
|
162
|
-
this.links = this.links.map((link) => typeof link === 'object' ? Object.assign(Object.assign({}, link), { current: parseInt(link.label) === newPage }) : link);
|
|
163
|
-
const pageChangeEvent = new CustomEvent('page', {
|
|
164
|
-
detail: newPage,
|
|
165
|
-
bubbles: true,
|
|
166
|
-
composed: true
|
|
167
|
-
});
|
|
168
|
-
this.hostEl.dispatchEvent(pageChangeEvent);
|
|
169
|
-
this.currentPage = newPage;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
render() {
|
|
173
|
-
return (h("div", { key: '1d53f69179791434224f152503c0b81c4cfc7cd3' }, this.total > 0 && this.mode === 'default' && (h("p", { key: '00ae324b49d62a74feee9d1cde21d67cd726ecf0', class: "f-ui-03 text-lightest mb-28 w-full text-center" }, h("span", { key: 'dedf2ce2700eae9d1386b305ec1d1904b133f992', class: "sr-only" }, "Results:"), this.pageResults())), this.mode === 'navigator' || (this.lastPage && this.lastPage > 1) ? (h("nav", { "aria-label": "Pagination" }, h("ul", { class: "flex items-center justify-center gap-x-8" }, h("li", { class: "mr-auto" }, h("eds-link", { label: this.prevLabel, url: this.mode === 'navigator'
|
|
174
|
-
? this.prevUrl || '#' // Use prevUrl if provided, otherwise disable with '#'
|
|
175
|
-
: this.isFirstPage()
|
|
176
|
-
? '#'
|
|
177
|
-
: this.generateLink(this.currentPage - 1).url, disabled: this.mode === 'navigator'
|
|
178
|
-
? !this.prevUrl // Disable if prevUrl is not provided
|
|
179
|
-
: this.isFirstPage(), "aria-label": "Previous page", icon: "chevron-left", "icon-pos": "left", size: "small", "icon-small": "true", intent: "strong", "hide-label-on-small-screen": true, class: "!p-8 lg:!pr-12", onClick: (event) => {
|
|
180
|
-
if (this.mode === 'default') {
|
|
181
|
-
if (this.isFirstPage()) {
|
|
182
|
-
event.preventDefault(); // Prevent click if disabled
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
this.handlePageClick(event, (this.currentPage || 1) - 1);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
} })), this.mode === 'default' &&
|
|
189
|
-
this.links.map((link, index) => (h("li", { key: index, class: "f-ui-02 flex h-36 items-center justify-center" }, typeof link === 'string' ? (h("span", { class: "flex items-center justify-center" }, link)) : (h("eds-link", { url: link.url, "aria-label": link.ariaLabel, label: link.label, current: link.current, size: "small", class: "!p-8", intent: link.current ? 'secondary' : 'ghost', onClick: (event) => this.handlePageClick(event, parseInt(link.label)) }))))), h("li", { class: "ml-auto" }, h("eds-link", { label: this.nextLabel, url: this.mode === 'navigator'
|
|
190
|
-
? this.nextUrl || '#' // Use nextUrl if provided, otherwise disable with '#'
|
|
191
|
-
: this.isLastPage()
|
|
192
|
-
? '#'
|
|
193
|
-
: this.generateLink(this.currentPage + 1).url, disabled: this.mode === 'navigator'
|
|
194
|
-
? !this.nextUrl // Disable if nextUrl is not provided
|
|
195
|
-
: this.isLastPage(), "aria-label": "Next page", size: "small", "icon-small": "true", icon: "chevron-right", intent: "strong", "hide-label-on-small-screen": true, class: "!p-8 lg:!pl-12 flex items-center gap-1 py-4 transition-colors", onClick: (event) => {
|
|
196
|
-
if (this.mode === 'default') {
|
|
197
|
-
if (this.isLastPage()) {
|
|
198
|
-
event.preventDefault(); // Prevent click if disabled
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
this.handlePageClick(event, (this.currentPage || 1) + 1);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
} }))))) : null));
|
|
205
|
-
}
|
|
206
|
-
get hostEl() { return getElement(this); }
|
|
207
|
-
static get watchers() { return {
|
|
208
|
-
"currentPage": ["onPageOrLastPageChange"],
|
|
209
|
-
"lastPage": ["onPageOrLastPageChange"]
|
|
210
|
-
}; }
|
|
211
|
-
};
|
|
212
|
-
EdsPagination.style = EdsPaginationStyle0;
|
|
213
|
-
|
|
214
|
-
const edsTableCss = "table{text-indent:0;border-color:inherit;border-collapse:collapse;}.container{width:calc(var(--container-width, 100%) - (2 * var(--breakout-container-outer-gutter, var(--container-outer-gutter, var(--outer-gutter, 0)))));margin-right:auto;margin-left:auto}.container>*{--container-outer-gutter:0;--breakout-container-outer-gutter:0}.pt-32{padding-top:2rem}.pt-40{padding-top:2.5rem}.pt-48{padding-top:3rem}.pb-28{padding-bottom:1.75rem}.pb-60{padding-bottom:3.75rem}.mt-20{margin-top:1.25rem}.mt-28{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.overflow-x-auto{overflow-x:auto}.mt-6{margin-top:0.375rem}.p-0{padding:0rem}.m-0{margin:0rem}.border{border-width:1px}.border-softer{border:1px solid rgba(0, 0, 0, .1)}.even\\:bg-inverse-softer:nth-child(even){background-color:rgba(255, 255, 255, .15)}.px-20{padding-left:1.25rem;padding-right:1.25rem}.py-8{padding-top:0.5rem;padding-bottom:0.5rem}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.f-ui-02{font-family:var(--f-ui-02-fontFamily);font-weight:var(--f-ui-02-fontWeight);font-size:var(--f-ui-02-fontSize);line-height:var(--f-ui-02-lineHeight);letter-spacing:var(--f-ui-02-letterSpacing)}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.text-center{text-align:center}.break-words{overflow-wrap:anywhere}";
|
|
215
|
-
const EdsTableStyle0 = edsTableCss;
|
|
216
|
-
|
|
217
|
-
const EdsTable = class {
|
|
218
|
-
constructor(hostRef) {
|
|
219
|
-
registerInstance(this, hostRef);
|
|
220
|
-
this.handleResize = () => {
|
|
221
|
-
this.updateContainerWidth();
|
|
222
|
-
};
|
|
223
|
-
this.data = null;
|
|
224
|
-
this.endpoint = null;
|
|
225
|
-
this.config = {};
|
|
226
|
-
this.rowsPerPage = 10;
|
|
227
|
-
this.paginationEnabled = true;
|
|
228
|
-
this.searchEnabled = false;
|
|
229
|
-
this.hostWidth = undefined;
|
|
230
|
-
this.columnSize = 'default';
|
|
231
|
-
this.tbData = [];
|
|
232
|
-
this.columns = [];
|
|
233
|
-
this.currentPage = 1;
|
|
234
|
-
this.parsedConfig = {};
|
|
235
|
-
this.totalRows = 0;
|
|
236
|
-
this.searchQuery = '';
|
|
237
|
-
this.containerWidth = 0;
|
|
238
|
-
}
|
|
239
|
-
handleDataChange() {
|
|
240
|
-
this.parseData();
|
|
241
|
-
}
|
|
242
|
-
handleConfigChange() {
|
|
243
|
-
this.parseConfig();
|
|
244
|
-
}
|
|
245
|
-
componentWillLoad() {
|
|
246
|
-
this.parseConfig();
|
|
247
|
-
this.data ? this.parseData() : this.endpoint && this.fetchData();
|
|
248
|
-
}
|
|
249
|
-
componentDidLoad() {
|
|
250
|
-
this.updateContainerWidth();
|
|
251
|
-
window.addEventListener('resize', this.handleResize);
|
|
252
|
-
this.setupPaginationListener();
|
|
253
|
-
}
|
|
254
|
-
componentDidUpdate() {
|
|
255
|
-
this.setupPaginationListener();
|
|
256
|
-
}
|
|
257
|
-
disconnectedCallback() {
|
|
258
|
-
window.removeEventListener('resize', this.handleResize);
|
|
259
|
-
}
|
|
260
|
-
updateContainerWidth() {
|
|
261
|
-
// Use hostWidth prop if provided; otherwise, measure parent element
|
|
262
|
-
if (this.hostWidth && this.hostWidth.trim() !== '') {
|
|
263
|
-
this.containerWidth = Number(this.hostWidth);
|
|
264
|
-
}
|
|
265
|
-
else if (this.hostEl.parentElement instanceof HTMLElement) {
|
|
266
|
-
this.containerWidth = this.hostEl.parentElement.getBoundingClientRect().width;
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
this.containerWidth = 400;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
parseData() {
|
|
273
|
-
try {
|
|
274
|
-
this.tbData = parseData(this.data);
|
|
275
|
-
//this.tbData = typeof this.data === 'string' ? JSON.parse(this.data) : this.data || [];
|
|
276
|
-
this.totalRows = this.tbData.length;
|
|
277
|
-
this.updateColumns();
|
|
278
|
-
this.currentPage = 1;
|
|
279
|
-
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
// eslint-disable-next-line
|
|
282
|
-
console.error('Failed to parse data:', error);
|
|
283
|
-
this.tbData = [];
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
parseConfig() {
|
|
287
|
-
try {
|
|
288
|
-
//this.parsedConfig = parseData(this.config);
|
|
289
|
-
this.parsedConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;
|
|
290
|
-
}
|
|
291
|
-
catch (error) {
|
|
292
|
-
// eslint-disable-next-line
|
|
293
|
-
console.error('Failed to parse config:', error);
|
|
294
|
-
this.parsedConfig = {};
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
async fetchData() {
|
|
298
|
-
try {
|
|
299
|
-
const response = await fetch(this.endpoint);
|
|
300
|
-
const data = await response.json();
|
|
301
|
-
this.data = data;
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
// eslint-disable-next-line
|
|
305
|
-
console.error('Failed to fetch data:', error);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
setupPaginationListener() {
|
|
309
|
-
if (!this.shouldEnablePagination()) {
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
const paginationEl = this.hostEl.shadowRoot.querySelector('eds-pagination');
|
|
313
|
-
if (paginationEl && !paginationEl.hasAttribute('listener-attached')) {
|
|
314
|
-
paginationEl.addEventListener('page', (event) => this.handlePageChange(event.detail));
|
|
315
|
-
paginationEl.setAttribute('listener-attached', 'true');
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
getFilteredRows() {
|
|
319
|
-
return this.tbData.filter((row) => Object.values(row).some((value) => value.toString().toLowerCase().includes(this.searchQuery.toLowerCase())));
|
|
320
|
-
}
|
|
321
|
-
getPaginatedRows() {
|
|
322
|
-
const filteredRows = this.getFilteredRows();
|
|
323
|
-
this.totalRows = filteredRows.length;
|
|
324
|
-
const start = (this.currentPage - 1) * this.rowsPerPage;
|
|
325
|
-
return filteredRows.slice(start, start + this.rowsPerPage);
|
|
326
|
-
}
|
|
327
|
-
handlePageChange(newPage) {
|
|
328
|
-
this.currentPage = newPage;
|
|
329
|
-
sendAnalytics({
|
|
330
|
-
category: 'ui-component',
|
|
331
|
-
parentContext: null,
|
|
332
|
-
tag: `${this.hostEl.tagName.toLowerCase()}/eds-pagination`,
|
|
333
|
-
name: `${newPage}` || '',
|
|
334
|
-
action: 'page'
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
handleSearch(event) {
|
|
338
|
-
this.searchQuery = event.target.value;
|
|
339
|
-
this.currentPage = 1;
|
|
340
|
-
/*sendAnalytics({
|
|
341
|
-
category: 'ui-component',
|
|
342
|
-
parentContext: null,
|
|
343
|
-
tag: `${this.hostEl.tagName.toLowerCase()}/eds-input-field/search`,
|
|
344
|
-
name: `${this.searchQuery}` || '',
|
|
345
|
-
action: 'page'
|
|
346
|
-
});*/
|
|
347
|
-
}
|
|
348
|
-
renderCell(value, column) {
|
|
349
|
-
var _a;
|
|
350
|
-
const format = (_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.format;
|
|
351
|
-
return format === 'uppercase' ? (value === null || value === void 0 ? void 0 : value.toString().toUpperCase()) : format === 'svg' ? (h("div", { innerHTML: value })) : format === 'bold' ? (h("strong", null, value)) : format === 'code' ? (h("code", null, value)) : (value);
|
|
352
|
-
}
|
|
353
|
-
shouldEnablePagination() {
|
|
354
|
-
return this.paginationEnabled && this.totalRows > this.rowsPerPage;
|
|
355
|
-
}
|
|
356
|
-
updateColumns() {
|
|
357
|
-
this.columns = this.tbData.length > 0 ? Object.keys(this.tbData[0]) : [];
|
|
358
|
-
}
|
|
359
|
-
getVisibleColumnsCount() {
|
|
360
|
-
return this.columns.filter((column) => { var _a; return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden); }).length;
|
|
361
|
-
}
|
|
362
|
-
divisionFactor() {
|
|
363
|
-
let divisionFactor = 1;
|
|
364
|
-
if (this.columnSize === 'medium') {
|
|
365
|
-
divisionFactor = 2;
|
|
366
|
-
}
|
|
367
|
-
else if (this.columnSize === 'large') {
|
|
368
|
-
divisionFactor = 4;
|
|
369
|
-
}
|
|
370
|
-
return divisionFactor;
|
|
371
|
-
}
|
|
372
|
-
render() {
|
|
373
|
-
// Use containerWidth state that is updated on resize.
|
|
374
|
-
const currentContainerWidth = this.hostWidth && this.hostWidth.trim() !== '' ? Number(this.hostWidth) : this.containerWidth || 400;
|
|
375
|
-
// Calculate the number of visible columns and the column width.
|
|
376
|
-
const visibleColumnsCount = this.getVisibleColumnsCount();
|
|
377
|
-
const columnWidth = visibleColumnsCount > 0 ? Math.floor((currentContainerWidth / visibleColumnsCount) * this.divisionFactor()) : 100;
|
|
378
|
-
const paginatedRows = this.getPaginatedRows();
|
|
379
|
-
const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
|
|
380
|
-
return (h("div", { key: '81735ac374853c8c92b3f50e26263ff9d71b326c' }, this.searchEnabled && (h("div", { key: '0b2ab8dbb343033f605e2028890bd963cd650998' }, h("eds-input-field", { key: 1, name: "search", "aria-label": "Search", type: "text", placeholder: "Search...",
|
|
381
|
-
// @ts-ignore
|
|
382
|
-
onInput: (event) => this.handleSearch(event) }))), h("div", { key: 'eb3eebe6fb124d4e1983b2fb7e636707817d36bd', class: "mt-20" }, h("table", { key: '03b312ac20bdec28843a46907a3cc4fba69f62ae', class: "block overflow-x-auto mt-6 p-0" }, h("thead", { key: 'ccab58dc46ae765df28da97ded6b1dd14d45d7f1' }, h("tr", { key: '904a125aad610cebe42b0bce46615be38f0ee17a', class: "m-0 p-0 border border-softer even:bg-inverse-softer" }, this.columns.map((column) => {
|
|
383
|
-
var _a;
|
|
384
|
-
return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && (h("th", { class: "m-0 py-8 border border-softer f-ui-02 break-words", style: { minWidth: `${columnWidth - 4}px` } }, column));
|
|
385
|
-
}))), h("tbody", { key: 'a4c54c9c89d15546020dbb684e5486decde33f30' }, paginatedRows.map((row) => (h("tr", { class: "m-0 p-0 border border-softer even:bg-inverse-softer" }, this.columns.map((column) => {
|
|
386
|
-
var _a;
|
|
387
|
-
return !((_a = this.parsedConfig[column]) === null || _a === void 0 ? void 0 : _a.hidden) && (h("td", { class: "text-center border border-softer m-0 py-8 f-ui-2 break-words", style: { minWidth: `${columnWidth - 4}px` } }, this.renderCell(row[column], column)));
|
|
388
|
-
}))))))), this.shouldEnablePagination() && (h("div", { key: '2a248cbbe81ac8c1ad4dfbb49a9615f15931bac6', class: "mt-20" }, h("eds-pagination", { key: '11701d81922ca4c8b36fe82be32316a175eddbcd', currentPage: this.currentPage, lastPage: lastPage, perPage: this.rowsPerPage, total: this.totalRows, mode: "default" })))));
|
|
389
|
-
}
|
|
390
|
-
get hostEl() { return getElement(this); }
|
|
391
|
-
static get watchers() { return {
|
|
392
|
-
"data": ["handleDataChange", "parseData"],
|
|
393
|
-
"config": ["handleConfigChange"]
|
|
394
|
-
}; }
|
|
395
|
-
};
|
|
396
|
-
EdsTable.style = EdsTableStyle0;
|
|
397
|
-
|
|
398
|
-
export { EdsPagination as eds_pagination, EdsTable as eds_table };
|