@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":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C;KACvD,CAAC;;;;IAMF,MAAM;QACJ,QACE,4DACE,KAAK,EAAE;gBACL,yBAAyB,EAAE,IAAI;gBAC/B,CAAC,iBAAiB,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI;gBACtC,gCAAgC,EAAE,IAAI,CAAC,UAAU;aAClD,EACD,IAAI,EAAC,MAAM,IAEX,4DAAK,KAAK,EAAE,iCAAiC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,IAClF,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACvD,EACN,4DAAK,KAAK,EAAC,uBAAuB,IAEhC,4DACE,KAAK,EAAE;gBACL,8EAA8E,EAAE,IAAI;gBACpF,qBAAqB,EAAE,IAAI,CAAC,UAAU;gBACtC,iBAAiB,EAAE,IAAI,CAAC,SAAS;aAClC,EACD,IAAI,EAAC,OAAO,IAEZ,8DAAQ,CACJ,EAEN,4DACE,KAAK,EAAE;gBACL,sEAAsE,EAAE,IAAI;gBAC5E,YAAY,EAAE,IAAI,CAAC,UAAU;aAC9B,EACD,IAAI,EAAC,aAAa,IAElB,6DAAM,IAAI,EAAC,aAAa,GAAG,CACvB,CACF,CACF,EACN;KACH;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/step-item/bq-step-item.types.ts","../../packages/beeq/src/components/step-item/scss/bq-step-item.scss?tag=bq-step-item&encapsulation=shadow","../../packages/beeq/src/components/step-item/bq-step-item.tsx"],"sourcesContent":["export const STEP_ITEM_STATUS = ['default', 'current', 'completed', 'error', 'disabled'] as const;\nexport type TStepItemStatus = (typeof STEP_ITEM_STATUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Step item styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-step-item.variables';\n\n:host {\n --bq-icon--color: theme(colors.icon.primary);\n\n @apply bg-bg-primary;\n}\n\n.bq-step-item__prefix.dot,\n.bq-step-item__prefix.icon {\n ::slotted(bq-icon) {\n --bq-icon--color: var(--bq-step-item--prefix-color);\n }\n\n &.current {\n ::slotted(bq-icon) {\n --bq-icon--color: var(--bq-step-item--prefix-color-current);\n }\n }\n\n &.completed {\n ::slotted(bq-icon) {\n --bq-icon--color: var(--bq-step-item--prefix-color-completed);\n }\n }\n\n &.error {\n ::slotted(bq-icon) {\n --bq-icon--color: var(--bq-step-item--prefix-color-error);\n }\n }\n\n &.disabled {\n ::slotted(bq-icon) {\n opacity: 0.6;\n }\n }\n}\n\n.bq-step-item__prefix.numeric {\n @apply flex items-center justify-center rounded-full;\n @apply bg-[--bq-step-item--prefix-num-bg-color] bs-[--bq-step-item--prefix-num-size] is-[--bq-step-item--prefix-num-size];\n @apply text-m font-semibold leading-regular;\n\n &.small {\n @apply text-s [--bq-step-item--prefix-num-size:--bq-spacing-l];\n }\n\n // Status\n\n &.current {\n @apply bg-[var(--bq-step-item--prefix-color-current)] text-[--bq-text--alt];\n }\n\n &.completed {\n @apply bg-ui-success-alt text-text-success;\n }\n\n &.error {\n @apply bg-ui-danger-alt text-text-danger;\n }\n\n &.disabled {\n @apply opacity-60;\n }\n}\n\n.bq-step-item__content--description::slotted(*) {\n @apply text-s leading-regular opacity-60;\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\n\nimport { STEP_ITEM_STATUS, TStepItemStatus } from './bq-step-item.types';\nimport { isHTMLElement, validatePropValue } from '../../shared/utils';\nimport { STEPS_SIZE, TStepsSize, TStepsType } from '../steps/bq-steps.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part title - The component's title.\n * @part description - The component's description.\n */\n@Component({\n tag: 'bq-step-item',\n styleUrl: './scss/bq-step-item.scss',\n shadow: true,\n})\nexport class BqStepItem {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n @Element() el!: HTMLBqStepItemElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** It defines prefix size */\n @Prop({ reflect: true }) size?: TStepsSize = 'medium';\n\n /** It defines step item appearance based on its status */\n @Prop({ reflect: true }) status?: TStepItemStatus = 'default';\n\n /** It defines the step item type used */\n @Prop({ reflect: true }) type?: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('status')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEP_ITEM_STATUS, 'default', this.el, 'status');\n\n this.handleIconPrefix();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the step item is clicked */\n @Event() bqClick: EventEmitter<{ target: HTMLBqStepItemElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.checkPropValues();\n }\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.handleIconPrefix();\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 isDisabled(): boolean {\n return this.status === 'disabled';\n }\n\n private get isCurrent(): boolean {\n return this.status === 'current';\n }\n\n private handleIconPrefix = () => {\n const iconElem = this.el.querySelector('[slot=\"prefix\"]');\n if (!iconElem || !isHTMLElement(iconElem, 'bq-icon')) return;\n\n iconElem.size = this.size === 'small' ? 24 : 32;\n iconElem.weight = this.isCurrent ? 'fill' : 'regular';\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div\n class={{\n 'bq-step-item flex gap-s': true,\n [`bq-step-item--${this.status}`]: true,\n 'pointer-events-none opacity-60': this.isDisabled,\n }}\n part=\"base\"\n >\n <div class={`bq-step-item__prefix relative ${this.type} ${this.size} ${this.status}`}>\n <slot name=\"prefix\" onSlotchange={this.handleIconPrefix} />\n </div>\n <div class=\"bq-step-item__content\">\n {/* TITLE */}\n <div\n class={{\n 'bq-step-item__content--title pe-xs3 text-m leading-regular text-text-primary': true,\n 'pointer-events-none': this.isDisabled,\n 'text-text-brand': this.isCurrent,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n {/* DESCRIPTION */}\n <div\n class={{\n 'bq-step-item__content--description text-s leading-regular opacity-60': true,\n 'opacity-60': this.isDisabled,\n }}\n part=\"description\"\n >\n <slot name=\"description\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, g as getElement, h } from './index-033f1efb.js';
|
|
6
6
|
import { S as STEPS_SIZE, a as STEPS_TYPE } from './bq-steps.types-3a84b1e3.js';
|
|
7
|
-
import './assetsPath-e2f1ceb9.js';
|
|
8
7
|
import { v as validatePropValue } from './props-3bf7f546.js';
|
|
9
8
|
|
|
10
9
|
const bqStepsCss = ".transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}::backdrop,:root{--bq-blue-100:#e7f0fd;--bq-blue-200:#d0e2fb;--bq-blue-300:#a1c5f7;--bq-blue-400:#73a8f3;--bq-blue-500:#448bef;--bq-blue-600:#156eeb;--bq-blue-700:#1158bc;--bq-blue-800:#0d428d;--bq-blue-900:#082c5e;--bq-blue-1000:#04162f;--bq-corai-100:#fff2f2;--bq-corai-200:#ffe6e6;--bq-corai-300:#ffccce;--bq-corai-400:#ffb3b5;--bq-corai-500:#ff999d;--bq-corai-600:#ff8084;--bq-corai-700:#cc666a;--bq-corai-800:#994d4f;--bq-corai-900:#663335;--bq-corai-1000:#331a1a;--bq-cyan-100:#e8f7fb;--bq-cyan-200:#d2f0f8;--bq-cyan-300:#a5e1f1;--bq-cyan-400:#78d1e9;--bq-cyan-500:#4bc2e2;--bq-cyan-600:#1eb3db;--bq-cyan-700:#188faf;--bq-cyan-800:#126b83;--bq-cyan-900:#0c4858;--bq-cyan-1000:#06242c;--bq-gold-100:#fbf4ec;--bq-gold-200:#f7e9da;--bq-gold-300:#f0d3b6;--bq-gold-400:#e8bc91;--bq-gold-500:#e1a66d;--bq-gold-600:#d99048;--bq-gold-700:#ae733a;--bq-gold-800:#82562b;--bq-gold-900:#573a1d;--bq-gold-1000:#2b1d0e;--bq-green-100:#e8f8ef;--bq-green-200:#d2f1e0;--bq-green-300:#a5e3c1;--bq-green-400:#78d5a1;--bq-green-500:#4bc782;--bq-green-600:#1eb963;--bq-green-700:#18944f;--bq-green-800:#126f3b;--bq-green-900:#0c4a28;--bq-green-1000:#062514;--bq-grey-100:#f1f2f4;--bq-grey-200:#e7e8eb;--bq-grey-300:#caccd2;--bq-grey-400:#a6aab3;--bq-grey-50:#f6f6f8;--bq-grey-500:#898e99;--bq-grey-600:#646a77;--bq-grey-700:#3f4350;--bq-grey-800:#2a2c35;--bq-grey-900:#1c1d23;--bq-grey-950:#15161a;--bq-grey-1000:#0d0e11;--bq-indigo-100:#edecfc;--bq-indigo-200:#dcdafa;--bq-indigo-300:#b9b5f5;--bq-indigo-400:#9590ef;--bq-indigo-500:#726bea;--bq-indigo-600:#4f46e5;--bq-indigo-700:#3f38b7;--bq-indigo-800:#2f2a89;--bq-indigo-900:#201c5c;--bq-indigo-1000:#100e2e;--bq-iris-100:#e9f0ff;--bq-iris-200:#d6e0ff;--bq-iris-300:#b2c0fe;--bq-iris-400:#8691f8;--bq-iris-500:#6061ee;--bq-iris-600:#4f46e5;--bq-iris-700:#413abd;--bq-iris-800:#332e95;--bq-iris-900:#26216d;--bq-iris-1000:#181545;--bq-lime-100:#f5fae8;--bq-lime-200:#ecf6d2;--bq-lime-300:#d9eda5;--bq-lime-400:#c5e379;--bq-lime-500:#b2da4c;--bq-lime-600:#9fd11f;--bq-lime-700:#7fa719;--bq-lime-800:#5f7d13;--bq-lime-900:#40540c;--bq-lime-1000:#202a06;--bq-magenta-100:#fce7f4;--bq-magenta-200:#f9cfea;--bq-magenta-300:#f39fd6;--bq-magenta-400:#ee6fbf;--bq-magenta-500:#e83fab;--bq-magenta-600:#de1395;--bq-magenta-700:#b20f77;--bq-magenta-800:#850c59;--bq-magenta-900:#58083c;--bq-magenta-1000:#2c041e;--bq-neutral-white:#fbfbfc;--bq-neutral-black:#060708;--bq-orange-100:#fbf0e9;--bq-orange-200:#f8e1d4;--bq-orange-300:#f1c2a8;--bq-orange-400:#eaa47d;--bq-orange-500:#e38551;--bq-orange-600:#dc6726;--bq-orange-700:#b0521e;--bq-orange-800:#843e17;--bq-orange-900:#58290f;--bq-orange-1000:#2c1508;--bq-purple-100:#efebf8;--bq-purple-200:#e0d7f2;--bq-purple-300:#c1afe5;--bq-purple-400:#a388d8;--bq-purple-500:#8460cb;--bq-purple-600:#6538be;--bq-purple-700:#512d98;--bq-purple-800:#3d2272;--bq-purple-900:#28164c;--bq-purple-1000:#140b26;--bq-red-100:#fce7ea;--bq-red-200:#f9d1d5;--bq-red-300:#f3a2ac;--bq-red-400:#ed7482;--bq-red-500:#e74559;--bq-red-600:#e1172f;--bq-red-700:#b41226;--bq-red-800:#870e1c;--bq-red-900:#5a0913;--bq-red-1000:#2d0509;--bq-sky-100:#eff4fb;--bq-sky-200:#dfeaf8;--bq-sky-300:#bfd5f1;--bq-sky-400:#9ec1e9;--bq-sky-500:#7eace2;--bq-sky-600:#5e97db;--bq-sky-700:#4b79af;--bq-sky-800:#385b83;--bq-sky-900:#263c58;--bq-sky-1000:#131e2c;--bq-teal-100:#e5f7f5;--bq-teal-200:#ccf0eb;--bq-teal-300:#99e1d8;--bq-teal-400:#66d2c4;--bq-teal-500:#33c3b1;--bq-teal-600:#00b49d;--bq-teal-700:#00907e;--bq-teal-800:#006c5e;--bq-teal-900:#00483f;--bq-teal-1000:#00241f;--bq-volcano-100:#feede7;--bq-volcano-200:#fddbd1;--bq-volcano-300:#fbb8a3;--bq-volcano-400:#fa9474;--bq-volcano-500:#f87146;--bq-volcano-600:#f64d18;--bq-volcano-700:#c53e13;--bq-volcano-800:#942e0e;--bq-volcano-900:#621f0a;--bq-volcano-1000:#310f05;--bq-yellow-100:#fefbe7;--bq-yellow-200:#fcf6d0;--bq-yellow-300:#faeea0;--bq-yellow-400:#f7e571;--bq-yellow-500:#f5dd41;--bq-yellow-600:#f2d412;--bq-yellow-700:#c2aa0e;--bq-yellow-800:#917f0b;--bq-yellow-900:#615507;--bq-yellow-1000:#302a04;--bq-endava-grey-50:#f7f7f8;--bq-endava-grey-100:#e4e6e7;--bq-endava-grey-200:#b5babe;--bq-endava-grey-300:#949ca1;--bq-endava-grey-400:#737d84;--bq-endava-grey-500:#525f67;--bq-endava-grey-600:#30404b;--bq-endava-grey-700:#2b3942;--bq-endava-grey-800:#263139;--bq-endava-grey-900:#192b37;--bq-endava-grey-950:#151b1e;--bq-endava-grey-1000:#0f1316;--bq-endava-neutral-white:#fafbfb;--bq-endava-neutral-black:#060708;--bq-endava-orange-100:#fef3f1;--bq-endava-orange-200:#fbd6d1;--bq-endava-orange-300:#fab7af;--bq-endava-orange-400:#fa988b;--bq-endava-orange-500:#fc7866;--bq-endava-orange-600:#ff5640;--bq-endava-orange-700:#ce4a39;--bq-endava-orange-800:#a03d30;--bq-endava-orange-900:#722e25;--bq-endava-orange-1000:#471e19}*,:after,:before{box-sizing:border-box}*{font:inherit;margin:0}ol[role=list],ul[role=list]{list-style-type:none}html{font-size:var(--bq-font-size--m)}html:focus-within{scroll-behavior:smooth}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:var(--bq-background--primary);color:var(--bq-text--primary);font-family:var(--bq-font-family);line-height:var(--bq-font-line-height--regular);min-height:100vh;text-rendering:optimizeSpeed}a:not([class]){text-decoration-skip-ink:auto}canvas,img,picture,svg,video{display:block;max-width:100%}button,input,select,textarea{font:inherit}h1,h2,h3,h4,h5,h6,p{overflow-wrap:break-word}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto;transition-duration:.01ms!important}}:root{--bq-white:#fff;--bq-black:#060708;--bq-neutral-50:var(--bq-grey-50);--bq-neutral-100:var(--bq-grey-100);--bq-neutral-200:var(--bq-grey-200);--bq-neutral-300:var(--bq-grey-300);--bq-neutral-400:var(--bq-grey-400);--bq-neutral-500:var(--bq-grey-500);--bq-neutral-600:var(--bq-grey-600);--bq-neutral-700:var(--bq-grey-700);--bq-neutral-800:var(--bq-grey-800);--bq-neutral-900:var(--bq-grey-900);--bq-neutral-950:var(--bq-grey-950);--bq-neutral-1000:var(--bq-grey-1000);--bq-brand-light:var(--bq-iris-100);--bq-brand:var(--bq-iris-600);--bq-brand-dark:var(--bq-iris-1000);--bq-accent-light:var(--bq-purple-100);--bq-accent:var(--bq-purple-600);--bq-accent-dark:var(--bq-purple-1000);--bq-success-light:var(--bq-teal-100);--bq-success:var(--bq-teal-600);--bq-success-dark:var(--bq-teal-1000);--bq-danger-light:var(--bq-red-100);--bq-danger:var(--bq-red-600);--bq-danger-dark:var(--bq-red-1000);--bq-warning-light:var(--bq-gold-100);--bq-warning:var(--bq-gold-600);--bq-warning-dark:var(--bq-gold-1000);--bq-info-light:var(--bq-iris-100);--bq-info:var(--bq-iris-600);--bq-info-dark:var(--bq-iris-1000);--bq-focus:var(--bq-iris-600);--bq-data-01:var(--bq-brand);--bq-data-02:var(--bq-purple-600);--bq-data-03:var(--bq-magenta-600);--bq-data-04:var(--bq-cyan-600);--bq-data-05:var(--bq-teal-600);--bq-data-06:var(--bq-orange-600);--bq-data-07:var(--bq-yellow-600);--bq-data-08:var(--bq-red-600);--bq-data-09:var(--bq-blue-600);--bq-data-10:var(--bq-grey-600);--bq-data-11:var(--bq-black);--bq-data-12:var(--bq-white);--bq-radius--none:0;--bq-radius--xs2:0.125rem;--bq-radius--xs:0.25rem;--bq-radius--s:0.5rem;--bq-radius--m:0.75rem;--bq-radius--l:1.5rem;--bq-radius--full:9999px;--bq-box-shadow--xs:0 2px 0 rgba(0,0,0,.016);--bq-box-shadow--s:0 8px 24px rgba(0,0,0,.04);--bq-box-shadow--m:0 10px 48px -16px rgba(0,0,0,.12);--bq-box-shadow--l:0 20px 58px -16px rgba(0,0,0,.16);--bq-font-family:\"Outfit\",sans-serif;--bq-font-size--xs:0.75rem;--bq-font-size--s:0.875rem;--bq-font-size--m:1rem;--bq-font-size--l:1.125rem;--bq-font-size--xl:1.5rem;--bq-font-size--xxl:2rem;--bq-font-size--xxl2:2.5rem;--bq-font-size--xxl3:3rem;--bq-font-size--xxl4:3.5rem;--bq-font-size--xxl5:4rem;--bq-font-weight--thin:100;--bq-font-weight--light:300;--bq-font-weight--regular:400;--bq-font-weight--medium:500;--bq-font-weight--semibold:600;--bq-font-weight--bold:700;--bq-font-line-height--small:1.2;--bq-font-line-height--regular:1.5;--bq-font-line-height--large:1.5;--bq-spacing-xs3:0.125rem;--bq-spacing-xs2:0.25rem;--bq-spacing-xs:0.5rem;--bq-spacing-s:0.75rem;--bq-spacing-m:1rem;--bq-spacing-l:1.5rem;--bq-spacing-xl:2rem;--bq-spacing-xxl:2.5rem;--bq-spacing-xxl2:3.5rem;--bq-spacing-xxl3:4rem;--bq-spacing-xxl4:4.5rem;--bq-stroke-s:1px;--bq-stroke-m:2px;--bq-stroke-l:3px}.beeq.light,.light,:root,[bq-mode=light]{--bq-background--primary:var(--bq-white);--bq-background--secondary:var(--bq-neutral-100);--bq-background--tertiary:var(--bq-neutral-200);--bq-background--alt:var(--bq-neutral-300);--bq-background--inverse:var(--bq-neutral-900);--bq-background--brand:var(--bq-brand);--bq-background--overlay:var(--bq-neutral-900);--bq-icon--primary:var(--bq-neutral-800);--bq-icon--alt:var(--bq-white);--bq-icon--secondary:var(--bq-neutral-600);--bq-icon--inverse:var(--bq-neutral-50);--bq-icon--brand:var(--bq-brand);--bq-icon--info:var(--bq-brand);--bq-icon--success:var(--bq-success);--bq-icon--warning:var(--bq-warning);--bq-icon--danger:var(--bq-danger);--bq-stroke--primary:var(--bq-neutral-200);--bq-stroke--secondary:var(--bq-neutral-600);--bq-stroke--tertiary:var(--bq-neutral-900);--bq-stroke--inverse:var(--bq-white);--bq-stroke--brand:var(--bq-brand);--bq-stroke--alt:var(--bq-neutral-50);--bq-stroke--success:var(--bq-success);--bq-stroke--warning:var(--bq-warning);--bq-stroke--danger:var(--bq-danger);--bq-stroke--info:var(--bq-brand);--bq-text--primary:var(--bq-neutral-800);--bq-text--secondary:var(--bq-neutral-600);--bq-text--inverse:var(--bq-neutral-50);--bq-text--brand:var(--bq-brand);--bq-text--alt:var(--bq-white);--bq-text--info:var(--bq-brand);--bq-text--success:var(--bq-success);--bq-text--warning:var(--bq-warning);--bq-text--danger:var(--bq-danger);--bq-ui--primary:var(--bq-white);--bq-ui--secondary:var(--bq-neutral-200);--bq-ui--tertiary:var(--bq-neutral-500);--bq-ui--inverse:var(--bq-neutral-900);--bq-ui--brand:var(--bq-brand);--bq-ui--brand-alt:var(--bq-brand-light);--bq-ui--alt:var(--bq-neutral-50);--bq-ui--success:var(--bq-success);--bq-ui--success-alt:var(--bq-success-light);--bq-ui--warning:var(--bq-warning);--bq-ui--warning-alt:var(--bq-warning-light);--bq-ui--danger:var(--bq-danger);--bq-ui--danger-alt:var(--bq-danger-light);--bq-ui--info:var(--bq-brand);--bq-ui--info-alt:var(--bq-brand-light);--bq-hover:#bcbfc5;--bq-active:#444546}.beeq.dark,.dark,[bq-mode=dark]{--bq-background--primary:var(--bq-neutral-1000);--bq-background--secondary:var(--bq-neutral-950);--bq-background--tertiary:var(--bq-neutral-800);--bq-background--alt:var(--bq-neutral-700);--bq-background--inverse:var(--bq-neutral-600);--bq-background--brand:var(--bq-brand);--bq-background--overlay:var(--bq-neutral-900);--bq-icon--primary:var(--bq-neutral-100);--bq-icon--secondary:var(--bq-neutral-400);--bq-icon--inverse:var(--bq-neutral-800);--bq-icon--brand:var(--bq-brand);--bq-icon--alt:var(--bq-white);--bq-icon--info:var(--bq-brand);--bq-icon--success:var(--bq-success);--bq-icon--warning:var(--bq-warning);--bq-icon--danger:var(--bq-danger);--bq-stroke--primary:var(--bq-neutral-900);--bq-stroke--secondary:var(--bq-neutral-700);--bq-stroke--tertiary:var(--bq-neutral-400);--bq-stroke--inverse:var(--bq-neutral-950);--bq-stroke--brand:var(--bq-brand);--bq-stroke--alt:var(--bq-neutral-1000);--bq-stroke--success:var(--bq-success);--bq-stroke--warning:var(--bq-warning);--bq-stroke--danger:var(--bq-danger);--bq-stroke--info:var(--bq-brand);--bq-text--primary:var(--bq-neutral-100);--bq-text--secondary:var(--bq-neutral-400);--bq-text--inverse:var(--bq-neutral-800);--bq-text--brand:var(--bq-brand);--bq-text--alt:var(--bq-white);--bq-text--info:var(--bq-brand);--bq-text--success:var(--bq-success);--bq-text--warning:var(--bq-warning);--bq-text--danger:var(--bq-danger);--bq-ui--primary:var(--bq-neutral-900);--bq-ui--secondary:var(--bq-neutral-800);--bq-ui--tertiary:var(--bq-neutral-700);--bq-ui--inverse:var(--bq-neutral-100);--bq-ui--brand:var(--bq-brand);--bq-ui--brand-alt:var(--bq-brand-dark);--bq-ui--alt:var(--bq-neutral-950);--bq-ui--success:var(--bq-success);--bq-ui--success-alt:var(--bq-success-dark);--bq-ui--warning:var(--bq-warning);--bq-ui--warning-alt:var(--bq-warning-dark);--bq-ui--danger:var(--bq-danger);--bq-ui--danger-alt:var(--bq-danger-dark);--bq-ui--info:var(--bq-brand);--bq-ui--info-alt:var(--bq-brand-dark);--bq-hover:#444546;--bq-active:#1f2026}.endava,[bq-theme=endava]{--bq-font-family:\"Poppins\",sans-serif;--bq-white:#fafbfb;--bq-black:#030406;--bq-neutral-50:var(--bq-endava-grey-50);--bq-neutral-100:var(--bq-endava-grey-100);--bq-neutral-200:var(--bq-endava-grey-200);--bq-neutral-300:var(--bq-endava-grey-300);--bq-neutral-400:var(--bq-endava-grey-400);--bq-neutral-500:var(--bq-endava-grey-500);--bq-neutral-600:var(--bq-endava-grey-600);--bq-neutral-700:var(--bq-endava-grey-700);--bq-neutral-800:var(--bq-endava-grey-800);--bq-neutral-900:var(--bq-endava-grey-900);--bq-neutral-950:var(--bq-endava-grey-950);--bq-neutral-1000:var(--bq-endava-grey-1000);--bq-brand-light:var(--bq-endava-orange-100);--bq-brand:var(--bq-endava-orange-600);--bq-brand-dark:var(--bq-endava-orange-1000);--bq-accent-light:var(--bq-endava-orange-100);--bq-accent:var(--bq-endava-orange-600);--bq-accent-dark:var(--bq-endava-orange-1000);--bq-success-light:var(--bq-green-100);--bq-success:var(--bq-green-600);--bq-success-dark:var(--bq-green-1000);--bq-danger-light:var(--bq-corai-100);--bq-danger:var(--bq-corai-600);--bq-danger-dark:var(--bq-corai-1000);--bq-warning-light:var(--bq-yellow-100);--bq-warning:var(--bq-yellow-600);--bq-warning-dark:var(--bq-yellow-1000);--bq-info-light:var(--bq-blue-100);--bq-info:var(--bq-blue-600);--bq-info-dark:var(--bq-blue-1000);--bq-focus:var(--bq-endava-orange-600);--bq-data-01:var(--bq-brand);--bq-data-02:#af0cd8;--bq-data-03:#0ca8d8;--bq-data-04:var(--bq-teal-600);--bq-data-05:var(--bq-yellow-600);--bq-data-06:var(--bq-orange-600);--bq-data-07:var(--bq-blue-600);--bq-data-08:var(--bq-red-600);--bq-data-09:var(--bq-purple-600);--bq-data-10:#394b56;--bq-data-11:var(--bq-black);--bq-data-12:var(--bq-white)}.endava.light,[bq-theme=endava][bq-mode=light]{--bq-background--primary:var(--bq-white);--bq-background--secondary:var(--bq-neutral-100);--bq-background--tertiary:var(--bq-neutral-200);--bq-background--alt:var(--bq-neutral-300);--bq-background--inverse:var(--bq-neutral-900);--bq-background--brand:var(--bq-brand);--bq-background--overlay:var(--bq-neutral-900);--bq-icon--primary:var(--bq-neutral-800);--bq-icon--secondary:var(--bq-neutral-600);--bq-icon--inverse:var(--bq-neutral-50);--bq-icon--brand:var(--bq-brand);--bq-icon--alt:var(--bq-white);--bq-icon--info:var(--bq-info);--bq-icon--success:var(--bq-success);--bq-icon--warning:var(--bq-warning);--bq-icon--danger:var(--bq-danger);--bq-stroke--primary:var(--bq-neutral-200);--bq-stroke--secondary:var(--bq-neutral-600);--bq-stroke--tertiary:var(--bq-neutral-900);--bq-stroke--inverse:var(--bq-white);--bq-stroke--brand:var(--bq-brand);--bq-stroke--alt:var(--bq-neutral-50);--bq-stroke--brand-alt:var(--bq-brand-light);--bq-stroke--success:var(--bq-success);--bq-stroke--warning:var(--bq-warning);--bq-stroke--danger:var(--bq-danger);--bq-stroke--info:var(--bq-info);--bq-text--primary:var(--bq-neutral-800);--bq-text--secondary:var(--bq-neutral-600);--bq-text--inverse:var(--bq-neutral-50);--bq-text--brand:var(--bq-brand);--bq-text--alt:var(--bq-white);--bq-text--info:var(--bq-info);--bq-text--success:var(--bq-success);--bq-text--warning:var(--bq-warning);--bq-text--danger:var(--bq-danger);--bq-ui--primary:var(--bq-white);--bq-ui--secondary:var(--bq-neutral-200);--bq-ui--tertiary:var(--bq-neutral-500);--bq-ui--inverse:var(--bq-neutral-900);--bq-ui--alt:var(--bq-neutral-50);--bq-ui--brand-alt:var(--bq-brand-light);--bq-ui--brand:var(--bq-brand);--bq-ui--success:var(--bq-success);--bq-ui--success-alt:var(--bq-success-light);--bq-ui--warning:var(--bq-warning);--bq-ui--warning-alt:var(--bq-warning-light);--bq-ui--danger:var(--bq-danger);--bq-ui--danger-alt:var(--bq-danger-light);--bq-ui--info:var(--bq-info);--bq-ui--info-alt:var(--bq-info-light);--bq-hover:#444546;--bq-active:#1f2026}.endava.dark,[bq-theme=endava][bq-mode=dark]{--bq-background--primary:var(--bq-neutral-1000);--bq-background--secondary:var(--bq-neutral-900);--bq-background--tertiary:var(--bq-neutral-800);--bq-background--alt:var(--bq-neutral-700);--bq-background--inverse:var(--bq-neutral-600);--bq-background--brand:var(--bq-brand);--bq-background--overlay:var(--bq-neutral-900);--bq-icon--primary:var(--bq-neutral-100);--bq-icon--secondary:var(--bq-neutral-400);--bq-icon--inverse:var(--bq-neutral-800);--bq-icon--brand:var(--bq-brand);--bq-icon--alt:var(--bq-white);--bq-icon--info:var(--bq-info);--bq-icon--success:var(--bq-success);--bq-icon--warning:var(--bq-warning);--bq-icon--danger:var(--bq-danger);--bq-stroke--primary:var(--bq-neutral-900);--bq-stroke--secondary:var(--bq-neutral-700);--bq-stroke--tertiary:var(--bq-neutral-400);--bq-stroke--inverse:var(--bq-neutral-950);--bq-stroke--brand:var(--bq-brand);--bq-stroke--brand-alt:var(--bq-brand-dark);--bq-stroke--alt:var(--bq-neutral-1000);--bq-stroke--success:var(--bq-success);--bq-stroke--warning:var(--bq-warning);--bq-stroke--danger:var(--bq-danger);--bq-stroke--info:var(--bq-info);--bq-text--primary:var(--bq-neutral-100);--bq-text--secondary:var(--bq-neutral-400);--bq-text--inverse:var(--bq-neutral-800);--bq-text--brand:var(--bq-brand);--bq-text--alt:var(--bq-neutral-white);--bq-text--info:var(--bq-info);--bq-text--success:var(--bq-success);--bq-text--warning:var(--bq-warning);--bq-text--danger:var(--bq-danger);--bq-ui--primary:var(--bq-neutral-900);--bq-ui--secondary:var(--bq-neutral-800);--bq-ui--tertiary:var(--bq-neutral-700);--bq-ui--inverse:var(--bq-neutral-100);--bq-ui--brand:var(--bq-brand);--bq-ui--brand-alt:var(--bq-brand-dark);--bq-ui--alt:var(--bq-neutral-950);--bq-ui--success:var(--bq-success);--bq-ui--success-alt:var(--bq-success-dark);--bq-ui--warning:var(--bq-warning);--bq-ui--warning-alt:var(--bq-warning-dark);--bq-ui--danger:var(--bq-danger);--bq-ui--danger-alt:var(--bq-danger-dark);--bq-ui--info:var(--bq-info);--bq-ui--info-alt:var(--bq-info-dark);--bq-hover:#444546;--bq-active:#1f2026}.block{display:block}.pe-\\[--bq-steps--gap\\]{padding-inline-end:var(--bq-steps--gap)}.ps-\\[--bq-steps--gap\\]{padding-inline-start:var(--bq-steps--gap)}@-webkit-keyframes fade-in{0%{opacity:0}}@keyframes fade-in{0%{opacity:0}}@-webkit-keyframes slide-in{0%{-webkit-transform:translateY(10px);transform:translateY(10px)}}@keyframes slide-in{0%{-webkit-transform:translateY(10px);transform:translateY(10px)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}:host{--bq-steps--divider-color:var(--bq-ui--secondary);--bq-steps--gap:var(--bq-spacing-m);display:block}::slotted(bq-step-item:not(:first-child)){padding-inline-start:var(--bq-steps--gap)}::slotted(bq-step-item:not(:last-child)){padding-inline-end:var(--bq-steps--gap)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.-z-10{z-index:-10}.flex{display:flex}.w-full{width:100%}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.p-bs-m{padding-block-start:var(--bq-spacing-m)}.p-bs-s{padding-block-start:var(--bq-spacing-s)}.p-i-s{padding-inline:var(--bq-spacing-s)}.inset-ie-0{inset-inline-end:0}.inset-is-0{inset-inline-start:0}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!hidden{display:none!important}.gap-0{gap:0}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-steps.entry.js","mappings":"
|
|
1
|
+
{"file":"bq-steps.entry.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,G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,EACnC,IAAI,EAAC,WAAW,IAEhB,8DAAQ,EACR,mEACE,KAAK,EAAE,8CAA8C,iBAAiB,EAAE,EACxE,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,eAAe,EAAE,CAAC,EAClB,WAAW,EAAC,2EAA2E,GACvF,CACE,EACN;KACH;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/steps/scss/bq-steps.scss?tag=bq-steps&encapsulation=shadow","../../packages/beeq/src/components/steps/bq-steps.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Steps styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-steps.variables';\n\n:host {\n @apply block;\n}\n\n::slotted(bq-step-item:not(:first-child)) {\n @apply ps-[--bq-steps--gap];\n}\n\n::slotted(bq-step-item:not(:last-child)) {\n @apply pe-[--bq-steps--gap];\n}\n","import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport { STEPS_SIZE, STEPS_TYPE, TStepsSize, TStepsType } from './bq-steps.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * @part container - The container wrapper of the Steps component\n * @part divider-base - The base wrapper of the divider component\n * @part divider-dash-start - The dash start wrapper of the divider component\n * @part divider-dash-end - The dash end wrapper of the divider component\n */\n@Component({\n tag: 'bq-steps',\n styleUrl: './scss/bq-steps.scss',\n shadow: true,\n})\nexport class BqSteps {\n // Own Properties\n // ====================\n\n private stepElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqStepsElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** The color of the line that connects the steps. It should be a valid declarative color token. */\n @Prop({ reflect: true }) dividerColor: string = 'stroke--primary';\n\n /** The size of the steps */\n @Prop({ reflect: true }) size: TStepsSize = 'medium';\n\n /** The type of prefix element to use on the step items */\n @Prop({ reflect: true }) type: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('size')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEPS_TYPE, 'numeric', this.el, 'type');\n\n this.setStepItemProps();\n }\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.setStepItemProps();\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 bqSteps(): HTMLBqStepItemElement[] {\n if (!this.stepElem) return [];\n\n const slot = this.stepElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === 'bq-step-item',\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private setStepItemProps = () => {\n this.bqSteps.forEach((bqStepElem: HTMLBqStepItemElement) => {\n bqStepElem.size = this.size;\n bqStepElem.type = this.type;\n });\n };\n\n // private handleChange = (event) => {\n // this.bqChange.emit(event);\n // }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';\n\n return (\n <div\n class=\"relative flex w-full items-start justify-between\"\n ref={(div) => (this.stepElem = div)}\n part=\"container\"\n >\n <slot />\n <bq-divider\n class={`absolute -z-10 p-i-s inset-ie-0 inset-is-0 ${dividerPaddingTop}`}\n strokeColor={this.dividerColor}\n strokeThickness={2}\n exportparts=\"base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end\"\n />\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 { r as registerInstance, c as createEvent, g as getElement, h, a as Host } from './index-033f1efb.js';
|
|
6
|
-
import './assetsPath-e2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QAAQ,IAAI,IAAI,CAAC,YAAY;aAC3C,EACD,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EACtC,IAAI,EAAC,OAAO,IAEZ,6DAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACxC,CACD,CACH,EACP;KACH;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/switch/scss/bq-switch.scss?tag=bq-switch&encapsulation=shadow","../../packages/beeq/src/components/switch/bq-switch.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Switch styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-switch.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.full-width) {\n @apply is-full;\n}\n\n.bq-switch {\n @apply flex cursor-pointer select-none items-center rounded-s transition-colors duration-300 p-b-2 p-i-2;\n\n justify-content: var(--bq-switch--justify-content);\n\n // Display background on hover (if enabled)\n &.has-background:not(.is-disabled):hover {\n @apply bg-hover-ui-primary;\n }\n\n &.is-disabled {\n @apply cursor-not-allowed opacity-60;\n }\n}\n\n.bq-switch--input:not(:disabled):focus-visible {\n ~ .bq-switch--control {\n @apply focus;\n }\n}\n\n.bq-switch--control__dot {\n @apply absolute start-xs2 rounded-full bg-icon-inverse bs-[--bq-switch--dot-size] is-[--bq-switch--dot-size];\n @apply group-[&.is-checked]:start-[calc(100%_-_var(--bq-switch--dot-size)_-_var(--bq-spacing-xs2))] group-[&.is-checked]:bg-[--bq-icon--alt];\n @apply transition-all duration-300;\n}\n\n.bq-switch--control__icon {\n --bq-icon--size: var(--bq-switch--dot-size) !important;\n\n &::part(base) {\n @apply flex;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-text-primary transition-colors duration-300':\n true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bq-switch.entry.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,muvBAAmuvB,CAAC;AACxvvB,uBAAe,WAAW;;MCsBb,QAAQ;;;;;;wBAiBC,KAAK;iCAM8B,KAAK;uBAGA,KAAK;wBAGnB,KAAK;yBAGJ,KAAK;0BAGM,SAAS;8BAMD,OAAO;;wBAM3B,KAAK;4BAGD,KAAK;;;;;IA9C/C,SAAS,CAAkB;IAC3B,SAAS,CAAmB;IAC5B,gBAAgB,CAAU;;;;;;;;IAyDzB,QAAQ,CAAqC;;IAG7C,OAAO,CAAoC;;IAG3C,MAAM,CAAoC;;;;IAMnD,iBAAiB;QACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;KACtC;IAED,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,kBAAkB;;;;;;QAMhB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,gBAAgB,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;SACtC;KACF;;;;;;;;;;;;;IAiBD,MAAM,MAAM;QACV,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;KACzB;;;;;IAOD,MAAM,MAAM;QACV,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;KACzB;;;;;IAOD,MAAM,KAAK;QACT,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;KACxB;;;;;IAOO,YAAY,GAAG;QACrB,IAAI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AAC,YAAY;gBAC3C,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY;aAC3C,EACD,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EACtC,IAAI,EAAC,OAAO,IAEZ,6DAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACxC,CACD,CACH,EACP;KACH;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/switch/scss/bq-switch.scss?tag=bq-switch&encapsulation=shadow","../../packages/beeq/src/components/switch/bq-switch.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Switch styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-switch.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.full-width) {\n @apply is-full;\n}\n\n.bq-switch {\n @apply flex cursor-pointer select-none items-center rounded-s transition-colors duration-300 p-b-2 p-i-2;\n\n justify-content: var(--bq-switch--justify-content);\n\n // Display background on hover (if enabled)\n &.has-background:not(.is-disabled):hover {\n @apply bg-hover-ui-primary;\n }\n\n &.is-disabled {\n @apply cursor-not-allowed opacity-60;\n }\n}\n\n.bq-switch--input:not(:disabled):focus-visible {\n ~ .bq-switch--control {\n @apply focus;\n }\n}\n\n.bq-switch--control__dot {\n @apply absolute start-xs2 rounded-full bg-icon-inverse bs-[--bq-switch--dot-size] is-[--bq-switch--dot-size];\n @apply group-[&.is-checked]:start-[calc(100%_-_var(--bq-switch--dot-size)_-_var(--bq-spacing-xs2))] group-[&.is-checked]:bg-[--bq-icon--alt];\n @apply transition-all duration-300;\n}\n\n.bq-switch--control__icon {\n --bq-icon--size: var(--bq-switch--dot-size) !important;\n\n &::part(base) {\n @apply flex;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-text-primary transition-colors duration-300':\n true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, g as getElement, h, a as Host } from './index-033f1efb.js';
|
|
6
|
-
import './assetsPath-e2f1ceb9.js';
|
|
7
6
|
import { d as debounce } from './debounce-3e72f418.js';
|
|
8
7
|
import { g as getNextElement } from './getNextElement-8bcc2025.js';
|
|
9
8
|
import { i as isHTMLElement } from './isHTMLElement-0271eefe.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-tab-group.entry.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,irqBAAirqB,CAAC;AACxsqB,yBAAe,aAAa;;MCoBf,UAAU;;;;;oBAsBqB,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;4BAGL,CAAC;8BAGd,KAAK;;;;IA9BvC,iBAAiB,CAAyD;;;;IAoClF,mBAAmB;QACjB,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;SACpD;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;SACjC;QAED,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,CAAC,KAAmD;YACpF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3B,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;KACvB;IAMD,eAAe;QACb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AAI,EAAC,MAAM,IAEX,8DAAQ,CACJ,CACF,CACD,EACP;KACH;;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tab-group/scss/bq-tab-group.scss?tag=bq-tab-group&encapsulation=shadow","../../packages/beeq/src/components/tab-group/bq-tab-group.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply block;\n}\n\n.bq-tab-group {\n @apply relative;\n\n &::after {\n @apply absolute flex border-0 border-solid border-bg-tertiary content-empty;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n @apply is-full inset-be-0 [border-block-end-width:--bq-stroke-s];\n }\n }\n\n &--horizontal-start {\n @apply justify-start;\n }\n\n &--horizontal-end {\n @apply justify-end;\n }\n\n &--vertical-start::after {\n @apply end-0 bs-full is-0 [border-block-end-width:0px] [border-inline-end-width:--bq-stroke-s];\n }\n\n &--vertical-end::after {\n @apply start-0 bs-full is-0 [border-block-end-width:0px] [border-inline-start-width:--bq-stroke-s];\n }\n}\n\n.bq-tab-group.no-divider {\n &::after {\n @apply content-none;\n }\n}\n\n.bq-tab-group--container {\n @include hide-scrollbar;\n @apply gap-xs2 p-xs2; // This will avoid cutting the outline focus style\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\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 focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bq-tab-group.entry.js","mappings":";;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,irqBAAirqB,CAAC;AACxsqB,yBAAe,aAAa;;MCoBf,UAAU;;;;;oBAsBqB,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;4BAGL,CAAC;8BAGd,KAAK;;;;IA9BvC,iBAAiB,CAAyD;;;;IAoClF,mBAAmB;QACjB,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;SACpD;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IA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CAAC,SAAS,eAAe,GAAG,IAAI;gBACvF,YAAY,EAAE,IAAI,CAAC,cAAc;aAClC,EACD,IAAI,EAAC,MAAM,IAEX,4DACE,KAAK,EAAE;gBACL,8CAA8C,EAAE,IAAI;gBACpD,UAAU,EAAE,IAAI,CAAC,WAAW,KAAK,YAAY;aAC9C,EACD,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM,IAEX,8DAAQ,CACJ,CACF,CACD,EACP;KACH;;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tab-group/scss/bq-tab-group.scss?tag=bq-tab-group&encapsulation=shadow","../../packages/beeq/src/components/tab-group/bq-tab-group.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n:host {\n @apply block;\n}\n\n.bq-tab-group {\n @apply relative;\n\n &::after {\n @apply absolute flex border-0 border-solid border-bg-tertiary content-empty;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n @apply is-full inset-be-0 [border-block-end-width:--bq-stroke-s];\n }\n }\n\n &--horizontal-start {\n @apply justify-start;\n }\n\n &--horizontal-end {\n @apply justify-end;\n }\n\n &--vertical-start::after {\n @apply end-0 bs-full is-0 [border-block-end-width:0px] [border-inline-end-width:--bq-stroke-s];\n }\n\n &--vertical-end::after {\n @apply start-0 bs-full is-0 [border-block-end-width:0px] [border-inline-start-width:--bq-stroke-s];\n }\n}\n\n.bq-tab-group.no-divider {\n &::after {\n @apply content-none;\n }\n}\n\n.bq-tab-group--container {\n @include hide-scrollbar;\n @apply gap-xs2 p-xs2; // This will avoid cutting the outline focus style\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\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 focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/esm/bq-tab.entry.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, g as getElement, h } from './index-033f1efb.js';
|
|
6
6
|
import { T as TAB_SIZE, a as TAB_ORIENTATION, b as TAB_PLACEMENT } from './bq-tab.types-36e2666e.js';
|
|
7
|
-
import './assetsPath-e2f1ceb9.js';
|
|
8
7
|
import { v as validatePropValue } from './props-3bf7f546.js';
|
|
9
8
|
import { b as hasSlotContent } from './slot-58bfedb5.js';
|
|
10
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-tab.entry.js","mappings":";;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,mgyBAAmgyB,CAAC;AACrhyB,oBAAe,QAAQ;;MCgBV,KAAK;;;;;;;wBAgBmB,IAAI;uBACX,KAAK;;wBASG,KAAK;oBAGC,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;;;;;;IA/BpD,aAAa,CAAoB;IACjC,WAAW,CAAkB;;;;IA4CrC,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzE,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;KACjE;;;;;IAOQ,OAAO,CAAiC;;IAGxC,OAAO,CAAiC;;IAGxC,MAAM,CAAiC;;IAGvC,SAAS,CAA8B;;;;IAMhD,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;;;;;;;;;;;;;IAgBD,MAAM,MAAM;QACV,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;KAC7B;;;;;IAOD,MAAM,MAAM;QACV,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;KAC7B;;;;;IAOD,MAAM,KAAK;QACT,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC;KAC5B;;;;;IAOD,MAAM,WAAW,CAAC,KAAc;QAC9B,IAAI,CAAC,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;KAClC;;;;;IAOO,WAAW,GAAG;QAC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ACvB,IAAI,EAAC,KAAK,mBACK,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,mBAChC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,EAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,MAAM,IAEX,4DAAK,KAAK,EAAC,kCAAkC,EAAC,IAAI,EAAC,SAAS,IAC1D,4DAAK,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,CAAC,IAAqB,MAAM,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,IAAI,EAAC,MAAM,IACtF,6DAAM,IAAI,EAAC,MAAM,EAAC,YAAY,EAAE,IAAI,CAAC,oBAAoB,GAAI,CACzD,EACN,4DAAK,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAC,MAAM,IAC9F,8DAAQ,CACJ,CACF,CACC,EACT;KACH;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tab/scss/bq-tab.scss?tag=bq-tab&encapsulation=shadow","../../packages/beeq/src/components/tab/bq-tab.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tab.variables';\n\n:host {\n @apply inline-block;\n}\n\n.bq-tab {\n @apply relative flex cursor-pointer items-center justify-center rounded-s disabled:cursor-not-allowed disabled:opacity-60;\n @apply text-[length:--bq-tab--font-size] font-[--bq-tab--font-weight] leading-[--bq-tab--line-height] [&:not([disabled])]:hover:bg-hover-ui-primary [&:not([disabled])]:hover:text-hover-text-brand;\n @apply border-0 bg-transparent focus-visible:focus;\n @apply transition-[color,background-color,border-color,box-shadow] duration-300;\n\n &::after {\n @apply absolute z-[1] block bg-stroke-brand opacity-0 content-empty -inset-be-1;\n @apply transition-opacity duration-300 ease-linear;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n /**\n * This hack will make the underline larger so it fits till the tab bar edges for the first and last tab button,\n * because the parent container applies some padding to not cut the focus outline style.\n */\n @apply -start-xs3 bs-[2px] is-[calc(100%_+_var(--bq-spacing-xs2))];\n }\n }\n\n &--vertical-start {\n @apply justify-end is-full;\n\n &::after {\n @apply -end-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &--vertical-end {\n @apply justify-start is-full;\n\n &::after {\n @apply -start-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &[aria-selected='true']::after {\n @apply opacity-100;\n }\n\n &--small {\n @apply p-b-[--bq-tab--padding-vertical-small] p-i-[--bq-tab--padding-horizontal-small];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-small) #{!important};\n }\n }\n\n &--medium {\n @apply p-b-[--bq-tab--padding-vertical-medium] p-i-[--bq-tab--padding-horizontal-medium];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-medium) #{!important};\n }\n }\n\n &--large {\n @apply text-l p-b-[--bq-tab--padding-vertical-large] p-i-[--bq-tab--padding-horizontal-large];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-large) #{!important};\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\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 * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-text-brand': this.active,\n 'text-text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bq-tab.entry.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,mgyBAAmgyB,CAAC;AACrhyB,oBAAe,QAAQ;;MCgBV,KAAK;;;;;;;wBAgBmB,IAAI;uBACX,KAAK;;wBASG,KAAK;oBAGC,QAAQ;2BAGO,YAAY;yBAGhB,OAAO;;;;;;IA/BpD,aAAa,CAAoB;IACjC,WAAW,CAAkB;;;;IA4CrC,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzE,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;KACjE;;;;;IAOQ,OAAO,CAAiC;;IAGxC,OAAO,CAAiC;;IAGxC,MAAM,CAAiC;;IAGvC,SAAS,CAA8B;;;;IAMhD,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;;;;;;;;;;;;;IAgBD,MAAM,MAAM;QACV,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;KAC7B;;;;;IAOD,MAAM,MAAM;QACV,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;KAC7B;;;;;IAOD,MAAM,KAAK;QACT,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC;KAC5B;;;;;IAOD,MAAM,WAAW,CAAC,KAAc;QAC9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AAI,CAAC,aAAa,EAC3B,SAAS,EAAE,IAAI,CAAC,eAAe,EAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,KAAK,mBACK,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,mBAChC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,EAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,MAAM,IAEX,4DAAK,KAAK,EAAC,kCAAkC,EAAC,IAAI,EAAC,SAAS,IAC1D,4DAAK,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,CAAC,IAAqB,MAAM,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,IAAI,EAAC,MAAM,IACtF,6DAAM,IAAI,EAAC,MAAM,EAAC,YAAY,EAAE,IAAI,CAAC,oBAAoB,GAAI,CACzD,EACN,4DAAK,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAC,MAAM,IAC9F,8DAAQ,CACJ,CACF,CACC,EACT;KACH;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/tab/scss/bq-tab.scss?tag=bq-tab&encapsulation=shadow","../../packages/beeq/src/components/tab/bq-tab.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Tab styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-tab.variables';\n\n:host {\n @apply inline-block;\n}\n\n.bq-tab {\n @apply relative flex cursor-pointer items-center justify-center rounded-s disabled:cursor-not-allowed disabled:opacity-60;\n @apply text-[length:--bq-tab--font-size] font-[--bq-tab--font-weight] leading-[--bq-tab--line-height] [&:not([disabled])]:hover:bg-hover-ui-primary [&:not([disabled])]:hover:text-hover-text-brand;\n @apply border-0 bg-transparent focus-visible:focus;\n @apply transition-[color,background-color,border-color,box-shadow] duration-300;\n\n &::after {\n @apply absolute z-[1] block bg-stroke-brand opacity-0 content-empty -inset-be-1;\n @apply transition-opacity duration-300 ease-linear;\n }\n\n &--horizontal-start,\n &--horizontal-end {\n &::after {\n /**\n * This hack will make the underline larger so it fits till the tab bar edges for the first and last tab button,\n * because the parent container applies some padding to not cut the focus outline style.\n */\n @apply -start-xs3 bs-[2px] is-[calc(100%_+_var(--bq-spacing-xs2))];\n }\n }\n\n &--vertical-start {\n @apply justify-end is-full;\n\n &::after {\n @apply -end-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &--vertical-end {\n @apply justify-start is-full;\n\n &::after {\n @apply -start-xs2 bs-[calc(100%_+_var(--bq-spacing-xs2))] is-[2px];\n }\n }\n\n &[aria-selected='true']::after {\n @apply opacity-100;\n }\n\n &--small {\n @apply p-b-[--bq-tab--padding-vertical-small] p-i-[--bq-tab--padding-horizontal-small];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-small) #{!important};\n }\n }\n\n &--medium {\n @apply p-b-[--bq-tab--padding-vertical-medium] p-i-[--bq-tab--padding-horizontal-medium];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-medium) #{!important};\n }\n }\n\n &--large {\n @apply text-l p-b-[--bq-tab--padding-vertical-large] p-i-[--bq-tab--padding-horizontal-large];\n\n ::slotted(bq-icon) {\n --bq-icon--size: var(--bq-tab--icon-size-large) #{!important};\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\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 * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-text-brand': this.active,\n 'text-text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, g as getElement, h } from './index-033f1efb.js';
|
|
6
|
-
import './assetsPath-e2f1ceb9.js';
|
|
7
6
|
import { d as debounce } from './debounce-3e72f418.js';
|
|
8
7
|
import { i as isHTMLElement } from './isHTMLElement-0271eefe.js';
|
|
9
8
|
import { b as hasSlotContent } from './slot-58bfedb5.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-textarea.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,uh0BAAuh0B,CAAC;AAC9i0B,yBAAe,aAAa;;MCoBf,UAAU;;;;;;;;6BAoBY,KAAK;wBACV,KAAK;8BAUkC,KAAK;4BAMxB,KAAK;2BAMA,KAAK;;wBASb,KAAK;4BAMM,CAAC;wBAGZ,KAAK;6BAGC,KAAK;;;;;wBAkBV,KAAK;wBAGL,KAAK;oBAGX,CAAC;0BAGM,KAAK;gCAWU,MAAM;;oBAMrB,MAAM;;;;IAxG7C,eAAe,CAAkB;IACjC,UAAU,GAAG,UAAU,CAAC;IAExB,cAAc,CAAe;IAC7B,SAAS,CAAoB;IAC7B,QAAQ,CAAsB;;;;IAyGtC,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC3B,IAAI,CAAC,IAAI,CA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CAAC,EAC1D,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,OAAO,IAEX,IAAI,CAAC,KAAK,CACF,EACX,4DACE,KAAK,EAAE;gBACL,uDAAuD,EAAE,IAAI;gBAC7D,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI;gBAC7C,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,SAAS;aAClD,EACD,IAAI,EAAC,aAAa,IAElB,6DACE,KAAK,EAAC,2BAA2B,EACjC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EACxD,IAAI,EAAC,aAAa,IAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,GAAI,CACrE,EACP,6DAAM,KAAK,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAC,gBAAgB,IACrG,IAAI,CAAC,kBAAkB,OAAG,IAAI,CAAC,SAAS,CACpC,CACH,CACF,EACN;KACH;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/textarea/scss/bq-textarea.scss?tag=bq-textarea&encapsulation=shadow","../../packages/beeq/src/components/textarea/bq-textarea.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Textarea styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-textarea.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__label {\n @apply text-[length:--bq-textarea--label-text-size] text-[color:--bq-textarea--label-text-color] m-be-[--bq-textarea--label-margin-bottom];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Textarea control */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__input {\n @apply flex-auto resize-y bg-[--bq-textarea--background-color] bs-[inherit];\n // Border\n @apply rounded-[--bq-textarea--border-radius] border-[length:--bq-textarea--border-width] border-[color:--bq-textarea--border-color];\n // Padding\n @apply pe-[--bq-textarea--padding-end] ps-[--bq-textarea--padding-start] p-b-[--bq-textarea--paddingY];\n // Text\n @apply text-[length:--bq-textarea--text-size] text-[color:--bq-textarea--text-color] placeholder:text-[color:--bq-textarea--text-placeholder-color];\n // Transition\n @apply transition-colors ease-in-out;\n // Hover\n @apply [&:not([disabled]):not(:focus-within)]:hover:border-hover-stroke-brand;\n // Disabled\n @apply disabled:cursor-not-allowed disabled:opacity-60;\n // Focus\n &:not([disabled]):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-textarea--border-color-focus);\n\n @apply focus border-[color:--bq-ring-color-focus];\n }\n}\n\n/* ------------------------------- Validations ------------------------------- */\n\n.bq-textarea__input.validation-error {\n @apply border-stroke-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.danger);\n\n @apply border-active-stroke-danger;\n }\n}\n\n.bq-textarea__input.validation-success {\n @apply border-stroke-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.success);\n\n @apply border-active-stroke-success;\n }\n}\n\n.bq-textarea__input.validation-warning {\n @apply border-stroke-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.warning);\n\n @apply border-active-stroke-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__helper {\n @apply text-[length:--bq-textarea--helper-text-size] text-[color:--bq-textarea--helper-text-color] m-bs-[--bq-textarea--helper-margin-top];\n}\n\n/* ------------------------------- Validations ------------------------------ */\n\n.bq-textarea__helper.validation-error {\n @apply text-text-danger;\n}\n\n.bq-textarea__helper.validation-success {\n @apply text-text-success;\n}\n\n.bq-textarea__helper.validation-warning {\n @apply text-text-warning;\n}\n\n/* ----------------------------- Helper counter ----------------------------- */\n\n/** Apply a disabled text color style to the textarea counter when the validation is none. */\n.bq-textarea__helper[class~='validation-none'] {\n .bq-textarea__helper--counter {\n @apply opacity-60;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TTextareaAutoCapitalize, TTextareaWrap } from './bq-textarea.types';\nimport { debounce, hasSlotContent, isHTMLElement, TDebounce } from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part input - The textarea element.\n * @part label - The textarea label.\n * @part helper-info - The helper info container.\n * @part helper-text - The helper text.\n * @part helper-counter - The helper counter.\n */\n@Component({\n tag: 'bq-textarea',\n styleUrl: './scss/bq-textarea.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTextarea {\n // Own Properties\n // ====================\n\n private debounceBqInput: TDebounce<void>;\n private fallbackId = 'textarea';\n\n private helperTextElem?: HTMLElement;\n private labelElem?: HTMLLabelElement;\n private textarea: HTMLTextAreaElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTextareaElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasHelperText = false;\n @State() private hasLabel = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the textarea field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: TTextareaAutoCapitalize = 'off';\n\n /**\n * Specifies whether or not the textarea field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the textarea field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the textarea will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /**\n * If `true`, the textarea will automatically grow and shrink to fit its contents.\n * If `false`, the textarea will have a fixed height specified by the `rows` property.\n */\n @Prop({ reflect: true }) autoGrow: boolean = false;\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the textarea value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /** If `true`, the user cannot interact with the textarea. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If `true`, it will block the user's ability to resize the textarea. */\n @Prop({ reflect: true }) disableResize?: boolean = false;\n\n /** The ID of the form that the textarea field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The maximum number of characters that can be entered into the textarea (`0`: no limit).\n * When enabled, a character counter will be shown underneath the textarea.\n */\n @Prop({ reflect: true }) maxlength: number;\n\n /** The name of the textarea element. */\n @Prop({ reflect: true }) name!: string;\n\n /** The placeholder text to show when there is no value. */\n @Prop({ reflect: true }) placeholder!: string;\n\n /** If true, the textarea field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean = false;\n\n /** Indicates whether or not the textarea field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** The number of visible text lines for the control. It must be a positive integer. */\n @Prop({ reflect: true }) rows: number = 5;\n\n /** If true, the textarea content may be checked for spelling errors. */\n @Prop({ reflect: true }) spellcheck: boolean = false;\n /**\n * The validation status of the textarea.\n *\n * @remarks\n * This property is used to indicate the validation status of the textarea. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The textarea has a validation error.\n * - `'warning'`: The textarea has a validation warning.\n * - `'success'`: The textarea has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The value of the textarea. It can be used to reset the textarea to a previous value. */\n @Prop({ mutable: true }) value: string;\n\n /** Specifies how the text in a text area is to be wrapped when submitted in a form */\n @Prop({ reflect: true }) wrap: TTextareaWrap = 'soft';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (!this.textarea) return;\n if (!this.maxlength || this.value.length < this.maxlength) return;\n // If the value is longer than the maxlength, we need to truncate it\n this.value = this.value.substring(0, this.maxlength);\n this.textarea.value = this.value;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the textarea loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value has changed and the textarea loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the textarea field and then clicks outside of the textarea field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n /** Callback handler emitted when the textarea value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqTextareaElement>;\n\n /** Callback handler emitted when the textarea has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value changes.\n * This handler is called whenever the user types or pastes text into the textarea field.\n */\n @Event() bqInput!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n // Listeners\n // ==============\n\n componentDidLoad() {\n this.handleValueChange();\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 numberOfCharacters() {\n if (!this.maxlength || !this.textarea) return 0;\n\n return this.value.length;\n }\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n\n this.autoResize();\n };\n\n private autoResize = () => {\n if (!this.autoGrow) return;\n\n const inputElem = this.textarea;\n if (!inputElem) return;\n\n inputElem.style.height = 'auto';\n inputElem.style.height = `${inputElem.scrollHeight}px`;\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-textarea flex flex-auto flex-col\" part=\"base\">\n <label\n class={{ 'bq-textarea__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name ?? this.fallbackId}\n aria-label={this.name ?? this.fallbackId}\n ref={(label: HTMLLabelElement) => (this.labelElem = label)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n <textarea\n id={this.name ?? this.fallbackId}\n class={{\n 'bq-textarea__input': true,\n 'resize-none': this.disableResize,\n [`validation-${this.validationStatus}`]: true,\n }}\n autocapitalize={this.autocapitalize}\n autocomplete={this.autocomplete}\n autocorrect={this.autocorrect}\n autofocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n maxLength={this.maxlength > 0 ? this.maxlength : undefined}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n spellcheck={this.spellcheck}\n wrap={this.wrap}\n ref={(elem: HTMLTextAreaElement) => (this.textarea = elem)}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n part=\"input\"\n >\n {this.value}\n </textarea>\n <div\n class={{\n 'bq-textarea__helper flex items-center justify-between': true,\n [`validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText && !this.maxlength,\n }}\n part=\"helper-info\"\n >\n <span\n class=\"bq-textarea__helper--text\"\n ref={(span: HTMLElement) => (this.helperTextElem = span)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </span>\n <span class={{ 'bq-textarea__helper--counter': true, '!hidden': !this.maxlength }} part=\"helper-counter\">\n {this.numberOfCharacters}/{this.maxlength}\n </span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"bq-textarea.entry.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,uh0BAAuh0B,CAAC;AAC9i0B,yBAAe,aAAa;;MCoBf,UAAU;;;;;;;;6BAoBY,KAAK;wBACV,KAAK;8BAUkC,KAAK;4BAMxB,KAAK;2BAMA,KAAK;;wBASb,KAAK;4BAMM,CAAC;wBAGZ,KAAK;6BAGC,KAAK;;;;;wBAkBV,KAAK;wBAGL,KAAK;oBAGX,CAAC;0BAGM,KAAK;gCAWU,MAAM;;oBAMrB,MAAM;;;;IAxG7C,eAAe,CAAkB;IACjC,UAAU,GAAG,UAAU,CAAC;IAExB,cAAc,CAAe;IAC7B,SAAS,CAAoB;IAC7B,QAAQ,CAAsB;;;;IAyGtC,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC3B,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS;YAA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,YAAY,EAC3B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,OAAO,IAEX,IAAI,CAAC,KAAK,CACF,EACX,4DACE,KAAK,EAAE;gBACL,uDAAuD,EAAE,IAAI;gBAC7D,CAAC,cAAc,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI;gBAC7C,SAAS,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,SAAS;aAClD,EACD,IAAI,EAAC,aAAa,IAElB,6DACE,KAAK,EAAC,2BAA2B,EACjC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EACxD,IAAI,EAAC,aAAa,IAElB,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,GAAI,CACrE,EACP,6DAAM,KAAK,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAC,gBAAgB,IACrG,IAAI,CAAC,kBAAkB,OAAG,IAAI,CAAC,SAAS,CACpC,CACH,CACF,EACN;KACH;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/textarea/scss/bq-textarea.scss?tag=bq-textarea&encapsulation=shadow","../../packages/beeq/src/components/textarea/bq-textarea.tsx"],"sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Textarea styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-textarea.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__label {\n @apply text-[length:--bq-textarea--label-text-size] text-[color:--bq-textarea--label-text-color] m-be-[--bq-textarea--label-margin-bottom];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Textarea control */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__input {\n @apply flex-auto resize-y bg-[--bq-textarea--background-color] bs-[inherit];\n // Border\n @apply rounded-[--bq-textarea--border-radius] border-[length:--bq-textarea--border-width] border-[color:--bq-textarea--border-color];\n // Padding\n @apply pe-[--bq-textarea--padding-end] ps-[--bq-textarea--padding-start] p-b-[--bq-textarea--paddingY];\n // Text\n @apply text-[length:--bq-textarea--text-size] text-[color:--bq-textarea--text-color] placeholder:text-[color:--bq-textarea--text-placeholder-color];\n // Transition\n @apply transition-colors ease-in-out;\n // Hover\n @apply [&:not([disabled]):not(:focus-within)]:hover:border-hover-stroke-brand;\n // Disabled\n @apply disabled:cursor-not-allowed disabled:opacity-60;\n // Focus\n &:not([disabled]):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-textarea--border-color-focus);\n\n @apply focus border-[color:--bq-ring-color-focus];\n }\n}\n\n/* ------------------------------- Validations ------------------------------- */\n\n.bq-textarea__input.validation-error {\n @apply border-stroke-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.danger);\n\n @apply border-active-stroke-danger;\n }\n}\n\n.bq-textarea__input.validation-success {\n @apply border-stroke-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.success);\n\n @apply border-active-stroke-success;\n }\n}\n\n.bq-textarea__input.validation-warning {\n @apply border-stroke-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-stroke-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(colors.stroke.warning);\n\n @apply border-active-stroke-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helper text */\n/* -------------------------------------------------------------------------- */\n\n.bq-textarea__helper {\n @apply text-[length:--bq-textarea--helper-text-size] text-[color:--bq-textarea--helper-text-color] m-bs-[--bq-textarea--helper-margin-top];\n}\n\n/* ------------------------------- Validations ------------------------------ */\n\n.bq-textarea__helper.validation-error {\n @apply text-text-danger;\n}\n\n.bq-textarea__helper.validation-success {\n @apply text-text-success;\n}\n\n.bq-textarea__helper.validation-warning {\n @apply text-text-warning;\n}\n\n/* ----------------------------- Helper counter ----------------------------- */\n\n/** Apply a disabled text color style to the textarea counter when the validation is none. */\n.bq-textarea__helper[class~='validation-none'] {\n .bq-textarea__helper--counter {\n @apply opacity-60;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TTextareaAutoCapitalize, TTextareaWrap } from './bq-textarea.types';\nimport { debounce, hasSlotContent, isHTMLElement, TDebounce } from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part input - The textarea element.\n * @part label - The textarea label.\n * @part helper-info - The helper info container.\n * @part helper-text - The helper text.\n * @part helper-counter - The helper counter.\n */\n@Component({\n tag: 'bq-textarea',\n styleUrl: './scss/bq-textarea.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTextarea {\n // Own Properties\n // ====================\n\n private debounceBqInput: TDebounce<void>;\n private fallbackId = 'textarea';\n\n private helperTextElem?: HTMLElement;\n private labelElem?: HTMLLabelElement;\n private textarea: HTMLTextAreaElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTextareaElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasHelperText = false;\n @State() private hasLabel = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the textarea field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: TTextareaAutoCapitalize = 'off';\n\n /**\n * Specifies whether or not the textarea field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the textarea field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the textarea will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /**\n * If `true`, the textarea will automatically grow and shrink to fit its contents.\n * If `false`, the textarea will have a fixed height specified by the `rows` property.\n */\n @Prop({ reflect: true }) autoGrow: boolean = false;\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the textarea value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /** If `true`, the user cannot interact with the textarea. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** If `true`, it will block the user's ability to resize the textarea. */\n @Prop({ reflect: true }) disableResize?: boolean = false;\n\n /** The ID of the form that the textarea field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The maximum number of characters that can be entered into the textarea (`0`: no limit).\n * When enabled, a character counter will be shown underneath the textarea.\n */\n @Prop({ reflect: true }) maxlength: number;\n\n /** The name of the textarea element. */\n @Prop({ reflect: true }) name!: string;\n\n /** The placeholder text to show when there is no value. */\n @Prop({ reflect: true }) placeholder!: string;\n\n /** If true, the textarea field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean = false;\n\n /** Indicates whether or not the textarea field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** The number of visible text lines for the control. It must be a positive integer. */\n @Prop({ reflect: true }) rows: number = 5;\n\n /** If true, the textarea content may be checked for spelling errors. */\n @Prop({ reflect: true }) spellcheck: boolean = false;\n /**\n * The validation status of the textarea.\n *\n * @remarks\n * This property is used to indicate the validation status of the textarea. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The textarea has a validation error.\n * - `'warning'`: The textarea has a validation warning.\n * - `'success'`: The textarea has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The value of the textarea. It can be used to reset the textarea to a previous value. */\n @Prop({ mutable: true }) value: string;\n\n /** Specifies how the text in a text area is to be wrapped when submitted in a form */\n @Prop({ reflect: true }) wrap: TTextareaWrap = 'soft';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (!this.textarea) return;\n if (!this.maxlength || this.value.length < this.maxlength) return;\n // If the value is longer than the maxlength, we need to truncate it\n this.value = this.value.substring(0, this.maxlength);\n this.textarea.value = this.value;\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the textarea loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value has changed and the textarea loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the textarea field and then clicks outside of the textarea field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n /** Callback handler emitted when the textarea value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqTextareaElement>;\n\n /** Callback handler emitted when the textarea has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqTextareaElement>;\n\n /**\n * Callback handler emitted when the textarea value changes.\n * This handler is called whenever the user types or pastes text into the textarea field.\n */\n @Event() bqInput!: EventEmitter<{ value: string; el: HTMLBqTextareaElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n // Listeners\n // ==============\n\n componentDidLoad() {\n this.handleValueChange();\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 numberOfCharacters() {\n if (!this.maxlength || !this.textarea) return 0;\n\n return this.value.length;\n }\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'textarea')) return;\n this.value = ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n\n this.autoResize();\n };\n\n private autoResize = () => {\n if (!this.autoGrow) return;\n\n const inputElem = this.textarea;\n if (!inputElem) return;\n\n inputElem.style.height = 'auto';\n inputElem.style.height = `${inputElem.scrollHeight}px`;\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-textarea flex flex-auto flex-col\" part=\"base\">\n <label\n class={{ 'bq-textarea__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name ?? this.fallbackId}\n aria-label={this.name ?? this.fallbackId}\n ref={(label: HTMLLabelElement) => (this.labelElem = label)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n <textarea\n id={this.name ?? this.fallbackId}\n class={{\n 'bq-textarea__input': true,\n 'resize-none': this.disableResize,\n [`validation-${this.validationStatus}`]: true,\n }}\n autocapitalize={this.autocapitalize}\n autocomplete={this.autocomplete}\n autocorrect={this.autocorrect}\n autofocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n maxLength={this.maxlength > 0 ? this.maxlength : undefined}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n rows={this.rows}\n spellcheck={this.spellcheck}\n wrap={this.wrap}\n ref={(elem: HTMLTextAreaElement) => (this.textarea = elem)}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n part=\"input\"\n >\n {this.value}\n </textarea>\n <div\n class={{\n 'bq-textarea__helper flex items-center justify-between': true,\n [`validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText && !this.maxlength,\n }}\n part=\"helper-info\"\n >\n <span\n class=\"bq-textarea__helper--text\"\n ref={(span: HTMLElement) => (this.helperTextElem = span)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </span>\n <span class={{ 'bq-textarea__helper--counter': true, '!hidden': !this.maxlength }} part=\"helper-counter\">\n {this.numberOfCharacters}/{this.maxlength}\n </span>\n </div>\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 { r as registerInstance, c as createEvent, g as getElement, h, a as Host } from './index-033f1efb.js';
|
|
6
|
-
import './assetsPath-e2f1ceb9.js';
|
|
7
6
|
import { d as debounce } from './debounce-3e72f418.js';
|
|
8
7
|
import { v as validatePropValue } from './props-3bf7f546.js';
|
|
9
8
|
import './isNil-2290f64e.js';
|
|
@@ -27,7 +26,7 @@ const BqToast = class {
|
|
|
27
26
|
registerInstance(this, hostRef);
|
|
28
27
|
this.bqHide = createEvent(this, "bqHide", 7);
|
|
29
28
|
this.bqShow = createEvent(this, "bqShow", 7);
|
|
30
|
-
this.toastPortal = document.querySelector(`.${TOAST_PORTAL_SELECTOR}`);
|
|
29
|
+
this.toastPortal = typeof window !== 'undefined' ? document.querySelector(`.${TOAST_PORTAL_SELECTOR}`) : null;
|
|
31
30
|
this.border = 's';
|
|
32
31
|
this.type = 'info';
|
|
33
32
|
this.placement = 'bottom-center';
|
|
@@ -73,7 +72,7 @@ const BqToast = class {
|
|
|
73
72
|
// =====================================
|
|
74
73
|
connectedCallback() {
|
|
75
74
|
const { toastPortal } = this;
|
|
76
|
-
if (!toastPortal && typeof
|
|
75
|
+
if (!toastPortal && typeof window !== 'undefined') {
|
|
77
76
|
this.toastPortal = Object.assign(document.createElement('div'), { className: TOAST_PORTAL_SELECTOR });
|
|
78
77
|
}
|
|
79
78
|
}
|
|
@@ -164,7 +163,7 @@ const BqToast = class {
|
|
|
164
163
|
const style = {
|
|
165
164
|
...(this.border && { '--bq-toast--border-radius': `var(--bq-radius--${this.border})` }),
|
|
166
165
|
};
|
|
167
|
-
return (h(Host, { key: '
|
|
166
|
+
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' }))));
|
|
168
167
|
}
|
|
169
168
|
static get watchers() { return {
|
|
170
169
|
"type": ["checkPropValues"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"bq-toast.entry.js","mappings":";;;;;;;;;;AAAO,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGvF,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,WAAW;IACX,cAAc;IACd,eAAe;IACf,aAAa;IACb,UAAU;CACF;;ACVV,MAAM,UAAU,GAA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IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAC,MAAM,IAC1F,6DAAM,IAAI,EAAC,MAAM,IACf,gEAAS,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,UAAU,GAAG,CACxE,CACH,EACN,8DAAQ,CACD,CACJ,EACP;KACH;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/toast/bq-toast.types.ts","../../packages/beeq/src/components/toast/scss/bq-toast.scss?tag=bq-toast&encapsulation=shadow","../../packages/beeq/src/components/toast/bq-toast.tsx"],"sourcesContent":["export const TOAST_TYPE = ['info', 'success', 'alert', 'error', 'loading', 'custom'] as const;\nexport type TToastType = (typeof TOAST_TYPE)[number];\n\nexport const TOAST_PLACEMENT = [\n 'top-center',\n 'top-right',\n 'bottom-right',\n 'bottom-center',\n 'bottom-left',\n 'top-left',\n] as const;\nexport type TToastPlacement = (typeof TOAST_PLACEMENT)[number];\n\nexport const TOAST_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TToastBorderRadius = (typeof TOAST_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Toast styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-toast.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-toast {\n @include animation-slide-in;\n @apply flex items-center gap-[--bq-toast--gap] p-b-[--bq-toast--padding-y] p-i-[--bq-toast--padding-x];\n @apply rounded-[--bq-toast--border-radius] bg-[--bq-toast--background] shadow-[shadow:--bq-toast--box-shadow];\n @apply border-[length:--bq-toast--border-width] border-[color:--bq-toast--border-color];\n\n border-style: var(--bq-toast--border-style);\n}\n\n.bq-toast--icon {\n @apply flex;\n\n &.info {\n @apply text-[--bq-toast--icon-color-info];\n }\n\n &.success {\n @apply text-[--bq-toast--icon-color-success];\n }\n\n &.alert {\n @apply text-[--bq-toast--icon-color-alert];\n }\n\n &.error {\n @apply text-[--bq-toast--icon-color-error];\n }\n\n &.loading {\n @include animation-spin;\n @apply text-[--bq-toast--icon-color-loading];\n }\n\n &.custom {\n @apply text-[--bq-toast--icon-color-custom];\n }\n}\n","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 = 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"],"version":3}
|
|
1
|
+
{"file":"bq-toast.entry.js","mappings":";;;;;;;;;AAAO,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAU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AM,GAAG,OAAO,EACrC,IAAI,EAAC,QAAQ,IAEb,+DAAQ,KAAK,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,IACrC,4DAAK,KAAK,EAAE,EAAE,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAC,MAAM,IAC1F,6DAAM,IAAI,EAAC,MAAM,IACf,gEAAS,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,UAAU,GAAG,CACxE,CACH,EACN,8DAAQ,CACD,CACJ,EACP;KACH;;;;;;;;;;;;","names":[],"sources":["../../packages/beeq/src/components/toast/bq-toast.types.ts","../../packages/beeq/src/components/toast/scss/bq-toast.scss?tag=bq-toast&encapsulation=shadow","../../packages/beeq/src/components/toast/bq-toast.tsx"],"sourcesContent":["export const TOAST_TYPE = ['info', 'success', 'alert', 'error', 'loading', 'custom'] as const;\nexport type TToastType = (typeof TOAST_TYPE)[number];\n\nexport const TOAST_PLACEMENT = [\n 'top-center',\n 'top-right',\n 'bottom-right',\n 'bottom-center',\n 'bottom-left',\n 'top-left',\n] as const;\nexport type TToastPlacement = (typeof TOAST_PLACEMENT)[number];\n\nexport const TOAST_BORDER_RADIUS = ['none', 'xs2', 'xs', 's', 'm', 'l', 'full'] as const;\nexport type TToastBorderRadius = (typeof TOAST_BORDER_RADIUS)[number];\n","/* -------------------------------------------------------------------------- */\n/* Toast styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-toast.variables';\n\n:host {\n @apply inline-block;\n}\n\n:host(.is-hidden) {\n @apply hidden;\n}\n\n.bq-toast {\n @include animation-slide-in;\n @apply flex items-center gap-[--bq-toast--gap] p-b-[--bq-toast--padding-y] p-i-[--bq-toast--padding-x];\n @apply rounded-[--bq-toast--border-radius] bg-[--bq-toast--background] shadow-[shadow:--bq-toast--box-shadow];\n @apply border-[length:--bq-toast--border-width] border-[color:--bq-toast--border-color];\n\n border-style: var(--bq-toast--border-style);\n}\n\n.bq-toast--icon {\n @apply flex;\n\n &.info {\n @apply text-[--bq-toast--icon-color-info];\n }\n\n &.success {\n @apply text-[--bq-toast--icon-color-success];\n }\n\n &.alert {\n @apply text-[--bq-toast--icon-color-alert];\n }\n\n &.error {\n @apply text-[--bq-toast--icon-color-error];\n }\n\n &.loading {\n @include animation-spin;\n @apply text-[--bq-toast--icon-color-loading];\n }\n\n &.custom {\n @apply text-[--bq-toast--icon-color-custom];\n }\n}\n","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"],"version":3}
|