@beeq/core 1.8.1 → 1.8.2
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 +1 -1
- package/dist/beeq/{p-2eab5223.entry.js → p-19f5a833.entry.js} +2 -2
- package/dist/beeq/{p-2eab5223.entry.js.map → p-19f5a833.entry.js.map} +1 -1
- package/dist/{components/p-55b0aea8.js → beeq/p-34611c2f.js} +2 -2
- package/dist/beeq/p-34611c2f.js.map +1 -0
- package/dist/beeq/{p-cb3b24e6.entry.js → p-347284ae.entry.js} +2 -2
- package/dist/beeq/p-347284ae.entry.js.map +1 -0
- package/dist/beeq/{p-20d91acf.entry.js → p-3806d9e3.entry.js} +2 -2
- package/dist/beeq/{p-20d91acf.entry.js.map → p-3806d9e3.entry.js.map} +1 -1
- package/dist/beeq/{p-c78ae3c2.js → p-397bc507.js} +2 -2
- package/dist/beeq/p-397bc507.js.map +1 -0
- package/dist/beeq/{p-4d6a9646.entry.js → p-39a80765.entry.js} +2 -2
- package/dist/beeq/{p-4d6a9646.entry.js.map → p-39a80765.entry.js.map} +1 -1
- package/dist/beeq/{p-f84ae6a1.entry.js → p-3d9ed4fa.entry.js} +2 -2
- package/dist/beeq/{p-f84ae6a1.entry.js.map → p-3d9ed4fa.entry.js.map} +1 -1
- package/dist/beeq/{p-5c7a719c.entry.js → p-3f654a12.entry.js} +2 -2
- package/dist/beeq/{p-5c7a719c.entry.js.map → p-3f654a12.entry.js.map} +1 -1
- package/dist/beeq/{p-7f124d61.entry.js → p-3fe626f1.entry.js} +2 -2
- package/dist/beeq/{p-7f124d61.entry.js.map → p-3fe626f1.entry.js.map} +1 -1
- package/dist/beeq/{p-0c12aa01.entry.js → p-4500ffe5.entry.js} +2 -2
- package/dist/beeq/{p-0c12aa01.entry.js.map → p-4500ffe5.entry.js.map} +1 -1
- package/dist/beeq/p-4a3784e1.js +7 -0
- package/dist/beeq/p-4a3784e1.js.map +1 -0
- package/dist/beeq/{p-0f72dbb6.entry.js → p-4d21a49d.entry.js} +2 -2
- package/dist/beeq/{p-0f72dbb6.entry.js.map → p-4d21a49d.entry.js.map} +1 -1
- package/dist/beeq/{p-36b653f6.entry.js → p-5546f242.entry.js} +2 -2
- package/dist/beeq/p-5546f242.entry.js.map +1 -0
- package/dist/beeq/{p-1cdea079.entry.js → p-65d67b85.entry.js} +2 -2
- package/dist/beeq/p-65d67b85.entry.js.map +1 -0
- package/dist/beeq/{p-43dc9906.entry.js → p-66b6d69a.entry.js} +2 -2
- package/dist/beeq/{p-43dc9906.entry.js.map → p-66b6d69a.entry.js.map} +1 -1
- package/dist/beeq/{p-dc544089.entry.js → p-70310ac8.entry.js} +2 -2
- package/dist/beeq/{p-dc544089.entry.js.map → p-70310ac8.entry.js.map} +1 -1
- package/dist/beeq/{p-a7fb6ffd.entry.js → p-7585f825.entry.js} +2 -2
- package/dist/beeq/{p-a7fb6ffd.entry.js.map → p-7585f825.entry.js.map} +1 -1
- package/dist/beeq/{p-75cc6789.entry.js → p-7efff703.entry.js} +2 -2
- package/dist/beeq/{p-75cc6789.entry.js.map → p-7efff703.entry.js.map} +1 -1
- package/dist/beeq/{p-19b7bbe0.entry.js → p-803269b3.entry.js} +2 -2
- package/dist/beeq/{p-19b7bbe0.entry.js.map → p-803269b3.entry.js.map} +1 -1
- package/dist/beeq/{p-1b0cfcd6.entry.js → p-8ed41b69.entry.js} +2 -2
- package/dist/beeq/{p-1b0cfcd6.entry.js.map → p-8ed41b69.entry.js.map} +1 -1
- package/dist/beeq/{p-7636aff3.entry.js → p-90165aef.entry.js} +2 -2
- package/dist/beeq/{p-7636aff3.entry.js.map → p-90165aef.entry.js.map} +1 -1
- package/dist/beeq/{p-00702295.entry.js → p-99d055ef.entry.js} +2 -2
- package/dist/beeq/p-99d055ef.entry.js.map +1 -0
- package/dist/beeq/{p-921fa1ea.entry.js → p-9a7af424.entry.js} +2 -2
- package/dist/beeq/{p-921fa1ea.entry.js.map → p-9a7af424.entry.js.map} +1 -1
- package/dist/beeq/{p-d8a257b7.entry.js → p-a4e11bbc.entry.js} +2 -2
- package/dist/beeq/{p-d8a257b7.entry.js.map → p-a4e11bbc.entry.js.map} +1 -1
- package/dist/beeq/{p-4c1f6afc.entry.js → p-a56ea1e0.entry.js} +2 -2
- package/dist/beeq/{p-4c1f6afc.entry.js.map → p-a56ea1e0.entry.js.map} +1 -1
- package/dist/beeq/{p-c70c6b00.entry.js → p-a8075be3.entry.js} +2 -2
- package/dist/beeq/{p-c70c6b00.entry.js.map → p-a8075be3.entry.js.map} +1 -1
- package/dist/beeq/{p-026fad0d.entry.js → p-a8d64d1b.entry.js} +2 -2
- package/dist/beeq/{p-026fad0d.entry.js.map → p-a8d64d1b.entry.js.map} +1 -1
- package/dist/beeq/{p-b83f174c.entry.js → p-a941b0bb.entry.js} +2 -2
- package/dist/beeq/{p-b83f174c.entry.js.map → p-a941b0bb.entry.js.map} +1 -1
- package/dist/beeq/p-b129db1a.entry.js +6 -0
- package/dist/beeq/{p-2c566eb0.entry.js.map → p-b129db1a.entry.js.map} +1 -1
- package/dist/beeq/p-b69f347d.entry.js +6 -0
- package/dist/beeq/p-b69f347d.entry.js.map +1 -0
- package/dist/beeq/{p-c09dac58.entry.js → p-b7b3f7c6.entry.js} +2 -2
- package/dist/beeq/{p-29d9487c.entry.js → p-bbaad491.entry.js} +2 -2
- package/dist/beeq/{p-29d9487c.entry.js.map → p-bbaad491.entry.js.map} +1 -1
- package/dist/beeq/p-c42f9ac5.entry.js +6 -0
- package/dist/beeq/{p-6079f9b2.entry.js.map → p-c42f9ac5.entry.js.map} +1 -1
- package/dist/beeq/{p-cf523684.entry.js → p-cb9fa154.entry.js} +2 -2
- package/dist/beeq/{p-cf523684.entry.js.map → p-cb9fa154.entry.js.map} +1 -1
- package/dist/beeq/p-cf923c68.js +6 -0
- package/dist/beeq/p-dafa4162.entry.js +6 -0
- package/dist/beeq/p-dafa4162.entry.js.map +1 -0
- package/dist/beeq/{p-0cab9a82.entry.js → p-e4983057.entry.js} +2 -2
- package/dist/beeq/p-e4983057.entry.js.map +1 -0
- package/dist/beeq/{p-3c472097.js → p-e4dd6ff4.js} +2 -2
- package/dist/beeq/{p-e056c02a.entry.js → p-e655938a.entry.js} +2 -2
- package/dist/beeq/{p-e056c02a.entry.js.map → p-e655938a.entry.js.map} +1 -1
- package/dist/beeq/{p-0c0bd129.entry.js → p-e8f147c2.entry.js} +2 -2
- package/dist/beeq/{p-0c0bd129.entry.js.map → p-e8f147c2.entry.js.map} +1 -1
- package/dist/beeq/{p-2ef4ed54.entry.js → p-ed569a61.entry.js} +2 -2
- package/dist/beeq/{p-2ef4ed54.entry.js.map → p-ed569a61.entry.js.map} +1 -1
- package/dist/beeq/{p-4c66663c.entry.js → p-ee1ecb6e.entry.js} +2 -2
- package/dist/beeq/{p-4c66663c.entry.js.map → p-ee1ecb6e.entry.js.map} +1 -1
- package/dist/beeq/{p-d8221b88.entry.js → p-f4e8ebd3.entry.js} +2 -2
- package/dist/beeq/{p-d8221b88.entry.js.map → p-f4e8ebd3.entry.js.map} +1 -1
- package/dist/beeq/{p-2e0e325b.entry.js → p-f83857ac.entry.js} +2 -2
- package/dist/beeq/p-f83857ac.entry.js.map +1 -0
- package/dist/cjs/{assetsPath-5e03c40e.js → assetsPath-32c4030b.js} +2 -2
- package/dist/cjs/{assetsPath-5e03c40e.js.map → assetsPath-32c4030b.js.map} +1 -1
- package/dist/cjs/beeq.cjs.js +2 -2
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +19 -6
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +32 -18
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +25 -12
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +19 -8
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +13 -5
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +13 -5
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +8 -2
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +62 -24
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +10 -3
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +24 -10
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +97 -43
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +24 -11
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +25 -11
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +21 -10
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +42 -17
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +10 -4
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +106 -31
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +23 -11
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +34 -12
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +16 -7
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +7 -4
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +20 -8
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +24 -10
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +20 -8
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +74 -32
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +13 -5
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +15 -5
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +51 -17
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +15 -7
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +8 -2
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +12 -4
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +12 -4
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +32 -13
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +18 -7
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +22 -10
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +77 -24
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +19 -8
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +25 -9
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{cally-9297cdd8.js → cally-1bde2e82.js} +3 -2
- package/dist/cjs/cally-1bde2e82.js.map +1 -0
- package/dist/cjs/{index-c4edfa07.js → index-0c8d249a.js} +1128 -920
- package/dist/cjs/index-0c8d249a.js.map +1 -0
- package/dist/cjs/{index-fc7876d6.js → index-30fbd193.js} +54 -29
- package/dist/cjs/index-30fbd193.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{isDefined-e538d669.js → isDefined-5e8aae9d.js} +2 -2
- package/dist/cjs/{isDefined-e538d669.js.map → isDefined-5e8aae9d.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/bq-accordion.js +30 -18
- package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
- package/dist/collection/components/accordion/scss/bq-accordion.css +1 -1
- package/dist/collection/components/accordion-group/bq-accordion-group.js +18 -7
- package/dist/collection/components/accordion-group/bq-accordion-group.js.map +1 -1
- package/dist/collection/components/alert/bq-alert.js +23 -12
- package/dist/collection/components/alert/bq-alert.js.map +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/avatar/bq-avatar.js +18 -9
- package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
- package/dist/collection/components/badge/bq-badge.js +12 -6
- package/dist/collection/components/badge/bq-badge.js.map +1 -1
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js +7 -3
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js.map +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +11 -5
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
- package/dist/collection/components/button/bq-button.js +37 -16
- package/dist/collection/components/button/bq-button.js.map +1 -1
- package/dist/collection/components/card/bq-card.js +9 -4
- package/dist/collection/components/card/bq-card.js.map +1 -1
- package/dist/collection/components/checkbox/bq-checkbox.js +23 -11
- package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js +93 -41
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/bq-dialog.js +23 -12
- package/dist/collection/components/dialog/bq-dialog.js.map +1 -1
- package/dist/collection/components/divider/bq-divider.js +24 -12
- package/dist/collection/components/divider/bq-divider.js.map +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +19 -10
- package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/dropdown/bq-dropdown.js +23 -11
- package/dist/collection/components/dropdown/bq-dropdown.js.map +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +9 -5
- package/dist/collection/components/empty-state/bq-empty-state.js.map +1 -1
- package/dist/collection/components/icon/bq-icon.js +22 -9
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/input/bq-input.js +104 -31
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/notification/bq-notification.js +22 -12
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/option/bq-option.js +15 -8
- package/dist/collection/components/option/bq-option.js.map +1 -1
- package/dist/collection/components/option-list/bq-option-list.js +9 -3
- package/dist/collection/components/option-list/bq-option-list.js.map +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +6 -5
- package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
- package/dist/collection/components/panel/bq-panel.js +17 -8
- package/dist/collection/components/panel/bq-panel.js.map +1 -1
- package/dist/collection/components/progress/bq-progress.js +19 -9
- package/dist/collection/components/progress/bq-progress.js.map +1 -1
- package/dist/collection/components/radio/bq-radio.js +19 -9
- package/dist/collection/components/radio/bq-radio.js.map +1 -1
- package/dist/collection/components/radio-group/bq-radio-group.js +23 -11
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/select/bq-select.js +71 -31
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +14 -6
- package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js +12 -6
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
- package/dist/collection/components/slider/bq-slider.js +50 -18
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +14 -8
- package/dist/collection/components/spinner/bq-spinner.js.map +1 -1
- package/dist/collection/components/status/bq-status.js +7 -3
- package/dist/collection/components/status/bq-status.js.map +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +11 -5
- package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
- package/dist/collection/components/steps/bq-steps.js +11 -5
- package/dist/collection/components/steps/bq-steps.js.map +1 -1
- package/dist/collection/components/switch/bq-switch.js +31 -14
- package/dist/collection/components/switch/bq-switch.js.map +1 -1
- package/dist/collection/components/tab/bq-tab.js +21 -11
- package/dist/collection/components/tab/bq-tab.js.map +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +17 -8
- package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
- package/dist/collection/components/tag/bq-tag.js +24 -12
- package/dist/collection/components/tag/bq-tag.js.map +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +75 -24
- package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
- package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
- package/dist/collection/components/toast/bq-toast.js +18 -9
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +23 -9
- package/dist/collection/components/tooltip/bq-tooltip.js.map +1 -1
- package/dist/collection/global/scripts/zeroheight-svg-loader.js +6 -5
- package/dist/components/bq-accordion-group.js +1 -1
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +1 -1
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +1 -1
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +1 -1
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge.js +1 -1
- package/dist/components/bq-breadcrumb-item.js +1 -1
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +1 -1
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button.js +1 -1
- package/dist/components/bq-card.js +1 -1
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +1 -1
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -1
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -1
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider.js +1 -1
- package/dist/components/bq-drawer.js +1 -1
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown.js +1 -1
- package/dist/components/bq-empty-state.js +1 -1
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon.js +1 -1
- package/dist/components/bq-input.js +1 -1
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +1 -1
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -1
- package/dist/components/bq-option-list.js +1 -1
- package/dist/components/bq-option.js +1 -1
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +1 -1
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel.js +1 -1
- package/dist/components/bq-progress.js +1 -1
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +1 -1
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +1 -1
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +1 -1
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +1 -1
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +1 -1
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +1 -1
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +1 -1
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +1 -1
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +1 -1
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -1
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +1 -1
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +1 -1
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +1 -1
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag.js +1 -1
- package/dist/components/bq-textarea.js +1 -1
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +1 -1
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/{beeq/p-55b0aea8.js → components/p-34611c2f.js} +2 -2
- package/dist/components/p-34611c2f.js.map +1 -0
- package/dist/components/p-37483f1c.js +6 -0
- package/dist/components/{p-d62fdbae.js.map → p-37483f1c.js.map} +1 -1
- package/dist/components/{p-c78ae3c2.js → p-397bc507.js} +2 -2
- package/dist/components/p-397bc507.js.map +1 -0
- package/dist/components/{p-c2d43340.js → p-5b34bd04.js} +2 -2
- package/dist/components/{p-c2d43340.js.map → p-5b34bd04.js.map} +1 -1
- package/dist/components/{p-78d23ddc.js → p-6e0c7ab4.js} +2 -2
- package/dist/components/{p-33371480.js → p-8d8eeb62.js} +2 -2
- package/dist/components/{p-33371480.js.map → p-8d8eeb62.js.map} +1 -1
- package/dist/components/{p-27c1b08e.js → p-9a115ee5.js} +2 -2
- package/dist/components/{p-27c1b08e.js.map → p-9a115ee5.js.map} +1 -1
- package/dist/components/p-a02c6b73.js +6 -0
- package/dist/components/{p-1566efe3.js.map → p-a02c6b73.js.map} +1 -1
- package/dist/components/p-ac26ffcd.js +6 -0
- package/dist/components/{p-603c898d.js.map → p-ac26ffcd.js.map} +1 -1
- package/dist/components/{p-d62fdbae.js → p-b50adb19.js} +2 -2
- package/dist/components/p-b50adb19.js.map +1 -0
- package/dist/components/p-c58e0d87.js +6 -0
- package/dist/components/{p-28da2321.js.map → p-c58e0d87.js.map} +1 -1
- package/dist/components/p-d16482dc.js +6 -0
- package/dist/components/p-d16482dc.js.map +1 -0
- package/dist/components/p-f5588ccd.js +6 -0
- package/dist/components/{p-7d7f1f7e.js.map → p-f5588ccd.js.map} +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/esm/{assetsPath-eed21007.js → assetsPath-57848212.js} +2 -2
- package/dist/esm/{assetsPath-eed21007.js.map → assetsPath-57848212.js.map} +1 -1
- package/dist/esm/beeq.js +3 -3
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +19 -6
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +32 -18
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +25 -12
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +19 -8
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +13 -5
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +13 -5
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +8 -2
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +62 -24
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +10 -3
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +24 -10
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +97 -43
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +24 -11
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +25 -11
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +21 -10
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +42 -17
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +10 -4
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +106 -31
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +23 -11
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +1 -1
- package/dist/esm/bq-option-list_2.entry.js +34 -12
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +16 -7
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +7 -4
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +20 -8
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +24 -10
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +20 -8
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +74 -32
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +13 -5
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +15 -5
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +51 -17
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +15 -7
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +8 -2
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +12 -4
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +12 -4
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +32 -13
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +18 -7
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +22 -10
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +77 -24
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +19 -8
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +25 -9
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{cally-1a3258d6.js → cally-49a83be1.js} +3 -2
- package/dist/esm/cally-49a83be1.js.map +1 -0
- package/dist/esm/{index-c7d02072.js → index-59610291.js} +1128 -920
- package/dist/esm/index-59610291.js.map +1 -0
- package/dist/esm/{index-1618c78b.js → index-d4eea621.js} +54 -29
- package/dist/esm/index-d4eea621.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/{isDefined-48de6db5.js → isDefined-30b8b652.js} +2 -2
- package/dist/esm/{isDefined-48de6db5.js.map → isDefined-30b8b652.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/hydrate/index.js +2354 -1514
- package/dist/hydrate/index.mjs +2354 -1514
- package/dist/stencil.config.js +3 -0
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/accordion/bq-accordion.d.ts +1 -1
- package/package.json +5 -5
- package/dist/beeq/p-00702295.entry.js.map +0 -1
- package/dist/beeq/p-01de6133.js +0 -6
- package/dist/beeq/p-0cab9a82.entry.js.map +0 -1
- package/dist/beeq/p-19c94c6d.entry.js +0 -6
- package/dist/beeq/p-19c94c6d.entry.js.map +0 -1
- package/dist/beeq/p-1cdea079.entry.js.map +0 -1
- package/dist/beeq/p-2c566eb0.entry.js +0 -6
- package/dist/beeq/p-2e0e325b.entry.js.map +0 -1
- package/dist/beeq/p-36b653f6.entry.js.map +0 -1
- package/dist/beeq/p-55b0aea8.js.map +0 -1
- package/dist/beeq/p-60094726.js +0 -7
- package/dist/beeq/p-60094726.js.map +0 -1
- package/dist/beeq/p-6079f9b2.entry.js +0 -6
- package/dist/beeq/p-c78ae3c2.js.map +0 -1
- package/dist/beeq/p-cb3b24e6.entry.js.map +0 -1
- package/dist/beeq/p-eb662058.entry.js +0 -6
- package/dist/beeq/p-eb662058.entry.js.map +0 -1
- package/dist/cjs/cally-9297cdd8.js.map +0 -1
- package/dist/cjs/index-c4edfa07.js.map +0 -1
- package/dist/cjs/index-fc7876d6.js.map +0 -1
- package/dist/components/p-1566efe3.js +0 -6
- package/dist/components/p-28da2321.js +0 -6
- package/dist/components/p-55b0aea8.js.map +0 -1
- package/dist/components/p-5940b410.js +0 -7
- package/dist/components/p-5940b410.js.map +0 -1
- package/dist/components/p-603c898d.js +0 -6
- package/dist/components/p-7d7f1f7e.js +0 -6
- package/dist/components/p-93c16753.js +0 -6
- package/dist/components/p-93c16753.js.map +0 -1
- package/dist/components/p-c78ae3c2.js.map +0 -1
- package/dist/components/p-cf496927.js +0 -6
- package/dist/components/p-cf496927.js.map +0 -1
- package/dist/esm/cally-1a3258d6.js.map +0 -1
- package/dist/esm/index-1618c78b.js.map +0 -1
- package/dist/esm/index-c7d02072.js.map +0 -1
- /package/dist/beeq/{p-c09dac58.entry.js.map → p-b7b3f7c6.entry.js.map} +0 -0
- /package/dist/beeq/{p-01de6133.js.map → p-cf923c68.js.map} +0 -0
- /package/dist/beeq/{p-3c472097.js.map → p-e4dd6ff4.js.map} +0 -0
- /package/dist/components/{p-78d23ddc.js.map → p-6e0c7ab4.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-panel.js","sourceRoot":"","sources":["../../../../../../src/components/panel/bq-panel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,MAAM,OAAO,OAAO
|
|
1
|
+
{"version":3,"file":"bq-panel.js","sourceRoot":"","sources":["../../../../../../src/components/panel/bq-panel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,MAAM,OAAO,OAAO;IAClB,iBAAiB;IACjB,uBAAuB;IAEf,KAAK,CAAc;IACnB,UAAU,CAAa;IACvB,OAAO,CAAmB;IAElC,iCAAiC;IACjC,sCAAsC;IAE3B,EAA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{ ReferenceElement } from '@floating-ui/dom';\nimport { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport { Placement } from '../../services/interfaces';\nimport { FloatingUI } from '../../services/libraries';\n\n/**\n * The Panel component is a versatile and essential element used to wrap and display content in a floating panel.\n *\n * @example How to use it\n * ```html\n * <bq-panel open>\n * <div>Panel content</div>\n * </bq-panel>\n * ```\n *\n * @status stable\n *\n * @attr {number} distance - Represents the distance (gutter or margin) between the panel and the trigger element.\n * @attr {\"top\" | \"bottom\" | \"left\" | \"right\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\" | \"right-start\" | \"right-end\"} placement - Position of the panel.\n * @attr {boolean} open - If true, the panel will be visible.\n * @attr {boolean} same-width - Whether the panel should have the same width as the trigger element.\n * @attr {number} skidding - Represents the skidding between the panel and the trigger element.\n * @attr {\"fixed\" | \"absolute\"} strategy - Defines the strategy to position the panel.\n *\n * @slot - The content of the panel.\n *\n * @part panel - The `<div>` element used to display and style the panel\n *\n * @prop --bq-panel--background - Panel background color\n * @prop --bq-panel--border-color - Panel border color\n * @prop --bq-panel--border-radius - Panel border radius\n * @prop --bq-panel--border-style - Panel border style\n * @prop --bq-panel--border-width - Panel border width\n * @prop --bq-panel--box-shadow - Panel box shadow\n * @prop --bq-panel--padding - Panel padding\n * @prop --bq-panel--height - Panel height\n * @prop --bq-panel--width - Panel width\n * @prop --bq-panel-z-index - Panel z-index applied when opened\n */\n@Component({\n tag: 'bq-panel',\n styleUrl: './scss/bq-panel.scss',\n shadow: true,\n})\nexport class BqPanel {\n // Own Properties\n // ====================\n\n private panel: HTMLElement;\n private floatingUI: FloatingUI;\n private trigger: ReferenceElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqPanelElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n handleOpenChange() {\n if (!this.open) {\n this.hidePanel();\n return;\n }\n\n this.showPanel();\n }\n\n @Watch('distance')\n @Watch('placement')\n @Watch('sameWidth')\n @Watch('skidding')\n @Watch('strategy')\n onPropChange() {\n this.floatingUI?.init({ ...this.options });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n // We need to find the trigger element from the parent to position the panel relative to it.\n const parentTrigger = this.el.parentElement.querySelector('div[part=\"trigger\"]');\n if (!parentTrigger) return;\n\n this.trigger = {\n getBoundingClientRect: () => parentTrigger.getBoundingClientRect(),\n contextElement: parentTrigger,\n };\n\n this.floatingUI = new FloatingUI(this.trigger, this.panel, { ...this.options });\n this.handleOpenChange();\n }\n\n disconnectedCallback() {\n this.floatingUI?.destroy();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private showPanel() {\n this.floatingUI?.update();\n }\n\n private async hidePanel() {\n this.open = false;\n }\n\n private get options() {\n return {\n distance: this.distance,\n placement: this.placement,\n sameWidth: this.sameWidth,\n skidding: this.skidding,\n strategy: this.strategy,\n };\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div\n class=\"bq-panel\"\n ref={(el) => (this.panel = el)}\n aria-hidden={!this.open ? 'true' : 'false'}\n hidden={!this.open}\n part=\"panel\"\n >\n <slot />\n </div>\n );\n }\n}\n"]}
|
|
@@ -41,20 +41,30 @@ import { validatePropValue } from "../../shared/utils";
|
|
|
41
41
|
* @cssprop --bq-progress-bar--trackColor - The progress bar track area (the grey one)
|
|
42
42
|
*/
|
|
43
43
|
export class BqProgress {
|
|
44
|
-
constructor() {
|
|
45
|
-
this.borderShape = 'rounded';
|
|
46
|
-
this.enableTooltip = false;
|
|
47
|
-
this.indeterminate = false;
|
|
48
|
-
this.label = false;
|
|
49
|
-
this.thickness = 'medium';
|
|
50
|
-
this.type = 'default';
|
|
51
|
-
this.value = 0;
|
|
52
|
-
}
|
|
53
44
|
// Own Properties
|
|
54
45
|
// ====================
|
|
55
46
|
// Reference to host HTML element
|
|
56
47
|
// ===================================
|
|
57
48
|
el;
|
|
49
|
+
// State() variables
|
|
50
|
+
// Inlined decorator, alphabetical order
|
|
51
|
+
// =======================================
|
|
52
|
+
// Public Property API
|
|
53
|
+
// ========================
|
|
54
|
+
/** It will set the border style of the progress bar */
|
|
55
|
+
borderShape = 'rounded';
|
|
56
|
+
/** If `true`, a tooltip will be shown displaying the progress value */
|
|
57
|
+
enableTooltip = false;
|
|
58
|
+
/** If `true` the indeterminate state of progress bar is enabled */
|
|
59
|
+
indeterminate = false;
|
|
60
|
+
/** If `true, a label text showing the value (in percentage) will be shown */
|
|
61
|
+
label = false;
|
|
62
|
+
/** Progress bar thickness */
|
|
63
|
+
thickness = 'medium';
|
|
64
|
+
/** Progress type */
|
|
65
|
+
type = 'default';
|
|
66
|
+
/** A number representing the current value of the progress bar */
|
|
67
|
+
value = 0;
|
|
58
68
|
// Prop lifecycle events
|
|
59
69
|
// =======================
|
|
60
70
|
handleTypePropChange() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-progress.js","sourceRoot":"","sources":["../../../../../../src/components/prog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'@stencil/core';\n\nimport {\n PROGRESS_BORDER_SHAPE,\n PROGRESS_THICKNESS,\n PROGRESS_TYPE,\n TProgressBorderShape,\n TProgressThickness,\n TProgressType,\n} from './bq-progress.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * The progress bar is a user interface component that visually represents the completion status of a task or process.\n *\n * @example How to use it\n * ```html\n * <bq-progress value=\"50\"></bq-progress>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/691cb3-progress\n * @status stable\n *\n * @dependency bq-tooltip\n *\n * @attr {\"rounded\" | \"rounded-full\"} border-shape - It will set the border style of the progress bar\n * @attr {boolean} enable-tooltip - If `true`, a tooltip will be shown displaying the progress value\n * @attr {boolean} indeterminate - If `true` the indeterminate state of progress bar is enabled\n * @attr {boolean} label - If `true`, a label text showing the value (in percentage) will be shown\n * @attr {\"small\" | \"medium\" | \"large\"} thickness - Progress bar thickness\n * @attr {\"default\" | \"error\"} type - Progress type\n * @attr {number} value - A number representing the current value of the progress bar\n *\n * @part wrapper - The component wrapper container inside the shadow DOM\n * @part progress - The `<div>` container that holds the native progress element\n * @part progress-bar - The native html for progress element\n * @part label - The `<div>` container that holds the label value (in percentage)\n * @part indeterminate - The `<div>` container that holds the indeterminate progress bar\n * @part base - The base container for the tooltip component inside the shadow DOM when hovering over the progress bar\n * @part trigger - The container holding the element that triggers the tooltip display when hovering over the progress bar\n * @part panel - The container holding the content of the tooltip when hovering over the progress bar\n *\n * @cssprop --bq-progress-bar--height - The progress bars height\n * @cssprop --bq-progress-bar--indeterminateWidth - The progress bar width when its indeterminate\n * @cssprop --bq-progress-bar--indicatorColor - The progress bar color (inside the track area)\n * @cssprop --bq-progress-bar--trackColor - The progress bar track area (the grey one)\n */\n@Component({\n tag: 'bq-progress',\n styleUrl: './scss/bq-progress.scss',\n shadow: true,\n})\nexport class BqProgress {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqProgressElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** It will set the border style of the progress bar */\n @Prop({ reflect: true }) borderShape: TProgressBorderShape = 'rounded';\n\n /** If `true`, a tooltip will be shown displaying the progress value */\n @Prop({ reflect: true }) enableTooltip: boolean = false;\n\n /** If `true` the indeterminate state of progress bar is enabled */\n @Prop({ reflect: true }) indeterminate: boolean = false;\n\n /** If `true, a label text showing the value (in percentage) will be shown */\n @Prop({ reflect: true }) label: boolean = false;\n\n /** Progress bar thickness */\n @Prop({ reflect: true }) thickness: TProgressThickness = 'medium';\n\n /** Progress type */\n @Prop({ reflect: true }) type: TProgressType = 'default';\n\n /** A number representing the current value of the progress bar */\n @Prop({ reflect: true, mutable: true }) value = 0;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('borderShape')\n @Watch('thickness')\n @Watch('type')\n handleTypePropChange() {\n validatePropValue(PROGRESS_BORDER_SHAPE, 'rounded', this.el, 'borderShape');\n validatePropValue(PROGRESS_THICKNESS, 'medium', this.el, 'thickness');\n validatePropValue(PROGRESS_TYPE, 'default', this.el, 'type');\n }\n\n @Watch('value')\n handleValuePropChange(newValue: number) {\n this.validateValue(newValue);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handleTypePropChange();\n this.handleValuePropChange(this.value);\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 validateValue(newValue: number) {\n const clampedValue = Math.max(0, Math.min(100, newValue));\n if (newValue !== clampedValue) {\n this.value = clampedValue;\n }\n return this.value;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.thickness === 'large' && { '--bq-progress-bar--height': 'var(--bq-spacing-xs)' }),\n ...(this.type === 'error' && { '--bq-progress-bar--indicatorColor': 'var(--bq-ui--danger)' }),\n };\n\n return (\n <Host style={style}>\n <div class=\"flex items-center\" part=\"wrapper\">\n <div class=\"relative flex items-center is-full\" part=\"progress\">\n <progress\n class={{\n [`progress-bar progress-bar__${this.type} ${this.thickness}`]: true,\n 'progress-bar__border-shape rounded-full': this.borderShape === 'rounded',\n }}\n value={this.indeterminate ? undefined : this.value}\n max=\"100\"\n part=\"progress-bar\"\n />\n {this.enableTooltip && !this.indeterminate && (\n <bq-tooltip\n class=\"absolute [&::part(panel)]:absolute\"\n exportparts=\"base,trigger,panel\"\n alwaysVisible={true}\n distance={16}\n style={{ insetInlineStart: `${this.value}%`, fontVariant: 'tabular-nums' }}\n >\n <div class=\"absolute bs-1 is-1\" slot=\"trigger\"></div>\n {this.value}\n </bq-tooltip>\n )}\n {this.indeterminate && (\n <div\n class={{\n 'progress-bar__indeterminate absolute bg-[--bq-progress-bar--indicatorColor] bs-[--bq-progress-bar--height] is-[--bq-progress-bar--indeterminateWidth]':\n true,\n 'rounded-full': this.borderShape === 'rounded',\n }}\n part=\"indeterminate\"\n />\n )}\n </div>\n <div\n aria-hidden={!this.label || this.indeterminate ? 'true' : 'false'}\n class={{\n 'ms-xs font-medium leading-regular': true,\n 'text-primary': this.type !== 'error',\n 'text-danger': this.type === 'error',\n 'invisible ms-0 is-0': !this.label || this.indeterminate,\n }}\n style={{ fontVariant: 'tabular-nums' }}\n part=\"label\"\n >\n <span>{this.value}%</span>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-progress.js","sourceRoot":"","sources":["../../../../../../src/components/progress/bq-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GAId,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\nimport {\n PROGRESS_BORDER_SHAPE,\n PROGRESS_THICKNESS,\n PROGRESS_TYPE,\n TProgressBorderShape,\n TProgressThickness,\n TProgressType,\n} from './bq-progress.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * The progress bar is a user interface component that visually represents the completion status of a task or process.\n *\n * @example How to use it\n * ```html\n * <bq-progress value=\"50\"></bq-progress>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/691cb3-progress\n * @status stable\n *\n * @dependency bq-tooltip\n *\n * @attr {\"rounded\" | \"rounded-full\"} border-shape - It will set the border style of the progress bar\n * @attr {boolean} enable-tooltip - If `true`, a tooltip will be shown displaying the progress value\n * @attr {boolean} indeterminate - If `true` the indeterminate state of progress bar is enabled\n * @attr {boolean} label - If `true`, a label text showing the value (in percentage) will be shown\n * @attr {\"small\" | \"medium\" | \"large\"} thickness - Progress bar thickness\n * @attr {\"default\" | \"error\"} type - Progress type\n * @attr {number} value - A number representing the current value of the progress bar\n *\n * @part wrapper - The component wrapper container inside the shadow DOM\n * @part progress - The `<div>` container that holds the native progress element\n * @part progress-bar - The native html for progress element\n * @part label - The `<div>` container that holds the label value (in percentage)\n * @part indeterminate - The `<div>` container that holds the indeterminate progress bar\n * @part base - The base container for the tooltip component inside the shadow DOM when hovering over the progress bar\n * @part trigger - The container holding the element that triggers the tooltip display when hovering over the progress bar\n * @part panel - The container holding the content of the tooltip when hovering over the progress bar\n *\n * @cssprop --bq-progress-bar--height - The progress bars height\n * @cssprop --bq-progress-bar--indeterminateWidth - The progress bar width when its indeterminate\n * @cssprop --bq-progress-bar--indicatorColor - The progress bar color (inside the track area)\n * @cssprop --bq-progress-bar--trackColor - The progress bar track area (the grey one)\n */\n@Component({\n tag: 'bq-progress',\n styleUrl: './scss/bq-progress.scss',\n shadow: true,\n})\nexport class BqProgress {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqProgressElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** It will set the border style of the progress bar */\n @Prop({ reflect: true }) borderShape: TProgressBorderShape = 'rounded';\n\n /** If `true`, a tooltip will be shown displaying the progress value */\n @Prop({ reflect: true }) enableTooltip: boolean = false;\n\n /** If `true` the indeterminate state of progress bar is enabled */\n @Prop({ reflect: true }) indeterminate: boolean = false;\n\n /** If `true, a label text showing the value (in percentage) will be shown */\n @Prop({ reflect: true }) label: boolean = false;\n\n /** Progress bar thickness */\n @Prop({ reflect: true }) thickness: TProgressThickness = 'medium';\n\n /** Progress type */\n @Prop({ reflect: true }) type: TProgressType = 'default';\n\n /** A number representing the current value of the progress bar */\n @Prop({ reflect: true, mutable: true }) value = 0;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('borderShape')\n @Watch('thickness')\n @Watch('type')\n handleTypePropChange() {\n validatePropValue(PROGRESS_BORDER_SHAPE, 'rounded', this.el, 'borderShape');\n validatePropValue(PROGRESS_THICKNESS, 'medium', this.el, 'thickness');\n validatePropValue(PROGRESS_TYPE, 'default', this.el, 'type');\n }\n\n @Watch('value')\n handleValuePropChange(newValue: number) {\n this.validateValue(newValue);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handleTypePropChange();\n this.handleValuePropChange(this.value);\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 validateValue(newValue: number) {\n const clampedValue = Math.max(0, Math.min(100, newValue));\n if (newValue !== clampedValue) {\n this.value = clampedValue;\n }\n return this.value;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.thickness === 'large' && { '--bq-progress-bar--height': 'var(--bq-spacing-xs)' }),\n ...(this.type === 'error' && { '--bq-progress-bar--indicatorColor': 'var(--bq-ui--danger)' }),\n };\n\n return (\n <Host style={style}>\n <div class=\"flex items-center\" part=\"wrapper\">\n <div class=\"relative flex items-center is-full\" part=\"progress\">\n <progress\n class={{\n [`progress-bar progress-bar__${this.type} ${this.thickness}`]: true,\n 'progress-bar__border-shape rounded-full': this.borderShape === 'rounded',\n }}\n value={this.indeterminate ? undefined : this.value}\n max=\"100\"\n part=\"progress-bar\"\n />\n {this.enableTooltip && !this.indeterminate && (\n <bq-tooltip\n class=\"absolute [&::part(panel)]:absolute\"\n exportparts=\"base,trigger,panel\"\n alwaysVisible={true}\n distance={16}\n style={{ insetInlineStart: `${this.value}%`, fontVariant: 'tabular-nums' }}\n >\n <div class=\"absolute bs-1 is-1\" slot=\"trigger\"></div>\n {this.value}\n </bq-tooltip>\n )}\n {this.indeterminate && (\n <div\n class={{\n 'progress-bar__indeterminate absolute bg-[--bq-progress-bar--indicatorColor] bs-[--bq-progress-bar--height] is-[--bq-progress-bar--indeterminateWidth]':\n true,\n 'rounded-full': this.borderShape === 'rounded',\n }}\n part=\"indeterminate\"\n />\n )}\n </div>\n <div\n aria-hidden={!this.label || this.indeterminate ? 'true' : 'false'}\n class={{\n 'ms-xs font-medium leading-regular': true,\n 'text-primary': this.type !== 'error',\n 'text-danger': this.type === 'error',\n 'invisible ms-0 is-0': !this.label || this.indeterminate,\n }}\n style={{ fontVariant: 'tabular-nums' }}\n part=\"label\"\n >\n <span>{this.value}%</span>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -43,21 +43,31 @@ import { h } from "@stencil/core";
|
|
|
43
43
|
* @cssprop --bq-radio--border-width - Radio border width
|
|
44
44
|
*/
|
|
45
45
|
export class BqRadio {
|
|
46
|
-
constructor() {
|
|
47
|
-
this.checked = undefined;
|
|
48
|
-
this.disabled = false;
|
|
49
|
-
this.backgroundOnHover = false;
|
|
50
|
-
this.formId = undefined;
|
|
51
|
-
this.name = undefined;
|
|
52
|
-
this.required = undefined;
|
|
53
|
-
this.value = undefined;
|
|
54
|
-
}
|
|
55
46
|
// Own Properties
|
|
56
47
|
// ====================
|
|
57
48
|
inputElement;
|
|
58
49
|
// Reference to host HTML element
|
|
59
50
|
// ===================================
|
|
60
51
|
el;
|
|
52
|
+
// State() variables
|
|
53
|
+
// Inlined decorator, alphabetical order
|
|
54
|
+
// =======================================
|
|
55
|
+
// Public Property API
|
|
56
|
+
// ========================
|
|
57
|
+
/** If true radio input is checked */
|
|
58
|
+
checked;
|
|
59
|
+
/** If true radio input is disabled */
|
|
60
|
+
disabled = false;
|
|
61
|
+
/** If true radio displays background on hover */
|
|
62
|
+
backgroundOnHover = false;
|
|
63
|
+
/** The form ID that the radio input is associated with */
|
|
64
|
+
formId;
|
|
65
|
+
/** Name of the HTML input form control. Submitted with the form as part of a name/value pair. */
|
|
66
|
+
name;
|
|
67
|
+
/** If `true`, it will indicate that the user must specify a value for the radio before the owning form can be submitted */
|
|
68
|
+
required;
|
|
69
|
+
/** A string representing the value of the radio. */
|
|
70
|
+
value;
|
|
61
71
|
// Prop lifecycle events
|
|
62
72
|
// =======================
|
|
63
73
|
// Events section
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-radio.js","sourceRoot":"","sources":["../../../../../../src/components/radio/bq-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAQH,MAAM,OAAO,OAAO;;;wBAqBmB,KAAK;iCAGI,KAAK;;;;;;IAvBnD,iBAAiB;IACjB,uBAAuB;IACf,YAAY,CAAmB;IAEvC,iCAAi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,iBAAiB,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,OAAO,GACZ;gBACF,4DAAK,KAAK,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO;oBACxC,4DAAK,KAAK,EAAC,mBAAmB,GAAG,CAC7B,CACF;YACN,6DACE,KAAK,EAAC,qGAAqG,EAC3G,IAAI,EAAC,OAAO;gBAEZ,6DAAM,EAAE,EAAC,iBAAiB,GAAQ,CAC7B,CACD,CACT,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop } from '@stencil/core';\n\n/**\n * The radio button is a user interface element that allows users to select a single option.\n *\n * @example How to use it\n * ```html\n * <bq-radio value=\"option1\">Radio option 1</bq-radio>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/9718e1-radio-button/b/09d7b1\n * @status stable\n *\n * @attr {boolean} background-on-hover - If `true`, the radio displays background on hover\n * @attr {boolean} checked - If `true` radio input is checked\n * @attr {boolean} disabled - If `true` radio input is disabled\n * @attr {string} form-id - The form ID that the radio input is associated with\n * @attr {string} name - Name of the HTML input form control. Submitted with the form as part of a name/value pair\n * @attr {boolean} required - If `true`, it will indicate that the user must specify a value for the radio before the owning form can be submitted\n * @attr {boolean} value - A string representing the value of the radio\n *\n * @method vClick - Simulate a click event on the native `<input>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<input>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<input>` HTML element used under the hood\n * @method getNativeInput - Returns the native `<input>` HTML element used under the hood\n *\n * @event bqBlur - Handler to be called when the radio loses focus\n * @event bqClick - Handler to be called when the radio state changes\n * @event bqFocus - Handler to be called when the radio gets focused\n * @event bqKeyDown - The handler is to be called when the radio key is pressed\n *\n * @slot - The bq-radio item\n *\n * @part base - The component's internal wrapper of the radio component.\n * @part input - The native HTML `<input type=\"radio\">` used under the hood.\n * @part radio - The component's internal wrapper of the radio component.\n * @part label - The `<span>` element that holds the text content.\n *\n * @cssprop --bq-radio--size - Radio size\n * @cssprop --bq-radio--border-width - Radio border width\n */\n@Component({\n tag: 'bq-radio',\n styleUrl: './scss/bq-radio.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqRadio {\n // Own Properties\n // ====================\n private inputElement: HTMLInputElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqRadioElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true radio input is checked */\n @Prop({ reflect: true, mutable: true }) checked?: boolean;\n\n /** If true radio input is disabled */\n @Prop({ reflect: true }) disabled? = false;\n\n /** If true radio displays background on hover */\n @Prop({ reflect: true }) backgroundOnHover? = false;\n\n /** The form ID that the radio input is associated with */\n @Prop({ reflect: true }) formId?: string;\n\n /** Name of the HTML input 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 specify a value for the radio before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean;\n\n /** A string representing the value of the radio. */\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 radio state changes */\n @Event() bqClick: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\n\n // Component lifecycle events\n // Ordered by their natural call order\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.inputElement?.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.inputElement?.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.inputElement?.blur();\n }\n\n /**\n * Returns the native `<input>` HTML element used under the hood.\n */\n @Method()\n async getNativeInput() {\n return this.inputElement;\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.checked = 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 get tabindex(): string {\n // NOTE: this.checked is undefined when is not part of bq-radio-group\n return `${-1 + +(this.checked ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <label\n class={{\n 'bq-radio group': true,\n 'is-disabled !cursor-not-allowed': this.disabled,\n 'is-checked': this.checked,\n 'has-background': this.backgroundOnHover,\n }}\n part=\"base\"\n >\n <div class=\"bq-radio__control\">\n <input\n class=\"bq-radio__input\"\n ref={(element) => (this.inputElement = element)}\n type=\"radio\"\n form={this.formId}\n name={this.name}\n value={this.value}\n required={this.required}\n disabled={this.disabled}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-labelledby=\"bq-radio__label\"\n tabindex={this.tabindex}\n part=\"input\"\n />\n <div class=\"bq-radio__circle\" part=\"radio\">\n <div class=\"bq-radio__checked\" />\n </div>\n </div>\n <span\n class=\"bq-radio__label group-hover:text-text-primary-hover group-[.is-disabled]:text-text-primary-disabled\"\n part=\"label\"\n >\n <slot id=\"bq-radio__label\"></slot>\n </span>\n </label>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-radio.js","sourceRoot":"","sources":["../../../../../../src/components/radio/bq-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAQH,MAAM,OAAO,OAAO;IAClB,iBAAiB;IACjB,uBAAuB;IACf,YAAY,CAAmB;IAEvC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAsB;IAEnC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAE1C,sBAAsB;IACtB,2BAA2B;IAE3B,qCAAqC;IACG,OAAO,CAAW;IAE1D,sCAAsC;IACb,QAAQ,GAAI,KAAK,CAAC;IAE3C,iDAAiD;IACxB,iBAAiB,GAAI,KAAK,CAAC;IAEpD,0DAA0D;IACjC,MAAM,CAAU;IAEzC,kGAAkG;IACzE,IAAI,CAAU;IAEvC,2HAA2H;IAClG,QAAQ,CAAW;IAE5C,oDAAoD;IAC3B,KAAK,CAAU;IAExC,wBAAwB;IACxB,0BAA0B;IAE1B,iBAAiB;IACjB,+CAA+C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EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO;oBACxC,4DAAK,KAAK,EAAC,mBAAmB,GAAG,CAC7B,CACF;YACN,6DACE,KAAK,EAAC,qGAAqG,EAC3G,IAAI,EAAC,OAAO;gBAEZ,6DAAM,EAAE,EAAC,iBAAiB,GAAQ,CAC7B,CACD,CACT,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop } from '@stencil/core';\n\n/**\n * The radio button is a user interface element that allows users to select a single option.\n *\n * @example How to use it\n * ```html\n * <bq-radio value=\"option1\">Radio option 1</bq-radio>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/9718e1-radio-button/b/09d7b1\n * @status stable\n *\n * @attr {boolean} background-on-hover - If `true`, the radio displays background on hover\n * @attr {boolean} checked - If `true` radio input is checked\n * @attr {boolean} disabled - If `true` radio input is disabled\n * @attr {string} form-id - The form ID that the radio input is associated with\n * @attr {string} name - Name of the HTML input form control. Submitted with the form as part of a name/value pair\n * @attr {boolean} required - If `true`, it will indicate that the user must specify a value for the radio before the owning form can be submitted\n * @attr {boolean} value - A string representing the value of the radio\n *\n * @method vClick - Simulate a click event on the native `<input>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<input>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<input>` HTML element used under the hood\n * @method getNativeInput - Returns the native `<input>` HTML element used under the hood\n *\n * @event bqBlur - Handler to be called when the radio loses focus\n * @event bqClick - Handler to be called when the radio state changes\n * @event bqFocus - Handler to be called when the radio gets focused\n * @event bqKeyDown - The handler is to be called when the radio key is pressed\n *\n * @slot - The bq-radio item\n *\n * @part base - The component's internal wrapper of the radio component.\n * @part input - The native HTML `<input type=\"radio\">` used under the hood.\n * @part radio - The component's internal wrapper of the radio component.\n * @part label - The `<span>` element that holds the text content.\n *\n * @cssprop --bq-radio--size - Radio size\n * @cssprop --bq-radio--border-width - Radio border width\n */\n@Component({\n tag: 'bq-radio',\n styleUrl: './scss/bq-radio.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqRadio {\n // Own Properties\n // ====================\n private inputElement: HTMLInputElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqRadioElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true radio input is checked */\n @Prop({ reflect: true, mutable: true }) checked?: boolean;\n\n /** If true radio input is disabled */\n @Prop({ reflect: true }) disabled? = false;\n\n /** If true radio displays background on hover */\n @Prop({ reflect: true }) backgroundOnHover? = false;\n\n /** The form ID that the radio input is associated with */\n @Prop({ reflect: true }) formId?: string;\n\n /** Name of the HTML input 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 specify a value for the radio before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean;\n\n /** A string representing the value of the radio. */\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 radio state changes */\n @Event() bqClick: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqRadioElement>;\n\n /** Handler to be called when the radio key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\n\n // Component lifecycle events\n // Ordered by their natural call order\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.inputElement?.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.inputElement?.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.inputElement?.blur();\n }\n\n /**\n * Returns the native `<input>` HTML element used under the hood.\n */\n @Method()\n async getNativeInput() {\n return this.inputElement;\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.checked = 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 get tabindex(): string {\n // NOTE: this.checked is undefined when is not part of bq-radio-group\n return `${-1 + +(this.checked ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <label\n class={{\n 'bq-radio group': true,\n 'is-disabled !cursor-not-allowed': this.disabled,\n 'is-checked': this.checked,\n 'has-background': this.backgroundOnHover,\n }}\n part=\"base\"\n >\n <div class=\"bq-radio__control\">\n <input\n class=\"bq-radio__input\"\n ref={(element) => (this.inputElement = element)}\n type=\"radio\"\n form={this.formId}\n name={this.name}\n value={this.value}\n required={this.required}\n disabled={this.disabled}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-labelledby=\"bq-radio__label\"\n tabindex={this.tabindex}\n part=\"input\"\n />\n <div class=\"bq-radio__circle\" part=\"radio\">\n <div class=\"bq-radio__checked\" />\n </div>\n </div>\n <span\n class=\"bq-radio__label group-hover:text-text-primary-hover group-[.is-disabled]:text-text-primary-disabled\"\n part=\"label\"\n >\n <slot id=\"bq-radio__label\"></slot>\n </span>\n </label>\n );\n }\n}\n"]}
|
|
@@ -45,17 +45,6 @@ import { debounce, isHTMLElement, isNil, validatePropValue } from "../../shared/
|
|
|
45
45
|
* @part group - The `<div>` element that holds the radio inputs.
|
|
46
46
|
*/
|
|
47
47
|
export class BqRadioGroup {
|
|
48
|
-
constructor() {
|
|
49
|
-
this.backgroundOnHover = false;
|
|
50
|
-
this.debounceTime = 0;
|
|
51
|
-
this.disabled = false;
|
|
52
|
-
this.fieldset = false;
|
|
53
|
-
this.name = undefined;
|
|
54
|
-
this.orientation = 'vertical';
|
|
55
|
-
this.required = false;
|
|
56
|
-
this.requiredValidationMessage = undefined;
|
|
57
|
-
this.value = undefined;
|
|
58
|
-
}
|
|
59
48
|
// Own Properties
|
|
60
49
|
// ====================
|
|
61
50
|
focusedBqRadio = null;
|
|
@@ -64,6 +53,29 @@ export class BqRadioGroup {
|
|
|
64
53
|
// ===================================
|
|
65
54
|
internals;
|
|
66
55
|
el;
|
|
56
|
+
// State() variables
|
|
57
|
+
// Inlined decorator, alphabetical order
|
|
58
|
+
// =======================================
|
|
59
|
+
// Public Property API
|
|
60
|
+
// ========================
|
|
61
|
+
/** If true, all radio inputs in the group will display a background on hover */
|
|
62
|
+
backgroundOnHover = false;
|
|
63
|
+
/** A number representing the delay time (in milliseconds) that `bqChange` event handler gets triggered once the value change */
|
|
64
|
+
debounceTime = 0;
|
|
65
|
+
/** If true radio inputs are disabled */
|
|
66
|
+
disabled = false;
|
|
67
|
+
/** If true displays fieldset */
|
|
68
|
+
fieldset = false;
|
|
69
|
+
/** Name of the HTML input form control. Submitted with the form as part of a name/value pair. */
|
|
70
|
+
name;
|
|
71
|
+
/** The display orientation of the radio inputs */
|
|
72
|
+
orientation = 'vertical';
|
|
73
|
+
/** If true, the radio group is required */
|
|
74
|
+
required = false;
|
|
75
|
+
/** The native form validation message when the radio group is required */
|
|
76
|
+
requiredValidationMessage;
|
|
77
|
+
/** A string representing the value of the radio. */
|
|
78
|
+
value;
|
|
67
79
|
// Prop lifecycle events
|
|
68
80
|
// =======================
|
|
69
81
|
handleGroupProperties() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-radio-group.js","sourceRoot":"","sources":["../../../../../../src/components/radio-group/bq-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjH,OAAO,EAAE,uBAAuB,EAA0B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAa,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AASH,MAAM,OAAO,YAAY;;iCAqBuB,KAAK;4BAGI,CAAC;wBAGnB,KAAK;wBAGL,KAAK;;2BAMqC,UAAU;wBAGpD,KAAK;;;;IAtC1C,iBAAiB;IACjB,uBAAuB;IAEf,cAAc,GAA8B,IAAI,CAAC;IACjD,iBAAiB,CAA2D;IAEpF,iCAAiC;IACjC,sCAAsC;IAEnB,SAAS,CAAoB;IACrC,EAAE,CAA2B;IAoCxC,wBAAwB;IACxB,0BAA0B;IAO1B,qBAAqB;QACnB,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAO;QAElC,IAAI,CAAC,eAA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AsB,EAAC,IAAI,EAAC,OAAO,GAAG,CACxC;YACT,4DAAK,KAAK,EAAE,mBAAmB,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAC,OAAO;gBAC7D,6DAAM,EAAE,EAAC,eAAe,GAAG,CACvB,CACG,CACZ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, h, Listen, Prop, Watch } from '@stencil/core';\n\nimport { RADIO_GROUP_ORIENTATION, TRadioGroupOrientation } from './bq-radio-group.types';\nimport { debounce, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\n\n/**\n * The radio group is a user interface component that groups radio buttons to enable a single selection within the group.\n *\n * @example How to use it\n * ```html\n * <bq-radio-group fieldset value=\"option1\">\n * <span slot=\"label\">radio group</span>\n * <bq-radio value=\"option1\">Radio option 1</bq-radio>\n * <bq-radio value=\"option2\">Radio option 2</bq-radio>\n * <bq-radio value=\"option3\">Radio option 3</bq-radio>\n * </bq-radio-group>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/9718e1-radio-button/b/09d7b1\n * @status stable\n *\n * @attr {boolean} background-on-hover - If `true`, the radio displays background on hover\n * @attr {number} debounce-time - A number representing the delay time (in milliseconds) that bqChange event handler gets triggered once the value change\n * @attr {boolean} disabled - If `true` radio inputs are disabled\n * @attr {boolean} fieldset - If `true` displays fieldset\n * @attr {string} name - Name of the HTML input form control. Submitted with the form as part of a name/value pair\n * @attr {\"horizontal\" | \"vertical\"} orientation - The display orientation of the radio inputs\n * @attr {boolean} required - If `true`, the radio group is required\n * @attr {string} required-validation-message - The native form validation message when the radio group is required\n * @attr {string} value - The display orientation of the radio inputs\n *\n * @method vClick - Simulate a click event on the native `<input>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<input>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<input>` HTML element used under the hood\n *\n * @event bqChange - Handler to be called when the radio state changes\n *\n * @slot - The bq-radio items to group\n * @slot label - The label content of radio group\n *\n * @part base - The component's internal wrapper of the radio components.\n * @part label - The `<legend>` element that holds the text content.\n * @part group - The `<div>` element that holds the radio inputs.\n */\n@Component({\n tag: 'bq-radio-group',\n styleUrl: './scss/bq-radio-group.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqRadioGroup {\n // Own Properties\n // ====================\n\n private focusedBqRadio: HTMLBqRadioElement | null = null;\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqRadioElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @AttachInternals() internals!: ElementInternals;\n @Element() el!: HTMLBqRadioGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, all radio inputs in the group will display a background on hover */\n @Prop({ reflect: true }) backgroundOnHover? = false;\n\n /** A number representing the delay time (in milliseconds) that `bqChange` event handler gets triggered once the value change */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true radio inputs are disabled */\n @Prop({ reflect: true }) disabled? = false;\n\n /** If true displays fieldset */\n @Prop({ reflect: true }) fieldset? = false;\n\n /** Name of the HTML input form control. Submitted with the form as part of a name/value pair. */\n @Prop({ reflect: true }) name!: string;\n\n /** The display orientation of the radio inputs */\n @Prop({ reflect: true, mutable: true }) orientation?: TRadioGroupOrientation = 'vertical';\n\n /** If true, the radio group is required */\n @Prop({ reflect: true }) required? = false;\n\n /** The native form validation message when the radio group is required */\n @Prop({ reflect: true }) requiredValidationMessage?: string;\n\n /** A string representing the value of the radio. */\n @Prop({ reflect: true, mutable: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('backgroundOnHover')\n @Watch('disabled')\n @Watch('name')\n @Watch('required')\n @Watch('value')\n handleGroupProperties() {\n if (!this.bqRadioElements) return;\n\n this.bqRadioElements.forEach((bqRadio) => {\n bqRadio.backgroundOnHover = this.backgroundOnHover;\n bqRadio.checked = !isNil(this.value) ? bqRadio.value === this.value : false;\n bqRadio.disabled = this.disabled;\n bqRadio.name = this.name;\n bqRadio.required = this.required;\n });\n }\n\n @Watch('orientation')\n checkPropValues() {\n validatePropValue(RADIO_GROUP_ORIENTATION, 'vertical', this.el, 'orientation');\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('required')\n @Watch('value')\n async handleRequiredChange() {\n await this.updateFormValidity();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the radio state changes */\n @Event() bqChange: EventEmitter<{ value: string; target: HTMLBqRadioElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n this.checkDebounceChange();\n this.internals.setFormValue(this.value);\n }\n\n componentDidLoad() {\n this.handleGroupProperties();\n }\n\n async formAssociatedCallback() {\n this.internals.setFormValue(this.value);\n await this.updateFormValidity();\n }\n\n formResetCallback() {\n this.value = null;\n this.internals.setFormValue(this.value);\n }\n\n // Listeners\n // ==============\n\n @Listen('mousedown', { target: 'body', passive: true })\n onMouseDown(event: MouseEvent) {\n if (!isNil(this.focusedBqRadio) && isHTMLElement(event.target, 'bq-radio') && this.el.contains(event.target)) {\n this.focusedBqRadio = event.target;\n }\n }\n\n @Listen('bqClick')\n onBqClick(event: CustomEvent<HTMLBqRadioElement>) {\n if (isNil(this.focusedBqRadio)) {\n this.focusedBqRadio = event.detail;\n }\n\n if (event.detail.value === this.value) return;\n\n const target = event.detail;\n this.bqRadioElements.forEach((bqRadioElement) => (bqRadioElement.checked = bqRadioElement === target));\n this.setCheckedRadioItem(event.detail);\n }\n\n @Listen('bqKeyDown')\n onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n if (!isHTMLElement(target, 'bq-radio')) return;\n\n switch (event.detail.key) {\n case 'ArrowDown':\n case 'ArrowRight': {\n this.focusRadioInputSibling(target, true);\n break;\n }\n\n case 'ArrowUp':\n case 'ArrowLeft': {\n this.focusRadioInputSibling(target, false);\n break;\n }\n\n default:\n }\n }\n\n @Listen('bqFocus', { capture: true })\n onBqFocus(event: CustomEvent<HTMLBqRadioElement>) {\n if (event.detail !== this.focusedBqRadio) return;\n\n event.stopPropagation();\n }\n\n @Listen('bqBlur', { capture: true })\n onBqBlur(event: CustomEvent<HTMLBqRadioElement>) {\n if (!isNil(this.focusedBqRadio) && event.detail !== this.focusedBqRadio) {\n event.stopPropagation();\n } else {\n this.focusedBqRadio = null;\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 // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private focusRadioInputSibling = (currentTarget: HTMLBqRadioElement, next: boolean): void => {\n this.bqRadioElements.forEach((bqRadioElement, index, elements) => {\n if (bqRadioElement === currentTarget) {\n const target = this.getNextRadioElement(elements, index, next);\n\n currentTarget.checked = false;\n\n target.vFocus();\n this.setCheckedRadioItem(target);\n }\n });\n };\n\n private setCheckedRadioItem = (target: HTMLBqRadioElement): void => {\n const { value } = target;\n target.checked = true;\n this.value = value;\n this.focusedBqRadio = target;\n this.internals.setFormValue(value);\n this.debouncedBqChange({ value, target });\n };\n\n private getNextRadioElement = (elements: HTMLBqRadioElement[], index: number, forward = true): HTMLBqRadioElement => {\n let element = null;\n let elementIndex = index;\n\n do {\n elementIndex = (elements.length + (elementIndex + (forward ? 1 : -1))) % elements.length;\n element = elements[elementIndex];\n } while (element.disabled);\n\n return element;\n };\n\n private updateFormValidity = async (): Promise<void> => {\n const { internals, required, requiredValidationMessage, value } = this;\n // Clear the validity state\n internals?.states.clear();\n\n if (!required || (required && !isNil(value))) {\n // If the checkbox is not required or is checked, set the validity state to valid\n internals?.states.add('valid');\n internals?.setValidity({});\n return;\n }\n\n // If the checkbox is required and not checked, set the validity state to invalid\n internals?.states.add('invalid');\n internals?.setValidity(\n { valueMissing: true },\n requiredValidationMessage,\n await this.bqRadioElements[0].getNativeInput(),\n );\n };\n\n private get bqRadioElements(): HTMLBqRadioElement[] {\n return Array.from(this.el.querySelectorAll('bq-radio'));\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <fieldset\n class={{ 'bq-radio-group': true, 'has-fieldset': this.fieldset }}\n aria-labelledby=\"bq-radio-group__label\"\n aria-controls=\"bq-radiogroup\"\n role=\"radiogroup\"\n part=\"base\"\n >\n <legend part=\"label\">\n <slot id=\"bq-radiogroup__label\" name=\"label\" />\n </legend>\n <div class={`bq-radio-group--${this.orientation}`} part=\"group\">\n <slot id=\"bq-radiogroup\" />\n </div>\n </fieldset>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-radio-group.js","sourceRoot":"","sources":["../../../../../../src/components/radio-group/bq-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjH,OAAO,EAAE,uBAAuB,EAA0B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,QAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, h, Listen, Prop, Watch } from '@stencil/core';\n\nimport { RADIO_GROUP_ORIENTATION, TRadioGroupOrientation } from './bq-radio-group.types';\nimport { debounce, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\n\n/**\n * The radio group is a user interface component that groups radio buttons to enable a single selection within the group.\n *\n * @example How to use it\n * ```html\n * <bq-radio-group fieldset value=\"option1\">\n * <span slot=\"label\">radio group</span>\n * <bq-radio value=\"option1\">Radio option 1</bq-radio>\n * <bq-radio value=\"option2\">Radio option 2</bq-radio>\n * <bq-radio value=\"option3\">Radio option 3</bq-radio>\n * </bq-radio-group>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/9718e1-radio-button/b/09d7b1\n * @status stable\n *\n * @attr {boolean} background-on-hover - If `true`, the radio displays background on hover\n * @attr {number} debounce-time - A number representing the delay time (in milliseconds) that bqChange event handler gets triggered once the value change\n * @attr {boolean} disabled - If `true` radio inputs are disabled\n * @attr {boolean} fieldset - If `true` displays fieldset\n * @attr {string} name - Name of the HTML input form control. Submitted with the form as part of a name/value pair\n * @attr {\"horizontal\" | \"vertical\"} orientation - The display orientation of the radio inputs\n * @attr {boolean} required - If `true`, the radio group is required\n * @attr {string} required-validation-message - The native form validation message when the radio group is required\n * @attr {string} value - The display orientation of the radio inputs\n *\n * @method vClick - Simulate a click event on the native `<input>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<input>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<input>` HTML element used under the hood\n *\n * @event bqChange - Handler to be called when the radio state changes\n *\n * @slot - The bq-radio items to group\n * @slot label - The label content of radio group\n *\n * @part base - The component's internal wrapper of the radio components.\n * @part label - The `<legend>` element that holds the text content.\n * @part group - The `<div>` element that holds the radio inputs.\n */\n@Component({\n tag: 'bq-radio-group',\n styleUrl: './scss/bq-radio-group.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqRadioGroup {\n // Own Properties\n // ====================\n\n private focusedBqRadio: HTMLBqRadioElement | null = null;\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqRadioElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @AttachInternals() internals!: ElementInternals;\n @Element() el!: HTMLBqRadioGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, all radio inputs in the group will display a background on hover */\n @Prop({ reflect: true }) backgroundOnHover? = false;\n\n /** A number representing the delay time (in milliseconds) that `bqChange` event handler gets triggered once the value change */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true radio inputs are disabled */\n @Prop({ reflect: true }) disabled? = false;\n\n /** If true displays fieldset */\n @Prop({ reflect: true }) fieldset? = false;\n\n /** Name of the HTML input form control. Submitted with the form as part of a name/value pair. */\n @Prop({ reflect: true }) name!: string;\n\n /** The display orientation of the radio inputs */\n @Prop({ reflect: true, mutable: true }) orientation?: TRadioGroupOrientation = 'vertical';\n\n /** If true, the radio group is required */\n @Prop({ reflect: true }) required? = false;\n\n /** The native form validation message when the radio group is required */\n @Prop({ reflect: true }) requiredValidationMessage?: string;\n\n /** A string representing the value of the radio. */\n @Prop({ reflect: true, mutable: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('backgroundOnHover')\n @Watch('disabled')\n @Watch('name')\n @Watch('required')\n @Watch('value')\n handleGroupProperties() {\n if (!this.bqRadioElements) return;\n\n this.bqRadioElements.forEach((bqRadio) => {\n bqRadio.backgroundOnHover = this.backgroundOnHover;\n bqRadio.checked = !isNil(this.value) ? bqRadio.value === this.value : false;\n bqRadio.disabled = this.disabled;\n bqRadio.name = this.name;\n bqRadio.required = this.required;\n });\n }\n\n @Watch('orientation')\n checkPropValues() {\n validatePropValue(RADIO_GROUP_ORIENTATION, 'vertical', this.el, 'orientation');\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('required')\n @Watch('value')\n async handleRequiredChange() {\n await this.updateFormValidity();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the radio state changes */\n @Event() bqChange: EventEmitter<{ value: string; target: HTMLBqRadioElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n this.checkDebounceChange();\n this.internals.setFormValue(this.value);\n }\n\n componentDidLoad() {\n this.handleGroupProperties();\n }\n\n async formAssociatedCallback() {\n this.internals.setFormValue(this.value);\n await this.updateFormValidity();\n }\n\n formResetCallback() {\n this.value = null;\n this.internals.setFormValue(this.value);\n }\n\n // Listeners\n // ==============\n\n @Listen('mousedown', { target: 'body', passive: true })\n onMouseDown(event: MouseEvent) {\n if (!isNil(this.focusedBqRadio) && isHTMLElement(event.target, 'bq-radio') && this.el.contains(event.target)) {\n this.focusedBqRadio = event.target;\n }\n }\n\n @Listen('bqClick')\n onBqClick(event: CustomEvent<HTMLBqRadioElement>) {\n if (isNil(this.focusedBqRadio)) {\n this.focusedBqRadio = event.detail;\n }\n\n if (event.detail.value === this.value) return;\n\n const target = event.detail;\n this.bqRadioElements.forEach((bqRadioElement) => (bqRadioElement.checked = bqRadioElement === target));\n this.setCheckedRadioItem(event.detail);\n }\n\n @Listen('bqKeyDown')\n onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n if (!isHTMLElement(target, 'bq-radio')) return;\n\n switch (event.detail.key) {\n case 'ArrowDown':\n case 'ArrowRight': {\n this.focusRadioInputSibling(target, true);\n break;\n }\n\n case 'ArrowUp':\n case 'ArrowLeft': {\n this.focusRadioInputSibling(target, false);\n break;\n }\n\n default:\n }\n }\n\n @Listen('bqFocus', { capture: true })\n onBqFocus(event: CustomEvent<HTMLBqRadioElement>) {\n if (event.detail !== this.focusedBqRadio) return;\n\n event.stopPropagation();\n }\n\n @Listen('bqBlur', { capture: true })\n onBqBlur(event: CustomEvent<HTMLBqRadioElement>) {\n if (!isNil(this.focusedBqRadio) && event.detail !== this.focusedBqRadio) {\n event.stopPropagation();\n } else {\n this.focusedBqRadio = null;\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 // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private focusRadioInputSibling = (currentTarget: HTMLBqRadioElement, next: boolean): void => {\n this.bqRadioElements.forEach((bqRadioElement, index, elements) => {\n if (bqRadioElement === currentTarget) {\n const target = this.getNextRadioElement(elements, index, next);\n\n currentTarget.checked = false;\n\n target.vFocus();\n this.setCheckedRadioItem(target);\n }\n });\n };\n\n private setCheckedRadioItem = (target: HTMLBqRadioElement): void => {\n const { value } = target;\n target.checked = true;\n this.value = value;\n this.focusedBqRadio = target;\n this.internals.setFormValue(value);\n this.debouncedBqChange({ value, target });\n };\n\n private getNextRadioElement = (elements: HTMLBqRadioElement[], index: number, forward = true): HTMLBqRadioElement => {\n let element = null;\n let elementIndex = index;\n\n do {\n elementIndex = (elements.length + (elementIndex + (forward ? 1 : -1))) % elements.length;\n element = elements[elementIndex];\n } while (element.disabled);\n\n return element;\n };\n\n private updateFormValidity = async (): Promise<void> => {\n const { internals, required, requiredValidationMessage, value } = this;\n // Clear the validity state\n internals?.states.clear();\n\n if (!required || (required && !isNil(value))) {\n // If the checkbox is not required or is checked, set the validity state to valid\n internals?.states.add('valid');\n internals?.setValidity({});\n return;\n }\n\n // If the checkbox is required and not checked, set the validity state to invalid\n internals?.states.add('invalid');\n internals?.setValidity(\n { valueMissing: true },\n requiredValidationMessage,\n await this.bqRadioElements[0].getNativeInput(),\n );\n };\n\n private get bqRadioElements(): HTMLBqRadioElement[] {\n return Array.from(this.el.querySelectorAll('bq-radio'));\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <fieldset\n class={{ 'bq-radio-group': true, 'has-fieldset': this.fieldset }}\n aria-labelledby=\"bq-radio-group__label\"\n aria-controls=\"bq-radiogroup\"\n role=\"radiogroup\"\n part=\"base\"\n >\n <legend part=\"label\">\n <slot id=\"bq-radiogroup__label\" name=\"label\" />\n </legend>\n <div class={`bq-radio-group--${this.orientation}`} part=\"group\">\n <slot id=\"bq-radiogroup\" />\n </div>\n </fieldset>\n );\n }\n}\n"]}
|
|
@@ -110,37 +110,6 @@ import { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, isString } f
|
|
|
110
110
|
* @cssprop --bq-select--text-placeholder-color - Select placeholder text color
|
|
111
111
|
*/
|
|
112
112
|
export class BqSelect {
|
|
113
|
-
constructor() {
|
|
114
|
-
this.displayValue = undefined;
|
|
115
|
-
this.hasHelperText = false;
|
|
116
|
-
this.selectedOptions = [];
|
|
117
|
-
this.hasLabel = false;
|
|
118
|
-
this.hasPrefix = false;
|
|
119
|
-
this.hasSuffix = false;
|
|
120
|
-
this.hasValue = false;
|
|
121
|
-
this.autofocus = undefined;
|
|
122
|
-
this.clearButtonLabel = 'Clear value';
|
|
123
|
-
this.debounceTime = 0;
|
|
124
|
-
this.disabled = false;
|
|
125
|
-
this.disableClear = false;
|
|
126
|
-
this.distance = 8;
|
|
127
|
-
this.form = undefined;
|
|
128
|
-
this.keepOpenOnSelect = false;
|
|
129
|
-
this.name = undefined;
|
|
130
|
-
this.maxTagsVisible = 2;
|
|
131
|
-
this.multiple = false;
|
|
132
|
-
this.open = false;
|
|
133
|
-
this.panelHeight = undefined;
|
|
134
|
-
this.placeholder = undefined;
|
|
135
|
-
this.placement = 'bottom';
|
|
136
|
-
this.readonly = undefined;
|
|
137
|
-
this.required = undefined;
|
|
138
|
-
this.sameWidth = true;
|
|
139
|
-
this.skidding = 0;
|
|
140
|
-
this.strategy = 'fixed';
|
|
141
|
-
this.validationStatus = 'none';
|
|
142
|
-
this.value = undefined;
|
|
143
|
-
}
|
|
144
113
|
// Own Properties
|
|
145
114
|
// ====================
|
|
146
115
|
helperTextElem;
|
|
@@ -154,6 +123,77 @@ export class BqSelect {
|
|
|
154
123
|
// ===================================
|
|
155
124
|
el;
|
|
156
125
|
internals;
|
|
126
|
+
// State() variables
|
|
127
|
+
// Inlined decorator, alphabetical order
|
|
128
|
+
// =======================================
|
|
129
|
+
displayValue;
|
|
130
|
+
hasHelperText = false;
|
|
131
|
+
selectedOptions = [];
|
|
132
|
+
hasLabel = false;
|
|
133
|
+
hasPrefix = false;
|
|
134
|
+
hasSuffix = false;
|
|
135
|
+
hasValue = false;
|
|
136
|
+
// Public Property API
|
|
137
|
+
// ========================
|
|
138
|
+
/** If true, the Select input will be focused on component render */
|
|
139
|
+
autofocus;
|
|
140
|
+
/** The clear button aria label */
|
|
141
|
+
clearButtonLabel = 'Clear value';
|
|
142
|
+
/**
|
|
143
|
+
* The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.
|
|
144
|
+
* A value of 0 means no debouncing will occur.
|
|
145
|
+
*/
|
|
146
|
+
debounceTime = 0;
|
|
147
|
+
/**
|
|
148
|
+
* Indicates whether the Select input is disabled or not.
|
|
149
|
+
* If `true`, the Select is disabled and cannot be interacted with.
|
|
150
|
+
*/
|
|
151
|
+
disabled = false;
|
|
152
|
+
/** If true, the clear button won't be displayed */
|
|
153
|
+
disableClear = false;
|
|
154
|
+
/** Represents the distance (gutter or margin) between the Select panel and the input element. */
|
|
155
|
+
distance = 8;
|
|
156
|
+
/** The ID of the form that the Select input belongs to. */
|
|
157
|
+
form;
|
|
158
|
+
/** If true, the Select panel will remain open after a selection is made. */
|
|
159
|
+
keepOpenOnSelect = false;
|
|
160
|
+
/** The Select input name. */
|
|
161
|
+
name;
|
|
162
|
+
/** The maximum number of tags to display when multiple selection is enabled */
|
|
163
|
+
maxTagsVisible = 2;
|
|
164
|
+
/** If true, the Select input will allow multiple selections. */
|
|
165
|
+
multiple = false;
|
|
166
|
+
/** If true, the Select panel will be visible. */
|
|
167
|
+
open = false;
|
|
168
|
+
/** When set, it will override the height of the Select panel. */
|
|
169
|
+
panelHeight;
|
|
170
|
+
/** The Select input placeholder text value */
|
|
171
|
+
placeholder;
|
|
172
|
+
/** Position of the Select panel */
|
|
173
|
+
placement = 'bottom';
|
|
174
|
+
/** If true, the list of options cannot be filtered (searching won't be available) */
|
|
175
|
+
readonly;
|
|
176
|
+
/** Indicates whether or not the Select input is required to be filled out before submitting the form. */
|
|
177
|
+
required;
|
|
178
|
+
/** Whether the panel should have the Select same width as the input element */
|
|
179
|
+
sameWidth = true;
|
|
180
|
+
/** Represents the skidding between the Select panel and the input element. */
|
|
181
|
+
skidding = 0;
|
|
182
|
+
/** Defines the strategy to position the Select panel */
|
|
183
|
+
strategy = 'fixed';
|
|
184
|
+
/**
|
|
185
|
+
* The validation status of the Select input.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* This property is used to indicate the validation status of the select input. It can be set to one of the following values:
|
|
189
|
+
* - `'none'`: No validation status is set.
|
|
190
|
+
* - `'error'`: The input has a validation error.
|
|
191
|
+
* - `'warning'`: The input has a validation warning.
|
|
192
|
+
* - `'success'`: The input has passed validation.
|
|
193
|
+
*/
|
|
194
|
+
validationStatus = 'none';
|
|
195
|
+
/** The select input value, it can be used to reset the field to a previous value */
|
|
196
|
+
value;
|
|
157
197
|
// Prop lifecycle events
|
|
158
198
|
// =======================
|
|
159
199
|
handleValueChange() {
|