@beeq/core 1.8.0-beta.1 → 1.8.0-beta.3
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 -43
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +1 -64
- package/dist/beeq/index.esm.js.map +1 -1
- package/dist/beeq/p-010fb578.entry.js +6 -0
- package/dist/beeq/{p-2bb65f53.entry.js.map → p-010fb578.entry.js.map} +1 -1
- package/dist/beeq/p-05b44bb7.entry.js +6 -0
- package/dist/beeq/p-05b44bb7.entry.js.map +1 -0
- package/dist/beeq/p-0cbec77b.entry.js +6 -0
- package/dist/beeq/p-0cbec77b.entry.js.map +1 -0
- package/dist/beeq/p-115ed5b2.js +1 -25
- package/dist/beeq/p-115ed5b2.js.map +1 -1
- package/dist/beeq/p-1202161d.entry.js +6 -0
- package/dist/beeq/{p-ffddc425.entry.js.map → p-1202161d.entry.js.map} +1 -1
- package/dist/beeq/p-17b341dd.entry.js +6 -0
- package/dist/beeq/{p-81f1c3ba.entry.js.map → p-17b341dd.entry.js.map} +1 -1
- package/dist/beeq/p-1c8b6eb4.js +1 -12
- package/dist/beeq/p-1c8b6eb4.js.map +1 -1
- package/dist/beeq/p-1d81f9e5.entry.js +6 -0
- package/dist/beeq/p-1d81f9e5.entry.js.map +1 -0
- package/dist/beeq/p-1f3a4359.js +1 -11
- package/dist/beeq/p-1f3a4359.js.map +1 -1
- package/dist/beeq/p-2714ce21.entry.js +6 -0
- package/dist/beeq/{p-db18eba1.entry.js.map → p-2714ce21.entry.js.map} +1 -1
- package/dist/beeq/p-2e61db84.entry.js +6 -0
- package/dist/beeq/{p-e88257a8.entry.js.map → p-2e61db84.entry.js.map} +1 -1
- package/dist/beeq/p-32f74048.entry.js +6 -0
- package/dist/beeq/p-32f74048.entry.js.map +1 -0
- package/dist/beeq/p-339d14c8.entry.js +6 -0
- package/dist/beeq/{p-822773ae.entry.js.map → p-339d14c8.entry.js.map} +1 -1
- package/dist/beeq/p-35ec6cac.entry.js +6 -0
- package/dist/beeq/{p-e9a54b49.entry.js.map → p-35ec6cac.entry.js.map} +1 -1
- package/dist/beeq/p-38d4bd8a.js +1 -1934
- package/dist/beeq/p-38d4bd8a.js.map +1 -1
- package/dist/beeq/p-3ea228d3.entry.js +6 -0
- package/dist/beeq/{p-bf2320dd.entry.js.map → p-3ea228d3.entry.js.map} +1 -1
- package/dist/beeq/p-3fd0d92d.js +1 -1228
- package/dist/beeq/p-3fd0d92d.js.map +1 -1
- package/dist/beeq/p-45b7b5cf.entry.js +6 -0
- package/dist/beeq/{p-36652891.entry.js.map → p-45b7b5cf.entry.js.map} +1 -1
- package/dist/beeq/p-45e674b4.entry.js +6 -0
- package/dist/beeq/{p-dd950c12.entry.js.map → p-45e674b4.entry.js.map} +1 -1
- package/dist/beeq/p-4954154f.entry.js +6 -0
- package/dist/beeq/{p-e41f07ae.entry.js.map → p-4954154f.entry.js.map} +1 -1
- package/dist/beeq/p-513bab02.js +6 -0
- package/dist/beeq/{p-4688e046.js.map → p-513bab02.js.map} +1 -1
- package/dist/beeq/p-57621be1.js +1 -9
- package/dist/beeq/p-57621be1.js.map +1 -1
- package/dist/beeq/p-5a9a73a0.js +6 -0
- package/dist/beeq/p-5a9a73a0.js.map +1 -0
- package/dist/beeq/p-5f3ce05a.entry.js +6 -0
- package/dist/beeq/p-5f3ce05a.entry.js.map +1 -0
- package/dist/beeq/p-6823479d.entry.js +6 -0
- package/dist/beeq/{p-49249dda.entry.js.map → p-6823479d.entry.js.map} +1 -1
- package/dist/beeq/p-687da041.js +1 -20
- package/dist/beeq/p-687da041.js.map +1 -1
- package/dist/beeq/p-76e714c6.js +7 -0
- package/dist/beeq/p-76e714c6.js.map +1 -0
- package/dist/beeq/p-7871f3f0.entry.js +6 -0
- package/dist/beeq/{p-297fb76b.entry.js.map → p-7871f3f0.entry.js.map} +1 -1
- package/dist/beeq/p-7a049750.entry.js +6 -0
- package/dist/beeq/{p-ac969486.entry.js.map → p-7a049750.entry.js.map} +1 -1
- package/dist/beeq/p-83207939.entry.js +6 -0
- package/dist/beeq/{p-0f48adcc.entry.js.map → p-83207939.entry.js.map} +1 -1
- package/dist/beeq/p-8d8993ba.entry.js +6 -0
- package/dist/beeq/p-8d8993ba.entry.js.map +1 -0
- package/dist/beeq/p-9406afc0.entry.js +6 -0
- package/dist/beeq/{p-fd658de1.entry.js.map → p-9406afc0.entry.js.map} +1 -1
- package/dist/beeq/p-94899104.entry.js +6 -0
- package/dist/beeq/p-94899104.entry.js.map +1 -0
- package/dist/beeq/p-951ba558.js +1 -64
- package/dist/beeq/p-951ba558.js.map +1 -1
- package/dist/beeq/p-95d0abdc.entry.js +6 -0
- package/dist/beeq/{p-e301647a.entry.js.map → p-95d0abdc.entry.js.map} +1 -1
- package/dist/beeq/p-99829fc7.js +1 -8
- package/dist/beeq/p-99829fc7.js.map +1 -1
- package/dist/beeq/p-9da0e8d7.entry.js +6 -0
- package/dist/beeq/{p-a6489187.entry.js.map → p-9da0e8d7.entry.js.map} +1 -1
- package/dist/beeq/p-a535a72f.entry.js +6 -0
- package/dist/beeq/{p-a1b43de6.entry.js.map → p-a535a72f.entry.js.map} +1 -1
- package/dist/beeq/p-a5a17e6e.entry.js +6 -0
- package/dist/beeq/{p-242ac28a.entry.js.map → p-a5a17e6e.entry.js.map} +1 -1
- package/dist/beeq/p-a5dc1c94.js +1 -118
- package/dist/beeq/p-a5dc1c94.js.map +1 -1
- package/dist/beeq/p-a8cad5ab.js +1 -5
- package/dist/beeq/p-a8cad5ab.js.map +1 -1
- package/dist/beeq/p-af062402.js +1 -7
- package/dist/beeq/p-af062402.js.map +1 -1
- package/dist/beeq/p-b2acd8f3.entry.js +6 -0
- package/dist/beeq/{p-5e11b866.entry.js.map → p-b2acd8f3.entry.js.map} +1 -1
- package/dist/beeq/p-b7f02fb6.entry.js +6 -0
- package/dist/beeq/{p-ffb48c40.entry.js.map → p-b7f02fb6.entry.js.map} +1 -1
- package/dist/beeq/p-b994054a.entry.js +6 -0
- package/dist/beeq/p-b994054a.entry.js.map +1 -0
- package/dist/beeq/p-be4941d0.entry.js +6 -0
- package/dist/beeq/{p-f77d9b8b.entry.js.map → p-be4941d0.entry.js.map} +1 -1
- package/dist/beeq/p-d5992d3d.entry.js +6 -0
- package/dist/beeq/{p-39b7c578.entry.js.map → p-d5992d3d.entry.js.map} +1 -1
- package/dist/beeq/p-d7a88b16.js +1 -87
- package/dist/beeq/p-d7a88b16.js.map +1 -1
- package/dist/beeq/p-dd206dba.entry.js +6 -0
- package/dist/beeq/{p-57a55ac5.entry.js.map → p-dd206dba.entry.js.map} +1 -1
- package/dist/beeq/p-ded1aed2.entry.js +6 -0
- package/dist/beeq/{p-14b44a4b.entry.js.map → p-ded1aed2.entry.js.map} +1 -1
- package/dist/beeq/p-e08d9b52.entry.js +6 -0
- package/dist/beeq/p-e08d9b52.entry.js.map +1 -0
- package/dist/beeq/p-e572b038.entry.js +6 -0
- package/dist/beeq/{p-e3aa2886.entry.js.map → p-e572b038.entry.js.map} +1 -1
- package/dist/beeq/p-e5afdf8c.js +6 -0
- package/dist/beeq/p-e5afdf8c.js.map +1 -0
- package/dist/beeq/p-e7ede06e.entry.js +6 -0
- package/dist/beeq/{p-afc9fd80.entry.js.map → p-e7ede06e.entry.js.map} +1 -1
- package/dist/beeq/p-ecd27cf2.js +1 -11
- package/dist/beeq/p-ecd27cf2.js.map +1 -1
- package/dist/beeq/p-f7a0a316.entry.js +6 -0
- package/dist/beeq/{p-548b45b7.entry.js.map → p-f7a0a316.entry.js.map} +1 -1
- package/dist/beeq/p-fbf6b04b.entry.js +6 -0
- package/dist/beeq/{p-39d77ba6.entry.js.map → p-fbf6b04b.entry.js.map} +1 -1
- package/dist/cjs/app-globals-b11284b9.js.map +1 -1
- package/dist/cjs/{assetsPath-3938a05d.js → assetsPath-7ead23b7.js} +19 -8
- package/dist/cjs/assetsPath-7ead23b7.js.map +1 -0
- package/dist/cjs/beeq.cjs.js +2 -2
- package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bq-alert.cjs.entry.js +19 -25
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +5 -5
- package/dist/cjs/bq-badge.cjs.entry.js +5 -5
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +6 -6
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/bq-button_2.cjs.entry.js +19 -11
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +4 -4
- package/dist/cjs/bq-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/bq-date-picker.cjs.entry.js +9 -6
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +7 -7
- package/dist/cjs/bq-divider.cjs.entry.js +10 -7
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +7 -7
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +3 -3
- package/dist/cjs/bq-empty-state.cjs.entry.js +6 -6
- package/dist/cjs/bq-input.cjs.entry.js +7 -7
- package/dist/cjs/bq-notification.cjs.entry.js +26 -19
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-option-list_2.cjs.entry.js +7 -7
- package/dist/cjs/bq-option.cjs.entry.js +6 -6
- package/dist/cjs/bq-page-title.cjs.entry.js +4 -4
- package/dist/cjs/bq-progress.cjs.entry.js +6 -6
- package/dist/cjs/bq-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/bq-radio.cjs.entry.js +3 -3
- package/dist/cjs/bq-select.cjs.entry.js +17 -11
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-side-menu.cjs.entry.js +3 -3
- package/dist/cjs/bq-slider.cjs.entry.js +12 -6
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +7 -7
- package/dist/cjs/bq-status.cjs.entry.js +3 -3
- package/dist/cjs/bq-step-item.cjs.entry.js +9 -6
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +3 -3
- package/dist/cjs/bq-switch.cjs.entry.js +4 -4
- package/dist/cjs/bq-tab-group.cjs.entry.js +5 -5
- package/dist/cjs/bq-tab.cjs.entry.js +4 -4
- package/dist/cjs/bq-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bq-toast.cjs.entry.js +29 -31
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/{cssVariables-7139f0c6.js → cssVariables-a0e1e906.js} +3 -1
- package/dist/cjs/cssVariables-a0e1e906.js.map +1 -0
- package/dist/cjs/{index-1d3aac65.js → index-e6d59dbb.js} +2 -20
- package/dist/cjs/index-e6d59dbb.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{isDefined-750bffc4.js → isDefined-a9dd6d5b.js} +2 -2
- package/dist/cjs/{isDefined-750bffc4.js.map → isDefined-a9dd6d5b.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/alert/bq-alert.js +26 -26
- package/dist/collection/components/alert/bq-alert.js.map +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/avatar/bq-avatar.js +3 -3
- package/dist/collection/components/badge/bq-badge.js +2 -2
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +3 -3
- package/dist/collection/components/button/bq-button.js +2 -2
- package/dist/collection/components/card/bq-card.js +2 -2
- package/dist/collection/components/checkbox/bq-checkbox.js +2 -2
- package/dist/collection/components/date-picker/bq-date-picker.js +6 -3
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/dialog/bq-dialog.js +4 -4
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/divider/bq-divider.js +7 -4
- package/dist/collection/components/divider/bq-divider.js.map +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +4 -4
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/dropdown/bq-dropdown.js +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +4 -4
- package/dist/collection/components/icon/bq-icon.js +13 -7
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/icon/helper/request.js +2 -0
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/input/bq-input.js +4 -4
- package/dist/collection/components/notification/bq-notification.js +31 -17
- 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/option/bq-option.js +4 -4
- package/dist/collection/components/option-group/bq-option-group.js +1 -1
- package/dist/collection/components/option-list/bq-option-list.js +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +2 -2
- package/dist/collection/components/panel/bq-panel.js +1 -1
- package/dist/collection/components/progress/bq-progress.js +4 -4
- package/dist/collection/components/radio/bq-radio.js +2 -2
- package/dist/collection/components/radio-group/bq-radio-group.js +1 -1
- package/dist/collection/components/select/bq-select.js +14 -8
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +1 -1
- package/dist/collection/components/slider/bq-slider.js +10 -4
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +4 -4
- package/dist/collection/components/status/bq-status.js +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +7 -4
- package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
- package/dist/collection/components/steps/bq-steps.js +1 -1
- package/dist/collection/components/switch/bq-switch.js +2 -2
- package/dist/collection/components/tab/bq-tab.js +2 -2
- package/dist/collection/components/tab-group/bq-tab-group.js +3 -3
- package/dist/collection/components/tag/bq-tag.js +3 -3
- package/dist/collection/components/textarea/bq-textarea.js +3 -3
- package/dist/collection/components/toast/bq-toast.js +35 -29
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +1 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/shared/utils/assetsPath.js +18 -7
- package/dist/collection/shared/utils/assetsPath.js.map +1 -1
- package/dist/collection/shared/utils/cssVariables.js +2 -0
- package/dist/collection/shared/utils/cssVariables.js.map +1 -1
- package/dist/components/assetsPath.js +18 -7
- package/dist/components/assetsPath.js.map +1 -1
- package/dist/components/bq-alert.js +17 -23
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +3 -3
- package/dist/components/bq-badge2.js +2 -2
- package/dist/components/bq-breadcrumb-item.js +3 -3
- package/dist/components/bq-breadcrumb.js +1 -1
- package/dist/components/bq-button2.js +2 -2
- package/dist/components/bq-card.js +2 -2
- package/dist/components/bq-checkbox.js +2 -2
- package/dist/components/bq-date-picker.js +6 -3
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +5 -5
- package/dist/components/bq-divider2.js +7 -4
- package/dist/components/bq-divider2.js.map +1 -1
- package/dist/components/bq-drawer.js +5 -5
- package/dist/components/bq-dropdown2.js +1 -1
- package/dist/components/bq-empty-state.js +4 -4
- package/dist/components/bq-icon2.js +13 -5
- package/dist/components/bq-icon2.js.map +1 -1
- package/dist/components/bq-input.js +4 -4
- package/dist/components/bq-notification.js +25 -17
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -1
- package/dist/components/bq-option-list2.js +1 -1
- package/dist/components/bq-option.js +4 -4
- package/dist/components/bq-page-title.js +2 -2
- package/dist/components/bq-panel2.js +1 -1
- package/dist/components/bq-progress.js +4 -4
- package/dist/components/bq-radio-group.js +1 -1
- package/dist/components/bq-radio.js +2 -2
- package/dist/components/bq-select.js +14 -8
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu.js +1 -1
- package/dist/components/bq-slider.js +10 -4
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +4 -4
- package/dist/components/bq-status.js +1 -1
- package/dist/components/bq-step-item.js +7 -4
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -1
- package/dist/components/bq-switch.js +2 -2
- package/dist/components/bq-tab-group.js +3 -3
- package/dist/components/bq-tab.js +2 -2
- package/dist/components/bq-tag2.js +3 -3
- package/dist/components/bq-textarea.js +3 -3
- package/dist/components/bq-toast.js +28 -29
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip2.js +1 -1
- package/dist/components/cssVariables.js +2 -0
- package/dist/components/cssVariables.js.map +1 -1
- package/dist/esm/app-globals-de5a646b.js.map +1 -1
- package/dist/esm/{assetsPath-a1b58980.js → assetsPath-c02b0e16.js} +19 -8
- package/dist/esm/assetsPath-c02b0e16.js.map +1 -0
- package/dist/esm/beeq.js +3 -3
- package/dist/esm/bq-accordion-group.entry.js +2 -2
- package/dist/esm/bq-accordion.entry.js +2 -2
- package/dist/esm/bq-alert.entry.js +19 -25
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +5 -5
- package/dist/esm/bq-badge.entry.js +5 -5
- package/dist/esm/bq-breadcrumb-item.entry.js +6 -6
- package/dist/esm/bq-breadcrumb.entry.js +3 -3
- package/dist/esm/bq-button_2.entry.js +19 -11
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +4 -4
- package/dist/esm/bq-checkbox.entry.js +4 -4
- package/dist/esm/bq-date-picker.entry.js +9 -6
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +7 -7
- package/dist/esm/bq-divider.entry.js +10 -7
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +7 -7
- package/dist/esm/bq-dropdown_2.entry.js +3 -3
- package/dist/esm/bq-empty-state.entry.js +6 -6
- package/dist/esm/bq-input.entry.js +7 -7
- package/dist/esm/bq-notification.entry.js +26 -19
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +2 -2
- package/dist/esm/bq-option-list_2.entry.js +7 -7
- package/dist/esm/bq-option.entry.js +6 -6
- package/dist/esm/bq-page-title.entry.js +4 -4
- package/dist/esm/bq-progress.entry.js +6 -6
- package/dist/esm/bq-radio-group.entry.js +3 -3
- package/dist/esm/bq-radio.entry.js +3 -3
- package/dist/esm/bq-select.entry.js +17 -11
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +2 -2
- package/dist/esm/bq-side-menu.entry.js +3 -3
- package/dist/esm/bq-slider.entry.js +12 -6
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +7 -7
- package/dist/esm/bq-status.entry.js +3 -3
- package/dist/esm/bq-step-item.entry.js +9 -6
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +3 -3
- package/dist/esm/bq-switch.entry.js +4 -4
- package/dist/esm/bq-tab-group.entry.js +5 -5
- package/dist/esm/bq-tab.entry.js +4 -4
- package/dist/esm/bq-textarea.entry.js +5 -5
- package/dist/esm/bq-toast.entry.js +29 -31
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +2 -2
- package/dist/esm/{cssVariables-5ffccc29.js → cssVariables-23e3ca0d.js} +3 -1
- package/dist/esm/cssVariables-23e3ca0d.js.map +1 -0
- package/dist/esm/{index-f69556fe.js → index-efc1c2ef.js} +2 -20
- package/dist/esm/index-efc1c2ef.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/{isDefined-170f3095.js → isDefined-1e676215.js} +2 -2
- package/dist/esm/{isDefined-170f3095.js.map → isDefined-1e676215.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hydrate/index.js +233 -175
- package/dist/hydrate/index.mjs +233 -175
- package/dist/stencil.config.js +6 -3
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System/packages/beeq/.stencil/packages/beeq/stencil.config.d.ts +2 -0
- package/dist/types/components/alert/bq-alert.d.ts +10 -4
- package/dist/types/components/date-picker/bq-date-picker.d.ts +1 -0
- package/dist/types/components/divider/bq-divider.d.ts +1 -0
- package/dist/types/components/icon/bq-icon.d.ts +3 -1
- package/dist/types/components/notification/bq-notification.d.ts +8 -0
- package/dist/types/components/select/bq-select.d.ts +2 -0
- package/dist/types/components/slider/bq-slider.d.ts +2 -0
- package/dist/types/components/step-item/bq-step-item.d.ts +1 -0
- package/dist/types/components/toast/bq-toast.d.ts +5 -0
- package/dist/types/components.d.ts +8 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/utils/assetsPath.d.ts +1 -1
- package/dist/types/shared/utils/cssVariables.d.ts +1 -1
- package/package.json +4 -4
- package/dist/beeq/p-063a3968.entry.js +0 -388
- package/dist/beeq/p-063a3968.entry.js.map +0 -1
- package/dist/beeq/p-0979fdfd.entry.js +0 -297
- package/dist/beeq/p-0979fdfd.entry.js.map +0 -1
- package/dist/beeq/p-0ab0b58d.js +0 -30
- package/dist/beeq/p-0ab0b58d.js.map +0 -1
- package/dist/beeq/p-0c42c08a.js +0 -1811
- package/dist/beeq/p-0c42c08a.js.map +0 -1
- package/dist/beeq/p-0f48adcc.entry.js +0 -117
- package/dist/beeq/p-14b44a4b.entry.js +0 -205
- package/dist/beeq/p-1715ac80.entry.js +0 -274
- package/dist/beeq/p-1715ac80.entry.js.map +0 -1
- package/dist/beeq/p-242ac28a.entry.js +0 -145
- package/dist/beeq/p-297fb76b.entry.js +0 -220
- package/dist/beeq/p-2bb65f53.entry.js +0 -204
- package/dist/beeq/p-2e66fc4f.entry.js +0 -434
- package/dist/beeq/p-2e66fc4f.entry.js.map +0 -1
- package/dist/beeq/p-36652891.entry.js +0 -102
- package/dist/beeq/p-39b7c578.entry.js +0 -84
- package/dist/beeq/p-39d77ba6.entry.js +0 -90
- package/dist/beeq/p-4688e046.js +0 -16
- package/dist/beeq/p-49249dda.entry.js +0 -156
- package/dist/beeq/p-548b45b7.entry.js +0 -104
- package/dist/beeq/p-57a55ac5.entry.js +0 -261
- package/dist/beeq/p-5e11b866.entry.js +0 -102
- package/dist/beeq/p-6a4e104b.entry.js +0 -263
- package/dist/beeq/p-6a4e104b.entry.js.map +0 -1
- package/dist/beeq/p-6a5a79a3.entry.js +0 -184
- package/dist/beeq/p-6a5a79a3.entry.js.map +0 -1
- package/dist/beeq/p-7f301da8.entry.js +0 -508
- package/dist/beeq/p-7f301da8.entry.js.map +0 -1
- package/dist/beeq/p-81f1c3ba.entry.js +0 -121
- package/dist/beeq/p-822773ae.entry.js +0 -195
- package/dist/beeq/p-9990889d.entry.js +0 -222
- package/dist/beeq/p-9990889d.entry.js.map +0 -1
- package/dist/beeq/p-a1b43de6.entry.js +0 -248
- package/dist/beeq/p-a6489187.entry.js +0 -103
- package/dist/beeq/p-ac969486.entry.js +0 -330
- package/dist/beeq/p-afc9fd80.entry.js +0 -144
- package/dist/beeq/p-bef53750.js +0 -79
- package/dist/beeq/p-bef53750.js.map +0 -1
- package/dist/beeq/p-bf2320dd.entry.js +0 -329
- package/dist/beeq/p-c34e292e.entry.js +0 -127
- package/dist/beeq/p-c34e292e.entry.js.map +0 -1
- package/dist/beeq/p-db18eba1.entry.js +0 -173
- package/dist/beeq/p-dd950c12.entry.js +0 -309
- package/dist/beeq/p-e301647a.entry.js +0 -87
- package/dist/beeq/p-e3aa2886.entry.js +0 -203
- package/dist/beeq/p-e41f07ae.entry.js +0 -173
- package/dist/beeq/p-e88257a8.entry.js +0 -259
- package/dist/beeq/p-e9a54b49.entry.js +0 -145
- package/dist/beeq/p-f77d9b8b.entry.js +0 -144
- package/dist/beeq/p-fd658de1.entry.js +0 -135
- package/dist/beeq/p-ffb48c40.entry.js +0 -258
- package/dist/beeq/p-ffddc425.entry.js +0 -149
- package/dist/cjs/assetsPath-3938a05d.js.map +0 -1
- package/dist/cjs/cssVariables-7139f0c6.js.map +0 -1
- package/dist/cjs/index-1d3aac65.js.map +0 -1
- package/dist/esm/assetsPath-a1b58980.js.map +0 -1
- package/dist/esm/cssVariables-5ffccc29.js.map +0 -1
- package/dist/esm/index-f69556fe.js.map +0 -1
- package/dist/types/home/workflows/workspace/packages/beeq/.stencil/packages/beeq/stencil.config.d.ts +0 -2
- /package/dist/types/{home/workflows/workspace → Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System}/packages/beeq/.stencil/tailwind.config.d.ts +0 -0
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
import { h, Host } from "@stencil/core";
|
|
6
6
|
import { TOAST_PLACEMENT, TOAST_TYPE } from "./bq-toast.types";
|
|
7
7
|
import { debounce, validatePropValue } from "../../shared/utils";
|
|
8
|
-
const
|
|
8
|
+
const TOAST_PORTAL_SELECTOR = 'bq-toast-portal';
|
|
9
9
|
/**
|
|
10
10
|
* @part wrapper - The component's internal wrapper inside the shadow DOM.
|
|
11
11
|
* @part icon-info - The `<div>` container that holds the icon component.
|
|
12
12
|
* @part base - The `<div>` container of the internal bq-icon component.
|
|
13
13
|
* @part svg - The `<svg>` element of the internal bq-icon component.
|
|
14
|
+
*
|
|
15
|
+
* @slot - The content to be displayed in the toast component.
|
|
16
|
+
* @slot icon - The icon to be displayed in the toast component.
|
|
14
17
|
*/
|
|
15
18
|
export class BqToast {
|
|
16
19
|
constructor() {
|
|
@@ -30,6 +33,7 @@ export class BqToast {
|
|
|
30
33
|
this.open = false;
|
|
31
34
|
}
|
|
32
35
|
};
|
|
36
|
+
this.toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);
|
|
33
37
|
this.border = 's';
|
|
34
38
|
this.type = 'info';
|
|
35
39
|
this.placement = 'bottom-center';
|
|
@@ -42,8 +46,9 @@ export class BqToast {
|
|
|
42
46
|
checkPropValues() {
|
|
43
47
|
validatePropValue(TOAST_TYPE, 'default', this.el, 'type');
|
|
44
48
|
validatePropValue(TOAST_PLACEMENT, 'bottom-center', this.el, 'placement');
|
|
45
|
-
toastPortal
|
|
46
|
-
toastPortal.classList.
|
|
49
|
+
const { toastPortal } = this;
|
|
50
|
+
toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.classList.remove(...TOAST_PLACEMENT);
|
|
51
|
+
toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.classList.add(this.placement);
|
|
47
52
|
}
|
|
48
53
|
handleTimeChange() {
|
|
49
54
|
var _a;
|
|
@@ -63,6 +68,12 @@ export class BqToast {
|
|
|
63
68
|
// Component lifecycle events
|
|
64
69
|
// Ordered by their natural call order
|
|
65
70
|
// =====================================
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
const { toastPortal } = this;
|
|
73
|
+
if (!toastPortal && typeof document !== 'undefined') {
|
|
74
|
+
this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
66
77
|
componentWillLoad() {
|
|
67
78
|
this.checkPropValues();
|
|
68
79
|
this.handleTimeChange();
|
|
@@ -76,10 +87,11 @@ export class BqToast {
|
|
|
76
87
|
// ==============
|
|
77
88
|
onNotificationHide() {
|
|
78
89
|
try {
|
|
79
|
-
toastPortal
|
|
90
|
+
const { toastPortal } = this;
|
|
91
|
+
toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.removeChild(this.el);
|
|
80
92
|
// Remove the toast portal from the DOM when there are no more toasts
|
|
81
|
-
if (toastPortal.querySelector(
|
|
82
|
-
toastPortal.remove();
|
|
93
|
+
if ((toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.querySelector(this.el.tagName.toLowerCase())) === null) {
|
|
94
|
+
toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.remove();
|
|
83
95
|
}
|
|
84
96
|
}
|
|
85
97
|
catch (error) {
|
|
@@ -108,35 +120,24 @@ export class BqToast {
|
|
|
108
120
|
}
|
|
109
121
|
/** This method can be used to display toasts in a fixed-position element that allows for stacking multiple toasts vertically */
|
|
110
122
|
async toast() {
|
|
111
|
-
|
|
123
|
+
const { toastPortal } = this;
|
|
124
|
+
if ((toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.parentElement) === null) {
|
|
112
125
|
document.body.append(toastPortal);
|
|
113
126
|
}
|
|
114
|
-
toastPortal.appendChild(this.el);
|
|
127
|
+
toastPortal === null || toastPortal === void 0 ? void 0 : toastPortal.appendChild(this.el);
|
|
115
128
|
requestAnimationFrame(() => {
|
|
116
129
|
this.show();
|
|
117
130
|
});
|
|
118
131
|
}
|
|
119
132
|
get iconName() {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return 'spinner-gap';
|
|
129
|
-
}
|
|
130
|
-
case 'alert': {
|
|
131
|
-
return 'warning';
|
|
132
|
-
}
|
|
133
|
-
case 'info': {
|
|
134
|
-
return 'info';
|
|
135
|
-
}
|
|
136
|
-
default: {
|
|
137
|
-
return 'info';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
133
|
+
const typeMap = {
|
|
134
|
+
success: 'check-circle-bold',
|
|
135
|
+
error: 'x-circle-bold',
|
|
136
|
+
loading: 'spinner-gap-bold',
|
|
137
|
+
alert: 'warning-bold',
|
|
138
|
+
info: 'info-bold',
|
|
139
|
+
};
|
|
140
|
+
return typeMap[this.type] || 'info-bold';
|
|
140
141
|
}
|
|
141
142
|
// render() function
|
|
142
143
|
// Always the last one in the class.
|
|
@@ -145,7 +146,7 @@ export class BqToast {
|
|
|
145
146
|
const style = {
|
|
146
147
|
...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),
|
|
147
148
|
};
|
|
148
|
-
return (h(Host, { key: '
|
|
149
|
+
return (h(Host, { key: '06ff4fce530e9b3d43ef319215a5a3be5abf6565', style: style, class: { 'is-hidden': !this.open }, "aria-hidden": !this.open ? 'true' : 'false', hidden: !this.open ? 'true' : 'false', role: "status" }, h("output", { key: '4686d298c9e0b3ddba33ee2c753bbb6dfe7a1d7e', class: "bq-toast", part: "wrapper" }, h("div", { key: '5e47a9e376fbba1ae806db0135d36862ffdcefaf', class: { [`bq-toast--icon ${this.type}`]: true, '!hidden': this.hideIcon }, part: "icon" }, h("slot", { key: '47711e80d9fafd776880106208c01748a9313c75', name: "icon" }, h("bq-icon", { key: '2e295a304800b3bc1665a82aa38a2c68322f2574', name: this.iconName, size: "24", slot: "icon", exportparts: "base,svg" }))), h("slot", { key: '0a5a1f76f8bcd11edb75d17ef1f2ea40620a5b79' }))));
|
|
149
150
|
}
|
|
150
151
|
static get is() { return "bq-toast"; }
|
|
151
152
|
static get encapsulation() { return "shadow"; }
|
|
@@ -288,6 +289,11 @@ export class BqToast {
|
|
|
288
289
|
}
|
|
289
290
|
};
|
|
290
291
|
}
|
|
292
|
+
static get states() {
|
|
293
|
+
return {
|
|
294
|
+
"toastPortal": {}
|
|
295
|
+
};
|
|
296
|
+
}
|
|
291
297
|
static get events() {
|
|
292
298
|
return [{
|
|
293
299
|
"method": "bqHide",
|
|
@@ -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,IA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Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, 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 toastPortal = Object.assign(document.createElement('div'), { className: '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@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 // 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 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 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 toastPortal.removeChild(this.el);\n // Remove the toast portal from the DOM when there are no more toasts\n if (toastPortal.querySelector('bq-toast') === 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 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 switch (this.type) {\n case 'success': {\n return 'check-circle';\n }\n case 'error': {\n return 'x-circle';\n }\n case 'loading': {\n return 'spinner-gap';\n }\n case 'alert': {\n return 'warning';\n }\n case 'info': {\n return 'info';\n }\n default: {\n return 'info';\n }\n }\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\" weight=\"bold\" slot=\"icon\" exportparts=\"base,svg\"></bq-icon>\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,MAAM,oBAAoB,CAAC;AAE5E,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AAMH,MAAM,OAAO,OAAO;;QA+JlB,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,eAAU,GAAG,GAAG,EAAE;YACxB,MAAM,EAAE,GAAG,IAAI,CAA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@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"]}
|
|
@@ -125,7 +125,7 @@ export class BqTooltip {
|
|
|
125
125
|
// Always the last one in the class.
|
|
126
126
|
// ===================================
|
|
127
127
|
render() {
|
|
128
|
-
return (h("div", { key: '
|
|
128
|
+
return (h("div", { key: 'b9f1d0b47c14cea37fd823edea60bcf87c9b8a2a', class: "bq-tooltip relative", part: "base" }, h("div", { key: '136cf04413fa8bc1a77543290953796e6365d574', class: "bq-tooltip--trigger", onMouseOver: this.handleTriggerMouseOver, onMouseLeave: this.handleTriggerMouseLeave, onClick: this.handleTriggerOnClick, ref: (el) => (this.trigger = el), part: "trigger" }, h("slot", { key: '088839bde1b1925d9d7bab04173f700a477993f7', name: "trigger" })), h("div", { key: '64c86c77546a216943b0515b58cccd04c66c8e4b', class: "bq-tooltip--panel", "aria-hidden": this.isHidden, hidden: this.isHidden, role: "tooltip", ref: (el) => (this.panel = el), part: "panel" }, !this.hideArrow && h("div", { key: 'a160c45c29b02456be1813081ae5f8a2c1e3a5af', class: "bq-tooltip--arrow", ref: (el) => (this.arrow = el) }), h("slot", { key: 'c482f6332e7ae04d098a9a7b829a4664f4be8866' }))));
|
|
129
129
|
}
|
|
130
130
|
static get is() { return "bq-tooltip"; }
|
|
131
131
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './components.d';\nexport * from './shared/utils';\n"]}
|
|
@@ -6,14 +6,21 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Define the `bqSVGBasePath` property on the global window object, but only when the window object is available.
|
|
11
|
+
*/
|
|
12
|
+
if (typeof window !== 'undefined') {
|
|
13
|
+
Object.defineProperty(window, 'bqSVGBasePath', {
|
|
14
|
+
configurable: true,
|
|
15
|
+
enumerable: false,
|
|
16
|
+
writable: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
14
19
|
const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
|
|
15
20
|
const DEFAULT_SVG_PATH = 'svg';
|
|
16
|
-
const scripts =
|
|
21
|
+
const scripts = typeof document !== 'undefined' && document
|
|
22
|
+
? [...document.getElementsByTagName('script')]
|
|
23
|
+
: [];
|
|
17
24
|
/**
|
|
18
25
|
* Sets the `bqSVGBasePath` in the global window object,
|
|
19
26
|
* which is used to determine the SVG path in the BQIcon component.
|
|
@@ -22,7 +29,9 @@ const scripts = [...document.getElementsByTagName('script')];
|
|
|
22
29
|
* @param path - The new base path to set.
|
|
23
30
|
*/
|
|
24
31
|
export const setBasePath = (path) => {
|
|
25
|
-
window
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
window.bqSVGBasePath = path;
|
|
34
|
+
}
|
|
26
35
|
};
|
|
27
36
|
/**
|
|
28
37
|
* Retrieves the `bqSVGBasePath`, optionally appending a subpath.
|
|
@@ -31,6 +40,8 @@ export const setBasePath = (path) => {
|
|
|
31
40
|
* @returns The full base path including the subpath.
|
|
32
41
|
*/
|
|
33
42
|
export const getBasePath = (subpath = '') => {
|
|
43
|
+
if (typeof window === 'undefined')
|
|
44
|
+
return undefined;
|
|
34
45
|
const { bqSVGBasePath } = window;
|
|
35
46
|
if (!bqSVGBasePath) {
|
|
36
47
|
initializeBasePath();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetsPath.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/assetsPath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"assetsPath.js","sourceRoot":"","sources":["../../../../../../src/shared/utils/assetsPath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;QAC7C,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC;AAED,MAAM,mBA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AC7C,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,cAAc,GAAG,CAAC,OAAe,EAAU,EAAE;IACjD,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAsB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAErH,MAAM,kBAAkB,GAAG,GAAsB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAExH,MAAM,aAAa,GAAG,CAAC,MAAyB,EAAU,EAAE,CAC1D,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,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\n/**\n * Extend the Window interface to include the `bqSVGBasePath` property and prevent it from being modified.\n * This is necessary to prevent the basePath from being modified by external scripts.\n */\ndeclare global {\n interface Window {\n bqSVGBasePath: string;\n }\n}\n\n/**\n * Define the `bqSVGBasePath` property on the global window object, but only when the window object is available.\n */\nif (typeof window !== 'undefined') {\n Object.defineProperty(window, 'bqSVGBasePath', {\n configurable: true,\n enumerable: false,\n writable: true,\n });\n}\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n typeof document !== 'undefined' && document\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n if (typeof window !== 'undefined') {\n window.bqSVGBasePath = path;\n }\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string | undefined => {\n if (typeof window === 'undefined') return undefined;\n\n const { bqSVGBasePath } = window;\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n return formatBasePath(subpath);\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 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.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\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 setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\n/**\n * Formats the `bqSVGBasePath` without a trailing slash.\n * If one exists, append the subpath separated by a slash.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The formatted base path.\n */\nconst formatBasePath = (subpath: string): string => {\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return window.bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement => scripts.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script.getAttribute('src').split('/').slice(0, -1).join('/');\n"]}
|
|
@@ -10,6 +10,8 @@ const CSSVALUEPREFIX = '--bq-';
|
|
|
10
10
|
* @return {string} The corresponding CSS custom property variable
|
|
11
11
|
*/
|
|
12
12
|
export function getColorCSSVariable(colorName) {
|
|
13
|
+
if (typeof document === 'undefined')
|
|
14
|
+
return undefined;
|
|
13
15
|
const token = `${CSSVALUEPREFIX}${colorName}`;
|
|
14
16
|
const value = getComputedStyle(document.documentElement).getPropertyValue(token);
|
|
15
17
|
if (!value)
|
|
@@ -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,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 {\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
|
+
{"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,QAAQ,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAEtD,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 document === '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"]}
|
|
@@ -6,14 +6,21 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Define the `bqSVGBasePath` property on the global window object, but only when the window object is available.
|
|
11
|
+
*/
|
|
12
|
+
if (typeof window !== 'undefined') {
|
|
13
|
+
Object.defineProperty(window, 'bqSVGBasePath', {
|
|
14
|
+
configurable: true,
|
|
15
|
+
enumerable: false,
|
|
16
|
+
writable: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
14
19
|
const DATA_BEEQ_ATTRIBUTE = 'data-beeq';
|
|
15
20
|
const DEFAULT_SVG_PATH = 'svg';
|
|
16
|
-
const scripts =
|
|
21
|
+
const scripts = typeof document !== 'undefined' && document
|
|
22
|
+
? [...document.getElementsByTagName('script')]
|
|
23
|
+
: [];
|
|
17
24
|
/**
|
|
18
25
|
* Sets the `bqSVGBasePath` in the global window object,
|
|
19
26
|
* which is used to determine the SVG path in the BQIcon component.
|
|
@@ -22,7 +29,9 @@ const scripts = [...document.getElementsByTagName('script')];
|
|
|
22
29
|
* @param path - The new base path to set.
|
|
23
30
|
*/
|
|
24
31
|
const setBasePath = (path) => {
|
|
25
|
-
window
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
window.bqSVGBasePath = path;
|
|
34
|
+
}
|
|
26
35
|
};
|
|
27
36
|
/**
|
|
28
37
|
* Retrieves the `bqSVGBasePath`, optionally appending a subpath.
|
|
@@ -31,6 +40,8 @@ const setBasePath = (path) => {
|
|
|
31
40
|
* @returns The full base path including the subpath.
|
|
32
41
|
*/
|
|
33
42
|
const getBasePath = (subpath = '') => {
|
|
43
|
+
if (typeof window === 'undefined')
|
|
44
|
+
return undefined;
|
|
34
45
|
const { bqSVGBasePath } = window;
|
|
35
46
|
if (!bqSVGBasePath) {
|
|
36
47
|
initializeBasePath();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"assetsPath.js","mappings":";;;;AAAA;;;;AAeA,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;
|
|
1
|
+
{"file":"assetsPath.js","mappings":";;;;AAAA;;;;AAeA;;;AAGA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;QAC7C,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC;AAED,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,OAAO,GACX,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ;MACtC,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAyB;MACrE,EAAE,CAAC;AAET;;;;;;;MAOa,WAAW,GAAG,CAAC,IAAY;IACtC,IAAI,OAAO,MAAM,KAAK,WAAW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;AAErH,MAAM,kBAAkB,GAAG,MAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAExH,MAAM,aAAa,GAAG,CAAC,MAAyB,KAC9C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;;;;","names":[],"sources":["../../packages/beeq/src/shared/utils/assetsPath.ts"],"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\n/**\n * Extend the Window interface to include the `bqSVGBasePath` property and prevent it from being modified.\n * This is necessary to prevent the basePath from being modified by external scripts.\n */\ndeclare global {\n interface Window {\n bqSVGBasePath: string;\n }\n}\n\n/**\n * Define the `bqSVGBasePath` property on the global window object, but only when the window object is available.\n */\nif (typeof window !== 'undefined') {\n Object.defineProperty(window, 'bqSVGBasePath', {\n configurable: true,\n enumerable: false,\n writable: true,\n });\n}\n\nconst DATA_BEEQ_ATTRIBUTE = 'data-beeq';\nconst DEFAULT_SVG_PATH = 'svg';\nconst scripts: HTMLScriptElement[] =\n typeof document !== 'undefined' && document\n ? ([...document.getElementsByTagName('script')] as HTMLScriptElement[])\n : [];\n\n/**\n * Sets the `bqSVGBasePath` in the global window object,\n * which is used to determine the SVG path in the BQIcon component.\n * This method is the only way to update the base path.\n *\n * @param path - The new base path to set.\n */\nexport const setBasePath = (path: string): void => {\n if (typeof window !== 'undefined') {\n window.bqSVGBasePath = path;\n }\n};\n\n/**\n * Retrieves the `bqSVGBasePath`, optionally appending a subpath.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The full base path including the subpath.\n */\nexport const getBasePath = (subpath = ''): string | undefined => {\n if (typeof window === 'undefined') return undefined;\n\n const { bqSVGBasePath } = window;\n if (!bqSVGBasePath) {\n initializeBasePath();\n }\n\n return formatBasePath(subpath);\n};\n\n/**\n * Initializes the `bqSVGBasePath` for the BEEQ assets by finding the appropriate script and setting the base path accordingly.\n * 1. If a script with the attribute `data-beeq` exists, the base path will be set to the value of the `src` attribute.\n * 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.\n * 3. If no scripts are found, the base path will be set to the default value `./svg`.\n */\nconst initializeBasePath = (): void => {\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 setBasePath(`./${DEFAULT_SVG_PATH}`);\n }\n};\n\n/**\n * Formats the `bqSVGBasePath` without a trailing slash.\n * If one exists, append the subpath separated by a slash.\n *\n * @param subpath - The subpath to append to the base path.\n * @returns The formatted base path.\n */\nconst formatBasePath = (subpath: string): string => {\n const formattedSubpath = subpath ? `/${subpath.replace(/^\\//, '')}` : '';\n return window.bqSVGBasePath.replace(/\\/$/, '') + formattedSubpath;\n};\n\nconst findConfigScript = (): HTMLScriptElement => scripts.find((script) => script.hasAttribute(DATA_BEEQ_ATTRIBUTE));\n\nconst findFallbackScript = (): HTMLScriptElement => scripts.find((script) => /beeq(\\.esm)?\\.js($|\\?)/.test(script.src));\n\nconst getScriptPath = (script: HTMLScriptElement): string =>\n script.getAttribute('src').split('/').slice(0, -1).join('/');\n"],"version":3}
|