@beeq/core 1.8.0-beta.14 → 1.8.0-beta.16
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-350cd07e.entry.js → p-026fad0d.entry.js} +2 -2
- package/dist/beeq/p-026fad0d.entry.js.map +1 -0
- package/dist/beeq/{p-457ab863.entry.js → p-09323635.entry.js} +2 -2
- package/dist/beeq/p-09323635.entry.js.map +1 -0
- package/dist/beeq/p-0c0bd129.entry.js +6 -0
- package/dist/beeq/p-0c0bd129.entry.js.map +1 -0
- package/dist/beeq/{p-0180a237.entry.js → p-0c12aa01.entry.js} +2 -2
- package/dist/beeq/p-0c12aa01.entry.js.map +1 -0
- package/dist/beeq/{p-be234206.entry.js → p-0f72dbb6.entry.js} +2 -2
- package/dist/beeq/p-0f72dbb6.entry.js.map +1 -0
- package/dist/beeq/{p-96793709.entry.js → p-19b7bbe0.entry.js} +2 -2
- package/dist/beeq/p-19b7bbe0.entry.js.map +1 -0
- package/dist/beeq/{p-a89bfbd8.entry.js → p-1b0cfcd6.entry.js} +2 -2
- package/dist/beeq/p-1b0cfcd6.entry.js.map +1 -0
- package/dist/beeq/{p-0711a447.entry.js → p-1cdea079.entry.js} +2 -2
- package/dist/beeq/p-1cdea079.entry.js.map +1 -0
- package/dist/beeq/{p-99668b08.entry.js → p-20d91acf.entry.js} +2 -2
- package/dist/beeq/p-20d91acf.entry.js.map +1 -0
- package/dist/beeq/{p-854e2114.entry.js → p-29d9487c.entry.js} +2 -2
- package/dist/beeq/p-29d9487c.entry.js.map +1 -0
- package/dist/beeq/p-2c566eb0.entry.js +6 -0
- package/dist/beeq/p-2c566eb0.entry.js.map +1 -0
- package/dist/beeq/{p-d2c20a92.entry.js → p-2ef4ed54.entry.js} +2 -2
- package/dist/beeq/p-2ef4ed54.entry.js.map +1 -0
- package/dist/beeq/{p-561ff182.js → p-3c472097.js} +2 -2
- package/dist/beeq/{p-bdf2ea24.entry.js → p-43dc9906.entry.js} +2 -2
- package/dist/beeq/p-43dc9906.entry.js.map +1 -0
- package/dist/beeq/{p-b9171e19.entry.js → p-4c66663c.entry.js} +2 -2
- package/dist/beeq/p-4c66663c.entry.js.map +1 -0
- package/dist/beeq/{p-81b6556f.entry.js → p-4d6a9646.entry.js} +2 -2
- package/dist/beeq/p-4d6a9646.entry.js.map +1 -0
- package/dist/beeq/{p-0ff234ec.entry.js → p-52603411.entry.js} +2 -2
- package/dist/beeq/p-52603411.entry.js.map +1 -0
- package/dist/beeq/{p-c8f639ab.entry.js → p-56c43424.entry.js} +2 -2
- package/dist/beeq/p-56c43424.entry.js.map +1 -0
- package/dist/beeq/{p-5b5f9a2a.entry.js → p-5d6fc48a.entry.js} +2 -2
- package/dist/beeq/p-5d6fc48a.entry.js.map +1 -0
- package/dist/beeq/p-60094726.js +7 -0
- package/dist/beeq/p-60094726.js.map +1 -0
- package/dist/beeq/p-6079f9b2.entry.js +6 -0
- package/dist/beeq/p-6079f9b2.entry.js.map +1 -0
- package/dist/beeq/{p-6482a62d.entry.js → p-6a0b0106.entry.js} +2 -2
- package/dist/beeq/p-6a0b0106.entry.js.map +1 -0
- package/dist/beeq/{p-382eea5f.entry.js → p-73ef1309.entry.js} +2 -2
- package/dist/beeq/p-73ef1309.entry.js.map +1 -0
- package/dist/beeq/{p-cc83682b.entry.js → p-75cc6789.entry.js} +2 -2
- package/dist/beeq/p-75cc6789.entry.js.map +1 -0
- package/dist/beeq/{p-42d22a31.entry.js → p-7a719a9b.entry.js} +2 -2
- package/dist/beeq/p-7a719a9b.entry.js.map +1 -0
- package/dist/beeq/{p-a0d6207d.entry.js → p-7f124d61.entry.js} +2 -2
- package/dist/beeq/p-7f124d61.entry.js.map +1 -0
- package/dist/beeq/{p-def8acd7.entry.js → p-8ca2588f.entry.js} +2 -2
- package/dist/beeq/p-8ca2588f.entry.js.map +1 -0
- package/dist/beeq/{p-8b595d1f.entry.js → p-921fa1ea.entry.js} +2 -2
- package/dist/beeq/p-921fa1ea.entry.js.map +1 -0
- package/dist/beeq/p-99b5d671.entry.js +6 -0
- package/dist/beeq/p-99b5d671.entry.js.map +1 -0
- package/dist/beeq/{p-47d41233.entry.js → p-a5e01629.entry.js} +2 -2
- package/dist/beeq/p-a5e01629.entry.js.map +1 -0
- package/dist/beeq/{p-5f00f1f5.entry.js → p-adec3d5b.entry.js} +2 -2
- package/dist/beeq/{p-5f00f1f5.entry.js.map → p-adec3d5b.entry.js.map} +1 -1
- package/dist/beeq/{p-1d67af77.entry.js → p-b83f174c.entry.js} +2 -2
- package/dist/beeq/p-b83f174c.entry.js.map +1 -0
- package/dist/beeq/{p-4f47130c.entry.js → p-c09dac58.entry.js} +2 -2
- package/dist/beeq/p-c09dac58.entry.js.map +1 -0
- package/dist/beeq/p-c65d21e2.entry.js +6 -0
- package/dist/beeq/p-c65d21e2.entry.js.map +1 -0
- package/dist/beeq/{p-eab2d27c.entry.js → p-c70c6b00.entry.js} +2 -2
- package/dist/beeq/p-c70c6b00.entry.js.map +1 -0
- package/dist/beeq/{p-995bfd58.js → p-c9ed66d9.js} +2 -2
- package/dist/beeq/{p-a6094ed8.entry.js → p-d8221b88.entry.js} +2 -2
- package/dist/beeq/p-d8221b88.entry.js.map +1 -0
- package/dist/beeq/{p-439583bc.entry.js → p-d8a257b7.entry.js} +2 -2
- package/dist/beeq/p-d8a257b7.entry.js.map +1 -0
- package/dist/beeq/p-dc544089.entry.js +6 -0
- package/dist/beeq/p-dc544089.entry.js.map +1 -0
- package/dist/beeq/{p-70ae504a.entry.js → p-e056c02a.entry.js} +2 -2
- package/dist/beeq/p-e056c02a.entry.js.map +1 -0
- package/dist/beeq/{p-8e9f0bf3.entry.js → p-e68dcd3d.entry.js} +2 -2
- package/dist/beeq/p-e68dcd3d.entry.js.map +1 -0
- package/dist/beeq/{p-d7507599.entry.js → p-eb662058.entry.js} +2 -2
- package/dist/beeq/p-eb662058.entry.js.map +1 -0
- package/dist/beeq.html-custom-data.json +2029 -0
- package/dist/cjs/{assetsPath-557e47c5.js → assetsPath-0ec85a1a.js} +2 -2
- package/dist/cjs/{assetsPath-557e47c5.js.map → assetsPath-0ec85a1a.js.map} +1 -1
- package/dist/cjs/beeq.cjs.js +3 -3
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +3 -3
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +5 -5
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +6 -6
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +5 -5
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +3 -3
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +4 -11
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +20 -38
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +7 -7
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +4 -4
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +9 -11
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +35 -16
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +6 -6
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +5 -5
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +6 -6
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +5 -5
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +5 -5
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +42 -17
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +4 -4
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +7 -7
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +5 -5
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +3 -3
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +9 -9
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +68 -25
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +10 -4
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +7 -7
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +3 -3
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +21 -7
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +5 -5
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +2 -2
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +5 -5
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +2 -2
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +56 -4
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +9 -9
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +6 -6
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +62 -13
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +2 -2
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-9cbab9ab.js → index-c4edfa07.js} +787 -553
- package/dist/cjs/index-c4edfa07.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{isDefined-7235b5cd.js → isDefined-e538d669.js} +2 -2
- package/dist/cjs/{isDefined-7235b5cd.js.map → isDefined-e538d669.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/bq-accordion.js +117 -18
- package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
- package/dist/collection/components/accordion-group/bq-accordion-group.js +36 -1
- package/dist/collection/components/accordion-group/bq-accordion-group.js.map +1 -1
- package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
- package/dist/collection/components/alert/bq-alert.js +91 -9
- 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 +66 -4
- package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
- package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
- package/dist/collection/components/badge/bq-badge.js +36 -2
- package/dist/collection/components/badge/bq-badge.js.map +1 -1
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js +43 -119
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js.map +1 -1
- package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +50 -46
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
- package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
- package/dist/collection/components/button/bq-button.js +77 -2
- package/dist/collection/components/button/bq-button.js.map +1 -1
- package/dist/collection/components/button/scss/bq-button.css +1 -1
- package/dist/collection/components/card/bq-card.js +37 -3
- package/dist/collection/components/card/bq-card.js.map +1 -1
- package/dist/collection/components/card/scss/bq-card.css +1 -1
- package/dist/collection/components/checkbox/bq-checkbox.js +62 -9
- package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
- package/dist/collection/components/checkbox/scss/bq-checkbox.css +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js +190 -43
- 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 +96 -12
- package/dist/collection/components/dialog/bq-dialog.js.map +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/divider/bq-divider.js +53 -8
- package/dist/collection/components/divider/bq-divider.js.map +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +75 -13
- 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 +70 -4
- package/dist/collection/components/dropdown/bq-dropdown.js.map +1 -1
- package/dist/collection/components/dropdown/scss/bq-dropdown.css +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +24 -4
- package/dist/collection/components/empty-state/bq-empty-state.js.map +1 -1
- package/dist/collection/components/icon/bq-icon.js +34 -2
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/input/bq-input.js +176 -14
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/input/scss/bq-input.css +1 -1
- package/dist/collection/components/notification/bq-notification.js +73 -7
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/notification/scss/bq-notification.css +1 -1
- package/dist/collection/components/option/bq-option.js +52 -4
- package/dist/collection/components/option/bq-option.js.map +1 -1
- package/dist/collection/components/option-group/bq-option-group.js +32 -1
- package/dist/collection/components/option-group/bq-option-group.js.map +1 -1
- package/dist/collection/components/option-list/bq-option-list.js +24 -1
- package/dist/collection/components/option-list/bq-option-list.js.map +1 -1
- package/dist/collection/components/option-list/scss/bq-option-list.css +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +39 -2
- package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
- package/dist/collection/components/panel/bq-panel.js +44 -1
- package/dist/collection/components/panel/bq-panel.js.map +1 -1
- package/dist/collection/components/panel/scss/bq-panel.css +1 -1
- package/dist/collection/components/progress/bq-progress.js +105 -67
- package/dist/collection/components/progress/bq-progress.js.map +1 -1
- package/dist/collection/components/radio/bq-radio.js +76 -2
- package/dist/collection/components/radio/bq-radio.js.map +1 -1
- package/dist/collection/components/radio/scss/bq-radio.css +1 -1
- package/dist/collection/components/radio-group/bq-radio-group.js +187 -57
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/radio-group/scss/bq-radio-group.css +1 -1
- package/dist/collection/components/select/bq-select.js +133 -4
- 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 +53 -2
- 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 +43 -0
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
- package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
- package/dist/collection/components/slider/bq-slider.js +88 -6
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +36 -4
- package/dist/collection/components/spinner/bq-spinner.js.map +1 -1
- package/dist/collection/components/status/bq-status.js +24 -4
- package/dist/collection/components/status/bq-status.js.map +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +42 -4
- package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
- package/dist/collection/components/steps/bq-steps.js +34 -1
- package/dist/collection/components/steps/bq-steps.js.map +1 -1
- package/dist/collection/components/switch/bq-switch.js +124 -3
- package/dist/collection/components/switch/bq-switch.js.map +1 -1
- package/dist/collection/components/switch/scss/bq-switch.css +1 -1
- package/dist/collection/components/tab/bq-tab.js +100 -41
- package/dist/collection/components/tab/bq-tab.js.map +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +84 -46
- package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
- package/dist/collection/components/tab-group/scss/bq-tab-group.css +1 -1
- package/dist/collection/components/tag/bq-tag.js +70 -3
- package/dist/collection/components/tag/bq-tag.js.map +1 -1
- package/dist/collection/components/tag/scss/bq-tag.css +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +176 -11
- 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 +60 -3
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +55 -1
- package/dist/collection/components/tooltip/bq-tooltip.js.map +1 -1
- package/dist/collection/global/scripts/global.js.map +1 -1
- package/dist/collection/tools/generate-custom-elements-json.js +8 -7
- package/dist/collection/tools/generate-custom-elements-json.js.map +1 -1
- 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-group.js.map +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/{p-2bdb6f46.js → p-27c1b08e.js} +2 -2
- package/dist/components/p-27c1b08e.js.map +1 -0
- package/dist/components/{p-209dd39e.js → p-295b174b.js} +2 -2
- package/dist/components/p-295b174b.js.map +1 -0
- package/dist/components/{p-fd41feb9.js → p-33371480.js} +2 -2
- package/dist/components/{p-fd41feb9.js.map → p-33371480.js.map} +1 -1
- package/dist/components/p-5940b410.js +7 -0
- package/dist/components/p-5940b410.js.map +1 -0
- package/dist/components/{p-00b80145.js → p-78d23ddc.js} +2 -2
- package/dist/components/{p-9e8fdef7.js → p-93c16753.js} +2 -2
- package/dist/components/p-93c16753.js.map +1 -0
- package/dist/components/{p-56dbc376.js → p-9f037c57.js} +2 -2
- package/dist/components/p-9f037c57.js.map +1 -0
- package/dist/components/{p-2c245c83.js → p-c2d43340.js} +2 -2
- package/dist/components/p-c2d43340.js.map +1 -0
- package/dist/components/{p-641036af.js → p-cbfc423f.js} +2 -2
- package/dist/components/p-cbfc423f.js.map +1 -0
- package/dist/components/{p-07467338.js → p-cf496927.js} +1 -1
- package/dist/components/p-cf496927.js.map +1 -0
- package/dist/components/{p-ddf2a5ae.js → p-f5cd1f38.js} +2 -2
- package/dist/components/p-f5cd1f38.js.map +1 -0
- package/dist/components/{p-59b33ad7.js → p-fe0b66e5.js} +2 -2
- package/dist/components/p-fe0b66e5.js.map +1 -0
- package/dist/custom-elements.json +17528 -0
- package/dist/esm/{assetsPath-15d3d3e4.js → assetsPath-6c498eae.js} +2 -2
- package/dist/esm/{assetsPath-15d3d3e4.js.map → assetsPath-6c498eae.js.map} +1 -1
- package/dist/esm/beeq.js +4 -4
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +3 -3
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +5 -5
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +6 -6
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +5 -5
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +3 -3
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +4 -11
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +20 -38
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +7 -7
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +4 -4
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +9 -11
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +35 -16
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +6 -6
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +5 -5
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +6 -6
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +5 -5
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +5 -5
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +42 -17
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +4 -4
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +2 -2
- package/dist/esm/bq-option-group.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +7 -7
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +5 -5
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +3 -3
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +9 -9
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +68 -25
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +10 -4
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +7 -7
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +2 -2
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +3 -3
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +21 -7
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +5 -5
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +2 -2
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +5 -5
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +2 -2
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +56 -4
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +9 -9
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +6 -6
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +62 -13
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +2 -2
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +2 -2
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{index-f0f1a8c6.js → index-c7d02072.js} +787 -553
- package/dist/esm/index-c7d02072.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/{isDefined-edd9ee7b.js → isDefined-48de6db5.js} +2 -2
- package/dist/esm/{isDefined-edd9ee7b.js.map → isDefined-48de6db5.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hydrate/index.js +3017 -848
- package/dist/hydrate/index.mjs +3017 -848
- package/dist/stencil.config.js +14 -3
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/accordion/bq-accordion.d.ts +100 -10
- package/dist/types/components/accordion-group/bq-accordion-group.d.ts +25 -0
- package/dist/types/components/alert/bq-alert.d.ts +71 -5
- package/dist/types/components/avatar/bq-avatar.d.ts +51 -1
- package/dist/types/components/badge/bq-badge.d.ts +28 -0
- package/dist/types/components/breadcrumb/bq-breadcrumb.d.ts +25 -17
- package/dist/types/components/breadcrumb-item/bq-breadcrumb-item.d.ts +43 -10
- package/dist/types/components/button/bq-button.d.ts +51 -0
- package/dist/types/components/card/bq-card.d.ts +31 -1
- package/dist/types/components/checkbox/bq-checkbox.d.ts +37 -1
- package/dist/types/components/date-picker/bq-date-picker.d.ts +112 -28
- package/dist/types/components/dialog/bq-dialog.d.ts +76 -8
- package/dist/types/components/divider/bq-divider.d.ts +31 -4
- package/dist/types/components/drawer/bq-drawer.d.ts +59 -9
- package/dist/types/components/dropdown/bq-dropdown.d.ts +51 -3
- package/dist/types/components/empty-state/bq-empty-state.d.ts +18 -0
- package/dist/types/components/icon/bq-icon.d.ts +21 -1
- package/dist/types/components/input/bq-input.d.ts +77 -0
- package/dist/types/components/notification/bq-notification.d.ts +57 -5
- package/dist/types/components/option/bq-option.d.ts +40 -0
- package/dist/types/components/option-group/bq-option-group.d.ts +31 -0
- package/dist/types/components/option-list/bq-option-list.d.ts +21 -0
- package/dist/types/components/page-title/bq-page-title.d.ts +37 -0
- package/dist/types/components/panel/bq-panel.d.ts +31 -0
- package/dist/types/components/progress/bq-progress.d.ts +33 -9
- package/dist/types/components/radio/bq-radio.d.ts +37 -0
- package/dist/types/components/radio-group/bq-radio-group.d.ts +53 -10
- package/dist/types/components/select/bq-select.d.ts +85 -0
- package/dist/types/components/side-menu/bq-side-menu.d.ts +45 -0
- package/dist/types/components/side-menu-item/bq-side-menu-item.d.ts +37 -0
- package/dist/types/components/slider/bq-slider.d.ts +39 -1
- package/dist/types/components/spinner/bq-spinner.d.ts +26 -0
- package/dist/types/components/status/bq-status.d.ts +21 -3
- package/dist/types/components/step-item/bq-step-item.d.ts +32 -0
- package/dist/types/components/steps/bq-steps.d.ts +27 -0
- package/dist/types/components/switch/bq-switch.d.ts +43 -0
- package/dist/types/components/tab/bq-tab.d.ts +47 -5
- package/dist/types/components/tab-group/bq-tab-group.d.ts +34 -8
- package/dist/types/components/tag/bq-tag.d.ts +49 -0
- package/dist/types/components/textarea/bq-textarea.d.ts +74 -0
- package/dist/types/components/toast/bq-toast.d.ts +47 -2
- package/dist/types/components/tooltip/bq-tooltip.d.ts +40 -0
- package/dist/types/components.d.ts +5783 -71
- package/dist/types/global/scripts/global.d.ts +0 -21
- package/dist/types/global.d.ts +26 -0
- package/dist/types/tools/generate-custom-elements-json.d.ts +1 -1
- package/package.json +1 -1
- package/dist/beeq/p-0180a237.entry.js.map +0 -1
- package/dist/beeq/p-0711a447.entry.js.map +0 -1
- package/dist/beeq/p-0875b715.entry.js +0 -6
- package/dist/beeq/p-0875b715.entry.js.map +0 -1
- package/dist/beeq/p-0ff234ec.entry.js.map +0 -1
- package/dist/beeq/p-1d67af77.entry.js.map +0 -1
- package/dist/beeq/p-25365502.entry.js +0 -6
- package/dist/beeq/p-25365502.entry.js.map +0 -1
- package/dist/beeq/p-350cd07e.entry.js.map +0 -1
- package/dist/beeq/p-382eea5f.entry.js.map +0 -1
- package/dist/beeq/p-42d22a31.entry.js.map +0 -1
- package/dist/beeq/p-439583bc.entry.js.map +0 -1
- package/dist/beeq/p-457ab863.entry.js.map +0 -1
- package/dist/beeq/p-47d41233.entry.js.map +0 -1
- package/dist/beeq/p-4f47130c.entry.js.map +0 -1
- package/dist/beeq/p-5b5f9a2a.entry.js.map +0 -1
- package/dist/beeq/p-5da52049.js +0 -7
- package/dist/beeq/p-5da52049.js.map +0 -1
- package/dist/beeq/p-63941636.entry.js +0 -6
- package/dist/beeq/p-63941636.entry.js.map +0 -1
- package/dist/beeq/p-6482a62d.entry.js.map +0 -1
- package/dist/beeq/p-64ddef8a.entry.js +0 -6
- package/dist/beeq/p-64ddef8a.entry.js.map +0 -1
- package/dist/beeq/p-70ae504a.entry.js.map +0 -1
- package/dist/beeq/p-81b6556f.entry.js.map +0 -1
- package/dist/beeq/p-854e2114.entry.js.map +0 -1
- package/dist/beeq/p-8b595d1f.entry.js.map +0 -1
- package/dist/beeq/p-8e9f0bf3.entry.js.map +0 -1
- package/dist/beeq/p-94ca5709.entry.js +0 -6
- package/dist/beeq/p-94ca5709.entry.js.map +0 -1
- package/dist/beeq/p-96793709.entry.js.map +0 -1
- package/dist/beeq/p-99668b08.entry.js.map +0 -1
- package/dist/beeq/p-a0d6207d.entry.js.map +0 -1
- package/dist/beeq/p-a6094ed8.entry.js.map +0 -1
- package/dist/beeq/p-a89bfbd8.entry.js.map +0 -1
- package/dist/beeq/p-b9171e19.entry.js.map +0 -1
- package/dist/beeq/p-bdf2ea24.entry.js.map +0 -1
- package/dist/beeq/p-be234206.entry.js.map +0 -1
- package/dist/beeq/p-c8f639ab.entry.js.map +0 -1
- package/dist/beeq/p-cc83682b.entry.js.map +0 -1
- package/dist/beeq/p-d2c20a92.entry.js.map +0 -1
- package/dist/beeq/p-d7507599.entry.js.map +0 -1
- package/dist/beeq/p-def8acd7.entry.js.map +0 -1
- package/dist/beeq/p-eab2d27c.entry.js.map +0 -1
- package/dist/beeq/p-f9d9bd41.entry.js +0 -6
- package/dist/beeq/p-f9d9bd41.entry.js.map +0 -1
- package/dist/cjs/index-9cbab9ab.js.map +0 -1
- package/dist/components/p-07467338.js.map +0 -1
- package/dist/components/p-209dd39e.js.map +0 -1
- package/dist/components/p-2bdb6f46.js.map +0 -1
- package/dist/components/p-2c245c83.js.map +0 -1
- package/dist/components/p-56dbc376.js.map +0 -1
- package/dist/components/p-59b33ad7.js.map +0 -1
- package/dist/components/p-641036af.js.map +0 -1
- package/dist/components/p-9e8fdef7.js.map +0 -1
- package/dist/components/p-ddf2a5ae.js.map +0 -1
- package/dist/components/p-f1736bec.js +0 -7
- package/dist/components/p-f1736bec.js.map +0 -1
- package/dist/esm/index-f0f1a8c6.js.map +0 -1
- /package/dist/beeq/{p-561ff182.js.map → p-3c472097.js.map} +0 -0
- /package/dist/beeq/{p-995bfd58.js.map → p-c9ed66d9.js.map} +0 -0
- /package/dist/components/{p-00b80145.js.map → p-78d23ddc.js.map} +0 -0
|
@@ -7,9 +7,41 @@ import { STEP_ITEM_STATUS } from "./bq-step-item.types";
|
|
|
7
7
|
import { isHTMLElement, validatePropValue } from "../../shared/utils";
|
|
8
8
|
import { STEPS_SIZE } from "../steps/bq-steps.types";
|
|
9
9
|
/**
|
|
10
|
+
* The Step Item Component is a UI element used to display a single step or stage in a process or task.
|
|
11
|
+
* It should be used inside the Steps component.
|
|
12
|
+
*
|
|
13
|
+
* @example How to use it
|
|
14
|
+
* ```html
|
|
15
|
+
* <bq-step-item status="completed">
|
|
16
|
+
* <bq-icon slot="prefix" name="check-circle"></bq-icon>
|
|
17
|
+
* <span>Title</span>
|
|
18
|
+
* <span slot="description">Description</span>
|
|
19
|
+
* </bq-step-item>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @documentation https://www.beeq.design/3d466e231/p/896b66-stepper
|
|
23
|
+
* @status stable
|
|
24
|
+
*
|
|
25
|
+
* @attr {"small" | "medium"} size - It defines prefix size
|
|
26
|
+
* @attr {"completed" | "current" | "error" | "default" | "disabled"} status - It defines step item appearance based on its status
|
|
27
|
+
* @attr {"numeric" | "icon" | "dot"} type - It defines the step item type used
|
|
28
|
+
*
|
|
29
|
+
* @event bqClick - Callback handler emitted when the step item is clicked
|
|
30
|
+
*
|
|
31
|
+
* @slot - The step item content
|
|
32
|
+
* @slot prefix - The step item prefix
|
|
33
|
+
* @slot description - The step item description
|
|
34
|
+
*
|
|
10
35
|
* @part base - The component's base wrapper.
|
|
11
36
|
* @part title - The component's title.
|
|
12
37
|
* @part description - The component's description.
|
|
38
|
+
*
|
|
39
|
+
* @cssprop --bq-step-item--prefix-color - Color of the prefix icon
|
|
40
|
+
* @cssprop --bq-step-item--prefix-color-current - Color of the prefix icon when current
|
|
41
|
+
* @cssprop --bq-step-item--prefix-color-completed - Color of the prefix icon when completed
|
|
42
|
+
* @cssprop --bq-step-item--prefix-color-error - Color of the prefix icon when error
|
|
43
|
+
* @cssprop --bq-step-item--prefix-num-size - Size of the prefix number
|
|
44
|
+
* @cssprop --bq-step-item--prefix-num-bg-color - Background color of the prefix number
|
|
13
45
|
*/
|
|
14
46
|
export class BqStepItem {
|
|
15
47
|
constructor() {
|
|
@@ -75,18 +107,18 @@ export class BqStepItem {
|
|
|
75
107
|
// Always the last one in the class.
|
|
76
108
|
// ===================================
|
|
77
109
|
render() {
|
|
78
|
-
return (h("div", { key: '
|
|
110
|
+
return (h("div", { key: '1161a3c603b431caa096ef8e0e8e5ab929173c80', class: {
|
|
79
111
|
'bq-step-item flex gap-s': true,
|
|
80
112
|
[`bq-step-item--${this.status}`]: true,
|
|
81
113
|
'pointer-events-none opacity-60': this.isDisabled,
|
|
82
|
-
}, part: "base" }, h("div", { key: '
|
|
114
|
+
}, part: "base" }, h("div", { key: '84901faf3c3b314f9fbe6f5169a9ba7b3bc2cf75', class: `bq-step-item__prefix relative ${this.type} ${this.size} ${this.status}` }, h("slot", { key: '1e8f12cbbd3f87a439b4c71653c5ab592c3f62e4', name: "prefix", onSlotchange: this.handleIconPrefix })), h("div", { key: '4411789c420bc5b25c16cf5c159a3b7960df6974', class: "bq-step-item__content" }, h("div", { key: '84449ef9359c2f46620e4f4fabd3cab4dfc0a4a5', class: {
|
|
83
115
|
'bq-step-item__content--title pe-xs3 text-m leading-regular text-primary': true,
|
|
84
116
|
'pointer-events-none': this.isDisabled,
|
|
85
117
|
'text-brand': this.isCurrent,
|
|
86
|
-
}, part: "title" }, h("slot", { key: '
|
|
118
|
+
}, part: "title" }, h("slot", { key: 'b26efa3c0d9bdb6e3691d947d018597114103b2b' })), h("div", { key: 'cfe3ba67018815d685815bf52d75d1225d81b113', class: {
|
|
87
119
|
'bq-step-item__content--description text-s leading-regular opacity-60': true,
|
|
88
120
|
'opacity-60': this.isDisabled,
|
|
89
|
-
}, part: "description" }, h("slot", { key: '
|
|
121
|
+
}, part: "description" }, h("slot", { key: '97be3adf391e9f125c65435fd5e8a8db2b029dad', name: "description" })))));
|
|
90
122
|
}
|
|
91
123
|
static get is() { return "bq-step-item"; }
|
|
92
124
|
static get encapsulation() { return "shadow"; }
|
|
@@ -122,6 +154,8 @@ export class BqStepItem {
|
|
|
122
154
|
"tags": [],
|
|
123
155
|
"text": "It defines prefix size"
|
|
124
156
|
},
|
|
157
|
+
"getter": false,
|
|
158
|
+
"setter": false,
|
|
125
159
|
"attribute": "size",
|
|
126
160
|
"reflect": true,
|
|
127
161
|
"defaultValue": "'medium'"
|
|
@@ -146,6 +180,8 @@ export class BqStepItem {
|
|
|
146
180
|
"tags": [],
|
|
147
181
|
"text": "It defines step item appearance based on its status"
|
|
148
182
|
},
|
|
183
|
+
"getter": false,
|
|
184
|
+
"setter": false,
|
|
149
185
|
"attribute": "status",
|
|
150
186
|
"reflect": true,
|
|
151
187
|
"defaultValue": "'default'"
|
|
@@ -170,6 +206,8 @@ export class BqStepItem {
|
|
|
170
206
|
"tags": [],
|
|
171
207
|
"text": "It defines the step item type used"
|
|
172
208
|
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
173
211
|
"attribute": "type",
|
|
174
212
|
"reflect": true
|
|
175
213
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-step-item.js","sourceRoot":"","sources":["../../../../../../src/components/step-item/bq-step-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,M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AC,uBAAuB;gBAEhC,4DACE,KAAK,EAAE;wBACL,yEAAyE,EAAE,IAAI;wBAC/E,qBAAqB,EAAE,IAAI,CAAC,UAAU;wBACtC,YAAY,EAAE,IAAI,CAAC,SAAS;qBAC7B,EACD,IAAI,EAAC,OAAO;oBAEZ,8DAAQ,CACJ;gBAEN,4DACE,KAAK,EAAE;wBACL,sEAAsE,EAAE,IAAI;wBAC5E,YAAY,EAAE,IAAI,CAAC,UAAU;qBAC9B,EACD,IAAI,EAAC,aAAa;oBAElB,6DAAM,IAAI,EAAC,aAAa,GAAG,CACvB,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\n\nimport { STEP_ITEM_STATUS, TStepItemStatus } from './bq-step-item.types';\nimport { isHTMLElement, validatePropValue } from '../../shared/utils';\nimport { STEPS_SIZE, TStepsSize, TStepsType } from '../steps/bq-steps.types';\n\n/**\n * The Step Item Component is a UI element used to display a single step or stage in a process or task.\n * It should be used inside the Steps component.\n *\n * @example How to use it\n * ```html\n * <bq-step-item status=\"completed\">\n * <bq-icon slot=\"prefix\" name=\"check-circle\"></bq-icon>\n * <span>Title</span>\n * <span slot=\"description\">Description</span>\n * </bq-step-item>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/896b66-stepper\n * @status stable\n *\n * @attr {\"small\" | \"medium\"} size - It defines prefix size\n * @attr {\"completed\" | \"current\" | \"error\" | \"default\" | \"disabled\"} status - It defines step item appearance based on its status\n * @attr {\"numeric\" | \"icon\" | \"dot\"} type - It defines the step item type used\n *\n * @event bqClick - Callback handler emitted when the step item is clicked\n *\n * @slot - The step item content\n * @slot prefix - The step item prefix\n * @slot description - The step item description\n *\n * @part base - The component's base wrapper.\n * @part title - The component's title.\n * @part description - The component's description.\n *\n * @cssprop --bq-step-item--prefix-color - Color of the prefix icon\n * @cssprop --bq-step-item--prefix-color-current - Color of the prefix icon when current\n * @cssprop --bq-step-item--prefix-color-completed - Color of the prefix icon when completed\n * @cssprop --bq-step-item--prefix-color-error - Color of the prefix icon when error\n * @cssprop --bq-step-item--prefix-num-size - Size of the prefix number\n * @cssprop --bq-step-item--prefix-num-bg-color - Background color of the prefix number\n */\n@Component({\n tag: 'bq-step-item',\n styleUrl: './scss/bq-step-item.scss',\n shadow: true,\n})\nexport class BqStepItem {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n @Element() el!: HTMLBqStepItemElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** It defines prefix size */\n @Prop({ reflect: true }) size?: TStepsSize = 'medium';\n\n /** It defines step item appearance based on its status */\n @Prop({ reflect: true }) status?: TStepItemStatus = 'default';\n\n /** It defines the step item type used */\n @Prop({ reflect: true }) type?: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('status')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEP_ITEM_STATUS, 'default', this.el, 'status');\n\n this.handleIconPrefix();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the step item is clicked */\n @Event() bqClick: EventEmitter<{ target: HTMLBqStepItemElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.checkPropValues();\n }\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.handleIconPrefix();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private get isDisabled(): boolean {\n return this.status === 'disabled';\n }\n\n private get isCurrent(): boolean {\n return this.status === 'current';\n }\n\n private handleIconPrefix = () => {\n const iconElem = this.el.querySelector('[slot=\"prefix\"]');\n if (!iconElem || !isHTMLElement(iconElem, 'bq-icon')) return;\n\n iconElem.size = this.size === 'small' ? 24 : 32;\n iconElem.weight = this.isCurrent ? 'fill' : 'regular';\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div\n class={{\n 'bq-step-item flex gap-s': true,\n [`bq-step-item--${this.status}`]: true,\n 'pointer-events-none opacity-60': this.isDisabled,\n }}\n part=\"base\"\n >\n <div class={`bq-step-item__prefix relative ${this.type} ${this.size} ${this.status}`}>\n <slot name=\"prefix\" onSlotchange={this.handleIconPrefix} />\n </div>\n <div class=\"bq-step-item__content\">\n {/* TITLE */}\n <div\n class={{\n 'bq-step-item__content--title pe-xs3 text-m leading-regular text-primary': true,\n 'pointer-events-none': this.isDisabled,\n 'text-brand': this.isCurrent,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n {/* DESCRIPTION */}\n <div\n class={{\n 'bq-step-item__content--description text-s leading-regular opacity-60': true,\n 'opacity-60': this.isDisabled,\n }}\n part=\"description\"\n >\n <slot name=\"description\" />\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -6,10 +6,37 @@ import { h } from "@stencil/core";
|
|
|
6
6
|
import { STEPS_SIZE, STEPS_TYPE } from "./bq-steps.types";
|
|
7
7
|
import { validatePropValue } from "../../shared/utils";
|
|
8
8
|
/**
|
|
9
|
+
* The Steps Component is a UI element used to display a series of steps or stages in a process or task.
|
|
10
|
+
* It is used to guide users through a process or task and to indicate their progress.
|
|
11
|
+
*
|
|
12
|
+
* @example How to use it
|
|
13
|
+
* ```html
|
|
14
|
+
* <bq-steps divider-color="stroke--primary" type="dot" size="medium">
|
|
15
|
+
* <bq-step-item status="completed"> ... </bq-step-item>
|
|
16
|
+
* <bq-step-item status="error"> ... </bq-step-item>
|
|
17
|
+
* <bq-step-item status="current"> ... </bq-step-item>
|
|
18
|
+
* <bq-step-item status="default"> ... </bq-step-item>
|
|
19
|
+
* </bq-steps>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @documentation https://www.beeq.design/3d466e231/p/896b66-stepper
|
|
23
|
+
* @status stable
|
|
24
|
+
*
|
|
25
|
+
* @dependency bq-divider
|
|
26
|
+
*
|
|
27
|
+
* @attr {string} divider-color - The color of the line that connects the steps. It should be a valid declarative color token.
|
|
28
|
+
* @attr {"medium" | "small"} size - The size of the steps
|
|
29
|
+
* @attr {"numeric" | "icon" | "dot"} type - The type of prefix element to use on the step items
|
|
30
|
+
*
|
|
31
|
+
* @slot - The step items
|
|
32
|
+
*
|
|
9
33
|
* @part container - The container wrapper of the Steps component
|
|
10
34
|
* @part divider-base - The base wrapper of the divider component
|
|
11
35
|
* @part divider-dash-start - The dash start wrapper of the divider component
|
|
12
36
|
* @part divider-dash-end - The dash end wrapper of the divider component
|
|
37
|
+
*
|
|
38
|
+
* @cssprop --bq-steps--divider-color - Divider color
|
|
39
|
+
* @cssprop --bq-steps--gap - Gap between steps
|
|
13
40
|
*/
|
|
14
41
|
export class BqSteps {
|
|
15
42
|
constructor() {
|
|
@@ -71,7 +98,7 @@ export class BqSteps {
|
|
|
71
98
|
// ===================================
|
|
72
99
|
render() {
|
|
73
100
|
const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';
|
|
74
|
-
return (h("div", { key: '
|
|
101
|
+
return (h("div", { key: '3dce87e1c73302eca5f4f7ddf8608318ceae1938', class: "relative flex w-full items-start justify-between", ref: (div) => (this.stepElem = div), part: "container" }, h("slot", { key: '5d55a7c2244bcdaab1ecc90365ac0e35b6f940e9' }), h("bq-divider", { key: '337a125bde11140ab4dff1fef10797b13613d182', class: `absolute -z-10 p-i-s inset-ie-0 inset-is-0 ${dividerPaddingTop}`, strokeColor: this.dividerColor, strokeThickness: 2, exportparts: "base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end" })));
|
|
75
102
|
}
|
|
76
103
|
static get is() { return "bq-steps"; }
|
|
77
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -101,6 +128,8 @@ export class BqSteps {
|
|
|
101
128
|
"tags": [],
|
|
102
129
|
"text": "The color of the line that connects the steps. It should be a valid declarative color token."
|
|
103
130
|
},
|
|
131
|
+
"getter": false,
|
|
132
|
+
"setter": false,
|
|
104
133
|
"attribute": "divider-color",
|
|
105
134
|
"reflect": true,
|
|
106
135
|
"defaultValue": "'stroke--primary'"
|
|
@@ -125,6 +154,8 @@ export class BqSteps {
|
|
|
125
154
|
"tags": [],
|
|
126
155
|
"text": "The size of the steps"
|
|
127
156
|
},
|
|
157
|
+
"getter": false,
|
|
158
|
+
"setter": false,
|
|
128
159
|
"attribute": "size",
|
|
129
160
|
"reflect": true,
|
|
130
161
|
"defaultValue": "'medium'"
|
|
@@ -149,6 +180,8 @@ export class BqSteps {
|
|
|
149
180
|
"tags": [],
|
|
150
181
|
"text": "The type of prefix element to use on the step items"
|
|
151
182
|
},
|
|
183
|
+
"getter": false,
|
|
184
|
+
"setter": false,
|
|
152
185
|
"attribute": "type",
|
|
153
186
|
"reflect": true
|
|
154
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-steps.js","sourceRoot":"","sources":["../../../../../../src/components/steps/bq-steps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"bq-steps.js","sourceRoot":"","sources":["../../../../../../src/components/steps/bq-steps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS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AAI,EAAE,CAAC,CAAC,CAAC,MAAM,CACzD,CAAC,EAA6B,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,cAAc,CAChD,CAAC;IACnC,CAAC;IAEO,gBAAgB,GAAG,GAAG,EAAE;QAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,UAAiC,EAAE,EAAE;YACzD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC5B,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,sCAAsC;IACtC,+BAA+B;IAC/B,IAAI;IAEJ,oBAAoB;IACpB,oCAAoC;IACpC,sCAAsC;IAEtC,MAAM;QACJ,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEtE,OAAO,CACL,4DACE,KAAK,EAAC,kDAAkD,EACxD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,EACnC,IAAI,EAAC,WAAW;YAEhB,8DAAQ;YACR,mEACE,KAAK,EAAE,8CAA8C,iBAAiB,EAAE,EACxE,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,eAAe,EAAE,CAAC,EAClB,WAAW,EAAC,2EAA2E,GACvF,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\nimport { STEPS_SIZE, STEPS_TYPE, TStepsSize, TStepsType } from './bq-steps.types';\nimport { validatePropValue } from '../../shared/utils';\n\n/**\n * The Steps Component is a UI element used to display a series of steps or stages in a process or task.\n * It is used to guide users through a process or task and to indicate their progress.\n *\n * @example How to use it\n * ```html\n * <bq-steps divider-color=\"stroke--primary\" type=\"dot\" size=\"medium\">\n * <bq-step-item status=\"completed\"> ... </bq-step-item>\n * <bq-step-item status=\"error\"> ... </bq-step-item>\n * <bq-step-item status=\"current\"> ... </bq-step-item>\n * <bq-step-item status=\"default\"> ... </bq-step-item>\n * </bq-steps>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/896b66-stepper\n * @status stable\n *\n * @dependency bq-divider\n *\n * @attr {string} divider-color - The color of the line that connects the steps. It should be a valid declarative color token.\n * @attr {\"medium\" | \"small\"} size - The size of the steps\n * @attr {\"numeric\" | \"icon\" | \"dot\"} type - The type of prefix element to use on the step items\n *\n * @slot - The step items\n *\n * @part container - The container wrapper of the Steps component\n * @part divider-base - The base wrapper of the divider component\n * @part divider-dash-start - The dash start wrapper of the divider component\n * @part divider-dash-end - The dash end wrapper of the divider component\n *\n * @cssprop --bq-steps--divider-color - Divider color\n * @cssprop --bq-steps--gap - Gap between steps\n */\n@Component({\n tag: 'bq-steps',\n styleUrl: './scss/bq-steps.scss',\n shadow: true,\n})\nexport class BqSteps {\n // Own Properties\n // ====================\n\n private stepElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqStepsElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** The color of the line that connects the steps. It should be a valid declarative color token. */\n @Prop({ reflect: true }) dividerColor: string = 'stroke--primary';\n\n /** The size of the steps */\n @Prop({ reflect: true }) size: TStepsSize = 'medium';\n\n /** The type of prefix element to use on the step items */\n @Prop({ reflect: true }) type: TStepsType;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('type')\n @Watch('size')\n checkPropValues() {\n validatePropValue(STEPS_SIZE, 'medium', this.el, 'size');\n validatePropValue(STEPS_TYPE, 'numeric', this.el, 'type');\n\n this.setStepItemProps();\n }\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.setStepItemProps();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private get bqSteps(): HTMLBqStepItemElement[] {\n if (!this.stepElem) return [];\n\n const slot = this.stepElem.querySelector('slot');\n return [...slot.assignedElements({ flatten: true })].filter(\n (el: HTMLBqSideMenuItemElement) => el.tagName.toLowerCase() === 'bq-step-item',\n ) as [HTMLBqSideMenuItemElement];\n }\n\n private setStepItemProps = () => {\n this.bqSteps.forEach((bqStepElem: HTMLBqStepItemElement) => {\n bqStepElem.size = this.size;\n bqStepElem.type = this.type;\n });\n };\n\n // private handleChange = (event) => {\n // this.bqChange.emit(event);\n // }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const dividerPaddingTop = this.size === 'small' ? 'p-bs-s' : 'p-bs-m';\n\n return (\n <div\n class=\"relative flex w-full items-start justify-between\"\n ref={(div) => (this.stepElem = div)}\n part=\"container\"\n >\n <slot />\n <bq-divider\n class={`absolute -z-10 p-i-s inset-ie-0 inset-is-0 ${dividerPaddingTop}`}\n strokeColor={this.dividerColor}\n strokeThickness={2}\n exportparts=\"base:divider-base,dash-start:divider-dash-start,dash-end:divider-dash-end\"\n />\n </div>\n );\n }\n}\n"]}
|
|
@@ -2,18 +2,53 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import { h, Host } from "@stencil/core";
|
|
5
|
+
import { h, Host, } from "@stencil/core";
|
|
6
6
|
import { getTextContent, isNil } from "../../shared/utils";
|
|
7
7
|
/**
|
|
8
8
|
* Toggle switches are digital on/off switches.
|
|
9
9
|
* They should provide immediate results, giving users the freedom to control their preferences as needed.
|
|
10
10
|
*
|
|
11
|
+
* @example How to use it
|
|
12
|
+
* ```html
|
|
13
|
+
* <bq-switch inner-label="default" justify-content="start" name="bq-switch" value="Switch value">
|
|
14
|
+
* Toggle me!
|
|
15
|
+
* </bq-switch>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @documentation https://www.beeq.design/3d466e231/p/49d9c9-switch
|
|
19
|
+
* @status stable
|
|
20
|
+
*
|
|
21
|
+
* @dependency bq-icon
|
|
22
|
+
*
|
|
23
|
+
* @attr {boolean} background-on-hover - If `true`, a background will be displayed on hover
|
|
24
|
+
* @attr {boolean} checked - It indicates whether if the switch is `ON` by default (when the page loads)
|
|
25
|
+
* @attr {boolean} disabled - If `true`, the switch control will be disabled and no interaction will be allowed
|
|
26
|
+
* @attr {string} form-validation-message - The native form validation message
|
|
27
|
+
* @attr {boolean} full-width - If `true`, the component will take the full width space available on the parent container
|
|
28
|
+
* @attr {"default" | "icon"} inner-label - It indicates how to to display the on/off marks inside the control, with icons or none (default)
|
|
29
|
+
* @attr {"start" | "end" | "center" | "space-between" | "space-around" | "space-evenly"} justify-content - It defines how to distribute the space between and around the control and the label text
|
|
30
|
+
* @attr {string} name - Name of the form control. Submitted with the form as part of a name/value pair
|
|
31
|
+
* @attr {boolean} required - If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted
|
|
32
|
+
* @attr {boolean} reverse-order - If `true`, the order of the control and the label text will be changed
|
|
33
|
+
* @attr {string} value - The input control's value, submitted as a name/value pair with form data
|
|
34
|
+
*
|
|
35
|
+
* @event bqChange - Handler to be called when the switch state changes
|
|
36
|
+
* @event bqFocus - Handler to be called when the switch gets focus
|
|
37
|
+
* @event bqBlur - Handler to be called when the switch loses focus
|
|
38
|
+
*
|
|
39
|
+
* @slot - The switch label text
|
|
40
|
+
*
|
|
11
41
|
* @part base - HTML `<label>` root container
|
|
12
42
|
* @part control - HTML `<div>` element for the custom control
|
|
13
43
|
* @part dot - HTML `<div>` element that acts as changing dot
|
|
14
44
|
* @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label
|
|
15
45
|
* @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label
|
|
16
46
|
* @part label - HTML `<span>` element that holds the label text
|
|
47
|
+
*
|
|
48
|
+
* @cssprop --bq-switch--height - Switch height
|
|
49
|
+
* @cssprop --bq-switch--justify-content - Switch justify content
|
|
50
|
+
* @cssprop --bq-switch--width - Switch width
|
|
51
|
+
* @cssprop --bq-switch--dot-size - Switch dot size
|
|
17
52
|
*/
|
|
18
53
|
export class BqSwitch {
|
|
19
54
|
constructor() {
|
|
@@ -21,6 +56,7 @@ export class BqSwitch {
|
|
|
21
56
|
this.backgroundOnHover = false;
|
|
22
57
|
this.checked = false;
|
|
23
58
|
this.disabled = false;
|
|
59
|
+
this.formValidationMessage = undefined;
|
|
24
60
|
this.fullWidth = false;
|
|
25
61
|
this.innerLabel = 'default';
|
|
26
62
|
this.justifyContent = 'start';
|
|
@@ -36,9 +72,13 @@ export class BqSwitch {
|
|
|
36
72
|
prevCheckedValue;
|
|
37
73
|
// Reference to host HTML element
|
|
38
74
|
// ===================================
|
|
75
|
+
internals;
|
|
39
76
|
el;
|
|
40
77
|
// Prop lifecycle events
|
|
41
78
|
// =======================
|
|
79
|
+
handleRequiredChange() {
|
|
80
|
+
this.updateFormValidity();
|
|
81
|
+
}
|
|
42
82
|
// Events section
|
|
43
83
|
// Requires JSDocs for public API documentation
|
|
44
84
|
// ==============================================
|
|
@@ -68,6 +108,17 @@ export class BqSwitch {
|
|
|
68
108
|
this.prevCheckedValue = this.checked;
|
|
69
109
|
}
|
|
70
110
|
}
|
|
111
|
+
formAssociatedCallback() {
|
|
112
|
+
this.setFormValue(this.checked);
|
|
113
|
+
this.updateFormValidity();
|
|
114
|
+
}
|
|
115
|
+
formResetCallback() {
|
|
116
|
+
// Reset the form value and validity state
|
|
117
|
+
this.checked = false;
|
|
118
|
+
this.inputElem.removeAttribute('checked');
|
|
119
|
+
this.internals?.setFormValue(undefined);
|
|
120
|
+
this.updateFormValidity();
|
|
121
|
+
}
|
|
71
122
|
// Listeners
|
|
72
123
|
// ==============
|
|
73
124
|
// Public methods API
|
|
@@ -104,6 +155,8 @@ export class BqSwitch {
|
|
|
104
155
|
handleChange = () => {
|
|
105
156
|
this.checked = !this.checked;
|
|
106
157
|
this.inputElem.setAttribute('checked', `${this.checked}`);
|
|
158
|
+
this.setFormValue(this.checked);
|
|
159
|
+
this.updateFormValidity();
|
|
107
160
|
};
|
|
108
161
|
handleOnFocus = () => {
|
|
109
162
|
this.bqFocus.emit(this.el);
|
|
@@ -117,6 +170,27 @@ export class BqSwitch {
|
|
|
117
170
|
return;
|
|
118
171
|
this.hasLabel = !!getTextContent(slot, { recurse: true }).length;
|
|
119
172
|
};
|
|
173
|
+
setFormValue = (checked) => {
|
|
174
|
+
const value = checked ? 'on' : undefined;
|
|
175
|
+
// Set form value based on the checked state
|
|
176
|
+
// Here we also pass the state of the component (2nd argument) as the state of the form control
|
|
177
|
+
// Details: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue
|
|
178
|
+
this.internals?.setFormValue(value, `${this.checked}`);
|
|
179
|
+
};
|
|
180
|
+
updateFormValidity = () => {
|
|
181
|
+
const { formValidationMessage, internals, required, checked, inputElem } = this;
|
|
182
|
+
// Clear the validity state
|
|
183
|
+
internals?.states.clear();
|
|
184
|
+
if (!(required && !checked)) {
|
|
185
|
+
// If the switch component is not required or is checked, set the validity state to valid
|
|
186
|
+
internals?.states.add('valid');
|
|
187
|
+
internals?.setValidity({});
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// Set validity state based on the required property and checked state
|
|
191
|
+
internals?.states.add('invalid');
|
|
192
|
+
internals?.setValidity({ valueMissing: true }, formValidationMessage, inputElem);
|
|
193
|
+
};
|
|
120
194
|
// render() function
|
|
121
195
|
// Always the last one in the class.
|
|
122
196
|
// ===================================
|
|
@@ -130,15 +204,16 @@ export class BqSwitch {
|
|
|
130
204
|
'is-disabled': this.disabled,
|
|
131
205
|
'flex-row-reverse': this.reverseOrder,
|
|
132
206
|
};
|
|
133
|
-
return (h(Host, { key: '
|
|
207
|
+
return (h(Host, { key: '630f292d2c6250f3e66209ec100d8f2f987f97f0', class: { 'full-width': this.fullWidth }, style: hostStyle }, h("label", { key: '82377b1b05bc43dc6df06b6fe127e09408e4744c', class: { 'bq-switch group': true, ...labelCssClasses }, part: "base" }, h("input", { key: '65c9f73951a1db95cb684111421e2755f5c92fba', class: "bq-switch--input peer sr-only !bs-[--bq-switch--dot-size] !is-[--bq-switch--width] peer-checked:invisible", type: "checkbox", checked: this.checked, disabled: this.disabled, required: this.required, name: !isNil(this.name) ? this.name : undefined, "aria-label": this.name, "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', onBlur: this.handleOnBlur, onChange: this.handleChange, onFocus: this.handleOnFocus, ref: (input) => (this.inputElem = input), role: "switch", value: this.value }), h("div", { key: 'ddc5c4b1c1d787597cf0157cd529d88ddda8ea20', class: "bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand", part: "control" }, this.innerLabel === 'icon' && (h("bq-icon", { key: 'baa7ceab4bc243d5e34943ee9f95cb3f74ceca1f', class: "bq-switch--control__icon on", name: "check", color: "icon--alt", role: "img", title: "On", part: "icon-on" })), this.innerLabel === 'icon' && (h("bq-icon", { key: 'ef541c5fa7c51d92bcd15f4d1af84887e250e4aa', class: "bq-switch--control__icon off", name: "x", color: "icon--inverse", role: "img", title: "Off", part: "icon-off" })), h("div", { key: '8d682574ee3eaeb6f93fb08a4c8a170b2e92e924', class: "bq-switch--control__dot", part: "dot" })), h("span", { key: '3c5ca5f5c30d54a4aee643769364b9d9b6b9fd17', class: {
|
|
134
208
|
'bq-switch--label text-m font-medium leading-regular text-primary transition-colors duration-300': true,
|
|
135
209
|
'ms-s': this.hasLabel && !this.reverseOrder,
|
|
136
210
|
'me-s': this.hasLabel && this.reverseOrder,
|
|
137
|
-
}, ref: (span) => (this.labelElem = span), part: "label" }, h("slot", { key: '
|
|
211
|
+
}, ref: (span) => (this.labelElem = span), part: "label" }, h("slot", { key: '85aed39ed5e1736a553297168999dc6c8eb72fd9', onSlotchange: this.handleSlotChange })))));
|
|
138
212
|
}
|
|
139
213
|
static get is() { return "bq-switch"; }
|
|
140
214
|
static get encapsulation() { return "shadow"; }
|
|
141
215
|
static get delegatesFocus() { return true; }
|
|
216
|
+
static get formAssociated() { return true; }
|
|
142
217
|
static get originalStyleUrls() {
|
|
143
218
|
return {
|
|
144
219
|
"$": ["./scss/bq-switch.scss"]
|
|
@@ -165,6 +240,8 @@ export class BqSwitch {
|
|
|
165
240
|
"tags": [],
|
|
166
241
|
"text": "If true, a background will be displayed on hover"
|
|
167
242
|
},
|
|
243
|
+
"getter": false,
|
|
244
|
+
"setter": false,
|
|
168
245
|
"attribute": "background-on-hover",
|
|
169
246
|
"reflect": true,
|
|
170
247
|
"defaultValue": "false"
|
|
@@ -183,6 +260,8 @@ export class BqSwitch {
|
|
|
183
260
|
"tags": [],
|
|
184
261
|
"text": "It indicates whether if the switch is `ON` by default (when the page loads)"
|
|
185
262
|
},
|
|
263
|
+
"getter": false,
|
|
264
|
+
"setter": false,
|
|
186
265
|
"attribute": "checked",
|
|
187
266
|
"reflect": true,
|
|
188
267
|
"defaultValue": "false"
|
|
@@ -201,10 +280,31 @@ export class BqSwitch {
|
|
|
201
280
|
"tags": [],
|
|
202
281
|
"text": "If true, the switch control will be disabled and no interaction will be allowed"
|
|
203
282
|
},
|
|
283
|
+
"getter": false,
|
|
284
|
+
"setter": false,
|
|
204
285
|
"attribute": "disabled",
|
|
205
286
|
"reflect": true,
|
|
206
287
|
"defaultValue": "false"
|
|
207
288
|
},
|
|
289
|
+
"formValidationMessage": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"mutable": true,
|
|
292
|
+
"complexType": {
|
|
293
|
+
"original": "string",
|
|
294
|
+
"resolved": "string",
|
|
295
|
+
"references": {}
|
|
296
|
+
},
|
|
297
|
+
"required": false,
|
|
298
|
+
"optional": true,
|
|
299
|
+
"docs": {
|
|
300
|
+
"tags": [],
|
|
301
|
+
"text": "The native form validation message"
|
|
302
|
+
},
|
|
303
|
+
"getter": false,
|
|
304
|
+
"setter": false,
|
|
305
|
+
"attribute": "form-validation-message",
|
|
306
|
+
"reflect": false
|
|
307
|
+
},
|
|
208
308
|
"fullWidth": {
|
|
209
309
|
"type": "boolean",
|
|
210
310
|
"mutable": false,
|
|
@@ -219,6 +319,8 @@ export class BqSwitch {
|
|
|
219
319
|
"tags": [],
|
|
220
320
|
"text": "If true, the component will take the full width space available on the parent container"
|
|
221
321
|
},
|
|
322
|
+
"getter": false,
|
|
323
|
+
"setter": false,
|
|
222
324
|
"attribute": "full-width",
|
|
223
325
|
"reflect": true,
|
|
224
326
|
"defaultValue": "false"
|
|
@@ -243,6 +345,8 @@ export class BqSwitch {
|
|
|
243
345
|
"tags": [],
|
|
244
346
|
"text": "It indicates how to to display the on/off marks inside the control, with icons or none (default)"
|
|
245
347
|
},
|
|
348
|
+
"getter": false,
|
|
349
|
+
"setter": false,
|
|
246
350
|
"attribute": "inner-label",
|
|
247
351
|
"reflect": true,
|
|
248
352
|
"defaultValue": "'default'"
|
|
@@ -267,6 +371,8 @@ export class BqSwitch {
|
|
|
267
371
|
"tags": [],
|
|
268
372
|
"text": "It defines how to distribute the space between and around the control and the label text\n(https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)"
|
|
269
373
|
},
|
|
374
|
+
"getter": false,
|
|
375
|
+
"setter": false,
|
|
270
376
|
"attribute": "justify-content",
|
|
271
377
|
"reflect": true,
|
|
272
378
|
"defaultValue": "'start'"
|
|
@@ -285,6 +391,8 @@ export class BqSwitch {
|
|
|
285
391
|
"tags": [],
|
|
286
392
|
"text": "Name of the form control. Submitted with the form as part of a name/value pair"
|
|
287
393
|
},
|
|
394
|
+
"getter": false,
|
|
395
|
+
"setter": false,
|
|
288
396
|
"attribute": "name",
|
|
289
397
|
"reflect": true
|
|
290
398
|
},
|
|
@@ -302,6 +410,8 @@ export class BqSwitch {
|
|
|
302
410
|
"tags": [],
|
|
303
411
|
"text": "If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted"
|
|
304
412
|
},
|
|
413
|
+
"getter": false,
|
|
414
|
+
"setter": false,
|
|
305
415
|
"attribute": "required",
|
|
306
416
|
"reflect": true,
|
|
307
417
|
"defaultValue": "false"
|
|
@@ -320,6 +430,8 @@ export class BqSwitch {
|
|
|
320
430
|
"tags": [],
|
|
321
431
|
"text": "If true, the order of the control and the label text will be changed"
|
|
322
432
|
},
|
|
433
|
+
"getter": false,
|
|
434
|
+
"setter": false,
|
|
323
435
|
"attribute": "reverse-order",
|
|
324
436
|
"reflect": true,
|
|
325
437
|
"defaultValue": "false"
|
|
@@ -338,6 +450,8 @@ export class BqSwitch {
|
|
|
338
450
|
"tags": [],
|
|
339
451
|
"text": "The input control's value, submitted as a name/value pair with form data."
|
|
340
452
|
},
|
|
453
|
+
"getter": false,
|
|
454
|
+
"setter": false,
|
|
341
455
|
"attribute": "value",
|
|
342
456
|
"reflect": true
|
|
343
457
|
}
|
|
@@ -462,5 +576,12 @@ export class BqSwitch {
|
|
|
462
576
|
};
|
|
463
577
|
}
|
|
464
578
|
static get elementRef() { return "el"; }
|
|
579
|
+
static get watchers() {
|
|
580
|
+
return [{
|
|
581
|
+
"propName": "required",
|
|
582
|
+
"methodName": "handleRequiredChange"
|
|
583
|
+
}];
|
|
584
|
+
}
|
|
585
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
465
586
|
}
|
|
466
587
|
//# sourceMappingURL=bq-switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-switch.js","sourceRoot":"","sources":["../../../../../../src/components/switch/bq-switch.t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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-primary transition-colors duration-300': true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-switch.js","sourceRoot":"","sources":["../../../../../../src/components/switch/bq-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AASH,MAAM,OAAO,QAAQ;;wBAkBC,KAAK;iCAM8B,KAAK;uBAGA,KAAK;wBAGnB,KAAK;;yBAMJ,KAAK;0BAGM,SAAS;8BAMD,OAAO;;wBAM3B,KAAK;4BAGD,KAAK;;;IArDvD,iBAAiB;IACjB,uBAAuB;IAEf,SAAS,CAAkB;IAC3B,SAAS,CAAmB;IAC5B,gBAAgB,CAAU;IAElC,iCAAiC;IACjC,sCAAsC;IAEnB,SAAS,CAAoB;IACrC,EAAE,CAAuB;IA+CpC,wBAAwB;IACxB,0BAA0B;IAG1B,oBAAoB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pC,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,KAAK,EACX,IAAI,EAAC,UAAU,GACf,CACH;oBAED,4DAAK,KAAK,EAAC,yBAAyB,EAAC,IAAI,EAAC,KAAK,GAAG,CAC9C;gBAEN,6DACE,KAAK,EAAE;wBACL,iGAAiG,EAAE,IAAI;wBACvG,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY;wBAC3C,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY;qBAC3C,EACD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EACtC,IAAI,EAAC,OAAO;oBAEZ,6DAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACxC,CACD,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { TSwitchInnerLabel, TSwitchJustifyContent } from './bq-switch.types';\nimport { getTextContent, isNil } from '../../shared/utils';\n\n/**\n * Toggle switches are digital on/off switches.\n * They should provide immediate results, giving users the freedom to control their preferences as needed.\n *\n * @example How to use it\n * ```html\n * <bq-switch inner-label=\"default\" justify-content=\"start\" name=\"bq-switch\" value=\"Switch value\">\n * Toggle me!\n * </bq-switch>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/49d9c9-switch\n * @status stable\n *\n * @dependency bq-icon\n *\n * @attr {boolean} background-on-hover - If `true`, a background will be displayed on hover\n * @attr {boolean} checked - It indicates whether if the switch is `ON` by default (when the page loads)\n * @attr {boolean} disabled - If `true`, the switch control will be disabled and no interaction will be allowed\n * @attr {string} form-validation-message - The native form validation message\n * @attr {boolean} full-width - If `true`, the component will take the full width space available on the parent container\n * @attr {\"default\" | \"icon\"} inner-label - It indicates how to to display the on/off marks inside the control, with icons or none (default)\n * @attr {\"start\" | \"end\" | \"center\" | \"space-between\" | \"space-around\" | \"space-evenly\"} justify-content - It defines how to distribute the space between and around the control and the label text\n * @attr {string} name - Name of the 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 switch `ON` the element before the owning form can be submitted\n * @attr {boolean} reverse-order - If `true`, the order of the control and the label text will be changed\n * @attr {string} value - The input control's value, submitted as a name/value pair with form data\n *\n * @event bqChange - Handler to be called when the switch state changes\n * @event bqFocus - Handler to be called when the switch gets focus\n * @event bqBlur - Handler to be called when the switch loses focus\n *\n * @slot - The switch label text\n *\n * @part base - HTML `<label>` root container\n * @part control - HTML `<div>` element for the custom control\n * @part dot - HTML `<div>` element that acts as changing dot\n * @part icon-off - HTMLBqIcon `<pk-icon>` element used as the `OFF` mark inner label\n * @part icon-on - HTMLBqIcon `<pk-icon>` element used as the `ON` mark inner label\n * @part label - HTML `<span>` element that holds the label text\n *\n * @cssprop --bq-switch--height - Switch height\n * @cssprop --bq-switch--justify-content - Switch justify content\n * @cssprop --bq-switch--width - Switch width\n * @cssprop --bq-switch--dot-size - Switch dot size\n */\n@Component({\n tag: 'bq-switch',\n styleUrl: './scss/bq-switch.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqSwitch {\n // Own Properties\n // ====================\n\n private labelElem: HTMLSpanElement;\n private inputElem: HTMLInputElement;\n private prevCheckedValue: boolean;\n\n // Reference to host HTML element\n // ===================================\n\n @AttachInternals() internals!: ElementInternals;\n @Element() el!: HTMLBqSwitchElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasLabel = false;\n\n // Public Property API\n // ========================\n\n /** If true, a background will be displayed on hover */\n @Prop({ reflect: true }) backgroundOnHover?: boolean = false;\n\n /** It indicates whether if the switch is `ON` by default (when the page loads) */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n\n /** If true, the switch control will be disabled and no interaction will be allowed */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** The native form validation message */\n @Prop({ mutable: true }) formValidationMessage?: string;\n\n /** If true, the component will take the full width space available on the parent container */\n @Prop({ reflect: true }) fullWidth?: boolean = false;\n\n /** It indicates how to to display the on/off marks inside the control, with icons or none (default) */\n @Prop({ reflect: true }) innerLabel?: TSwitchInnerLabel = 'default';\n\n /**\n * It defines how to distribute the space between and around the control and the label text\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)\n */\n @Prop({ reflect: true }) justifyContent?: TSwitchJustifyContent = 'start';\n\n /** Name of the form control. Submitted with the form as part of a name/value pair */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, it will indicate that the user must switch `ON` the element before the owning form can be submitted */\n @Prop({ reflect: true }) required?: boolean = false;\n\n /** If true, the order of the control and the label text will be changed */\n @Prop({ reflect: true }) reverseOrder?: boolean = false;\n\n /** The input control's value, submitted as a name/value pair with form data. */\n @Prop({ reflect: true }) value?: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('required')\n handleRequiredChange() {\n this.updateFormValidity();\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the switch state changes */\n @Event() bqChange: EventEmitter<{ checked: boolean }>;\n\n /** Handler to be called when the switch gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqSwitchElement>;\n\n /** Handler to be called when the switch loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqSwitchElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.prevCheckedValue = this.checked;\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n }\n\n componentDidUpdate() {\n /**\n * We need to trigger the `bqChange` immediately after the first update happens\n * so the checked attribute get applied, otherwise, a delay will happen\n * between the event emits and when the checked attribute value gets reflected in the element host.\n */\n if (this.checked !== this.prevCheckedValue) {\n this.bqChange.emit({ checked: this.checked });\n this.prevCheckedValue = this.checked;\n }\n }\n\n formAssociatedCallback() {\n this.setFormValue(this.checked);\n this.updateFormValidity();\n }\n\n formResetCallback() {\n // Reset the form value and validity state\n this.checked = false;\n this.inputElem.removeAttribute('checked');\n this.internals?.setFormValue(undefined);\n this.updateFormValidity();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Simulate a click event on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.inputElem?.click();\n }\n\n /**\n * Sets focus on the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.inputElem?.focus();\n }\n\n /**\n * Remove focus from the native `<input>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.inputElem?.blur();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleChange = () => {\n this.checked = !this.checked;\n this.inputElem.setAttribute('checked', `${this.checked}`);\n this.setFormValue(this.checked);\n this.updateFormValidity();\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleSlotChange = () => {\n const slot = this.labelElem?.querySelector('slot') ?? null;\n if (isNil(slot)) return;\n\n this.hasLabel = !!getTextContent(slot, { recurse: true }).length;\n };\n\n private setFormValue = (checked: boolean) => {\n const value = checked ? 'on' : undefined;\n // Set form value based on the checked state\n // Here we also pass the state of the component (2nd argument) as the state of the form control\n // Details: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue\n this.internals?.setFormValue(value, `${this.checked}`);\n };\n\n private updateFormValidity = () => {\n const { formValidationMessage, internals, required, checked, inputElem } = this;\n // Clear the validity state\n internals?.states.clear();\n\n if (!(required && !checked)) {\n // If the switch component 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 // Set validity state based on the required property and checked state\n internals?.states.add('invalid');\n internals?.setValidity({ valueMissing: true }, formValidationMessage, inputElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const hostStyle = {\n ...(this.justifyContent && { '--bq-switch--justify-content': this.justifyContent }),\n };\n\n const labelCssClasses = {\n 'has-background': this.backgroundOnHover,\n 'is-checked': this.checked,\n 'is-disabled': this.disabled,\n 'flex-row-reverse': this.reverseOrder,\n };\n\n return (\n <Host class={{ 'full-width': this.fullWidth }} style={hostStyle}>\n <label class={{ 'bq-switch group': true, ...labelCssClasses }} part=\"base\">\n {/* Hidden native HTML input */}\n <input\n class=\"bq-switch--input peer sr-only !bs-[--bq-switch--dot-size] !is-[--bq-switch--width] peer-checked:invisible\"\n type=\"checkbox\"\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n name={!isNil(this.name) ? this.name : undefined}\n aria-label={this.name}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n onBlur={this.handleOnBlur}\n onChange={this.handleChange}\n onFocus={this.handleOnFocus}\n ref={(input) => (this.inputElem = input)}\n role=\"switch\"\n value={this.value}\n />\n {/* Control */}\n <div\n class=\"bq-switch--control relative box-border flex justify-between rounded-full bg-ui-tertiary transition duration-300 bs-[--bq-switch--height] is-[--bq-switch--width] p-b-xs2 p-i-xs2 group-[&.is-checked]:bg-ui-brand\"\n part=\"control\"\n >\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon on\"\n name=\"check\"\n color=\"icon--alt\"\n role=\"img\"\n title=\"On\"\n part=\"icon-on\"\n />\n )}\n {this.innerLabel === 'icon' && (\n <bq-icon\n class=\"bq-switch--control__icon off\"\n name=\"x\"\n color=\"icon--inverse\"\n role=\"img\"\n title=\"Off\"\n part=\"icon-off\"\n />\n )}\n {/* Dot */}\n <div class=\"bq-switch--control__dot\" part=\"dot\" />\n </div>\n {/* Label */}\n <span\n class={{\n 'bq-switch--label text-m font-medium leading-regular text-primary transition-colors duration-300': true,\n 'ms-s': this.hasLabel && !this.reverseOrder,\n 'me-s': this.hasLabel && this.reverseOrder,\n }}\n ref={(span) => (this.labelElem = span)}\n part=\"label\"\n >\n <slot onSlotchange={this.handleSlotChange} />\n </span>\n </label>\n </Host>\n );\n }\n}\n"]}
|