@beeq/core 1.8.0-beta.4 → 1.8.0-beta.6
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 -1
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +12 -12
- package/dist/beeq/{p-7ea146b8.entry.js → p-01fe8efb.entry.js} +1 -3
- package/dist/beeq/{p-7ea146b8.entry.js.map → p-01fe8efb.entry.js.map} +1 -1
- package/dist/beeq/{p-d9bcaeed.entry.js → p-03373320.entry.js} +1 -3
- package/dist/beeq/{p-d9bcaeed.entry.js.map → p-03373320.entry.js.map} +1 -1
- package/dist/beeq/{p-b877d662.entry.js → p-06faf55b.entry.js} +127 -84
- package/dist/beeq/p-06faf55b.entry.js.map +1 -0
- package/dist/beeq/{p-a94d15f9.entry.js → p-0a981080.entry.js} +1 -3
- package/dist/beeq/{p-a94d15f9.entry.js.map → p-0a981080.entry.js.map} +1 -1
- package/dist/beeq/{p-03e23dca.entry.js → p-0ce76c54.entry.js} +1 -3
- package/dist/beeq/{p-03e23dca.entry.js.map → p-0ce76c54.entry.js.map} +1 -1
- package/dist/beeq/{p-f5eb8fff.entry.js → p-2bb049ae.entry.js} +2 -4
- package/dist/beeq/{p-f5eb8fff.entry.js.map → p-2bb049ae.entry.js.map} +1 -1
- package/dist/beeq/{p-e06c8398.entry.js → p-2fe5f338.entry.js} +20 -22
- package/dist/beeq/p-2fe5f338.entry.js.map +1 -0
- package/dist/beeq/{p-8b6fc3ef.entry.js → p-3043c826.entry.js} +5 -7
- package/dist/beeq/{p-8b6fc3ef.entry.js.map → p-3043c826.entry.js.map} +1 -1
- package/dist/beeq/{p-fe57aa48.entry.js → p-38e70f78.entry.js} +1 -3
- package/dist/beeq/{p-fe57aa48.entry.js.map → p-38e70f78.entry.js.map} +1 -1
- package/dist/beeq/{p-818cd6d7.entry.js → p-398bfb48.entry.js} +1 -3
- package/dist/beeq/{p-818cd6d7.entry.js.map → p-398bfb48.entry.js.map} +1 -1
- package/dist/beeq/{p-27974392.entry.js → p-41ac1d84.entry.js} +2 -4
- package/dist/beeq/{p-27974392.entry.js.map → p-41ac1d84.entry.js.map} +1 -1
- package/dist/beeq/{p-908c57e9.entry.js → p-4eabcd51.entry.js} +1 -3
- package/dist/beeq/{p-908c57e9.entry.js.map → p-4eabcd51.entry.js.map} +1 -1
- package/dist/beeq/{p-f5d59aba.entry.js → p-5ff6621d.entry.js} +2 -4
- package/dist/beeq/{p-f5d59aba.entry.js.map → p-5ff6621d.entry.js.map} +1 -1
- package/dist/beeq/{p-3e3fd7b5.entry.js → p-60cbc966.entry.js} +1 -3
- package/dist/beeq/{p-3e3fd7b5.entry.js.map → p-60cbc966.entry.js.map} +1 -1
- package/dist/beeq/{p-98de0101.entry.js → p-68ff188d.entry.js} +1 -3
- package/dist/beeq/{p-98de0101.entry.js.map → p-68ff188d.entry.js.map} +1 -1
- package/dist/beeq/{p-7aa47927.entry.js → p-69c766a3.entry.js} +9 -11
- package/dist/beeq/p-69c766a3.entry.js.map +1 -0
- package/dist/beeq/{p-89665044.entry.js → p-76486949.entry.js} +2 -4
- package/dist/beeq/{p-89665044.entry.js.map → p-76486949.entry.js.map} +1 -1
- package/dist/beeq/{p-bb14b231.entry.js → p-8275d147.entry.js} +3 -5
- package/dist/beeq/{p-bb14b231.entry.js.map → p-8275d147.entry.js.map} +1 -1
- package/dist/beeq/{p-0fce4de9.js → p-83d6d9ad.js} +2 -4
- package/dist/beeq/{p-0fce4de9.js.map → p-83d6d9ad.js.map} +1 -1
- package/dist/beeq/{p-03749fbf.entry.js → p-8b16f130.entry.js} +1 -3
- package/dist/beeq/{p-03749fbf.entry.js.map → p-8b16f130.entry.js.map} +1 -1
- package/dist/beeq/p-8f1c68c0.js +71 -0
- package/dist/beeq/p-8f1c68c0.js.map +1 -0
- package/dist/beeq/{p-5d51cadd.entry.js → p-9cab14ee.entry.js} +1 -3
- package/dist/beeq/{p-5d51cadd.entry.js.map → p-9cab14ee.entry.js.map} +1 -1
- package/dist/beeq/{p-7695fc8d.entry.js → p-a23b23c4.entry.js} +1 -3
- package/dist/beeq/{p-7695fc8d.entry.js.map → p-a23b23c4.entry.js.map} +1 -1
- package/dist/beeq/{p-2b2d8b0c.entry.js → p-a608a4fb.entry.js} +2 -4
- package/dist/beeq/{p-2b2d8b0c.entry.js.map → p-a608a4fb.entry.js.map} +1 -1
- package/dist/beeq/{p-bc60faa1.entry.js → p-aacaaa35.entry.js} +1 -3
- package/dist/beeq/{p-bc60faa1.entry.js.map → p-aacaaa35.entry.js.map} +1 -1
- package/dist/beeq/{p-5d8d6717.entry.js → p-b77b52f2.entry.js} +2 -4
- package/dist/beeq/{p-5d8d6717.entry.js.map → p-b77b52f2.entry.js.map} +1 -1
- package/dist/beeq/{p-d2f682a9.entry.js → p-bbf4aad4.entry.js} +3 -5
- package/dist/beeq/{p-d2f682a9.entry.js.map → p-bbf4aad4.entry.js.map} +1 -1
- package/dist/beeq/{p-5fcbf15f.entry.js → p-c83bc7fd.entry.js} +10 -11
- package/dist/beeq/p-c83bc7fd.entry.js.map +1 -0
- package/dist/beeq/{p-e6911710.entry.js → p-cb2b0014.entry.js} +1 -3
- package/dist/beeq/{p-e6911710.entry.js.map → p-cb2b0014.entry.js.map} +1 -1
- package/dist/beeq/{p-60ab652b.entry.js → p-cfb8829b.entry.js} +1 -3
- package/dist/beeq/{p-60ab652b.entry.js.map → p-cfb8829b.entry.js.map} +1 -1
- package/dist/beeq/{p-3ed73068.entry.js → p-d7067dae.entry.js} +1 -3
- package/dist/beeq/{p-3ed73068.entry.js.map → p-d7067dae.entry.js.map} +1 -1
- package/dist/beeq/{p-f69d2900.entry.js → p-d7dc7086.entry.js} +1 -3
- package/dist/beeq/{p-f69d2900.entry.js.map → p-d7dc7086.entry.js.map} +1 -1
- package/dist/beeq/{p-d8f7bf11.entry.js → p-df9ce322.entry.js} +2 -4
- package/dist/beeq/{p-d8f7bf11.entry.js.map → p-df9ce322.entry.js.map} +1 -1
- package/dist/beeq/{p-5a9a73a0.js → p-edfd9767.js} +2 -2
- package/dist/beeq/p-edfd9767.js.map +1 -0
- package/dist/beeq/{p-ac0d84a6.entry.js → p-f979d79a.entry.js} +1 -3
- package/dist/beeq/{p-ac0d84a6.entry.js.map → p-f979d79a.entry.js.map} +1 -1
- package/dist/beeq/{p-5a12011a.entry.js → p-faa3be41.entry.js} +1 -3
- package/dist/beeq/{p-5a12011a.entry.js.map → p-faa3be41.entry.js.map} +1 -1
- package/dist/beeq/{p-cdd5b425.entry.js → p-fb809932.entry.js} +2 -4
- package/dist/beeq/{p-cdd5b425.entry.js.map → p-fb809932.entry.js.map} +1 -1
- package/dist/beeq/{p-be746e37.entry.js → p-fe278ecc.entry.js} +2 -4
- package/dist/beeq/{p-be746e37.entry.js.map → p-fe278ecc.entry.js.map} +1 -1
- package/dist/cjs/assetsPath-8bd8d221.js +77 -0
- package/dist/cjs/assetsPath-8bd8d221.js.map +1 -0
- package/dist/cjs/beeq.cjs.js +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +0 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +0 -1
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +1 -2
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +0 -1
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +1 -2
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +1 -2
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +0 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +100 -53
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +0 -1
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +0 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +2 -3
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +1 -2
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +1 -2
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +1 -2
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +0 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +1 -2
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +5 -6
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +1 -2
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +0 -1
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +0 -1
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +0 -1
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +0 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +2 -3
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +0 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +4 -4
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +0 -1
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +1 -2
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +0 -1
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +0 -1
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +0 -1
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +0 -1
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +0 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +0 -1
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +0 -1
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +3 -4
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/{cssVariables-a0e1e906.js → cssVariables-dd190bc2.js} +2 -2
- package/dist/cjs/cssVariables-dd190bc2.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{isDefined-ee0026ed.js → isDefined-f3968296.js} +1 -2
- package/dist/cjs/isDefined-f3968296.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/button/bq-button.js +41 -16
- package/dist/collection/components/button/bq-button.js.map +1 -1
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/icon/helper/request.js +50 -34
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/notification/bq-notification.js +4 -4
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/notification/scss/bq-notification.css +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +9 -3
- package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
- package/dist/collection/components/toast/bq-toast.js +3 -3
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/shared/utils/assetsPath.js +47 -35
- package/dist/collection/shared/utils/assetsPath.js.map +1 -1
- package/dist/collection/shared/utils/cssVariables.js +1 -1
- package/dist/collection/shared/utils/cssVariables.js.map +1 -1
- package/dist/components/bq-accordion-group.js +0 -1
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +0 -1
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +1 -2
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +0 -1
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge2.js +0 -1
- package/dist/components/bq-badge2.js.map +1 -1
- package/dist/components/bq-breadcrumb-item.js +0 -1
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +0 -1
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button2.js +42 -18
- package/dist/components/bq-button2.js.map +1 -1
- package/dist/components/bq-card.js +0 -1
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +0 -1
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -2
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -2
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider2.js +0 -1
- package/dist/components/bq-divider2.js.map +1 -1
- package/dist/components/bq-drawer.js +1 -2
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-empty-state.js +0 -1
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon2.js +118 -36
- package/dist/components/bq-icon2.js.map +1 -1
- package/dist/components/bq-input.js +0 -1
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +5 -6
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-list2.js +0 -1
- package/dist/components/bq-option-list2.js.map +1 -1
- package/dist/components/bq-option.js +0 -1
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +0 -1
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-progress.js +0 -1
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +0 -1
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-select.js +1 -2
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +0 -1
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +5 -4
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +0 -1
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +0 -1
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +0 -1
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +0 -1
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +0 -1
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +0 -1
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +0 -1
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +0 -1
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag2.js +0 -1
- package/dist/components/bq-tag2.js.map +1 -1
- package/dist/components/bq-textarea.js +0 -1
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +3 -4
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/cssVariables.js +1 -1
- package/dist/components/cssVariables.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/isDefined.js +0 -1
- package/dist/components/isDefined.js.map +1 -1
- package/dist/esm/assetsPath-beeee241.js +74 -0
- package/dist/esm/assetsPath-beeee241.js.map +1 -0
- package/dist/esm/beeq.js +1 -1
- package/dist/esm/bq-accordion-group.entry.js +0 -1
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +0 -1
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +1 -2
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +0 -1
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +1 -2
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +1 -2
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +0 -1
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +100 -53
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +0 -1
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +0 -1
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +2 -3
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +1 -2
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +1 -2
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +1 -2
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +0 -1
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +1 -2
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +5 -6
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +1 -2
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +0 -1
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +0 -1
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +0 -1
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +0 -1
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +2 -3
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +0 -1
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +4 -4
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +0 -1
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +1 -2
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +0 -1
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +0 -1
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +0 -1
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +0 -1
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +0 -1
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +0 -1
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +0 -1
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +3 -4
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/{cssVariables-23e3ca0d.js → cssVariables-000c23ad.js} +2 -2
- package/dist/esm/cssVariables-000c23ad.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/{isDefined-650befc3.js → isDefined-0cb07ee6.js} +1 -2
- package/dist/esm/isDefined-0cb07ee6.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +164 -103
- package/dist/hydrate/index.mjs +164 -103
- package/dist/types/components/button/bq-button.d.ts +5 -0
- package/dist/types/components/icon/helper/request.d.ts +17 -1
- package/dist/types/shared/utils/assetsPath.d.ts +5 -9
- package/package.json +1 -1
- package/dist/beeq/p-5a9a73a0.js.map +0 -1
- package/dist/beeq/p-5fcbf15f.entry.js.map +0 -1
- package/dist/beeq/p-7aa47927.entry.js.map +0 -1
- package/dist/beeq/p-a84d4562.js +0 -64
- package/dist/beeq/p-a84d4562.js.map +0 -1
- package/dist/beeq/p-b877d662.entry.js.map +0 -1
- package/dist/beeq/p-e06c8398.entry.js.map +0 -1
- package/dist/cjs/assetsPath-6ac8935a.js +0 -65
- package/dist/cjs/assetsPath-6ac8935a.js.map +0 -1
- package/dist/cjs/cssVariables-a0e1e906.js.map +0 -1
- package/dist/cjs/isDefined-ee0026ed.js.map +0 -1
- package/dist/components/assetsPath.js +0 -62
- package/dist/components/assetsPath.js.map +0 -1
- package/dist/esm/assetsPath-e2f1ceb9.js +0 -62
- package/dist/esm/assetsPath-e2f1ceb9.js.map +0 -1
- package/dist/esm/cssVariables-23e3ca0d.js.map +0 -1
- package/dist/esm/isDefined-650befc3.js.map +0 -1
|
@@ -12,6 +12,7 @@ import { isHTMLElement } from "../../shared/utils";
|
|
|
12
12
|
*/
|
|
13
13
|
export class BqSideMenu {
|
|
14
14
|
constructor() {
|
|
15
|
+
this.documentBody = undefined;
|
|
15
16
|
this.appearance = 'default';
|
|
16
17
|
this.collapse = false;
|
|
17
18
|
this.size = 'medium';
|
|
@@ -23,7 +24,6 @@ export class BqSideMenu {
|
|
|
23
24
|
bodyCssExpand = 'bq-body--side-menu__expand';
|
|
24
25
|
bodyCssCollapse = 'bq-body--side-menu__collapse';
|
|
25
26
|
menuElem;
|
|
26
|
-
documentBody = document.querySelector('body');
|
|
27
27
|
// Prop lifecycle events
|
|
28
28
|
// =======================
|
|
29
29
|
onCollapsePropChange() {
|
|
@@ -41,6 +41,7 @@ export class BqSideMenu {
|
|
|
41
41
|
// Ordered by their natural call order
|
|
42
42
|
// =====================================
|
|
43
43
|
componentDidLoad() {
|
|
44
|
+
this.documentBody = document.querySelector('body');
|
|
44
45
|
this.documentBody.classList.add(this.bodyCss);
|
|
45
46
|
this.handleCollapse();
|
|
46
47
|
}
|
|
@@ -106,9 +107,9 @@ export class BqSideMenu {
|
|
|
106
107
|
// Always the last one in the class.
|
|
107
108
|
// ===================================
|
|
108
109
|
render() {
|
|
109
|
-
return (h("aside", { key: '
|
|
110
|
+
return (h("aside", { key: '6b9b70d549a2fd19b32ef2f0ab367e61b818b112', class: { 'bq-side-menu overflow-y-auto': true, 'is-collapsed': this.collapse }, part: "base" }, h("div", { key: '48cc468552ac2e9b1fe05c8e12164894ac21c70b', class: { 'bq-side-menu--logo': true, 'is-collapsed': this.collapse }, part: "logo" }, h("slot", { key: '76915db8b5e43de19b98eb1455596da1552c1abd', name: "logo" })), h("nav", { key: '12f920b6403642d0cc7b12e93f655c7b76ed8db8', class: "bq-side-menu--nav flex flex-col gap-y-xs px-xs pt-xs2", ref: (navElem) => (this.menuElem = navElem),
|
|
110
111
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
|
|
111
|
-
role: "menu", part: "nav" }, h("slot", { key: '
|
|
112
|
+
role: "menu", part: "nav" }, h("slot", { key: '1c3c3a54716f2682cede96fc951c488ae99e259f' })), h("div", { key: 'ec11a043441529487b46c9d79c2fe921914b17a1', class: "bq-side-menu--footer sticky flex justify-center bg-[var(--bq-side-menu--bg-color)] p-xs inset-be-0 m-bs-[auto]", part: "footer" }, h("slot", { key: '767399bb44187023a853e52e926207b3622f685f', name: "footer" }))));
|
|
112
113
|
}
|
|
113
114
|
static get is() { return "bq-side-menu"; }
|
|
114
115
|
static get encapsulation() { return "shadow"; }
|
|
@@ -192,6 +193,11 @@ export class BqSideMenu {
|
|
|
192
193
|
}
|
|
193
194
|
};
|
|
194
195
|
}
|
|
196
|
+
static get states() {
|
|
197
|
+
return {
|
|
198
|
+
"documentBody": {}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
195
201
|
static get events() {
|
|
196
202
|
return [{
|
|
197
203
|
"method": "bqCollapse",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-side-menu.js","sourceRoot":"","sources":["../../../../../../src/components/side-menu/bq-side-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"bq-side-menu.js","sourceRoot":"","sources":["../../../../../../src/components/side-menu/bq-side-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AAMH,MAAM,OAAO,UAAU;;;0BAyBsC,SAAS;wBAGvB,KAAK;oBAGH,QAAQ;;IA9BvD,iBAAiB;IACjB,uBAAuB;IAEf,mBAAmB,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TSideMenuAppearance, TSideMenuSize } from './bq-side-menu.types';\nimport { isHTMLElement } from '../../shared/utils';\n\n/**\n * @part base - HTML `<aside>` root container\n * @part footer - HTML `<div>` element that holds the footer\n * @part logo - HTML `<div>` element that holds the logo\n * @part nav - HTML `<nav>` element that holds the navigation items\n */\n@Component({\n tag: 'bq-side-menu',\n styleUrl: './scss/bq-side-menu.scss',\n shadow: true,\n})\nexport class BqSideMenu {\n // Own Properties\n // ====================\n\n private menuItemCssSelector = 'bq-side-menu-item';\n\n private bodyCss = 'bq-body--side-menu';\n private bodyCssExpand = 'bq-body--side-menu__expand';\n private bodyCssCollapse = 'bq-body--side-menu__collapse';\n\n private menuElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private documentBody: HTMLBodyElement;\n\n // Public Property API\n // ========================\n\n /** It sets a predefined appearance of the side menu */\n @Prop({ reflect: true }) appearance: TSideMenuAppearance = 'default';\n\n /** If true, the container will reduce its width */\n @Prop({ reflect: true }) collapse: boolean = false;\n\n /** It sets the size of the navigation menu items */\n @Prop({ reflect: true }) size: TSideMenuSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('collapse')\n onCollapsePropChange() {\n this.handleCollapse();\n this.bqCollapse.emit({ collapse: this.collapse });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the Side menu changes its width from expanded to collapse and vice versa */\n @Event() bqCollapse: EventEmitter<{ collapse: boolean }>;\n\n /** Callback handler to be called when the active/selected menu item changes */\n @Event() bqSelect: EventEmitter<HTMLBqSideMenuItemElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.documentBody = document.querySelector('body');\n this.documentBody.classList.add(this.bodyCss);\n this.handleCollapse();\n }\n\n disconnectedCallback() {\n this.cleanDocumentBodyClass();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqClick', { passive: true })\n onMenuItemClick(event: Event) {\n const { target: item } = event;\n if (!isHTMLElement(item, 'bq-side-menu-item')) return;\n\n this.menuItems.forEach(\n (menuItem: HTMLBqSideMenuItemElement) => (menuItem.active = !menuItem.disabled && menuItem === item),\n );\n this.bqSelect.emit(item);\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 /** Toggle the collapse state of the side menu */\n @Method()\n async toggleCollapse() {\n this.collapse = !this.collapse;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private get menuItems() {\n if (!this.menuElem) return [];\n\n const slot = this.menuElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === this.menuItemCssSelector,\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private handleCollapse = () => {\n if (!this.menuItems.length) return;\n\n this.menuItems.forEach((menuItem: HTMLBqSideMenuItemElement) => (menuItem.collapse = this.collapse));\n if (this.collapse) {\n this.collapseDocumentBody();\n } else {\n this.expandDocumentBody();\n }\n };\n\n private collapseDocumentBody = () => {\n if (!this.collapse) return;\n\n this.documentBody.classList.remove(this.bodyCssExpand);\n this.documentBody.classList.add(this.bodyCssCollapse);\n };\n\n private expandDocumentBody = () => {\n if (this.collapse) return;\n\n this.documentBody.classList.remove(this.bodyCssCollapse);\n this.documentBody.classList.add(this.bodyCssExpand);\n };\n\n private cleanDocumentBodyClass = () => {\n this.documentBody.classList.remove(this.bodyCss, this.bodyCssCollapse, this.bodyCssExpand);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <aside class={{ 'bq-side-menu overflow-y-auto': true, 'is-collapsed': this.collapse }} part=\"base\">\n {/* Company logo and name */}\n <div class={{ 'bq-side-menu--logo': true, 'is-collapsed': this.collapse }} part=\"logo\">\n <slot name=\"logo\" />\n </div>\n {/* Navigation content */}\n <nav\n class=\"bq-side-menu--nav flex flex-col gap-y-xs px-xs pt-xs2\"\n ref={(navElem) => (this.menuElem = navElem)}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"menu\"\n part=\"nav\"\n >\n <slot />\n </nav>\n {/* Footer */}\n <div\n class=\"bq-side-menu--footer sticky flex justify-center bg-[var(--bq-side-menu--bg-color)] p-xs inset-be-0 m-bs-[auto]\"\n part=\"footer\"\n >\n <slot name=\"footer\"></slot>\n </div>\n </aside>\n );\n }\n}\n"]}
|
|
@@ -17,7 +17,7 @@ const TOAST_PORTAL_SELECTOR = 'bq-toast-portal';
|
|
|
17
17
|
*/
|
|
18
18
|
export class BqToast {
|
|
19
19
|
constructor() {
|
|
20
|
-
this.toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);
|
|
20
|
+
this.toastPortal = typeof window !== 'undefined' ? document.querySelector(`.${TOAST_PORTAL_SELECTOR}`) : null;
|
|
21
21
|
this.border = 's';
|
|
22
22
|
this.type = 'info';
|
|
23
23
|
this.placement = 'bottom-center';
|
|
@@ -65,7 +65,7 @@ export class BqToast {
|
|
|
65
65
|
// =====================================
|
|
66
66
|
connectedCallback() {
|
|
67
67
|
const { toastPortal } = this;
|
|
68
|
-
if (!toastPortal && typeof
|
|
68
|
+
if (!toastPortal && typeof window !== 'undefined') {
|
|
69
69
|
this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -156,7 +156,7 @@ export class BqToast {
|
|
|
156
156
|
const style = {
|
|
157
157
|
...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),
|
|
158
158
|
};
|
|
159
|
-
return (h(Host, { key: '
|
|
159
|
+
return (h(Host, { key: '0c720b655e1ccfb620eb3a317bf77e31f328308b', style: style, class: { 'is-hidden': !this.open }, "aria-hidden": !this.open ? 'true' : 'false', hidden: !this.open ? 'true' : 'false', role: "status" }, h("output", { key: 'a7f39180143c475d6554799eccb52fb52b61b978', class: "bq-toast", part: "wrapper" }, h("div", { key: '10a989822386e2abd536a58fd84fb8cc431b387e', class: { [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }, part: "icon" }, h("slot", { key: '6ac3e6c871ce1fd6b5a1f3202cc68c55bb8384fd', name: "icon" }, h("bq-icon", { key: '2de92ed1b7051b57f8979cbbef6fe03e6eec6880', name: this.iconName, size: "24", slot: "icon", exportparts: "base,svg" }))), h("slot", { key: '2794332bcd8fc1e2d314bcbb950d517f775d457e' }))));
|
|
160
160
|
}
|
|
161
161
|
static get is() { return "bq-toast"; }
|
|
162
162
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-toast.js","sourceRoot":"","sources":["../../../../../../src/components/toast/bq-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAmD,MAAM,kBAAkB,CAAC;AAChH,OAAO,EAAE,QAAQ,EAAa,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AAMH,MAAM,OAAO,OAAO;;2BAea,QAAQ,CAAC,aAAa,CAAC,IAAI,qBAAqB,EAAE,CAAC;sBAM5B,GAAG;oBAG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Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TOAST_PLACEMENT, TOAST_TYPE, TToastBorderRadius, TToastPlacement, TToastType } from './bq-toast.types';\nimport { debounce, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst TOAST_PORTAL_SELECTOR = 'bq-toast-portal';\n\n/**\n * @part wrapper - The component's internal wrapper inside the shadow DOM.\n * @part icon-info - The `<div>` container that holds the icon component.\n * @part base - The `<div>` container of the internal bq-icon component.\n * @part svg - The `<svg>` element of the internal bq-icon component.\n *\n * @slot - The content to be displayed in the toast component.\n * @slot icon - The icon to be displayed in the toast component.\n */\n@Component({\n tag: 'bq-toast',\n styleUrl: './scss/bq-toast.scss',\n shadow: true,\n})\nexport class BqToast {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqToastElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);\n\n // Public Property API\n // ========================\n\n /** The corder radius of the toast component */\n @Prop({ reflect: true }) border: TToastBorderRadius = 's';\n\n /** Type of toast */\n @Prop({ reflect: true, mutable: true }) type: TToastType = 'info';\n\n /** Placement of toast */\n @Prop({ reflect: true, mutable: true }) placement: TToastPlacement = 'bottom-center';\n\n /** If true will hide toast icon */\n @Prop({ reflect: true, mutable: true }) hideIcon = false;\n\n /** If true, the toast will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the toast will close itself */\n @Prop({ reflect: true }) time: number = 3000;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TOAST_TYPE, 'default', this.el, 'type');\n validatePropValue(TOAST_PLACEMENT, 'bottom-center', this.el, 'placement');\n\n const { toastPortal } = this;\n toastPortal?.classList.remove(...TOAST_PLACEMENT);\n toastPortal?.classList.add(this.placement);\n }\n\n @Watch('time')\n handleTimeChange() {\n this.autoDismissDebounce?.cancel();\n\n this.time = Math.max(0, this.time);\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (this.open) {\n this.autoDismissDebounce?.();\n }\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide: EventEmitter<HTMLBqToastElement>;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow: EventEmitter<HTMLBqToastElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n const { toastPortal } = this;\n if (!toastPortal && typeof document !== 'undefined') {\n this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeChange();\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n this.autoDismissDebounce?.cancel();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqHide')\n onNotificationHide() {\n try {\n const { toastPortal } = this;\n toastPortal?.removeChild(this.el);\n // Remove the toast portal from the DOM when there are no more toasts\n if (toastPortal?.querySelector(this.el.tagName.toLowerCase()) === null) {\n toastPortal?.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to show the toast component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n /** Method to be called to hide the toast component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically */\n @Method()\n async toast() {\n const { toastPortal } = this;\n if (toastPortal?.parentElement === null) {\n document.body.append(toastPortal);\n }\n\n toastPortal?.appendChild(this.el);\n\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleShow = () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n }\n };\n\n private handleHide = () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = false;\n }\n };\n\n private get iconName() {\n const typeMap = {\n success: 'check-circle-bold',\n error: 'x-circle-bold',\n loading: 'spinner-gap-bold',\n alert: 'warning-bold',\n info: 'info-bold',\n };\n\n return typeMap[this.type] || 'info-bold';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"status\"\n >\n <output class=\"bq-toast\" part=\"wrapper\">\n <div class={{ [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }} part=\"icon\">\n <slot name=\"icon\">\n <bq-icon name={this.iconName} size=\"24\" slot=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <slot />\n </output>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-toast.js","sourceRoot":"","sources":["../../../../../../src/components/toast/bq-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAmD,MAAM,kBAAkB,CAAC;AAChH,OAAO,EAAE,QAAQ,EAAa,iBAAiB,EAAE,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TOAST_PLACEMENT, TOAST_TYPE, TToastBorderRadius, TToastPlacement, TToastType } from './bq-toast.types';\nimport { debounce, TDebounce, validatePropValue } from '../../shared/utils';\n\nconst TOAST_PORTAL_SELECTOR = 'bq-toast-portal';\n\n/**\n * @part wrapper - The component's internal wrapper inside the shadow DOM.\n * @part icon-info - The `<div>` container that holds the icon component.\n * @part base - The `<div>` container of the internal bq-icon component.\n * @part svg - The `<svg>` element of the internal bq-icon component.\n *\n * @slot - The content to be displayed in the toast component.\n * @slot icon - The icon to be displayed in the toast component.\n */\n@Component({\n tag: 'bq-toast',\n styleUrl: './scss/bq-toast.scss',\n shadow: true,\n})\nexport class BqToast {\n // Own Properties\n // ====================\n\n private autoDismissDebounce: TDebounce<void>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqToastElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private toastPortal =\n typeof window !== 'undefined' ? document.querySelector(`.${TOAST_PORTAL_SELECTOR}`) : null;\n\n // Public Property API\n // ========================\n\n /** The corder radius of the toast component */\n @Prop({ reflect: true }) border: TToastBorderRadius = 's';\n\n /** Type of toast */\n @Prop({ reflect: true, mutable: true }) type: TToastType = 'info';\n\n /** Placement of toast */\n @Prop({ reflect: true, mutable: true }) placement: TToastPlacement = 'bottom-center';\n\n /** If true will hide toast icon */\n @Prop({ reflect: true, mutable: true }) hideIcon = false;\n\n /** If true, the toast will be shown */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** The length of time, in milliseconds, after which the toast will close itself */\n @Prop({ reflect: true }) time: number = 3000;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TOAST_TYPE, 'default', this.el, 'type');\n validatePropValue(TOAST_PLACEMENT, 'bottom-center', this.el, 'placement');\n\n const { toastPortal } = this;\n toastPortal?.classList.remove(...TOAST_PLACEMENT);\n toastPortal?.classList.add(this.placement);\n }\n\n @Watch('time')\n handleTimeChange() {\n this.autoDismissDebounce?.cancel();\n\n this.time = Math.max(0, this.time);\n\n this.autoDismissDebounce = debounce(() => {\n this.hide();\n }, this.time);\n }\n\n @Watch('open')\n handleOpenChange() {\n this.autoDismissDebounce?.cancel();\n\n if (this.open) {\n this.autoDismissDebounce?.();\n }\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the notification is hidden */\n @Event() bqHide: EventEmitter<HTMLBqToastElement>;\n\n /** Callback handler to be called when the notification is shown */\n @Event() bqShow: EventEmitter<HTMLBqToastElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n const { toastPortal } = this;\n if (!toastPortal && typeof window !== 'undefined') {\n this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });\n }\n }\n\n componentWillLoad() {\n this.checkPropValues();\n this.handleTimeChange();\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n this.autoDismissDebounce?.cancel();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqHide')\n onNotificationHide() {\n try {\n const { toastPortal } = this;\n toastPortal?.removeChild(this.el);\n // Remove the toast portal from the DOM when there are no more toasts\n if (toastPortal?.querySelector(this.el.tagName.toLowerCase()) === null) {\n toastPortal?.remove();\n }\n } catch (error) {\n /**\n * Skip DOMException error since it could be possible that\n * in some situations the notification portal is missing\n */\n if (error instanceof DOMException) return;\n throw error;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to show the toast component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n /** Method to be called to hide the toast component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically */\n @Method()\n async toast() {\n const { toastPortal } = this;\n if (toastPortal?.parentElement === null) {\n document.body.append(toastPortal);\n }\n\n toastPortal?.appendChild(this.el);\n\n requestAnimationFrame(() => {\n this.show();\n });\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleShow = () => {\n const ev = this.bqShow.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = true;\n }\n };\n\n private handleHide = () => {\n const ev = this.bqHide.emit(this.el);\n if (!ev.defaultPrevented) {\n this.open = false;\n }\n };\n\n private get iconName() {\n const typeMap = {\n success: 'check-circle-bold',\n error: 'x-circle-bold',\n loading: 'spinner-gap-bold',\n alert: 'warning-bold',\n info: 'info-bold',\n };\n\n return typeMap[this.type] || 'info-bold';\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),\n };\n\n return (\n <Host\n style={style}\n class={{ 'is-hidden': !this.open }}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open ? 'true' : 'false'}\n role=\"status\"\n >\n <output class=\"bq-toast\" part=\"wrapper\">\n <div class={{ [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }} part=\"icon\">\n <slot name=\"icon\">\n <bq-icon name={this.iconName} size=\"24\" slot=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <slot />\n </output>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -6,54 +6,66 @@
|
|
|
6
6
|
* Inspired by Shoelace's `getBasePath` and `setBasePath` functions.
|
|
7
7
|
* https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts
|
|
8
8
|
*/
|
|
9
|
-
let
|
|
9
|
+
let basePath;
|
|
10
10
|
const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
|
|
11
11
|
const DEFAULT_SVG_PATH = 'svg';
|
|
12
|
-
const scripts = document && typeof document !== 'undefined'
|
|
13
|
-
? [...document.getElementsByTagName('script')]
|
|
14
|
-
: [];
|
|
15
12
|
/**
|
|
16
|
-
* Sets the
|
|
17
|
-
*
|
|
18
|
-
* This method is the only way to update the base path.
|
|
19
|
-
*
|
|
20
|
-
* @param path - The new base path to set.
|
|
13
|
+
* Sets the base path for the assets.
|
|
14
|
+
* @param {string} path - The base path to set.
|
|
21
15
|
*/
|
|
22
16
|
export const setBasePath = (path) => {
|
|
23
|
-
|
|
17
|
+
basePath = path;
|
|
24
18
|
};
|
|
25
19
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @
|
|
29
|
-
* @returns The full base path including the subpath.
|
|
20
|
+
* Gets the base path for the assets.
|
|
21
|
+
* @param {string} subpath - An optional subpath to append to the base path.
|
|
22
|
+
* @returns {string} The base path of the assets.
|
|
30
23
|
*/
|
|
31
24
|
export const getBasePath = (subpath = '') => {
|
|
32
|
-
if (!
|
|
33
|
-
|
|
25
|
+
if (!basePath) {
|
|
26
|
+
const configScript = findConfigScript();
|
|
27
|
+
const fallbackScript = configScript ? null : findFallbackScript();
|
|
28
|
+
const script = configScript || fallbackScript;
|
|
29
|
+
if (script) {
|
|
30
|
+
const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);
|
|
31
|
+
setBasePath(`${path}/${DEFAULT_SVG_PATH}`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// Fallback: use an environment variable (if set) or the default path
|
|
35
|
+
setBasePath(process.env.ASSETS_BASE_PATH || `./${DEFAULT_SVG_PATH}`);
|
|
36
|
+
}
|
|
34
37
|
}
|
|
38
|
+
// Return the base path without a trailing slash. If one exists, append the subpath separated by a slash.
|
|
35
39
|
const formattedSubpath = subpath ? `/${subpath.replace(/^\//, '')}` : '';
|
|
36
|
-
return
|
|
40
|
+
return basePath.replace(/\/$/, '') + formattedSubpath;
|
|
37
41
|
};
|
|
38
42
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* 2. If a script with the name `beeq.js` or `beeq.esm.js` exists, the base path will be set to the value of the `src` attribute.
|
|
42
|
-
* 3. If no scripts are found, the base path will be set to the default value `./svg`.
|
|
43
|
+
* Finds the configuration script element.
|
|
44
|
+
* @returns The configuration script element or null if not found.
|
|
43
45
|
*/
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
const findConfigScript = () => {
|
|
47
|
+
if (typeof window === 'undefined')
|
|
48
|
+
return null;
|
|
49
|
+
return document.querySelector(`script[${DATA_BEEQ_ATTRIBUTE}]`);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Finds the fallback script element.
|
|
53
|
+
* @returns The fallback script element or null if not found.
|
|
54
|
+
*/
|
|
55
|
+
const findFallbackScript = () => {
|
|
56
|
+
if (typeof window === 'undefined')
|
|
57
|
+
return null;
|
|
58
|
+
return document.querySelector(`script[src*="beeq"]`);
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Gets the path of a script element.
|
|
62
|
+
* @param {HTMLScriptElement} script - The script element.
|
|
63
|
+
* @returns The path of the script element.
|
|
64
|
+
*/
|
|
65
|
+
const getScriptPath = (script) => {
|
|
66
|
+
if (typeof window === 'undefined')
|
|
67
|
+
return '';
|
|
68
|
+
const src = script.getAttribute('src');
|
|
69
|
+
return src ? src.substring(0, src.lastIndexOf('/')) : '';
|
|
55
70
|
};
|
|
56
|
-
const findConfigScript = () => scripts?.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));
|
|
57
|
-
const findFallbackScript = () => scripts?.find((script) => /beeq(\.esm)?\.js($|\?)/.test(script.src));
|
|
58
|
-
const getScriptPath = (script) => script?.getAttribute('src').split('/').slice(0, -1).join('/');
|
|
59
71
|
//# sourceMappingURL=assetsPath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsPath.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/assetsPath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,
|
|
1
|
+
{"version":3,"file":"assetsPath.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/assetsPath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,QAA4B,CAAC;AACjC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAQ,EAAE;IAChD,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAU,EAAE;IAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;QACxC,MAAM,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAElE,MAAM,MAAM,GAAG,YAAY,IAAI,cAAc,CAAC;QAC9C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC7F,WAAW,CAAC,GAAG,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,qEAAqE;YACrE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,KAAK,gBAAgB,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,yGAAyG;IACzG,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC;AACxD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,gBAAgB,GAAG,GAA6B,EAAE;IACtD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAE/C,OAAO,QAAQ,CAAC,aAAa,CAAC,UAAU,mBAAmB,GAAG,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,kBAAkB,GAAG,GAA6B,EAAE;IACxD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAE/C,OAAO,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAyB,EAAU,EAAE;IAC1D,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["/**\n * Inspired by Shoelace's `getBasePath` and `setBasePath` functions.\n * https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n */\n\nlet basePath: string | undefined;\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\n\n/**\n * Sets the base path for the assets.\n * @param {string} path - The base path to set.\n */\nexport const setBasePath = (path: string): void => {\n basePath = path;\n};\n\n/**\n * Gets the base path for the assets.\n * @param {string} subpath - An optional subpath to append to the base path.\n * @returns {string} The base path of the assets.\n */\nexport const getBasePath = (subpath: string = ''): string => {\n if (!basePath) {\n const configScript = findConfigScript();\n const fallbackScript = configScript ? null : findFallbackScript();\n\n const script = configScript || fallbackScript;\n if (script) {\n const path = configScript ? script.getAttribute(DATA_BEEQ_ATTRIBUTE) : getScriptPath(script);\n setBasePath(`${path}/${DEFAULT_SVG_PATH}`);\n } else {\n // Fallback: use an environment variable (if set) or the default path\n setBasePath(process.env.ASSETS_BASE_PATH || `./${DEFAULT_SVG_PATH}`);\n }\n }\n\n // Return the base path without a trailing slash. If one exists, append the subpath separated by a slash.\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return basePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\n/**\n * Finds the configuration script element.\n * @returns The configuration script element or null if not found.\n */\nconst findConfigScript = (): HTMLScriptElement | null => {\n if (typeof window === 'undefined') return null;\n\n return document.querySelector(`script[${DATA_BEEQ_ATTRIBUTE}]`);\n};\n\n/**\n * Finds the fallback script element.\n * @returns The fallback script element or null if not found.\n */\nconst findFallbackScript = (): HTMLScriptElement | null => {\n if (typeof window === 'undefined') return null;\n\n return document.querySelector(`script[src*=\"beeq\"]`);\n};\n\n/**\n * Gets the path of a script element.\n * @param {HTMLScriptElement} script - The script element.\n * @returns The path of the script element.\n */\nconst getScriptPath = (script: HTMLScriptElement): string => {\n if (typeof window === 'undefined') return '';\n\n const src = script.getAttribute('src');\n return src ? src.substring(0, src.lastIndexOf('/')) : '';\n};\n"]}
|
|
@@ -10,7 +10,7 @@ const CSSVALUEPREFIX = '--bq-';
|
|
|
10
10
|
* @return {string} The corresponding CSS custom property variable
|
|
11
11
|
*/
|
|
12
12
|
export function getColorCSSVariable(colorName) {
|
|
13
|
-
if (typeof
|
|
13
|
+
if (typeof window === 'undefined')
|
|
14
14
|
return undefined;
|
|
15
15
|
const token = `${CSSVALUEPREFIX}${colorName}`;
|
|
16
16
|
const value = getComputedStyle(document.documentElement).getPropertyValue(token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssVariables.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/cssVariables.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"cssVariables.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/cssVariables.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAEpD,MAAM,KAAK,GAAG,GAAG,cAAc,GAAG,SAAS,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjF,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,OAAO,OAAO,KAAK,GAAG,CAAC;AACzB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,SAAkB;IACtE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC","sourcesContent":["const CSSVALUEPREFIX = '--bq-';\n\n/**\n * Get CSS custom property variable of a given color string value\n *\n * @param {string} colorName - Valid string value.\n * @return {string} The corresponding CSS custom property variable\n */\nexport function getColorCSSVariable(colorName: string): string | undefined {\n if (typeof window === 'undefined') return undefined;\n\n const token = `${CSSVALUEPREFIX}${colorName}`;\n const value = getComputedStyle(document.documentElement).getPropertyValue(token);\n if (!value) return undefined;\n\n return `var(${token})`;\n}\n\n/**\n * Get compiled CSS custom property value\n *\n * @param {string} variable - The variable name for which to get its value\n * @return {string} The corresponding value for the given CSS custom property\n */\nexport function getCSSVariableValue(variable: string, component: Element): string {\n const styles = getComputedStyle(component);\n return String(styles.getPropertyValue(`--${variable}`)).trim();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-accordion-group.js","mappings":"
|
|
1
|
+
{"file":"bq-accordion-group.js","mappings":";;;;;;;;AAAA,MAAM,mBAAmB,GAAG,s3lBAAs3lB,CAAC;AACn5lB,+BAAe,mBAAmB;;MCYrBA,kBAAgB;;;;;0BAiBgD,QAAQ;;2BASnC,KAAK;wBAGR,KAAK;oBAGa,QAAQ;;;;;IASvE,eAAe;QACb,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,kBAAkB;;YAElD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAC1B,kBAAkB,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;aAC9C;YACD,kBAAkB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YAChD,kBAAkB,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAClD,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACrC,CAAC,CAAC;KACJ;;;;IAOD,SAAS,CAAC,KAA0C;QAClD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;;QAEjC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO;;QAEhF,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAE1B,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,kBAAkB;YAClD,IAAI,kBAAkB,KAAK,KAAK,CAAC,MAAM;gBAAE,OAAO;YAEhD,kBAAkB,CAAC,QAAQ,GAAG,KAAK,CAAC;SACrC,CAAC,CAAC;KACJ;;;;IAMD,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;;;;;;;;;;;;;IAiBD,IAAY,mBAAmB;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;KAC7D;;;;IAKD,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,+CAA+C,EAAC,IAAI,EAAC,MAAM,IACpE,8DAAQ,CACJ,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqAccordionGroup"],"sources":["../../packages/beeq/src/components/accordion-group/scss/bq-accordion-group.scss?tag=bq-accordion-group&encapsulation=shadow","../../packages/beeq/src/components/accordion-group/bq-accordion-group.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Accordion group styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-accordion-group.variables';\n\n:host {\n @apply block;\n}\n","import { Component, Element, h, Listen, Prop, Watch } from '@stencil/core';\n\nimport { isHTMLElement, isNil } from '../../shared/utils';\nimport { TAccordionAppearance, TAccordionSize } from '../accordion/bq-accordion.types';\n\n/**\n * @part base - The component's base wrapper.\n */\n@Component({\n tag: 'bq-accordion-group',\n styleUrl: './scss/bq-accordion-group.scss',\n shadow: true,\n})\nexport class BqAccordionGroup {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqAccordionGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** The appearance style of accordion to be applied to all accordions */\n @Prop({ reflect: true, mutable: true }) appearance: TAccordionAppearance = 'filled';\n\n /** If true all accordions are expanded */\n @Prop({ reflect: true }) expandAll: boolean;\n\n /**\n * Animation is set through JS when the browser does not support CSS calc-size()\n * If true, the accordion animation, will be disabled. No animation will be applied.\n */\n @Prop({ reflect: true }) noAnimation: boolean = false;\n\n /** If true multiple accordions can be expanded at the same time */\n @Prop({ reflect: true }) multiple: boolean = false;\n\n /** The size of accordion to be applied to all accordions */\n @Prop({ reflect: true, mutable: true }) size: TAccordionSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('appearance')\n @Watch('expandAll')\n @Watch('noAnimation')\n @Watch('size')\n checkPropValues() {\n this.bqAccordionElements.forEach((bqAccordionElement) => {\n // NOTE: if expandAll is nil we will keep accordion default state\n if (!isNil(this.expandAll)) {\n bqAccordionElement.expanded = this.expandAll;\n }\n bqAccordionElement.appearance = this.appearance;\n bqAccordionElement.noAnimation = this.noAnimation;\n bqAccordionElement.size = this.size;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqAccordionElement>) {\n const { detail: bqElem } = event;\n // Make sure the event is coming from a bq-accordion element and its a child of the bq-accordion-group\n if (!isHTMLElement(bqElem, 'bq-accordion') || !this.el.contains(bqElem)) return;\n // We keep default behavior if multiple accordion can be expanded\n if (this.multiple) return;\n\n this.bqAccordionElements.forEach((bqAccordionElement) => {\n if (bqAccordionElement === event.detail) return;\n\n bqAccordionElement.expanded = false;\n });\n }\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\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 get bqAccordionElements(): HTMLBqAccordionElement[] {\n return Array.from(this.el.querySelectorAll('bq-accordion'));\n }\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"flex flex-col gap-[--bq-accordion-group--gap]\" part=\"base\">\n <slot />\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
5
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
6
|
-
import './assetsPath.js';
|
|
7
6
|
import { v as validatePropValue } from './props.js';
|
|
8
7
|
import { b as hasSlotContent } from './slot.js';
|
|
9
8
|
import { d as defineCustomElement$2 } from './bq-icon2.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-accordion.js","mappings":";;;;;;;;;;AAAO,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGpD,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;;ACHhE;AACA;AACA;MAEa,SAAS;IACZ,EAAE,CAAqB;IACvB,MAAM,CAAc;IACpB,KAAK,CAAc;IACnB,SAAS,CAAmB;IAC5B,SAAS,CAAU;IACnB,WAAW,CAAU;IACrB,gBAAgB,GAAG;QACzB,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,aAAa;KACtB,CAAC;IAEF,YAAY,EAAsB;;QAEhC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;;QAEb,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;;QAE1C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;;QAErD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;;QAEtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;;QAEvB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqAccordion"],"sources":["../../packages/beeq/src/components/accordion/bq-accordion.types.ts","../../packages/beeq/src/components/accordion/helper/index.ts","../../packages/beeq/src/components/accordion/scss/bq-accordion.scss?tag=bq-accordion&encapsulation=shadow","../../packages/beeq/src/components/accordion/bq-accordion.tsx"],"sourcesContent":["export const ACCORDION_SIZE = ['small', 'medium'] as const;\nexport type TAccordionSize = (typeof ACCORDION_SIZE)[number];\n\nexport const ACCORDION_APPEARANCE = ['filled', 'ghost'] as const;\nexport type TAccordionAppearance = (typeof ACCORDION_APPEARANCE)[number];\n","/* -------------------------------------------------------------------------------------- */\n/* 💡 Credits: https://css-tricks.com/how-to-animate-the-details-element-using-waapi */\n/* -------------------------------------------------------------------------------------- */\n\nexport class Accordion {\n private el: HTMLDetailsElement;\n private header: HTMLElement;\n private panel: HTMLElement;\n private animation: Animation | null;\n private isClosing: boolean;\n private isExpanding: boolean;\n private animationOptions = {\n duration: 200,\n easing: 'ease-in-out',\n };\n\n constructor(el: HTMLDetailsElement) {\n // Store the <details> element\n this.el = el;\n // Store the <summary> header element\n this.header = el.querySelector('summary');\n // Store the <div class=\"content\"> element\n this.panel = el.querySelector('.bq-accordion__body');\n // Store the animation object (so we can cancel it, if needed)\n this.animation = null;\n // Store if the element is closing\n this.isClosing = false;\n // Store if the element is expanding\n this.isExpanding = false;\n }\n\n public open() {\n // Check if the element is being closed or is already closed\n if (!this.isClosing && this.el.open) return;\n // Apply a fixed height on the element\n this.el.style.height = `${this.el.offsetHeight}px`;\n // Force the [open] attribute on the details element\n this.el.open = true;\n // Wait for the next frame to call the expand function\n window.requestAnimationFrame(() => this.expand());\n }\n\n public close() {\n // Check if the element is being opened or is already open\n if (!this.isExpanding && !this.el.open) return;\n // Set the element as \"being closed\"\n this.isClosing = true;\n\n // Store the current height of the element\n const startHeight = `${this.el.offsetHeight}px`;\n // Calculate the height of the <summary> header\n const endHeight = `${this.header.offsetHeight}px`;\n\n // If there is already an animation running\n if (this.animation) {\n // Cancel the current animation\n this.animation.cancel();\n }\n\n // Start a WAAPI animation\n this.animation = this.el.animate({ height: [startHeight, endHeight] }, this.animationOptions);\n // When the animation is complete, call onAnimationFinish()\n this.animation.onfinish = () => this.onAnimationFinish(false);\n // If the animation is cancelled, isClosing variable is set to false\n this.animation.oncancel = () => (this.isClosing = false);\n }\n\n // Expands the accordion\n private expand() {\n // Set the element as \"being expanding\"\n this.isExpanding = true;\n // Get the current fixed height of the element\n const startHeight = `${this.el.offsetHeight}px`;\n // Calculate the open height of the element (summary header height + panel body height)\n const endHeight = `${this.header.offsetHeight + this.panel.offsetHeight}px`;\n\n // If there is already an animation running\n if (this.animation) {\n // Cancel the current animation\n this.animation.cancel();\n }\n\n // Start a WAAPI animation\n this.animation = this.el.animate({ height: [startHeight, endHeight] }, this.animationOptions);\n // When the animation is complete, call onAnimationFinish()\n this.animation.onfinish = () => this.onAnimationFinish(true);\n // If the animation is cancelled, isExpanding variable is set to false\n this.animation.oncancel = () => (this.isExpanding = false);\n }\n\n // Handles the end of the animation\n private onAnimationFinish(open: boolean) {\n // Set the open attribute based on the parameter\n this.el.open = open;\n // Clear the stored animation\n this.animation = null;\n // Reset isClosing & isExpanding\n this.isClosing = false;\n this.isExpanding = false;\n // Remove the overflow hidden and the fixed height\n this.el.removeAttribute('style');\n // Dispatch a custom event based on the open parameter\n const endEvent = new Event('accordionTransitionEnd', { bubbles: false, composed: true });\n this.el.dispatchEvent(endEvent);\n }\n}\n","/* -------------------------------------------------------------------------- */\n/* Accordion styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-accordion.variables';\n\n:host {\n @apply block;\n}\n\n.bq-accordion {\n &.disabled {\n @apply cursor-not-allowed opacity-60;\n\n .bq-accordion__header {\n @apply pointer-events-none;\n }\n }\n\n &.small .bq-accordion__header {\n @apply gap-[--bq-accordion--small-gap] pe-[--bq-accordion--small-padding-end] ps-[--bq-accordion--small-padding-start] p-b-[--bq-accordion--small-padding-y];\n @apply rounded-ee-[--bq-accordion--small-radius] rounded-es-[--bq-accordion--small-radius] rounded-se-[--bq-accordion--small-radius] rounded-ss-[--bq-accordion--small-radius];\n }\n\n &.medium .bq-accordion__header {\n @apply gap-[--bq-accordion--medium-gap] pe-[--bq-accordion--medium-padding-end] ps-[--bq-accordion--medium-padding-start] p-b-[--bq-accordion--medium-padding-y];\n @apply rounded-ee-[--bq-accordion--medium-radius] rounded-es-[--bq-accordion--medium-radius] rounded-se-[--bq-accordion--medium-radius] rounded-ss-[--bq-accordion--medium-radius];\n }\n\n &[open] .bq-accordion__header {\n @apply border-[length:--bq-accordion--expanded-border-width] border-[color:--bq-accordion--expanded-border-color];\n @apply rounded-ee-[0px] rounded-es-[0px];\n\n border-style: var(--bq-accordion--expanded-border-style);\n }\n\n &.small .bq-accordion__body {\n @apply rounded-ee-[--bq-accordion--small-radius] rounded-es-[--bq-accordion--small-radius] rounded-se-[0px] rounded-ss-[0px];\n }\n\n &.medium .bq-accordion__body {\n @apply rounded-ee-[--bq-accordion--medium-radius] rounded-es-[--bq-accordion--medium-radius] rounded-se-[0px] rounded-ss-[0px];\n }\n\n &.filled {\n .bq-accordion__header {\n @apply bg-[--bq-accordion--filled-collapsed-background] hover:bg-hover-ui-secondary;\n }\n\n .bq-accordion__header--text {\n @apply text-[--bq-accordion--filled-collapsed-text-color];\n }\n\n .bq-accordion__body {\n @apply border-[length:--bq-accordion--panel-filled-border-width] border-[color:--bq-accordion--panel-filled-border-color];\n\n border-style: var(--bq-accordion--panel-filled-border-style);\n }\n\n &[open] .bq-accordion__header {\n @apply bg-[--bq-accordion--filled-expanded-background] hover:bg-hover-ui-secondary;\n }\n\n &[open] .bq-accordion__header--text {\n @apply text-[--bq-accordion--filled-expanded-text-color];\n }\n }\n\n &.ghost {\n .bq-accordion__header {\n @apply bg-[--bq-accordion--ghost-collapsed-background] hover:bg-hover-ui-secondary;\n }\n\n .bq-accordion__header--text {\n @apply text-[--bq-accordion--ghost-collapsed-text-color];\n }\n\n .bq-accordion__body {\n @apply border-[length:--bq-accordion--panel-ghost-border-width] border-[color:--bq-accordion--panel-ghost-border-color];\n\n border-style: var(--bq-accordion--panel-ghost-border-style);\n }\n\n &[open] .bq-accordion__header {\n @apply bg-[--bq-accordion--ghost-expanded-background] hover:bg-hover-ui-secondary;\n }\n\n &[open] .bq-accordion__header--text {\n @apply text-[--bq-accordion--ghost-expanded-text-color];\n }\n }\n\n &.small.filled .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-small-filled-padding-end] ps-[--bq-accordion--panel-small-filled-padding-start] p-b-[--bq-accordion--panel-small-filled-padding-y];\n }\n\n &.medium.filled .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-medium-filled-padding-end] ps-[--bq-accordion--panel-medium-filled-padding-start] p-b-[--bq-accordion--panel-medium-filled-padding-y];\n }\n\n &.small.ghost .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-small-ghost-padding-end] ps-[--bq-accordion--panel-small-ghost-padding-start] p-b-[--bq-accordion--panel-small-ghost-padding-y];\n }\n\n &.medium.ghost .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-medium-ghost-padding-end] ps-[--bq-accordion--panel-medium-ghost-padding-start] p-b-[--bq-accordion--panel-medium-ghost-padding-y];\n }\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion::details-content {\n @apply block overflow-hidden transition-[block-size,content-visibility] duration-300 ease-in-out bs-0 [transition-behavior:allow-discrete];\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion[open]::details-content {\n /* block-size: auto is just a fallback for browsers that don't support the calc-size() function */\n @apply bs-auto;\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion[open]:not(.no-animation)::details-content {\n @apply supports-[block-size:calc-size(auto)]:bs-[calc-size(auto)];\n}\n\n.bq-accordion__header {\n // Since there's an overflow on the <summary> element, the focus outline is not visible,\n // so we force it to be inset to avoid the overflow hidden.\n --bq-ring-offset-width: -2px;\n\n @apply flex cursor-pointer select-none list-none items-center transition-colors duration-300 ease-in-out focus-visible:focus;\n @apply border-[length:--bq-accordion--collapsed-border-width] border-[color:--bq-accordion--collapsed-border-color];\n\n border-style: var(--bq-accordion--collapsed-border-style);\n\n &::marker,\n &::-webkit-details-marker {\n @apply hidden;\n }\n}\n\n.bq-accordion__header--text {\n @apply flex-1;\n}\n\n.bq-accordion__header--prefix,\n.bq-accordion__header--suffix {\n @apply flex items-center justify-center;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\n\nimport { ACCORDION_APPEARANCE, ACCORDION_SIZE, TAccordionAppearance, TAccordionSize } from './bq-accordion.types';\nimport { Accordion } from './helper';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The `<details>` that holds the accordion content\n * @part header - The `<summary>` that holds the accordion header content\n * @part prefix - The `<div>` that holds the accordion text prefix icon / avatar\n * @part text - The `<div>` that holds the accordion header text\n * @part suffix - The `<div>` that holds the accordion text suffix icon\n * @part panel - The `<div>` that holds the accordion panel content\n */\n@Component({\n tag: 'bq-accordion',\n styleUrl: './scss/bq-accordion.scss',\n shadow: true,\n})\nexport class BqAccordion {\n // Own Properties\n // ====================\n\n private accordion: Accordion;\n private prefixElem: HTMLDivElement;\n private suffixElem: HTMLDivElement;\n private detailsElem: HTMLDetailsElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqAccordionElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n @State() private hasSuffix = false;\n\n // Public Property API\n // ========================\n\n /** The appearance style of accordion */\n @Prop({ reflect: true, mutable: true }) appearance: TAccordionAppearance = 'filled';\n\n /** If true accordion is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If true accordion is expanded */\n @Prop({ reflect: true, mutable: true }) expanded: boolean = false;\n\n /**\n * Animation is set through JS when the browser does not support CSS calc-size()\n * If true, the accordion animation, will be disabled. No animation will be applied.\n */\n @Prop({ reflect: true }) noAnimation: boolean = false;\n\n /** If true accordion expand icon is rotate 180deg when expanded */\n @Prop({ reflect: true }) rotate: boolean = false;\n\n /** The size of accordion */\n @Prop({ reflect: true, mutable: true }) size: TAccordionSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(ACCORDION_SIZE, 'medium', this.el, 'size');\n validatePropValue(ACCORDION_APPEARANCE, 'filled', this.el, 'appearance');\n }\n\n @Watch('expanded')\n handleExpandedChange() {\n const event = this.expanded ? this.bqOpen.emit(this.el) : this.bqClose.emit(this.el);\n if (event.defaultPrevented) {\n this.expanded = !this.expanded;\n return;\n }\n\n if (this.expanded) {\n this.accordion?.open();\n } else {\n this.accordion?.close();\n }\n if (!this.isCssCalcSizeSupported) return;\n\n // NOTE: This is a workaround to trigger the transitionEnd event\n // when the open/close animation is handled via CSS instead of JS\n setTimeout(() => {\n this.el.dispatchEvent(new CustomEvent('accordionTransitionEnd', { bubbles: false, composed: true }));\n }, 200);\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.disabled) return;\n\n this.expanded = false;\n }\n\n @Watch('noAnimation')\n handleJsAnimation() {\n if (this.isCssCalcSizeSupported) return;\n\n console.warn(\n `[bq-accordion] calc-size() is not supported and animation will be set through JS\n For vertical layout, consider using the 'noAnimation' prop ('no-animation' attribute) to disable it`,\n );\n this.accordion = !this.noAnimation ? new Accordion(this.detailsElem) : null;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the accordion loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion is opened */\n @Event() bqOpen: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called after the accordion is opened */\n @Event() bqAfterOpen: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion is closed */\n @Event() bqClose: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called after the accordion is closed */\n @Event() bqAfterClose: EventEmitter<HTMLBqAccordionElement>;\n\n /** @internal Handler to be called when the accordion is clicked */\n @Event() bqClick: EventEmitter<HTMLBqAccordionElement>;\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.handleJsAnimation();\n this.handleExpandedChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('accordionTransitionEnd')\n onAccordionTransitionEnd(event: CustomEvent) {\n event.stopPropagation();\n if (event.target !== this.el) return;\n\n if (this.expanded) {\n this.bqAfterOpen.emit(this.el);\n return;\n }\n\n this.bqAfterClose.emit(this.el);\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 handleClick = (event: MouseEvent) => {\n event.preventDefault();\n\n if (this.disabled) return;\n\n this.bqClick.emit(this.el);\n this.expanded = !this.expanded;\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem, 'suffix');\n };\n\n private get open() {\n return this.expanded && !this.disabled;\n }\n\n private get isCssCalcSizeSupported() {\n return window.CSS?.supports('(block-size: calc-size(auto))');\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <details\n class={{\n [`bq-accordion overflow-hidden ${this.size} ${this.appearance}`]: true,\n 'no-animation': this.noAnimation,\n disabled: this.disabled,\n }}\n ref={(detailsElem: HTMLDetailsElement) => (this.detailsElem = detailsElem)}\n open={this.open}\n part=\"base\"\n >\n <summary\n class=\"bq-accordion__header\"\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n aria-expanded={this.expanded}\n aria-disabled={this.disabled}\n aria-controls=\"bq-accordion__body\"\n tabindex={this.disabled ? -1 : 0}\n part=\"header\"\n >\n <div\n ref={(element) => (this.prefixElem = element)}\n class={{ 'bq-accordion__header--prefix': true, '!hidden': !this.hasPrefix }}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </div>\n <div class=\"bq-accordion__header--text\" part=\"text\">\n <slot name=\"header\" />\n </div>\n <div\n ref={(element) => (this.suffixElem = element)}\n class={{ 'bq-accordion__header--suffix': true, '!hidden': !this.hasSuffix }}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange} />\n </div>\n <div\n class={{\n 'flex items-center justify-center transition-transform duration-300 ease-in-out': true,\n '!hidden': this.open && !this.rotate,\n 'rotate-180': this.rotate && this.open,\n }}\n >\n <slot name=\"expand\">\n <bq-icon name=\"plus\" />\n </slot>\n </div>\n <div\n class={{ 'flex items-center justify-center': true, '!hidden': (!this.open && !this.rotate) || this.rotate }}\n >\n <slot name=\"collapse\">\n <bq-icon name=\"minus\" />\n </slot>\n </div>\n </summary>\n <div id=\"bq-accordion__body\" class=\"bq-accordion__body overflow-hidden\" part=\"panel\">\n <slot />\n </div>\n </details>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bq-accordion.js","mappings":";;;;;;;;;AAAO,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGpD,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;;ACHhE;AACA;AACA;MAEa,SAAS;IACZ,EAAE,CAAqB;IACvB,MAAM,CAAc;IACpB,KAAK,CAA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I;aACvC,IAED,6DAAM,IAAI,EAAC,QAAQ,IACjB,gEAAS,IAAI,EAAC,MAAM,GAAG,CAClB,CACH,EACN,4DACE,KAAK,EAAE,EAAE,kCAAkC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,IAE3G,6DAAM,IAAI,EAAC,UAAU,IACnB,gEAAS,IAAI,EAAC,OAAO,GAAG,CACnB,CACH,CACE,EACV,4DAAK,EAAE,EAAC,oBAAoB,EAAC,KAAK,EAAC,oCAAoC,EAAC,IAAI,EAAC,OAAO,IAClF,8DAAQ,CACJ,CACE,EACV;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BqAccordion"],"sources":["../../packages/beeq/src/components/accordion/bq-accordion.types.ts","../../packages/beeq/src/components/accordion/helper/index.ts","../../packages/beeq/src/components/accordion/scss/bq-accordion.scss?tag=bq-accordion&encapsulation=shadow","../../packages/beeq/src/components/accordion/bq-accordion.tsx"],"sourcesContent":["export const ACCORDION_SIZE = ['small', 'medium'] as const;\nexport type TAccordionSize = (typeof ACCORDION_SIZE)[number];\n\nexport const ACCORDION_APPEARANCE = ['filled', 'ghost'] as const;\nexport type TAccordionAppearance = (typeof ACCORDION_APPEARANCE)[number];\n","/* -------------------------------------------------------------------------------------- */\n/* 💡 Credits: https://css-tricks.com/how-to-animate-the-details-element-using-waapi */\n/* -------------------------------------------------------------------------------------- */\n\nexport class Accordion {\n private el: HTMLDetailsElement;\n private header: HTMLElement;\n private panel: HTMLElement;\n private animation: Animation | null;\n private isClosing: boolean;\n private isExpanding: boolean;\n private animationOptions = {\n duration: 200,\n easing: 'ease-in-out',\n };\n\n constructor(el: HTMLDetailsElement) {\n // Store the <details> element\n this.el = el;\n // Store the <summary> header element\n this.header = el.querySelector('summary');\n // Store the <div class=\"content\"> element\n this.panel = el.querySelector('.bq-accordion__body');\n // Store the animation object (so we can cancel it, if needed)\n this.animation = null;\n // Store if the element is closing\n this.isClosing = false;\n // Store if the element is expanding\n this.isExpanding = false;\n }\n\n public open() {\n // Check if the element is being closed or is already closed\n if (!this.isClosing && this.el.open) return;\n // Apply a fixed height on the element\n this.el.style.height = `${this.el.offsetHeight}px`;\n // Force the [open] attribute on the details element\n this.el.open = true;\n // Wait for the next frame to call the expand function\n window.requestAnimationFrame(() => this.expand());\n }\n\n public close() {\n // Check if the element is being opened or is already open\n if (!this.isExpanding && !this.el.open) return;\n // Set the element as \"being closed\"\n this.isClosing = true;\n\n // Store the current height of the element\n const startHeight = `${this.el.offsetHeight}px`;\n // Calculate the height of the <summary> header\n const endHeight = `${this.header.offsetHeight}px`;\n\n // If there is already an animation running\n if (this.animation) {\n // Cancel the current animation\n this.animation.cancel();\n }\n\n // Start a WAAPI animation\n this.animation = this.el.animate({ height: [startHeight, endHeight] }, this.animationOptions);\n // When the animation is complete, call onAnimationFinish()\n this.animation.onfinish = () => this.onAnimationFinish(false);\n // If the animation is cancelled, isClosing variable is set to false\n this.animation.oncancel = () => (this.isClosing = false);\n }\n\n // Expands the accordion\n private expand() {\n // Set the element as \"being expanding\"\n this.isExpanding = true;\n // Get the current fixed height of the element\n const startHeight = `${this.el.offsetHeight}px`;\n // Calculate the open height of the element (summary header height + panel body height)\n const endHeight = `${this.header.offsetHeight + this.panel.offsetHeight}px`;\n\n // If there is already an animation running\n if (this.animation) {\n // Cancel the current animation\n this.animation.cancel();\n }\n\n // Start a WAAPI animation\n this.animation = this.el.animate({ height: [startHeight, endHeight] }, this.animationOptions);\n // When the animation is complete, call onAnimationFinish()\n this.animation.onfinish = () => this.onAnimationFinish(true);\n // If the animation is cancelled, isExpanding variable is set to false\n this.animation.oncancel = () => (this.isExpanding = false);\n }\n\n // Handles the end of the animation\n private onAnimationFinish(open: boolean) {\n // Set the open attribute based on the parameter\n this.el.open = open;\n // Clear the stored animation\n this.animation = null;\n // Reset isClosing & isExpanding\n this.isClosing = false;\n this.isExpanding = false;\n // Remove the overflow hidden and the fixed height\n this.el.removeAttribute('style');\n // Dispatch a custom event based on the open parameter\n const endEvent = new Event('accordionTransitionEnd', { bubbles: false, composed: true });\n this.el.dispatchEvent(endEvent);\n }\n}\n","/* -------------------------------------------------------------------------- */\n/* Accordion styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-accordion.variables';\n\n:host {\n @apply block;\n}\n\n.bq-accordion {\n &.disabled {\n @apply cursor-not-allowed opacity-60;\n\n .bq-accordion__header {\n @apply pointer-events-none;\n }\n }\n\n &.small .bq-accordion__header {\n @apply gap-[--bq-accordion--small-gap] pe-[--bq-accordion--small-padding-end] ps-[--bq-accordion--small-padding-start] p-b-[--bq-accordion--small-padding-y];\n @apply rounded-ee-[--bq-accordion--small-radius] rounded-es-[--bq-accordion--small-radius] rounded-se-[--bq-accordion--small-radius] rounded-ss-[--bq-accordion--small-radius];\n }\n\n &.medium .bq-accordion__header {\n @apply gap-[--bq-accordion--medium-gap] pe-[--bq-accordion--medium-padding-end] ps-[--bq-accordion--medium-padding-start] p-b-[--bq-accordion--medium-padding-y];\n @apply rounded-ee-[--bq-accordion--medium-radius] rounded-es-[--bq-accordion--medium-radius] rounded-se-[--bq-accordion--medium-radius] rounded-ss-[--bq-accordion--medium-radius];\n }\n\n &[open] .bq-accordion__header {\n @apply border-[length:--bq-accordion--expanded-border-width] border-[color:--bq-accordion--expanded-border-color];\n @apply rounded-ee-[0px] rounded-es-[0px];\n\n border-style: var(--bq-accordion--expanded-border-style);\n }\n\n &.small .bq-accordion__body {\n @apply rounded-ee-[--bq-accordion--small-radius] rounded-es-[--bq-accordion--small-radius] rounded-se-[0px] rounded-ss-[0px];\n }\n\n &.medium .bq-accordion__body {\n @apply rounded-ee-[--bq-accordion--medium-radius] rounded-es-[--bq-accordion--medium-radius] rounded-se-[0px] rounded-ss-[0px];\n }\n\n &.filled {\n .bq-accordion__header {\n @apply bg-[--bq-accordion--filled-collapsed-background] hover:bg-hover-ui-secondary;\n }\n\n .bq-accordion__header--text {\n @apply text-[--bq-accordion--filled-collapsed-text-color];\n }\n\n .bq-accordion__body {\n @apply border-[length:--bq-accordion--panel-filled-border-width] border-[color:--bq-accordion--panel-filled-border-color];\n\n border-style: var(--bq-accordion--panel-filled-border-style);\n }\n\n &[open] .bq-accordion__header {\n @apply bg-[--bq-accordion--filled-expanded-background] hover:bg-hover-ui-secondary;\n }\n\n &[open] .bq-accordion__header--text {\n @apply text-[--bq-accordion--filled-expanded-text-color];\n }\n }\n\n &.ghost {\n .bq-accordion__header {\n @apply bg-[--bq-accordion--ghost-collapsed-background] hover:bg-hover-ui-secondary;\n }\n\n .bq-accordion__header--text {\n @apply text-[--bq-accordion--ghost-collapsed-text-color];\n }\n\n .bq-accordion__body {\n @apply border-[length:--bq-accordion--panel-ghost-border-width] border-[color:--bq-accordion--panel-ghost-border-color];\n\n border-style: var(--bq-accordion--panel-ghost-border-style);\n }\n\n &[open] .bq-accordion__header {\n @apply bg-[--bq-accordion--ghost-expanded-background] hover:bg-hover-ui-secondary;\n }\n\n &[open] .bq-accordion__header--text {\n @apply text-[--bq-accordion--ghost-expanded-text-color];\n }\n }\n\n &.small.filled .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-small-filled-padding-end] ps-[--bq-accordion--panel-small-filled-padding-start] p-b-[--bq-accordion--panel-small-filled-padding-y];\n }\n\n &.medium.filled .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-medium-filled-padding-end] ps-[--bq-accordion--panel-medium-filled-padding-start] p-b-[--bq-accordion--panel-medium-filled-padding-y];\n }\n\n &.small.ghost .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-small-ghost-padding-end] ps-[--bq-accordion--panel-small-ghost-padding-start] p-b-[--bq-accordion--panel-small-ghost-padding-y];\n }\n\n &.medium.ghost .bq-accordion__body {\n @apply pe-[--bq-accordion--panel-medium-ghost-padding-end] ps-[--bq-accordion--panel-medium-ghost-padding-start] p-b-[--bq-accordion--panel-medium-ghost-padding-y];\n }\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion::details-content {\n @apply block overflow-hidden transition-[block-size,content-visibility] duration-300 ease-in-out bs-0 [transition-behavior:allow-discrete];\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion[open]::details-content {\n /* block-size: auto is just a fallback for browsers that don't support the calc-size() function */\n @apply bs-auto;\n}\n\n/* stylelint-disable-next-line selector-pseudo-element-no-unknown */\n.bq-accordion[open]:not(.no-animation)::details-content {\n @apply supports-[block-size:calc-size(auto)]:bs-[calc-size(auto)];\n}\n\n.bq-accordion__header {\n // Since there's an overflow on the <summary> element, the focus outline is not visible,\n // so we force it to be inset to avoid the overflow hidden.\n --bq-ring-offset-width: -2px;\n\n @apply flex cursor-pointer select-none list-none items-center transition-colors duration-300 ease-in-out focus-visible:focus;\n @apply border-[length:--bq-accordion--collapsed-border-width] border-[color:--bq-accordion--collapsed-border-color];\n\n border-style: var(--bq-accordion--collapsed-border-style);\n\n &::marker,\n &::-webkit-details-marker {\n @apply hidden;\n }\n}\n\n.bq-accordion__header--text {\n @apply flex-1;\n}\n\n.bq-accordion__header--prefix,\n.bq-accordion__header--suffix {\n @apply flex items-center justify-center;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\n\nimport { ACCORDION_APPEARANCE, ACCORDION_SIZE, TAccordionAppearance, TAccordionSize } from './bq-accordion.types';\nimport { Accordion } from './helper';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The `<details>` that holds the accordion content\n * @part header - The `<summary>` that holds the accordion header content\n * @part prefix - The `<div>` that holds the accordion text prefix icon / avatar\n * @part text - The `<div>` that holds the accordion header text\n * @part suffix - The `<div>` that holds the accordion text suffix icon\n * @part panel - The `<div>` that holds the accordion panel content\n */\n@Component({\n tag: 'bq-accordion',\n styleUrl: './scss/bq-accordion.scss',\n shadow: true,\n})\nexport class BqAccordion {\n // Own Properties\n // ====================\n\n private accordion: Accordion;\n private prefixElem: HTMLDivElement;\n private suffixElem: HTMLDivElement;\n private detailsElem: HTMLDetailsElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqAccordionElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n @State() private hasSuffix = false;\n\n // Public Property API\n // ========================\n\n /** The appearance style of accordion */\n @Prop({ reflect: true, mutable: true }) appearance: TAccordionAppearance = 'filled';\n\n /** If true accordion is disabled */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If true accordion is expanded */\n @Prop({ reflect: true, mutable: true }) expanded: boolean = false;\n\n /**\n * Animation is set through JS when the browser does not support CSS calc-size()\n * If true, the accordion animation, will be disabled. No animation will be applied.\n */\n @Prop({ reflect: true }) noAnimation: boolean = false;\n\n /** If true accordion expand icon is rotate 180deg when expanded */\n @Prop({ reflect: true }) rotate: boolean = false;\n\n /** The size of accordion */\n @Prop({ reflect: true, mutable: true }) size: TAccordionSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(ACCORDION_SIZE, 'medium', this.el, 'size');\n validatePropValue(ACCORDION_APPEARANCE, 'filled', this.el, 'appearance');\n }\n\n @Watch('expanded')\n handleExpandedChange() {\n const event = this.expanded ? this.bqOpen.emit(this.el) : this.bqClose.emit(this.el);\n if (event.defaultPrevented) {\n this.expanded = !this.expanded;\n return;\n }\n\n if (this.expanded) {\n this.accordion?.open();\n } else {\n this.accordion?.close();\n }\n if (!this.isCssCalcSizeSupported) return;\n\n // NOTE: This is a workaround to trigger the transitionEnd event\n // when the open/close animation is handled via CSS instead of JS\n setTimeout(() => {\n this.el.dispatchEvent(new CustomEvent('accordionTransitionEnd', { bubbles: false, composed: true }));\n }, 200);\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.disabled) return;\n\n this.expanded = false;\n }\n\n @Watch('noAnimation')\n handleJsAnimation() {\n if (this.isCssCalcSizeSupported) return;\n\n console.warn(\n `[bq-accordion] calc-size() is not supported and animation will be set through JS\n For vertical layout, consider using the 'noAnimation' prop ('no-animation' attribute) to disable it`,\n );\n this.accordion = !this.noAnimation ? new Accordion(this.detailsElem) : null;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the accordion loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion is opened */\n @Event() bqOpen: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called after the accordion is opened */\n @Event() bqAfterOpen: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called when the accordion is closed */\n @Event() bqClose: EventEmitter<HTMLBqAccordionElement>;\n\n /** Handler to be called after the accordion is closed */\n @Event() bqAfterClose: EventEmitter<HTMLBqAccordionElement>;\n\n /** @internal Handler to be called when the accordion is clicked */\n @Event() bqClick: EventEmitter<HTMLBqAccordionElement>;\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.handleJsAnimation();\n this.handleExpandedChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('accordionTransitionEnd')\n onAccordionTransitionEnd(event: CustomEvent) {\n event.stopPropagation();\n if (event.target !== this.el) return;\n\n if (this.expanded) {\n this.bqAfterOpen.emit(this.el);\n return;\n }\n\n this.bqAfterClose.emit(this.el);\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 handleClick = (event: MouseEvent) => {\n event.preventDefault();\n\n if (this.disabled) return;\n\n this.bqClick.emit(this.el);\n this.expanded = !this.expanded;\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem, 'suffix');\n };\n\n private get open() {\n return this.expanded && !this.disabled;\n }\n\n private get isCssCalcSizeSupported() {\n return window.CSS?.supports('(block-size: calc-size(auto))');\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <details\n class={{\n [`bq-accordion overflow-hidden ${this.size} ${this.appearance}`]: true,\n 'no-animation': this.noAnimation,\n disabled: this.disabled,\n }}\n ref={(detailsElem: HTMLDetailsElement) => (this.detailsElem = detailsElem)}\n open={this.open}\n part=\"base\"\n >\n <summary\n class=\"bq-accordion__header\"\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n aria-expanded={this.expanded}\n aria-disabled={this.disabled}\n aria-controls=\"bq-accordion__body\"\n tabindex={this.disabled ? -1 : 0}\n part=\"header\"\n >\n <div\n ref={(element) => (this.prefixElem = element)}\n class={{ 'bq-accordion__header--prefix': true, '!hidden': !this.hasPrefix }}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </div>\n <div class=\"bq-accordion__header--text\" part=\"text\">\n <slot name=\"header\" />\n </div>\n <div\n ref={(element) => (this.suffixElem = element)}\n class={{ 'bq-accordion__header--suffix': true, '!hidden': !this.hasSuffix }}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange} />\n </div>\n <div\n class={{\n 'flex items-center justify-center transition-transform duration-300 ease-in-out': true,\n '!hidden': this.open && !this.rotate,\n 'rotate-180': this.rotate && this.open,\n }}\n >\n <slot name=\"expand\">\n <bq-icon name=\"plus\" />\n </slot>\n </div>\n <div\n class={{ 'flex items-center justify-center': true, '!hidden': (!this.open && !this.rotate) || this.rotate }}\n >\n <slot name=\"collapse\">\n <bq-icon name=\"minus\" />\n </slot>\n </div>\n </summary>\n <div id=\"bq-accordion__body\" class=\"bq-accordion__body overflow-hidden\" part=\"panel\">\n <slot />\n </div>\n </details>\n );\n }\n}\n"],"version":3}
|