@beeq/core 1.10.0-beta.2 → 1.10.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/beeq/beeq.css +1 -1
- package/dist/beeq/beeq.esm.js +1 -1
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/bq-accordion-group.entry.esm.js.map +1 -1
- package/dist/beeq/bq-accordion.entry.esm.js.map +1 -1
- package/dist/beeq/bq-alert.entry.esm.js.map +1 -1
- package/dist/beeq/bq-avatar.entry.esm.js.map +1 -1
- package/dist/beeq/bq-badge.entry.esm.js.map +1 -1
- package/dist/beeq/bq-breadcrumb-item.entry.esm.js.map +1 -1
- package/dist/beeq/bq-breadcrumb.entry.esm.js.map +1 -1
- package/dist/beeq/bq-button.bq-icon.entry.esm.js.map +1 -1
- package/dist/beeq/bq-card.entry.esm.js.map +1 -1
- package/dist/beeq/bq-checkbox.entry.esm.js.map +1 -1
- package/dist/beeq/bq-date-picker.entry.esm.js.map +1 -1
- package/dist/beeq/bq-dialog.entry.esm.js.map +1 -1
- package/dist/beeq/bq-divider.entry.esm.js.map +1 -1
- package/dist/beeq/bq-drawer.entry.esm.js.map +1 -1
- package/dist/beeq/bq-dropdown.bq-panel.entry.esm.js.map +1 -1
- package/dist/beeq/bq-empty-state.entry.esm.js.map +1 -1
- package/dist/beeq/bq-input.entry.esm.js.map +1 -1
- package/dist/beeq/bq-notification.entry.esm.js.map +1 -1
- package/dist/beeq/bq-option-group.entry.esm.js.map +1 -1
- package/dist/beeq/bq-option-list.bq-tag.entry.esm.js.map +1 -1
- package/dist/beeq/bq-option.entry.esm.js.map +1 -1
- package/dist/beeq/bq-page-title.entry.esm.js.map +1 -1
- package/dist/beeq/bq-progress.entry.esm.js.map +1 -1
- package/dist/beeq/bq-radio-group.entry.esm.js.map +1 -1
- package/dist/beeq/bq-radio.entry.esm.js.map +1 -1
- package/dist/beeq/bq-select.entry.esm.js.map +1 -1
- package/dist/beeq/bq-side-menu-item.entry.esm.js.map +1 -1
- package/dist/beeq/bq-side-menu.entry.esm.js.map +1 -1
- package/dist/beeq/bq-slider.entry.esm.js.map +1 -1
- package/dist/beeq/bq-spinner.entry.esm.js.map +1 -1
- package/dist/beeq/bq-status.entry.esm.js.map +1 -1
- package/dist/beeq/bq-step-item.entry.esm.js.map +1 -1
- package/dist/beeq/bq-steps.entry.esm.js.map +1 -1
- package/dist/beeq/bq-switch.entry.esm.js.map +1 -1
- package/dist/beeq/bq-tab-group.entry.esm.js.map +1 -1
- package/dist/beeq/bq-tab.entry.esm.js.map +1 -1
- package/dist/beeq/bq-textarea.entry.esm.js.map +1 -1
- package/dist/beeq/bq-toast.entry.esm.js.map +1 -1
- package/dist/beeq/bq-tooltip.entry.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +1 -1
- package/dist/beeq/p-00f6ab04.entry.js +6 -0
- package/dist/beeq/{p-e8435655.entry.js.map → p-00f6ab04.entry.js.map} +1 -1
- package/dist/beeq/p-01d832d0.entry.js +6 -0
- package/dist/beeq/{p-ed10c8bf.entry.js.map → p-01d832d0.entry.js.map} +1 -1
- package/dist/beeq/p-0bf9984d.entry.js +6 -0
- package/dist/beeq/{p-e91d1052.entry.js.map → p-0bf9984d.entry.js.map} +1 -1
- package/dist/beeq/p-12249759.entry.js +6 -0
- package/dist/beeq/{p-ab352f43.entry.js.map → p-12249759.entry.js.map} +1 -1
- package/dist/beeq/p-1a19b5fa.entry.js +6 -0
- package/dist/beeq/{p-3f7193fb.entry.js.map → p-1a19b5fa.entry.js.map} +1 -1
- package/dist/beeq/p-1cd5bf89.entry.js +6 -0
- package/dist/beeq/p-1cd5bf89.entry.js.map +1 -0
- package/dist/beeq/p-3464beb1.entry.js +6 -0
- package/dist/beeq/{p-4f24e77c.entry.js.map → p-3464beb1.entry.js.map} +1 -1
- package/dist/beeq/p-38b70ecf.entry.js +6 -0
- package/dist/beeq/{p-4c4201e1.entry.js.map → p-38b70ecf.entry.js.map} +1 -1
- package/dist/beeq/p-3bac8fc4.entry.js +6 -0
- package/dist/beeq/{p-f9734e66.entry.js.map → p-3bac8fc4.entry.js.map} +1 -1
- package/dist/beeq/p-4a29e2d0.entry.js +6 -0
- package/dist/beeq/{p-a6d2ceb4.entry.js.map → p-4a29e2d0.entry.js.map} +1 -1
- package/dist/beeq/p-4a3d974a.entry.js +6 -0
- package/dist/beeq/{p-078d8f91.entry.js.map → p-4a3d974a.entry.js.map} +1 -1
- package/dist/beeq/p-4aa72d5a.entry.js +6 -0
- package/dist/beeq/p-4aa72d5a.entry.js.map +1 -0
- package/dist/beeq/p-50b2fd06.entry.js +6 -0
- package/dist/beeq/{p-c3f20d0e.entry.js.map → p-50b2fd06.entry.js.map} +1 -1
- package/dist/beeq/p-55017e05.entry.js +6 -0
- package/dist/beeq/{p-20d9b09b.entry.js.map → p-55017e05.entry.js.map} +1 -1
- package/dist/beeq/p-58541f26.entry.js +6 -0
- package/dist/beeq/{p-2219f451.entry.js.map → p-58541f26.entry.js.map} +1 -1
- package/dist/beeq/p-5b5442ce.entry.js +6 -0
- package/dist/beeq/{p-6bcae73b.entry.js.map → p-5b5442ce.entry.js.map} +1 -1
- package/dist/beeq/p-622b9249.entry.js +6 -0
- package/dist/beeq/{p-80916524.entry.js.map → p-622b9249.entry.js.map} +1 -1
- package/dist/beeq/p-74daa290.entry.js +6 -0
- package/dist/beeq/{p-0949ff39.entry.js.map → p-74daa290.entry.js.map} +1 -1
- package/dist/beeq/p-7eb5259f.entry.js +6 -0
- package/dist/beeq/{p-189629c7.entry.js.map → p-7eb5259f.entry.js.map} +1 -1
- package/dist/beeq/p-9573c018.entry.js +6 -0
- package/dist/beeq/{p-49bda6bc.entry.js.map → p-9573c018.entry.js.map} +1 -1
- package/dist/beeq/p-968a4833.entry.js +6 -0
- package/dist/beeq/{p-bf7a0a2d.entry.js.map → p-968a4833.entry.js.map} +1 -1
- package/dist/beeq/{p-4iHDua0i.js → p-BsSDkLU5.js} +1 -1
- package/dist/beeq/p-BsSDkLU5.js.map +1 -0
- package/dist/beeq/p-BtpBVYE0.js +6 -0
- package/dist/beeq/p-BtpBVYE0.js.map +1 -0
- package/dist/beeq/p-C4jSqdYP.js +7 -0
- package/dist/beeq/p-C4jSqdYP.js.map +1 -0
- package/dist/beeq/p-a1ad0e09.entry.js +6 -0
- package/dist/beeq/{p-604a001b.entry.js.map → p-a1ad0e09.entry.js.map} +1 -1
- package/dist/beeq/p-a8c20aaf.entry.js +6 -0
- package/dist/beeq/p-a8c20aaf.entry.js.map +1 -0
- package/dist/beeq/p-a9070048.entry.js +6 -0
- package/dist/beeq/{p-98333265.entry.js.map → p-a9070048.entry.js.map} +1 -1
- package/dist/beeq/p-ad869f7e.entry.js +6 -0
- package/dist/beeq/p-ad869f7e.entry.js.map +1 -0
- package/dist/beeq/p-afb356b4.entry.js +6 -0
- package/dist/beeq/{p-90947d6b.entry.js.map → p-afb356b4.entry.js.map} +1 -1
- package/dist/beeq/p-b3f103da.entry.js +6 -0
- package/dist/beeq/{p-912955f0.entry.js.map → p-b3f103da.entry.js.map} +1 -1
- package/dist/beeq/p-bb038cc5.entry.js +6 -0
- package/dist/beeq/{p-af445f7e.entry.js.map → p-bb038cc5.entry.js.map} +1 -1
- package/dist/beeq/p-c00bcbe6.entry.js +6 -0
- package/dist/beeq/{p-a489f10f.entry.js.map → p-c00bcbe6.entry.js.map} +1 -1
- package/dist/beeq/p-c110a7ea.entry.js +6 -0
- package/dist/beeq/{p-f683e400.entry.js.map → p-c110a7ea.entry.js.map} +1 -1
- package/dist/beeq/p-c5b7bad2.entry.js +6 -0
- package/dist/beeq/{p-4623461e.entry.js.map → p-c5b7bad2.entry.js.map} +1 -1
- package/dist/beeq/p-cb1ec3ac.entry.js +6 -0
- package/dist/beeq/p-cb1ec3ac.entry.js.map +1 -0
- package/dist/beeq/p-d4b0dcda.entry.js +6 -0
- package/dist/beeq/{p-50f9e2c0.entry.js.map → p-d4b0dcda.entry.js.map} +1 -1
- package/dist/beeq/p-d58133b8.entry.js +6 -0
- package/dist/beeq/{p-3fa6805d.entry.js.map → p-d58133b8.entry.js.map} +1 -1
- package/dist/beeq/p-d88394b9.entry.js +6 -0
- package/dist/beeq/p-d88394b9.entry.js.map +1 -0
- package/dist/beeq/p-e2b24948.entry.js +6 -0
- package/dist/beeq/{p-d4b529aa.entry.js.map → p-e2b24948.entry.js.map} +1 -1
- package/dist/beeq/p-ea1244cc.entry.js +6 -0
- package/dist/beeq/p-ea1244cc.entry.js.map +1 -0
- package/dist/beeq/p-f738ef10.entry.js +6 -0
- package/dist/beeq/{p-6e7734bb.entry.js.map → p-f738ef10.entry.js.map} +1 -1
- package/dist/beeq/p-fc2f0022.entry.js +6 -0
- package/dist/beeq/p-fc2f0022.entry.js.map +1 -0
- package/dist/beeq.html-custom-data.json +397 -396
- package/dist/cjs/beeq.cjs.js +3 -3
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion-group.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +8 -5
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +3 -3
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +4 -4
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +6 -6
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-button.bq-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +26 -22
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +4 -4
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +2 -2
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +2 -2
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +6 -6
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-dropdown.bq-panel.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +4 -4
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +2 -2
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +2 -2
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-option-list.bq-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +6 -6
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +2 -2
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +4 -4
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +5 -5
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +209 -102
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +24 -15
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +2 -2
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +6 -6
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +4 -4
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +7 -5
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +6 -6
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +3 -3
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +39 -16
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +18 -7
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +4 -4
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +6 -6
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +4 -4
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +3 -3
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.entry.cjs.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/{getNextElement-B5h_gmRG.js → getNextElement-Bcdj4jIn.js} +4 -4
- package/dist/cjs/getNextElement-Bcdj4jIn.js.map +1 -0
- package/dist/cjs/{index-bEOoX8tm.js → index-BKXwzJHW.js} +545 -168
- package/dist/cjs/index-BKXwzJHW.js.map +1 -0
- package/dist/cjs/{index-CD2anR4A.js → index-BZ6JRHUg.js} +56 -32
- package/dist/cjs/index-BZ6JRHUg.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/bq-accordion.js +6 -3
- package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
- package/dist/collection/components/accordion/scss/bq-accordion.css +1 -1
- package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
- package/dist/collection/components/alert/bq-alert.js +1 -1
- package/dist/collection/components/alert/bq-alert.js.map +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/avatar/bq-avatar.js +2 -2
- package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
- package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
- package/dist/collection/components/badge/bq-badge.js +6 -8
- package/dist/collection/components/badge/bq-badge.js.map +1 -1
- package/dist/collection/components/badge/scss/bq-badge.css +1 -1
- package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
- package/dist/collection/components/button/scss/bq-button.css +1 -1
- package/dist/collection/components/card/bq-card.js +2 -2
- package/dist/collection/components/card/bq-card.js.map +1 -1
- package/dist/collection/components/card/scss/bq-card.css +1 -1
- package/dist/collection/components/checkbox/scss/bq-checkbox.css +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/divider/scss/bq-divider.css +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +4 -4
- package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/dropdown/scss/bq-dropdown.css +1 -1
- package/dist/collection/components/empty-state/scss/bq-empty-state.css +1 -1
- package/dist/collection/components/icon/bq-icon.js +14 -9
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/icon/helper/request.js +9 -10
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/icon/scss/bq-icon.css +1 -1
- package/dist/collection/components/input/scss/bq-input.css +1 -1
- package/dist/collection/components/notification/scss/bq-notification.css +1 -1
- package/dist/collection/components/option/scss/bq-option.css +1 -1
- package/dist/collection/components/option-group/scss/bq-option-group.css +1 -1
- package/dist/collection/components/option-list/scss/bq-option-list.css +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +2 -2
- package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
- package/dist/collection/components/page-title/scss/bq-page-title.css +1 -1
- package/dist/collection/components/panel/scss/bq-panel.css +1 -1
- package/dist/collection/components/progress/bq-progress.js +3 -3
- package/dist/collection/components/progress/bq-progress.js.map +1 -1
- package/dist/collection/components/progress/scss/bq-progress.css +1 -1
- package/dist/collection/components/radio/bq-radio.js +61 -28
- package/dist/collection/components/radio/bq-radio.js.map +1 -1
- package/dist/collection/components/radio/scss/bq-radio.css +1 -1
- package/dist/collection/components/radio-group/bq-radio-group.js +220 -115
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/radio-group/scss/bq-radio-group.css +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +2 -2
- package/dist/collection/components/side-menu/scss/bq-side-menu.css +1 -1
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js +7 -10
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
- package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
- package/dist/collection/components/slider/bq-slider.js +5 -3
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/slider/scss/bq-slider.css +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +4 -4
- package/dist/collection/components/spinner/scss/bq-spinner.css +1 -1
- package/dist/collection/components/status/bq-status.js +1 -1
- package/dist/collection/components/status/scss/bq-status.css +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +79 -18
- package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
- package/dist/collection/components/step-item/scss/bq-step-item.css +1 -1
- package/dist/collection/components/steps/bq-steps.js +48 -5
- package/dist/collection/components/steps/bq-steps.js.map +1 -1
- package/dist/collection/components/steps/scss/bq-steps.css +1 -1
- package/dist/collection/components/switch/bq-switch.js +2 -2
- package/dist/collection/components/switch/scss/bq-switch.css +1 -1
- package/dist/collection/components/tab/bq-tab.js +2 -2
- package/dist/collection/components/tab/scss/bq-tab.css +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +3 -3
- package/dist/collection/components/tab-group/scss/bq-tab-group.css +1 -1
- package/dist/collection/components/tag/bq-tag.js +3 -3
- package/dist/collection/components/tag/scss/bq-tag.css +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +3 -3
- package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
- package/dist/collection/components/toast/bq-toast.js +1 -1
- package/dist/collection/components/toast/scss/bq-toast.css +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +1 -1
- package/dist/collection/components/tooltip/scss/bq-tooltip.css +1 -1
- package/dist/collection/shared/test-utils/index.js +1 -0
- package/dist/collection/shared/test-utils/index.js.map +1 -1
- package/dist/collection/shared/test-utils/setProperties.js +10 -2
- package/dist/collection/shared/test-utils/setProperties.js.map +1 -1
- package/dist/collection/shared/test-utils/waitForSvgLoad.js +61 -0
- package/dist/collection/shared/test-utils/waitForSvgLoad.js.map +1 -0
- package/dist/collection/shared/utils/getNextElement.js +2 -2
- package/dist/collection/shared/utils/getNextElement.js.map +1 -1
- package/dist/components/bq-accordion-group.js +1 -1
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +1 -1
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +1 -1
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +1 -1
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge.js +1 -1
- package/dist/components/bq-breadcrumb-item.js +1 -1
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +1 -1
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button.js +1 -1
- package/dist/components/bq-card.js +1 -1
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +1 -1
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -1
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -1
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider.js +1 -1
- package/dist/components/bq-drawer.js +1 -1
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown.js +1 -1
- package/dist/components/bq-empty-state.js +1 -1
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon.js +1 -1
- package/dist/components/bq-input.js +1 -1
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +1 -1
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -1
- package/dist/components/bq-option-group.js.map +1 -1
- package/dist/components/bq-option-list.js +1 -1
- package/dist/components/bq-option.js +1 -1
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +1 -1
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel.js +1 -1
- package/dist/components/bq-progress.js +1 -1
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +1 -1
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +1 -1
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +1 -1
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +1 -1
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +1 -1
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +1 -1
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +1 -1
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +1 -1
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +1 -1
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -1
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +1 -1
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +1 -1
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +1 -1
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag.js +1 -1
- package/dist/components/bq-textarea.js +1 -1
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +1 -1
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-9gvSRSmi.js +6 -0
- package/dist/components/{p-Cggonv2n.js.map → p-9gvSRSmi.js.map} +1 -1
- package/dist/components/p-B8eXbMij.js +6 -0
- package/dist/components/{p-DLp7W9zW.js.map → p-B8eXbMij.js.map} +1 -1
- package/dist/components/p-BUpGMEPS.js +6 -0
- package/dist/components/{p-DkiBVsAp.js.map → p-BUpGMEPS.js.map} +1 -1
- package/dist/components/p-BmdGoExW.js +6 -0
- package/dist/components/{p-UjIYbgCH.js.map → p-BmdGoExW.js.map} +1 -1
- package/dist/components/p-BrcJUBET.js +6 -0
- package/dist/components/{p-NQu7tItb.js.map → p-BrcJUBET.js.map} +1 -1
- package/dist/components/p-BsSDkLU5.js +6 -0
- package/dist/components/p-BsSDkLU5.js.map +1 -0
- package/dist/components/p-BtpBVYE0.js +6 -0
- package/dist/components/p-BtpBVYE0.js.map +1 -0
- package/dist/components/p-C63H4SKY.js +6 -0
- package/dist/components/{p-BV-P7QQT.js.map → p-C63H4SKY.js.map} +1 -1
- package/dist/components/p-DSDQV9S1.js +6 -0
- package/dist/components/p-DSDQV9S1.js.map +1 -0
- package/dist/components/p-DWg_PDHj.js +6 -0
- package/dist/components/{p-CBNE-LlA.js.map → p-DWg_PDHj.js.map} +1 -1
- package/dist/components/p-DZoizZde.js +6 -0
- package/dist/components/p-DZoizZde.js.map +1 -0
- package/dist/components/p-DdRiQ0rm.js +6 -0
- package/dist/components/{p-CzunKNKG.js.map → p-DdRiQ0rm.js.map} +1 -1
- package/dist/custom-elements.json +4822 -4715
- package/dist/esm/beeq.js +4 -4
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +2 -2
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +8 -5
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +3 -3
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +4 -4
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +6 -6
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +2 -2
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +2 -2
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button.bq-icon.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +26 -22
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +4 -4
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +2 -2
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +3 -3
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +2 -2
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +2 -2
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +6 -6
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown.bq-panel.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +4 -4
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +2 -2
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +2 -2
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +2 -2
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +2 -2
- package/dist/esm/bq-option-group.entry.js.map +1 -1
- package/dist/esm/bq-option-list.bq-tag.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +6 -6
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +2 -2
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +4 -4
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +5 -5
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +206 -99
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +24 -15
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +2 -2
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +6 -6
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +4 -4
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +7 -5
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +6 -6
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +3 -3
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +39 -16
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +18 -7
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +4 -4
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +6 -6
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +4 -4
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +5 -5
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +3 -3
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +4 -4
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{getNextElement-4iHDua0i.js → getNextElement-BsSDkLU5.js} +4 -4
- package/dist/esm/getNextElement-BsSDkLU5.js.map +1 -0
- package/dist/esm/{index-DJ_hypV7.js → index-BtpBVYE0.js} +56 -32
- package/dist/esm/index-BtpBVYE0.js.map +1 -0
- package/dist/esm/{index-e5zjNNdI.js → index-C4jSqdYP.js} +546 -168
- package/dist/esm/index-C4jSqdYP.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hydrate/index.js +815 -469
- package/dist/hydrate/index.mjs +815 -469
- package/dist/stencil.config.js +1 -0
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/date-picker/bq-date-picker.d.ts +1 -1
- package/dist/types/components/icon/helper/request.d.ts +1 -1
- package/dist/types/components/radio/bq-radio.d.ts +15 -7
- package/dist/types/components/radio-group/bq-radio-group.d.ts +57 -16
- package/dist/types/components/side-menu-item/bq-side-menu-item.d.ts +2 -5
- package/dist/types/components/step-item/bq-step-item.d.ts +10 -6
- package/dist/types/components/steps/bq-steps.d.ts +5 -0
- package/dist/types/components.d.ts +42 -37
- package/dist/types/shared/test-utils/index.d.ts +1 -0
- package/dist/types/shared/test-utils/setProperties.d.ts +1 -1
- package/dist/types/shared/test-utils/waitForSvgLoad.d.ts +19 -0
- package/dist/types/shared/utils/getNextElement.d.ts +2 -2
- package/dist/types/stencil-public-runtime.d.ts +12 -5
- package/package.json +1 -1
- package/dist/beeq/p-078d8f91.entry.js +0 -6
- package/dist/beeq/p-0949ff39.entry.js +0 -6
- package/dist/beeq/p-189629c7.entry.js +0 -6
- package/dist/beeq/p-20d9b09b.entry.js +0 -6
- package/dist/beeq/p-2219f451.entry.js +0 -6
- package/dist/beeq/p-388876c1.entry.js +0 -6
- package/dist/beeq/p-388876c1.entry.js.map +0 -1
- package/dist/beeq/p-3c330710.entry.js +0 -6
- package/dist/beeq/p-3c330710.entry.js.map +0 -1
- package/dist/beeq/p-3f7193fb.entry.js +0 -6
- package/dist/beeq/p-3fa6805d.entry.js +0 -6
- package/dist/beeq/p-41744618.entry.js +0 -6
- package/dist/beeq/p-41744618.entry.js.map +0 -1
- package/dist/beeq/p-4623461e.entry.js +0 -6
- package/dist/beeq/p-49bda6bc.entry.js +0 -6
- package/dist/beeq/p-4c4201e1.entry.js +0 -6
- package/dist/beeq/p-4f24e77c.entry.js +0 -6
- package/dist/beeq/p-4iHDua0i.js.map +0 -1
- package/dist/beeq/p-50f9e2c0.entry.js +0 -6
- package/dist/beeq/p-5105d079.entry.js +0 -6
- package/dist/beeq/p-5105d079.entry.js.map +0 -1
- package/dist/beeq/p-604a001b.entry.js +0 -6
- package/dist/beeq/p-6bcae73b.entry.js +0 -6
- package/dist/beeq/p-6e7734bb.entry.js +0 -6
- package/dist/beeq/p-76ee57c6.entry.js +0 -6
- package/dist/beeq/p-76ee57c6.entry.js.map +0 -1
- package/dist/beeq/p-80916524.entry.js +0 -6
- package/dist/beeq/p-90947d6b.entry.js +0 -6
- package/dist/beeq/p-912955f0.entry.js +0 -6
- package/dist/beeq/p-98333265.entry.js +0 -6
- package/dist/beeq/p-987c0ab6.entry.js +0 -6
- package/dist/beeq/p-987c0ab6.entry.js.map +0 -1
- package/dist/beeq/p-DJ_hypV7.js +0 -6
- package/dist/beeq/p-DJ_hypV7.js.map +0 -1
- package/dist/beeq/p-a489f10f.entry.js +0 -6
- package/dist/beeq/p-a6d2ceb4.entry.js +0 -6
- package/dist/beeq/p-ab352f43.entry.js +0 -6
- package/dist/beeq/p-af445f7e.entry.js +0 -6
- package/dist/beeq/p-bf7a0a2d.entry.js +0 -6
- package/dist/beeq/p-c3f20d0e.entry.js +0 -6
- package/dist/beeq/p-c5fc822f.entry.js +0 -6
- package/dist/beeq/p-c5fc822f.entry.js.map +0 -1
- package/dist/beeq/p-d4b529aa.entry.js +0 -6
- package/dist/beeq/p-e5zjNNdI.js +0 -7
- package/dist/beeq/p-e5zjNNdI.js.map +0 -1
- package/dist/beeq/p-e8435655.entry.js +0 -6
- package/dist/beeq/p-e91d1052.entry.js +0 -6
- package/dist/beeq/p-ed10c8bf.entry.js +0 -6
- package/dist/beeq/p-ee31c3cb.entry.js +0 -6
- package/dist/beeq/p-ee31c3cb.entry.js.map +0 -1
- package/dist/beeq/p-f683e400.entry.js +0 -6
- package/dist/beeq/p-f9734e66.entry.js +0 -6
- package/dist/cjs/getNextElement-B5h_gmRG.js.map +0 -1
- package/dist/cjs/index-CD2anR4A.js.map +0 -1
- package/dist/cjs/index-bEOoX8tm.js.map +0 -1
- package/dist/components/p-9Z6M4Uap.js +0 -6
- package/dist/components/p-9Z6M4Uap.js.map +0 -1
- package/dist/components/p-BV-P7QQT.js +0 -6
- package/dist/components/p-CBNE-LlA.js +0 -6
- package/dist/components/p-Cggonv2n.js +0 -6
- package/dist/components/p-CzunKNKG.js +0 -6
- package/dist/components/p-DBkP6C_Q.js +0 -6
- package/dist/components/p-DBkP6C_Q.js.map +0 -1
- package/dist/components/p-DJ_hypV7.js +0 -6
- package/dist/components/p-DJ_hypV7.js.map +0 -1
- package/dist/components/p-DLp7W9zW.js +0 -6
- package/dist/components/p-DkiBVsAp.js +0 -6
- package/dist/components/p-NQu7tItb.js +0 -6
- package/dist/components/p-UjIYbgCH.js +0 -6
- package/dist/esm/getNextElement-4iHDua0i.js.map +0 -1
- package/dist/esm/index-DJ_hypV7.js.map +0 -1
- package/dist/esm/index-e5zjNNdI.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-drawer.entry.esm.js","sources":["../../packages/beeq/src/components/drawer/bq-drawer.types.ts","../../packages/beeq/src/components/drawer/scss/bq-drawer.scss?tag=bq-drawer&encapsulation=shadow","../../packages/beeq/src/components/drawer/bq-drawer.tsx"],"sourcesContent":["export const DRAWER_POSITIONS = ['start', 'end'] as const;\nexport type TDrawerPosition = (typeof DRAWER_POSITIONS)[number];\n// !TO BE REMOVED: `placement` is deprecated and it will be removed in the future\nexport const DRAWER_PLACEMENT = ['left', 'right'] as const;\nexport type TDrawerPlacement = (typeof DRAWER_PLACEMENT)[number];\n","/* -------------------------------------------------------------------------- */\n/* Drawer styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-drawer.variables';\n\n:host {\n @apply invisible #{!important};\n}\n\n:host(.bq-drawer--open) {\n @apply visible #{!important};\n}\n\n.bq-drawer {\n @apply fixed z-[--bq-drawer--zIndex] flex flex-col gap-[--bq-drawer--gap] bg-primary shadow-m is-[--bq-drawer--width] max-is-full p-b-[--bq-drawer--paddingY] p-i-[--bq-drawer--paddingX] inset-b-0;\n}\n","import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport { DRAWER_PLACEMENT, DRAWER_POSITIONS } from './bq-drawer.types';\nimport type { TDrawerPlacement, TDrawerPosition } from './bq-drawer.types';\nimport { enter, hasSlotContent, isNil, leave, validatePropValue } from '../../shared/utils';\n\n/**\n * The Drawer component provides a sliding panel interface commonly used for navigation or presenting additional content without taking up significant screen space.\n *\n * @example How to use it\n * ```html\n * <bq-drawer position=\"end\">\n * <div class=\"flex gap-xs\" slot=\"title\">Title</div>\n * <div class=\"...\">\n * Content\n * </div>\n * <div class=\"flex flex-1 justify-center gap-xs\" slot=\"footer\">\n * <bq-button appearance=\"primary\" block=\"\" size=\"small\">Button</bq-button>\n * <bq-button appearance=\"link\" block=\"\" size=\"small\">Button</bq-button>\n * </div>\n * </bq-drawer>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/871139-drawer\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n * @dependency bq-divider\n *\n * @attr {boolean} enable-backdrop - If true, the backdrop overlay will be shown when the drawer opens.\n * @attr {boolean} close-on-click-outside - If true, the drawer will not close when clicking outside the panel.\n * @attr {boolean} close-on-esc - If true, the drawer will not close when the [Esc] key is pressed.\n * @attr {boolean} open - If true, the drawer component will be shown.\n * @attr {\"start\" | \"end\"} position - Defines the position of the drawer.\n *\n * @method show - Method to be called to show the drawer component.\n * @method hide - Method to be called to hide the drawer component.\n *\n * @event bqClose - Callback handler to be called when the drawer is closed.\n * @event bqOpen - Callback handler to be called when the drawer is opened.\n * @event bqAfterOpen - Callback handler to be called after the drawer has been opened.\n * @event bqAfterClose - Callback handler to be called after the drawer has been closed.\n *\n * @slot title - The title content of the drawer.\n * @slot - The body content of the drawer.\n * @slot footer - The footer content of the drawer.\n * @slot button-close - The close button content of the drawer.\n * @slot footer-divider - The footer divider content of the drawer.\n *\n * @part backdrop - The `<div>` that holds the backdrop overlay.\n * @part button-close - The BqButton that closes the drawer.\n * @part button-close__btn - The native button used under the hood that closes the drawer.\n * @part button-close__label - The text inside the native button that closes the drawer.\n * @part panel - The `<div>` that holds the drawer entire content.\n * @part header - The `<header>` that holds the icon, title, and close button.\n * @part title - The `<div>` that holds the title content.\n * @part body - The `<main>` that holds the drawer body content.\n * @part footer - The `<footer>` that holds footer content.\n *\n * @cssprop --bq-drawer--backgroundBackdrop - Background color of the backdrop\n * @cssprop --bq-drawer--gap - Gap between the drawer and the viewport\n * @cssprop --bq-drawer--width - Width of the drawer\n * @cssprop --bq-drawer--paddingX - Padding left and right of the drawer\n * @cssprop --bq-drawer--paddingY - Padding top and bottom of the drawer\n * @cssprop --bq-drawer--zIndex - Z-index of the drawer component\n */\n@Component({\n tag: 'bq-drawer',\n styleUrl: './scss/bq-drawer.scss',\n shadow: true,\n})\nexport class BqDrawer {\n // Own Properties\n // ====================\n\n private footerElem: HTMLElement;\n private drawerElem: HTMLDivElement;\n private OPEN_CSS_CLASS = 'bq-drawer--open';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDrawerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasFooter = false;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true, the backdrop overlay will be shown when the drawer opens */\n @Prop({ reflect: true }) enableBackdrop = false;\n\n /** If true, the drawer will not close when clicking outside the panel */\n @Prop({ reflect: true }) closeOnClickOutside = false;\n\n /** If true, the dialog will not close when the [Esc] key is pressed */\n @Prop({ reflect: true }) closeOnEsc = false;\n\n /** If true, the drawer component will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** @deprecated Defines the position of the drawer */\n @Prop({ reflect: true, mutable: true }) placement: TDrawerPlacement = 'right';\n\n /** Defines the position of the drawer */\n @Prop({ reflect: true, mutable: true }) position: TDrawerPosition = 'end';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n async handleOpenChange() {\n if (!this.open) {\n await this.handleAfterHide();\n return;\n }\n\n await this.handleAfterShow();\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `placement` property is removed\n * We need to maintain retro-compatibility with the deprecated `placement` property\n */\n @Watch('placement')\n handlePlacementChange() {\n if (!isNil(this.placement)) {\n console.warn(\n `❗️ [bq-drawer]: the 'placement' prop is deprecated and it will be removed in the future. Please use 'position' instead.`,\n );\n }\n validatePropValue(DRAWER_PLACEMENT, 'right', this.el, 'placement');\n // Sync 'position' property\n const synPositionMap = {\n right: 'end',\n left: 'start',\n };\n this.position = (synPositionMap[this.placement] as TDrawerPosition) || this.position;\n }\n\n @Watch('position')\n handlePositionChange() {\n validatePropValue(DRAWER_POSITIONS, 'start', this.el, 'position');\n /**\n * Sync 'placement' property\n * !TO BE REMOVED: Delete the code below once the deprecated `placement` property is removed\n */\n const syncPlacementMap = {\n end: 'right',\n start: 'left',\n };\n this.placement = (syncPlacementMap[this.position] as TDrawerPlacement) || this.placement;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the drawer is closed */\n @Event() bqClose!: EventEmitter;\n\n /** Callback handler to be called when the drawer is opened */\n @Event() bqOpen!: EventEmitter;\n\n /** Callback handler to be called after the drawer has been opened */\n @Event() bqAfterOpen!: EventEmitter;\n\n /** Callback handler to be called after the drawer has been closed */\n @Event() bqAfterClose!: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handlePositionChange();\n // !TO BE REMOVED: Delete this once the deprecated `placement` property is removed\n this.handlePlacementChange();\n }\n\n componentDidLoad() {\n this.handleFooterSlotChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('mousedown', { target: 'window', capture: true })\n async handleMouseClick(event: MouseEvent) {\n if (!this.open) return;\n if (!this.drawerElem || this.closeOnClickOutside) return;\n // Skip if the mouse button is not the main button\n if (event.button !== 0) return;\n\n const rect = this.drawerElem.getBoundingClientRect();\n if (event.clientX < rect.left || event.clientX > rect.right) {\n await this.hide();\n }\n }\n\n @Listen('keydown', { target: 'window', capture: true })\n async handleKeyDown(event: KeyboardEvent) {\n if (!this.open) return;\n if (!this.drawerElem || this.closeOnEsc || !(event.key === 'Escape' || event.key === 'Esc')) return;\n\n await this.hide();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to hide the drawer component */\n @Method()\n async hide(): Promise<void> {\n const ev = this.bqClose.emit();\n if (ev.defaultPrevented) return;\n\n this.open = false;\n }\n\n /** Method to be called to show the drawer component */\n @Method()\n async show(): Promise<void> {\n const ev = this.bqOpen.emit();\n if (ev.defaultPrevented) return;\n\n this.open = true;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleFooterSlotChange = () => {\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private handleAfterHide = async () => {\n if (!this.drawerElem) return;\n\n await leave(this.drawerElem);\n this.handleTransitionEnd();\n };\n\n private handleAfterShow = async () => {\n if (!this.drawerElem) return;\n\n this.el.classList.add(this.OPEN_CSS_CLASS);\n await enter(this.drawerElem);\n this.handleTransitionEnd();\n };\n\n private handleTransitionEnd = () => {\n if (this.open) {\n this.bqAfterOpen.emit();\n return;\n }\n\n this.bqAfterClose.emit();\n this.el.classList.remove(this.OPEN_CSS_CLASS);\n };\n\n private get isPositionStart() {\n // !TO BE REMOVED: `placement` is deprecated and will be removed in the future\n return this.position === 'start' || this.placement === 'left';\n }\n\n private get isPositionEnd() {\n // !TO BE REMOVED: `placement` is deprecated and will be removed in the future\n return this.position === 'end' || this.placement === 'right';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host>\n {/* BACKDROP */}\n {this.enableBackdrop && (\n <div\n class={{\n 'fixed inset-0 block bg-[--bq-drawer--backgroundBackdrop] opacity-0 transition-opacity duration-300':\n true,\n 'pointer-events-none': !this.open,\n 'opacity-60': this.open,\n }}\n tabIndex={-1}\n part=\"backdrop\"\n />\n )}\n {/* DRAWER PANEL */}\n <div\n class={{\n [`bq-drawer transition-all duration-300 ease-in-out ${this.position || this.placement}`]: true,\n '-start-[--bq-drawer--width]': this.isPositionStart,\n '-end-[--bq-drawer--width]': this.isPositionEnd,\n 'start-0': this.open && this.isPositionStart,\n 'end-0': this.open && this.isPositionEnd,\n }}\n ref={(div) => (this.drawerElem = div)}\n aria-hidden={!this.open ? 'true' : 'false'}\n aria-labelledby=\"bq-drawer__title\"\n aria-modal=\"true\"\n hidden={!this.open}\n part=\"panel\"\n role=\"dialog\"\n >\n <header class=\"flex items-center\" part=\"header\">\n <h2\n class=\"flex-1 items-center justify-between font-bold leading-regular text-primary\"\n id=\"bq-drawer__title\"\n part=\"title\"\n >\n <slot name=\"title\" />\n </h2>\n <div class=\"flex\" part=\"button-close\">\n <bq-button\n class=\"[&::part(button)]:rounded-s [&::part(button)]:border-0 [&::part(button)]:bs-fit [&::part(button)]:p-b-0 [&::part(button)]:p-i-0 [&::part(label)]:inline-flex\"\n appearance=\"text\"\n size=\"small\"\n slot=\"button-close\"\n exportparts=\"button:button-close__btn,label:button-close__label\"\n onClick={this.hide.bind(this)}\n >\n <slot name=\"button-close\">\n <bq-icon name=\"x-bold\" role=\"img\" title=\"Close\" />\n </slot>\n </bq-button>\n </div>\n </header>\n <main class=\"block flex-auto overflow-auto\" part=\"body\">\n <slot />\n </main>\n <footer\n class={{\n block: true,\n '!hidden': !this.hasFooter,\n }}\n ref={(footerElem) => (this.footerElem = footerElem)}\n part=\"footer\"\n >\n <slot name=\"footer-divider\">\n <bq-divider class=\"mb-m block\" dashed />\n </slot>\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange} />\n </footer>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,KAAK,CAAU;AAEzD;AACO,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;;ACH1D,MAAM,WAAW,GAAG,w0sBAAw0sB;;MCyE/0sB,QAAQ,GAAA,MAAA;;;;;;;;;;AAIX,IAAA,UAAU;AACV,IAAA,UAAU;IACV,cAAc,GAAG,iBAAiB;;;;;IAWzB,SAAS,GAAG,KAAK;IACzB,OAAO,GAAY,KAAK;;;;IAMR,cAAc,GAAG,KAAK;;IAGtB,mBAAmB,GAAG,KAAK;;IAG3B,UAAU,GAAG,KAAK;;AAGH,IAAA,IAAI;;IAGJ,SAAS,GAAqB,OAAO;;IAGrC,QAAQ,GAAoB,KAAK;;;AAMzE,IAAA,MAAM,gBAAgB,GAAA;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACd,YAAA,MAAM,IAAI,CAAC,eAAe,EAAE;YAC5B;;AAGF,QAAA,MAAM,IAAI,CAAC,eAAe,EAAE;;AAG9B;;;AAGG;IAEH,qBAAqB,GAAA;QACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AAC1B,YAAA,OAAO,CAAC,IAAI,CACV,CAAA,uHAAA,CAAyH,CAC1H;;QAEH,iBAAiB,CAAC,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC;;AAElE,QAAA,MAAM,cAAc,GAAG;AACrB,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,IAAI,EAAE,OAA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A,EAAA,CAAQ,CACH,EACP,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS;AAC3B,aAAA,EACD,GAAG,EAAE,CAAC,UAAU,MAAM,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,EACnD,IAAI,EAAC,QAAQ,EAAA,EAEb,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,gBAAgB,EAAA,EACzB,CAAA,CAAA,YAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAY,KAAK,EAAC,YAAY,EAAC,MAAM,SAAG,CACnC,EACP,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,EAAI,CAAA,CAC1D,CACL,CACD;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bq-drawer.entry.esm.js","sources":["../../packages/beeq/src/components/drawer/bq-drawer.types.ts","../../packages/beeq/src/components/drawer/scss/bq-drawer.scss?tag=bq-drawer&encapsulation=shadow","../../packages/beeq/src/components/drawer/bq-drawer.tsx"],"sourcesContent":["export const DRAWER_POSITIONS = ['start', 'end'] as const;\nexport type TDrawerPosition = (typeof DRAWER_POSITIONS)[number];\n// !TO BE REMOVED: `placement` is deprecated and it will be removed in the future\nexport const DRAWER_PLACEMENT = ['left', 'right'] as const;\nexport type TDrawerPlacement = (typeof DRAWER_PLACEMENT)[number];\n","/* -------------------------------------------------------------------------- */\n/* Drawer styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-drawer.variables';\n\n:host {\n @apply invisible #{!important};\n}\n\n:host(.bq-drawer--open) {\n @apply visible #{!important};\n}\n\n.bq-drawer {\n @apply fixed z-[--bq-drawer--zIndex] flex flex-col gap-[--bq-drawer--gap] bg-ui-primary shadow-m is-[--bq-drawer--width] max-is-full p-b-[--bq-drawer--paddingY] p-i-[--bq-drawer--paddingX] inset-b-0;\n}\n","import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport { DRAWER_PLACEMENT, DRAWER_POSITIONS } from './bq-drawer.types';\nimport type { TDrawerPlacement, TDrawerPosition } from './bq-drawer.types';\nimport { enter, hasSlotContent, isNil, leave, validatePropValue } from '../../shared/utils';\n\n/**\n * The Drawer component provides a sliding panel interface commonly used for navigation or presenting additional content without taking up significant screen space.\n *\n * @example How to use it\n * ```html\n * <bq-drawer position=\"end\">\n * <div class=\"flex gap-xs\" slot=\"title\">Title</div>\n * <div class=\"...\">\n * Content\n * </div>\n * <div class=\"flex flex-1 justify-center gap-xs\" slot=\"footer\">\n * <bq-button appearance=\"primary\" block=\"\" size=\"small\">Button</bq-button>\n * <bq-button appearance=\"link\" block=\"\" size=\"small\">Button</bq-button>\n * </div>\n * </bq-drawer>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/871139-drawer\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n * @dependency bq-divider\n *\n * @attr {boolean} enable-backdrop - If true, the backdrop overlay will be shown when the drawer opens.\n * @attr {boolean} close-on-click-outside - If true, the drawer will not close when clicking outside the panel.\n * @attr {boolean} close-on-esc - If true, the drawer will not close when the [Esc] key is pressed.\n * @attr {boolean} open - If true, the drawer component will be shown.\n * @attr {\"start\" | \"end\"} position - Defines the position of the drawer.\n *\n * @method show - Method to be called to show the drawer component.\n * @method hide - Method to be called to hide the drawer component.\n *\n * @event bqClose - Callback handler to be called when the drawer is closed.\n * @event bqOpen - Callback handler to be called when the drawer is opened.\n * @event bqAfterOpen - Callback handler to be called after the drawer has been opened.\n * @event bqAfterClose - Callback handler to be called after the drawer has been closed.\n *\n * @slot title - The title content of the drawer.\n * @slot - The body content of the drawer.\n * @slot footer - The footer content of the drawer.\n * @slot button-close - The close button content of the drawer.\n * @slot footer-divider - The footer divider content of the drawer.\n *\n * @part backdrop - The `<div>` that holds the backdrop overlay.\n * @part button-close - The BqButton that closes the drawer.\n * @part button-close__btn - The native button used under the hood that closes the drawer.\n * @part button-close__label - The text inside the native button that closes the drawer.\n * @part panel - The `<div>` that holds the drawer entire content.\n * @part header - The `<header>` that holds the icon, title, and close button.\n * @part title - The `<div>` that holds the title content.\n * @part body - The `<main>` that holds the drawer body content.\n * @part footer - The `<footer>` that holds footer content.\n *\n * @cssprop --bq-drawer--backgroundBackdrop - Background color of the backdrop\n * @cssprop --bq-drawer--gap - Gap between the drawer and the viewport\n * @cssprop --bq-drawer--width - Width of the drawer\n * @cssprop --bq-drawer--paddingX - Padding left and right of the drawer\n * @cssprop --bq-drawer--paddingY - Padding top and bottom of the drawer\n * @cssprop --bq-drawer--zIndex - Z-index of the drawer component\n */\n@Component({\n tag: 'bq-drawer',\n styleUrl: './scss/bq-drawer.scss',\n shadow: true,\n})\nexport class BqDrawer {\n // Own Properties\n // ====================\n\n private footerElem: HTMLElement;\n private drawerElem: HTMLDivElement;\n private OPEN_CSS_CLASS = 'bq-drawer--open';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDrawerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasFooter = false;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true, the backdrop overlay will be shown when the drawer opens */\n @Prop({ reflect: true }) enableBackdrop = false;\n\n /** If true, the drawer will not close when clicking outside the panel */\n @Prop({ reflect: true }) closeOnClickOutside = false;\n\n /** If true, the dialog will not close when the [Esc] key is pressed */\n @Prop({ reflect: true }) closeOnEsc = false;\n\n /** If true, the drawer component will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** @deprecated Defines the position of the drawer */\n @Prop({ reflect: true, mutable: true }) placement: TDrawerPlacement = 'right';\n\n /** Defines the position of the drawer */\n @Prop({ reflect: true, mutable: true }) position: TDrawerPosition = 'end';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n async handleOpenChange() {\n if (!this.open) {\n await this.handleAfterHide();\n return;\n }\n\n await this.handleAfterShow();\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `placement` property is removed\n * We need to maintain retro-compatibility with the deprecated `placement` property\n */\n @Watch('placement')\n handlePlacementChange() {\n if (!isNil(this.placement)) {\n console.warn(\n `❗️ [bq-drawer]: the 'placement' prop is deprecated and it will be removed in the future. Please use 'position' instead.`,\n );\n }\n validatePropValue(DRAWER_PLACEMENT, 'right', this.el, 'placement');\n // Sync 'position' property\n const synPositionMap = {\n right: 'end',\n left: 'start',\n };\n this.position = (synPositionMap[this.placement] as TDrawerPosition) || this.position;\n }\n\n @Watch('position')\n handlePositionChange() {\n validatePropValue(DRAWER_POSITIONS, 'start', this.el, 'position');\n /**\n * Sync 'placement' property\n * !TO BE REMOVED: Delete the code below once the deprecated `placement` property is removed\n */\n const syncPlacementMap = {\n end: 'right',\n start: 'left',\n };\n this.placement = (syncPlacementMap[this.position] as TDrawerPlacement) || this.placement;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the drawer is closed */\n @Event() bqClose!: EventEmitter;\n\n /** Callback handler to be called when the drawer is opened */\n @Event() bqOpen!: EventEmitter;\n\n /** Callback handler to be called after the drawer has been opened */\n @Event() bqAfterOpen!: EventEmitter;\n\n /** Callback handler to be called after the drawer has been closed */\n @Event() bqAfterClose!: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handlePositionChange();\n // !TO BE REMOVED: Delete this once the deprecated `placement` property is removed\n this.handlePlacementChange();\n }\n\n componentDidLoad() {\n this.handleFooterSlotChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('mousedown', { target: 'window', capture: true })\n async handleMouseClick(event: MouseEvent) {\n if (!this.open) return;\n if (!this.drawerElem || this.closeOnClickOutside) return;\n // Skip if the mouse button is not the main button\n if (event.button !== 0) return;\n\n const rect = this.drawerElem.getBoundingClientRect();\n if (event.clientX < rect.left || event.clientX > rect.right) {\n await this.hide();\n }\n }\n\n @Listen('keydown', { target: 'window', capture: true })\n async handleKeyDown(event: KeyboardEvent) {\n if (!this.open) return;\n if (!this.drawerElem || this.closeOnEsc || !(event.key === 'Escape' || event.key === 'Esc')) return;\n\n await this.hide();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to hide the drawer component */\n @Method()\n async hide(): Promise<void> {\n const ev = this.bqClose.emit();\n if (ev.defaultPrevented) return;\n\n this.open = false;\n }\n\n /** Method to be called to show the drawer component */\n @Method()\n async show(): Promise<void> {\n const ev = this.bqOpen.emit();\n if (ev.defaultPrevented) return;\n\n this.open = true;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleFooterSlotChange = () => {\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private handleAfterHide = async () => {\n if (!this.drawerElem) return;\n\n await leave(this.drawerElem);\n this.handleTransitionEnd();\n };\n\n private handleAfterShow = async () => {\n if (!this.drawerElem) return;\n\n this.el.classList.add(this.OPEN_CSS_CLASS);\n await enter(this.drawerElem);\n this.handleTransitionEnd();\n };\n\n private handleTransitionEnd = () => {\n if (this.open) {\n this.bqAfterOpen.emit();\n return;\n }\n\n this.bqAfterClose.emit();\n this.el.classList.remove(this.OPEN_CSS_CLASS);\n };\n\n private get isPositionStart() {\n // !TO BE REMOVED: `placement` is deprecated and will be removed in the future\n return this.position === 'start' || this.placement === 'left';\n }\n\n private get isPositionEnd() {\n // !TO BE REMOVED: `placement` is deprecated and will be removed in the future\n return this.position === 'end' || this.placement === 'right';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host>\n {/* BACKDROP */}\n {this.enableBackdrop && (\n <div\n class={{\n 'fixed inset-0 block bg-[--bq-drawer--backgroundBackdrop] opacity-0 transition-opacity duration-300': true,\n 'pointer-events-none': !this.open,\n 'opacity-60': this.open,\n }}\n tabIndex={-1}\n part=\"backdrop\"\n />\n )}\n {/* DRAWER PANEL */}\n <div\n class={{\n [`bq-drawer transition-all duration-300 ease-in-out ${this.position || this.placement}`]: true,\n '-start-[--bq-drawer--width]': this.isPositionStart,\n '-end-[--bq-drawer--width]': this.isPositionEnd,\n 'start-0': this.open && this.isPositionStart,\n 'end-0': this.open && this.isPositionEnd,\n }}\n ref={(div) => (this.drawerElem = div)}\n aria-hidden={!this.open ? 'true' : 'false'}\n aria-labelledby=\"bq-drawer__title\"\n aria-modal=\"true\"\n hidden={!this.open}\n part=\"panel\"\n role=\"dialog\"\n >\n <header class=\"flex items-center\" part=\"header\">\n <h2\n class=\"flex-1 items-center justify-between text-xl font-bold leading-regular text-primary\"\n id=\"bq-drawer__title\"\n part=\"title\"\n >\n <slot name=\"title\" />\n </h2>\n <div class=\"flex\" part=\"button-close\">\n <bq-button\n class=\"[&::part(button)]:rounded-s [&::part(button)]:border-0 [&::part(button)]:bs-fit [&::part(button)]:p-b-0 [&::part(button)]:p-i-0 [&::part(label)]:inline-flex\"\n appearance=\"text\"\n size=\"small\"\n slot=\"button-close\"\n exportparts=\"button:button-close__btn,label:button-close__label\"\n onClick={this.hide.bind(this)}\n >\n <slot name=\"button-close\">\n <bq-icon name=\"x-bold\" role=\"img\" title=\"Close\" />\n </slot>\n </bq-button>\n </div>\n </header>\n <main class=\"block flex-auto overflow-auto\" part=\"body\">\n <slot />\n </main>\n <footer\n class={{\n block: true,\n '!hidden': !this.hasFooter,\n }}\n ref={(footerElem) => (this.footerElem = footerElem)}\n part=\"footer\"\n >\n <slot name=\"footer-divider\">\n <bq-divider class=\"mb-m block\" dashed />\n </slot>\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange} />\n </footer>\n </div>\n </Host>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AAU,MAAM,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,EACnD,IAAI,EAAC,QAAQ,EAAA,EAEb,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,gBAAgB,EAAA,EACzB,CAAA,CAAA,YAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAY,KAAK,EAAC,YAAY,EAAC,MAAM,SAAG,CACnC,EACP,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,EAAI,CAAA,CAC1D,CACL,CACD;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-dropdown.bq-panel.entry.esm.js","sources":["../../packages/beeq/src/components/dropdown/scss/bq-dropdown.scss?tag=bq-dropdown&encapsulation=shadow","../../packages/beeq/src/components/dropdown/bq-dropdown.tsx","../../packages/beeq/src/components/panel/scss/bq-panel.scss?tag=bq-panel&encapsulation=shadow","../../packages/beeq/src/components/panel/bq-panel.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Dropdown styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply relative inline-block;\n}\n","import { Component, Element, Event, h, Listen, Prop, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport { isEventTargetChildOfElement } from '../../shared/utils';\n\nlet id = 0;\n\n/**\n * The Dropdown Component is commonly used when presenting a list of selectable options that are too numerous to fit comfortably on the screen.\n * They provide an efficient way to save space and present a long list of options in a compact and organized manner.\n *\n * @example How to use it\n * ```html\n * <bq-dropdown placement=\"bottom-start\">\n * <bq-button slot=\"trigger\">Dropdown</bq-button>\n * <bq-option-list>\n * <bq-option value=\"users\">...</bq-option>\n * <bq-option value=\"user\">...</bq-option>\n * <bq-option value=\"dashboard\">...</bq-option>\n * <bq-option value=\"settings\">...</bq-option>\n * <bq-option value=\"logout\">...</bq-option>\n * </bq-option-list>\n * </bq-dropdown>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/47ff4b-dropdown\n * @status stable\n *\n * @dependency bq-panel\n *\n * @attr {boolean} disabled - If true, the dropdown panel will be visible and won't be shown.\n * @attr {number} distance - Represents the distance (gutter or margin) between the panel and the trigger element.\n * @attr {boolean} keep-open-on-select - If true, the panel will remain open after a selection is made.\n * @attr {\"top\" | \"bottom\" | \"left\" | \"right\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\" | \"right-start\" | \"right-end\"} placement - Position of the panel.\n * @attr {boolean} open - If true, the panel will be visible.\n * @attr {string} panel-height - When set, it will override the height of the dropdown panel.\n * @attr {boolean} same-width - Whether the panel should have the same width as the trigger element.\n * @attr {number} skidding - Represents the skidding between the panel and the trigger element.\n * @attr {\"fixed\" | \"absolute\"} strategy - Defines the strategy to position the panel.\n *\n * @event bqOpen - Callback handler to be called when the dropdown panel is opened or closed.\n *\n * @slot trigger - The trigger element that opens the dropdown panel.\n * @slot - The content of the dropdown panel.\n *\n * @part base - The component's internal wrapper.\n * @part dropdown - The `<bq-panel>` element used under the hood to display the dropdown panel.\n * @part panel - The `<div>` element used to display and style the panel inside the `<bq-panel>` element.\n * @part trigger - The `<div>` element that hosts the trigger element.\n *\n * @cssprop --bq-panel--background - Panel background color\n * @cssprop --bq-panel--border-color - Panel border color\n * @cssprop --bq-panel--border-radius - Panel border radius\n * @cssprop --bq-panel--border-style - Panel border style\n * @cssprop --bq-panel--border-width - Panel border width\n * @cssprop --bq-panel--box-shadow - Panel box shadow\n * @cssprop --bq-panel--padding - Panel padding\n * @cssprop --bq-panel--height - Panel height\n * @cssprop --bq-panel--width - Panel width\n * @cssprop --bq-panel-z-index - Panel z-index applied when opened\n */\n@Component({\n tag: 'bq-dropdown',\n styleUrl: './scss/bq-dropdown.scss',\n shadow: true,\n})\nexport class BqDropdown {\n // Own Properties\n // ====================\n\n private dropdownPanelId = `bq-dropdown-panel-${++id}`;\n private triggerElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDropdownElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the dropdown panel will not lock the page body scroll when open. */\n @Prop({ reflect: true }) disableScrollLock?: boolean = false;\n\n /** If true, the dropdown panel will be visible and won't be shown. */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** If true, the panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the dropdown panel */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n onOpenChange() {\n this.bqOpen.emit({ open: this.open });\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.triggerElem) return;\n\n // set 'disabled' attribute based on 'this.disabled' value, ensuring consistent state handling\n if (!this.disabled) {\n this.triggerElem?.removeAttribute('disabled');\n return;\n }\n this.triggerElem?.setAttribute('disabled', 'true');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the dropdown panel is opened or closed. */\n @Event() bqOpen: EventEmitter<{ open: boolean }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.triggerElem = this.el.querySelector('[slot=\"trigger\"]');\n this.handleDisabledChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqSelect', { passive: true })\n onItemSelect() {\n if (this.keepOpenOnSelect) return;\n\n this.open = false;\n }\n\n /** Listens for the 'click' event on the document object\n * and closes the dropdown panel if the click is outside the component.\n */\n @Listen('click', { target: 'document', passive: true })\n onClickOutside(event: MouseEvent) {\n if (!this.open || isEventTargetChildOfElement(event, this.el)) return;\n\n // Close when clicking outside of the close element\n this.open = false;\n }\n\n @Listen('keyup', { target: 'window', passive: true })\n onEscape(event: KeyboardEvent) {\n if (!this.open) return;\n // Close the panel when pressing Escape or when pressing Tab and the component loses focus.\n if (event.key === 'Escape' || (event.key === 'Tab' && !isEventTargetChildOfElement(event, this.el))) {\n this.open = false;\n }\n }\n\n @Listen('scroll', { target: 'window', passive: true, capture: true })\n handleScrollEvent() {\n if (!this.open || this.disableScrollLock) return;\n\n // Close the panel when the scroll event is triggered.\n // This is useful for those cases where the floating panel is inside a scrollable container.\n // For example, a select inside a dialog, drawer, etc.\n // ⚠️ Notice that document body scroll lock is handled via the `scrollLock` utility.\n this.open = false;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private togglePanel = (): void => {\n // Don't toggle the panel if the component is disabled or the trigger element is disabled\n if (this.disabled || this.triggerElem?.hasAttribute('disabled')) return;\n\n this.open = !this.open;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),\n };\n\n return (\n <div class=\"bq-dropdown\" part=\"base\">\n {/* TRIGGER CONTAINER */}\n <div\n class=\"bq-dropdown__trigger block\"\n aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n onClick={this.togglePanel}\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n style={style}\n id={this.dropdownPanelId}\n class=\"bq-dropdown__panel\"\n disableScrollLock={this.disableScrollLock}\n distance={this.distance}\n placement={this.placement}\n open={this.open}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n role=\"group\"\n part=\"dropdown\"\n exportparts=\"panel\"\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n","/* -------------------------------------------------------------------------- */\n/* Panel styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-panel.variables';\n\n:host {\n @apply block;\n}\n\n.bq-panel {\n @include animation-fade-in;\n @apply fixed z-[--bq-panel-z-index] overflow-y-auto overflow-x-hidden is-[--bq-panel--width] max-bs-[--bq-panel--height];\n @apply rounded-[--bq-panel--border-radius] bg-[--bq-panel--background] shadow-[shadow:--bq-panel--box-shadow];\n @apply pe-[--bq-panel--padding-end] ps-[--bq-panel--padding-start] p-b-[--bq-panel--paddingY];\n @apply border-[length:--bq-panel--border-width] border-[color:--bq-panel--border-color];\n\n border-style: var(--bq-panel--border-style);\n}\n","import { ReferenceElement } from '@floating-ui/dom';\nimport { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport { FloatingUI } from '../../services/libraries';\nimport { isClient, lockBodyScroll, unlockBodyScroll } from '../../shared/utils';\n\n/**\n * The Panel component is a versatile and essential element used to wrap and display content in a floating panel.\n *\n * @example How to use it\n * ```html\n * <bq-panel open>\n * <div>Panel content</div>\n * </bq-panel>\n * ```\n *\n * @status stable\n *\n * @attr {number} distance - Represents the distance (gutter or margin) between the panel and the trigger element.\n * @attr {\"top\" | \"bottom\" | \"left\" | \"right\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\" | \"right-start\" | \"right-end\"} placement - Position of the panel.\n * @attr {boolean} open - If true, the panel will be visible.\n * @attr {boolean} same-width - Whether the panel should have the same width as the trigger element.\n * @attr {number} skidding - Represents the skidding between the panel and the trigger element.\n * @attr {\"fixed\" | \"absolute\"} strategy - Defines the strategy to position the panel.\n *\n * @slot - The content of the panel.\n *\n * @part panel - The `<div>` element used to display and style the panel\n *\n * @prop --bq-panel--background - Panel background color\n * @prop --bq-panel--border-color - Panel border color\n * @prop --bq-panel--border-radius - Panel border radius\n * @prop --bq-panel--border-style - Panel border style\n * @prop --bq-panel--border-width - Panel border width\n * @prop --bq-panel--box-shadow - Panel box shadow\n * @prop --bq-panel--padding - Panel padding\n * @prop --bq-panel--height - Panel height\n * @prop --bq-panel--width - Panel width\n * @prop --bq-panel-z-index - Panel z-index applied when opened\n */\n@Component({\n tag: 'bq-panel',\n styleUrl: './scss/bq-panel.scss',\n shadow: true,\n})\nexport class BqPanel {\n // Own Properties\n // ====================\n\n private panel: HTMLElement;\n private floatingUI: FloatingUI;\n private trigger: ReferenceElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqPanelElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the panel will not lock the page body scroll when open. */\n @Prop({ reflect: true }) disableScrollLock?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n handleOpenChange() {\n if (!this.open) {\n this.hidePanel();\n return;\n }\n\n this.showPanel();\n }\n\n @Watch('distance')\n @Watch('placement')\n @Watch('sameWidth')\n @Watch('skidding')\n @Watch('strategy')\n onPropChange() {\n if (!isClient()) return;\n\n this.floatingUI?.init({ ...this.options });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n if (!isClient()) return;\n\n // We need to find the trigger element from the parent to position the panel relative to it.\n const parentTrigger = this.el.parentElement.querySelector('div[part=\"trigger\"]');\n\n if (!parentTrigger) return;\n\n this.trigger = {\n getBoundingClientRect: () => parentTrigger.getBoundingClientRect(),\n contextElement: parentTrigger,\n };\n\n this.floatingUI = new FloatingUI(this.trigger, this.panel, { ...this.options });\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n if (!isClient()) return;\n\n this.floatingUI?.destroy();\n\n // Ensure scroll lock is removed if the component is disconnected while the panel is open.\n if (this.open && !this.disableScrollLock) {\n unlockBodyScroll();\n }\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private showPanel() {\n if (!isClient()) return;\n\n this.floatingUI?.update();\n\n // Lock the body scroll if the disableScrollLock prop is not true.\n if (!this.disableScrollLock) {\n lockBodyScroll();\n }\n }\n\n private async hidePanel() {\n this.open = false;\n\n // Unlock the body scroll if the disableScrollLock prop is not true.\n if (isClient() && !this.disableScrollLock) {\n unlockBodyScroll();\n }\n }\n\n private get options() {\n return {\n distance: this.distance,\n placement: this.placement,\n sameWidth: this.sameWidth,\n skidding: this.skidding,\n strategy: this.strategy,\n };\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div\n class=\"bq-panel\"\n ref={(el) => (this.panel = el)}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open}\n part=\"panel\"\n >\n <slot />\n </div>\n );\n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B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;;;;;IAOH,MAAM,GAAA;AACJ,QAAA,QACE,CACE,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,UAAU,EAChB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,EAAA,aAAA,EACjB,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,OAAO,EAC1C,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAClB,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bq-dropdown.bq-panel.entry.esm.js","sources":["../../packages/beeq/src/components/dropdown/scss/bq-dropdown.scss?tag=bq-dropdown&encapsulation=shadow","../../packages/beeq/src/components/dropdown/bq-dropdown.tsx","../../packages/beeq/src/components/panel/scss/bq-panel.scss?tag=bq-panel&encapsulation=shadow","../../packages/beeq/src/components/panel/bq-panel.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Dropdown styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply relative inline-block;\n}\n","import { Component, Element, Event, h, Listen, Prop, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport { isEventTargetChildOfElement } from '../../shared/utils';\n\nlet id = 0;\n\n/**\n * The Dropdown Component is commonly used when presenting a list of selectable options that are too numerous to fit comfortably on the screen.\n * They provide an efficient way to save space and present a long list of options in a compact and organized manner.\n *\n * @example How to use it\n * ```html\n * <bq-dropdown placement=\"bottom-start\">\n * <bq-button slot=\"trigger\">Dropdown</bq-button>\n * <bq-option-list>\n * <bq-option value=\"users\">...</bq-option>\n * <bq-option value=\"user\">...</bq-option>\n * <bq-option value=\"dashboard\">...</bq-option>\n * <bq-option value=\"settings\">...</bq-option>\n * <bq-option value=\"logout\">...</bq-option>\n * </bq-option-list>\n * </bq-dropdown>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/47ff4b-dropdown\n * @status stable\n *\n * @dependency bq-panel\n *\n * @attr {boolean} disabled - If true, the dropdown panel will be visible and won't be shown.\n * @attr {number} distance - Represents the distance (gutter or margin) between the panel and the trigger element.\n * @attr {boolean} keep-open-on-select - If true, the panel will remain open after a selection is made.\n * @attr {\"top\" | \"bottom\" | \"left\" | \"right\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\" | \"right-start\" | \"right-end\"} placement - Position of the panel.\n * @attr {boolean} open - If true, the panel will be visible.\n * @attr {string} panel-height - When set, it will override the height of the dropdown panel.\n * @attr {boolean} same-width - Whether the panel should have the same width as the trigger element.\n * @attr {number} skidding - Represents the skidding between the panel and the trigger element.\n * @attr {\"fixed\" | \"absolute\"} strategy - Defines the strategy to position the panel.\n *\n * @event bqOpen - Callback handler to be called when the dropdown panel is opened or closed.\n *\n * @slot trigger - The trigger element that opens the dropdown panel.\n * @slot - The content of the dropdown panel.\n *\n * @part base - The component's internal wrapper.\n * @part dropdown - The `<bq-panel>` element used under the hood to display the dropdown panel.\n * @part panel - The `<div>` element used to display and style the panel inside the `<bq-panel>` element.\n * @part trigger - The `<div>` element that hosts the trigger element.\n *\n * @cssprop --bq-panel--background - Panel background color\n * @cssprop --bq-panel--border-color - Panel border color\n * @cssprop --bq-panel--border-radius - Panel border radius\n * @cssprop --bq-panel--border-style - Panel border style\n * @cssprop --bq-panel--border-width - Panel border width\n * @cssprop --bq-panel--box-shadow - Panel box shadow\n * @cssprop --bq-panel--padding - Panel padding\n * @cssprop --bq-panel--height - Panel height\n * @cssprop --bq-panel--width - Panel width\n * @cssprop --bq-panel-z-index - Panel z-index applied when opened\n */\n@Component({\n tag: 'bq-dropdown',\n styleUrl: './scss/bq-dropdown.scss',\n shadow: true,\n})\nexport class BqDropdown {\n // Own Properties\n // ====================\n\n private dropdownPanelId = `bq-dropdown-panel-${++id}`;\n private triggerElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDropdownElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the dropdown panel will not lock the page body scroll when open. */\n @Prop({ reflect: true }) disableScrollLock?: boolean = false;\n\n /** If true, the dropdown panel will be visible and won't be shown. */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** If true, the panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the dropdown panel */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n onOpenChange() {\n this.bqOpen.emit({ open: this.open });\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.triggerElem) return;\n\n // set 'disabled' attribute based on 'this.disabled' value, ensuring consistent state handling\n if (!this.disabled) {\n this.triggerElem?.removeAttribute('disabled');\n return;\n }\n this.triggerElem?.setAttribute('disabled', 'true');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the dropdown panel is opened or closed. */\n @Event() bqOpen: EventEmitter<{ open: boolean }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.triggerElem = this.el.querySelector('[slot=\"trigger\"]');\n this.handleDisabledChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqSelect', { passive: true })\n onItemSelect() {\n if (this.keepOpenOnSelect) return;\n\n this.open = false;\n }\n\n /** Listens for the 'click' event on the document object\n * and closes the dropdown panel if the click is outside the component.\n */\n @Listen('click', { target: 'document', passive: true })\n onClickOutside(event: MouseEvent) {\n if (!this.open || isEventTargetChildOfElement(event, this.el)) return;\n\n // Close when clicking outside of the close element\n this.open = false;\n }\n\n @Listen('keyup', { target: 'window', passive: true })\n onEscape(event: KeyboardEvent) {\n if (!this.open) return;\n // Close the panel when pressing Escape or when pressing Tab and the component loses focus.\n if (event.key === 'Escape' || (event.key === 'Tab' && !isEventTargetChildOfElement(event, this.el))) {\n this.open = false;\n }\n }\n\n @Listen('scroll', { target: 'window', passive: true, capture: true })\n handleScrollEvent() {\n if (!this.open || this.disableScrollLock) return;\n\n // Close the panel when the scroll event is triggered.\n // This is useful for those cases where the floating panel is inside a scrollable container.\n // For example, a select inside a dialog, drawer, etc.\n // ⚠️ Notice that document body scroll lock is handled via the `scrollLock` utility.\n this.open = false;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private togglePanel = (): void => {\n // Don't toggle the panel if the component is disabled or the trigger element is disabled\n if (this.disabled || this.triggerElem?.hasAttribute('disabled')) return;\n\n this.open = !this.open;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),\n };\n\n return (\n <div class=\"bq-dropdown\" part=\"base\">\n {/* TRIGGER CONTAINER */}\n <div\n class=\"bq-dropdown__trigger block\"\n aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n onClick={this.togglePanel}\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n style={style}\n id={this.dropdownPanelId}\n class=\"bq-dropdown__panel\"\n disableScrollLock={this.disableScrollLock}\n distance={this.distance}\n placement={this.placement}\n open={this.open}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n role=\"group\"\n part=\"dropdown\"\n exportparts=\"panel\"\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n","/* -------------------------------------------------------------------------- */\n/* Panel styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-panel.variables';\n\n:host {\n @apply block;\n}\n\n.bq-panel {\n @include animation-fade-in;\n @apply fixed z-[--bq-panel-z-index] overflow-y-auto overflow-x-hidden is-[--bq-panel--width] max-bs-[--bq-panel--height];\n @apply rounded-[--bq-panel--border-radius] bg-[--bq-panel--background] shadow-[shadow:--bq-panel--box-shadow];\n @apply pe-[--bq-panel--padding-end] ps-[--bq-panel--padding-start] p-b-[--bq-panel--paddingY];\n @apply border-[length:--bq-panel--border-width] border-[color:--bq-panel--border-color];\n\n border-style: var(--bq-panel--border-style);\n}\n","import { ReferenceElement } from '@floating-ui/dom';\nimport { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport type { Placement } from '../../services/interfaces';\nimport { FloatingUI } from '../../services/libraries';\nimport { isClient, lockBodyScroll, unlockBodyScroll } from '../../shared/utils';\n\n/**\n * The Panel component is a versatile and essential element used to wrap and display content in a floating panel.\n *\n * @example How to use it\n * ```html\n * <bq-panel open>\n * <div>Panel content</div>\n * </bq-panel>\n * ```\n *\n * @status stable\n *\n * @attr {number} distance - Represents the distance (gutter or margin) between the panel and the trigger element.\n * @attr {\"top\" | \"bottom\" | \"left\" | \"right\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\" | \"right-start\" | \"right-end\"} placement - Position of the panel.\n * @attr {boolean} open - If true, the panel will be visible.\n * @attr {boolean} same-width - Whether the panel should have the same width as the trigger element.\n * @attr {number} skidding - Represents the skidding between the panel and the trigger element.\n * @attr {\"fixed\" | \"absolute\"} strategy - Defines the strategy to position the panel.\n *\n * @slot - The content of the panel.\n *\n * @part panel - The `<div>` element used to display and style the panel\n *\n * @prop --bq-panel--background - Panel background color\n * @prop --bq-panel--border-color - Panel border color\n * @prop --bq-panel--border-radius - Panel border radius\n * @prop --bq-panel--border-style - Panel border style\n * @prop --bq-panel--border-width - Panel border width\n * @prop --bq-panel--box-shadow - Panel box shadow\n * @prop --bq-panel--padding - Panel padding\n * @prop --bq-panel--height - Panel height\n * @prop --bq-panel--width - Panel width\n * @prop --bq-panel-z-index - Panel z-index applied when opened\n */\n@Component({\n tag: 'bq-panel',\n styleUrl: './scss/bq-panel.scss',\n shadow: true,\n})\nexport class BqPanel {\n // Own Properties\n // ====================\n\n private panel: HTMLElement;\n private floatingUI: FloatingUI;\n private trigger: ReferenceElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqPanelElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the panel will not lock the page body scroll when open. */\n @Prop({ reflect: true }) disableScrollLock?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n handleOpenChange() {\n if (!this.open) {\n this.hidePanel();\n return;\n }\n\n this.showPanel();\n }\n\n @Watch('distance')\n @Watch('placement')\n @Watch('sameWidth')\n @Watch('skidding')\n @Watch('strategy')\n onPropChange() {\n if (!isClient()) return;\n\n this.floatingUI?.init({ ...this.options });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n if (!isClient()) return;\n\n // We need to find the trigger element from the parent to position the panel relative to it.\n const parentTrigger = this.el.parentElement.querySelector('div[part=\"trigger\"]');\n\n if (!parentTrigger) return;\n\n this.trigger = {\n getBoundingClientRect: () => parentTrigger.getBoundingClientRect(),\n contextElement: parentTrigger,\n };\n\n this.floatingUI = new FloatingUI(this.trigger, this.panel, { ...this.options });\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n if (!isClient()) return;\n\n this.floatingUI?.destroy();\n\n // Ensure scroll lock is removed if the component is disconnected while the panel is open.\n if (this.open && !this.disableScrollLock) {\n unlockBodyScroll();\n }\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private showPanel() {\n if (!isClient()) return;\n\n this.floatingUI?.update();\n\n // Lock the body scroll if the disableScrollLock prop is not true.\n if (!this.disableScrollLock) {\n lockBodyScroll();\n }\n }\n\n private async hidePanel() {\n this.open = false;\n\n // Unlock the body scroll if the disableScrollLock prop is not true.\n if (isClient() && !this.disableScrollLock) {\n unlockBodyScroll();\n }\n }\n\n private get options() {\n return {\n distance: this.distance,\n placement: this.placement,\n sameWidth: this.sameWidth,\n skidding: this.skidding,\n strategy: this.strategy,\n };\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div\n class=\"bq-panel\"\n ref={(el) => (this.panel = el)}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open}\n part=\"panel\"\n >\n <slot />\n </div>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;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;;;;;IAOH,MAAM,GAAA;AACJ,QAAA,QACE,CACE,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,UAAU,EAChB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,EAAA,aAAA,EACjB,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,OAAO,EAC1C,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,EAClB,IAAI,EAAC,OAAO,EAAA,EAEZ,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-empty-state.entry.esm.js","sources":["../../packages/beeq/src/components/empty-state/bq-empty-state.types.ts","../../packages/beeq/src/components/empty-state/scss/bq-empty-state.scss?tag=bq-empty-state&encapsulation=shadow","../../packages/beeq/src/components/empty-state/bq-empty-state.tsx"],"sourcesContent":["export const EMPTY_STATE_SIZE = ['small', 'medium', 'large'] as const;\nexport type TEmptyStateSize = (typeof EMPTY_STATE_SIZE)[number];\n\nexport const SIZE_TO_VALUE_MAP: Record<TEmptyStateSize, number> = {\n small: 40,\n medium: 80,\n large: 180,\n};\n","/* -------------------------------------------------------------------------- */\n/* Empty state styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply relative inline-block;\n}\n","import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\nimport { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP } from './bq-empty-state.types';\nimport type { TEmptyStateSize } from './bq-empty-state.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * An Empty State is a UI component displayed when there is no data or content available, often used in dynamic or inactive application states.\n *\n * @example How to use it\n * ```html\n * <bq-empty-state size=\"medium\">Title</bq-empty-state>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/673ae0-empty-state/b/09d7b1\n * @status stable\n *\n * @dependency bq-icon\n *\n * @attr {\"large\" | \"medium\" | \"small\"} size - The size of the empty state component\n *\n * @slot thumbnail - The element that wraps the thumbnail element\n * @slot body - The content to be displayed after the thumbnail section\n * @slot footer - The content to be displayed after the body section as footer\n *\n * @part body - The container `<div>` that wraps the alert description content\n * @part footer - The container `<div>` that wraps the alert footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon size based on the empty state size (small, medium, large)\n * @part thumbnail - The container `<div>` that wraps the thumbnail element\n * @part title - The container `<div>` that wraps the empty state title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n */\n\n@Component({\n tag: 'bq-empty-state',\n styleUrl: './scss/bq-empty-state.scss',\n shadow: true,\n})\nexport class BqEmptyState {\n // Own Properties\n // ====================\n\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqEmptyStateElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasBody = false;\n @State() private hasFooter = false;\n\n // Public Property API\n // ========================\n\n /** The size of the empty state component */\n @Prop({ reflect: true, mutable: true }) size: TEmptyStateSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(EMPTY_STATE_SIZE, 'medium', this.el, 'size');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleSlotChange = () => {\n this.hasBody = hasSlotContent(this.bodyElem, 'body');\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconSize(): number {\n return SIZE_TO_VALUE_MAP[this.size] || SIZE_TO_VALUE_MAP.medium;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"inline-flex flex-col items-center\" part=\"wrapper\">\n <div\n class={{\n 'm-be-m': this.size === 'small',\n 'm-be-xl': this.size === 'medium',\n 'm-be-xxl': this.size === 'large',\n }}\n part=\"thumbnail\"\n >\n <slot name=\"thumbnail\">\n <bq-icon size={this.iconSize} name=\"database\" part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <div\n class={{\n 'font-bold leading-regular text-primary': true,\n 'text-m': this.size === 'small',\n 'text-l': this.size === 'medium',\n 'text-xxl2': this.size === 'large',\n 'm-be-xs': this.size === 'small' && this.hasBody,\n 'm-be-m': this.size === 'medium' && this.hasBody,\n 'm-be-l': this.size === 'large' && this.hasBody,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n <div\n class={{\n 'font-normal leading-regular': true,\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n 'text-l': this.size === 'large',\n 'm-be-m': this.size === 'small' && this.hasFooter,\n 'm-be-l': this.size === 'medium' && this.hasFooter,\n 'm-be-xl': this.size === 'large' && this.hasFooter,\n }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleSlotChange} />\n </div>\n <div class=\"flex items-start gap-xs\" ref={(div) => (this.footerElem = div)} part=\"footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AAG9D,MAAM,iBAAiB,GAAoC;AAChE,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,KAAK,EAAE,GAAG;CACX;;ACPD,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"bq-empty-state.entry.esm.js","sources":["../../packages/beeq/src/components/empty-state/bq-empty-state.types.ts","../../packages/beeq/src/components/empty-state/scss/bq-empty-state.scss?tag=bq-empty-state&encapsulation=shadow","../../packages/beeq/src/components/empty-state/bq-empty-state.tsx"],"sourcesContent":["export const EMPTY_STATE_SIZE = ['small', 'medium', 'large'] as const;\nexport type TEmptyStateSize = (typeof EMPTY_STATE_SIZE)[number];\n\nexport const SIZE_TO_VALUE_MAP: Record<TEmptyStateSize, number> = {\n small: 40,\n medium: 80,\n large: 180,\n};\n","/* -------------------------------------------------------------------------- */\n/* Empty state styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply relative inline-block;\n}\n","import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\nimport { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP } from './bq-empty-state.types';\nimport type { TEmptyStateSize } from './bq-empty-state.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * An Empty State is a UI component displayed when there is no data or content available, often used in dynamic or inactive application states.\n *\n * @example How to use it\n * ```html\n * <bq-empty-state size=\"medium\">Title</bq-empty-state>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/673ae0-empty-state/b/09d7b1\n * @status stable\n *\n * @dependency bq-icon\n *\n * @attr {\"large\" | \"medium\" | \"small\"} size - The size of the empty state component\n *\n * @slot thumbnail - The element that wraps the thumbnail element\n * @slot body - The content to be displayed after the thumbnail section\n * @slot footer - The content to be displayed after the body section as footer\n *\n * @part body - The container `<div>` that wraps the alert description content\n * @part footer - The container `<div>` that wraps the alert footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon size based on the empty state size (small, medium, large)\n * @part thumbnail - The container `<div>` that wraps the thumbnail element\n * @part title - The container `<div>` that wraps the empty state title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n */\n\n@Component({\n tag: 'bq-empty-state',\n styleUrl: './scss/bq-empty-state.scss',\n shadow: true,\n})\nexport class BqEmptyState {\n // Own Properties\n // ====================\n\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqEmptyStateElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasBody = false;\n @State() private hasFooter = false;\n\n // Public Property API\n // ========================\n\n /** The size of the empty state component */\n @Prop({ reflect: true, mutable: true }) size: TEmptyStateSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(EMPTY_STATE_SIZE, 'medium', this.el, 'size');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleSlotChange = () => {\n this.hasBody = hasSlotContent(this.bodyElem, 'body');\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconSize(): number {\n return SIZE_TO_VALUE_MAP[this.size] || SIZE_TO_VALUE_MAP.medium;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"inline-flex flex-col items-center\" part=\"wrapper\">\n <div\n class={{\n 'm-be-m': this.size === 'small',\n 'm-be-xl': this.size === 'medium',\n 'm-be-xxl': this.size === 'large',\n }}\n part=\"thumbnail\"\n >\n <slot name=\"thumbnail\">\n <bq-icon size={this.iconSize} name=\"database\" part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <div\n class={{\n 'font-bold leading-regular text-primary': true,\n 'text-m': this.size === 'small',\n 'text-l': this.size === 'medium',\n 'text-xxl2': this.size === 'large',\n 'm-be-xs': this.size === 'small' && this.hasBody,\n 'm-be-m': this.size === 'medium' && this.hasBody,\n 'm-be-l': this.size === 'large' && this.hasBody,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n <div\n class={{\n 'font-normal leading-regular': true,\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n 'text-l': this.size === 'large',\n 'm-be-m': this.size === 'small' && this.hasFooter,\n 'm-be-l': this.size === 'medium' && this.hasFooter,\n 'm-be-xl': this.size === 'large' && this.hasFooter,\n }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleSlotChange} />\n </div>\n <div class=\"flex items-start gap-xs\" ref={(div) => (this.footerElem = div)} part=\"footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AAG9D,MAAM,iBAAiB,GAAoC;AAChE,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,KAAK,EAAE,GAAG;CACX;;ACPD,MAAM,eAAe,GAAG,0hnBAA0hnB;;MCsCrinB,YAAY,GAAA,MAAA;;;;;;AAIf,IAAA,QAAQ;AACR,IAAA,UAAU;;;;;IAWD,OAAO,GAAG,KAAK;IACf,SAAS,GAAG,KAAK;;;;IAMM,IAAI,GAAoB,QAAQ;;;IAMxE,eAAe,GAAA;QACb,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC;;;;;;;;IAWhE,iBAAiB,GAAA;QACf,IAAI,CAAC,eAAe,EAAE;;IAGxB,gBAAgB,GAAA;QACd,IAAI,CAAC,gBAAgB,EAAE;;;;;;;;;;;;;;IAkBjB,gBAAgB,GAAG,M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AC,QAAQ,EAAA,EACvF,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAA,CAAI,CACvD,CACF;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-input.entry.esm.js","sources":["../../packages/beeq/src/components/input/scss/bq-input.scss?tag=bq-input&encapsulation=shadow","../../packages/beeq/src/components/input/bq-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Input styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-input.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label and Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--label {\n @apply flex flex-grow items-center m-be-[--bq-input--label-margin-bottom];\n @apply text-[length:--bq-input--label-text-size] text-[color:--bq-input--label-text-color];\n}\n\n.bq-input--helper-text {\n @apply text-[length:--bq-input--helper-text-size] text-[color:--bq-input--helper-text-color] m-bs-[--bq-input--helper-margin-top];\n}\n\n.bq-input--helper-text.validation-error {\n @apply text-danger;\n}\n\n.bq-input--helper-text.validation-success {\n @apply text-success;\n}\n\n.bq-input--helper-text.validation-warning {\n @apply text-warning;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input group control */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control {\n @apply flex items-center transition-[border-color,box-shadow] is-full;\n // Border\n @apply rounded-[--bq-input--border-radius] border-[length:--bq-input--border-width] border-[color:--bq-input--border-color];\n // Padding\n @apply pe-[--bq-input--padding-end] ps-[--bq-input--padding-start] p-b-[--bq-input--paddingY];\n // Text\n @apply text-[length:--bq-input--text-size] text-[color:--bq-input--text-color] placeholder:text-[color:--bq-input--text-placeholder-color];\n // Hover\n @apply [&:not(.disabled):not(:focus-within)]:hover:border-hover-brand;\n\n border-style: var(--bq-input--border-style);\n\n // Focus\n &:not(.disabled):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-input--border-color-focus);\n\n @apply focus border-[color:--bq-input--border-color-focus];\n }\n\n // Enable clear button whenever the input group control is hovered or has focus\n &:not(.disabled):hover,\n &:not(.disabled):focus-within {\n .bq-input--control__clear {\n @apply inline-block;\n }\n }\n}\n\n.bq-input--control.disabled {\n @apply cursor-not-allowed opacity-60;\n}\n\n/* ------------------------------- Validation ------------------------------- */\n\n.bq-input--control.validation-error {\n @apply border-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.danger);\n\n @apply border-active-danger;\n }\n}\n\n.bq-input--control.validation-success {\n @apply border-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.success);\n\n @apply border-active-success;\n }\n}\n\n.bq-input--control.validation-warning {\n @apply border-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.warning);\n\n @apply border-active-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Input */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__input {\n @apply flex-auto cursor-inherit appearance-none bg-inherit font-inherit text-[length:inherit] text-inherit;\n @apply border-none min-bs-[--bq-input--icon-size] min-is-0 p-b-0 p-i-0 m-b-0 m-i-0 focus:outline-none focus-visible:outline-none;\n\n box-shadow: none;\n font-weight: inherit;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Clear button */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__clear::part(button) {\n // Since the clear button is inside the input group control,\n // we need to reset the focus ring styles\n --bq-ring-width: initial;\n --bq-ring-offset-width: initial;\n --bq-ring-color-focus: initial;\n\n @apply rounded-xs border-none bs-auto p-b-0 p-i-0;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Prefix and suffix */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__prefix,\n.bq-input--control__suffix {\n @apply pointer-events-none flex items-center text-[color:--bq-input--text-color];\n}\n\n.bq-input--control__prefix {\n @apply me-[--bq-input--gap];\n}\n\n.bq-input--control__suffix {\n @apply ms-[--bq-input--gap];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Slotted and internal icons */\n/* -------------------------------------------------------------------------- */\n\nbq-icon,\n::slotted(bq-icon) {\n --bq-icon--size: var(--bq-input--icon-size) !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Hide webkit clear button */\n/* -------------------------------------------------------------------------- */\n\n/* Remove clear controls from search input */\n\n.bq-input--control__input::-moz-search-cancel {\n @apply hidden appearance-none;\n}\n\n.bq-input--control__input::-webkit-search-decoration,\n.bq-input--control__input::-webkit-search-cancel-button,\n.bq-input--control__input::-webkit-search-results-button,\n.bq-input--control__input::-webkit-search-results-decoration {\n @apply hidden appearance-none;\n}\n\n/* Remove native control extra padding from input date and datetime */\n\n.bq-input--control__input::-webkit-datetime-edit-fields-wrapper,\n.bq-input--control__input::-webkit-datetime-edit,\n.bq-input--control__input::-webkit-datetime-edit-year-field,\n.bq-input--control__input::-webkit-datetime-edit-month-field,\n.bq-input--control__input::-webkit-datetime-edit-day-field,\n.bq-input--control__input::-webkit-datetime-edit-hour-field,\n.bq-input--control__input::-webkit-datetime-edit-minute-field,\n.bq-input--control__input::-webkit-datetime-edit-second-field,\n.bq-input--control__input::-webkit-datetime-edit-millisecond-field,\n.bq-input--control__input::-webkit-datetime-edit-meridiem-field {\n @apply p-b-0 p-i-0;\n}\n","import { AttachInternals, Component, Element, Event, h, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { TInputType, TInputValidation, TInputValue } from './bq-input.types';\nimport { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, TDebounce } from '../../shared/utils';\n\n/**\n * The Input component is a fundamental user interface element that allows users to input data by typing it into a text field.\n * It is commonly used in web and mobile applications for various purposes, such as collecting user information, search inputs, and login forms.\n *\n * @example How to use it\n * ```html\n * <bq-input name=\"username\" label=\"Username\" placeholder=\"Enter your username\"></bq-input>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/980362-input\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {string} autocapitalize - Controls whether or not the input field should be capitalized and how.\n * @attr {string} autocomplete - Specifies whether or not the input field should have autocomplete enabled.\n * @attr {string} autocorrect - Controls whether or not the input field should have autocorrect enabled.\n * @attr {boolean} autofocus - If true, the input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {number} debounce-time - The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * @attr {boolean} disabled - Indicates whether the input is disabled or not.\n * @attr {boolean} disable-clear - If true, the clear button won't be displayed.\n * @attr {string} form - The ID of the form that the input field belongs to.\n * @attr {string} form-validation-message - The native form validation message (mandatory if `required` is set).\n * @attr {string} inputmode - The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * @attr {number | string} max - The maximum value that the input field can accept.\n * @attr {number} maxlength - The maximum number of characters that the input field can accept.\n * @attr {number | string} min - The minimum value that the input field can accept.\n * @attr {number} minlength - The minimum number of characters that the input field can accept.\n * @attr {string} name - The input field name.\n * @attr {string} pattern - Specifies a regular expression the form control's value should match.\n * @attr {string} placeholder - The input placeholder text value.\n * @attr {boolean} readonly - If true, the input field cannot be modified.\n * @attr {boolean} required - Indicates whether or not the input field is required to be filled out before submitting the form.\n * @attr {number | 'any'} step - A number that specifies the granularity that the value must adhere to.\n * @attr {string} type - The type attribute specifies the type of input field to display.\n * @attr {'none' | 'error' | 'warning' | 'success'} validation-status - The validation status of the input.\n * @attr {string | number | string[]} value - The input value, it can be used to reset the input to a previous value.\n *\n * @event bqBlur - Callback handler emitted when the input loses focus.\n * @event bqChange - Callback handler emitted when the input value has changed and the input loses focus.\n * @event bqClear - Callback handler emitted when the input value has been cleared.\n * @event bqFocus - Callback handler emitted when the input has received focus.\n * @event bqInput - Callback handler emitted when the input value changes.\n *\n * @slot label - The label slot container.\n * @slot prefix - The prefix slot container.\n * @slot suffix - The suffix slot container.\n * @slot helper-text - The helper text slot container.\n * @slot clear-icon - The clear icon slot container.\n *\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part helper-text - The helper text slot container.\n * @part label - The label slot container.\n * @part input - The native HTML input element used under the hood.\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n *\n * @cssprop --bq-input--background-color - Input background color\n * @cssprop --bq-input--border-color - Input border color\n * @cssprop --bq-input--border-color-focus - Input border color on focus\n * @cssprop --bq-input--border-radius - Input border radius\n * @cssprop --bq-input--border-width - Input border width\n * @cssprop --bq-input--border-style - Input border style\n * @cssprop --bq-input--gap - Gap between input content and prefix/suffix\n * @cssprop --bq-input--helper-margin-top - Helper text margin top\n * @cssprop --bq-input--helper-text-color - Helper text color\n * @cssprop --bq-input--helper-text-size - Helper text size\n * @cssprop --bq-input--icon-size - Icon size to use in prefix/suffix and clear button\n * @cssprop --bq-input--label-margin-bottom - Input label margin bottom\n * @cssprop --bq-input--label-text-color - Input label text color\n * @cssprop --bq-input--label-text-size - Input label text size\n * @cssprop --bq-input--padding-start - Input padding start\n * @cssprop --bq-input--padding-end - Input padding end\n * @cssprop --bq-input--paddingY - Input padding top and bottom\n * @cssprop --bq-input--text-color - Input text color\n * @cssprop --bq-input--text-size - Input text size\n * @cssprop --bq-input--text-placeholder-color - Input placeholder text color\n */\n@Component({\n tag: 'bq-input',\n styleUrl: './scss/bq-input.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqInput {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceBqInput: TDebounce<void>;\n private fallbackInputId = 'input';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqInputElement;\n @AttachInternals() internals!: ElementInternals;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasHelperText = false;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the input field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: string = 'off';\n\n /**\n * Specifies whether or not the input field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the input field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the input is disabled or not.\n * If `true`, the input is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** The ID of the form that the input field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** The native form validation message (mandatory if `required` is set) */\n @Prop({ mutable: true }) formValidationMessage?: string;\n\n /**\n * The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * This allows a browser to display an appropriate virtual keyboard while editing.\n * Possible values are 'none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url', and 'date'.\n */\n @Prop() inputmode?: string;\n\n /**\n * The maximum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) max?: number | string;\n\n /** The maximum number of characters that the input field can accept. */\n @Prop({ reflect: true }) maxlength: number;\n\n /**\n * The minimum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) min?: number | string;\n\n /** The minimum number of characters that the input field can accept. */\n @Prop({ reflect: true }) minlength: number;\n\n /** The input field name. */\n @Prop({ reflect: true }) name!: string;\n\n /**\n * Specifies a regular expression the form control's value should match.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern\n */\n @Prop({ reflect: true }) pattern?: string;\n\n /** The input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** If true, the input field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the input field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /**\n * A number that specifies the granularity that the value must adhere to.\n * Valid for date, month, week, time, datetime-local, number, and range.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @Prop({ reflect: true }) step: number | 'any';\n\n /**\n * The type attribute specifies the type of input field to display.\n * Possible values are 'text', 'password', 'email', 'number', 'tel', 'search', 'url', and more.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n */\n @Prop({ reflect: true }) type: TInputType = 'text';\n\n /**\n * The validation status of the input.\n *\n * @remarks\n * This property is used to indicate the validation status of the input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The input value, it can be used to reset the input to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TInputValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n const { internals, value } = this;\n if (Array.isArray(value)) {\n this.hasValue = value.some((val) => val.length > 0);\n this.internals.setFormValue(value.join(','));\n return;\n }\n\n this.hasValue = isDefined(value);\n internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqInputElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value changes.\n * This handler is called whenever the user types or pastes text into the input field.\n */\n @Event() bqInput!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handleValueChange();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n formAssociatedCallback() {\n this.setFormValue(this.value?.toString());\n this.updateFormValidity();\n }\n\n formResetCallback() {\n if (isNil(this.value)) return;\n\n this.handleClear();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n // Update form value and validity\n this.setFormValue(`${this.value}`);\n this.updateFormValidity();\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleClear = () => {\n if (this.disabled) return;\n\n const { inputElem, setFormValue, updateFormValidity } = this;\n // Clear input element value\n inputElem.value = '';\n this.value = inputElem.value;\n // Set form value to empty string abd update validity\n setFormValue(this.value);\n updateFormValidity();\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n ev.stopPropagation();\n this.handleClear();\n\n const { bqClear, bqChange, bqInput, el, inputElem } = this;\n // Emit events\n bqClear.emit(el);\n bqInput.emit({ value: this.value, el });\n bqChange.emit({ value: this.value, el });\n // Refocus input element\n inputElem.focus();\n };\n\n private setFormValue = (value?: string) => {\n this.internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n };\n\n private updateFormValidity = () => {\n const { formValidationMessage, internals, required, value, inputElem } = this;\n\n // Clear the validity state\n internals?.states.clear();\n\n if (required && (!value || value.toString().trim() === '')) {\n // Set validity state to invalid\n internals?.states.add('invalid');\n internals?.setValidity({ valueMissing: true }, formValidationMessage, inputElem);\n return;\n }\n\n // Set validity state to valid if textarea has value or is not required\n internals?.states.add('valid');\n internals?.setValidity({});\n };\n\n private handleSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n this.hasPrefix = hasSlotContent(this.prefixElem);\n this.hasSuffix = hasSlotContent(this.suffixElem);\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-input\" part=\"base\">\n {/* Label */}\n <label\n class={{ 'bq-input--label': true, '!hidden': !this.hasLabel }}\n aria-label={this.name || this.fallbackInputId}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n {/* Input control group */}\n <div\n class={{\n 'bq-input--control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-input--control__prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-input--control__input\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n disabled={this.disabled}\n form={this.form}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxlength}\n min={this.min}\n minLength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n ref={(inputElem) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={this.value}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-input--control__clear ms-[--bq-input--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-input--control__suffix': true, '!hidden': !this.hasSuffix }}\n ref={(spanElem) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange} />\n </span>\n </div>\n {/* Helper text */}\n <div\n class={{\n [`bq-input--helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,wy4BAAwy4B;;MCiG9y4B,OAAO,GAAA,MAAA;;;;;;;;;;;;;;;;;;AAIV,IAAA,cAAc;AACd,IAAA,SAAS;AACT,IAAA,SAAS;AACT,IAAA,UAAU;AACV,IAAA,UAAU;AAEV,IAAA,eAAe;IACf,eAAe,GAAG,OAAO;;AAMd,IAAA,SAAS;;;;IAMnB,aAAa,GAAG,KAAK;IACrB,QAAQ,GAAG,KAAK;IAChB,SAAS,GAAG,KAAK;IACjB,SAAS,GAAG,KAAK;IACjB,QAAQ,GAAG,KAAK;;;AAKzB;;;;AAIG;IACsB,cAAc,GAAW,KAAK;AAEvD;;;AAGG;IACsB,YAAY,GAAW,KAAK;AAErD;;;AAGG;IACsB,WAAW,GAAiB,KAAK;;AAGjC,IAAA,SAAS;;IAGT,gBAAgB,GAAI,aAAa;AAE1D;;;AAGG;IACqC,YAAY,GAAI,CAAC;AAEzD;;;AAGG;IACsB,QAAQ,GAAa,KAAK;;IAG1B,YAAY,GAAI,KAAK;;AAGrB,IAAA,IAAI;;AAGJ,IAAA,qBAAqB;AAE9C;;;;AAIG;AACK,IAAA,SAAS;AAEjB;;;AAGG;AACsB,IAAA,GAAG;;AAGH,IAAA,SAAS;AAElC;;;AAGG;AACsB,IAAA,GAAG;;AAGH,IAAA,SAAS;;AAGT,IAAA,IAAI;AAE7B;;;AAGG;AACs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AI,EAAC,YAAY,EAAA,EACrB,CAAS,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,MAAM,EAAA,CAAG,CACnC,CACG,CACb,EAED,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,EAAE,2BAA2B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EACxE,GAAG,EAAE,CAAC,QAAQ,MAAM,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,EAC/C,IAAI,EAAC,QAAQ,EAAA,EAEb,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAI,CAAA,CACtD,CACH,EAEN,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,CAAC,oCAAoC,IAAI,CAAC,gBAAgB,CAAE,CAAA,GAAG,IAAI;AACnE,gBAAA,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa;AAC/B,aAAA,EACD,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,EACjD,IAAI,EAAC,aAAa,EAAA,EAElB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAA,CAAI,CAC5D,CACF;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bq-input.entry.esm.js","sources":["../../packages/beeq/src/components/input/scss/bq-input.scss?tag=bq-input&encapsulation=shadow","../../packages/beeq/src/components/input/bq-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Input styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-input.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label and Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--label {\n @apply flex flex-grow items-center m-be-[--bq-input--label-margin-bottom];\n @apply text-[length:--bq-input--label-text-size] text-[color:--bq-input--label-text-color];\n}\n\n.bq-input--helper-text {\n @apply text-[length:--bq-input--helper-text-size] text-[color:--bq-input--helper-text-color] m-bs-[--bq-input--helper-margin-top];\n}\n\n.bq-input--helper-text.validation-error {\n @apply text-danger;\n}\n\n.bq-input--helper-text.validation-success {\n @apply text-success;\n}\n\n.bq-input--helper-text.validation-warning {\n @apply text-warning;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input group control */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control {\n @apply flex items-center transition-[border-color,box-shadow] is-full;\n // Border\n @apply rounded-[--bq-input--border-radius] border-[length:--bq-input--border-width] border-[color:--bq-input--border-color];\n // Padding\n @apply pe-[--bq-input--padding-end] ps-[--bq-input--padding-start] p-b-[--bq-input--paddingY];\n // Text\n @apply text-[length:--bq-input--text-size] text-[color:--bq-input--text-color] placeholder:text-[color:--bq-input--text-placeholder-color];\n // Hover\n @apply [&:not(.disabled):not(:focus-within)]:hover:border-hover-brand;\n\n border-style: var(--bq-input--border-style);\n\n // Focus\n &:not(.disabled):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-input--border-color-focus);\n\n @apply focus border-[color:--bq-input--border-color-focus];\n }\n\n // Enable clear button whenever the input group control is hovered or has focus\n &:not(.disabled):hover,\n &:not(.disabled):focus-within {\n .bq-input--control__clear {\n @apply inline-block;\n }\n }\n}\n\n.bq-input--control.disabled {\n @apply cursor-not-allowed opacity-60;\n}\n\n/* ------------------------------- Validation ------------------------------- */\n\n.bq-input--control.validation-error {\n @apply border-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.danger);\n\n @apply border-active-danger;\n }\n}\n\n.bq-input--control.validation-success {\n @apply border-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.success);\n\n @apply border-active-success;\n }\n}\n\n.bq-input--control.validation-warning {\n @apply border-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.warning);\n\n @apply border-active-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Input */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__input {\n @apply flex-auto cursor-inherit appearance-none bg-inherit font-inherit text-[length:inherit] text-inherit;\n @apply border-none min-bs-[--bq-input--icon-size] min-is-0 p-b-0 p-i-0 m-b-0 m-i-0 focus:outline-none focus-visible:outline-none;\n\n box-shadow: none;\n font-weight: inherit;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Clear button */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__clear::part(button) {\n // Since the clear button is inside the input group control,\n // we need to reset the focus ring styles\n --bq-ring-width: initial;\n --bq-ring-offset-width: initial;\n --bq-ring-color-focus: initial;\n\n @apply rounded-xs border-none bs-auto p-b-0 p-i-0;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Prefix and suffix */\n/* -------------------------------------------------------------------------- */\n\n.bq-input--control__prefix,\n.bq-input--control__suffix {\n @apply pointer-events-none flex items-center text-[color:--bq-input--text-color];\n}\n\n.bq-input--control__prefix {\n @apply me-[--bq-input--gap];\n}\n\n.bq-input--control__suffix {\n @apply ms-[--bq-input--gap];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Slotted and internal icons */\n/* -------------------------------------------------------------------------- */\n\nbq-icon,\n::slotted(bq-icon) {\n --bq-icon--size: var(--bq-input--icon-size) !important;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Hide webkit clear button */\n/* -------------------------------------------------------------------------- */\n\n/* Remove clear controls from search input */\n\n.bq-input--control__input::-moz-search-cancel {\n @apply hidden appearance-none;\n}\n\n.bq-input--control__input::-webkit-search-decoration,\n.bq-input--control__input::-webkit-search-cancel-button,\n.bq-input--control__input::-webkit-search-results-button,\n.bq-input--control__input::-webkit-search-results-decoration {\n @apply hidden appearance-none;\n}\n\n/* Remove native control extra padding from input date and datetime */\n\n.bq-input--control__input::-webkit-datetime-edit-fields-wrapper,\n.bq-input--control__input::-webkit-datetime-edit,\n.bq-input--control__input::-webkit-datetime-edit-year-field,\n.bq-input--control__input::-webkit-datetime-edit-month-field,\n.bq-input--control__input::-webkit-datetime-edit-day-field,\n.bq-input--control__input::-webkit-datetime-edit-hour-field,\n.bq-input--control__input::-webkit-datetime-edit-minute-field,\n.bq-input--control__input::-webkit-datetime-edit-second-field,\n.bq-input--control__input::-webkit-datetime-edit-millisecond-field,\n.bq-input--control__input::-webkit-datetime-edit-meridiem-field {\n @apply p-b-0 p-i-0;\n}\n","import { AttachInternals, Component, Element, Event, h, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport type { TInputType, TInputValidation, TInputValue } from './bq-input.types';\nimport { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, TDebounce } from '../../shared/utils';\n\n/**\n * The Input component is a fundamental user interface element that allows users to input data by typing it into a text field.\n * It is commonly used in web and mobile applications for various purposes, such as collecting user information, search inputs, and login forms.\n *\n * @example How to use it\n * ```html\n * <bq-input name=\"username\" label=\"Username\" placeholder=\"Enter your username\"></bq-input>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/980362-input\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {string} autocapitalize - Controls whether or not the input field should be capitalized and how.\n * @attr {string} autocomplete - Specifies whether or not the input field should have autocomplete enabled.\n * @attr {string} autocorrect - Controls whether or not the input field should have autocorrect enabled.\n * @attr {boolean} autofocus - If true, the input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {number} debounce-time - The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * @attr {boolean} disabled - Indicates whether the input is disabled or not.\n * @attr {boolean} disable-clear - If true, the clear button won't be displayed.\n * @attr {string} form - The ID of the form that the input field belongs to.\n * @attr {string} form-validation-message - The native form validation message (mandatory if `required` is set).\n * @attr {string} inputmode - The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * @attr {number | string} max - The maximum value that the input field can accept.\n * @attr {number} maxlength - The maximum number of characters that the input field can accept.\n * @attr {number | string} min - The minimum value that the input field can accept.\n * @attr {number} minlength - The minimum number of characters that the input field can accept.\n * @attr {string} name - The input field name.\n * @attr {string} pattern - Specifies a regular expression the form control's value should match.\n * @attr {string} placeholder - The input placeholder text value.\n * @attr {boolean} readonly - If true, the input field cannot be modified.\n * @attr {boolean} required - Indicates whether or not the input field is required to be filled out before submitting the form.\n * @attr {number | 'any'} step - A number that specifies the granularity that the value must adhere to.\n * @attr {string} type - The type attribute specifies the type of input field to display.\n * @attr {'none' | 'error' | 'warning' | 'success'} validation-status - The validation status of the input.\n * @attr {string | number | string[]} value - The input value, it can be used to reset the input to a previous value.\n *\n * @event bqBlur - Callback handler emitted when the input loses focus.\n * @event bqChange - Callback handler emitted when the input value has changed and the input loses focus.\n * @event bqClear - Callback handler emitted when the input value has been cleared.\n * @event bqFocus - Callback handler emitted when the input has received focus.\n * @event bqInput - Callback handler emitted when the input value changes.\n *\n * @slot label - The label slot container.\n * @slot prefix - The prefix slot container.\n * @slot suffix - The suffix slot container.\n * @slot helper-text - The helper text slot container.\n * @slot clear-icon - The clear icon slot container.\n *\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part helper-text - The helper text slot container.\n * @part label - The label slot container.\n * @part input - The native HTML input element used under the hood.\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n *\n * @cssprop --bq-input--background-color - Input background color\n * @cssprop --bq-input--border-color - Input border color\n * @cssprop --bq-input--border-color-focus - Input border color on focus\n * @cssprop --bq-input--border-radius - Input border radius\n * @cssprop --bq-input--border-width - Input border width\n * @cssprop --bq-input--border-style - Input border style\n * @cssprop --bq-input--gap - Gap between input content and prefix/suffix\n * @cssprop --bq-input--helper-margin-top - Helper text margin top\n * @cssprop --bq-input--helper-text-color - Helper text color\n * @cssprop --bq-input--helper-text-size - Helper text size\n * @cssprop --bq-input--icon-size - Icon size to use in prefix/suffix and clear button\n * @cssprop --bq-input--label-margin-bottom - Input label margin bottom\n * @cssprop --bq-input--label-text-color - Input label text color\n * @cssprop --bq-input--label-text-size - Input label text size\n * @cssprop --bq-input--padding-start - Input padding start\n * @cssprop --bq-input--padding-end - Input padding end\n * @cssprop --bq-input--paddingY - Input padding top and bottom\n * @cssprop --bq-input--text-color - Input text color\n * @cssprop --bq-input--text-size - Input text size\n * @cssprop --bq-input--text-placeholder-color - Input placeholder text color\n */\n@Component({\n tag: 'bq-input',\n styleUrl: './scss/bq-input.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqInput {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceBqInput: TDebounce<void>;\n private fallbackInputId = 'input';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqInputElement;\n @AttachInternals() internals!: ElementInternals;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasHelperText = false;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the input field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: string = 'off';\n\n /**\n * Specifies whether or not the input field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the input field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the input is disabled or not.\n * If `true`, the input is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** The ID of the form that the input field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** The native form validation message (mandatory if `required` is set) */\n @Prop({ mutable: true }) formValidationMessage?: string;\n\n /**\n * The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * This allows a browser to display an appropriate virtual keyboard while editing.\n * Possible values are 'none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url', and 'date'.\n */\n @Prop() inputmode?: string;\n\n /**\n * The maximum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) max?: number | string;\n\n /** The maximum number of characters that the input field can accept. */\n @Prop({ reflect: true }) maxlength: number;\n\n /**\n * The minimum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) min?: number | string;\n\n /** The minimum number of characters that the input field can accept. */\n @Prop({ reflect: true }) minlength: number;\n\n /** The input field name. */\n @Prop({ reflect: true }) name!: string;\n\n /**\n * Specifies a regular expression the form control's value should match.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern\n */\n @Prop({ reflect: true }) pattern?: string;\n\n /** The input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** If true, the input field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the input field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /**\n * A number that specifies the granularity that the value must adhere to.\n * Valid for date, month, week, time, datetime-local, number, and range.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @Prop({ reflect: true }) step: number | 'any';\n\n /**\n * The type attribute specifies the type of input field to display.\n * Possible values are 'text', 'password', 'email', 'number', 'tel', 'search', 'url', and more.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n */\n @Prop({ reflect: true }) type: TInputType = 'text';\n\n /**\n * The validation status of the input.\n *\n * @remarks\n * This property is used to indicate the validation status of the input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The input value, it can be used to reset the input to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TInputValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n const { internals, value } = this;\n if (Array.isArray(value)) {\n this.hasValue = value.some((val) => val.length > 0);\n this.internals.setFormValue(value.join(','));\n return;\n }\n\n this.hasValue = isDefined(value);\n internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqInputElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value changes.\n * This handler is called whenever the user types or pastes text into the input field.\n */\n @Event() bqInput!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handleValueChange();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n formAssociatedCallback() {\n this.setFormValue(this.value?.toString());\n this.updateFormValidity();\n }\n\n formResetCallback() {\n if (isNil(this.value)) return;\n\n this.handleClear();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n // Update form value and validity\n this.setFormValue(`${this.value}`);\n this.updateFormValidity();\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleClear = () => {\n if (this.disabled) return;\n\n const { inputElem, setFormValue, updateFormValidity } = this;\n // Clear input element value\n inputElem.value = '';\n this.value = inputElem.value;\n // Set form value to empty string abd update validity\n setFormValue(this.value);\n updateFormValidity();\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n ev.stopPropagation();\n this.handleClear();\n\n const { bqClear, bqChange, bqInput, el, inputElem } = this;\n // Emit events\n bqClear.emit(el);\n bqInput.emit({ value: this.value, el });\n bqChange.emit({ value: this.value, el });\n // Refocus input element\n inputElem.focus();\n };\n\n private setFormValue = (value?: string) => {\n this.internals.setFormValue(!isNil(value) ? `${value}` : undefined);\n };\n\n private updateFormValidity = () => {\n const { formValidationMessage, internals, required, value, inputElem } = this;\n\n // Clear the validity state\n internals?.states.clear();\n\n if (required && (!value || value.toString().trim() === '')) {\n // Set validity state to invalid\n internals?.states.add('invalid');\n internals?.setValidity({ valueMissing: true }, formValidationMessage, inputElem);\n return;\n }\n\n // Set validity state to valid if textarea has value or is not required\n internals?.states.add('valid');\n internals?.setValidity({});\n };\n\n private handleSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n this.hasPrefix = hasSlotContent(this.prefixElem);\n this.hasSuffix = hasSlotContent(this.suffixElem);\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-input\" part=\"base\">\n {/* Label */}\n <label\n class={{ 'bq-input--label': true, '!hidden': !this.hasLabel }}\n aria-label={this.name || this.fallbackInputId}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n {/* Input control group */}\n <div\n class={{\n 'bq-input--control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-input--control__prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-input--control__input\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n disabled={this.disabled}\n form={this.form}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxlength}\n min={this.min}\n minLength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n ref={(inputElem) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={this.value}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-input--control__clear ms-[--bq-input--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-input--control__suffix': true, '!hidden': !this.hasSuffix }}\n ref={(spanElem) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange} />\n </span>\n </div>\n {/* Helper text */}\n <div\n class={{\n [`bq-input--helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,+54BAA+54B;;MCiG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CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAI,CAAA,CACtD,CACH,EAEN,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,CAAC,oCAAoC,IAAI,CAAC,gBAAgB,CAAE,CAAA,GAAG,IAAI;AACnE,gBAAA,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa;AAC/B,aAAA,EACD,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,EACjD,IAAI,EAAC,aAAa,EAAA,EAElB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAA,CAAI,CAC5D,CACF;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-notification.entry.esm.js","sources":["../../packages/beeq/src/components/notification/bq-notification.types.ts","../../packages/beeq/src/components/notification/scss/bq-notification.scss?tag=bq-notification&encapsulation=shadow","../../packages/beeq/src/components/notification/bq-notification.tsx"],"sourcesContent":["export const NOTIFICATION_TYPE = ['error', 'info', 'neutral', 'success', 'warning'] as const;\nexport type TNotificationType = (typeof NOTIFICATION_TYPE)[number];\n\nexport const NOTIFICATION_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TNotificationBorderRadius = (typeof NOTIFICATION_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Notification styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-notification.variables';\n\n:host {\n @apply block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-notification {\n @apply relative flex transition-all min-is-[--bq-notification--min-width] p-b-[--bq-notification--padding] p-i-[--bq-notification--padding];\n @apply rounded-[--bq-notification--border-radius] bg-[--bq-notification--background] shadow-[shadow:--bq-notification--box-shadow];\n}\n\n/**\n * Set the notification icon color based on the type value selected\n */\n.notification--icon.color {\n &-error {\n @apply text-[color:--bq-notification--icon-color-error];\n }\n\n &-info {\n @apply text-[color:--bq-notification--icon-color-info];\n }\n\n &-neutral {\n @apply text-[color:--bq-notification--icon-color-neutral];\n }\n\n &-success {\n @apply text-[color:--bq-notification--icon-color-success];\n }\n\n &-warning {\n @apply text-[color:--bq-notification--icon-color-warning];\n }\n}\n\n/**\n * Tweak the close bq-button styles so it remain small without extra padding\n */\n.notification--close::part(button) {\n @apply rounded-s border-0 bs-fit p-b-0 p-i-0;\n}\n\n/**\n * Here we guarantee that if the footer actions are wrapped in a div container from the consumer side,\n * the styles get applied to the that wrapping container directly\n */\n[part='footer'] ::slotted(*) {\n @apply flex items-start gap-xs;\n}\n\n[part='body'],\n[part='footer'] {\n ::slotted(*) {\n @apply block m-bs-m;\n }\n}\n","import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport { NOTIFICATION_TYPE } from './bq-notification.types';\nimport type { TNotificationBorderRadius, TNotificationType } from './bq-notification.types';\nimport { debounce, enter, hasSlotContent, isClient, leave, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst NOTIFICATION_PORTAL_SELECTOR = 'bq-notification-portal';\n\n/**\n * The Notification component is a user interface element used to provide information or alerts to users in a non-intrusive manner.\n *\n * @example How to use it\n * ```html\n * <bq-notification border=\"s\" time=\"3000\" type=\"info\">\n * Title\n * <span slot=\"body\">\n * This is some description text text\n * <a class=\"bq-link\" href=\"https://example.com\">Link</a>\n * </span>\n * <div class=\"flex gap-xs\" slot=\"footer\">\n * <bq-button appearance=\"primary\" size=\"small\">Button</bq-button>\n * <bq-button appearance=\"link\" size=\"small\">Button</bq-button>\n * </div>\n * </bq-notification>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/945cb6-notification\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {boolean} auto-dismiss - If true, the notification will automatically hide after the specified amount of time\n * @attr {string} border - The corder radius of the notification component\n * @attr {boolean} disable-close - If true, the close button at the top right of the notification won't be shown\n * @attr {boolean} hide-icon - If true, the notification icon won't be shown\n * @attr {boolean} open - If true, the notification will be shown\n * @attr {number} time - The length of time, in milliseconds, after which the notification will close itself. Only valid if `auto-dismiss=\"true\"`\n * @attr {string} type - Type of Notification\n *\n * @event bqAfterClose - Callback handler to be called after the notification has been closed\n * @event bqAfterOpen - Callback handler to be called after the notification has been opened\n * @event bqHide - Callback handler to be called when the notification is hidden\n * @event bqShow - Callback handler to be called when the notification is shown\n *\n * @slot - The notification title content\n * @slot body - The notification description content\n * @slot footer - The notification footer content\n * @slot icon - The icon to be displayed in the notification\n * @slot btn-close - The close button of the notification\n *\n * @part base - The `<div>` container of the predefined bq-icon component.\n * @part body - The container `<div>` that wraps the notification description content\n * @part btn-close - The `bq-button` used to close the notification\n * @part content - The container `<div>` that wraps all the notification content (title, description, footer)\n * @part footer - The container `<div>` that wraps the notification footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon based on the notification type\n * @part icon-outline - The container `<div>` that wraps the icon element\n * @part main - The container `<div>` that wraps the notification main content (title, description)\n * @part svg - The `<svg>` element of the predefined bq-icon component.\n * @part title - The container `<div>` that wraps the notification title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n *\n * @cssprop --bq-notification--background - The notification background color\n * @cssprop --bq-notification--box-shadow - The notification box shadow\n * @cssprop --bq-notification--border-color - The notification border color\n * @cssprop --bq-notification--border-radius - The notification border radius\n * @cssprop --bq-notification--border-style - The notification border style\n * @cssprop --bq-notification--border-width - The notification border width\n * @cssprop --bq-notification--content-footer-gap - The notification content and footer gap\n * @cssprop --bq-notification--title-body-gap - The notification title and body gap\n * @cssprop --bq-notification--icon-color-error - The notification icon color for error type\n * @cssprop --bq-notification--icon-color-info - The notification icon color for info type\n * @cssprop --bq-notification--icon-color-neutral - The notification icon color for neutral type\n * @cssprop --bq-notification--icon-color-success - The notification icon color for success type\n * @cssprop --bq-notification--icon-color-warning - The notification icon color for warning type\n * @cssprop --bq-notification--padding - The notification padding\n * @cssprop --bq-notification--min-width - The notification min width\n */\n@Component({\n tag: 'bq-notification',\n styleUrl: './scss/bq-notification.scss',\n shadow: true,\n})\nexport class BqNotification {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n private notificationElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqNotificationElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasContent = false;\n @State() private hasFooter = false;\n @State() private notificationPortal = isClient() ? document.querySelector(`.${NOTIFICATION_PORTAL_SELECTOR}`) : null;\n\n // Public Property API\n // ========================\n\n /** If true, the notification will automatically hide after the specified amount of time */\n @Prop({ reflect: true }) autoDismiss: boolean;\n\n /** The corder radius of the notification component */\n @Prop({ reflect: true }) border: TNotificationBorderRadius = 's';\n\n /** If true, the close button at the top right of the notification won't be shown */\n @Prop({ reflect: true }) disableClose: boolean;\n\n /** If true, the notification icon won't be shown */\n @Prop({ reflect: true }) hideIcon: boolean;\n\n /** If true, the notification will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the notification will close itself. Only valid if `autoDismiss=\"true\"` */\n @Prop({ reflect: true }) time: number = 3000;\n\n /** Type of Notification */\n @Prop({ reflect: true }) type: TNotificationType = 'info';\n\n // Prop lifecycle events\n // =======================\n @Watch('autoDismiss')\n @Watch('time')\n handleTimeout() {\n this.autoDismissDebounce?.cancel();\n if (!this.autoDismiss) return;\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n // Make sure to autodismiss the notification if the `auto-dismiss` value changed while open\n if (this.open) this.autoDismissDebounce();\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (!(this.autoDismiss && this.open)) return;\n this.autoDismissDebounce();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(NOTIFICATION_TYPE, 'info', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide!: EventEmitter;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow!: EventEmitter;\n\n /** Callback handler to be called after the notification has been opened */\n @Event() bqAfterOpen!: EventEmitter;\n\n /** Callback handler to be called after the notification has been closed */\n @Event() bqAfterClose!: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n if (!isClient()) return;\n\n const { notificationPortal } = this;\n if (!notificationPortal) {\n this.notificationPortal = Object.assign(document.createElement('div'), {\n className: NOTIFICATION_PORTAL_SELECTOR,\n });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeout();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqAfterClose')\n afterNotificationClose() {\n try {\n const { notificationPortal } = this;\n notificationPortal.removeChild(this.el);\n // Remove the notification portal from the DOM when there are no more notifications\n if (notificationPortal.querySelector(this.el.tagName.toLowerCase()) === null) {\n notificationPortal.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to hide the notification component */\n @Method()\n async hide(): Promise<void> {\n await this.handleHide();\n }\n\n /** Method to be called to show the notification component */\n @Method()\n async show(): Promise<void> {\n await this.handleShow();\n }\n\n /** This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically */\n @Method()\n async toast() {\n if (!isClient()) return;\n\n const { notificationPortal } = this;\n if (notificationPortal?.parentElement === null) {\n document.body.append(notificationPortal);\n }\n\n notificationPortal?.appendChild(this.el);\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = async () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n await leave(this.notificationElem);\n this.open = false;\n this.handleTransitionEnd();\n }\n };\n\n private handleShow = async () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n await enter(this.notificationElem);\n this.handleTransitionEnd();\n }\n };\n\n private handleTransitionEnd = () => {\n if (this.open) {\n this.bqAfterOpen.emit();\n return;\n }\n\n this.bqAfterClose.emit();\n };\n\n private handleSlotChange = () => {\n this.hasContent = hasSlotContent(this.bodyElem);\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconName(): string {\n const typeMap = {\n error: 'x-circle',\n success: 'check-circle',\n warning: 'warning-circle',\n };\n\n return typeMap[this.type] || 'info';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-notification--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"alert\"\n >\n <div\n class=\"bq-notification\"\n data-transition-enter=\"transform transition ease-out duration-300\"\n data-transition-enter-start=\"translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n data-transition-enter-end=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave=\"transform transition ease-in duration-100\"\n data-transition-leave-start=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave-end=\"-translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n ref={(div) => (this.notificationElem = div)}\n part=\"wrapper\"\n >\n {/* CLOSE BUTTON */}\n {!this.disableClose && (\n <bq-button\n class=\"notification--close absolute inset-ie-5 [&::part(label)]:inline-flex\"\n appearance=\"text\"\n size=\"small\"\n onClick={() => this.hide()}\n part=\"btn-close\"\n >\n <slot name=\"btn-close\">\n <bq-icon name=\"x\" />\n </slot>\n </bq-button>\n )}\n {/* ICON */}\n <div\n class={{\n '!hidden': this.hideIcon,\n [`color-${this.type}`]: true, // The icon color will be based on the type (info, success, warning, error)\n 'notification--icon me-xs flex text-left align-top': true,\n }}\n part=\"icon-outline\"\n >\n <slot name=\"icon\">\n <bq-icon name={this.iconName} part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n {/* MAIN */}\n <div class=\"flex flex-col items-start gap-[--bq-notification--content-footer-gap]\" part=\"main\">\n <div class=\"flex flex-col gap-[--bq-notification--title-body-gap]\" part=\"content\">\n {/* TITLE */}\n <div class=\"title-font font-semibold leading-regular\" part=\"title\">\n <slot />\n </div>\n {/* BODY */}\n <div\n class={{ 'text-s leading-regular': true, '!hidden': !this.hasContent }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n {/* FOOTER */}\n <div\n class={{ 'flex items-start gap-xs': true, '!hidden': !this.hasFooter }}\n ref={(div) => (this.footerElem = div)}\n part=\"footer\"\n >\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAO,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU;;ACA5F,MAAM,iBAAiB,GAAG,+7yBAA+7yB;;ACOz9yB,MAAM,4BAA4B,GAAG,wBAAwB;MA8EhD,cAAc,GAAA,MAAA;;;;;;;;;;AAIjB,IAAA,mBAAmB;AACnB,IAAA,QAAQ;AACR,IAAA,UAAU;AACV,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EAAE,IAAI,CAAC,gBAAgB,EAAI,CAAA,CACrD,CACF,EAEN,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EACtE,GAAG,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EACrC,IAAI,EAAC,QAAQ,EAAA,EAEb,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACvD,CACF,CACF,CACD;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bq-notification.entry.esm.js","sources":["../../packages/beeq/src/components/notification/bq-notification.types.ts","../../packages/beeq/src/components/notification/scss/bq-notification.scss?tag=bq-notification&encapsulation=shadow","../../packages/beeq/src/components/notification/bq-notification.tsx"],"sourcesContent":["export const NOTIFICATION_TYPE = ['error', 'info', 'neutral', 'success', 'warning'] as const;\nexport type TNotificationType = (typeof NOTIFICATION_TYPE)[number];\n\nexport const NOTIFICATION_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TNotificationBorderRadius = (typeof NOTIFICATION_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Notification styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-notification.variables';\n\n:host {\n @apply block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-notification {\n @apply relative flex transition-all min-is-[--bq-notification--min-width] p-b-[--bq-notification--padding] p-i-[--bq-notification--padding];\n @apply rounded-[--bq-notification--border-radius] bg-[--bq-notification--background] shadow-[shadow:--bq-notification--box-shadow];\n}\n\n/**\n * Set the notification icon color based on the type value selected\n */\n.notification--icon.color {\n &-error {\n @apply text-[color:--bq-notification--icon-color-error];\n }\n\n &-info {\n @apply text-[color:--bq-notification--icon-color-info];\n }\n\n &-neutral {\n @apply text-[color:--bq-notification--icon-color-neutral];\n }\n\n &-success {\n @apply text-[color:--bq-notification--icon-color-success];\n }\n\n &-warning {\n @apply text-[color:--bq-notification--icon-color-warning];\n }\n}\n\n/**\n * Tweak the close bq-button styles so it remain small without extra padding\n */\n.notification--close::part(button) {\n @apply rounded-s border-0 bs-fit p-b-0 p-i-0;\n}\n\n/**\n * Here we guarantee that if the footer actions are wrapped in a div container from the consumer side,\n * the styles get applied to the that wrapping container directly\n */\n[part='footer'] ::slotted(*) {\n @apply flex items-start gap-xs;\n}\n\n[part='body'],\n[part='footer'] {\n ::slotted(*) {\n @apply block m-bs-m;\n }\n}\n","import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { EventEmitter } from '@stencil/core';\n\nimport { NOTIFICATION_TYPE } from './bq-notification.types';\nimport type { TNotificationBorderRadius, TNotificationType } from './bq-notification.types';\nimport { debounce, enter, hasSlotContent, isClient, leave, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst NOTIFICATION_PORTAL_SELECTOR = 'bq-notification-portal';\n\n/**\n * The Notification component is a user interface element used to provide information or alerts to users in a non-intrusive manner.\n *\n * @example How to use it\n * ```html\n * <bq-notification border=\"s\" time=\"3000\" type=\"info\">\n * Title\n * <span slot=\"body\">\n * This is some description text text\n * <a class=\"bq-link\" href=\"https://example.com\">Link</a>\n * </span>\n * <div class=\"flex gap-xs\" slot=\"footer\">\n * <bq-button appearance=\"primary\" size=\"small\">Button</bq-button>\n * <bq-button appearance=\"link\" size=\"small\">Button</bq-button>\n * </div>\n * </bq-notification>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/945cb6-notification\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {boolean} auto-dismiss - If true, the notification will automatically hide after the specified amount of time\n * @attr {string} border - The corder radius of the notification component\n * @attr {boolean} disable-close - If true, the close button at the top right of the notification won't be shown\n * @attr {boolean} hide-icon - If true, the notification icon won't be shown\n * @attr {boolean} open - If true, the notification will be shown\n * @attr {number} time - The length of time, in milliseconds, after which the notification will close itself. Only valid if `auto-dismiss=\"true\"`\n * @attr {string} type - Type of Notification\n *\n * @event bqAfterClose - Callback handler to be called after the notification has been closed\n * @event bqAfterOpen - Callback handler to be called after the notification has been opened\n * @event bqHide - Callback handler to be called when the notification is hidden\n * @event bqShow - Callback handler to be called when the notification is shown\n *\n * @slot - The notification title content\n * @slot body - The notification description content\n * @slot footer - The notification footer content\n * @slot icon - The icon to be displayed in the notification\n * @slot btn-close - The close button of the notification\n *\n * @part base - The `<div>` container of the predefined bq-icon component.\n * @part body - The container `<div>` that wraps the notification description content\n * @part btn-close - The `bq-button` used to close the notification\n * @part content - The container `<div>` that wraps all the notification content (title, description, footer)\n * @part footer - The container `<div>` that wraps the notification footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon based on the notification type\n * @part icon-outline - The container `<div>` that wraps the icon element\n * @part main - The container `<div>` that wraps the notification main content (title, description)\n * @part svg - The `<svg>` element of the predefined bq-icon component.\n * @part title - The container `<div>` that wraps the notification title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n *\n * @cssprop --bq-notification--background - The notification background color\n * @cssprop --bq-notification--box-shadow - The notification box shadow\n * @cssprop --bq-notification--border-color - The notification border color\n * @cssprop --bq-notification--border-radius - The notification border radius\n * @cssprop --bq-notification--border-style - The notification border style\n * @cssprop --bq-notification--border-width - The notification border width\n * @cssprop --bq-notification--content-footer-gap - The notification content and footer gap\n * @cssprop --bq-notification--title-body-gap - The notification title and body gap\n * @cssprop --bq-notification--icon-color-error - The notification icon color for error type\n * @cssprop --bq-notification--icon-color-info - The notification icon color for info type\n * @cssprop --bq-notification--icon-color-neutral - The notification icon color for neutral type\n * @cssprop --bq-notification--icon-color-success - The notification icon color for success type\n * @cssprop --bq-notification--icon-color-warning - The notification icon color for warning type\n * @cssprop --bq-notification--padding - The notification padding\n * @cssprop --bq-notification--min-width - The notification min width\n */\n@Component({\n tag: 'bq-notification',\n styleUrl: './scss/bq-notification.scss',\n shadow: true,\n})\nexport class BqNotification {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n private notificationElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqNotificationElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasContent = false;\n @State() private hasFooter = false;\n @State() private notificationPortal = isClient() ? document.querySelector(`.${NOTIFICATION_PORTAL_SELECTOR}`) : null;\n\n // Public Property API\n // ========================\n\n /** If true, the notification will automatically hide after the specified amount of time */\n @Prop({ reflect: true }) autoDismiss: boolean;\n\n /** The corder radius of the notification component */\n @Prop({ reflect: true }) border: TNotificationBorderRadius = 's';\n\n /** If true, the close button at the top right of the notification won't be shown */\n @Prop({ reflect: true }) disableClose: boolean;\n\n /** If true, the notification icon won't be shown */\n @Prop({ reflect: true }) hideIcon: boolean;\n\n /** If true, the notification will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the notification will close itself. Only valid if `autoDismiss=\"true\"` */\n @Prop({ reflect: true }) time: number = 3000;\n\n /** Type of Notification */\n @Prop({ reflect: true }) type: TNotificationType = 'info';\n\n // Prop lifecycle events\n // =======================\n @Watch('autoDismiss')\n @Watch('time')\n handleTimeout() {\n this.autoDismissDebounce?.cancel();\n if (!this.autoDismiss) return;\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n // Make sure to autodismiss the notification if the `auto-dismiss` value changed while open\n if (this.open) this.autoDismissDebounce();\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (!(this.autoDismiss && this.open)) return;\n this.autoDismissDebounce();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(NOTIFICATION_TYPE, 'info', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide!: EventEmitter;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow!: EventEmitter;\n\n /** Callback handler to be called after the notification has been opened */\n @Event() bqAfterOpen!: EventEmitter;\n\n /** Callback handler to be called after the notification has been closed */\n @Event() bqAfterClose!: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n if (!isClient()) return;\n\n const { notificationPortal } = this;\n if (!notificationPortal) {\n this.notificationPortal = Object.assign(document.createElement('div'), {\n className: NOTIFICATION_PORTAL_SELECTOR,\n });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeout();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqAfterClose')\n afterNotificationClose() {\n try {\n const { notificationPortal } = this;\n notificationPortal.removeChild(this.el);\n // Remove the notification portal from the DOM when there are no more notifications\n if (notificationPortal.querySelector(this.el.tagName.toLowerCase()) === null) {\n notificationPortal.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to hide the notification component */\n @Method()\n async hide(): Promise<void> {\n await this.handleHide();\n }\n\n /** Method to be called to show the notification component */\n @Method()\n async show(): Promise<void> {\n await this.handleShow();\n }\n\n /** This method can be used to display notifications in a fixed-position element that allows for stacking multiple notifications vertically */\n @Method()\n async toast() {\n if (!isClient()) return;\n\n const { notificationPortal } = this;\n if (notificationPortal?.parentElement === null) {\n document.body.append(notificationPortal);\n }\n\n notificationPortal?.appendChild(this.el);\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = async () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n await leave(this.notificationElem);\n this.open = false;\n this.handleTransitionEnd();\n }\n };\n\n private handleShow = async () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n await enter(this.notificationElem);\n this.handleTransitionEnd();\n }\n };\n\n private handleTransitionEnd = () => {\n if (this.open) {\n this.bqAfterOpen.emit();\n return;\n }\n\n this.bqAfterClose.emit();\n };\n\n private handleSlotChange = () => {\n this.hasContent = hasSlotContent(this.bodyElem);\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconName(): string {\n const typeMap = {\n error: 'x-circle',\n success: 'check-circle',\n warning: 'warning-circle',\n };\n\n return typeMap[this.type] || 'info';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-notification--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"alert\"\n >\n <div\n class=\"bq-notification\"\n data-transition-enter=\"transform transition ease-out duration-300\"\n data-transition-enter-start=\"translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n data-transition-enter-end=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave=\"transform transition ease-in duration-100\"\n data-transition-leave-start=\"translate-y-0 opacity-100 sm:translate-x-0\"\n data-transition-leave-end=\"-translate-y-xs opacity-0 sm:translate-y-0 sm:translate-x-s\"\n ref={(div) => (this.notificationElem = div)}\n part=\"wrapper\"\n >\n {/* CLOSE BUTTON */}\n {!this.disableClose && (\n <bq-button\n class=\"notification--close absolute inset-ie-5 [&::part(label)]:inline-flex\"\n appearance=\"text\"\n size=\"small\"\n onClick={() => this.hide()}\n part=\"btn-close\"\n >\n <slot name=\"btn-close\">\n <bq-icon name=\"x\" />\n </slot>\n </bq-button>\n )}\n {/* ICON */}\n <div\n class={{\n '!hidden': this.hideIcon,\n [`color-${this.type}`]: true, // The icon color will be based on the type (info, success, warning, error)\n 'notification--icon me-xs flex text-left align-top': true,\n }}\n part=\"icon-outline\"\n >\n <slot name=\"icon\">\n <bq-icon name={this.iconName} part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n {/* MAIN */}\n <div class=\"flex flex-col items-start gap-[--bq-notification--content-footer-gap]\" part=\"main\">\n <div class=\"flex flex-col gap-[--bq-notification--title-body-gap]\" part=\"content\">\n {/* TITLE */}\n <div class=\"title-font font-semibold leading-regular\" part=\"title\">\n <slot />\n </div>\n {/* BODY */}\n <div\n class={{ 'text-s leading-regular': true, '!hidden': !this.hasContent }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n {/* FOOTER */}\n <div\n class={{ 'flex items-start gap-xs': true, '!hidden': !this.hasFooter }}\n ref={(div) => (this.footerElem = div)}\n part=\"footer\"\n >\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAO,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU;;ACA5F,MAAM,iBAAiB,GAAG,sjzBAAsjzB;;ACOhlzB,MAAM,4BAA4B,GAAG,wBAAwB;MA8EhD,cAAc,GAAA,MAAA;;;;;;;;;;AAIjB,IAAA,mBAAmB;AACnB,IAAA,QAAQ;AACR,IAAA,UAAU;AACV,IAAA,gBAAgB;;;;;IAWP,UAAU,GAAG,KAAK;IAClB,SAAS,GAAG,KAAK;AACjB,IAAA,kBAAkB,GAAG,QAAQ,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA,CAAA,EAA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