@ukic/web-components 2.33.0 → 2.34.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -4
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-df61b63f.js → helpers-6f6991cb.js} +13 -1
- package/dist/cjs/helpers-6f6991cb.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +2 -9
- 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 +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 +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +12 -19
- 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 +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +2 -12
- package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +18 -7
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +2 -9
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -10
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +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 +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 +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.cjs.entry.js +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +8 -7
- 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-group.cjs.entry.js +10 -2
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +3 -2
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +2 -2
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/types-dc22e301.js.map +1 -1
- package/dist/collection/components/ic-alert/ic-alert.js +3 -10
- package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js +21 -3
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.js +2 -2
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.types.js.map +1 -1
- package/dist/collection/components/ic-card/ic-card.js +13 -20
- package/dist/collection/components/ic-card/ic-card.js.map +1 -1
- package/dist/collection/components/ic-card/test/basic/ic-card.spec.js +34 -3
- package/dist/collection/components/ic-card/test/basic/ic-card.spec.js.map +1 -1
- package/dist/collection/components/ic-empty-state/ic-empty-state.js +3 -13
- package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -1
- package/dist/collection/components/ic-footer/ic-footer.js +18 -7
- package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
- package/dist/collection/components/ic-footer/test/basic/ic-footer.spec.js +41 -0
- package/dist/collection/components/ic-footer/test/basic/ic-footer.spec.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.js +3 -10
- package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
- package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js +21 -3
- package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js.map +1 -1
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +3 -10
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
- package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js +21 -3
- package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +4 -0
- package/dist/collection/components/ic-text-field/ic-text-field.js +8 -7
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +26 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js.map +1 -1
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +34 -0
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +4 -0
- package/dist/collection/testspec.setup.js +14 -0
- package/dist/collection/testspec.setup.js.map +1 -1
- package/dist/collection/utils/helpers.js +11 -0
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js +12 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-alert2.js +3 -10
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js +13 -20
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-empty-state.js +3 -13
- package/dist/components/ic-empty-state.js.map +1 -1
- package/dist/components/ic-footer.js +18 -7
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +3 -10
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +3 -10
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-menu2.js +1 -1
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-select.js +1 -1
- package/dist/components/ic-side-navigation.js +1 -1
- package/dist/components/ic-stepper.js +1 -1
- package/dist/components/ic-text-field2.js +8 -7
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toggle-button-group.js +12 -2
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-toggle-button.js +3 -1
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/components/ic-top-navigation.js +2 -2
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/types.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-e218165c.entry.js → p-08478a4c.entry.js} +2 -2
- package/dist/core/{p-45b9b893.entry.js → p-12bac804.entry.js} +2 -2
- package/dist/core/{p-ae89e61c.entry.js → p-13b2c3a2.entry.js} +2 -2
- package/dist/core/{p-9ab3b47e.entry.js → p-168a7440.entry.js} +2 -2
- package/dist/core/{p-d9e36712.entry.js → p-193fc7d0.entry.js} +2 -2
- package/dist/core/{p-fa83d7c2.entry.js → p-1e4690f8.entry.js} +2 -2
- package/dist/core/{p-2c93290d.entry.js → p-1f6d36d5.entry.js} +2 -2
- package/dist/core/p-26b7b18f.js.map +1 -1
- package/dist/core/p-2a11be1e.entry.js +2 -0
- package/dist/core/p-2a11be1e.entry.js.map +1 -0
- package/dist/core/{p-cc6a677b.entry.js → p-2cd1a601.entry.js} +2 -2
- package/dist/core/p-3ba915a5.entry.js +2 -0
- package/dist/core/p-3ba915a5.entry.js.map +1 -0
- package/dist/core/{p-742189ad.entry.js → p-405d89bb.entry.js} +2 -2
- package/dist/core/{p-72a854dd.entry.js → p-4c6dc1b2.entry.js} +2 -2
- package/dist/core/{p-90e4679d.entry.js → p-51407872.entry.js} +2 -2
- package/dist/core/{p-ef4acad9.entry.js → p-597c221c.entry.js} +2 -2
- package/dist/core/{p-5739e0a9.entry.js → p-5d3c6ea1.entry.js} +2 -2
- package/dist/core/{p-f1bf36e4.entry.js → p-65dc77ba.entry.js} +2 -2
- package/dist/core/p-6beed7db.entry.js +2 -0
- package/dist/core/p-6beed7db.entry.js.map +1 -0
- package/dist/core/{p-5ec8938f.entry.js → p-6d8dc552.entry.js} +2 -2
- package/dist/core/{p-0bd82370.entry.js → p-72f292f2.entry.js} +2 -2
- package/dist/core/p-78f16b1a.entry.js +2 -0
- package/dist/core/p-78f16b1a.entry.js.map +1 -0
- package/dist/core/{p-1ee0b4eb.entry.js → p-7b3a4b3f.entry.js} +2 -2
- package/dist/core/{p-f53503ca.entry.js → p-7e8a4abd.entry.js} +2 -2
- package/dist/core/p-7f1594d9.entry.js +2 -0
- package/dist/core/p-7f1594d9.entry.js.map +1 -0
- package/dist/core/{p-cb344d95.entry.js → p-8dd2d3df.entry.js} +2 -2
- package/dist/core/p-90433147.entry.js +2 -0
- package/dist/core/p-90433147.entry.js.map +1 -0
- package/dist/core/{p-f61a4e8d.entry.js → p-915e5888.entry.js} +2 -2
- package/dist/core/{p-614cb828.entry.js → p-91fab13d.entry.js} +2 -2
- package/dist/core/{p-20203682.entry.js → p-922036e8.entry.js} +2 -2
- package/dist/core/{p-050dc124.entry.js → p-96e79d69.entry.js} +2 -2
- package/dist/core/{p-bdb77a91.entry.js → p-9a6790d8.entry.js} +2 -2
- package/dist/core/{p-7e6fa0ea.entry.js → p-9ef08234.entry.js} +2 -2
- package/dist/core/{p-c02f2a47.entry.js → p-a020afbd.entry.js} +2 -2
- package/dist/core/p-a020afbd.entry.js.map +1 -0
- package/dist/core/{p-de3d293b.entry.js → p-a141ea39.entry.js} +2 -2
- package/dist/core/p-a141ea39.entry.js.map +1 -0
- package/dist/core/p-a438656d.entry.js +2 -0
- package/dist/core/p-a438656d.entry.js.map +1 -0
- package/dist/core/{p-c0885ea6.entry.js → p-a9cea205.entry.js} +2 -2
- package/dist/core/{p-b8de998d.entry.js → p-afa78488.entry.js} +2 -2
- package/dist/core/{p-a4f42217.entry.js → p-b21d5f94.entry.js} +2 -2
- package/dist/core/{p-4bb9c52f.entry.js → p-b262eaff.entry.js} +2 -2
- package/dist/core/{p-5a7fd661.entry.js → p-b60912a7.entry.js} +2 -2
- package/dist/core/{p-63b88ad2.entry.js → p-b62735aa.entry.js} +2 -2
- package/dist/core/{p-cb5f7b90.entry.js → p-ba06cc95.entry.js} +2 -2
- package/dist/core/p-ba06cc95.entry.js.map +1 -0
- package/dist/core/{p-bb21769c.entry.js → p-ba884064.entry.js} +2 -2
- package/dist/core/{p-649bd0e1.entry.js → p-bdaff5c9.entry.js} +2 -2
- package/dist/core/{p-7ef7adc4.entry.js → p-c939d07d.entry.js} +2 -2
- package/dist/core/p-d3344518.entry.js +2 -0
- package/dist/core/p-d3344518.entry.js.map +1 -0
- package/dist/core/{p-ad2a8eab.entry.js → p-d375858e.entry.js} +2 -2
- package/dist/core/p-d41c847e.js +2 -0
- package/dist/core/p-d41c847e.js.map +1 -0
- package/dist/core/{p-a15dfa51.entry.js → p-dfb3e76e.entry.js} +2 -2
- package/dist/core/{p-48922e0a.entry.js → p-eae017ce.entry.js} +2 -2
- package/dist/core/{p-6c31fd9f.entry.js → p-f3599009.entry.js} +2 -2
- package/dist/core/{p-d4d4b392.entry.js → p-f39741be.entry.js} +2 -2
- package/dist/core/{p-f73cb96b.entry.js → p-f404b35e.entry.js} +2 -2
- package/dist/core/{p-04876964.entry.js → p-f4a29c16.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-b0150c61.js → helpers-003f27c9.js} +13 -2
- package/dist/{core/p-6d23ec8e.js.map → esm/helpers-003f27c9.js.map} +1 -1
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +3 -10
- 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 +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 +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +13 -20
- 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 +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +3 -13
- package/dist/esm/ic-empty-state.entry.js.map +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +18 -7
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +3 -10
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +4 -11
- package/dist/esm/ic-input-component-container_3.entry.js.map +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 +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 +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.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js +8 -7
- 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-group.entry.js +10 -2
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +3 -2
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +2 -2
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/types-6f6b41a5.js.map +1 -1
- package/dist/types/components/ic-alert/ic-alert.d.ts +0 -1
- package/dist/types/components/ic-button/ic-button.d.ts +2 -2
- package/dist/types/components/ic-button/ic-button.types.d.ts +0 -1
- package/dist/types/components/ic-card/ic-card.d.ts +0 -1
- package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +0 -1
- package/dist/types/components/ic-footer/ic-footer.d.ts +1 -0
- package/dist/types/components/ic-hero/ic-hero.d.ts +0 -1
- package/dist/types/components/ic-input-component-container/ic-input-component-container.d.ts +0 -1
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +1 -0
- package/dist/types/components/ic-toggle-button/ic-toggle-button.d.ts +5 -1
- package/dist/types/components/ic-toggle-button-group/ic-toggle-button-group.d.ts +6 -1
- package/dist/types/components.d.ts +20 -4
- package/dist/types/testspec.setup.d.ts +9 -0
- package/dist/types/utils/helpers.d.ts +2 -0
- package/dist/types/utils/types.d.ts +1 -0
- package/hydrate/index.js +62 -59
- package/package.json +2 -2
- package/vscode-data.json +36 -0
- package/dist/cjs/helpers-df61b63f.js.map +0 -1
- package/dist/core/p-145a4619.entry.js +0 -2
- package/dist/core/p-145a4619.entry.js.map +0 -1
- package/dist/core/p-350d89d0.entry.js +0 -2
- package/dist/core/p-350d89d0.entry.js.map +0 -1
- package/dist/core/p-618a0098.entry.js +0 -2
- package/dist/core/p-618a0098.entry.js.map +0 -1
- package/dist/core/p-6d23ec8e.js +0 -2
- package/dist/core/p-8920ebe6.entry.js +0 -2
- package/dist/core/p-8920ebe6.entry.js.map +0 -1
- package/dist/core/p-ac39415d.entry.js +0 -2
- package/dist/core/p-ac39415d.entry.js.map +0 -1
- package/dist/core/p-c02f2a47.entry.js.map +0 -1
- package/dist/core/p-c8b56283.entry.js +0 -2
- package/dist/core/p-c8b56283.entry.js.map +0 -1
- package/dist/core/p-cb5f7b90.entry.js.map +0 -1
- package/dist/core/p-de3d293b.entry.js.map +0 -1
- package/dist/core/p-ec15bf1b.entry.js +0 -2
- package/dist/core/p-ec15bf1b.entry.js.map +0 -1
- package/dist/core/p-f1583332.entry.js +0 -2
- package/dist/core/p-f1583332.entry.js.map +0 -1
- package/dist/esm/helpers-b0150c61.js.map +0 -1
- /package/dist/core/{p-e218165c.entry.js.map → p-08478a4c.entry.js.map} +0 -0
- /package/dist/core/{p-45b9b893.entry.js.map → p-12bac804.entry.js.map} +0 -0
- /package/dist/core/{p-ae89e61c.entry.js.map → p-13b2c3a2.entry.js.map} +0 -0
- /package/dist/core/{p-9ab3b47e.entry.js.map → p-168a7440.entry.js.map} +0 -0
- /package/dist/core/{p-d9e36712.entry.js.map → p-193fc7d0.entry.js.map} +0 -0
- /package/dist/core/{p-fa83d7c2.entry.js.map → p-1e4690f8.entry.js.map} +0 -0
- /package/dist/core/{p-2c93290d.entry.js.map → p-1f6d36d5.entry.js.map} +0 -0
- /package/dist/core/{p-cc6a677b.entry.js.map → p-2cd1a601.entry.js.map} +0 -0
- /package/dist/core/{p-742189ad.entry.js.map → p-405d89bb.entry.js.map} +0 -0
- /package/dist/core/{p-72a854dd.entry.js.map → p-4c6dc1b2.entry.js.map} +0 -0
- /package/dist/core/{p-90e4679d.entry.js.map → p-51407872.entry.js.map} +0 -0
- /package/dist/core/{p-ef4acad9.entry.js.map → p-597c221c.entry.js.map} +0 -0
- /package/dist/core/{p-5739e0a9.entry.js.map → p-5d3c6ea1.entry.js.map} +0 -0
- /package/dist/core/{p-f1bf36e4.entry.js.map → p-65dc77ba.entry.js.map} +0 -0
- /package/dist/core/{p-5ec8938f.entry.js.map → p-6d8dc552.entry.js.map} +0 -0
- /package/dist/core/{p-0bd82370.entry.js.map → p-72f292f2.entry.js.map} +0 -0
- /package/dist/core/{p-1ee0b4eb.entry.js.map → p-7b3a4b3f.entry.js.map} +0 -0
- /package/dist/core/{p-f53503ca.entry.js.map → p-7e8a4abd.entry.js.map} +0 -0
- /package/dist/core/{p-cb344d95.entry.js.map → p-8dd2d3df.entry.js.map} +0 -0
- /package/dist/core/{p-f61a4e8d.entry.js.map → p-915e5888.entry.js.map} +0 -0
- /package/dist/core/{p-614cb828.entry.js.map → p-91fab13d.entry.js.map} +0 -0
- /package/dist/core/{p-20203682.entry.js.map → p-922036e8.entry.js.map} +0 -0
- /package/dist/core/{p-050dc124.entry.js.map → p-96e79d69.entry.js.map} +0 -0
- /package/dist/core/{p-bdb77a91.entry.js.map → p-9a6790d8.entry.js.map} +0 -0
- /package/dist/core/{p-7e6fa0ea.entry.js.map → p-9ef08234.entry.js.map} +0 -0
- /package/dist/core/{p-c0885ea6.entry.js.map → p-a9cea205.entry.js.map} +0 -0
- /package/dist/core/{p-b8de998d.entry.js.map → p-afa78488.entry.js.map} +0 -0
- /package/dist/core/{p-a4f42217.entry.js.map → p-b21d5f94.entry.js.map} +0 -0
- /package/dist/core/{p-4bb9c52f.entry.js.map → p-b262eaff.entry.js.map} +0 -0
- /package/dist/core/{p-5a7fd661.entry.js.map → p-b60912a7.entry.js.map} +0 -0
- /package/dist/core/{p-63b88ad2.entry.js.map → p-b62735aa.entry.js.map} +0 -0
- /package/dist/core/{p-bb21769c.entry.js.map → p-ba884064.entry.js.map} +0 -0
- /package/dist/core/{p-649bd0e1.entry.js.map → p-bdaff5c9.entry.js.map} +0 -0
- /package/dist/core/{p-7ef7adc4.entry.js.map → p-c939d07d.entry.js.map} +0 -0
- /package/dist/core/{p-ad2a8eab.entry.js.map → p-d375858e.entry.js.map} +0 -0
- /package/dist/core/{p-a15dfa51.entry.js.map → p-dfb3e76e.entry.js.map} +0 -0
- /package/dist/core/{p-48922e0a.entry.js.map → p-eae017ce.entry.js.map} +0 -0
- /package/dist/core/{p-6c31fd9f.entry.js.map → p-f3599009.entry.js.map} +0 -0
- /package/dist/core/{p-d4d4b392.entry.js.map → p-f39741be.entry.js.map} +0 -0
- /package/dist/core/{p-f73cb96b.entry.js.map → p-f404b35e.entry.js.map} +0 -0
- /package/dist/core/{p-04876964.entry.js.map → p-f4a29c16.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-hero.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-hero/test/basic/ic-hero.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"ic-hero.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-hero/test/basic/ic-hero.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAElC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,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ClB,YAAY,EAAE,EAAE;gBAChB,MAAM,EAAE,IAAI;aACb;SACF,CAAC;QAEF,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,CAAC,2BAA2B,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,2BAA2B,CAAC,CAAC,oBAAoB,CACtD,kBAAkB,EAClB,WAAW,EACX,SAAS,CACV,CAAC;QAEF,MAAM,CAAC,wBAAwB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAE1D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from \"@stencil/core/testing\";\nimport { Hero } from \"../../ic-hero\";\nimport {\n mockHasDynamicChildSlots,\n mockMutationObserverImplementation,\n MockMutationRecord,\n mockRenderDynamicChildSlots,\n} from \"../../../../testspec.setup\";\n\ndescribe(\"ic-hero component\", () => {\n afterAll(() => {\n jest.restoreAllMocks();\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n it(\"should render\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\"></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders\");\n });\n\n it(\"should render with a secondary heading\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\" secondary-heading=\"Test title\" secondary-subheading=\"Test text\"></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders-with-secondary-heading\");\n });\n\n it(\"should render with interaction content\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\"><ic-button slot=\"interaction\">Button</ic-button></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders-with-interaction-content\");\n });\n\n it(\"should render with secondary content\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\"><ic-card slot=\"secondary\" heading=\"Test card\"></ic-card></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders-with-secondary-content\");\n });\n\n it(\"should render with a background image when given\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\" background-image=\"test.png\"><ic-card slot=\"secondary\" heading=\"Test card\"></ic-card></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders-with-background-image\");\n });\n\n it(\"should use parallax on scroll when a background image is given\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\" background-image=\"test.png\"><ic-card slot=\"secondary\" heading=\"Test card\"></ic-card></ic-hero>`,\n });\n\n page.doc.scrollingElement.scrollTop = 50;\n page.doc.dispatchEvent(new CustomEvent(\"scroll\"));\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(\"renders-with-parallax-on-scroll\");\n });\n\n it(\"should use not parallax on scroll when a background image is given, but parallax disabled\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" disable-background-parallax subheading=\"Test text\" background-image=\"test.png\"><ic-card slot=\"secondary\" heading=\"Test card\"></ic-card></ic-hero>`,\n });\n\n page.doc.scrollingElement.scrollTop = 50;\n page.doc.dispatchEvent(new CustomEvent(\"scroll\"));\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(\n \"renders-with-parallax-on-scroll-disabled\"\n );\n });\n\n it(\"should render small\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero small heading=\"Test title\" subheading=\"Test text\"></ic-hero>`,\n });\n\n expect(page.root).toMatchSnapshot(\"renders-small-variant\");\n });\n\n it(\"should correctly set foregroundColor on theme change\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\"></ic-hero>`,\n });\n\n await page.rootInstance.themeChangeHandler({ detail: { mode: \"dark\" } });\n await page.waitForChanges();\n\n expect(page.rootInstance.foregroundColor).toBe(\"dark\");\n });\n\n it(\"should test rendering secondary slot after initial render\", async () => {\n const page = await newSpecPage({\n components: [Hero],\n html: `<ic-hero heading=\"Test title\" subheading=\"Test text\"></ic-hero>`,\n });\n\n const component = page.rootInstance;\n const host = page.root;\n\n const observerInstance =\n mockMutationObserverImplementation.mock.results[0].value;\n\n const icon = document.createElement(\"svg\");\n icon.setAttribute(\"slot\", \"secondary\");\n\n observerInstance.observe(host, { childList: true });\n\n host.appendChild(icon);\n\n const mockMutationRecord: MockMutationRecord[] = [\n {\n addedNodes: [icon],\n removedNodes: [],\n target: host,\n },\n ];\n\n observerInstance.trigger(mockMutationRecord);\n\n await page.waitForChanges();\n\n expect(mockRenderDynamicChildSlots).toHaveBeenCalledTimes(1);\n expect(mockRenderDynamicChildSlots).toHaveBeenCalledWith(\n mockMutationRecord,\n \"secondary\",\n component\n );\n\n expect(mockHasDynamicChildSlots).toHaveBeenCalledTimes(1);\n\n expect(page.root).toMatchSnapshot();\n });\n});\n"]}
|
package/dist/collection/components/ic-input-component-container/ic-input-component-container.js
CHANGED
@@ -1,19 +1,12 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
2
|
import { IcInformationStatus, } from "../../utils/types";
|
3
3
|
import successIcon from "../../assets/success-icon.svg";
|
4
|
-
import {
|
4
|
+
import { removeDisabledFalse, renderDynamicChildSlots, slotHasContent, } from "../../utils/helpers";
|
5
5
|
/**
|
6
6
|
* @slot left-icon - Content will be placed to the left of the input.
|
7
7
|
*/
|
8
8
|
export class InputComponentContainer {
|
9
9
|
constructor() {
|
10
|
-
this.hostMutationCallback = (mutationList) => {
|
11
|
-
if (mutationList.some(({ type, addedNodes, removedNodes }) => type === "childList"
|
12
|
-
? checkSlotInChildMutations(addedNodes, removedNodes, "left-icon")
|
13
|
-
: false)) {
|
14
|
-
forceUpdate(this);
|
15
|
-
}
|
16
|
-
};
|
17
10
|
this.appearance = "default";
|
18
11
|
this.dark = false;
|
19
12
|
this.disabled = false;
|
@@ -32,7 +25,7 @@ export class InputComponentContainer {
|
|
32
25
|
removeDisabledFalse(this.disabled, this.el);
|
33
26
|
}
|
34
27
|
componentDidLoad() {
|
35
|
-
this.hostMutationObserver = new MutationObserver(this
|
28
|
+
this.hostMutationObserver = new MutationObserver((mutationList) => renderDynamicChildSlots(mutationList, "left-icon", this));
|
36
29
|
this.hostMutationObserver.observe(this.el, { childList: true });
|
37
30
|
}
|
38
31
|
render() {
|
package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-input-component-container.js","sourceRoot":"","sources":["../../../src/components/ic-input-component-container/ic-input-component-container.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"ic-input-component-container.js","sourceRoot":"","sources":["../../../src/components/ic-input-component-container/ic-input-component-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EACL,mBAAmB,GAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AAKH,MAAM,OAAO,uBAAuB;;0BAOQ,SAAS;oBAK1B,KAAK;wBAKF,KAAK;yBASJ,KAAK;yBAKL,KAAK;wBAKN,KAAK;oBAKR,SAAS;qBAKR,KAAK;gCAKK,KAAK;gCAKc,EAAE;;IArCzD,oBAAoB;QAClB,mBAAmB,CAAC,IAAI,CAAC,QA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AAiB,EAAE,IAAI;oBACvB,IAAI,EAAE,IAAI,IAAI,UAAU,KAAK,MAAM;iBACpC;gBAEA,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,IAAI,CACvC,WACE,KAAK,EAAE;wBACL,CAAC,gBAAgB,CAAC,EAAE,IAAI;qBACzB;oBAED,YAAM,IAAI,EAAC,WAAW,GAAG,CACrB,CACP;gBACD,eAAa;gBAEZ,gBAAgB;oBACf,gBAAgB,KAAK,mBAAmB,CAAC,OAAO,IAAI,CAClD,YACE,KAAK,EAAE;wBACL,CAAC,gBAAgB,CAAC,EAAE,IAAI;qBACzB,EACD,SAAS,EAAE,WAAW,GACtB,CACH,CACC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, Watch, h } from \"@stencil/core\";\n\nimport {\n IcInformationStatus,\n IcInformationStatusOrEmpty,\n IcSizes,\n} from \"../../utils/types\";\nimport successIcon from \"../../assets/success-icon.svg\";\nimport {\n removeDisabledFalse,\n renderDynamicChildSlots,\n slotHasContent,\n} from \"../../utils/helpers\";\n\n/**\n * @slot left-icon - Content will be placed to the left of the input.\n */\n@Component({\n tag: \"ic-input-component-container\",\n styleUrl: \"ic-input-component-container.css\",\n})\nexport class InputComponentContainer {\n private hostMutationObserver: MutationObserver;\n @Element() el: HTMLIcInputComponentContainerElement;\n\n /**\n * The appearance of the input component container.\n */\n @Prop() appearance?: \"dark\" | \"default\" = \"default\";\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `appearance` to \"dark\" instead.\n */\n @Prop() dark?: boolean = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the input component container will fill the width of the container it is in.\n */\n @Prop() fullWidth: boolean = false;\n\n /**\n * If `true`, the input component container will allow for multiple lines.\n */\n @Prop() multiLine: boolean = false;\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly: boolean = false;\n\n /**\n * The size of the input component container component.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * If `true`, the validation will display inline.\n */\n @Prop() validationInline: boolean = false;\n\n /**\n * The validation status of the input component container - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n this.hostMutationObserver = new MutationObserver((mutationList) =>\n renderDynamicChildSlots(mutationList, \"left-icon\", this)\n );\n this.hostMutationObserver.observe(this.el, { childList: true });\n }\n\n render() {\n const {\n size,\n small,\n validationStatus,\n disabled,\n readonly,\n multiLine,\n fullWidth,\n dark,\n appearance,\n validationInline,\n } = this;\n const hasValidationStatus =\n this.validationStatus !== \"\" && !this.disabled && !this.readonly\n ? true\n : false;\n\n return (\n <Host\n class={{\n small: small,\n [`${size}`]: true,\n [validationStatus]: hasValidationStatus,\n disabled: disabled,\n readonly: readonly,\n [\"multiline\"]: multiLine,\n [\"fullwidth\"]: fullWidth,\n [\"dark\"]: dark || appearance === \"dark\",\n }}\n aria-disabled={disabled ? \"true\" : null}\n >\n <div\n class={{\n \"focus-indicator\": true,\n dark: dark || appearance === \"dark\",\n }}\n >\n {slotHasContent(this.el, \"left-icon\") && (\n <div\n class={{\n [\"icon-container\"]: true,\n }}\n >\n <slot name=\"left-icon\" />\n </div>\n )}\n <slot></slot>\n\n {validationInline &&\n validationStatus === IcInformationStatus.Success && (\n <span\n class={{\n [\"inline-success\"]: true,\n }}\n innerHTML={successIcon}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -1,6 +1,13 @@
|
|
1
|
+
import { mockHasDynamicChildSlots, mockMutationObserverImplementation, mockRenderDynamicChildSlots, } from "../../../../testspec.setup";
|
1
2
|
import { InputComponentContainer } from "../../ic-input-component-container";
|
2
3
|
import { newSpecPage } from "@stencil/core/testing";
|
3
4
|
describe("ic-input-component-container", () => {
|
5
|
+
afterAll(() => {
|
6
|
+
jest.restoreAllMocks();
|
7
|
+
});
|
8
|
+
afterEach(() => {
|
9
|
+
jest.clearAllMocks();
|
10
|
+
});
|
4
11
|
it("should render", async () => {
|
5
12
|
const page = await newSpecPage({
|
6
13
|
components: [InputComponentContainer],
|
@@ -140,15 +147,26 @@ describe("ic-input-component-container", () => {
|
|
140
147
|
components: [InputComponentContainer],
|
141
148
|
html: `<ic-input-component-container>content</ic-input-component-container>`,
|
142
149
|
});
|
150
|
+
const component = page.rootInstance;
|
151
|
+
const host = page.root;
|
152
|
+
const observerInstance = mockMutationObserverImplementation.mock.results[0].value;
|
143
153
|
const icon = document.createElement("svg");
|
144
154
|
icon.setAttribute("slot", "left-icon");
|
145
|
-
|
155
|
+
observerInstance.observe(host, { childList: true });
|
156
|
+
host.appendChild(icon);
|
157
|
+
const mockMutationRecord = [
|
146
158
|
{
|
147
|
-
type: "childList",
|
148
159
|
addedNodes: [icon],
|
149
160
|
removedNodes: [],
|
161
|
+
target: host,
|
150
162
|
},
|
151
|
-
]
|
163
|
+
];
|
164
|
+
observerInstance.trigger(mockMutationRecord);
|
165
|
+
await page.waitForChanges();
|
166
|
+
expect(mockRenderDynamicChildSlots).toHaveBeenCalledTimes(1);
|
167
|
+
expect(mockRenderDynamicChildSlots).toHaveBeenCalledWith(mockMutationRecord, "left-icon", component);
|
168
|
+
expect(mockHasDynamicChildSlots).toHaveBeenCalledTimes(1);
|
169
|
+
expect(page.root).toMatchSnapshot();
|
152
170
|
});
|
153
171
|
});
|
154
172
|
//# sourceMappingURL=ic-input-component-container.spec.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-input-component-container.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-input-component-container/test/basic/ic-input-component-container.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,uBAAuB,CAAC;YACrC,IAAI,EAAE,sEAAsE;SAC7E,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,uBAAuB,CAAC;YACrC,IAAI,EAAE,kGAAkG;SACzG,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,uBAAuB,CAAC;YACrC,IAAI,EAAE,yHAAyH;SAChI,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;KAS7B,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ent":["import { InputComponentContainer } from \"../../ic-input-component-container\";\nimport { newSpecPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-input-component-container\", () => {\n it(\"should render\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with validation status\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\">content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container> \n `);\n });\n\n it(\"should render with validation inline\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" validation-inline=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default success\" validation-inline=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n content\n <span class=\"inline-success\">\n svg\n </span>\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should ignore validation inline if not success\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"error\" validation-inline=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default error\" validation-inline=\"true\" validation-status=\"error\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with size small, multiline & fullwidth props set\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container size=\"small\" multi-line=true full-width=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"small fullwidth multiline\" full-width=\"true\" multi-line=\"true\" size=\"small\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with size large\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container size=large>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"large\" size=\"large\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render disabled\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" disabled=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default disabled\" aria-disabled=\"true\" disabled=\"true\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n\n page.rootInstance.disabled = false;\n\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render readonly\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" readonly=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default readonly\" readonly=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with slotted content\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" disabled=true><span slot=\"left-icon\">slotted content</span>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default disabled\" aria-disabled=\"true\" disabled=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n <div class=\"icon-container\">\n <span slot=\"left-icon\">\n slotted content\n </span>\n </div>\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should test rendering icon after initial render\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container>content</ic-input-component-container>`,\n });\n\n const icon = document.createElement(\"svg\");\n icon.setAttribute(\"slot\", \"left-icon\");\n\n page.rootInstance.hostMutationCallback([\n {\n type: \"childList\",\n addedNodes: [icon],\n removedNodes: [],\n },\n ]);\n });\n});\n"]}
|
1
|
+
{"version":3,"file":"ic-input-component-container.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-input-component-container/test/basic/ic-input-component-container.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAElC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,QAAQ,CAAC,GAAG,EAAE;QACZ,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,uBAAuB,CAAC;YACrC,IAAI,EAAE,sEAAsE;SAC7E,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,uBAAuB,CAAC;YACrC,IAAI,EAAE,kGAAkG;SACzG,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAA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AAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,MAAM,gBAAgB,GACpB,kCAAkC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAE3D,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAEvC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEpD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvB,MAAM,kBAAkB,GAAyB;YAC/C;gBACE,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,YAAY,EAAE,EAAE;gBAChB,MAAM,EAAE,IAAI;aACb;SACF,CAAC;QAEF,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,CAAC,2BAA2B,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,2BAA2B,CAAC,CAAC,oBAAoB,CACtD,kBAAkB,EAClB,WAAW,EACX,SAAS,CACV,CAAC;QAEF,MAAM,CAAC,wBAAwB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAE1D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n mockHasDynamicChildSlots,\n mockMutationObserverImplementation,\n MockMutationRecord,\n mockRenderDynamicChildSlots,\n} from \"../../../../testspec.setup\";\nimport { InputComponentContainer } from \"../../ic-input-component-container\";\nimport { newSpecPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-input-component-container\", () => {\n afterAll(() => {\n jest.restoreAllMocks();\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n it(\"should render\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with validation status\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\">content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container> \n `);\n });\n\n it(\"should render with validation inline\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" validation-inline=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default success\" validation-inline=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n content\n <span class=\"inline-success\">\n svg\n </span>\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should ignore validation inline if not success\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"error\" validation-inline=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default error\" validation-inline=\"true\" validation-status=\"error\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with size small, multiline & fullwidth props set\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container size=\"small\" multi-line=true full-width=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"small fullwidth multiline\" full-width=\"true\" multi-line=\"true\" size=\"small\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with size large\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container size=large>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"large\" size=\"large\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render disabled\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" disabled=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default disabled\" aria-disabled=\"true\" disabled=\"true\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n\n page.rootInstance.disabled = false;\n\n await page.waitForChanges();\n expect(page.root).toEqualHtml(`\n <ic-input-component-container validation-status=\"success\" class=\"default success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render readonly\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" readonly=true>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default readonly\" readonly=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should render with slotted content\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container validation-status=\"success\" disabled=true><span slot=\"left-icon\">slotted content</span>content</ic-input-component-container>`,\n });\n\n expect(page.root).toEqualHtml(`\n <ic-input-component-container class=\"default disabled\" aria-disabled=\"true\" disabled=\"true\" validation-status=\"success\">\n <div class=\"focus-indicator\">\n <div class=\"icon-container\">\n <span slot=\"left-icon\">\n slotted content\n </span>\n </div>\n content\n </div>\n </ic-input-component-container>\n `);\n });\n\n it(\"should test rendering icon after initial render\", async () => {\n const page = await newSpecPage({\n components: [InputComponentContainer],\n html: `<ic-input-component-container>content</ic-input-component-container>`,\n });\n\n const component = page.rootInstance;\n const host = page.root;\n\n const observerInstance =\n mockMutationObserverImplementation.mock.results[0].value;\n\n const icon = document.createElement(\"svg\");\n icon.setAttribute(\"slot\", \"left-icon\");\n\n observerInstance.observe(host, { childList: true });\n\n host.appendChild(icon);\n\n const mockMutationRecord: MockMutationRecord[] = [\n {\n addedNodes: [icon],\n removedNodes: [],\n target: host,\n },\n ];\n\n observerInstance.trigger(mockMutationRecord);\n\n await page.waitForChanges();\n\n expect(mockRenderDynamicChildSlots).toHaveBeenCalledTimes(1);\n expect(mockRenderDynamicChildSlots).toHaveBeenCalledWith(\n mockMutationRecord,\n \"left-icon\",\n component\n );\n\n expect(mockHasDynamicChildSlots).toHaveBeenCalledTimes(1);\n\n expect(page.root).toMatchSnapshot();\n });\n});\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Host, h, forceUpdate, } from "@stencil/core";
|
2
2
|
import { IcInformationStatus, } from "../../utils/types";
|
3
|
-
import { inheritAttributes, debounceEvent, getInputDescribedByText, renderHiddenInput, isEmptyString, onComponentRequiredPropUndefined, addFormResetListener, removeFormResetListener, isSlotUsed, removeDisabledFalse, checkSlotInChildMutations, } from "../../utils/helpers";
|
3
|
+
import { inheritAttributes, debounceEvent, getInputDescribedByText, renderHiddenInput, isEmptyString, onComponentRequiredPropUndefined, addFormResetListener, removeFormResetListener, isSlotUsed, removeDisabledFalse, checkSlotInChildMutations, removeHiddenInput, } from "../../utils/helpers";
|
4
4
|
import { IC_INHERITED_ARIA } from "../../utils/constants";
|
5
5
|
let inputIds = 0;
|
6
6
|
const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "title"];
|
@@ -11,8 +11,9 @@ export class TextField {
|
|
11
11
|
constructor() {
|
12
12
|
this.inheritedAttributes = {};
|
13
13
|
this.hostMutationObserver = null;
|
14
|
+
this.getNumberOfCharacters = (value) => value !== null && value !== undefined ? value.length : 0;
|
14
15
|
this.getMaxLengthExceeded = (value) => {
|
15
|
-
this.numChars = value
|
16
|
+
this.numChars = this.getNumberOfCharacters(value);
|
16
17
|
if (this.type === "number") {
|
17
18
|
this.minValueUnattained = value && Number(value) < Number(this.min);
|
18
19
|
this.maxValueExceeded = Number(value) > Number(this.max);
|
@@ -22,7 +23,7 @@ export class TextField {
|
|
22
23
|
}
|
23
24
|
};
|
24
25
|
this.getMaxCharactersReached = (value) => {
|
25
|
-
this.numChars = value
|
26
|
+
this.numChars = this.getNumberOfCharacters(value);
|
26
27
|
this.maxCharactersReached =
|
27
28
|
this.maxCharacters > 0 ? this.numChars >= this.maxCharacters : false;
|
28
29
|
if (this.maxCharactersError && !this.maxCharactersReached) {
|
@@ -223,12 +224,12 @@ export class TextField {
|
|
223
224
|
const disabledText = disabledMode && !readonly;
|
224
225
|
const showLeftIcon = !!this.el.querySelector(`[slot="icon"]`) && !disabledText;
|
225
226
|
const invalid = `${currentStatus === IcInformationStatus.Error}`;
|
226
|
-
|
227
|
-
renderHiddenInput(true, this.el, name, value, disabledMode)
|
228
|
-
|
227
|
+
hiddenInput
|
228
|
+
? renderHiddenInput(true, this.el, name, value, disabledMode)
|
229
|
+
: removeHiddenInput(this.el);
|
229
230
|
return (h(Host, { class: { ["fullwidth"]: fullWidth } }, h("ic-input-container", { readonly: readonly, disabled: disabledMode }, !this.hideLabel && (h("ic-input-label", { for: inputId, label: label, helperText: helperText, required: required, disabled: disabledText, readonly: readonly })), h("ic-input-component-container", { size: small ? "small" : size, validationStatus: currentStatus, multiLine: multiline, disabled: disabledMode, readonly: readonly, validationInline: validationInline, fullWidth: fullWidth }, showLeftIcon && (h("span", { class: {
|
230
231
|
["readonly"]: readonly,
|
231
|
-
["has-value"]: value
|
232
|
+
["has-value"]: this.getNumberOfCharacters(value) > 0,
|
232
233
|
}, slot: "left-icon" }, h("slot", { name: "icon" }))), !multiline ? (h("input", Object.assign({ id: inputId, name: name, ref: (el) => (this.inputEl = el), type: this.type, min: min, max: max, value: value, class: {
|
233
234
|
["no-left-pad"]: !showLeftIcon && readonly,
|
234
235
|
["readonly"]: readonly,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-text-field.js","sourceRoot":"","sources":["../../../src/components/ic-text-field/ic-text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,CAAC,EACD,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,GAMpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EAChC,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,MAAM,kBAAkB,GAAG,CAAC,GAAG,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAE3D;;GAEG;AAMH,MAAM,OAAO,SAAS;;QACZ,wBAAmB,GAA4B,EAAE,CAAC;QAElD,yBAAoB,GAAqB,IAAI,CAAC;QAgV9C,yBAAoB,GAAG,CAAC,KAAa,EAAE,EAAE;YAC/C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;YAE7B,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACpE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG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ventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n forceUpdate,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcInformationStatusOrEmpty,\n IcValueEventDetail,\n IcSizesNoLarge,\n} from \"../../utils/types\";\nimport {\n inheritAttributes,\n debounceEvent,\n getInputDescribedByText,\n renderHiddenInput,\n isEmptyString,\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n isSlotUsed,\n removeDisabledFalse,\n checkSlotInChildMutations,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcAriaAutocompleteTypes,\n IcTextFieldInputModes,\n IcTextFieldTypes,\n} from \"./ic-text-field.types\";\n\nlet inputIds = 0;\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the text input.\n */\n@Component({\n tag: \"ic-text-field\",\n styleUrl: \"ic-text-field.css\",\n shadow: true,\n})\nexport class TextField {\n private inheritedAttributes: { [k: string]: string } = {};\n private inputEl: HTMLInputElement | HTMLTextAreaElement;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcTextFieldElement;\n\n @State() numChars: number = 0;\n @State() maxCharactersReached: boolean = false;\n @State() maxCharactersError: boolean = false;\n @State() minCharactersUnattained: boolean = false;\n @State() maxLengthExceeded: boolean = false;\n @State() maxValueExceeded: boolean = false;\n @State() minValueUnattained: boolean = false;\n\n /**\n * @slot clear-button - an ic-button clear component will render as an end adornment to the input.\n * @slot search-submit-button - an ic-button search submit component will render as an end adornment to the input.\n * @slot menu - an ic-menu component will appear below the input.\n */\n\n /**\n * @internal The active element when focus is on the ic-menu items.\n */\n @Prop() ariaActiveDescendant?: string;\n\n /**\n * @internal Used to identify whether inputting any text triggers more predictions\n */\n @Prop() ariaAutocomplete: IcAriaAutocompleteTypes = undefined;\n\n /**\n * @internal Used to identify if the slotted menu is rendered\n */\n @Prop() ariaExpanded: string;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwns: string;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autoFocus = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * Specify whether the text field fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth: boolean = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * @internal If `true`, the hidden form input will stop rendering for form submission.\n */\n @Prop() hiddenInput: boolean = true;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-text-field-input-${inputIds++}`;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode: IcTextFieldInputModes = \"text\";\n\n /**\n * The label for the input.\n */\n @Prop() label!: string;\n\n /**\n * The maximum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of max value in `helperText` or `label`)\n */\n @Prop() max: string | number = undefined;\n\n /**\n * The maximum number of characters that can be entered in the field. Will display an error if too many characters are entered.\n */\n @Prop() maxCharacters: number = 0;\n\n /**\n * The count of characters in the field. Will display a warning if the bound is reached.\n */\n @Prop() maxLength: number = 0;\n\n /**\n * The text to display as the validation message when the maximum length is exceeded.\n */\n @Prop() maxLengthMessage: string = \"Maximum length exceeded\";\n\n /**\n * The minimum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of min value in `helperText` or `label`)\n */\n @Prop() min: string | number = undefined;\n\n /**\n * The minimum number of characters that can be entered in the field.\n */\n @Prop() minCharacters: number = 0;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * The placeholder value to be displayed.\n */\n @Prop() placeholder: string = \"\";\n\n /**\n * If `true`, the read only state will be set.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the multiline text area will be resizeable.\n */\n @Prop() resize: boolean = false;\n\n /**\n * @internal Used to set the role if not default textbox;\n */\n @Prop() role: string;\n\n /**\n * The number of rows to transform the text field into a text area with a specific height.\n */\n @Prop() rows: number = 1;\n\n /**\n * The size of the text field component.\n */\n @Prop() size?: IcSizesNoLarge = \"default\";\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * If `true`, the value of the text field will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n /**\n * @internal If `true`, an ellipsis will be displayed at the end of the value if the value is longer than the container.\n */\n @Prop() truncateValue?: boolean;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: IcTextFieldTypes = \"text\";\n\n /**\n * If `true`, the icon in input control will be displayed - only applies when validationStatus ='success'.\n */\n @Prop() validationInline: boolean = false;\n\n /**\n * @internal If `true`, the validation will display inline.\n */\n @Prop() validationInlineInternal: boolean = false;\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce: number = 0;\n\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = \"\";\n @State() initialValue = this.value;\n\n @Watch(\"value\")\n private watchValueHandler(newValue: string): void {\n if (this.inputEl && this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n\n this.getMaxLengthExceeded(newValue);\n\n this.getMaxCharactersReached(newValue);\n\n this.icChange.emit({ value: newValue });\n }\n\n /**\n * @internal Emitted when the validationInlineInternal is `true`\n */\n @Event() getValidationText: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input loses focus.\n */\n @Event() icBlur: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input gains focus.\n */\n @Event() icFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n if (this.value !== this.initialValue) {\n this.watchValueHandler(this.value);\n }\n\n this.getMaxLengthExceeded(this.value);\n\n this.getMaxCharactersReached(this.value);\n\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n\n if (this.readonly) {\n this.maxLengthExceeded = false;\n this.maxValueExceeded = false;\n this.minValueUnattained = false;\n }\n\n addFormResetListener(this.el, this.handleFormReset);\n\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Text Field\"\n );\n if (this.validationInlineInternal) {\n this.getValidationText.emit({ value: this.validationText });\n }\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n childList: true,\n });\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n this.icKeydown.emit({ event: ev });\n this.maxCharactersError = this.maxCharactersReached;\n }\n\n /**\n * Sets focus on the native `input`.\n */\n\n @Method()\n async setFocus(): Promise<void> {\n this.inputEl?.focus();\n }\n\n private getMaxLengthExceeded = (value: string) => {\n this.numChars = value.length;\n\n if (this.type === \"number\") {\n this.minValueUnattained = value && Number(value) < Number(this.min);\n this.maxValueExceeded = Number(value) > Number(this.max);\n }\n\n if (this.maxLength > 0) {\n this.maxLengthExceeded = this.numChars > this.maxLength;\n }\n };\n\n private getMaxCharactersReached = (value: string) => {\n this.numChars = value.length;\n this.maxCharactersReached =\n this.maxCharacters > 0 ? this.numChars >= this.maxCharacters : false;\n\n if (this.maxCharactersError && !this.maxCharactersReached) {\n this.maxCharactersError = false;\n }\n };\n\n private onInput = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n };\n\n private onBlur = (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value;\n this.numChars = value.length;\n this.minCharactersUnattained =\n this.minCharacters > 0 ? this.numChars < this.minCharacters : false;\n this.icBlur.emit({ value: value });\n };\n\n private onFocus = (ev: Event) => {\n this.icFocus.emit({ value: (ev.target as HTMLInputElement).value });\n };\n\n private hasStatus = (status: IcInformationStatusOrEmpty) =>\n status !== \"\" && !this.disabled;\n\n private handleFormReset = (): void => {\n this.value = this.initialValue;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(\n ({ attributeName, type, addedNodes, removedNodes }) => {\n if (MUTABLE_ATTRIBUTES.includes(attributeName)) {\n this.inheritedAttributes[attributeName] =\n this.el.getAttribute(attributeName);\n forceComponentUpdate = true;\n } else if (type === \"childList\") {\n forceComponentUpdate = checkSlotInChildMutations(\n addedNodes,\n removedNodes,\n \"icon\"\n );\n }\n }\n );\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private showValidation = (): boolean => {\n const maxNumChars = this.readonly ? 0 : this.maxLength;\n const emptyString =\n isEmptyString(this.validationStatus) ||\n isEmptyString(this.validationText);\n const valueOutsideRange = this.minValueUnattained || this.maxValueExceeded;\n const charOutsideRange =\n maxNumChars > 0 ||\n this.maxCharactersError ||\n this.minCharactersUnattained;\n return (\n (!emptyString || valueOutsideRange || charOutsideRange) &&\n !this.validationInlineInternal\n );\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n small,\n placeholder,\n helperText,\n rows,\n resize,\n disabled,\n value,\n min,\n max,\n maxLength,\n numChars,\n readonly,\n maxLengthExceeded,\n maxCharacters,\n maxCharactersError,\n maxCharactersReached,\n minCharacters,\n minCharactersUnattained,\n minValueUnattained,\n maxValueExceeded,\n validationStatus,\n validationText,\n validationInline,\n validationInlineInternal,\n spellcheck,\n inputmode,\n fullWidth,\n truncateValue,\n hiddenInput,\n showValidation,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const currentStatus =\n maxLengthExceeded ||\n maxValueExceeded ||\n minValueUnattained ||\n minCharactersUnattained ||\n maxCharactersError\n ? maxCharactersError\n ? IcInformationStatus.Warning\n : IcInformationStatus.Error\n : validationStatus;\n\n const currentValidationText = maxLengthExceeded\n ? this.maxLengthMessage\n : maxCharactersError\n ? `Maximum input is ${maxCharacters} characters`\n : maxValueExceeded\n ? `Maximum value of ${max} exceeded`\n : minValueUnattained\n ? `Minimum value of ${min} not met`\n : minCharactersUnattained\n ? `Minimum input is ${minCharacters} characters`\n : validationText;\n\n const maxNumChars = readonly ? 0 : maxLength;\n const messageAriaLive =\n maxLengthExceeded ||\n maxCharactersError ||\n maxValueExceeded ||\n minValueUnattained ||\n (maxLength === 0 && currentStatus === IcInformationStatus.Error)\n ? \"assertive\"\n : \"polite\";\n\n const showStatusText =\n this.hasStatus(currentStatus) &&\n !(currentStatus == IcInformationStatus.Success && validationInline) &&\n !validationInlineInternal;\n\n const multiline = rows > 1;\n const hiddenCharCountDescId =\n maxLength > 0 ? `${inputId}-charcount-desc` : \"\";\n\n const describedBy = `${hiddenCharCountDescId} ${getInputDescribedByText(\n inputId,\n helperText !== \"\",\n showStatusText\n )}`.trim();\n\n const disabledText = disabledMode && !readonly;\n const showLeftIcon =\n !!this.el.querySelector(`[slot=\"icon\"]`) && !disabledText;\n\n const invalid = `${currentStatus === IcInformationStatus.Error}`;\n\n if (hiddenInput) {\n renderHiddenInput(true, this.el, name, value, disabledMode);\n }\n return (\n <Host class={{ [\"fullwidth\"]: fullWidth }}>\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!this.hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledText}\n readonly={readonly}\n ></ic-input-label>\n )}\n\n <ic-input-component-container\n size={small ? \"small\" : size}\n validationStatus={currentStatus}\n multiLine={multiline}\n disabled={disabledMode}\n readonly={readonly}\n validationInline={validationInline}\n fullWidth={fullWidth}\n >\n {showLeftIcon && (\n <span\n class={{\n [\"readonly\"]: readonly,\n [\"has-value\"]: value.length > 0,\n }}\n slot=\"left-icon\"\n >\n <slot name=\"icon\" />\n </span>\n )}\n\n {!multiline ? (\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLInputElement)}\n type={this.type}\n min={min}\n max={max}\n value={value}\n class={{\n [\"no-left-pad\"]: !showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n [\"truncate-value\"]: truncateValue,\n }}\n placeholder={placeholder ? placeholder : \"\"}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-activedescendant={this.ariaActiveDescendant}\n aria-expanded={this.ariaExpanded}\n aria-owns={this.ariaOwns}\n autocomplete={this.autocomplete}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n role={this.role}\n maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\n {...this.inheritedAttributes}\n ></input>\n ) : (\n <textarea\n id={inputId}\n class={{\n [\"no-resize\"]: resize === false || readonly,\n [\"no-left-pad\"]: !showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n }}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLTextAreaElement)}\n value={value}\n rows={rows}\n required={required}\n disabled={disabledMode}\n placeholder={placeholder ? placeholder : \"\"}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\n {...this.inheritedAttributes}\n ></textarea>\n )}\n {isSlotUsed(this.el, \"clear-button\") && (\n <slot name=\"clear-button\"></slot>\n )}\n {isSlotUsed(this.el, \"search-submit-button\") && (\n <slot name=\"search-submit-button\"></slot>\n )}\n </ic-input-component-container>\n {isSlotUsed(this.el, \"menu\") && <slot name=\"menu\"></slot>}\n {showValidation() && (\n <ic-input-validation\n status={\n this.hasStatus(currentStatus) === false ||\n (currentStatus === IcInformationStatus.Success &&\n validationInline) ||\n validationInlineInternal\n ? \"\"\n : currentStatus\n }\n message={showStatusText ? currentValidationText : \"\"}\n ariaLiveMode={messageAriaLive}\n for={inputId}\n fullWidth={fullWidth}\n >\n {!readonly && maxNumChars > 0 && (\n <div slot=\"validation-message-adornment\">\n <ic-typography\n variant=\"caption\"\n class={{\n [\"maxlengthtext\"]: true,\n [\"error\"]: maxLengthExceeded,\n [\"disabled\"]: disabledText,\n }}\n >\n <span\n aria-live=\"polite\"\n id={`${inputId}-charcount`}\n class=\"charcount\"\n >\n {numChars}/{maxNumChars}\n </span>\n <span hidden={true} id={hiddenCharCountDescId}>\n Field can contain a maximum of {maxNumChars} characters.\n </span>\n </ic-typography>\n </div>\n )}\n </ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-text-field.js","sourceRoot":"","sources":["../../../src/components/ic-text-field/ic-text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,CAAC,EACD,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,GAMpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,gCAAgC,EAChC,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,MAAM,kBAAkB,GAAG,CAAC,GAAG,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAE3D;;GAEG;AAMH,MAAM,OAAO,SAAS;;QACZ,wBAAmB,GAA4B,EAAE,CAAC;QAElD,yBAAoB,GAAqB,IAAI,CAAC;QAgV9C,0BAAqB,GAAG,CAAC,KAAa,EAAE,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n forceUpdate,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcInformationStatusOrEmpty,\n IcValueEventDetail,\n IcSizesNoLarge,\n} from \"../../utils/types\";\nimport {\n inheritAttributes,\n debounceEvent,\n getInputDescribedByText,\n renderHiddenInput,\n isEmptyString,\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n isSlotUsed,\n removeDisabledFalse,\n checkSlotInChildMutations,\n removeHiddenInput,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcAriaAutocompleteTypes,\n IcTextFieldInputModes,\n IcTextFieldTypes,\n} from \"./ic-text-field.types\";\n\nlet inputIds = 0;\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the text input.\n */\n@Component({\n tag: \"ic-text-field\",\n styleUrl: \"ic-text-field.css\",\n shadow: true,\n})\nexport class TextField {\n private inheritedAttributes: { [k: string]: string } = {};\n private inputEl: HTMLInputElement | HTMLTextAreaElement;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcTextFieldElement;\n\n @State() numChars: number = 0;\n @State() maxCharactersReached: boolean = false;\n @State() maxCharactersError: boolean = false;\n @State() minCharactersUnattained: boolean = false;\n @State() maxLengthExceeded: boolean = false;\n @State() maxValueExceeded: boolean = false;\n @State() minValueUnattained: boolean = false;\n\n /**\n * @slot clear-button - an ic-button clear component will render as an end adornment to the input.\n * @slot search-submit-button - an ic-button search submit component will render as an end adornment to the input.\n * @slot menu - an ic-menu component will appear below the input.\n */\n\n /**\n * @internal The active element when focus is on the ic-menu items.\n */\n @Prop() ariaActiveDescendant?: string;\n\n /**\n * @internal Used to identify whether inputting any text triggers more predictions\n */\n @Prop() ariaAutocomplete: IcAriaAutocompleteTypes = undefined;\n\n /**\n * @internal Used to identify if the slotted menu is rendered\n */\n @Prop() ariaExpanded: string;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwns: string;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autoFocus = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * Specify whether the text field fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth: boolean = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * @internal If `true`, the hidden form input will stop rendering for form submission.\n */\n @Prop() hiddenInput: boolean = true;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-text-field-input-${inputIds++}`;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode: IcTextFieldInputModes = \"text\";\n\n /**\n * The label for the input.\n */\n @Prop() label!: string;\n\n /**\n * The maximum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of max value in `helperText` or `label`)\n */\n @Prop() max: string | number = undefined;\n\n /**\n * The maximum number of characters that can be entered in the field. Will display an error if too many characters are entered.\n */\n @Prop() maxCharacters: number = 0;\n\n /**\n * The count of characters in the field. Will display a warning if the bound is reached.\n */\n @Prop() maxLength: number = 0;\n\n /**\n * The text to display as the validation message when the maximum length is exceeded.\n */\n @Prop() maxLengthMessage: string = \"Maximum length exceeded\";\n\n /**\n * The minimum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of min value in `helperText` or `label`)\n */\n @Prop() min: string | number = undefined;\n\n /**\n * The minimum number of characters that can be entered in the field.\n */\n @Prop() minCharacters: number = 0;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * The placeholder value to be displayed.\n */\n @Prop() placeholder: string = \"\";\n\n /**\n * If `true`, the read only state will be set.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the multiline text area will be resizeable.\n */\n @Prop() resize: boolean = false;\n\n /**\n * @internal Used to set the role if not default textbox;\n */\n @Prop() role: string;\n\n /**\n * The number of rows to transform the text field into a text area with a specific height.\n */\n @Prop() rows: number = 1;\n\n /**\n * The size of the text field component.\n */\n @Prop() size?: IcSizesNoLarge = \"default\";\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\n\n /**\n * If `true`, the value of the text field will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n /**\n * @internal If `true`, an ellipsis will be displayed at the end of the value if the value is longer than the container.\n */\n @Prop() truncateValue?: boolean;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: IcTextFieldTypes = \"text\";\n\n /**\n * If `true`, the icon in input control will be displayed - only applies when validationStatus ='success'.\n */\n @Prop() validationInline: boolean = false;\n\n /**\n * @internal If `true`, the validation will display inline.\n */\n @Prop() validationInlineInternal: boolean = false;\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce: number = 0;\n\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = \"\";\n @State() initialValue = this.value;\n\n @Watch(\"value\")\n private watchValueHandler(newValue: string): void {\n if (this.inputEl && this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n\n this.getMaxLengthExceeded(newValue);\n\n this.getMaxCharactersReached(newValue);\n\n this.icChange.emit({ value: newValue });\n }\n\n /**\n * @internal Emitted when the validationInlineInternal is `true`\n */\n @Event() getValidationText: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input loses focus.\n */\n @Event() icBlur: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input gains focus.\n */\n @Event() icFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n if (this.value !== this.initialValue) {\n this.watchValueHandler(this.value);\n }\n\n this.getMaxLengthExceeded(this.value);\n\n this.getMaxCharactersReached(this.value);\n\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n\n if (this.readonly) {\n this.maxLengthExceeded = false;\n this.maxValueExceeded = false;\n this.minValueUnattained = false;\n }\n\n addFormResetListener(this.el, this.handleFormReset);\n\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Text Field\"\n );\n if (this.validationInlineInternal) {\n this.getValidationText.emit({ value: this.validationText });\n }\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n childList: true,\n });\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n this.icKeydown.emit({ event: ev });\n this.maxCharactersError = this.maxCharactersReached;\n }\n\n /**\n * Sets focus on the native `input`.\n */\n\n @Method()\n async setFocus(): Promise<void> {\n this.inputEl?.focus();\n }\n\n private getNumberOfCharacters = (value: string) =>\n value !== null && value !== undefined ? value.length : 0;\n\n private getMaxLengthExceeded = (value: string) => {\n this.numChars = this.getNumberOfCharacters(value);\n\n if (this.type === \"number\") {\n this.minValueUnattained = value && Number(value) < Number(this.min);\n this.maxValueExceeded = Number(value) > Number(this.max);\n }\n\n if (this.maxLength > 0) {\n this.maxLengthExceeded = this.numChars > this.maxLength;\n }\n };\n\n private getMaxCharactersReached = (value: string) => {\n this.numChars = this.getNumberOfCharacters(value);\n\n this.maxCharactersReached =\n this.maxCharacters > 0 ? this.numChars >= this.maxCharacters : false;\n\n if (this.maxCharactersError && !this.maxCharactersReached) {\n this.maxCharactersError = false;\n }\n };\n\n private onInput = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n };\n\n private onBlur = (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value;\n this.numChars = value.length;\n this.minCharactersUnattained =\n this.minCharacters > 0 ? this.numChars < this.minCharacters : false;\n this.icBlur.emit({ value: value });\n };\n\n private onFocus = (ev: Event) => {\n this.icFocus.emit({ value: (ev.target as HTMLInputElement).value });\n };\n\n private hasStatus = (status: IcInformationStatusOrEmpty) =>\n status !== \"\" && !this.disabled;\n\n private handleFormReset = (): void => {\n this.value = this.initialValue;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(\n ({ attributeName, type, addedNodes, removedNodes }) => {\n if (MUTABLE_ATTRIBUTES.includes(attributeName)) {\n this.inheritedAttributes[attributeName] =\n this.el.getAttribute(attributeName);\n forceComponentUpdate = true;\n } else if (type === \"childList\") {\n forceComponentUpdate = checkSlotInChildMutations(\n addedNodes,\n removedNodes,\n \"icon\"\n );\n }\n }\n );\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private showValidation = (): boolean => {\n const maxNumChars = this.readonly ? 0 : this.maxLength;\n const emptyString =\n isEmptyString(this.validationStatus) ||\n isEmptyString(this.validationText);\n const valueOutsideRange = this.minValueUnattained || this.maxValueExceeded;\n const charOutsideRange =\n maxNumChars > 0 ||\n this.maxCharactersError ||\n this.minCharactersUnattained;\n return (\n (!emptyString || valueOutsideRange || charOutsideRange) &&\n !this.validationInlineInternal\n );\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n small,\n placeholder,\n helperText,\n rows,\n resize,\n disabled,\n value,\n min,\n max,\n maxLength,\n numChars,\n readonly,\n maxLengthExceeded,\n maxCharacters,\n maxCharactersError,\n maxCharactersReached,\n minCharacters,\n minCharactersUnattained,\n minValueUnattained,\n maxValueExceeded,\n validationStatus,\n validationText,\n validationInline,\n validationInlineInternal,\n spellcheck,\n inputmode,\n fullWidth,\n truncateValue,\n hiddenInput,\n showValidation,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const currentStatus =\n maxLengthExceeded ||\n maxValueExceeded ||\n minValueUnattained ||\n minCharactersUnattained ||\n maxCharactersError\n ? maxCharactersError\n ? IcInformationStatus.Warning\n : IcInformationStatus.Error\n : validationStatus;\n\n const currentValidationText = maxLengthExceeded\n ? this.maxLengthMessage\n : maxCharactersError\n ? `Maximum input is ${maxCharacters} characters`\n : maxValueExceeded\n ? `Maximum value of ${max} exceeded`\n : minValueUnattained\n ? `Minimum value of ${min} not met`\n : minCharactersUnattained\n ? `Minimum input is ${minCharacters} characters`\n : validationText;\n\n const maxNumChars = readonly ? 0 : maxLength;\n const messageAriaLive =\n maxLengthExceeded ||\n maxCharactersError ||\n maxValueExceeded ||\n minValueUnattained ||\n (maxLength === 0 && currentStatus === IcInformationStatus.Error)\n ? \"assertive\"\n : \"polite\";\n\n const showStatusText =\n this.hasStatus(currentStatus) &&\n !(currentStatus == IcInformationStatus.Success && validationInline) &&\n !validationInlineInternal;\n\n const multiline = rows > 1;\n const hiddenCharCountDescId =\n maxLength > 0 ? `${inputId}-charcount-desc` : \"\";\n\n const describedBy = `${hiddenCharCountDescId} ${getInputDescribedByText(\n inputId,\n helperText !== \"\",\n showStatusText\n )}`.trim();\n\n const disabledText = disabledMode && !readonly;\n const showLeftIcon =\n !!this.el.querySelector(`[slot=\"icon\"]`) && !disabledText;\n\n const invalid = `${currentStatus === IcInformationStatus.Error}`;\n\n hiddenInput\n ? renderHiddenInput(true, this.el, name, value, disabledMode)\n : removeHiddenInput(this.el);\n\n return (\n <Host class={{ [\"fullwidth\"]: fullWidth }}>\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!this.hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledText}\n readonly={readonly}\n ></ic-input-label>\n )}\n\n <ic-input-component-container\n size={small ? \"small\" : size}\n validationStatus={currentStatus}\n multiLine={multiline}\n disabled={disabledMode}\n readonly={readonly}\n validationInline={validationInline}\n fullWidth={fullWidth}\n >\n {showLeftIcon && (\n <span\n class={{\n [\"readonly\"]: readonly,\n [\"has-value\"]: this.getNumberOfCharacters(value) > 0,\n }}\n slot=\"left-icon\"\n >\n <slot name=\"icon\" />\n </span>\n )}\n\n {!multiline ? (\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLInputElement)}\n type={this.type}\n min={min}\n max={max}\n value={value}\n class={{\n [\"no-left-pad\"]: !showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n [\"truncate-value\"]: truncateValue,\n }}\n placeholder={placeholder ? placeholder : \"\"}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-activedescendant={this.ariaActiveDescendant}\n aria-expanded={this.ariaExpanded}\n aria-owns={this.ariaOwns}\n autocomplete={this.autocomplete}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n role={this.role}\n maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\n {...this.inheritedAttributes}\n ></input>\n ) : (\n <textarea\n id={inputId}\n class={{\n [\"no-resize\"]: resize === false || readonly,\n [\"no-left-pad\"]: !showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n }}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLTextAreaElement)}\n value={value}\n rows={rows}\n required={required}\n disabled={disabledMode}\n placeholder={placeholder ? placeholder : \"\"}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\n {...this.inheritedAttributes}\n ></textarea>\n )}\n {isSlotUsed(this.el, \"clear-button\") && (\n <slot name=\"clear-button\"></slot>\n )}\n {isSlotUsed(this.el, \"search-submit-button\") && (\n <slot name=\"search-submit-button\"></slot>\n )}\n </ic-input-component-container>\n {isSlotUsed(this.el, \"menu\") && <slot name=\"menu\"></slot>}\n {showValidation() && (\n <ic-input-validation\n status={\n this.hasStatus(currentStatus) === false ||\n (currentStatus === IcInformationStatus.Success &&\n validationInline) ||\n validationInlineInternal\n ? \"\"\n : currentStatus\n }\n message={showStatusText ? currentValidationText : \"\"}\n ariaLiveMode={messageAriaLive}\n for={inputId}\n fullWidth={fullWidth}\n >\n {!readonly && maxNumChars > 0 && (\n <div slot=\"validation-message-adornment\">\n <ic-typography\n variant=\"caption\"\n class={{\n [\"maxlengthtext\"]: true,\n [\"error\"]: maxLengthExceeded,\n [\"disabled\"]: disabledText,\n }}\n >\n <span\n aria-live=\"polite\"\n id={`${inputId}-charcount`}\n class=\"charcount\"\n >\n {numChars}/{maxNumChars}\n </span>\n <span hidden={true} id={hiddenCharCountDescId}>\n Field can contain a maximum of {maxNumChars} characters.\n </span>\n </ic-typography>\n </div>\n )}\n </ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"]}
|
@@ -29,6 +29,7 @@ export class ToggleButton {
|
|
29
29
|
this.loading = false;
|
30
30
|
this.size = "default";
|
31
31
|
this.toggleChecked = false;
|
32
|
+
this.tooltipPlacement = "bottom";
|
32
33
|
this.variant = "default";
|
33
34
|
}
|
34
35
|
watchDisabledHandler() {
|
@@ -75,7 +76,7 @@ export class ToggleButton {
|
|
75
76
|
["icon"]: this.variant === "icon",
|
76
77
|
[`${this.size}`]: true,
|
77
78
|
["loading"]: this.loading,
|
78
|
-
}, onFocus: this.handleFocus }, h("ic-button", { "aria-pressed": this.toggleChecked.toString(), variant: this.variant === "icon" ? "icon" : "secondary", onClick: this.handleClick, title: this.accessibleLabel, "aria-label": `${this.accessibleLabel ? this.accessibleLabel : this.label}, ${this.toggleChecked ? "ticked" : "unticked"}`, disabled: this.disabled, appearance: this.appearance, size: this.size, fullWidth: this.fullWidth, loading: this.loading, "aria-disabled": `${this.disabled}
|
79
|
+
}, onFocus: this.handleFocus }, h("ic-button", { "aria-pressed": this.toggleChecked.toString(), variant: this.variant === "icon" ? "icon" : "secondary", onClick: this.handleClick, title: this.accessibleLabel, "aria-label": `${this.accessibleLabel ? this.accessibleLabel : this.label}, ${this.toggleChecked ? "ticked" : "unticked"}`, disabled: this.disabled, appearance: this.appearance, size: this.size, fullWidth: this.fullWidth, loading: this.loading, "aria-disabled": `${this.disabled}`, tooltipPlacement: this.tooltipPlacement }, this.variant !== "icon" && this.label, h("slot", null), isSlotUsed(this.el, "icon") && (h("slot", { name: "icon", slot: `${this.iconPosition ? `${this.iconPosition}-icon` : "icon"}` })), isSlotUsed(this.el, "badge") && (h("slot", { name: "badge", slot: "badge" })))));
|
79
80
|
}
|
80
81
|
static get is() { return "ic-toggle-button"; }
|
81
82
|
static get encapsulation() { return "shadow"; }
|
@@ -263,6 +264,30 @@ export class ToggleButton {
|
|
263
264
|
"reflect": true,
|
264
265
|
"defaultValue": "false"
|
265
266
|
},
|
267
|
+
"tooltipPlacement": {
|
268
|
+
"type": "string",
|
269
|
+
"mutable": false,
|
270
|
+
"complexType": {
|
271
|
+
"original": "IcButtonTooltipPlacement",
|
272
|
+
"resolved": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
273
|
+
"references": {
|
274
|
+
"IcButtonTooltipPlacement": {
|
275
|
+
"location": "import",
|
276
|
+
"path": "../../utils/types",
|
277
|
+
"id": "src/utils/types.ts::IcButtonTooltipPlacement"
|
278
|
+
}
|
279
|
+
}
|
280
|
+
},
|
281
|
+
"required": false,
|
282
|
+
"optional": false,
|
283
|
+
"docs": {
|
284
|
+
"tags": [],
|
285
|
+
"text": "The position of the tooltip in relation to the toggle button."
|
286
|
+
},
|
287
|
+
"attribute": "tooltip-placement",
|
288
|
+
"reflect": false,
|
289
|
+
"defaultValue": "\"bottom\""
|
290
|
+
},
|
266
291
|
"variant": {
|
267
292
|
"type": "string",
|
268
293
|
"mutable": false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-toggle-button.js","sourceRoot":"","sources":["../../../src/components/ic-toggle-button/ic-toggle-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,KAAK,EAEL,MAAM,EACN,CAAC,EACD,WAAW,EACX,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"ic-toggle-button.js","sourceRoot":"","sources":["../../../src/components/ic-toggle-button/ic-toggle-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,KAAK,EAEL,MAAM,EACN,CAAC,EACD,WAAW,EACX,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAO7B;;;GAGG;AASH,MAAM,OAAO,YAAY;;QAEf,yBAAoB,GAAqB,IAAI,CAAC;QA4G9C,yBAAoB,GAAG,GAAS,EAAE;YACxC,WAAW,CAAC,IAAI,CAAC,CAAC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\n Event,\n EventEmitter,\n Listen,\n h,\n forceUpdate,\n Watch,\n} from \"@stencil/core\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcButtonTooltipPlacement,\n IcSizes,\n IcThemeForeground,\n} from \"../../utils/types\";\n\n/**\n * @slot icon - Content will be displayed alongside the toggle button label.\n * @slot badge - Badge component overlaying the top right of the toggle button.\n */\n\n@Component({\n tag: \"ic-toggle-button\",\n styleUrl: \"ic-toggle-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class ToggleButton {\n private iconPosition: \"left\" | \"right\" | \"top\";\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcToggleButtonElement;\n\n /**\n * The accessible label that will be applied to the toggle button. This is required for the icon variant of toggle buttons.\n */\n @Prop() accessibleLabel?: string;\n\n /**\n * The appearance of the toggle button.\n */\n @Prop() appearance?: IcThemeForeground = \"default\";\n\n /**\n * If `true`, the toggle button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the toggle button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The placement of the icon in relation to the toggle button label.\n */\n @Prop() iconPlacement?: \"left\" | \"right\" | \"top\";\n\n /**\n * The label to display in the toggle button. This is required for the default variant of toggle buttons.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the toggle button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * The size of the toggle button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * If `true`, the toggle button will be in a checked state.\n */\n @Prop({ mutable: true, reflect: true }) toggleChecked: boolean = false;\n\n /**\n * The position of the tooltip in relation to the toggle button.\n */\n @Prop() tooltipPlacement: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * The variant of the toggle button.\n */\n @Prop({ reflect: true }) variant: \"default\" | \"icon\" = \"default\";\n\n /**\n * Emitted when the user clicks a toggle button.\n */\n @Event() icToggleChecked: EventEmitter<{\n checked: boolean;\n }>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n const parentIconPlacement = (\n this.el.parentElement as HTMLIcToggleButtonGroupElement\n ).iconPlacement;\n this.iconPosition = this.iconPlacement || parentIconPlacement;\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n {\n prop: this.variant === \"icon\" ? this.accessibleLabel : this.label,\n propName: this.variant === \"icon\" ? \"accessible-label\" : \"label\",\n },\n ],\n \"Toggle button\"\n );\n if (typeof MutationObserver !== \"undefined\") {\n this.hostMutationObserver = new MutationObserver(\n this.hostMutationCallback\n );\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n }\n\n disconnectedCallback(): void {\n if (\n this.hostMutationObserver !== null &&\n this.hostMutationObserver !== undefined\n ) {\n this.hostMutationObserver.disconnect();\n }\n }\n\n private hostMutationCallback = (): void => {\n forceUpdate(this);\n };\n\n @Listen(\"click\", { capture: true })\n handleHostClick(e: Event): void {\n if (this.disabled) {\n e.stopImmediatePropagation();\n } else if (!this.loading) {\n this.toggleChecked = !this.toggleChecked;\n }\n }\n\n private handleFocus = (ev: FocusEvent) => {\n ev.stopImmediatePropagation();\n };\n\n private handleClick = (): void => {\n !this.loading &&\n !this.disabled &&\n this.icToggleChecked.emit({\n checked: this.toggleChecked,\n });\n };\n\n render() {\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled,\n [\"checked\"]: this.toggleChecked,\n [`${this.appearance}`]: true,\n [\"icon\"]: this.variant === \"icon\",\n [`${this.size}`]: true,\n [\"loading\"]: this.loading,\n }}\n onFocus={this.handleFocus}\n >\n <ic-button\n aria-pressed={this.toggleChecked.toString()}\n variant={this.variant === \"icon\" ? \"icon\" : \"secondary\"}\n onClick={this.handleClick}\n title={this.accessibleLabel}\n aria-label={`${\n this.accessibleLabel ? this.accessibleLabel : this.label\n }, ${this.toggleChecked ? \"ticked\" : \"unticked\"}`}\n disabled={this.disabled}\n appearance={this.appearance}\n size={this.size}\n fullWidth={this.fullWidth}\n loading={this.loading}\n aria-disabled={`${this.disabled}`}\n tooltipPlacement={this.tooltipPlacement}\n >\n {this.variant !== \"icon\" && this.label}\n <slot />\n {isSlotUsed(this.el, \"icon\") && (\n <slot\n name=\"icon\"\n slot={`${\n this.iconPosition ? `${this.iconPosition}-icon` : \"icon\"\n }`}\n ></slot>\n )}\n {isSlotUsed(this.el, \"badge\") && (\n <slot name=\"badge\" slot=\"badge\"></slot>\n )}\n </ic-button>\n </Host>\n );\n }\n}\n"]}
|