@brandsync/wc 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +340 -24
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/{p-fde5e9f1.entry.js → p-051d3064.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f243683f.entry.js → p-05c7de28.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2d6955d6.entry.js → p-062cfa34.entry.js} +1 -1
- package/dist/brandsync-wc/p-0e39b9cc.entry.js +1 -0
- package/dist/brandsync-wc/p-0eed6813.entry.js +1 -0
- package/dist/brandsync-wc/{p-d25b7b74.entry.js → p-107b1c5d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-538cc08e.entry.js → p-114d2fd8.entry.js} +1 -1
- package/dist/brandsync-wc/{p-6754dfa9.entry.js → p-1c0db4d6.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4a1a5d6e.entry.js → p-1f7208cb.entry.js} +1 -1
- package/dist/brandsync-wc/p-2181378f.entry.js +1 -0
- package/dist/brandsync-wc/{p-d06543a5.entry.js → p-235ae012.entry.js} +1 -1
- package/dist/brandsync-wc/{p-2700a63e.entry.js → p-275072dd.entry.js} +1 -1
- package/dist/brandsync-wc/p-27bbed83.entry.js +1 -0
- package/dist/brandsync-wc/p-2891d40b.entry.js +1 -0
- package/dist/brandsync-wc/p-29027559.entry.js +1 -0
- package/dist/brandsync-wc/{p-a36a0e6a.entry.js → p-3176d1d3.entry.js} +1 -1
- package/dist/brandsync-wc/{p-0d86c22d.entry.js → p-33e44094.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e427bbda.entry.js → p-360452c2.entry.js} +1 -1
- package/dist/brandsync-wc/p-36bf37d9.entry.js +1 -0
- package/dist/brandsync-wc/p-3b64e3cd.entry.js +1 -0
- package/dist/brandsync-wc/p-3ec74d35.entry.js +1 -0
- package/dist/brandsync-wc/p-4574a707.entry.js +1 -0
- package/dist/brandsync-wc/p-4e5dcaff.entry.js +1 -0
- package/dist/brandsync-wc/{p-61db6ce2.entry.js → p-61c1a2a3.entry.js} +1 -1
- package/dist/brandsync-wc/{p-85c70f6d.entry.js → p-6331de9c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-9c1be2a0.entry.js → p-6bf2f116.entry.js} +1 -1
- package/dist/brandsync-wc/p-6fd7dd6a.entry.js +1 -0
- package/dist/brandsync-wc/{p-c3a28a89.entry.js → p-70f64b25.entry.js} +1 -1
- package/dist/brandsync-wc/{p-06e9b45d.entry.js → p-7b00dd36.entry.js} +1 -1
- package/dist/brandsync-wc/{p-13e4966c.entry.js → p-7c94e6ae.entry.js} +1 -1
- package/dist/brandsync-wc/p-835a8dc7.entry.js +1 -0
- package/dist/brandsync-wc/{p-77433277.entry.js → p-8ee0153b.entry.js} +1 -1
- package/dist/brandsync-wc/{p-e1069ba9.entry.js → p-9f65f998.entry.js} +1 -1
- package/dist/brandsync-wc/p-9f6fe37d.entry.js +1 -0
- package/dist/brandsync-wc/{p-b2dc9886.entry.js → p-9f8852a0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-DuyFft7h.js → p-AgoOSYvW.js} +2 -2
- package/dist/brandsync-wc/{p-fba01c96.entry.js → p-a09e157f.entry.js} +1 -1
- package/dist/brandsync-wc/{p-55e6438c.entry.js → p-a0d5a620.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8b2ab522.entry.js → p-a5feaad4.entry.js} +1 -1
- package/dist/brandsync-wc/{p-cbaa19ab.entry.js → p-a92eec48.entry.js} +1 -1
- package/dist/brandsync-wc/{p-3eab22a5.entry.js → p-ae978c9a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f2ce9a1f.entry.js → p-bbcc47b0.entry.js} +1 -1
- package/dist/brandsync-wc/{p-80cf96ff.entry.js → p-be2c1740.entry.js} +1 -1
- package/dist/brandsync-wc/p-c10d2529.entry.js +1 -0
- package/dist/brandsync-wc/{p-819a3dae.entry.js → p-c3f72584.entry.js} +1 -1
- package/dist/brandsync-wc/{p-8b57f606.entry.js → p-c4de155c.entry.js} +1 -1
- package/dist/brandsync-wc/{p-c197cc95.entry.js → p-cfcf3f0a.entry.js} +1 -1
- package/dist/brandsync-wc/{p-f8f03334.entry.js → p-de7c946d.entry.js} +1 -1
- package/dist/brandsync-wc/{p-600b5434.entry.js → p-e9b43754.entry.js} +1 -1
- package/dist/brandsync-wc/{p-4bff9b4b.entry.js → p-f006d962.entry.js} +1 -1
- package/dist/brandsync-wc/p-f074f94e.entry.js +1 -0
- package/dist/brandsync-wc/{p-7ed5670e.entry.js → p-f7d47c17.entry.js} +1 -1
- package/dist/brandsync-wc/p-fc240aa0.entry.js +1 -0
- package/dist/brandsync-wc/{p-f518f486.entry.js → p-fc58c663.entry.js} +1 -1
- package/dist/brandsync-wc/{p-be14f99f.entry.js → p-fddc7bd1.entry.js} +1 -1
- package/dist/cjs/brandsync-wc.cjs.js +2 -2
- package/dist/cjs/bs-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bs-ai-disclaimer.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-greeting.cjs.entry.js +1 -1
- package/dist/cjs/bs-ai-thinking.cjs.entry.js +1 -1
- package/dist/cjs/bs-attachment-list.cjs.entry.js +2 -2
- package/dist/cjs/bs-attachment.cjs.entry.js +2 -2
- package/dist/cjs/bs-avatar.cjs.entry.js +1 -1
- package/dist/cjs/bs-badge.cjs.entry.js +1 -1
- package/dist/cjs/bs-breadcrumb-overflow.cjs.entry.js +15 -3
- package/dist/cjs/bs-breadcrumb.cjs.entry.js +16 -2
- package/dist/cjs/bs-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/bs-button-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-button.cjs.entry.js +23 -4
- package/dist/cjs/bs-card.cjs.entry.js +2 -2
- package/dist/cjs/bs-carousel.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-feedback.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-header.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-response-action.cjs.entry.js +2 -2
- package/dist/cjs/bs-chatbot-sources-drawer.cjs.entry.js +1 -1
- package/dist/cjs/bs-chatbot-suggestion-button.cjs.entry.js +1 -1
- package/dist/cjs/bs-checkbox-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bs-checkbox.cjs.entry.js +48 -3
- package/dist/cjs/bs-chip-filter.cjs.entry.js +2 -2
- package/dist/cjs/bs-chip-informative.cjs.entry.js +2 -2
- package/dist/cjs/bs-chip-input.cjs.entry.js +2 -2
- package/dist/cjs/bs-composer-status-banner.cjs.entry.js +1 -1
- package/dist/cjs/bs-composer.cjs.entry.js +1 -1
- package/dist/cjs/bs-data-table.cjs.entry.js +20 -6
- package/dist/cjs/bs-dialog.cjs.entry.js +2 -2
- package/dist/cjs/bs-file-upload-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/bs-icon-button.cjs.entry.js +23 -4
- package/dist/cjs/bs-inline-tab.cjs.entry.js +11 -3
- package/dist/cjs/bs-input.cjs.entry.js +69 -5
- package/dist/cjs/bs-logo.cjs.entry.js +1 -1
- package/dist/cjs/bs-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/bs-menu.cjs.entry.js +25 -3
- package/dist/cjs/bs-navigation-drawer-item.cjs.entry.js +2 -2
- package/dist/cjs/bs-navigation-drawer.cjs.entry.js +119 -6
- package/dist/cjs/bs-navigation-header.cjs.entry.js +2 -2
- package/dist/cjs/bs-pagination.cjs.entry.js +1 -1
- package/dist/cjs/bs-progress-linear.cjs.entry.js +1 -1
- package/dist/cjs/bs-progress.cjs.entry.js +8 -3
- package/dist/cjs/bs-radio.cjs.entry.js +81 -12
- package/dist/cjs/bs-slider.cjs.entry.js +54 -2
- package/dist/cjs/bs-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/bs-source-link.cjs.entry.js +2 -2
- package/dist/cjs/bs-stepper-step.cjs.entry.js +2 -2
- package/dist/cjs/bs-stepper.cjs.entry.js +3 -2
- package/dist/cjs/bs-switch.cjs.entry.js +36 -3
- package/dist/cjs/bs-tab.cjs.entry.js +11 -3
- package/dist/cjs/bs-tabs.cjs.entry.js +97 -3
- package/dist/cjs/bs-toast.cjs.entry.js +1 -1
- package/dist/cjs/bs-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{index-D7e6DfLV.js → index-kk9YXF2S.js} +43 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/bs-a11y.cmp.test.js +54 -0
- package/dist/collection/components/bs-accordion/bs-accordion.css +5 -5
- package/dist/collection/components/bs-attachment/bs-attachment.css +1 -1
- package/dist/collection/components/bs-attachment-list/bs-attachment-list.css +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.cmp.test.js +63 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.js +32 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.cmp.test.js +45 -0
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.css +1 -1
- package/dist/collection/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.js +30 -1
- package/dist/collection/components/bs-button/bs-button/bs-button.css +17 -10
- package/dist/collection/components/bs-button/bs-button/bs-button.js +16 -3
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.cmp.test.js +20 -0
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.css +21 -4
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.js +18 -4
- package/dist/collection/components/bs-button/bs-icon-button/bs-icon-button.stories.js +10 -0
- package/dist/collection/components/bs-card/bs-card.css +4 -0
- package/dist/collection/components/bs-chatbot-feedback/bs-chatbot-feedback.css +1 -1
- package/dist/collection/components/bs-chatbot-response-action/bs-chatbot-response-action.css +3 -3
- package/dist/collection/components/bs-checkbox/bs-checkbox.css +8 -1
- package/dist/collection/components/bs-checkbox/bs-checkbox.js +100 -2
- package/dist/collection/components/bs-chip/bs-chip-filter/bs-chip-filter.css +4 -4
- package/dist/collection/components/bs-chip/bs-chip-informative/bs-chip-informative.css +4 -4
- package/dist/collection/components/bs-chip/bs-chip-input/bs-chip-input.css +5 -5
- package/dist/collection/components/bs-data-table/bs-data-table.cmp.test.js +19 -0
- package/dist/collection/components/bs-data-table/bs-data-table.css +1 -1
- package/dist/collection/components/bs-data-table/bs-data-table.js +19 -5
- package/dist/collection/components/bs-data-table/bs-data-table.stories.js +8 -1
- package/dist/collection/components/bs-dialog/bs-dialog.css +5 -1
- package/dist/collection/components/bs-form-association.cmp.test.js +172 -0
- package/dist/collection/components/bs-input/bs-input.css +10 -4
- package/dist/collection/components/bs-input/bs-input.js +82 -4
- package/dist/collection/components/bs-keyboard-nav.cmp.test.js +100 -0
- package/dist/collection/components/bs-logo/bs-logo.cmp.test.js +52 -3
- package/dist/collection/components/bs-menu/bs-menu.css +4 -0
- package/dist/collection/components/bs-menu/bs-menu.js +33 -1
- package/dist/collection/components/bs-menu/bs-menu.stories.js +54 -0
- package/dist/collection/components/bs-progress/bs-progress.js +27 -2
- package/dist/collection/components/bs-radio/bs-radio.cmp.test.js +4 -10
- package/dist/collection/components/bs-radio/bs-radio.css +7 -1
- package/dist/collection/components/bs-radio/bs-radio.js +92 -14
- package/dist/collection/components/bs-radio/bs-radio.stories.js +1 -10
- package/dist/collection/components/bs-slider/bs-slider.js +68 -2
- package/dist/collection/components/bs-source-link/bs-source-link.css +2 -2
- package/dist/collection/components/bs-stepper/bs-stepper/bs-stepper.js +3 -2
- package/dist/collection/components/bs-stepper/bs-stepper-step/bs-stepper-step.css +3 -3
- package/dist/collection/components/bs-switch/bs-switch.css +10 -1
- package/dist/collection/components/bs-switch/bs-switch.js +69 -2
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.css +2 -2
- package/dist/collection/components/bs-tab/bs-inline-tab/bs-inline-tab.js +47 -1
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.css +2 -2
- package/dist/collection/components/bs-tab/bs-tab/bs-tab.js +47 -1
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.cmp.test.js +88 -0
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.js +139 -2
- package/dist/collection/components/bs-tab/bs-tabs/bs-tabs.stories.js +24 -0
- package/dist/collection/components/bs-tooltip/bs-tooltip.js +1 -1
- package/dist/collection/components/forms/forms.stories.js +63 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.cmp.test.js +173 -5
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.css +106 -34
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.js +181 -5
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.js +48 -0
- package/dist/collection/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer-item/bs-navigation-drawer-item.js +1 -1
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.cmp.test.js +68 -0
- package/dist/collection/components/ui-shell/bs-navigation-header/bs-navigation-header/bs-navigation-header.css +31 -17
- package/dist/components/bs-accordion.js +1 -1
- package/dist/components/bs-ai-disclaimer.js +1 -1
- package/dist/components/bs-ai-greeting.js +1 -1
- package/dist/components/bs-ai-thinking.js +1 -1
- package/dist/components/bs-attachment-list.js +1 -1
- package/dist/components/bs-attachment.js +1 -1
- package/dist/components/bs-avatar.js +1 -1
- package/dist/components/bs-badge.js +1 -1
- package/dist/components/bs-breadcrumb-overflow.js +1 -1
- package/dist/components/bs-breadcrumb.js +1 -1
- package/dist/components/bs-breadcrumbs.js +1 -1
- package/dist/components/bs-button-skeleton.js +1 -1
- package/dist/components/bs-button.js +1 -1
- package/dist/components/bs-card.js +1 -1
- package/dist/components/bs-carousel.js +1 -1
- package/dist/components/bs-chatbot-feedback.js +1 -1
- package/dist/components/bs-chatbot-header.js +1 -1
- package/dist/components/bs-chatbot-response-action.js +1 -1
- package/dist/components/bs-chatbot-sources-drawer.js +1 -1
- package/dist/components/bs-chatbot-suggestion-button.js +1 -1
- package/dist/components/bs-checkbox-skeleton.js +1 -1
- package/dist/components/bs-checkbox.js +1 -1
- package/dist/components/bs-chip-filter.js +1 -1
- package/dist/components/bs-chip-informative.js +1 -1
- package/dist/components/bs-chip-input.js +1 -1
- package/dist/components/bs-composer-status-banner.js +1 -1
- package/dist/components/bs-composer.js +1 -1
- package/dist/components/bs-data-table.js +1 -1
- package/dist/components/bs-dialog.js +1 -1
- package/dist/components/bs-file-upload-item.js +1 -1
- package/dist/components/bs-file-upload.js +1 -1
- package/dist/components/bs-icon-button.js +1 -1
- package/dist/components/bs-inline-tab.js +1 -1
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-logo.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/bs-menu.js +1 -1
- package/dist/components/bs-navigation-drawer-item.js +1 -1
- package/dist/components/bs-navigation-drawer.js +1 -1
- package/dist/components/bs-navigation-header.js +1 -1
- package/dist/components/bs-pagination.js +1 -1
- package/dist/components/bs-progress-linear.js +1 -1
- package/dist/components/bs-progress.js +1 -1
- package/dist/components/bs-radio.js +1 -1
- package/dist/components/bs-slider.js +1 -1
- package/dist/components/bs-snackbar.js +1 -1
- package/dist/components/bs-source-link.js +1 -1
- package/dist/components/bs-stepper-step.js +1 -1
- package/dist/components/bs-stepper.js +1 -1
- package/dist/components/bs-switch.js +1 -1
- package/dist/components/bs-tab.js +1 -1
- package/dist/components/bs-tabs.js +1 -1
- package/dist/components/bs-toast.js +1 -1
- package/dist/components/bs-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-LYvoWZt4.js → p-BA3c9Rom.js} +1 -1
- package/dist/components/{p-Dqt-Qp4W.js → p-BfEyD6Ku.js} +1 -1
- package/dist/components/p-BoeorHNv.js +1 -0
- package/dist/components/p-Buly0d5G.js +1 -0
- package/dist/components/p-CpUHnsq9.js +1 -0
- package/dist/components/{p-BxFJ74fI.js → p-EtXc94lJ.js} +1 -1
- package/dist/components/{p-mnGJPH85.js → p-JYlmcxBn.js} +1 -1
- package/dist/components/{p-BhvV55-6.js → p-R2MlkUzD.js} +1 -1
- package/dist/components/{p-Dx8gAOVC.js → p-wei0Ija2.js} +1 -1
- package/dist/esm/brandsync-wc.js +3 -3
- package/dist/esm/bs-accordion.entry.js +2 -2
- package/dist/esm/bs-ai-disclaimer.entry.js +1 -1
- package/dist/esm/bs-ai-greeting.entry.js +1 -1
- package/dist/esm/bs-ai-thinking.entry.js +1 -1
- package/dist/esm/bs-attachment-list.entry.js +2 -2
- package/dist/esm/bs-attachment.entry.js +2 -2
- package/dist/esm/bs-avatar.entry.js +1 -1
- package/dist/esm/bs-badge.entry.js +1 -1
- package/dist/esm/bs-breadcrumb-overflow.entry.js +15 -3
- package/dist/esm/bs-breadcrumb.entry.js +16 -2
- package/dist/esm/bs-breadcrumbs.entry.js +1 -1
- package/dist/esm/bs-button-skeleton.entry.js +1 -1
- package/dist/esm/bs-button.entry.js +23 -4
- package/dist/esm/bs-card.entry.js +2 -2
- package/dist/esm/bs-carousel.entry.js +1 -1
- package/dist/esm/bs-chatbot-feedback.entry.js +2 -2
- package/dist/esm/bs-chatbot-header.entry.js +1 -1
- package/dist/esm/bs-chatbot-response-action.entry.js +2 -2
- package/dist/esm/bs-chatbot-sources-drawer.entry.js +1 -1
- package/dist/esm/bs-chatbot-suggestion-button.entry.js +1 -1
- package/dist/esm/bs-checkbox-skeleton.entry.js +1 -1
- package/dist/esm/bs-checkbox.entry.js +48 -3
- package/dist/esm/bs-chip-filter.entry.js +2 -2
- package/dist/esm/bs-chip-informative.entry.js +2 -2
- package/dist/esm/bs-chip-input.entry.js +2 -2
- package/dist/esm/bs-composer-status-banner.entry.js +1 -1
- package/dist/esm/bs-composer.entry.js +1 -1
- package/dist/esm/bs-data-table.entry.js +20 -6
- package/dist/esm/bs-dialog.entry.js +2 -2
- package/dist/esm/bs-file-upload-item.entry.js +1 -1
- package/dist/esm/bs-file-upload.entry.js +1 -1
- package/dist/esm/bs-icon-button.entry.js +23 -4
- package/dist/esm/bs-inline-tab.entry.js +11 -3
- package/dist/esm/bs-input.entry.js +69 -5
- package/dist/esm/bs-logo.entry.js +1 -1
- package/dist/esm/bs-menu-item.entry.js +1 -1
- package/dist/esm/bs-menu.entry.js +25 -3
- package/dist/esm/bs-navigation-drawer-item.entry.js +2 -2
- package/dist/esm/bs-navigation-drawer.entry.js +119 -6
- package/dist/esm/bs-navigation-header.entry.js +2 -2
- package/dist/esm/bs-pagination.entry.js +1 -1
- package/dist/esm/bs-progress-linear.entry.js +1 -1
- package/dist/esm/bs-progress.entry.js +8 -3
- package/dist/esm/bs-radio.entry.js +81 -12
- package/dist/esm/bs-slider.entry.js +54 -2
- package/dist/esm/bs-snackbar.entry.js +1 -1
- package/dist/esm/bs-source-link.entry.js +2 -2
- package/dist/esm/bs-stepper-step.entry.js +2 -2
- package/dist/esm/bs-stepper.entry.js +3 -2
- package/dist/esm/bs-switch.entry.js +36 -3
- package/dist/esm/bs-tab.entry.js +11 -3
- package/dist/esm/bs-tabs.entry.js +97 -3
- package/dist/esm/bs-toast.entry.js +1 -1
- package/dist/esm/bs-tooltip.entry.js +2 -2
- package/dist/esm/{index-DuyFft7h.js → index-AgoOSYvW.js} +43 -5
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/bs-a11y.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumb/bs-breadcrumb.d.ts +10 -0
- package/dist/types/components/bs-breadcrumb/bs-breadcrumb-overflow/bs-breadcrumb-overflow.d.ts +8 -0
- package/dist/types/components/bs-button/bs-button/bs-button.d.ts +4 -1
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.d.ts +6 -2
- package/dist/types/components/bs-button/bs-icon-button/bs-icon-button.stories.d.ts +1 -0
- package/dist/types/components/bs-checkbox/bs-checkbox.d.ts +12 -0
- package/dist/types/components/bs-data-table/bs-data-table.d.ts +16 -2
- package/dist/types/components/bs-form-association.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-input/bs-input.d.ts +12 -0
- package/dist/types/components/bs-keyboard-nav.cmp.test.d.ts +1 -0
- package/dist/types/components/bs-menu/bs-menu.d.ts +4 -0
- package/dist/types/components/bs-menu/bs-menu.stories.d.ts +1 -0
- package/dist/types/components/bs-progress/bs-progress.d.ts +5 -0
- package/dist/types/components/bs-radio/bs-radio.d.ts +23 -9
- package/dist/types/components/bs-slider/bs-slider.d.ts +9 -0
- package/dist/types/components/bs-switch/bs-switch.d.ts +10 -0
- package/dist/types/components/bs-tab/bs-inline-tab/bs-inline-tab.d.ts +8 -0
- package/dist/types/components/bs-tab/bs-tab/bs-tab.d.ts +8 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.d.ts +24 -0
- package/dist/types/components/bs-tab/bs-tabs/bs-tabs.stories.d.ts +1 -0
- package/dist/types/components/forms/forms.stories.d.ts +6 -0
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.d.ts +50 -1
- package/dist/types/components/ui-shell/bs-navigation-drawer/bs-navigation-drawer/bs-navigation-drawer.stories.d.ts +2 -0
- package/dist/types/components.d.ts +271 -9
- package/package.json +1 -1
- package/readme.md +14 -0
- package/dist/brandsync-wc/p-18021c05.entry.js +0 -1
- package/dist/brandsync-wc/p-1c8160c2.entry.js +0 -1
- package/dist/brandsync-wc/p-21c14465.entry.js +0 -1
- package/dist/brandsync-wc/p-27100489.entry.js +0 -1
- package/dist/brandsync-wc/p-309f920e.entry.js +0 -1
- package/dist/brandsync-wc/p-30d6a6d0.entry.js +0 -1
- package/dist/brandsync-wc/p-387ed85f.entry.js +0 -1
- package/dist/brandsync-wc/p-4b0938a5.entry.js +0 -1
- package/dist/brandsync-wc/p-5312b6a5.entry.js +0 -1
- package/dist/brandsync-wc/p-70e035ed.entry.js +0 -1
- package/dist/brandsync-wc/p-777a9dbf.entry.js +0 -1
- package/dist/brandsync-wc/p-a96856fd.entry.js +0 -1
- package/dist/brandsync-wc/p-b0634051.entry.js +0 -1
- package/dist/brandsync-wc/p-bcee3d60.entry.js +0 -1
- package/dist/brandsync-wc/p-d03eba2b.entry.js +0 -1
- package/dist/brandsync-wc/p-e61efe4d.entry.js +0 -1
- package/dist/brandsync-wc/p-f14bda01.entry.js +0 -1
- package/dist/components/p-BaxFLlKS.js +0 -1
- package/dist/components/p-DI5GgSqL.js +0 -1
- package/dist/components/p-v4T0qPVn.js +0 -1
|
@@ -20,6 +20,12 @@ import { h } from "@stencil/core";
|
|
|
20
20
|
// bs-switch.css, not here.
|
|
21
21
|
export class BsSwitch {
|
|
22
22
|
el;
|
|
23
|
+
internals;
|
|
24
|
+
initialChecked = false;
|
|
25
|
+
/** The `name` the value is submitted under in a surrounding `<form>`'s `FormData`. */
|
|
26
|
+
name;
|
|
27
|
+
/** The value submitted when on (native checkbox default: `"on"`). */
|
|
28
|
+
value = 'on';
|
|
23
29
|
/** Sizing scale. Controls the track's width/height and the knob's diameter. */
|
|
24
30
|
size = 'lg';
|
|
25
31
|
/** Whether the switch is on. Mutable so clicking the label/input toggles it directly, and
|
|
@@ -41,6 +47,17 @@ export class BsSwitch {
|
|
|
41
47
|
ariaLabel = null;
|
|
42
48
|
/** Emitted when the checked state changes via user interaction, with the new `checked` value. */
|
|
43
49
|
bsChange;
|
|
50
|
+
syncFormValue() {
|
|
51
|
+
this.internals?.setFormValue?.(this.checked ? this.value : null);
|
|
52
|
+
}
|
|
53
|
+
/** Called by the browser when the surrounding `<form>` is reset. */
|
|
54
|
+
formResetCallback() {
|
|
55
|
+
this.checked = this.initialChecked;
|
|
56
|
+
}
|
|
57
|
+
componentWillLoad() {
|
|
58
|
+
this.initialChecked = this.checked;
|
|
59
|
+
this.syncFormValue();
|
|
60
|
+
}
|
|
44
61
|
onChange = (ev) => {
|
|
45
62
|
const checked = ev.target.checked;
|
|
46
63
|
this.checked = checked;
|
|
@@ -58,11 +75,12 @@ export class BsSwitch {
|
|
|
58
75
|
const knobClasses = ['bs-switch__knob', `bs-switch__knob--${this.size}`, this.disabled ? 'bs-switch__knob--disabled' : '']
|
|
59
76
|
.filter(Boolean)
|
|
60
77
|
.join(' ');
|
|
61
|
-
return (h("label", { key: '
|
|
78
|
+
return (h("label", { key: '37466aa7ca1b18c07b92bd7855fd974d62ad5845', class: `bs-switch ${this.disabled ? 'bs-switch--disabled' : ''}` }, h("input", { key: 'f4e0073dd9a322692003593385da04a9289ea848', class: "bs-switch__input", type: "checkbox", role: "switch", checked: this.checked, disabled: this.disabled, "aria-checked": String(this.checked), "aria-label": this.ariaLabel, onChange: this.onChange }), h("span", { key: 'f8cbdb6bb25964ba79e9cb09d82beab0c3946a14', part: "track", class: trackClasses }, h("span", { key: '7e8598698e08a95d1ada9829264df99abd507d81', part: "knob", class: knobClasses })), h("span", { key: '11d464eaf95f555f3874524adc5fb2373b1fd056', part: "label", class: "bs-switch__label" }, h("slot", { key: '2409cb732d23f613c2595fa62e9fd7539bb2041e' }))));
|
|
62
79
|
}
|
|
63
80
|
static get is() { return "bs-switch"; }
|
|
64
81
|
static get encapsulation() { return "shadow"; }
|
|
65
82
|
static get delegatesFocus() { return true; }
|
|
83
|
+
static get formAssociated() { return true; }
|
|
66
84
|
static get originalStyleUrls() {
|
|
67
85
|
return {
|
|
68
86
|
"$": ["bs-switch.css"]
|
|
@@ -75,6 +93,45 @@ export class BsSwitch {
|
|
|
75
93
|
}
|
|
76
94
|
static get properties() {
|
|
77
95
|
return {
|
|
96
|
+
"name": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": true,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": "The `name` the value is submitted under in a surrounding `<form>`'s `FormData`."
|
|
109
|
+
},
|
|
110
|
+
"getter": false,
|
|
111
|
+
"setter": false,
|
|
112
|
+
"reflect": true,
|
|
113
|
+
"attribute": "name"
|
|
114
|
+
},
|
|
115
|
+
"value": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "The value submitted when on (native checkbox default: `\"on\"`)."
|
|
128
|
+
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"attribute": "value",
|
|
133
|
+
"defaultValue": "'on'"
|
|
134
|
+
},
|
|
78
135
|
"size": {
|
|
79
136
|
"type": "string",
|
|
80
137
|
"mutable": false,
|
|
@@ -137,7 +194,7 @@ export class BsSwitch {
|
|
|
137
194
|
},
|
|
138
195
|
"getter": false,
|
|
139
196
|
"setter": false,
|
|
140
|
-
"reflect":
|
|
197
|
+
"reflect": true,
|
|
141
198
|
"attribute": "disabled",
|
|
142
199
|
"defaultValue": "false"
|
|
143
200
|
},
|
|
@@ -182,4 +239,14 @@ export class BsSwitch {
|
|
|
182
239
|
}];
|
|
183
240
|
}
|
|
184
241
|
static get elementRef() { return "el"; }
|
|
242
|
+
static get watchers() {
|
|
243
|
+
return [{
|
|
244
|
+
"propName": "checked",
|
|
245
|
+
"methodName": "syncFormValue"
|
|
246
|
+
}, {
|
|
247
|
+
"propName": "value",
|
|
248
|
+
"methodName": "syncFormValue"
|
|
249
|
+
}];
|
|
250
|
+
}
|
|
251
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
185
252
|
}
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
.bs-inline-tab--has-icon {
|
|
79
79
|
padding-top: var(--bs-inline-tab-padding-y);
|
|
80
80
|
padding-bottom: var(--bs-inline-tab-padding-y);
|
|
81
|
-
padding-
|
|
82
|
-
padding-
|
|
81
|
+
padding-inline-start: var(--bs-inline-tab-padding-left-with-icon);
|
|
82
|
+
padding-inline-end: var(--bs-inline-tab-padding-right-with-icon);
|
|
83
83
|
gap: var(--bs-inline-tab-gap);
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -48,6 +48,14 @@ export class BsInlineTab {
|
|
|
48
48
|
* violation). Stencil reflects this camelCase prop to the `aria-label` HTML attribute
|
|
49
49
|
* automatically, same as `bs-tab`'s identical prop. */
|
|
50
50
|
ariaLabel = null;
|
|
51
|
+
/** Identifies this tab within a parent `bs-tabs`: the group's `value` is the selected tab's
|
|
52
|
+
* `value`, and `bsChange` reports it. Optional -- a tab without one is identified by its
|
|
53
|
+
* zero-based position in the group (`"0"`, `"1"`...). */
|
|
54
|
+
value;
|
|
55
|
+
/** Set by a parent `bs-tabs` to implement roving tabindex (only one tab in the group is in the
|
|
56
|
+
* Tab order; arrow keys move between them). Left `undefined` for a standalone tab, which stays
|
|
57
|
+
* a normal tab stop. */
|
|
58
|
+
tabbable;
|
|
51
59
|
/** Tracks whether the `icon` slot has assigned content. */
|
|
52
60
|
hasIcon = false;
|
|
53
61
|
/** Tracks whether the default (label) slot has assigned content. */
|
|
@@ -86,7 +94,7 @@ export class BsInlineTab {
|
|
|
86
94
|
};
|
|
87
95
|
render() {
|
|
88
96
|
const iconOnly = this.hasIcon && !this.hasLabel;
|
|
89
|
-
return (h("button", { key: '
|
|
97
|
+
return (h("button", { key: '0d6927b0b39a7d84add287e6473681e5052b5f2d', type: "button", part: "tab", role: "tab", class: `bs-inline-tab ${this.selected ? 'bs-inline-tab--selected' : ''} ${this.disabled ? 'bs-inline-tab--disabled' : ''} ${iconOnly ? 'bs-inline-tab--icon-only' : ''} ${this.hasIcon ? 'bs-inline-tab--has-icon' : ''}`, disabled: this.disabled, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel, tabIndex: this.tabbable === undefined ? undefined : this.tabbable ? 0 : -1, onClick: this.onClick }, h("span", { key: '866660f0f79927cd018df42286719f2f48262cbb', part: "icon", class: `bs-inline-tab__icon ${this.hasIcon ? 'bs-inline-tab__icon--has-content' : ''}` }, h("slot", { key: '58e11c8a0a57646644cb0b7c950d73f5cee52310', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '38d2e1df2b4e494f68d3c4b9ea34d7a317401953', part: "label", class: `bs-inline-tab__label ${this.hasLabel ? 'bs-inline-tab__label--has-content' : ''}` }, h("slot", { key: '51fb6ec04479b18af787bca4e64f8105a0b19311', onSlotchange: this.onLabelSlotchange }))));
|
|
90
98
|
}
|
|
91
99
|
static get is() { return "bs-inline-tab"; }
|
|
92
100
|
static get encapsulation() { return "shadow"; }
|
|
@@ -161,6 +169,44 @@ export class BsInlineTab {
|
|
|
161
169
|
"reflect": false,
|
|
162
170
|
"attribute": "aria-label",
|
|
163
171
|
"defaultValue": "null"
|
|
172
|
+
},
|
|
173
|
+
"value": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "string",
|
|
178
|
+
"resolved": "string",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": true,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Identifies this tab within a parent `bs-tabs`: the group's `value` is the selected tab's\n`value`, and `bsChange` reports it. Optional -- a tab without one is identified by its\nzero-based position in the group (`\"0\"`, `\"1\"`...)."
|
|
186
|
+
},
|
|
187
|
+
"getter": false,
|
|
188
|
+
"setter": false,
|
|
189
|
+
"reflect": true,
|
|
190
|
+
"attribute": "value"
|
|
191
|
+
},
|
|
192
|
+
"tabbable": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": true,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": "Set by a parent `bs-tabs` to implement roving tabindex (only one tab in the group is in the\nTab order; arrow keys move between them). Left `undefined` for a standalone tab, which stays\na normal tab stop."
|
|
205
|
+
},
|
|
206
|
+
"getter": false,
|
|
207
|
+
"setter": false,
|
|
208
|
+
"reflect": false,
|
|
209
|
+
"attribute": "tabbable"
|
|
164
210
|
}
|
|
165
211
|
};
|
|
166
212
|
}
|
|
@@ -207,8 +207,8 @@
|
|
|
207
207
|
enabled/selected/hover state above sets its background. */
|
|
208
208
|
.bs-tab__indicator {
|
|
209
209
|
position: absolute;
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
inset-inline-start: var(--bs-tab-padding-x);
|
|
211
|
+
inset-inline-end: var(--bs-tab-padding-x);
|
|
212
212
|
bottom: 0;
|
|
213
213
|
height: 2px;
|
|
214
214
|
background: transparent;
|
|
@@ -53,6 +53,14 @@ export class BsTab {
|
|
|
53
53
|
* violation). Stencil reflects this camelCase prop to the `aria-label` HTML attribute
|
|
54
54
|
* automatically, same as `bs-button`'s identical prop. */
|
|
55
55
|
ariaLabel = null;
|
|
56
|
+
/** Identifies this tab within a parent `bs-tabs`: the group's `value` is the selected tab's
|
|
57
|
+
* `value`, and `bsChange` reports it. Optional -- a tab without one is identified by its
|
|
58
|
+
* zero-based position in the group (`"0"`, `"1"`...). */
|
|
59
|
+
value;
|
|
60
|
+
/** Set by a parent `bs-tabs` to implement roving tabindex (only one tab in the group is in the
|
|
61
|
+
* Tab order; arrow keys move between them). Left `undefined` for a standalone tab, which stays
|
|
62
|
+
* a normal tab stop. */
|
|
63
|
+
tabbable;
|
|
56
64
|
/** Tracks whether the `icon` slot has assigned content. */
|
|
57
65
|
hasIcon = false;
|
|
58
66
|
/** Tracks whether the default (label) slot has assigned content. */
|
|
@@ -99,7 +107,7 @@ export class BsTab {
|
|
|
99
107
|
const iconOnly = this.hasIcon && !this.hasLabel;
|
|
100
108
|
const vertical = this.hasIcon && this.hasLabel && this.iconPosition === 'top';
|
|
101
109
|
const showBadge = this.hasBadge && !iconOnly && !vertical;
|
|
102
|
-
return (h("button", { key: '
|
|
110
|
+
return (h("button", { key: '383cf44dfcf1feb5404e6a392318c8ce5a8a1178', type: "button", part: "tab", role: "tab", class: `bs-tab ${this.selected ? 'bs-tab--selected' : ''} ${this.disabled ? 'bs-tab--disabled' : ''} ${iconOnly ? 'bs-tab--icon-only' : ''} ${vertical ? 'bs-tab--vertical' : ''}`, disabled: this.disabled, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel, tabIndex: this.tabbable === undefined ? undefined : this.tabbable ? 0 : -1, onClick: this.onClick }, h("span", { key: '8b3a6b9ee663c2957c206024478ee76abf4fb905', part: "icon", class: `bs-tab__icon ${this.hasIcon ? 'bs-tab__icon--has-content' : ''}` }, h("slot", { key: 'b46fd73bac532345e747bb214f8c91f32b04810c', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '9d3e69f4dc96e20a327ebccdbdf934f07a4892c0', part: "label", class: `bs-tab__label ${this.hasLabel ? 'bs-tab__label--has-content' : ''}` }, h("slot", { key: 'e724d44bec76845b64e8e0ebb5c883dc47ff11a3', onSlotchange: this.onLabelSlotchange })), h("span", { key: '1cb4e5a8056ebac8b1b098c350c4a5d89bd2968a', part: "badge", class: `bs-tab__badge ${showBadge ? 'bs-tab__badge--has-content' : ''}` }, h("slot", { key: '46a6bbf2c8702645b85062012294eedf3facceac', name: "badge", onSlotchange: this.onBadgeSlotchange })), h("span", { key: '38845ccafeddfe79af64c3e291197e88bbced150', part: "indicator", class: "bs-tab__indicator" })));
|
|
103
111
|
}
|
|
104
112
|
static get is() { return "bs-tab"; }
|
|
105
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -200,6 +208,44 @@ export class BsTab {
|
|
|
200
208
|
"reflect": false,
|
|
201
209
|
"attribute": "aria-label",
|
|
202
210
|
"defaultValue": "null"
|
|
211
|
+
},
|
|
212
|
+
"value": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "string",
|
|
217
|
+
"resolved": "string",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": true,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": "Identifies this tab within a parent `bs-tabs`: the group's `value` is the selected tab's\n`value`, and `bsChange` reports it. Optional -- a tab without one is identified by its\nzero-based position in the group (`\"0\"`, `\"1\"`...)."
|
|
225
|
+
},
|
|
226
|
+
"getter": false,
|
|
227
|
+
"setter": false,
|
|
228
|
+
"reflect": true,
|
|
229
|
+
"attribute": "value"
|
|
230
|
+
},
|
|
231
|
+
"tabbable": {
|
|
232
|
+
"type": "boolean",
|
|
233
|
+
"mutable": false,
|
|
234
|
+
"complexType": {
|
|
235
|
+
"original": "boolean",
|
|
236
|
+
"resolved": "boolean",
|
|
237
|
+
"references": {}
|
|
238
|
+
},
|
|
239
|
+
"required": false,
|
|
240
|
+
"optional": true,
|
|
241
|
+
"docs": {
|
|
242
|
+
"tags": [],
|
|
243
|
+
"text": "Set by a parent `bs-tabs` to implement roving tabindex (only one tab in the group is in the\nTab order; arrow keys move between them). Left `undefined` for a standalone tab, which stays\na normal tab stop."
|
|
244
|
+
},
|
|
245
|
+
"getter": false,
|
|
246
|
+
"setter": false,
|
|
247
|
+
"reflect": false,
|
|
248
|
+
"attribute": "tabbable"
|
|
203
249
|
}
|
|
204
250
|
};
|
|
205
251
|
}
|
|
@@ -58,4 +58,92 @@ describe('bs-tabs', () => {
|
|
|
58
58
|
expect(first.selected).toBe(true);
|
|
59
59
|
expect(second.selected).toBe(false);
|
|
60
60
|
});
|
|
61
|
+
describe('value and bsChange', () => {
|
|
62
|
+
const btn = (el) => el.shadowRoot.querySelector('button');
|
|
63
|
+
const key = (el, k) => el.dispatchEvent(new KeyboardEvent('keydown', { key: k, bubbles: true, composed: true, cancelable: true }));
|
|
64
|
+
const group = () => (h("bs-tabs", null, h("bs-tab", { value: "overview" }, "Overview"), h("bs-tab", { value: "details" }, "Details"), h("bs-tab", { value: "history" }, "History")));
|
|
65
|
+
it('a click selects the tab, updates the group value and emits bsChange with it', async () => {
|
|
66
|
+
const { root, waitForChanges, spyOnEvent } = await render(group());
|
|
67
|
+
const spy = spyOnEvent('bsChange');
|
|
68
|
+
const tabs = Array.from(root.querySelectorAll('bs-tab'));
|
|
69
|
+
btn(tabs[1]).click();
|
|
70
|
+
await waitForChanges();
|
|
71
|
+
expect(root.value).toBe('details');
|
|
72
|
+
expect(root.getAttribute('value')).toBe('details'); // reflected
|
|
73
|
+
expect(tabs[1].selected).toBe(true);
|
|
74
|
+
expect(spy).toHaveReceivedEventTimes(1);
|
|
75
|
+
expect(spy).toHaveReceivedEventDetail({ value: 'details' });
|
|
76
|
+
});
|
|
77
|
+
it('does not emit again when the already-selected tab is clicked', async () => {
|
|
78
|
+
const { root, waitForChanges, spyOnEvent } = await render(group());
|
|
79
|
+
const spy = spyOnEvent('bsChange');
|
|
80
|
+
const tabs = Array.from(root.querySelectorAll('bs-tab'));
|
|
81
|
+
btn(tabs[1]).click();
|
|
82
|
+
await waitForChanges();
|
|
83
|
+
btn(tabs[1]).click();
|
|
84
|
+
await waitForChanges();
|
|
85
|
+
expect(spy).toHaveReceivedEventTimes(1);
|
|
86
|
+
});
|
|
87
|
+
it('a tab without a value is identified by its zero-based index as a string', async () => {
|
|
88
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-tabs", null, h("bs-tab", null, "One"), h("bs-tab", null, "Two")));
|
|
89
|
+
const spy = spyOnEvent('bsChange');
|
|
90
|
+
btn(root.querySelectorAll('bs-tab')[1]).click();
|
|
91
|
+
await waitForChanges();
|
|
92
|
+
expect(spy).toHaveReceivedEventDetail({ value: '1' });
|
|
93
|
+
expect(root.value).toBe('1');
|
|
94
|
+
});
|
|
95
|
+
it('an initial value selects the matching tab on load', async () => {
|
|
96
|
+
const { root, waitForChanges } = await render(h("bs-tabs", { value: "history" }, h("bs-tab", { value: "overview" }, "Overview"), h("bs-tab", { value: "details" }, "Details"), h("bs-tab", { value: "history" }, "History")));
|
|
97
|
+
await waitForChanges();
|
|
98
|
+
const tabs = Array.from(root.querySelectorAll('bs-tab'));
|
|
99
|
+
expect(tabs.map(t => t.selected)).toEqual([false, false, true]);
|
|
100
|
+
// roving tabindex follows the selection
|
|
101
|
+
expect(btn(tabs[2]).tabIndex).toBe(0);
|
|
102
|
+
expect(btn(tabs[0]).tabIndex).toBe(-1);
|
|
103
|
+
});
|
|
104
|
+
it('setting value from outside selects the matching tab and does NOT emit bsChange', async () => {
|
|
105
|
+
const { root, waitForChanges, spyOnEvent } = await render(group());
|
|
106
|
+
const spy = spyOnEvent('bsChange');
|
|
107
|
+
root.value = 'details';
|
|
108
|
+
await waitForChanges();
|
|
109
|
+
const tabs = Array.from(root.querySelectorAll('bs-tab'));
|
|
110
|
+
expect(tabs.map(t => t.selected)).toEqual([false, true, false]);
|
|
111
|
+
expect(spy).not.toHaveReceivedEvent();
|
|
112
|
+
});
|
|
113
|
+
it('with no value set, reports the tab the consumer already marked selected (without emitting)', async () => {
|
|
114
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-tabs", null, h("bs-tab", { value: "a" }, "A"), h("bs-tab", { value: "b", selected: true }, "B")));
|
|
115
|
+
const spy = spyOnEvent('bsChange');
|
|
116
|
+
await waitForChanges();
|
|
117
|
+
expect(root.value).toBe('b');
|
|
118
|
+
expect(spy).not.toHaveReceivedEvent();
|
|
119
|
+
});
|
|
120
|
+
it('keyboard navigation emits bsChange too (arrow keys select the next tab)', async () => {
|
|
121
|
+
const { root, waitForChanges, spyOnEvent } = await render(group());
|
|
122
|
+
const spy = spyOnEvent('bsChange');
|
|
123
|
+
const tabs = Array.from(root.querySelectorAll('bs-tab'));
|
|
124
|
+
btn(tabs[0]).click();
|
|
125
|
+
await waitForChanges();
|
|
126
|
+
key(btn(tabs[0]), 'ArrowRight');
|
|
127
|
+
await waitForChanges();
|
|
128
|
+
expect(spy).toHaveReceivedEventDetail({ value: 'details' });
|
|
129
|
+
});
|
|
130
|
+
it('still emits bsSelect on the tab itself', async () => {
|
|
131
|
+
const { root, waitForChanges, spyOnEvent } = await render(group());
|
|
132
|
+
const spy = spyOnEvent('bsSelect');
|
|
133
|
+
btn(root.querySelectorAll('bs-tab')[2]).click();
|
|
134
|
+
await waitForChanges();
|
|
135
|
+
expect(spy).toHaveReceivedEventTimes(1);
|
|
136
|
+
});
|
|
137
|
+
it('works for bs-inline-tab groups', async () => {
|
|
138
|
+
const { root, waitForChanges, spyOnEvent } = await render(h("bs-tabs", { type: "bs-inline-tab" }, h("bs-inline-tab", { value: "x" }, "X"), h("bs-inline-tab", { value: "y" }, "Y")));
|
|
139
|
+
const spy = spyOnEvent('bsChange');
|
|
140
|
+
btn(root.querySelectorAll('bs-inline-tab')[1]).click();
|
|
141
|
+
await waitForChanges();
|
|
142
|
+
expect(spy).toHaveReceivedEventDetail({ value: 'y' });
|
|
143
|
+
});
|
|
144
|
+
it('a tab\'s value prop is reflected as an attribute', async () => {
|
|
145
|
+
const { root } = await render(group());
|
|
146
|
+
expect(root.querySelector('bs-tab').getAttribute('value')).toBe('overview');
|
|
147
|
+
});
|
|
148
|
+
});
|
|
61
149
|
});
|
|
@@ -35,6 +35,16 @@ export class BsTabs {
|
|
|
35
35
|
/** Layout direction of the tab bar itself. Sets `aria-orientation` on the internal wrapper and
|
|
36
36
|
* switches `flex-direction`. */
|
|
37
37
|
orientation = 'horizontal';
|
|
38
|
+
/** The selected tab's `value`. Mutable and reflected: it follows the user's selection, and
|
|
39
|
+
* setting it from outside (attribute or property) selects the matching tab -- without emitting
|
|
40
|
+
* `bsChange`, which only fires for user-driven changes. A tab's value is its own `value` prop,
|
|
41
|
+
* or, for a tab without one, its zero-based position in the group as a string (`"0"`, `"1"`...).
|
|
42
|
+
* If unset, it is read from whichever tab is already `selected` once the group loads. */
|
|
43
|
+
value;
|
|
44
|
+
/** Fires when the user selects a different tab (click, or arrow/Home/End), with the new
|
|
45
|
+
* `value`. Does not fire when `value` is set programmatically. `bsSelect` on the individual tab
|
|
46
|
+
* still fires as before. */
|
|
47
|
+
bsChange;
|
|
38
48
|
/**
|
|
39
49
|
* Catches `bsSelect` bubbling up from any slotted `<bs-tab>`/`<bs-inline-tab>` (Stencil's
|
|
40
50
|
* `@Event()` defaults to `bubbles: true, composed: true`, and `@Listen` without a target listens
|
|
@@ -43,14 +53,89 @@ export class BsTabs {
|
|
|
43
53
|
* `if (this.disabled) return;`), so no special-casing is needed here.
|
|
44
54
|
*/
|
|
45
55
|
onTabSelect(ev) {
|
|
46
|
-
const tabs = this.
|
|
56
|
+
const tabs = this.tabs();
|
|
47
57
|
tabs.forEach(tab => {
|
|
48
58
|
tab.selected = tab === ev.target;
|
|
49
59
|
});
|
|
60
|
+
this.syncRovingTabindex();
|
|
61
|
+
const index = tabs.findIndex(tab => tab === ev.target);
|
|
62
|
+
if (index === -1)
|
|
63
|
+
return;
|
|
64
|
+
const value = this.tabValue(tabs[index], index);
|
|
65
|
+
if (value !== this.value) {
|
|
66
|
+
this.value = value;
|
|
67
|
+
this.bsChange.emit({ value });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
componentDidLoad() {
|
|
71
|
+
if (this.value !== undefined) {
|
|
72
|
+
this.applyValue();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Uncontrolled: report whichever tab the consumer already marked `selected`.
|
|
76
|
+
const tabs = this.tabs();
|
|
77
|
+
const index = tabs.findIndex(t => t.selected);
|
|
78
|
+
if (index !== -1)
|
|
79
|
+
this.value = this.tabValue(tabs[index], index);
|
|
80
|
+
}
|
|
81
|
+
this.syncRovingTabindex();
|
|
82
|
+
}
|
|
83
|
+
tabValue(tab, index) {
|
|
84
|
+
return tab.value ?? String(index);
|
|
85
|
+
}
|
|
86
|
+
/** Selects the tab whose value matches `this.value` (and deselects the rest). */
|
|
87
|
+
applyValue() {
|
|
88
|
+
this.tabs().forEach((tab, i) => {
|
|
89
|
+
tab.selected = this.tabValue(tab, i) === this.value;
|
|
90
|
+
});
|
|
91
|
+
this.syncRovingTabindex();
|
|
92
|
+
}
|
|
93
|
+
onValueChange() {
|
|
94
|
+
this.applyValue();
|
|
95
|
+
}
|
|
96
|
+
syncRovingTabindex() {
|
|
97
|
+
const tabs = this.tabs();
|
|
98
|
+
const anySelected = tabs.some(t => t.selected);
|
|
99
|
+
const firstEnabled = tabs.find(t => !t.disabled);
|
|
100
|
+
tabs.forEach(t => {
|
|
101
|
+
t.tabbable = anySelected ? t.selected : t === firstEnabled;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
tabs() {
|
|
105
|
+
return Array.from(this.el.querySelectorAll(':scope > bs-tab, :scope > bs-inline-tab'));
|
|
106
|
+
}
|
|
107
|
+
/** WAI-ARIA tabs pattern (automatic activation): arrows move focus *and* selection to the
|
|
108
|
+
* previous/next enabled tab (wrapping), Home/End jump to the first/last. Arrow axis follows
|
|
109
|
+
* `orientation`; in RTL the horizontal arrows are mirrored. */
|
|
110
|
+
onKeyDown(ev) {
|
|
111
|
+
const vertical = this.orientation === 'vertical';
|
|
112
|
+
const rtl = getComputedStyle(this.el).direction === 'rtl';
|
|
113
|
+
const prevKey = vertical ? 'ArrowUp' : rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
114
|
+
const nextKey = vertical ? 'ArrowDown' : rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
115
|
+
if (![prevKey, nextKey, 'Home', 'End'].includes(ev.key))
|
|
116
|
+
return;
|
|
117
|
+
const enabled = this.tabs().filter(t => !t.disabled);
|
|
118
|
+
const current = enabled.findIndex(t => t === ev.target || t.contains(ev.target));
|
|
119
|
+
if (current === -1 || enabled.length === 0)
|
|
120
|
+
return;
|
|
121
|
+
ev.preventDefault();
|
|
122
|
+
let nextIdx = current;
|
|
123
|
+
if (ev.key === nextKey)
|
|
124
|
+
nextIdx = (current + 1) % enabled.length;
|
|
125
|
+
else if (ev.key === prevKey)
|
|
126
|
+
nextIdx = (current - 1 + enabled.length) % enabled.length;
|
|
127
|
+
else if (ev.key === 'Home')
|
|
128
|
+
nextIdx = 0;
|
|
129
|
+
else
|
|
130
|
+
nextIdx = enabled.length - 1;
|
|
131
|
+
const target = enabled[nextIdx];
|
|
132
|
+
const button = target.shadowRoot?.querySelector('button');
|
|
133
|
+
button?.focus();
|
|
134
|
+
button?.click();
|
|
50
135
|
}
|
|
51
136
|
render() {
|
|
52
137
|
const vertical = this.orientation === 'vertical';
|
|
53
|
-
return (h("div", { key: '
|
|
138
|
+
return (h("div", { key: '251521d36dcf4d6960df344285bc9a060ff87abb', part: "tablist", role: "tablist", "aria-orientation": this.orientation, class: `bs-tabs bs-tabs--${this.type} ${vertical ? 'bs-tabs--vertical' : ''}` }, h("slot", { key: '02216f048eaedb13f00891c30e1c49d15a509c1d', onSlotchange: () => this.syncRovingTabindex() })));
|
|
54
139
|
}
|
|
55
140
|
static get is() { return "bs-tabs"; }
|
|
56
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -117,10 +202,56 @@ export class BsTabs {
|
|
|
117
202
|
"reflect": false,
|
|
118
203
|
"attribute": "orientation",
|
|
119
204
|
"defaultValue": "'horizontal'"
|
|
205
|
+
},
|
|
206
|
+
"value": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"mutable": true,
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "string",
|
|
211
|
+
"resolved": "string",
|
|
212
|
+
"references": {}
|
|
213
|
+
},
|
|
214
|
+
"required": false,
|
|
215
|
+
"optional": true,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": "The selected tab's `value`. Mutable and reflected: it follows the user's selection, and\nsetting it from outside (attribute or property) selects the matching tab -- without emitting\n`bsChange`, which only fires for user-driven changes. A tab's value is its own `value` prop,\nor, for a tab without one, its zero-based position in the group as a string (`\"0\"`, `\"1\"`...).\nIf unset, it is read from whichever tab is already `selected` once the group loads."
|
|
219
|
+
},
|
|
220
|
+
"getter": false,
|
|
221
|
+
"setter": false,
|
|
222
|
+
"reflect": true,
|
|
223
|
+
"attribute": "value"
|
|
120
224
|
}
|
|
121
225
|
};
|
|
122
226
|
}
|
|
227
|
+
static get events() {
|
|
228
|
+
return [{
|
|
229
|
+
"method": "bsChange",
|
|
230
|
+
"name": "bsChange",
|
|
231
|
+
"bubbles": true,
|
|
232
|
+
"cancelable": true,
|
|
233
|
+
"composed": true,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "Fires when the user selects a different tab (click, or arrow/Home/End), with the new\n`value`. Does not fire when `value` is set programmatically. `bsSelect` on the individual tab\nstill fires as before."
|
|
237
|
+
},
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "{ value: string }",
|
|
240
|
+
"resolved": "{ value: string; }",
|
|
241
|
+
"references": {}
|
|
242
|
+
}
|
|
243
|
+
}];
|
|
244
|
+
}
|
|
123
245
|
static get elementRef() { return "el"; }
|
|
246
|
+
static get watchers() {
|
|
247
|
+
return [{
|
|
248
|
+
"propName": "value",
|
|
249
|
+
"methodName": "onValueChange"
|
|
250
|
+
}, {
|
|
251
|
+
"propName": "orientation",
|
|
252
|
+
"methodName": "syncRovingTabindex"
|
|
253
|
+
}];
|
|
254
|
+
}
|
|
124
255
|
static get listeners() {
|
|
125
256
|
return [{
|
|
126
257
|
"name": "bsSelect",
|
|
@@ -128,6 +259,12 @@ export class BsTabs {
|
|
|
128
259
|
"target": undefined,
|
|
129
260
|
"capture": false,
|
|
130
261
|
"passive": false
|
|
262
|
+
}, {
|
|
263
|
+
"name": "keydown",
|
|
264
|
+
"method": "onKeyDown",
|
|
265
|
+
"target": undefined,
|
|
266
|
+
"capture": false,
|
|
267
|
+
"passive": false
|
|
131
268
|
}];
|
|
132
269
|
}
|
|
133
270
|
}
|
|
@@ -37,3 +37,27 @@ export const InlineTabGroup = {
|
|
|
37
37
|
export const Vertical = {
|
|
38
38
|
args: { orientation: 'vertical' },
|
|
39
39
|
};
|
|
40
|
+
// The group's `value` follows the selection, and `bsChange` reports user-driven changes: the panel
|
|
41
|
+
// below switches in response to it, with no per-tab selection wiring.
|
|
42
|
+
export const WithValueAndPanels = {
|
|
43
|
+
name: 'With value and panels',
|
|
44
|
+
render: () => {
|
|
45
|
+
const panels = {
|
|
46
|
+
overview: 'Overview content',
|
|
47
|
+
details: 'Details content',
|
|
48
|
+
history: 'History content',
|
|
49
|
+
};
|
|
50
|
+
const onChange = (ev) => {
|
|
51
|
+
const panel = ev.currentTarget.nextElementSibling;
|
|
52
|
+
panel.textContent = panels[ev.detail.value];
|
|
53
|
+
};
|
|
54
|
+
return html `
|
|
55
|
+
<bs-tabs value="overview" @bsChange=${onChange}>
|
|
56
|
+
<bs-tab value="overview">Overview</bs-tab>
|
|
57
|
+
<bs-tab value="details">Details</bs-tab>
|
|
58
|
+
<bs-tab value="history">History</bs-tab>
|
|
59
|
+
</bs-tabs>
|
|
60
|
+
<p role="tabpanel" style="margin: 16px 0 0;">Overview content</p>
|
|
61
|
+
`;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -42,7 +42,7 @@ export class BsTooltip {
|
|
|
42
42
|
*/
|
|
43
43
|
placement = 'top';
|
|
44
44
|
render() {
|
|
45
|
-
return (h("div", { key: '
|
|
45
|
+
return (h("div", { key: 'b7c2ee57db3a4e36cdd106d78f0f8d54c45a04c6', class: "bs-tooltip" }, h("span", { key: '22b738a760e9967233052ce4540c77da4ac9563e', part: "arrow", class: "bs-tooltip__arrow" }), h("div", { key: '69a8b07711478e699be4c8151d9f7dfd2e4e0bf4', part: "bubble", class: "bs-tooltip__bubble" }, h("slot", { key: 'b32c75a06582b8e8f99b973889450e9100b75323' }))));
|
|
46
46
|
}
|
|
47
47
|
static get is() { return "bs-tooltip"; }
|
|
48
48
|
static get encapsulation() { return "shadow"; }
|