@ukic/web-components 2.11.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-56e80cc9.js → helpers-81e0057b.js} +44 -3
- package/dist/cjs/helpers-81e0057b.js.map +1 -0
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +3 -3
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +2 -2
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +33 -4
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +3 -2
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +4 -2
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +10 -4
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +7 -5
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +48 -11
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ic-alert/ic-alert.css +0 -1
- package/dist/collection/components/ic-alert/ic-alert.js +1 -1
- package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
- package/dist/collection/components/ic-badge/ic-badge.js +1 -1
- package/dist/collection/components/ic-badge/ic-badge.js.map +1 -1
- package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js +7 -0
- package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.js +143 -3
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js +6 -5
- package/dist/collection/components/ic-button/test/basic/ic-button.spec.js.map +1 -1
- package/dist/collection/components/ic-card/ic-card.js +5 -4
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.css +1 -1
- package/dist/collection/components/ic-dialog/ic-dialog.js +20 -0
- package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
- package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js +8 -0
- package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js.map +1 -1
- package/dist/collection/components/ic-footer/ic-footer.js +1 -1
- package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
- package/dist/collection/components/ic-footer-link/ic-footer-link.css +2 -3
- package/dist/collection/components/ic-pagination/test/a11y/ic-pagination.test.a11y.js +8 -1
- package/dist/collection/components/ic-pagination/test/a11y/ic-pagination.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +9 -3
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/test/basic/ic-popover-menu.spec.js +3 -0
- package/dist/collection/components/ic-popover-menu/test/basic/ic-popover-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-search-bar/test/a11y/ic-search-bar.test.a11y.js +8 -1
- package/dist/collection/components/ic-search-bar/test/a11y/ic-search-bar.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +10 -5
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js +87 -11
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js +20 -0
- package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/utils/helpers.js +42 -2
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +43 -3
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-alert2.js +2 -2
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-back-to-top.js +1 -1
- package/dist/components/ic-badge.js +2 -2
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js +1 -1
- package/dist/components/ic-breadcrumb2.js +1 -1
- package/dist/components/ic-button2.js +37 -3
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js +3 -2
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +1 -1
- package/dist/components/ic-checkbox.js +1 -1
- package/dist/components/ic-chip.js +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-dialog.js +5 -2
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link.js +2 -2
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +2 -2
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +1 -1
- package/dist/components/ic-horizontal-scroll2.js +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-label2.js +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-loading-indicator2.js +1 -1
- package/dist/components/ic-menu-group.js +1 -1
- package/dist/components/ic-menu-item2.js +1 -1
- package/dist/components/ic-navigation-button.js +1 -1
- package/dist/components/ic-navigation-group.js +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-page-header.js +1 -1
- package/dist/components/ic-pagination-item2.js +1 -1
- package/dist/components/ic-pagination.js +1 -1
- package/dist/components/ic-popover-menu.js +10 -4
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-select.js +1 -1
- package/dist/components/ic-side-navigation.js +10 -6
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-step.js +1 -1
- package/dist/components/ic-stepper.js +1 -1
- package/dist/components/ic-switch.js +1 -1
- package/dist/components/ic-tab-panel.js +1 -1
- package/dist/components/ic-tab.js +1 -1
- package/dist/components/ic-text-field2.js +53 -11
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-toggle-button.js +1 -1
- package/dist/components/ic-tooltip2.js +1 -1
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-59c4bc0a.entry.js → p-0df94b9d.entry.js} +2 -2
- package/dist/core/{p-171e25c9.entry.js → p-10448c8d.entry.js} +2 -2
- package/dist/core/p-231a7230.entry.js +2 -0
- package/dist/core/p-231a7230.entry.js.map +1 -0
- package/dist/core/{p-eb2d06c1.entry.js → p-263da6f8.entry.js} +2 -2
- package/dist/core/{p-4f8b7aa3.entry.js → p-2db45025.entry.js} +2 -2
- package/dist/core/{p-5adaf5c3.entry.js → p-2fbb52cd.entry.js} +2 -2
- package/dist/core/{p-5adaf5c3.entry.js.map → p-2fbb52cd.entry.js.map} +1 -1
- package/dist/core/{p-3c752bca.entry.js → p-3784f352.entry.js} +2 -2
- package/dist/core/{p-bb41b637.entry.js → p-42f5f86d.entry.js} +2 -2
- package/dist/core/{p-26334b3a.entry.js → p-45fb7128.entry.js} +2 -2
- package/dist/core/{p-7c724f2c.entry.js → p-4cf909ad.entry.js} +2 -2
- package/dist/core/{p-0a0b748c.entry.js → p-4ece659b.entry.js} +2 -2
- package/dist/core/{p-c786d62f.entry.js → p-50df74fb.entry.js} +2 -2
- package/dist/core/{p-c786d62f.entry.js.map → p-50df74fb.entry.js.map} +1 -1
- package/dist/core/p-56c41889.entry.js +2 -0
- package/dist/core/p-56c41889.entry.js.map +1 -0
- package/dist/core/{p-c1109ec7.entry.js → p-573322c6.entry.js} +2 -2
- package/dist/core/{p-d3e54a29.entry.js → p-584f15f9.entry.js} +2 -2
- package/dist/core/{p-42c0e318.entry.js → p-596c702b.entry.js} +2 -2
- package/dist/core/{p-1e809ecd.entry.js → p-5a243837.entry.js} +2 -2
- package/dist/core/{p-003c44bd.entry.js → p-5bbbb507.entry.js} +2 -2
- package/dist/core/{p-b74f92b6.entry.js → p-5bce919a.entry.js} +2 -2
- package/dist/core/{p-f9452975.entry.js → p-6724e9fd.entry.js} +2 -2
- package/dist/core/p-6724e9fd.entry.js.map +1 -0
- package/dist/core/{p-8f97463f.entry.js → p-7384a191.entry.js} +2 -2
- package/dist/core/{p-8be3ec3d.entry.js → p-77a9c4fd.entry.js} +2 -2
- package/dist/core/{p-3f07c471.entry.js → p-77b56204.entry.js} +2 -2
- package/dist/core/{p-6bbe0550.entry.js → p-792d194d.entry.js} +2 -2
- package/dist/core/p-7a62bb2f.entry.js +2 -0
- package/dist/core/p-7a62bb2f.entry.js.map +1 -0
- package/dist/core/{p-c75d6022.entry.js → p-7ef4f806.entry.js} +2 -2
- package/dist/core/{p-0ee13da0.entry.js → p-83f58174.entry.js} +2 -2
- package/dist/core/{p-8c2322a9.entry.js → p-85601b9f.entry.js} +2 -2
- package/dist/core/{p-29b812c0.entry.js → p-87933302.entry.js} +2 -2
- package/dist/core/{p-c7a08024.entry.js → p-881be3d5.entry.js} +2 -2
- package/dist/core/{p-525323ab.entry.js → p-898a35c5.entry.js} +2 -2
- package/dist/core/{p-0d2eb765.entry.js → p-89a4057e.entry.js} +2 -2
- package/dist/core/{p-357eaebe.entry.js → p-8b9d5e1f.entry.js} +2 -2
- package/dist/core/p-8b9d5e1f.entry.js.map +1 -0
- package/dist/core/{p-e4d827d4.entry.js → p-8c0f0a88.entry.js} +2 -2
- package/dist/core/{p-22208df0.entry.js → p-8c55b011.entry.js} +2 -2
- package/dist/core/p-8c55b011.entry.js.map +1 -0
- package/dist/core/{p-8a66cab4.entry.js → p-911592a7.entry.js} +2 -2
- package/dist/core/{p-9184e385.entry.js → p-9c835bd7.entry.js} +2 -2
- package/dist/core/{p-9b8ab047.entry.js → p-9d66dd4c.entry.js} +2 -2
- package/dist/core/p-9d66dd4c.entry.js.map +1 -0
- package/dist/core/{p-3ebe5fa3.entry.js → p-a741d16f.entry.js} +2 -2
- package/dist/core/p-b34eb829.js +2 -0
- package/dist/core/p-b34eb829.js.map +1 -0
- package/dist/core/{p-4f1792a6.entry.js → p-b723f883.entry.js} +2 -2
- package/dist/core/{p-783c2ced.entry.js → p-bfbf4c5b.entry.js} +2 -2
- package/dist/core/{p-049bf5e3.entry.js → p-c0e003dc.entry.js} +2 -2
- package/dist/core/{p-5894f6aa.entry.js → p-c5e71983.entry.js} +2 -2
- package/dist/core/p-c5e71983.entry.js.map +1 -0
- package/dist/core/{p-9ee138e7.entry.js → p-c73081df.entry.js} +2 -2
- package/dist/core/{p-0713230f.entry.js → p-d01d69a3.entry.js} +2 -2
- package/dist/core/{p-2e7f22af.entry.js → p-d3059083.entry.js} +2 -2
- package/dist/core/{p-38bf02aa.entry.js → p-dae0cfd0.entry.js} +2 -2
- package/dist/core/{p-bf93455b.entry.js → p-daf7e227.entry.js} +2 -2
- package/dist/core/{p-de87d585.entry.js → p-dce01eea.entry.js} +2 -2
- package/dist/core/{p-9808f7c9.entry.js → p-e8d77f95.entry.js} +2 -2
- package/dist/core/{p-8146336b.entry.js → p-eadb62d5.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-821dcdf2.js → helpers-5c2846f4.js} +44 -4
- package/dist/esm/helpers-5c2846f4.js.map +1 -0
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +3 -3
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +2 -2
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +33 -4
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +3 -2
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +4 -2
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +2 -2
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination.entry.js +1 -1
- package/dist/esm/ic-popover-menu.entry.js +10 -4
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js +7 -5
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js +48 -11
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-button/ic-button.d.ts +26 -0
- package/dist/types/components/ic-card/ic-card.d.ts +2 -2
- package/dist/types/components/ic-dialog/ic-dialog.d.ts +4 -0
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +4 -0
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +2 -1
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +13 -0
- package/dist/types/components.d.ts +75 -6
- package/dist/types/utils/helpers.d.ts +15 -0
- package/hydrate/index.js +157 -29
- package/package.json +4 -2
- package/vscode-data.json +31 -3
- package/dist/cjs/helpers-56e80cc9.js.map +0 -1
- package/dist/collection/components/ic-card/test/a11y/ic-card.test.a11y.js +0 -21
- package/dist/collection/components/ic-card/test/a11y/ic-card.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-card/test/basic/ic-card.e2e.js +0 -23
- package/dist/collection/components/ic-card/test/basic/ic-card.e2e.js.map +0 -1
- package/dist/collection/components/ic-chip/test/a11y/ic-chip.test.a11y.js +0 -11
- package/dist/collection/components/ic-chip/test/a11y/ic-chip.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-data-entity/test/a11y/ic-data-entity.test.a11y.js +0 -11
- package/dist/collection/components/ic-data-entity/test/a11y/ic-data-entity.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.js +0 -38
- package/dist/collection/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-empty-state/test/basic/ic-empty-state.spec.js +0 -86
- package/dist/collection/components/ic-empty-state/test/basic/ic-empty-state.spec.js.map +0 -1
- package/dist/collection/components/ic-footer/test/a11y/ic-footer.test.a11y.js +0 -23
- package/dist/collection/components/ic-footer/test/a11y/ic-footer.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-footer/test/basic/ic-footer.e2e.js +0 -50
- package/dist/collection/components/ic-footer/test/basic/ic-footer.e2e.js.map +0 -1
- package/dist/collection/components/ic-footer-link/test/a11y/ic-footer-link.test.a11y.js +0 -21
- package/dist/collection/components/ic-footer-link/test/a11y/ic-footer-link.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-footer-link-group/test/a11y/ic-footer-link-group.test.a11y.js +0 -21
- package/dist/collection/components/ic-footer-link-group/test/a11y/ic-footer-link-group.test.a11y.js.map +0 -1
- package/dist/collection/components/ic-link/test/a11y/ic-link.test.a11y.js +0 -11
- package/dist/collection/components/ic-link/test/a11y/ic-link.test.a11y.js.map +0 -1
- package/dist/core/p-22208df0.entry.js.map +0 -1
- package/dist/core/p-357eaebe.entry.js.map +0 -1
- package/dist/core/p-5894f6aa.entry.js.map +0 -1
- package/dist/core/p-671b7cac.js +0 -2
- package/dist/core/p-671b7cac.js.map +0 -1
- package/dist/core/p-8931210a.entry.js +0 -2
- package/dist/core/p-8931210a.entry.js.map +0 -1
- package/dist/core/p-9b8ab047.entry.js.map +0 -1
- package/dist/core/p-a6143c94.entry.js +0 -2
- package/dist/core/p-a6143c94.entry.js.map +0 -1
- package/dist/core/p-f62982ae.entry.js +0 -2
- package/dist/core/p-f62982ae.entry.js.map +0 -1
- package/dist/core/p-f9452975.entry.js.map +0 -1
- package/dist/esm/helpers-821dcdf2.js.map +0 -1
- package/dist/types/components/ic-card/test/a11y/ic-card.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-chip/test/a11y/ic-chip.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-data-entity/test/a11y/ic-data-entity.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-empty-state/test/a11y/ic-empty-state.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-footer/test/a11y/ic-footer.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-footer-link/test/a11y/ic-footer-link.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-footer-link-group/test/a11y/ic-footer-link-group.test.a11y.d.ts +0 -1
- package/dist/types/components/ic-link/test/a11y/ic-link.test.a11y.d.ts +0 -1
- /package/dist/core/{p-59c4bc0a.entry.js.map → p-0df94b9d.entry.js.map} +0 -0
- /package/dist/core/{p-171e25c9.entry.js.map → p-10448c8d.entry.js.map} +0 -0
- /package/dist/core/{p-eb2d06c1.entry.js.map → p-263da6f8.entry.js.map} +0 -0
- /package/dist/core/{p-4f8b7aa3.entry.js.map → p-2db45025.entry.js.map} +0 -0
- /package/dist/core/{p-3c752bca.entry.js.map → p-3784f352.entry.js.map} +0 -0
- /package/dist/core/{p-bb41b637.entry.js.map → p-42f5f86d.entry.js.map} +0 -0
- /package/dist/core/{p-26334b3a.entry.js.map → p-45fb7128.entry.js.map} +0 -0
- /package/dist/core/{p-7c724f2c.entry.js.map → p-4cf909ad.entry.js.map} +0 -0
- /package/dist/core/{p-0a0b748c.entry.js.map → p-4ece659b.entry.js.map} +0 -0
- /package/dist/core/{p-c1109ec7.entry.js.map → p-573322c6.entry.js.map} +0 -0
- /package/dist/core/{p-d3e54a29.entry.js.map → p-584f15f9.entry.js.map} +0 -0
- /package/dist/core/{p-42c0e318.entry.js.map → p-596c702b.entry.js.map} +0 -0
- /package/dist/core/{p-1e809ecd.entry.js.map → p-5a243837.entry.js.map} +0 -0
- /package/dist/core/{p-003c44bd.entry.js.map → p-5bbbb507.entry.js.map} +0 -0
- /package/dist/core/{p-b74f92b6.entry.js.map → p-5bce919a.entry.js.map} +0 -0
- /package/dist/core/{p-8f97463f.entry.js.map → p-7384a191.entry.js.map} +0 -0
- /package/dist/core/{p-8be3ec3d.entry.js.map → p-77a9c4fd.entry.js.map} +0 -0
- /package/dist/core/{p-3f07c471.entry.js.map → p-77b56204.entry.js.map} +0 -0
- /package/dist/core/{p-6bbe0550.entry.js.map → p-792d194d.entry.js.map} +0 -0
- /package/dist/core/{p-c75d6022.entry.js.map → p-7ef4f806.entry.js.map} +0 -0
- /package/dist/core/{p-0ee13da0.entry.js.map → p-83f58174.entry.js.map} +0 -0
- /package/dist/core/{p-8c2322a9.entry.js.map → p-85601b9f.entry.js.map} +0 -0
- /package/dist/core/{p-29b812c0.entry.js.map → p-87933302.entry.js.map} +0 -0
- /package/dist/core/{p-c7a08024.entry.js.map → p-881be3d5.entry.js.map} +0 -0
- /package/dist/core/{p-525323ab.entry.js.map → p-898a35c5.entry.js.map} +0 -0
- /package/dist/core/{p-0d2eb765.entry.js.map → p-89a4057e.entry.js.map} +0 -0
- /package/dist/core/{p-e4d827d4.entry.js.map → p-8c0f0a88.entry.js.map} +0 -0
- /package/dist/core/{p-8a66cab4.entry.js.map → p-911592a7.entry.js.map} +0 -0
- /package/dist/core/{p-9184e385.entry.js.map → p-9c835bd7.entry.js.map} +0 -0
- /package/dist/core/{p-3ebe5fa3.entry.js.map → p-a741d16f.entry.js.map} +0 -0
- /package/dist/core/{p-4f1792a6.entry.js.map → p-b723f883.entry.js.map} +0 -0
- /package/dist/core/{p-783c2ced.entry.js.map → p-bfbf4c5b.entry.js.map} +0 -0
- /package/dist/core/{p-049bf5e3.entry.js.map → p-c0e003dc.entry.js.map} +0 -0
- /package/dist/core/{p-9ee138e7.entry.js.map → p-c73081df.entry.js.map} +0 -0
- /package/dist/core/{p-0713230f.entry.js.map → p-d01d69a3.entry.js.map} +0 -0
- /package/dist/core/{p-2e7f22af.entry.js.map → p-d3059083.entry.js.map} +0 -0
- /package/dist/core/{p-38bf02aa.entry.js.map → p-dae0cfd0.entry.js.map} +0 -0
- /package/dist/core/{p-bf93455b.entry.js.map → p-daf7e227.entry.js.map} +0 -0
- /package/dist/core/{p-de87d585.entry.js.map → p-dce01eea.entry.js.map} +0 -0
- /package/dist/core/{p-9808f7c9.entry.js.map → p-e8d77f95.entry.js.map} +0 -0
- /package/dist/core/{p-8146336b.entry.js.map → p-eadb62d5.entry.js.map} +0 -0
@@ -255,5 +255,12 @@ describe("ic-badge", () => {
|
|
255
255
|
});
|
256
256
|
expect(page.rootInstance.getTextLabel()).toBe("9+");
|
257
257
|
});
|
258
|
+
it("should render with id set", async () => {
|
259
|
+
const page = await newSpecPage({
|
260
|
+
components: [Button, Badge],
|
261
|
+
html: `<ic-button>Button<ic-badge slot="badge" id="badge-1" text-label="1"/></ic-button>`,
|
262
|
+
});
|
263
|
+
expect(page.root).toMatchSnapshot("should render with id");
|
264
|
+
});
|
258
265
|
});
|
259
266
|
//# sourceMappingURL=ic-badge.spec.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-badge.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-badge/test/basic/ic-badge.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAEhF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YAC3B,IAAI,EAAE,sEAAsE;SAC7E,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAC/B,6CAA6C,CAC9C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YAC3B,IAAI,EAAE,sFAAsF;SAC7F,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI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WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,8GAA8G;SACrH,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,CAAC;QAE7C,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;QACxE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,uFAAuF;SAC9F,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Badge } from \"../../ic-badge\";\nimport { Button } from \"../../../ic-button/ic-button\";\nimport { Chip } from \"../../../ic-chip/ic-chip\";\nimport { Tab } from \"../../../ic-tab/ic-tab\";\nimport { Card } from \"../../../ic-card/ic-card\";\nimport { NavigationButton } from \"../../../ic-navigation-button/ic-navigation-button\";\nimport { NavigationItem } from \"../../../ic-navigation-item/ic-navigation-item\";\n\ndescribe(\"ic-badge\", () => {\n it(\"should render with text slotted in a button\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render with text slotted in a button\"\n );\n });\n\n it(\"should render light variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"light\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render light variant\");\n });\n\n it(\"should render error variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"error\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render error variant\");\n });\n\n it(\"should render success variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"success\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render success variant\");\n });\n\n it(\"should render warning variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"warning\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render warning variant\");\n });\n it(\"should render info variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"info\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render info variant\");\n });\n\n it(\"should render custom variant with custom colour in hex\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render custom variant with custom colour in hex\"\n );\n });\n\n it(\"should render custom variant with custom colour in rgb\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"rgb(248,200,220)\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render custom variant with custom colour in rgb\"\n );\n });\n\n it(\"should render with max number prop set\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" max-number=\"9\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with max number prop set\");\n });\n\n it(\"should render with accessible label\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\" accessible-label=\"1 notification found\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with accessible label\");\n });\n\n it(\"should render size small\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" size=\"small\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render size small\");\n });\n\n it(\"should render size large\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" size=\"large\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render size large\");\n });\n\n it(\"should render type dot\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" type=\"dot\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render type dot\");\n });\n\n it(\"should render type icon\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" type=\"icon\">\n <svg slot='badge-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n </ic-badge></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render type icon\");\n });\n\n it(\"should render with visible false\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" visible=\"false\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with visible false\");\n });\n\n it(\"should render slotted in a chip\", async () => {\n const page = await newSpecPage({\n components: [Chip, Badge],\n html: `<ic-chip label=\"Badge\"><ic-badge slot=\"badge\" text-label=\"1\" position=\"near\"/></ic-chip>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a chip\");\n });\n\n it(\"should render slotted in a tab\", async () => {\n const page = await newSpecPage({\n components: [Tab, Badge],\n html: `<ic-tab>Tab<ic-badge slot=\"badge\" text-label=\"1\" position=\"inline\"/></ic-tab>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a tab\");\n });\n\n it(\"should render slotted in a card\", async () => {\n const page = await newSpecPage({\n components: [Card, Badge],\n html: `<ic-card heading=\"Badge\"><ic-badge slot=\"badge\" text-label=\"1\" position=\"near\"/></ic-card>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a card\");\n });\n\n it(\"should render slotted in a navigation button\", async () => {\n const page = await newSpecPage({\n components: [NavigationButton, Badge],\n html: `<ic-navigation-button\n label=\"Button One\"\n slot=\"buttons\"\n href=\"https://www.google.com\"\n target=\"_blank\"\n title=\"Google 1\"\n >\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z\"\n />\n </svg>\n <ic-badge\n text-label=\"1\"\n slot=\"badge\"\n position=\"near\"\n variant=\"light\"\n ></ic-badge>\n </ic-navigation-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render slotted in a navigation button\"\n );\n });\n\n it(\"should render slotted in a navigation item\", async () => {\n const page = await newSpecPage({\n components: [NavigationItem, Badge],\n html: `<ic-navigation-item label=\"Navigation\" href=\"/\">\n <ic-badge\n text-label=\"1\"\n slot=\"badge\"\n variant=\"light\"\n position=\"far\"\n ></ic-badge>\n <svg\n slot=\"icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M23 8C23 9.1 22.1 10 21 10C20.82 10 20.65 9.98 20.49 9.93L16.93 13.48C16.98 13.64 17 13.82 17 14C17 15.1 16.1 16 15 16C13.9 16 13 15.1 13 14C13 13.82 13.02 13.64 13.07 13.48L10.52 10.93C10.36 10.98 10.18 11 10 11C9.82 11 9.64 10.98 9.48 10.93L4.93 15.49C4.98 15.65 5 15.82 5 16C5 17.1 4.1 18 3 18C1.9 18 1 17.1 1 16C1 14.9 1.9 14 3 14C3.18 14 3.35 14.02 3.51 14.07L8.07 9.52C8.02 9.36 8 9.18 8 9C8 7.9 8.9 7 10 7C11.1 7 12 7.9 12 9C12 9.18 11.98 9.36 11.93 9.52L14.48 12.07C14.64 12.02 14.82 12 15 12C15.18 12 15.36 12.02 15.52 12.07L19.07 8.51C19.02 8.35 19 8.18 19 8C19 6.9 19.9 6 21 6C22.1 6 23 6.9 23 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n </ic-navigation-item>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render slotted in a navigation item\"\n );\n });\n\n it(\"should hide and show the badge using visible prop\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n const badge = document.querySelector(\"ic-badge\");\n\n expect(page.rootInstance.visible).toBe(true);\n\n badge.visible = false;\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(false);\n\n badge.visible = true;\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(true);\n });\n\n //To be removed when we remove show and hide methods\n it(\"should hide and show the badge using methods\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n const badge = document.querySelector(\"ic-badge\");\n\n expect(page.rootInstance.visible).toBe(true);\n\n await badge.hideBadge();\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(false);\n\n await badge.showBadge();\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(true);\n });\n\n it(\"should set the correct badge colour\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n await page.rootInstance.setBadgeColour();\n\n expect(page.rootInstance.customColorRGBA).toEqual({\n a: 1,\n b: 220,\n g: 200,\n r: 248,\n });\n });\n\n it(\"should set the correct foreground colour\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n await page.rootInstance.getBadgeForeground();\n\n expect(page.rootInstance.foregroundColour).toBe(\"dark\");\n });\n\n it(\"should set the correct text label when max number is set\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" max-number=\"9\"/></ic-button>`,\n });\n\n expect(page.rootInstance.getTextLabel()).toBe(\"9+\");\n });\n});\n"]}
|
1
|
+
{"version":3,"file":"ic-badge.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-badge/test/basic/ic-badge.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,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CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YAC3B,IAAI,EAAE,mFAAmF;SAC1F,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Badge } from \"../../ic-badge\";\nimport { Button } from \"../../../ic-button/ic-button\";\nimport { Chip } from \"../../../ic-chip/ic-chip\";\nimport { Tab } from \"../../../ic-tab/ic-tab\";\nimport { Card } from \"../../../ic-card/ic-card\";\nimport { NavigationButton } from \"../../../ic-navigation-button/ic-navigation-button\";\nimport { NavigationItem } from \"../../../ic-navigation-item/ic-navigation-item\";\n\ndescribe(\"ic-badge\", () => {\n it(\"should render with text slotted in a button\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render with text slotted in a button\"\n );\n });\n\n it(\"should render light variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"light\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render light variant\");\n });\n\n it(\"should render error variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"error\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render error variant\");\n });\n\n it(\"should render success variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"success\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render success variant\");\n });\n\n it(\"should render warning variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"warning\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render warning variant\");\n });\n it(\"should render info variant\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"info\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render info variant\");\n });\n\n it(\"should render custom variant with custom colour in hex\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render custom variant with custom colour in hex\"\n );\n });\n\n it(\"should render custom variant with custom colour in rgb\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"rgb(248,200,220)\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render custom variant with custom colour in rgb\"\n );\n });\n\n it(\"should render with max number prop set\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" max-number=\"9\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with max number prop set\");\n });\n\n it(\"should render with accessible label\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\" accessible-label=\"1 notification found\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with accessible label\");\n });\n\n it(\"should render size small\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" size=\"small\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render size small\");\n });\n\n it(\"should render size large\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" size=\"large\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render size large\");\n });\n\n it(\"should render type dot\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" type=\"dot\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render type dot\");\n });\n\n it(\"should render type icon\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" type=\"icon\">\n <svg slot='badge-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n </ic-badge></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render type icon\");\n });\n\n it(\"should render with visible false\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" visible=\"false\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with visible false\");\n });\n\n it(\"should render slotted in a chip\", async () => {\n const page = await newSpecPage({\n components: [Chip, Badge],\n html: `<ic-chip label=\"Badge\"><ic-badge slot=\"badge\" text-label=\"1\" position=\"near\"/></ic-chip>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a chip\");\n });\n\n it(\"should render slotted in a tab\", async () => {\n const page = await newSpecPage({\n components: [Tab, Badge],\n html: `<ic-tab>Tab<ic-badge slot=\"badge\" text-label=\"1\" position=\"inline\"/></ic-tab>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a tab\");\n });\n\n it(\"should render slotted in a card\", async () => {\n const page = await newSpecPage({\n components: [Card, Badge],\n html: `<ic-card heading=\"Badge\"><ic-badge slot=\"badge\" text-label=\"1\" position=\"near\"/></ic-card>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render slotted in a card\");\n });\n\n it(\"should render slotted in a navigation button\", async () => {\n const page = await newSpecPage({\n components: [NavigationButton, Badge],\n html: `<ic-navigation-button\n label=\"Button One\"\n slot=\"buttons\"\n href=\"https://www.google.com\"\n target=\"_blank\"\n title=\"Google 1\"\n >\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z\"\n />\n </svg>\n <ic-badge\n text-label=\"1\"\n slot=\"badge\"\n position=\"near\"\n variant=\"light\"\n ></ic-badge>\n </ic-navigation-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render slotted in a navigation button\"\n );\n });\n\n it(\"should render slotted in a navigation item\", async () => {\n const page = await newSpecPage({\n components: [NavigationItem, Badge],\n html: `<ic-navigation-item label=\"Navigation\" href=\"/\">\n <ic-badge\n text-label=\"1\"\n slot=\"badge\"\n variant=\"light\"\n position=\"far\"\n ></ic-badge>\n <svg\n slot=\"icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M23 8C23 9.1 22.1 10 21 10C20.82 10 20.65 9.98 20.49 9.93L16.93 13.48C16.98 13.64 17 13.82 17 14C17 15.1 16.1 16 15 16C13.9 16 13 15.1 13 14C13 13.82 13.02 13.64 13.07 13.48L10.52 10.93C10.36 10.98 10.18 11 10 11C9.82 11 9.64 10.98 9.48 10.93L4.93 15.49C4.98 15.65 5 15.82 5 16C5 17.1 4.1 18 3 18C1.9 18 1 17.1 1 16C1 14.9 1.9 14 3 14C3.18 14 3.35 14.02 3.51 14.07L8.07 9.52C8.02 9.36 8 9.18 8 9C8 7.9 8.9 7 10 7C11.1 7 12 7.9 12 9C12 9.18 11.98 9.36 11.93 9.52L14.48 12.07C14.64 12.02 14.82 12 15 12C15.18 12 15.36 12.02 15.52 12.07L19.07 8.51C19.02 8.35 19 8.18 19 8C19 6.9 19.9 6 21 6C22.1 6 23 6.9 23 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n </ic-navigation-item>`,\n });\n\n expect(page.root).toMatchSnapshot(\n \"should render slotted in a navigation item\"\n );\n });\n\n it(\"should hide and show the badge using visible prop\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n const badge = document.querySelector(\"ic-badge\");\n\n expect(page.rootInstance.visible).toBe(true);\n\n badge.visible = false;\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(false);\n\n badge.visible = true;\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(true);\n });\n\n //To be removed when we remove show and hide methods\n it(\"should hide and show the badge using methods\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"1\"/></ic-button>`,\n });\n\n const badge = document.querySelector(\"ic-badge\");\n\n expect(page.rootInstance.visible).toBe(true);\n\n await badge.hideBadge();\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(false);\n\n await badge.showBadge();\n await page.waitForChanges();\n\n expect(page.rootInstance.visible).toBe(true);\n });\n\n it(\"should set the correct badge colour\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n await page.rootInstance.setBadgeColour();\n\n expect(page.rootInstance.customColorRGBA).toEqual({\n a: 1,\n b: 220,\n g: 200,\n r: 248,\n });\n });\n\n it(\"should set the correct foreground colour\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" variant=\"custom\" text-label=\"1\" custom-color=\"#F8C8DC\"/></ic-button>`,\n });\n\n await page.rootInstance.getBadgeForeground();\n\n expect(page.rootInstance.foregroundColour).toBe(\"dark\");\n });\n\n it(\"should set the correct text label when max number is set\", async () => {\n const page = await newSpecPage({\n components: [Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" text-label=\"100\" max-number=\"9\"/></ic-button>`,\n });\n\n expect(page.rootInstance.getTextLabel()).toBe(\"9+\");\n });\n\n it(\"should render with id set\", async () => {\n const page = await newSpecPage({\n components: [Button, Badge],\n html: `<ic-button>Button<ic-badge slot=\"badge\" id=\"badge-1\" text-label=\"1\"/></ic-button>`,\n });\n\n expect(page.root).toMatchSnapshot(\"should render with id\");\n });\n});\n"]}
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
11
11
|
return t;
|
12
12
|
};
|
13
13
|
import { Host, forceUpdate, h, } from "@stencil/core";
|
14
|
-
import { getThemeFromContext, inheritAttributes, isSlotUsed, removeDisabledFalse, } from "../../utils/helpers";
|
14
|
+
import { getThemeFromContext, inheritAttributes, isSlotUsed, removeDisabledFalse, renderFileHiddenInput, } from "../../utils/helpers";
|
15
15
|
import { IC_INHERITED_ARIA } from "../../utils/constants";
|
16
16
|
import { IcThemeForegroundEnum, } from "../../utils/types";
|
17
17
|
import arrowDropdown from "../../assets/arrow-dropdown.svg";
|
@@ -88,9 +88,27 @@ export class Button {
|
|
88
88
|
this.hasTooltip =
|
89
89
|
!this.disableTooltip && (!!this.title || this.variant === "icon");
|
90
90
|
};
|
91
|
+
// file explorer is only opened if the property fileUpload is set to 'true'
|
92
|
+
this.openFileExplorer = () => {
|
93
|
+
renderFileHiddenInput(this.icFileSelection, this.el, this.multiple, this.fileInputName, this.selectedFiles, this.disabled, this.accept);
|
94
|
+
};
|
95
|
+
this.isTooltipSilent = () => {
|
96
|
+
if (this.variant === "icon") {
|
97
|
+
if (this.title)
|
98
|
+
return true;
|
99
|
+
else if (this.ariaLabel)
|
100
|
+
return true;
|
101
|
+
else
|
102
|
+
return false;
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
};
|
91
108
|
this.ariaLabel = null;
|
92
109
|
this.describedByContent = null;
|
93
110
|
this.title = null;
|
111
|
+
this.accept = "*";
|
94
112
|
this.appearance = "default";
|
95
113
|
this.ariaControlsId = undefined;
|
96
114
|
this.ariaOwnsId = undefined;
|
@@ -99,6 +117,8 @@ export class Button {
|
|
99
117
|
this.download = false;
|
100
118
|
this.dropdown = false;
|
101
119
|
this.dropdownExpanded = false;
|
120
|
+
this.fileUpload = false;
|
121
|
+
this.fileInputName = `ic-button-file-upload-input-${buttonIds++}`;
|
102
122
|
this.form = undefined;
|
103
123
|
this.formaction = undefined;
|
104
124
|
this.formenctype = undefined;
|
@@ -109,8 +129,10 @@ export class Button {
|
|
109
129
|
this.href = undefined;
|
110
130
|
this.hreflang = undefined;
|
111
131
|
this.loading = false;
|
132
|
+
this.multiple = false;
|
112
133
|
this.referrerpolicy = undefined;
|
113
134
|
this.rel = undefined;
|
135
|
+
this.selectedFiles = undefined;
|
114
136
|
this.size = "default";
|
115
137
|
this.target = undefined;
|
116
138
|
this.tooltipPlacement = "bottom";
|
@@ -179,6 +201,9 @@ export class Button {
|
|
179
201
|
(_a = this.setViewBox()) === null || _a === void 0 ? void 0 : _a.setAttribute("viewBox", "0 0 24 24");
|
180
202
|
}
|
181
203
|
handleHostClick(event) {
|
204
|
+
if (this.fileUpload) {
|
205
|
+
this.openFileExplorer();
|
206
|
+
}
|
182
207
|
if (this.disabled || this.loading) {
|
183
208
|
event.stopImmediatePropagation();
|
184
209
|
}
|
@@ -257,7 +282,10 @@ export class Button {
|
|
257
282
|
this.id !== null
|
258
283
|
? `ic-button-with-tooltip-${this.id}`
|
259
284
|
: `ic-button-with-tooltip-${this.buttonIdNum}`;
|
260
|
-
describedBy =
|
285
|
+
describedBy =
|
286
|
+
this.variant === "icon" && !!ariaLabel
|
287
|
+
? null
|
288
|
+
: `ic-tooltip-${buttonId}`;
|
261
289
|
}
|
262
290
|
else {
|
263
291
|
describedBy = this.describedById;
|
@@ -295,7 +323,7 @@ export class Button {
|
|
295
323
|
["white-background"]: this.variant === "secondary" &&
|
296
324
|
!this.transparentBackground &&
|
297
325
|
this.appearance !== "light",
|
298
|
-
}, onClick: this.handleClick, "aria-owns": this.ariaOwnsId, "aria-controls": this.ariaControlsId, "aria-expanded": this.dropdown && `${this.dropdownExpanded}` }, this.hasTooltip && (h("ic-tooltip", { id: describedBy, label: title || ariaLabel, target: buttonId, placement: this.tooltipPlacement, silent: this.
|
326
|
+
}, onClick: this.handleClick, "aria-owns": this.ariaOwnsId, "aria-controls": this.ariaControlsId, "aria-expanded": this.dropdown && `${this.dropdownExpanded}` }, this.hasTooltip && (h("ic-tooltip", { id: describedBy, label: title || ariaLabel, target: buttonId, placement: this.tooltipPlacement, silent: this.isTooltipSilent() }, h(ButtonContent, null))), isSlotUsed(this.el, "badge") && h("slot", { name: "badge" }), !this.hasTooltip && h(ButtonContent, null), this.describedByContent && (h("span", { id: describedBy, class: "ic-button-describedby" }, this.describedByContent))));
|
299
327
|
}
|
300
328
|
static get is() { return "ic-button"; }
|
301
329
|
static get encapsulation() { return "shadow"; }
|
@@ -312,6 +340,24 @@ export class Button {
|
|
312
340
|
}
|
313
341
|
static get properties() {
|
314
342
|
return {
|
343
|
+
"accept": {
|
344
|
+
"type": "string",
|
345
|
+
"mutable": false,
|
346
|
+
"complexType": {
|
347
|
+
"original": "string",
|
348
|
+
"resolved": "string",
|
349
|
+
"references": {}
|
350
|
+
},
|
351
|
+
"required": false,
|
352
|
+
"optional": true,
|
353
|
+
"docs": {
|
354
|
+
"tags": [],
|
355
|
+
"text": "If `fileUpload` is set to `true`, this is the accepted list of file types."
|
356
|
+
},
|
357
|
+
"attribute": "accept",
|
358
|
+
"reflect": false,
|
359
|
+
"defaultValue": "\"*\""
|
360
|
+
},
|
315
361
|
"appearance": {
|
316
362
|
"type": "string",
|
317
363
|
"mutable": true,
|
@@ -466,6 +512,42 @@ export class Button {
|
|
466
512
|
"reflect": true,
|
467
513
|
"defaultValue": "false"
|
468
514
|
},
|
515
|
+
"fileUpload": {
|
516
|
+
"type": "boolean",
|
517
|
+
"mutable": false,
|
518
|
+
"complexType": {
|
519
|
+
"original": "boolean",
|
520
|
+
"resolved": "boolean",
|
521
|
+
"references": {}
|
522
|
+
},
|
523
|
+
"required": false,
|
524
|
+
"optional": true,
|
525
|
+
"docs": {
|
526
|
+
"tags": [],
|
527
|
+
"text": "If `true`, when the button is clicked the native file explorer will be launched."
|
528
|
+
},
|
529
|
+
"attribute": "file-upload",
|
530
|
+
"reflect": false,
|
531
|
+
"defaultValue": "false"
|
532
|
+
},
|
533
|
+
"fileInputName": {
|
534
|
+
"type": "string",
|
535
|
+
"mutable": false,
|
536
|
+
"complexType": {
|
537
|
+
"original": "string",
|
538
|
+
"resolved": "string",
|
539
|
+
"references": {}
|
540
|
+
},
|
541
|
+
"required": false,
|
542
|
+
"optional": false,
|
543
|
+
"docs": {
|
544
|
+
"tags": [],
|
545
|
+
"text": "The name of the control for the file input, which is submitted with the form data."
|
546
|
+
},
|
547
|
+
"attribute": "file-input-name",
|
548
|
+
"reflect": false,
|
549
|
+
"defaultValue": "`ic-button-file-upload-input-${buttonIds++}`"
|
550
|
+
},
|
469
551
|
"form": {
|
470
552
|
"type": "string",
|
471
553
|
"mutable": false,
|
@@ -638,6 +720,24 @@ export class Button {
|
|
638
720
|
"reflect": false,
|
639
721
|
"defaultValue": "false"
|
640
722
|
},
|
723
|
+
"multiple": {
|
724
|
+
"type": "boolean",
|
725
|
+
"mutable": false,
|
726
|
+
"complexType": {
|
727
|
+
"original": "boolean",
|
728
|
+
"resolved": "boolean",
|
729
|
+
"references": {}
|
730
|
+
},
|
731
|
+
"required": false,
|
732
|
+
"optional": true,
|
733
|
+
"docs": {
|
734
|
+
"tags": [],
|
735
|
+
"text": "If `fileUpload` is set to `true`, this boolean determines whether multiple files are accepted."
|
736
|
+
},
|
737
|
+
"attribute": "multiple",
|
738
|
+
"reflect": false,
|
739
|
+
"defaultValue": "false"
|
740
|
+
},
|
641
741
|
"referrerpolicy": {
|
642
742
|
"type": "string",
|
643
743
|
"mutable": false,
|
@@ -677,6 +777,26 @@ export class Button {
|
|
677
777
|
"attribute": "rel",
|
678
778
|
"reflect": false
|
679
779
|
},
|
780
|
+
"selectedFiles": {
|
781
|
+
"type": "unknown",
|
782
|
+
"mutable": false,
|
783
|
+
"complexType": {
|
784
|
+
"original": "FileList",
|
785
|
+
"resolved": "FileList",
|
786
|
+
"references": {
|
787
|
+
"FileList": {
|
788
|
+
"location": "global",
|
789
|
+
"id": "global::FileList"
|
790
|
+
}
|
791
|
+
}
|
792
|
+
},
|
793
|
+
"required": false,
|
794
|
+
"optional": false,
|
795
|
+
"docs": {
|
796
|
+
"tags": [],
|
797
|
+
"text": "The list of the files that have been selected by a user."
|
798
|
+
}
|
799
|
+
},
|
680
800
|
"size": {
|
681
801
|
"type": "string",
|
682
802
|
"mutable": false,
|
@@ -833,6 +953,26 @@ export class Button {
|
|
833
953
|
"resolved": "void",
|
834
954
|
"references": {}
|
835
955
|
}
|
956
|
+
}, {
|
957
|
+
"method": "icFileSelection",
|
958
|
+
"name": "icFileSelection",
|
959
|
+
"bubbles": true,
|
960
|
+
"cancelable": true,
|
961
|
+
"composed": true,
|
962
|
+
"docs": {
|
963
|
+
"tags": [],
|
964
|
+
"text": "If `fileUpload` is set to `true`, this will be emitted when a file is selected in the native explorer."
|
965
|
+
},
|
966
|
+
"complexType": {
|
967
|
+
"original": "FileList",
|
968
|
+
"resolved": "FileList",
|
969
|
+
"references": {
|
970
|
+
"FileList": {
|
971
|
+
"location": "global",
|
972
|
+
"id": "global::FileList"
|
973
|
+
}
|
974
|
+
}
|
975
|
+
}
|
836
976
|
}, {
|
837
977
|
"method": "icFocus",
|
838
978
|
"name": "icFocus",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAIL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAE5D,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;;;;;GAMG;AAQH,MAAM,OAAO,MAAM;;QAET,gBAAW,GAAG,SAAS,EAAE,CAAC;QAC1B,eAAU,GAAY,KAAK,CAAC;QAE5B,wBAAmB,GAA6B,EAAE,CAAC;QACnD,kBAAa,GAAgB,IAAI,CAAC;QAClC,kBAAa,GAAW,IAAI,CAAC;QAC7B,qBAAgB,GAAqB,IAAI,CAAC;QA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n isSlotUsed,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcSizes,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport arrowDropdown from \"../../assets/arrow-dropdown.svg\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.\n * @slot left-icon - Content will be placed to the left of the button label.\n * @slot right-icon - Content will be placed to the right of the button label.\n * @slot top-icon - Content will be placed above the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() ariaLabel: string = null;\n @State() describedByContent: string = null;\n @State() title: string = null;\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaControlsId: string | boolean;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwnsId: string | boolean;\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * If `true`, the button will show a dropdown icon.\n */\n @Prop() dropdown?: boolean = false;\n\n /**\n * If `true`, the aria-expanded value will be set to true. This is only applied if the dropdown prop is also true.\n */\n @Prop({ mutable: true, reflect: true }) dropdownExpanded?: boolean = false;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * If `true`, the secondary variant of button will have a transparent background rather than white.\n */\n @Prop() transparentBackground?: boolean = true;\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n if (\n this.hostMutationObserver !== null &&\n this.hostMutationObserver !== undefined\n ) {\n this.hostMutationObserver.disconnect();\n }\n }\n\n componentWillUpdate(): void {\n this.loadingWidth();\n this.setHasTooltip();\n }\n\n componentWillLoad(): void {\n const allInheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"title\",\n ]);\n\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = allInheritedAttributes;\n\n this.title = title as string;\n this.ariaLabel = ariaLabel as string;\n this.inheritedAttributes = restInheritedAttributes;\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.setHasTooltip();\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n if (el !== undefined && el !== null) {\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (typeof MutationObserver !== \"undefined\") {\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n\n this.hostMutationObserver = new MutationObserver(\n this.hostMutationCallback\n );\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n }\n\n componentWillRender(): void {\n this.setViewBox()?.setAttribute(\"viewBox\", \"0 0 24 24\");\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n if (this.dropdown) {\n this.dropdownExpanded = !this.dropdownExpanded;\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n return iconEl !== null;\n }\n\n private hasTopIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"top-icon\"]`);\n return iconEl !== null;\n }\n\n private hasRightIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n return iconEl !== null;\n }\n\n private setViewBox = () => {\n let iconEl;\n if (this.hasLeftIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n } else if (this.hasRightIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n } else {\n iconEl = null;\n }\n return iconEl;\n };\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private loadingWidth = () => {\n if (this.loading) {\n this.el.style.setProperty(\n \"--min-width\",\n `${this.el.getBoundingClientRect().width}px`\n );\n }\n };\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n const attribute = this.el.getAttribute(attributeName);\n if (attributeName === \"title\") this.title = attribute;\n else if (attributeName === \"aria-label\") this.ariaLabel = attribute;\n\n if (IC_INHERITED_ARIA.includes(attributeName)) {\n this.inheritedAttributes[attributeName] = attribute;\n forceComponentUpdate = true;\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private setHasTooltip = (): void => {\n this.hasTooltip =\n !this.disableTooltip && (!!this.title || this.variant === \"icon\");\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const { title, ariaLabel, inheritedAttributes } = this;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...inheritedAttributes}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.hasLeftIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n {this.hasTopIconSlot() &&\n !this.hasLeftIconSlot() &&\n !this.hasRightIconSlot() &&\n !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"top-icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n {this.hasRightIconSlot() && !this.loading && !this.dropdown && (\n <div class={{ \"icon-container\": true, \"right-icon\": true }}>\n <slot name=\"right-icon\" />\n </div>\n )}\n {this.dropdown &&\n !this.loading &&\n this.variant !== \"icon\" &&\n this.variant !== \"destructive\" && (\n <span\n class={{\n [\"arrow-dropdown\"]: !this.dropdownExpanded,\n [\"dropdown-expanded\"]: this.dropdownExpanded,\n }}\n innerHTML={arrowDropdown}\n />\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n [\"with-badge\"]: isSlotUsed(this.el, \"badge\"),\n [\"dropdown-no-icon\"]:\n this.dropdown &&\n !isSlotUsed(this.el, \"icon\") &&\n !isSlotUsed(this.el, \"left-icon\"),\n [\"top-icon\"]: isSlotUsed(this.el, \"top-icon\"),\n [\"white-background\"]:\n this.variant === \"secondary\" &&\n !this.transparentBackground &&\n this.appearance !== \"light\",\n }}\n onClick={this.handleClick}\n aria-owns={this.ariaOwnsId}\n aria-controls={this.ariaControlsId}\n aria-expanded={this.dropdown && `${this.dropdownExpanded}`}\n >\n {this.hasTooltip && (\n <ic-tooltip\n id={describedBy}\n label={title || ariaLabel}\n target={buttonId}\n placement={this.tooltipPlacement}\n silent={this.variant === \"icon\" && !!title}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAIL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAE5D,IAAI,SAAS,GAA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;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n isSlotUsed,\n removeDisabledFalse,\n renderFileHiddenInput,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcSizes,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport arrowDropdown from \"../../assets/arrow-dropdown.svg\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.\n * @slot left-icon - Content will be placed to the left of the button label.\n * @slot right-icon - Content will be placed to the right of the button label.\n * @slot top-icon - Content will be placed above the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() ariaLabel: string = null;\n @State() describedByContent: string = null;\n @State() title: string = null;\n\n /**\n * If `fileUpload` is set to `true`, this is the accepted list of file types.\n */\n @Prop() accept?: string = \"*\";\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaControlsId: string | boolean;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwnsId: string | boolean;\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * If `true`, the button will show a dropdown icon.\n */\n @Prop() dropdown?: boolean = false;\n\n /**\n * If `true`, the aria-expanded value will be set to true. This is only applied if the dropdown prop is also true.\n */\n @Prop({ mutable: true, reflect: true }) dropdownExpanded?: boolean = false;\n\n /**\n * If `true`, when the button is clicked the native file explorer will be launched.\n */\n @Prop() fileUpload?: boolean = false;\n\n /**\n * The name of the control for the file input, which is submitted with the form data.\n */\n @Prop() fileInputName: string = `ic-button-file-upload-input-${buttonIds++}`;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * If `fileUpload` is set to `true`, this boolean determines whether multiple files are accepted.\n */\n @Prop() multiple?: boolean = false;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The list of the files that have been selected by a user.\n */\n @Prop() selectedFiles: FileList;\n\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * If `true`, the secondary variant of button will have a transparent background rather than white.\n */\n @Prop() transparentBackground?: boolean = true;\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * If `fileUpload` is set to `true`, this will be emitted when a file is selected in the native explorer.\n */\n @Event() icFileSelection!: EventEmitter<FileList>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n if (\n this.hostMutationObserver !== null &&\n this.hostMutationObserver !== undefined\n ) {\n this.hostMutationObserver.disconnect();\n }\n }\n\n componentWillUpdate(): void {\n this.loadingWidth();\n this.setHasTooltip();\n }\n\n componentWillLoad(): void {\n const allInheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"title\",\n ]);\n\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = allInheritedAttributes;\n\n this.title = title as string;\n this.ariaLabel = ariaLabel as string;\n this.inheritedAttributes = restInheritedAttributes;\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.setHasTooltip();\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n if (el !== undefined && el !== null) {\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (typeof MutationObserver !== \"undefined\") {\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n\n this.hostMutationObserver = new MutationObserver(\n this.hostMutationCallback\n );\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n }\n\n componentWillRender(): void {\n this.setViewBox()?.setAttribute(\"viewBox\", \"0 0 24 24\");\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.fileUpload) {\n this.openFileExplorer();\n }\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n if (this.dropdown) {\n this.dropdownExpanded = !this.dropdownExpanded;\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n return iconEl !== null;\n }\n\n private hasTopIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"top-icon\"]`);\n return iconEl !== null;\n }\n\n private hasRightIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n return iconEl !== null;\n }\n\n private setViewBox = () => {\n let iconEl;\n if (this.hasLeftIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n } else if (this.hasRightIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n } else {\n iconEl = null;\n }\n return iconEl;\n };\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private loadingWidth = () => {\n if (this.loading) {\n this.el.style.setProperty(\n \"--min-width\",\n `${this.el.getBoundingClientRect().width}px`\n );\n }\n };\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n const attribute = this.el.getAttribute(attributeName);\n if (attributeName === \"title\") this.title = attribute;\n else if (attributeName === \"aria-label\") this.ariaLabel = attribute;\n\n if (IC_INHERITED_ARIA.includes(attributeName)) {\n this.inheritedAttributes[attributeName] = attribute;\n forceComponentUpdate = true;\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private setHasTooltip = (): void => {\n this.hasTooltip =\n !this.disableTooltip && (!!this.title || this.variant === \"icon\");\n };\n\n // file explorer is only opened if the property fileUpload is set to 'true'\n private openFileExplorer = () => {\n renderFileHiddenInput(\n this.icFileSelection,\n this.el,\n this.multiple,\n this.fileInputName,\n this.selectedFiles,\n this.disabled,\n this.accept\n );\n };\n\n private isTooltipSilent = (): boolean => {\n if (this.variant === \"icon\") {\n if (this.title) return true;\n else if (this.ariaLabel) return true;\n else return false;\n } else {\n return false;\n }\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const { title, ariaLabel, inheritedAttributes } = this;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy =\n this.variant === \"icon\" && !!ariaLabel\n ? null\n : `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...inheritedAttributes}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.hasLeftIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n {this.hasTopIconSlot() &&\n !this.hasLeftIconSlot() &&\n !this.hasRightIconSlot() &&\n !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"top-icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n {this.hasRightIconSlot() && !this.loading && !this.dropdown && (\n <div class={{ \"icon-container\": true, \"right-icon\": true }}>\n <slot name=\"right-icon\" />\n </div>\n )}\n {this.dropdown &&\n !this.loading &&\n this.variant !== \"icon\" &&\n this.variant !== \"destructive\" && (\n <span\n class={{\n [\"arrow-dropdown\"]: !this.dropdownExpanded,\n [\"dropdown-expanded\"]: this.dropdownExpanded,\n }}\n innerHTML={arrowDropdown}\n />\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n [\"with-badge\"]: isSlotUsed(this.el, \"badge\"),\n [\"dropdown-no-icon\"]:\n this.dropdown &&\n !isSlotUsed(this.el, \"icon\") &&\n !isSlotUsed(this.el, \"left-icon\"),\n [\"top-icon\"]: isSlotUsed(this.el, \"top-icon\"),\n [\"white-background\"]:\n this.variant === \"secondary\" &&\n !this.transparentBackground &&\n this.appearance !== \"light\",\n }}\n onClick={this.handleClick}\n aria-owns={this.ariaOwnsId}\n aria-controls={this.ariaControlsId}\n aria-expanded={this.dropdown && `${this.dropdownExpanded}`}\n >\n {this.hasTooltip && (\n <ic-tooltip\n id={describedBy}\n label={title || ariaLabel}\n target={buttonId}\n placement={this.tooltipPlacement}\n silent={this.isTooltipSilent()}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Button } from "../../ic-button";
|
2
2
|
import { newSpecPage } from "@stencil/core/testing";
|
3
3
|
import * as helpers from "../../../../utils/helpers";
|
4
|
+
import { Tooltip } from "../../../ic-tooltip/ic-tooltip";
|
4
5
|
beforeAll(() => {
|
5
6
|
jest.spyOn(console, "warn").mockImplementation(jest.fn());
|
6
7
|
});
|
@@ -154,35 +155,35 @@ describe("button component", () => {
|
|
154
155
|
});
|
155
156
|
it("should render icon variant with a tooltip", async () => {
|
156
157
|
const page = await newSpecPage({
|
157
|
-
components: [Button],
|
158
|
+
components: [Button, Tooltip],
|
158
159
|
html: "<ic-button variant='icon' id='test-button'>Button</ic-button>",
|
159
160
|
});
|
160
161
|
expect(page.root).toMatchSnapshot();
|
161
162
|
});
|
162
163
|
it("should render icon variant with a tooltip based on title", async () => {
|
163
164
|
const page = await newSpecPage({
|
164
|
-
components: [Button],
|
165
|
+
components: [Button, Tooltip],
|
165
166
|
html: "<ic-button variant='icon' id='test-button' title='Tooltip text'>Button</ic-button>",
|
166
167
|
});
|
167
168
|
expect(page.root).toMatchSnapshot();
|
168
169
|
});
|
169
170
|
it("should render icon variant with a tooltip based on aria-label", async () => {
|
170
171
|
const page = await newSpecPage({
|
171
|
-
components: [Button],
|
172
|
+
components: [Button, Tooltip],
|
172
173
|
html: "<ic-button variant='icon' id='test-button' aria-label='Tooltip text' tooltip-placement='top'>Button</ic-button>",
|
173
174
|
});
|
174
175
|
expect(page.root).toMatchSnapshot();
|
175
176
|
});
|
176
177
|
it("should disable tooltip when prop set", async () => {
|
177
178
|
const page = await newSpecPage({
|
178
|
-
components: [Button],
|
179
|
+
components: [Button, Tooltip],
|
179
180
|
html: "<ic-button variant='icon' aria-label='Tooltip text' id='test-button' disable-tooltip>Button</ic-button>",
|
180
181
|
});
|
181
182
|
expect(page.root).toMatchSnapshot();
|
182
183
|
});
|
183
184
|
it("should update aria-label when attribute changed", async () => {
|
184
185
|
const page = await newSpecPage({
|
185
|
-
components: [Button],
|
186
|
+
components: [Button, Tooltip],
|
186
187
|
html: "<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>",
|
187
188
|
});
|
188
189
|
expect(page.root).toMatchSnapshot();
|