@beeq/core 1.12.2-beta.0 → 1.12.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/beeq/beeq.esm.js +1 -44
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +1 -69
- package/dist/beeq/p-026cfacc.entry.js +6 -0
- package/dist/beeq/p-026cfacc.entry.js.map +1 -0
- package/dist/beeq/p-061d53de.entry.js +6 -0
- package/dist/beeq/p-061d53de.entry.js.map +1 -0
- package/dist/beeq/{p-9a78587d.entry.js → p-08fef3d3.entry.js} +2 -134
- package/dist/beeq/p-08fef3d3.entry.js.map +1 -0
- package/dist/beeq/p-12d9420b.entry.js +6 -0
- package/dist/beeq/p-12d9420b.entry.js.map +1 -0
- package/dist/beeq/p-17454929.entry.js +6 -0
- package/dist/beeq/p-17454929.entry.js.map +1 -0
- package/dist/beeq/{p-ff327b98.entry.js → p-1bce390d.entry.js} +2 -116
- package/dist/beeq/p-1bce390d.entry.js.map +1 -0
- package/dist/beeq/p-1c09c7c0.entry.js +6 -0
- package/dist/beeq/p-1c09c7c0.entry.js.map +1 -0
- package/dist/beeq/p-1f819545.entry.js +6 -0
- package/dist/beeq/p-1f819545.entry.js.map +1 -0
- package/dist/beeq/p-292a8a40.entry.js +6 -0
- package/dist/beeq/p-292a8a40.entry.js.map +1 -0
- package/dist/beeq/p-2ec4fbf0.entry.js +6 -0
- package/dist/beeq/p-2ec4fbf0.entry.js.map +1 -0
- package/dist/beeq/p-34125078.entry.js +6 -0
- package/dist/beeq/p-34125078.entry.js.map +1 -0
- package/dist/beeq/{p-6b68123f.entry.js → p-36e8e717.entry.js} +2 -246
- package/dist/beeq/p-36e8e717.entry.js.map +1 -0
- package/dist/beeq/p-37f739f5.entry.js +6 -0
- package/dist/beeq/p-37f739f5.entry.js.map +1 -0
- package/dist/beeq/p-38a7015c.entry.js +6 -0
- package/dist/{components/p-CXLw0i9p.js.map → beeq/p-38a7015c.entry.js.map} +1 -1
- package/dist/beeq/p-4aa539d7.entry.js +6 -0
- package/dist/beeq/p-4aa539d7.entry.js.map +1 -0
- package/dist/beeq/p-51074699.entry.js +6 -0
- package/dist/beeq/p-51074699.entry.js.map +1 -0
- package/dist/beeq/p-64123cb2.entry.js +6 -0
- package/dist/beeq/p-64123cb2.entry.js.map +1 -0
- package/dist/beeq/{p-426fd908.entry.js → p-6a70511e.entry.js} +2 -211
- package/dist/beeq/p-6a70511e.entry.js.map +1 -0
- package/dist/beeq/{p-1011ae42.entry.js → p-7c9c6561.entry.js} +2 -89
- package/dist/beeq/p-7c9c6561.entry.js.map +1 -0
- package/dist/beeq/p-7e73ea84.entry.js +6 -0
- package/dist/beeq/p-7e73ea84.entry.js.map +1 -0
- package/dist/beeq/p-84db8789.entry.js +6 -0
- package/dist/beeq/p-84db8789.entry.js.map +1 -0
- package/dist/beeq/p-85af346a.entry.js +6 -0
- package/dist/beeq/p-85af346a.entry.js.map +1 -0
- package/dist/beeq/p-B4sM1t6Z.js +1 -8
- package/dist/beeq/p-BNvWMggA.js +1 -23
- package/dist/beeq/p-BRMw_HGf.js +1 -8
- package/dist/beeq/p-BRbYDZoo.js +1 -10
- package/dist/beeq/p-BcPwGxIn.js +1 -9
- package/dist/beeq/p-BsSDkLU5.js +1 -26
- package/dist/beeq/p-CCNjsDdb.js +1 -88
- package/dist/beeq/p-CVw85-WU.js +1 -64
- package/dist/beeq/p-Cau9SvT4.js +1 -12
- package/dist/beeq/p-CmKvDWiL.js +1 -1782
- package/dist/beeq/p-CpKQ7XUL.js +1 -284
- package/dist/beeq/p-D1A0LpG_.js +1 -10
- package/dist/beeq/p-DdvbF5yL.js +1 -119
- package/dist/beeq/p-DnkZCdMA.js +1 -8
- package/dist/beeq/p-Ds7rcaFH.js +1 -65
- package/dist/beeq/p-Dx-CEPSQ.js +1 -13
- package/dist/beeq/p-XbB3xSTR.js +7 -0
- package/dist/beeq/p-XbB3xSTR.js.map +1 -0
- package/dist/beeq/p-_RvVpeh2.js +1 -29
- package/dist/beeq/p-a4e6c238.entry.js +6 -0
- package/dist/beeq/p-a4e6c238.entry.js.map +1 -0
- package/dist/beeq/p-ab690c8e.entry.js +6 -0
- package/dist/beeq/p-ab690c8e.entry.js.map +1 -0
- package/dist/beeq/p-ad86b7ee.entry.js +6 -0
- package/dist/beeq/p-ad86b7ee.entry.js.map +1 -0
- package/dist/beeq/p-b31ab8df.entry.js +6 -0
- package/dist/beeq/p-b31ab8df.entry.js.map +1 -0
- package/dist/beeq/p-b4f1b67f.entry.js +6 -0
- package/dist/beeq/p-b4f1b67f.entry.js.map +1 -0
- package/dist/beeq/{p-8b5934a3.entry.js → p-bcd26036.entry.js} +2 -154
- package/dist/beeq/p-bcd26036.entry.js.map +1 -0
- package/dist/beeq/{p-11671252.entry.js → p-c08c4c7b.entry.js} +2 -124
- package/dist/beeq/p-c08c4c7b.entry.js.map +1 -0
- package/dist/{components/p-CXLw0i9p.js → beeq/p-c3013171.entry.js} +2 -291
- package/dist/beeq/p-c3013171.entry.js.map +1 -0
- package/dist/beeq/p-ce975008.entry.js +6 -0
- package/dist/beeq/p-ce975008.entry.js.map +1 -0
- package/dist/beeq/{p-db09cc1e.entry.js → p-cf843f3a.entry.js} +2 -83
- package/dist/beeq/p-cf843f3a.entry.js.map +1 -0
- package/dist/beeq/p-d1f4ce2e.entry.js +6 -0
- package/dist/beeq/p-d1f4ce2e.entry.js.map +1 -0
- package/dist/beeq/p-d6edf4cb.entry.js +6 -0
- package/dist/beeq/p-d6edf4cb.entry.js.map +1 -0
- package/dist/beeq/p-e38637a0.entry.js +6 -0
- package/dist/beeq/p-e38637a0.entry.js.map +1 -0
- package/dist/beeq/p-ec4c7f14.entry.js +6 -0
- package/dist/beeq/p-ec4c7f14.entry.js.map +1 -0
- package/dist/beeq/p-f3c8eda1.entry.js +6 -0
- package/dist/beeq/p-f3c8eda1.entry.js.map +1 -0
- package/dist/beeq/{p-1aba3eec.entry.js → p-f86bbd71.entry.js} +2 -146
- package/dist/beeq/p-f86bbd71.entry.js.map +1 -0
- package/dist/beeq/p-ff68b62f.entry.js +6 -0
- package/dist/beeq/p-ff68b62f.entry.js.map +1 -0
- package/dist/beeq/p-lysmVw2n.js +1 -12
- package/dist/beeq/p-uqkxeAeG.js +1 -88
- package/dist/beeq/p-zh4P02Kn.js +1 -21
- package/dist/beeq/scripts/esm-loader.js +24 -0
- package/dist/beeq/scripts/zeroheight-svg-loader.js +22 -0
- package/dist/beeq.html-custom-data.json +198 -198
- package/dist/cjs/beeq.cjs.js +2 -3
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -3
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +14 -15
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +14 -15
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +13 -14
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +9 -10
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +2 -3
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +7 -8
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +19 -20
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +7 -8
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +5 -6
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +20 -21
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +15 -16
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +15 -16
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +19 -20
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +7 -8
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +26 -27
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +22 -23
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +12 -13
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +2 -3
- package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +11 -12
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +15 -16
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +11 -12
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +13 -14
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +2 -3
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +9 -10
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +31 -32
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +6 -7
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +4 -5
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +23 -24
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +10 -11
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +2 -3
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +17 -18
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +3 -4
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +10 -11
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +8 -9
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +5 -6
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +16 -17
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +2 -3
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +9 -10
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-BwvwUnfB.js → index-Bp6IQmE_.js} +68 -22
- package/dist/cjs/index-Bp6IQmE_.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/components/accordion/bq-accordion.js +14 -14
- package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
- package/dist/collection/components/accordion-group/bq-accordion-group.js +2 -2
- package/dist/collection/components/accordion-group/bq-accordion-group.js.map +1 -1
- package/dist/collection/components/alert/bq-alert.js +14 -15
- package/dist/collection/components/alert/bq-alert.js.map +1 -1
- package/dist/collection/components/avatar/bq-avatar.js +13 -14
- package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
- package/dist/collection/components/badge/bq-badge.js +9 -10
- package/dist/collection/components/badge/bq-badge.js.map +1 -1
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js +6 -7
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js.map +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +2 -2
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
- package/dist/collection/components/button/bq-button.js +18 -19
- package/dist/collection/components/button/bq-button.js.map +1 -1
- package/dist/collection/components/card/bq-card.js +7 -8
- package/dist/collection/components/card/bq-card.js.map +1 -1
- package/dist/collection/components/checkbox/bq-checkbox.js +5 -5
- package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js +20 -20
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/dialog/bq-dialog.js +15 -15
- package/dist/collection/components/dialog/bq-dialog.js.map +1 -1
- package/dist/collection/components/divider/bq-divider.js +15 -16
- package/dist/collection/components/divider/bq-divider.js.map +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +19 -20
- package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
- package/dist/collection/components/dropdown/bq-dropdown.js +2 -2
- package/dist/collection/components/dropdown/bq-dropdown.js.map +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +26 -26
- package/dist/collection/components/empty-state/bq-empty-state.js.map +1 -1
- package/dist/collection/components/icon/bq-icon.js +2 -3
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/input/bq-input.js +22 -22
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/notification/bq-notification.js +12 -13
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/option/bq-option.js +15 -16
- package/dist/collection/components/option/bq-option.js.map +1 -1
- package/dist/collection/components/option-group/bq-option-group.js +2 -2
- package/dist/collection/components/option-group/bq-option-group.js.map +1 -1
- package/dist/collection/components/option-list/bq-option-list.js +2 -2
- package/dist/collection/components/option-list/bq-option-list.js.map +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +11 -11
- package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
- package/dist/collection/components/panel/bq-panel.js +3 -3
- package/dist/collection/components/panel/bq-panel.js.map +1 -1
- package/dist/collection/components/progress/bq-progress.js +13 -14
- package/dist/collection/components/progress/bq-progress.js.map +1 -1
- package/dist/collection/components/radio/bq-radio.js +9 -10
- package/dist/collection/components/radio/bq-radio.js.map +1 -1
- package/dist/collection/components/radio-group/bq-radio-group.js +2 -3
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/select/bq-select.js +27 -27
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +4 -4
- package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js +6 -6
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
- package/dist/collection/components/slider/bq-slider.js +23 -23
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +10 -10
- package/dist/collection/components/spinner/bq-spinner.js.map +1 -1
- package/dist/collection/components/status/bq-status.js +2 -2
- package/dist/collection/components/status/bq-status.js.map +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +16 -16
- 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 +3 -3
- package/dist/collection/components/steps/bq-steps.js.map +1 -1
- package/dist/collection/components/switch/bq-switch.js +10 -11
- package/dist/collection/components/switch/bq-switch.js.map +1 -1
- package/dist/collection/components/tab/bq-tab.js +5 -5
- package/dist/collection/components/tab/bq-tab.js.map +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +8 -9
- package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
- package/dist/collection/components/tag/bq-tag.js +10 -11
- package/dist/collection/components/tag/bq-tag.js.map +1 -1
- package/dist/collection/components/tag/scss/bq-tag.css +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +16 -16
- package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
- package/dist/collection/components/toast/bq-toast.js +2 -3
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +8 -8
- package/dist/collection/components/tooltip/bq-tooltip.js.map +1 -1
- package/dist/collection/global/scripts/esm-loader.js +23 -6
- package/dist/collection/scripts/esm-loader.js +24 -0
- package/dist/collection/scripts/zeroheight-svg-loader.js +22 -0
- package/dist/components/bq-accordion-group.js +1 -157
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +1 -444
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +1 -354
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +1 -206
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge.js +1 -8
- package/dist/components/bq-breadcrumb-item.js +1 -129
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +1 -138
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button.js +1 -8
- package/dist/components/bq-card.js +1 -118
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +1 -314
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -1113
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -347
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider.js +1 -8
- package/dist/components/bq-drawer.js +1 -356
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown.js +1 -8
- package/dist/components/bq-empty-state.js +1 -192
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon.js +1 -8
- package/dist/components/bq-input.js +1 -502
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +1 -381
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -104
- package/dist/components/bq-option-group.js.map +1 -1
- package/dist/components/bq-option-list.js +1 -8
- package/dist/components/bq-option.js +1 -200
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +1 -150
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel.js +1 -8
- package/dist/components/bq-progress.js +1 -220
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +1 -457
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +1 -219
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +1 -794
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +1 -181
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +1 -200
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +1 -443
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +1 -248
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +1 -119
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +1 -236
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -175
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +1 -330
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +1 -273
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +1 -248
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag.js +1 -8
- package/dist/components/bq-textarea.js +1 -393
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +1 -281
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip.js +1 -8
- package/dist/components/index.js +1 -149
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-4z5qnOaY.js +6 -0
- package/dist/components/p-4z5qnOaY.js.map +1 -0
- package/dist/components/p-8mobOXPw.js +6 -0
- package/dist/components/p-8mobOXPw.js.map +1 -0
- package/dist/components/p-B4sM1t6Z.js +1 -8
- package/dist/components/p-B4sM1t6Z.js.map +1 -1
- package/dist/components/p-BHxv_w2i.js +6 -0
- package/dist/components/p-BHxv_w2i.js.map +1 -0
- package/dist/components/p-BRMw_HGf.js +1 -8
- package/dist/components/p-BRMw_HGf.js.map +1 -1
- package/dist/components/p-BRbYDZoo.js +1 -10
- package/dist/components/p-BRbYDZoo.js.map +1 -1
- package/dist/components/p-BcPwGxIn.js +1 -9
- package/dist/components/p-BcPwGxIn.js.map +1 -1
- package/dist/components/{p-C8_OKNHL.js → p-Br5pwRAS.js} +2 -221
- package/dist/components/p-Br5pwRAS.js.map +1 -0
- package/dist/components/p-BsSDkLU5.js +1 -26
- package/dist/components/p-BsSDkLU5.js.map +1 -1
- package/dist/components/p-C4FuG35Q.js +6 -0
- package/dist/components/p-C4FuG35Q.js.map +1 -0
- package/dist/components/p-CVw85-WU.js +1 -64
- package/dist/components/p-CVw85-WU.js.map +1 -1
- package/dist/components/p-CmKvDWiL.js +1 -1782
- package/dist/components/p-CmKvDWiL.js.map +1 -1
- package/dist/components/p-D1A0LpG_.js +1 -10
- package/dist/components/p-D1A0LpG_.js.map +1 -1
- package/dist/components/p-D97CZ-cz.js +6 -0
- package/dist/components/p-D97CZ-cz.js.map +1 -0
- package/dist/components/p-DDVIIUm1.js +6 -0
- package/dist/components/p-DDVIIUm1.js.map +1 -0
- package/dist/components/p-DSdUt2Ay.js +6 -0
- package/dist/components/p-DSdUt2Ay.js.map +1 -0
- package/dist/components/p-DdvbF5yL.js +1 -119
- package/dist/components/p-DdvbF5yL.js.map +1 -1
- package/dist/components/p-Dla7kvqV.js +6 -0
- package/dist/components/p-Dla7kvqV.js.map +1 -0
- package/dist/components/p-DnkZCdMA.js +1 -8
- package/dist/components/p-DnkZCdMA.js.map +1 -1
- package/dist/components/{p-YyF6_fWE.js → p-DoX6g7vo.js} +2 -381
- package/dist/components/p-DoX6g7vo.js.map +1 -0
- package/dist/components/p-Dx-CEPSQ.js +1 -13
- package/dist/components/p-Dx-CEPSQ.js.map +1 -1
- package/dist/components/p-_RvVpeh2.js +1 -29
- package/dist/components/p-_RvVpeh2.js.map +1 -1
- package/dist/components/p-lysmVw2n.js +1 -12
- package/dist/components/p-lysmVw2n.js.map +1 -1
- package/dist/components/p-uqkxeAeG.js +1 -88
- package/dist/components/p-uqkxeAeG.js.map +1 -1
- package/dist/components/p-zh4P02Kn.js +1 -21
- package/dist/components/p-zh4P02Kn.js.map +1 -1
- package/dist/custom-elements.json +5184 -5184
- package/dist/esm/beeq.js +2 -3
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +2 -3
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +14 -15
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +14 -15
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +13 -14
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +9 -10
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +2 -3
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +7 -8
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +19 -20
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +7 -8
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +5 -6
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +20 -21
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +15 -16
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +15 -16
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +19 -20
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +5 -6
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +26 -27
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +22 -23
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +12 -13
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +2 -3
- package/dist/esm/bq-option-group.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +11 -12
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +15 -16
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +11 -12
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +13 -14
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +2 -3
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +9 -10
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +28 -29
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +6 -7
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +4 -5
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +23 -24
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +10 -11
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +2 -3
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +17 -18
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +3 -4
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +10 -11
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +8 -9
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +5 -6
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +16 -17
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +2 -3
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +9 -10
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{index-D0hQxkOP.js → index-XbB3xSTR.js} +67 -23
- package/dist/esm/index-XbB3xSTR.js.map +1 -0
- package/dist/esm/loader.js +2 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/hydrate/index.js +413 -417
- package/dist/hydrate/index.mjs +413 -417
- package/dist/stencil.config.js +1 -1
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/accordion/bq-accordion.d.ts +1 -1
- package/dist/types/components/accordion-group/bq-accordion-group.d.ts +1 -1
- package/dist/types/components/alert/bq-alert.d.ts +1 -1
- package/dist/types/components/avatar/bq-avatar.d.ts +1 -1
- package/dist/types/components/badge/bq-badge.d.ts +1 -1
- package/dist/types/components/breadcrumb/bq-breadcrumb.d.ts +1 -1
- package/dist/types/components/breadcrumb-item/bq-breadcrumb-item.d.ts +1 -1
- package/dist/types/components/button/bq-button.d.ts +1 -1
- package/dist/types/components/card/bq-card.d.ts +1 -1
- package/dist/types/components/checkbox/bq-checkbox.d.ts +1 -1
- package/dist/types/components/date-picker/bq-date-picker.d.ts +1 -1
- package/dist/types/components/dialog/bq-dialog.d.ts +1 -1
- package/dist/types/components/divider/bq-divider.d.ts +1 -1
- package/dist/types/components/drawer/bq-drawer.d.ts +1 -1
- package/dist/types/components/dropdown/bq-dropdown.d.ts +1 -1
- package/dist/types/components/empty-state/bq-empty-state.d.ts +1 -1
- package/dist/types/components/icon/bq-icon.d.ts +1 -1
- package/dist/types/components/input/bq-input.d.ts +1 -1
- package/dist/types/components/notification/bq-notification.d.ts +1 -1
- package/dist/types/components/option/bq-option.d.ts +1 -1
- package/dist/types/components/option-group/bq-option-group.d.ts +1 -1
- package/dist/types/components/option-list/bq-option-list.d.ts +1 -1
- package/dist/types/components/page-title/bq-page-title.d.ts +1 -1
- package/dist/types/components/panel/bq-panel.d.ts +1 -1
- package/dist/types/components/progress/bq-progress.d.ts +1 -1
- package/dist/types/components/radio/bq-radio.d.ts +1 -1
- package/dist/types/components/radio-group/bq-radio-group.d.ts +1 -1
- package/dist/types/components/select/bq-select.d.ts +1 -1
- package/dist/types/components/side-menu/bq-side-menu.d.ts +1 -1
- package/dist/types/components/side-menu-item/bq-side-menu-item.d.ts +1 -1
- package/dist/types/components/slider/bq-slider.d.ts +1 -1
- package/dist/types/components/spinner/bq-spinner.d.ts +1 -1
- package/dist/types/components/status/bq-status.d.ts +1 -1
- package/dist/types/components/step-item/bq-step-item.d.ts +1 -1
- package/dist/types/components/steps/bq-steps.d.ts +1 -1
- package/dist/types/components/switch/bq-switch.d.ts +1 -1
- package/dist/types/components/tab/bq-tab.d.ts +1 -1
- package/dist/types/components/tab-group/bq-tab-group.d.ts +1 -1
- package/dist/types/components/tag/bq-tag.d.ts +1 -1
- package/dist/types/components/textarea/bq-textarea.d.ts +1 -1
- package/dist/types/components/toast/bq-toast.d.ts +1 -1
- package/dist/types/components/tooltip/bq-tooltip.d.ts +1 -1
- package/package.json +1 -1
- package/dist/beeq/p-1011ae42.entry.js.map +0 -1
- package/dist/beeq/p-110c262d.entry.js +0 -173
- package/dist/beeq/p-110c262d.entry.js.map +0 -1
- package/dist/beeq/p-11671252.entry.js.map +0 -1
- package/dist/beeq/p-11fcb99b.entry.js +0 -281
- package/dist/beeq/p-11fcb99b.entry.js.map +0 -1
- package/dist/beeq/p-1aba3eec.entry.js.map +0 -1
- package/dist/beeq/p-20162842.entry.js +0 -151
- package/dist/beeq/p-20162842.entry.js.map +0 -1
- package/dist/beeq/p-3a4c4de9.entry.js +0 -188
- package/dist/beeq/p-3a4c4de9.entry.js.map +0 -1
- package/dist/beeq/p-426fd908.entry.js.map +0 -1
- package/dist/beeq/p-47571092.entry.js +0 -289
- package/dist/beeq/p-47571092.entry.js.map +0 -1
- package/dist/beeq/p-49e90223.entry.js +0 -86
- package/dist/beeq/p-49e90223.entry.js.map +0 -1
- package/dist/beeq/p-4b00a155.entry.js +0 -747
- package/dist/beeq/p-4b00a155.entry.js.map +0 -1
- package/dist/beeq/p-54ddd09f.entry.js +0 -392
- package/dist/beeq/p-54ddd09f.entry.js.map +0 -1
- package/dist/beeq/p-6b68123f.entry.js.map +0 -1
- package/dist/beeq/p-6d708caf.entry.js +0 -339
- package/dist/beeq/p-6d708caf.entry.js.map +0 -1
- package/dist/beeq/p-70607940.entry.js +0 -174
- package/dist/beeq/p-70607940.entry.js.map +0 -1
- package/dist/beeq/p-72c376a9.entry.js +0 -165
- package/dist/beeq/p-72c376a9.entry.js.map +0 -1
- package/dist/beeq/p-78bbd845.entry.js +0 -109
- package/dist/beeq/p-78bbd845.entry.js.map +0 -1
- package/dist/beeq/p-8012f01d.entry.js +0 -556
- package/dist/beeq/p-8012f01d.entry.js.map +0 -1
- package/dist/beeq/p-8b5934a3.entry.js.map +0 -1
- package/dist/beeq/p-94c2081a.entry.js +0 -681
- package/dist/beeq/p-94c2081a.entry.js.map +0 -1
- package/dist/beeq/p-95979cb0.entry.js +0 -289
- package/dist/beeq/p-95979cb0.entry.js.map +0 -1
- package/dist/beeq/p-978b2249.entry.js +0 -196
- package/dist/beeq/p-978b2249.entry.js.map +0 -1
- package/dist/beeq/p-9a78587d.entry.js.map +0 -1
- package/dist/beeq/p-BtYhUEAn.js +0 -9
- package/dist/beeq/p-BtYhUEAn.js.map +0 -1
- package/dist/beeq/p-C33fRBEf.js +0 -156
- package/dist/beeq/p-C33fRBEf.js.map +0 -1
- package/dist/beeq/p-D0hQxkOP.js +0 -2816
- package/dist/beeq/p-D0hQxkOP.js.map +0 -1
- package/dist/beeq/p-ac7cd72b.entry.js +0 -322
- package/dist/beeq/p-ac7cd72b.entry.js.map +0 -1
- package/dist/beeq/p-ae85a23a.entry.js +0 -408
- package/dist/beeq/p-ae85a23a.entry.js.map +0 -1
- package/dist/beeq/p-b0f9a0cb.entry.js +0 -296
- package/dist/beeq/p-b0f9a0cb.entry.js.map +0 -1
- package/dist/beeq/p-b194e120.entry.js +0 -293
- package/dist/beeq/p-b194e120.entry.js.map +0 -1
- package/dist/beeq/p-b2858324.entry.js +0 -210
- package/dist/beeq/p-b2858324.entry.js.map +0 -1
- package/dist/beeq/p-c34fc2c7.entry.js +0 -351
- package/dist/beeq/p-c34fc2c7.entry.js.map +0 -1
- package/dist/beeq/p-c630a8b8.entry.js +0 -442
- package/dist/beeq/p-c630a8b8.entry.js.map +0 -1
- package/dist/beeq/p-cb9b1edc.entry.js +0 -232
- package/dist/beeq/p-cb9b1edc.entry.js.map +0 -1
- package/dist/beeq/p-cc6b349e.entry.js +0 -172
- package/dist/beeq/p-cc6b349e.entry.js.map +0 -1
- package/dist/beeq/p-d0edfaa5.entry.js +0 -388
- package/dist/beeq/p-d0edfaa5.entry.js.map +0 -1
- package/dist/beeq/p-db09cc1e.entry.js.map +0 -1
- package/dist/beeq/p-f6d82c39.entry.js +0 -206
- package/dist/beeq/p-f6d82c39.entry.js.map +0 -1
- package/dist/beeq/p-f83010e9.entry.js +0 -118
- package/dist/beeq/p-f83010e9.entry.js.map +0 -1
- package/dist/beeq/p-f97c679f.entry.js +0 -233
- package/dist/beeq/p-f97c679f.entry.js.map +0 -1
- package/dist/beeq/p-ff327b98.entry.js.map +0 -1
- package/dist/beeq/p-ff73f344.entry.js +0 -396
- package/dist/beeq/p-ff73f344.entry.js.map +0 -1
- package/dist/cjs/app-globals-BY_z0SzA.js +0 -12
- package/dist/cjs/app-globals-BY_z0SzA.js.map +0 -1
- package/dist/cjs/index-BwvwUnfB.js.map +0 -1
- package/dist/cjs/index-C09ZVaB4.js +0 -154
- package/dist/cjs/index-C09ZVaB4.js.map +0 -1
- package/dist/components/p-C8_OKNHL.js.map +0 -1
- package/dist/components/p-C97BzPa8.js +0 -177
- package/dist/components/p-C97BzPa8.js.map +0 -1
- package/dist/components/p-CMejKLsB.js +0 -248
- package/dist/components/p-CMejKLsB.js.map +0 -1
- package/dist/components/p-DBPU_cIr.js +0 -338
- package/dist/components/p-DBPU_cIr.js.map +0 -1
- package/dist/components/p-DDCN9O42.js +0 -2669
- package/dist/components/p-DDCN9O42.js.map +0 -1
- package/dist/components/p-DHhUeR-_.js +0 -377
- package/dist/components/p-DHhUeR-_.js.map +0 -1
- package/dist/components/p-DSqLegVR.js +0 -100
- package/dist/components/p-DSqLegVR.js.map +0 -1
- package/dist/components/p-YyF6_fWE.js.map +0 -1
- package/dist/components/p-qOL6hl5s.js +0 -298
- package/dist/components/p-qOL6hl5s.js.map +0 -1
- package/dist/esm/app-globals-BtYhUEAn.js +0 -10
- package/dist/esm/app-globals-BtYhUEAn.js.map +0 -1
- package/dist/esm/index-C33fRBEf.js +0 -151
- package/dist/esm/index-C33fRBEf.js.map +0 -1
- package/dist/esm/index-D0hQxkOP.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-divider.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/divider/bq-divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnH,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,MAAM,OAAO,SAAS;IACpB,iBAAiB;IACjB,uBAAuB;IAEf,SAAS,CAAiB;IAElC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAwB;IAErC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAEzB,QAAQ,CAAU;IAEnC,sBAAsB;IACtB,2BAA2B;IAE3B,gDAAgD;IACxC,MAAM,GAAG,KAAK,CAAC;IAEvB,6CAA6C;IACpB,WAAW,GAAwB,YAAY,CAAC;IAEzE,kGAAkG;IACzE,WAAW,GAAY,iBAAiB,CAAC;IAElE,6FAA6F;IACpE,cAAc,GAA4B,QAAQ,CAAC;IAE5E,uGAAuG;IAC9E,eAAe,GAAY,EAAE,CAAC;IAEvD,wFAAwF;IAC/D,aAAa,GAAY,CAAC,CAAC;IAEpD,sEAAsE;IAC7C,eAAe,GAAY,CAAC,CAAC;IAEtD,iGAAiG;IACxE,WAAW,GAAY,CAAC,CAAC;IAElD,yFAAyF;IAChE,aAAa,GAA2B,MAAM,CAAC;IAExE,wBAAwB;IACxB,0BAA0B;IAK1B,eAAe;QACb,iBAAiB,CAAC,mBAAmB,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa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C,EAAE,IAAI;oBACnD,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ;iBACxB,EACD,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;oBACX,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;gBACvB,CAAC,aAED,6BACc,MAAM,EAClB,KAAK,EAAE;4BACL,0BAA0B,EAAE,IAAI;4BAChC,SAAS,EAAE,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,IAAI,CAAC,cAAc,KAAK,OAAO;yBACrE,EACD,IAAI,EAAC,YAAY,YAEjB,kBAAU,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAC,iBAAiB,+CAAG,+CACtD,EACN,eAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,+CAAI,EAC7C,6BACc,MAAM,EAClB,KAAK,EAAE;4BACL,wBAAwB,EAAE,IAAI;4BAC9B,SAAS,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK,CAAC;yBACvF,EACD,IAAI,EAAC,UAAU,YAEf,kBAAU,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAC,eAAe,+CAAG,+CACpD,gDACF,+CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch } from '@stencil/core';\n\nimport { getColorCSSVariable, getTextContent, hasSlotContent, isNil, validatePropValue } from '../../shared/utils';\nimport type { TDividerOrientation, TDividerStrokeLinecap, TDividerTitleAlignment } from './bq-divider.types';\nimport {\n DIVIDER_ORIENTATION,\n DIVIDER_ORIENTATION_ENUM,\n DIVIDER_STROKE_LINECAP,\n DIVIDER_TITLE_ALIGNMENT,\n} from './bq-divider.types';\n\n/**\n * The Divider component is used to visually separate content in a layout.\n *\n * @example How to use it\n * ```html\n * <bq-divider orientation=\"horizontal\" stroke-color=\"stroke--primary\" title-alignment=\"middle\">\n * <span slot=\"title\">Divider Title</span>\n * </bq-divider>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/53dfe6-divider\n * @status stable\n *\n * @attr {boolean} dashed - If true, the divider has a dashed pattern.\n * @attr {\"horizontal\" | \"vertical\"} orientation - The default orientation of the divider.\n * @attr {string} stroke-color - Set the stroke color of the divider. The value should be a valid value of the palette color.\n * @attr {\"start\" | \"middle\" | \"end\"} title-alignment - Set the alignment of the title on the main axis of the divider (horizontal / vertical).\n * @attr {number} stroke-dash-width - Set the width of each dash of the divider's stroke. This is applicable when the stroke is dashed.\n * @attr {number} stroke-dash-gap - Set the gap of the divider's stroke. This is applicable when the stroke is dashed.\n * @attr {number} stroke-thickness - Set the thickness of the divider's stroke. Value expressed in px.\n * @attr {number} stroke-basis - Set the min width of the divider's stroke when text is not centered. Value expressed in px.\n * @attr {\"square\" | \"round\" | \"butt\"} stroke-linecap - Set the line of the divider's stroke. This is applicable when the stroke is dashed.\n *\n * @slot - The title content of the divider.\n *\n * @part base - The component's internal wrapper.\n * @part dash-start - The component's internal svg wrapper for the start line of the divider's stroke.\n * @part dash-end - The component's internal svg wrapper for the end line of the divider's stroke.\n * @part dash-start-line - The component's internal line component of the divider's stroke.\n * @part dash-end-line - The component's internal line component of the divider's stroke.\n *\n * @cssprop --bq-divider--color - Divider color\n * @cssprop --bq-divider--title-marginX - Divider space between title and delimiters\n */\n@Component({\n tag: 'bq-divider',\n styleUrl: './scss/bq-divider.scss',\n shadow: true,\n})\nexport class BqDivider {\n // Own Properties\n // ====================\n\n private titleElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDividerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasTitle: boolean;\n\n // Public Property API\n // ========================\n\n /** If true, the divider has a dashed pattern */\n @Prop() dashed = false;\n\n /** The default orientation of the divider */\n @Prop({ reflect: true }) orientation: TDividerOrientation = 'horizontal';\n\n /** Set the stroke color of the divider. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) strokeColor?: string = 'stroke--primary';\n\n /** Set the alignment of the title on the main axis of the divider (horizontal / vertical) */\n @Prop({ reflect: true }) titleAlignment?: TDividerTitleAlignment = 'middle';\n\n /** Set the width of each dash of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeDashWidth?: number = 12;\n\n /** Set the gap of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeDashGap?: number = 7;\n\n /** Set the thickness of the divider's stroke. Value expressed in px*/\n @Prop({ reflect: true }) strokeThickness?: number = 1;\n\n /** Set the min width of the divider's stroke when text is not centered. Value expressed in px */\n @Prop({ reflect: true }) strokeBasis?: number = 0;\n\n /** Set the line of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeLinecap?: TDividerStrokeLinecap = 'butt';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('orientation')\n @Watch('titleAlignment')\n @Watch('strokeLinecap')\n checkPropValues() {\n validatePropValue(DIVIDER_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(DIVIDER_TITLE_ALIGNMENT, 'middle', this.el, 'titleAlignment');\n validatePropValue(DIVIDER_STROKE_LINECAP, 'butt', this.el, 'strokeLinecap');\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 connectedCallback() {\n this.checkPropValues();\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.hasTitle = hasSlotContent(this.titleElem) || !!getTextContent(this.titleElem.querySelector('slot'));\n };\n\n private get strokeAttributes() {\n return {\n ...this.strokeDrawPositions,\n ...(this.dashed && { 'stroke-dasharray': this.strokeDasharray }),\n 'stroke-linecap': this.strokeLinecap,\n 'stroke-width': this.strokeThickness,\n };\n }\n\n private get strokeDrawPositions() {\n const drawOffset = this.strokeThickness / 2;\n const strokeDrawPositions = {\n [DIVIDER_ORIENTATION_ENUM.HORIZONTAL]: { x1: drawOffset, x2: '100%', y1: drawOffset, y2: drawOffset },\n [DIVIDER_ORIENTATION_ENUM.VERTICAL]: { x1: drawOffset, x2: drawOffset, y1: drawOffset, y2: '100%' },\n };\n const orientationMap = new Map(Object.entries(strokeDrawPositions));\n\n return orientationMap.get(this.orientation);\n }\n\n private get strokeDasharray() {\n return `${this.strokeDashWidth}, ${this.strokeDashGap}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const styles = {\n ...(this.strokeColor && { '--bq-divider--stroke-color': getColorCSSVariable(this.strokeColor) }),\n ...(this.strokeThickness && { '--bq-divider--stroke-thickness': `${this.strokeThickness}px` }),\n ...(!isNil(this.strokeBasis) && { '--bq-divider--stroke-basis': `${this.strokeBasis}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n class={{\n 'bq-divider': true,\n [`bq-divider--${this.orientation}`]: true,\n [`bq-divider--title__${this.titleAlignment}`]: true,\n 'gap-0': !this.hasTitle,\n }}\n part=\"base\"\n ref={(div) => {\n this.titleElem = div;\n }}\n >\n <svg\n aria-hidden=\"true\"\n class={{\n 'bq-divider--stroke start': true,\n '!hidden': this.strokeBasis === 0 && this.titleAlignment === 'start',\n }}\n part=\"dash-start\"\n >\n <line {...this.strokeAttributes} part=\"dash-start-line\" />\n </svg>\n <slot onSlotchange={this.handleSlotChange} />\n <svg\n aria-hidden=\"true\"\n class={{\n 'bq-divider--stroke end': true,\n '!hidden': !this.hasTitle || (this.strokeBasis === 0 && this.titleAlignment === 'end'),\n }}\n part=\"dash-end\"\n >\n <line {...this.strokeAttributes} part=\"dash-end-line\" />\n </svg>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-divider.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/divider/bq-divider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnH,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,MAAM,OAAO,SAAS;IACpB,iBAAiB;IACjB,uBAAuB;IAEf,SAAS,CAAiB;IAElC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAwB;IAErC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAEzB,QAAQ,CAAU;IAEnC,sBAAsB;IACtB,2BAA2B;IAE3B,gDAAgD;IACxC,MAAM,GAAG,KAAK,CAAC;IAEvB,6CAA6C;IACpB,WAAW,GAAwB,YAAY,CAAC;IAEzE,kGAAkG;IACzE,WAAW,GAAY,iBAAiB,CAAC;IAElE,6FAA6F;IACpE,cAAc,GAA4B,QAAQ,CAAC;IAE5E,uGAAuG;IAC9E,eAAe,GAAY,EAAE,CAAC;IAEvD,wFAAwF;IAC/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, h, Prop, State, Watch } from '@stencil/core';\n\nimport { getColorCSSVariable, getTextContent, hasSlotContent, isNil, validatePropValue } from '../../shared/utils';\nimport type { TDividerOrientation, TDividerStrokeLinecap, TDividerTitleAlignment } from './bq-divider.types';\nimport {\n DIVIDER_ORIENTATION,\n DIVIDER_ORIENTATION_ENUM,\n DIVIDER_STROKE_LINECAP,\n DIVIDER_TITLE_ALIGNMENT,\n} from './bq-divider.types';\n\n/**\n * The Divider component is used to visually separate content in a layout.\n *\n * @example How to use it\n * ```html\n * <bq-divider orientation=\"horizontal\" stroke-color=\"stroke--primary\" title-alignment=\"middle\">\n * <span slot=\"title\">Divider Title</span>\n * </bq-divider>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/53dfe6-divider\n * @status stable\n *\n * @attr {boolean} dashed - If true, the divider has a dashed pattern.\n * @attr {\"horizontal\" | \"vertical\"} orientation - The default orientation of the divider.\n * @attr {string} stroke-color - Set the stroke color of the divider. The value should be a valid value of the palette color.\n * @attr {\"start\" | \"middle\" | \"end\"} title-alignment - Set the alignment of the title on the main axis of the divider (horizontal / vertical).\n * @attr {number} stroke-dash-width - Set the width of each dash of the divider's stroke. This is applicable when the stroke is dashed.\n * @attr {number} stroke-dash-gap - Set the gap of the divider's stroke. This is applicable when the stroke is dashed.\n * @attr {number} stroke-thickness - Set the thickness of the divider's stroke. Value expressed in px.\n * @attr {number} stroke-basis - Set the min width of the divider's stroke when text is not centered. Value expressed in px.\n * @attr {\"square\" | \"round\" | \"butt\"} stroke-linecap - Set the line of the divider's stroke. This is applicable when the stroke is dashed.\n *\n * @slot - The title content of the divider.\n *\n * @part base - The component's internal wrapper.\n * @part dash-start - The component's internal svg wrapper for the start line of the divider's stroke.\n * @part dash-end - The component's internal svg wrapper for the end line of the divider's stroke.\n * @part dash-start-line - The component's internal line component of the divider's stroke.\n * @part dash-end-line - The component's internal line component of the divider's stroke.\n *\n * @cssprop --bq-divider--color - Divider color\n * @cssprop --bq-divider--title-marginX - Divider space between title and delimiters\n */\n@Component({\n tag: 'bq-divider',\n styleUrl: './scss/bq-divider.scss',\n shadow: true,\n})\nexport class BqDivider {\n // Own Properties\n // ====================\n\n private titleElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDividerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasTitle: boolean;\n\n // Public Property API\n // ========================\n\n /** If true, the divider has a dashed pattern */\n @Prop() dashed = false;\n\n /** The default orientation of the divider */\n @Prop({ reflect: true }) orientation: TDividerOrientation = 'horizontal';\n\n /** Set the stroke color of the divider. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) strokeColor?: string = 'stroke--primary';\n\n /** Set the alignment of the title on the main axis of the divider (horizontal / vertical) */\n @Prop({ reflect: true }) titleAlignment?: TDividerTitleAlignment = 'middle';\n\n /** Set the width of each dash of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeDashWidth?: number = 12;\n\n /** Set the gap of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeDashGap?: number = 7;\n\n /** Set the thickness of the divider's stroke. Value expressed in px*/\n @Prop({ reflect: true }) strokeThickness?: number = 1;\n\n /** Set the min width of the divider's stroke when text is not centered. Value expressed in px */\n @Prop({ reflect: true }) strokeBasis?: number = 0;\n\n /** Set the line of the divider's stroke. This is applicable when the stroke is dashed */\n @Prop({ reflect: true }) strokeLinecap?: TDividerStrokeLinecap = 'butt';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('orientation')\n @Watch('titleAlignment')\n @Watch('strokeLinecap')\n checkPropValues() {\n validatePropValue(DIVIDER_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(DIVIDER_TITLE_ALIGNMENT, 'middle', this.el, 'titleAlignment');\n validatePropValue(DIVIDER_STROKE_LINECAP, 'butt', this.el, 'strokeLinecap');\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 connectedCallback() {\n this.checkPropValues();\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.hasTitle = hasSlotContent(this.titleElem) || !!getTextContent(this.titleElem.querySelector('slot'));\n };\n\n private get strokeAttributes() {\n return {\n ...this.strokeDrawPositions,\n ...(this.dashed && { 'stroke-dasharray': this.strokeDasharray }),\n 'stroke-linecap': this.strokeLinecap,\n 'stroke-width': this.strokeThickness,\n };\n }\n\n private get strokeDrawPositions() {\n const drawOffset = this.strokeThickness / 2;\n const strokeDrawPositions = {\n [DIVIDER_ORIENTATION_ENUM.HORIZONTAL]: { x1: drawOffset, x2: '100%', y1: drawOffset, y2: drawOffset },\n [DIVIDER_ORIENTATION_ENUM.VERTICAL]: { x1: drawOffset, x2: drawOffset, y1: drawOffset, y2: '100%' },\n };\n const orientationMap = new Map(Object.entries(strokeDrawPositions));\n\n return orientationMap.get(this.orientation);\n }\n\n private get strokeDasharray() {\n return `${this.strokeDashWidth}, ${this.strokeDashGap}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const styles = {\n ...(this.strokeColor && { '--bq-divider--stroke-color': getColorCSSVariable(this.strokeColor) }),\n ...(this.strokeThickness && { '--bq-divider--stroke-thickness': `${this.strokeThickness}px` }),\n ...(!isNil(this.strokeBasis) && { '--bq-divider--stroke-basis': `${this.strokeBasis}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n class={{\n 'bq-divider': true,\n [`bq-divider--${this.orientation}`]: true,\n [`bq-divider--title__${this.titleAlignment}`]: true,\n 'gap-0': !this.hasTitle,\n }}\n part=\"base\"\n ref={(div) => {\n this.titleElem = div;\n }}\n >\n <svg\n aria-hidden=\"true\"\n class={{\n 'bq-divider--stroke start': true,\n '!hidden': this.strokeBasis === 0 && this.titleAlignment === 'start',\n }}\n part=\"dash-start\"\n >\n <line {...this.strokeAttributes} part=\"dash-start-line\" />\n </svg>\n <slot onSlotchange={this.handleSlotChange} />\n <svg\n aria-hidden=\"true\"\n class={{\n 'bq-divider--stroke end': true,\n '!hidden': !this.hasTitle || (this.strokeBasis === 0 && this.titleAlignment === 'end'),\n }}\n part=\"dash-end\"\n >\n <line {...this.strokeAttributes} part=\"dash-end-line\" />\n </svg>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { Host } from "@stencil/core";
|
|
5
|
+
import { Host, h } from "@stencil/core";
|
|
7
6
|
import { enter, hasSlotContent, isNil, leave, validatePropValue } from "../../shared/utils";
|
|
8
7
|
import { DRAWER_PLACEMENT, DRAWER_POSITIONS } from "./bq-drawer.types";
|
|
9
8
|
/**
|
|
@@ -236,24 +235,24 @@ export class BqDrawer {
|
|
|
236
235
|
// Always the last one in the class.
|
|
237
236
|
// ===================================
|
|
238
237
|
render() {
|
|
239
|
-
return (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
238
|
+
return (h(Host, { key: 'efb946ee8385eb53479a2775b0374a0545d19e2d' }, this.enableBackdrop && (h("div", { key: 'b3afc7c855f826110f59af39118ec0677f1d878b', class: {
|
|
239
|
+
'fixed inset-0 block bg-[--bq-drawer--backgroundBackdrop] opacity-0 transition-opacity duration-300': true,
|
|
240
|
+
'pointer-events-none': !this.open,
|
|
241
|
+
'opacity-60': this.open,
|
|
242
|
+
}, part: "backdrop", tabIndex: -1 })), h("div", { key: 'c86c49c074fd1e7d59de8d8df33fe43504fcb169', "aria-hidden": !this.open ? 'true' : 'false', "aria-labelledby": "bq-drawer__title", "aria-modal": "true", class: {
|
|
243
|
+
[`bq-drawer transition-all duration-300 ease-in-out ${this.position || this.placement}`]: true,
|
|
244
|
+
'-start-[--bq-drawer--width]': this.isPositionStart,
|
|
245
|
+
'-end-[--bq-drawer--width]': this.isPositionEnd,
|
|
246
|
+
'start-0': this.open && this.isPositionStart,
|
|
247
|
+
'end-0': this.open && this.isPositionEnd,
|
|
248
|
+
}, hidden: !this.open, part: "panel", ref: (div) => {
|
|
249
|
+
this.drawerElem = div;
|
|
250
|
+
}, role: "dialog" }, h("header", { key: '6cd1d9ce70d4cb30d6524af6dd366e989e676c62', class: "flex items-center", part: "header" }, h("h2", { key: '3212557ad0649414eb332e187acd52c96efbd835', class: "flex-1 items-center justify-between font-bold text-primary text-xl leading-regular", id: "bq-drawer__title", part: "title" }, h("slot", { key: '6aebb931e8cea3ede8dde98c66ebf9a275d1cb66', name: "title" })), h("div", { key: 'd68cac1a5bc9d7e7d4b4c885003630baae96c46e', class: "flex", part: "button-close" }, h("bq-button", { key: '2d9ece0738afc94ac2b93e315fd814e9c5112930', appearance: "text", border: "s", class: "[&::part(label)]:inline-flex", exportparts: "button:button-close__btn,label:button-close__label", label: "Close", onBqClick: () => this.hide(), onlyIcon: true, size: "small", slot: "button-close" }, h("slot", { key: '9f8cef6896ce38cacf0b2035dda22bfa92d61f10', name: "button-close" }, h("bq-icon", { key: '173869695225aae3e1b17c3ad5bdf96902f85d8e', "aria-hidden": "true", name: "x-bold", title: "Close" }))))), h("main", { key: '671bf595a03619ab1ace8262cf636d1b20728897', class: "block flex-auto overflow-auto", part: "body" }, h("slot", { key: 'e3f41064ea0b690df0da286cf22e6ce6c8c0fae5' })), h("footer", { key: 'efad25f94af91333beacf50450f74e25a4719505', class: {
|
|
251
|
+
block: true,
|
|
252
|
+
'!hidden': !this.hasFooter,
|
|
253
|
+
}, part: "footer", ref: (footerElem) => {
|
|
254
|
+
this.footerElem = footerElem;
|
|
255
|
+
} }, h("slot", { key: 'fc2440d2e8bb7ef396ec8757ef4a9a53c2f2059e', name: "footer-divider" }, h("bq-divider", { key: '5f8e1a591997cb7fa07a34ce7cc3bfd087d9c2cf', class: "mb-m block", dashed: true })), h("slot", { key: '98ed77fe6ad40a1c6e9082e3f661a7d9aaa24e54', name: "footer", onSlotchange: this.handleFooterSlotChange })))));
|
|
257
256
|
}
|
|
258
257
|
static get is() { return "bq-drawer"; }
|
|
259
258
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-drawer.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/drawer/bq-drawer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpG,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAMH,MAAM,OAAO,QAAQ;IACnB,iBAAiB;IACjB,uBAAuB;IAEf,UAAU,CAAc;IACxB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IAAI,CAAC,SAAS;6BAC3B,EACD,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;gCAClB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;4BAC/B,CAAC,aAED,eAAM,IAAI,EAAC,gBAAgB,YACzB,qBAAY,KAAK,EAAC,YAAY,EAAC,MAAM,qDAAG,+CACnC,EACP,eAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,+CAAI,gDAC1D,gDACL,gDACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Element, Event, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { enter, hasSlotContent, isNil, leave, validatePropValue } from '../../shared/utils';\nimport type { TDrawerPlacement, TDrawerPosition } from './bq-drawer.types';\nimport { DRAWER_PLACEMENT, DRAWER_POSITIONS } from './bq-drawer.types';\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 part=\"backdrop\"\n tabIndex={-1}\n />\n )}\n {/* DRAWER PANEL */}\n <div\n aria-hidden={!this.open ? 'true' : 'false'}\n aria-labelledby=\"bq-drawer__title\"\n aria-modal=\"true\"\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 hidden={!this.open}\n part=\"panel\"\n ref={(div) => {\n this.drawerElem = div;\n }}\n role=\"dialog\"\n >\n <header class=\"flex items-center\" part=\"header\">\n <h2\n class=\"flex-1 items-center justify-between font-bold text-primary text-xl leading-regular\"\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 appearance=\"text\"\n border=\"s\"\n class=\"[&::part(label)]:inline-flex\"\n exportparts=\"button:button-close__btn,label:button-close__label\"\n label=\"Close\"\n onBqClick={() => this.hide()}\n onlyIcon\n size=\"small\"\n slot=\"button-close\"\n >\n <slot name=\"button-close\">\n <bq-icon aria-hidden=\"true\" name=\"x-bold\" 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 part=\"footer\"\n ref={(footerElem) => {\n this.footerElem = footerElem;\n }}\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"]}
|
|
1
|
+
{"version":3,"file":"bq-drawer.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/drawer/bq-drawer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAMH,MAAM,OAAO,QAAQ;IACnB,iBAAiB;IACjB,uBAAuB;IAEf,UAAU,CAAc;IACxB,UAAU,CAAiB;IAC3B,cAAc,GAAG,iBAAiB,CAAC;IAE3C,iCAAiC;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GAAG,EAAE,CAAC,UAAU,EAAE,EAAE;wBAClB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;oBAC/B,CAAC;oBAED,6DAAM,IAAI,EAAC,gBAAgB;wBACzB,mEAAY,KAAK,EAAC,YAAY,EAAC,MAAM,SAAG,CACnC;oBACP,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,GAAI,CAC1D,CACL,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Element, Event, Host, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { enter, hasSlotContent, isNil, leave, validatePropValue } from '../../shared/utils';\nimport type { TDrawerPlacement, TDrawerPosition } from './bq-drawer.types';\nimport { DRAWER_PLACEMENT, DRAWER_POSITIONS } from './bq-drawer.types';\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 part=\"backdrop\"\n tabIndex={-1}\n />\n )}\n {/* DRAWER PANEL */}\n <div\n aria-hidden={!this.open ? 'true' : 'false'}\n aria-labelledby=\"bq-drawer__title\"\n aria-modal=\"true\"\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 hidden={!this.open}\n part=\"panel\"\n ref={(div) => {\n this.drawerElem = div;\n }}\n role=\"dialog\"\n >\n <header class=\"flex items-center\" part=\"header\">\n <h2\n class=\"flex-1 items-center justify-between font-bold text-primary text-xl leading-regular\"\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 appearance=\"text\"\n border=\"s\"\n class=\"[&::part(label)]:inline-flex\"\n exportparts=\"button:button-close__btn,label:button-close__label\"\n label=\"Close\"\n onBqClick={() => this.hide()}\n onlyIcon\n size=\"small\"\n slot=\"button-close\"\n >\n <slot name=\"button-close\">\n <bq-icon aria-hidden=\"true\" name=\"x-bold\" 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 part=\"footer\"\n ref={(footerElem) => {\n this.footerElem = footerElem;\n }}\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"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { h } from "@stencil/core";
|
|
6
6
|
import { isEventTargetChildOfElement } from "../../shared/utils";
|
|
7
7
|
let id = 0;
|
|
8
8
|
/**
|
|
@@ -179,7 +179,7 @@ export class BqDropdown {
|
|
|
179
179
|
const style = {
|
|
180
180
|
...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),
|
|
181
181
|
};
|
|
182
|
-
return (
|
|
182
|
+
return (h("div", { key: 'ae583f26db0f5dd9ed8a9b1bad4700fa1f43d64d', class: "bq-dropdown", part: "base" }, h("div", { key: '5ed63cafc2149a554cf19f448b84f74b7e90ad4e', "aria-controls": this.dropdownPanelId, "aria-haspopup": "true", class: "bq-dropdown__trigger block", part: "trigger" }, h("slot", { key: '4a0c6d8df5b8ea1be06db2b95f30603348b6d86a', name: "trigger" })), h("bq-panel", { key: '863be4b92b73f3769edcabee007c622270074cb1', class: "bq-dropdown__panel", disableScrollLock: this.disableScrollLock, distance: this.distance, exportparts: "panel", id: this.dropdownPanelId, open: this.open, part: "dropdown", placement: this.placement, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, style: style }, h("slot", { key: '94c1d32fbb1f0e19bce48851443e52c5471a09ed' }))));
|
|
183
183
|
}
|
|
184
184
|
static get is() { return "bq-dropdown"; }
|
|
185
185
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-dropdown.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/dropdown/bq-dropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAMH,MAAM,OAAO,UAAU;IACrB,iBAAiB;IACjB,uBAAuB;IAEf,eAAe,GAAG,qBAAqB,EAAE,EAAE,EAAE,CAAC;IAC9C,WAAW,CAAc;IAEjC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAyB;IAEtC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAE1C,sBAAsB;IACtB,2BAA2B;IAE3B,gFAAgF;IACvD,iBAAiB,GAAa,KAAK,CAAC;IAE7D,sEAAsE;IAC7C,QAAQ,GAAa,KAAK,CAAC;IAEpD,4FAA4F;IACnE,QAAQ,GAAY,CAAC,CAAC;IAE/C,qEAAqE;IAC5C,gBAAgB,GAAa,KAAK,CAAC;IAE5D,4BAA4B;IACH,SAAS,GAAe,cAAc,CAAC;IAEhE,0CAA0C;IACF,IAAI,GAAa,KAAK,CAAC;IAE/D,kEAAkE;IACzC,WAAW,CAAU;IAE9C,0EAA0E;IACjD,SAAS,GAAa,KAAK,C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CAAC;QAEF,OAAO,CACL,eAAK,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,MAAM,aAElC,+BACiB,IAAI,CAAC,eAAe,mBACrB,MAAM,EACpB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,SAAS,YAEd,eAAM,IAAI,EAAC,SAAS,+CAAG,+CACnB,EAEN,mBACE,KAAK,EAAC,oBAAoB,EAC1B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAC,OAAO,EACnB,EAAE,EAAE,IAAI,CAAC,eAAe,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,KAAK,YAEZ,4DAAQ,+CACC,gDACP,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Element, Event, Listen, Prop, Watch } 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.triggerElem?.addEventListener('click', this.togglePanel);\n\n this.handleDisabledChange();\n }\n\n disconnectedCallback() {\n this.triggerElem?.removeEventListener('click', this.togglePanel);\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 const isDisabled = this.disabled || this.triggerElem?.hasAttribute('disabled');\n if (isDisabled) 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 aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n class=\"bq-dropdown__trigger block\"\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n class=\"bq-dropdown__panel\"\n disableScrollLock={this.disableScrollLock}\n distance={this.distance}\n exportparts=\"panel\"\n id={this.dropdownPanelId}\n open={this.open}\n part=\"dropdown\"\n placement={this.placement}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n style={style}\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-dropdown.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/dropdown/bq-dropdown.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGlF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAMH,MAAM,OAAO,UAAU;IACrB,iBAAiB;IACjB,uBAAuB;IAEf,eAAe,GAAG,qBAAqB,EAAE,EAAE,EAAE,CAAC;IAC9C,WAAW,CAAc;IAEjC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAyB;IAEtC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAE1C,sBAAsB;IACtB,2BAA2B;IAE3B,gFAAgF;IACvD,iBAAiB,GAAa,KAAK,CAAC;IAE7D,sEA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Element, Event, h, Listen, Prop, Watch } 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.triggerElem?.addEventListener('click', this.togglePanel);\n\n this.handleDisabledChange();\n }\n\n disconnectedCallback() {\n this.triggerElem?.removeEventListener('click', this.togglePanel);\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 const isDisabled = this.disabled || this.triggerElem?.hasAttribute('disabled');\n if (isDisabled) 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 aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n class=\"bq-dropdown__trigger block\"\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n class=\"bq-dropdown__panel\"\n disableScrollLock={this.disableScrollLock}\n distance={this.distance}\n exportparts=\"panel\"\n id={this.dropdownPanelId}\n open={this.open}\n part=\"dropdown\"\n placement={this.placement}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n style={style}\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { h } from "@stencil/core";
|
|
6
6
|
import { hasSlotContent, validatePropValue } from "../../shared/utils";
|
|
7
7
|
import { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP } from "./bq-empty-state.types";
|
|
8
8
|
/**
|
|
@@ -88,31 +88,31 @@ export class BqEmptyState {
|
|
|
88
88
|
// Always the last one in the class.
|
|
89
89
|
// ===================================
|
|
90
90
|
render() {
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
return (h("div", { key: 'ca9753f87f3aa64c300215b3e1400810ff93cb02', class: "inline-flex flex-col items-center", part: "wrapper" }, h("div", { key: '3a9b44d9d90bbd909e22a2cac0ce5437caefe7c4', class: {
|
|
92
|
+
'm-be-m': this.size === 'small',
|
|
93
|
+
'm-be-xl': this.size === 'medium',
|
|
94
|
+
'm-be-xxl': this.size === 'large',
|
|
95
|
+
}, part: "thumbnail" }, h("slot", { key: '643c89912ebd98e4690c603d9dea6e158bf5b20d', name: "thumbnail" }, h("bq-icon", { key: 'e60ce04ea42f7c5167c1c44bf0c496c1846f40b1', exportparts: "base,svg", name: "database", part: "icon", size: this.iconSize }))), h("div", { key: 'a939eee07a7076849ac0619c8198bbc55e60c2c8', class: {
|
|
96
|
+
'font-bold text-primary leading-regular': true,
|
|
97
|
+
'text-m': this.size === 'small',
|
|
98
|
+
'text-l': this.size === 'medium',
|
|
99
|
+
'text-xxl2': this.size === 'large',
|
|
100
|
+
'm-be-xs': this.size === 'small' && this.hasBody,
|
|
101
|
+
'm-be-m': this.size === 'medium' && this.hasBody,
|
|
102
|
+
'm-be-l': this.size === 'large' && this.hasBody,
|
|
103
|
+
}, part: "title" }, h("slot", { key: '34f897969f846ae3fc962e45201f719551fab812' })), h("div", { key: 'a20024b1c429b05e4d69afff8f86d00d67a330c4', class: {
|
|
104
|
+
'font-normal leading-regular': true,
|
|
105
|
+
'text-s': this.size === 'small',
|
|
106
|
+
'text-m': this.size === 'medium',
|
|
107
|
+
'text-l': this.size === 'large',
|
|
108
|
+
'm-be-m': this.size === 'small' && this.hasFooter,
|
|
109
|
+
'm-be-l': this.size === 'medium' && this.hasFooter,
|
|
110
|
+
'm-be-xl': this.size === 'large' && this.hasFooter,
|
|
111
|
+
}, part: "body", ref: (div) => {
|
|
112
|
+
this.bodyElem = div;
|
|
113
|
+
} }, h("slot", { key: 'bce4e2e9ed40496b40352395ffa4c746ca3dc640', name: "body", onSlotchange: this.handleSlotChange })), h("div", { key: '782ad1f922b120301ba25cd5e303bdc8d01ca0a5', class: "flex items-start gap-xs", part: "footer", ref: (div) => {
|
|
114
|
+
this.footerElem = div;
|
|
115
|
+
} }, h("slot", { key: '989ee75a06b199dc997f93f3828e0aa9699028a9', name: "footer", onSlotchange: this.handleSlotChange }))));
|
|
116
116
|
}
|
|
117
117
|
static get is() { return "bq-empty-state"; }
|
|
118
118
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-empty-state.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/empty-state/bq-empty-state.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bq-empty-state.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/empty-state/bq-empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,MAAM,OAAO,YAAY;IACvB,iBAAiB;IACjB,uBAAuB;IAEf,QAAQ,CAAiB;IACzB,UAAU,CAAiB;IAEnC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAA2B;IAExC,oBAAoB;IACpB,wCAAwC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X,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;oBACX,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;gBACtB,CAAC;gBAED,6DAAM,IAAI,EAAC,MAAM,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACrD;YACN,4DACE,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;oBACX,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;gBACxB,CAAC;gBAED,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACvD,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\nimport type { TEmptyStateSize } from './bq-empty-state.types';\nimport { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP } from './bq-empty-state.types';\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 exportparts=\"base,svg\" name=\"database\" part=\"icon\" size={this.iconSize} />\n </slot>\n </div>\n <div\n class={{\n 'font-bold text-primary leading-regular': 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 part=\"body\"\n ref={(div) => {\n this.bodyElem = div;\n }}\n >\n <slot name=\"body\" onSlotchange={this.handleSlotChange} />\n </div>\n <div\n class=\"flex items-start gap-xs\"\n part=\"footer\"\n ref={(div) => {\n this.footerElem = div;\n }}\n >\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { Host } from "@stencil/core";
|
|
5
|
+
import { Host, h } from "@stencil/core";
|
|
7
6
|
import { getBasePath, getColorCSSVariable, isNil } from "../../shared/utils";
|
|
8
7
|
import { getSvgContent } from "./helper/request";
|
|
9
8
|
/**
|
|
@@ -147,7 +146,7 @@ export class BqIcon {
|
|
|
147
146
|
...(color && { '--bq-icon--color': getColorCSSVariable(color) }),
|
|
148
147
|
...(size && { '--bq-icon--size': `${size}px` }),
|
|
149
148
|
};
|
|
150
|
-
return (
|
|
149
|
+
return (h(Host, { key: '7d609e95807e9a4cd6be72e467b674ac9a0fef24', style: styles }, h("div", { key: '95452929fe794238458d65447e2b57c39e67c4cf', "aria-label": label ?? `${name} icon`, class: "bs-[--bq-icon--size] is-[--bq-icon--size] flex text-[--bq-icon--color]", innerHTML: this.svgContent, part: "base", role: "img" })));
|
|
151
150
|
}
|
|
152
151
|
static get is() { return "bq-icon"; }
|
|
153
152
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-icon.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/icon/bq-icon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,MAAM,OAAO,MAAM;IACjB,iBAAiB;IACjB,uBAAuB;IAEvB,iCAAiC;IACjC,sCAAsC;IAEtC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAEzB,UAAU,CAAS;IAEpC,sBAAsB;IACtB,2BAA2B;IAE3B,iDAAiD;IACxB,KAAK,CAAU;IAExC,8FAA8F;IACrE,KAAK,CAAU;IAExC,6FAA6F;IACpE,IAAI,CAAU;IAEvC,8BAA8B;IACL,IAAI,GAAqB,EAAE,CAAC;IAErD,yFAAyF;IAChE,GAAG,CAAU;IAEtC,+CAA+C;IACtB,MAAM,GAAiB,SAAS,CAAC;IAE1D,wBAAwB;IACxB,0BAA0B;IAK1B,iBAAiB;QACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEH,kBAAkB;QAChB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE,OAAO;QAE5C,OAAO,CAAC,IAAI,CACV;sHACgH,CACjH,CAAC;QACF,4HAA4H;QAC5H,wFAAwF;QACxF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EAC9E,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,KAAK,+CACV,+CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Event, Host, Prop, State, Watch } from '@stencil/core';\n\nimport { getBasePath, getColorCSSVariable, isNil } from '../../shared/utils';\nimport type { TIconWeight } from './bq-icon.types';\nimport { getSvgContent } from './helper/request';\n\n/**\n * The Icon component is an image that provides a visual representation of an object, action, or concept displayed on the screen.\n * It is a small graphical element that is used to enhance the user interface and improve user experience.\n *\n * @example How to use it\n * ```html\n * <bq-icon color=\"text--brand\" name=\"bell-ringing\" size=\"24\"></bq-icon>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/675fad-icon\n * @status stable\n *\n * @attr {string} color - Set the stroke color of the SVG. The value should be a valid value of the palette color.\n * @attr {string} label - Label for the icon, used for accessibility.\n * @attr {string} name - Icon name to load. Please check all available icons [here](https://phosphoricons.com/).\n * @attr {string | number} size - Set the size of the SVG.\n * @attr {string} src - Set the source of the SVG. If the source is set, the name property will be ignored.\n *\n * @event svgLoaded - Callback handler to be called when the SVG has loaded.\n *\n * @part base - The component's internal wrapper that holds the icon SVG content.\n * @part svg - The `<svg>` tag element inside the component.\n *\n * @cssprop --bq-icon--color - The stroke color of the SVG.\n * @cssprop --bq-icon--size - The size of the SVG.\n */\n@Component({\n assetsDirs: ['svg'],\n tag: 'bq-icon',\n styleUrl: './scss/bq-icon.scss',\n shadow: true,\n})\nexport class BqIcon {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private svgContent: string;\n\n // Public Property API\n // ========================\n\n /** Label for the icon, used for accessibility */\n @Prop({ reflect: true }) label?: string;\n\n /** Set the stroke color of the SVG. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) color?: string;\n\n /** Icon name to load. Please check all available icons [here](https://phosphoricons.com/) */\n @Prop({ reflect: true }) name?: string;\n\n /** Set the size of the SVG */\n @Prop({ reflect: true }) size?: string | number = 24;\n\n /** Set the source of the SVG. If the source is set, the name property will be ignored */\n @Prop({ reflect: true }) src?: string;\n\n /** @deprecated It set the icon weight/style */\n @Prop({ reflect: true }) weight?: TIconWeight = undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('color')\n @Watch('name')\n @Watch('size')\n handlePropsChange() {\n this.loadIcon(this.name);\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `weight` property is removed\n * We need to maintain retro-compatibility until the next major release\n */\n @Watch('weight')\n handleWeightChange() {\n if (this.name.includes(this.weight)) return;\n\n console.warn(\n `❗️ [bq-icon]: the 'weight' property is deprecated, you should add the weight to the icon name.\\n\n For example, '<bq-icon name=\"bell-fill\"></bq-icon>' instead of '<bq-icon name=\"bell\" weight=\"fill\"></bq-icon>'`,\n );\n // Check if the icon is weighted. An icon is considered weighted if its weight is not 'regular' and ENV_SVG_PATH is not set.\n // Eg: if the weight is 'bold' and ENV_SVG_PATH is not set, isWeightedIcon will be true.\n const REGULAR = 'regular';\n const isWeightedIcon = !isNil(this.weight) && this.weight !== REGULAR;\n // If the icon is weighted, append the weight to the icon name. Otherwise, append nothing.\n // Eg: if isWeightedIcon is true and the weight is 'bold', weightSuffix will be '-bold'.\n const weightSuffix = isWeightedIcon ? `-${this.weight}` : '';\n // Construct the icon name by appending the weight suffix (if any) and the file extension.\n // Eg: if the name is 'my-icon' and weightSuffix is '-bold', iconName will be 'my-icon-bold.svg'.\n const iconName = `${this.name}${weightSuffix}`;\n this.loadIcon(iconName);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the SVG has loaded */\n @Event() svgLoaded: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.setupIconComponent();\n }\n\n componentWillLoad() {\n this.setupIconComponent();\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 setupIconComponent = () => {\n this.loadIcon(this.name);\n // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed\n if (!isNil(this.weight)) this.handleWeightChange();\n };\n\n private getIconSource = (name: string) => {\n if (!this.name && !this.src) return undefined;\n // Return the src if it is set\n if (this.src) return this.src;\n\n const SVG_EXTENSION = '.svg';\n const iconFileName = `${name}${SVG_EXTENSION}`;\n\n return getBasePath(iconFileName);\n };\n\n private loadIcon = async (name: string) => {\n const url = this.getIconSource(name);\n if (!url) return;\n\n try {\n const content = await getSvgContent(url, true);\n if (!content) return;\n\n this.svgContent = content;\n this.svgLoaded.emit(this.svgContent);\n } catch (error) {\n console.error('[BEEQ] Failed to load the icon SVG content', error);\n }\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const { color, label, name, size } = this;\n const styles = {\n ...(color && { '--bq-icon--color': getColorCSSVariable(color) }),\n ...(size && { '--bq-icon--size': `${size}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n aria-label={label ?? `${name} icon`}\n class=\"bs-[--bq-icon--size] is-[--bq-icon--size] flex text-[--bq-icon--color]\"\n innerHTML={this.svgContent}\n part=\"base\"\n role=\"img\"\n />\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-icon.js","sourceRoot":"","sources":["../../../../../../packages/beeq/src/components/icon/bq-icon.tsx"],"names":[],"mappings":"AACA,OAAO,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { EventEmitter } from '@stencil/core';\nimport { Component, Event, Host, h, Prop, State, Watch } from '@stencil/core';\n\nimport { getBasePath, getColorCSSVariable, isNil } from '../../shared/utils';\nimport type { TIconWeight } from './bq-icon.types';\nimport { getSvgContent } from './helper/request';\n\n/**\n * The Icon component is an image that provides a visual representation of an object, action, or concept displayed on the screen.\n * It is a small graphical element that is used to enhance the user interface and improve user experience.\n *\n * @example How to use it\n * ```html\n * <bq-icon color=\"text--brand\" name=\"bell-ringing\" size=\"24\"></bq-icon>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/675fad-icon\n * @status stable\n *\n * @attr {string} color - Set the stroke color of the SVG. The value should be a valid value of the palette color.\n * @attr {string} label - Label for the icon, used for accessibility.\n * @attr {string} name - Icon name to load. Please check all available icons [here](https://phosphoricons.com/).\n * @attr {string | number} size - Set the size of the SVG.\n * @attr {string} src - Set the source of the SVG. If the source is set, the name property will be ignored.\n *\n * @event svgLoaded - Callback handler to be called when the SVG has loaded.\n *\n * @part base - The component's internal wrapper that holds the icon SVG content.\n * @part svg - The `<svg>` tag element inside the component.\n *\n * @cssprop --bq-icon--color - The stroke color of the SVG.\n * @cssprop --bq-icon--size - The size of the SVG.\n */\n@Component({\n assetsDirs: ['svg'],\n tag: 'bq-icon',\n styleUrl: './scss/bq-icon.scss',\n shadow: true,\n})\nexport class BqIcon {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private svgContent: string;\n\n // Public Property API\n // ========================\n\n /** Label for the icon, used for accessibility */\n @Prop({ reflect: true }) label?: string;\n\n /** Set the stroke color of the SVG. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) color?: string;\n\n /** Icon name to load. Please check all available icons [here](https://phosphoricons.com/) */\n @Prop({ reflect: true }) name?: string;\n\n /** Set the size of the SVG */\n @Prop({ reflect: true }) size?: string | number = 24;\n\n /** Set the source of the SVG. If the source is set, the name property will be ignored */\n @Prop({ reflect: true }) src?: string;\n\n /** @deprecated It set the icon weight/style */\n @Prop({ reflect: true }) weight?: TIconWeight = undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('color')\n @Watch('name')\n @Watch('size')\n handlePropsChange() {\n this.loadIcon(this.name);\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `weight` property is removed\n * We need to maintain retro-compatibility until the next major release\n */\n @Watch('weight')\n handleWeightChange() {\n if (this.name.includes(this.weight)) return;\n\n console.warn(\n `❗️ [bq-icon]: the 'weight' property is deprecated, you should add the weight to the icon name.\\n\n For example, '<bq-icon name=\"bell-fill\"></bq-icon>' instead of '<bq-icon name=\"bell\" weight=\"fill\"></bq-icon>'`,\n );\n // Check if the icon is weighted. An icon is considered weighted if its weight is not 'regular' and ENV_SVG_PATH is not set.\n // Eg: if the weight is 'bold' and ENV_SVG_PATH is not set, isWeightedIcon will be true.\n const REGULAR = 'regular';\n const isWeightedIcon = !isNil(this.weight) && this.weight !== REGULAR;\n // If the icon is weighted, append the weight to the icon name. Otherwise, append nothing.\n // Eg: if isWeightedIcon is true and the weight is 'bold', weightSuffix will be '-bold'.\n const weightSuffix = isWeightedIcon ? `-${this.weight}` : '';\n // Construct the icon name by appending the weight suffix (if any) and the file extension.\n // Eg: if the name is 'my-icon' and weightSuffix is '-bold', iconName will be 'my-icon-bold.svg'.\n const iconName = `${this.name}${weightSuffix}`;\n this.loadIcon(iconName);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the SVG has loaded */\n @Event() svgLoaded: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.setupIconComponent();\n }\n\n componentWillLoad() {\n this.setupIconComponent();\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 setupIconComponent = () => {\n this.loadIcon(this.name);\n // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed\n if (!isNil(this.weight)) this.handleWeightChange();\n };\n\n private getIconSource = (name: string) => {\n if (!this.name && !this.src) return undefined;\n // Return the src if it is set\n if (this.src) return this.src;\n\n const SVG_EXTENSION = '.svg';\n const iconFileName = `${name}${SVG_EXTENSION}`;\n\n return getBasePath(iconFileName);\n };\n\n private loadIcon = async (name: string) => {\n const url = this.getIconSource(name);\n if (!url) return;\n\n try {\n const content = await getSvgContent(url, true);\n if (!content) return;\n\n this.svgContent = content;\n this.svgLoaded.emit(this.svgContent);\n } catch (error) {\n console.error('[BEEQ] Failed to load the icon SVG content', error);\n }\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const { color, label, name, size } = this;\n const styles = {\n ...(color && { '--bq-icon--color': getColorCSSVariable(color) }),\n ...(size && { '--bq-icon--size': `${size}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n aria-label={label ?? `${name} icon`}\n class=\"bs-[--bq-icon--size] is-[--bq-icon--size] flex text-[--bq-icon--color]\"\n innerHTML={this.svgContent}\n part=\"base\"\n role=\"img\"\n />\n </Host>\n );\n }\n}\n"]}
|