@beeq/core 1.8.1 → 1.8.3-beta.0
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-00702295.entry.js → p-0f9ecc0c.entry.js} +2 -2
- package/dist/beeq/p-0f9ecc0c.entry.js.map +1 -0
- package/dist/beeq/{p-0cab9a82.entry.js → p-1499deaf.entry.js} +2 -2
- package/dist/beeq/p-1499deaf.entry.js.map +1 -0
- package/dist/beeq/{p-b83f174c.entry.js → p-15bf8ffd.entry.js} +2 -2
- package/dist/beeq/{p-b83f174c.entry.js.map → p-15bf8ffd.entry.js.map} +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/beeq/{p-cb3b24e6.entry.js → p-2c4cdf27.entry.js} +2 -2
- package/dist/beeq/p-2c4cdf27.entry.js.map +1 -0
- 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-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-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-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-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/beeq.html-custom-data.json +208 -208
- 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 +24 -11
- 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 +102 -48
- 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/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 +98 -46
- 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 +72 -32
- 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 +3113 -3113
- 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 +24 -11
- 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 +102 -48
- 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 +2358 -1518
- package/dist/hydrate/index.mjs +2358 -1518
- 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/dist/types/components/date-picker/bq-date-picker.d.ts +2 -2
- 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
- /package/dist/types/{home/runner/work/BEEQ/BEEQ → Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System}/packages/beeq/.stencil/packages/beeq/stencil.config.d.ts +0 -0
- /package/dist/types/{home/runner/work/BEEQ/BEEQ → Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System}/packages/beeq/.stencil/tailwind.config.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
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;0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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"]}
|
|
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,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3C,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"]}
|
|
@@ -55,17 +55,6 @@ import { hasSlotContent, validatePropValue } from "../../shared/utils";
|
|
|
55
55
|
* @cssprop --bq-tab--padding-vertical-small - Vertical padding for small tab
|
|
56
56
|
*/
|
|
57
57
|
export class BqTab {
|
|
58
|
-
constructor() {
|
|
59
|
-
this.tabIndex = null;
|
|
60
|
-
this.hasIcon = false;
|
|
61
|
-
this.active = undefined;
|
|
62
|
-
this.controls = undefined;
|
|
63
|
-
this.disabled = false;
|
|
64
|
-
this.orientation = 'horizontal';
|
|
65
|
-
this.placement = 'start';
|
|
66
|
-
this.size = 'medium';
|
|
67
|
-
this.tabId = undefined;
|
|
68
|
-
}
|
|
69
58
|
// Own Properties
|
|
70
59
|
// ====================
|
|
71
60
|
buttonElement;
|
|
@@ -73,6 +62,27 @@ export class BqTab {
|
|
|
73
62
|
// Reference to host HTML element
|
|
74
63
|
// ===================================
|
|
75
64
|
el;
|
|
65
|
+
// State() variables
|
|
66
|
+
// Inlined decorator, alphabetical order
|
|
67
|
+
// =======================================
|
|
68
|
+
tabIndex = null;
|
|
69
|
+
hasIcon = false;
|
|
70
|
+
// Public Property API
|
|
71
|
+
// ========================
|
|
72
|
+
/** If true tab is active */
|
|
73
|
+
active;
|
|
74
|
+
/** The tab panel id that the tab controls */
|
|
75
|
+
controls;
|
|
76
|
+
/** If true tab is disabled */
|
|
77
|
+
disabled = false;
|
|
78
|
+
/** The direction that tab should be render */
|
|
79
|
+
orientation = 'horizontal';
|
|
80
|
+
/** The placement that tab should be render */
|
|
81
|
+
placement = 'start';
|
|
82
|
+
/** The size of the tab */
|
|
83
|
+
size = 'medium';
|
|
84
|
+
/** The id of the tab */
|
|
85
|
+
tabId;
|
|
76
86
|
// Prop lifecycle events
|
|
77
87
|
// =======================
|
|
78
88
|
checkPropValues() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-tab.js","sourceRoot":"","sources":["../../../../../../src/components/tab/bq-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAA4C,MAAM,gBAAgB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAMH,MAAM,OAAO,KAAK;;wBAgBmB,IAAI;uBACX,KAAK;;;wBAYG,KAAK;2BAGgB,YAAY;yBAGhB,OAAO;oBAGlB,QAAQ;;;IArClD,iBAAiB;IACjB,uBAAuB;IAEf,aAAa,CAAoB;IACjC,WAAW,CAAkB;IAErC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAoB;IAiCjC,wBAAwB;IACxB,0BAA0B;IAK1B,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzE,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EA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C,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAChC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,MAAM;YAEX,4DAAK,KAAK,EAAC,kCAAkC,EAAC,IAAI,EAAC,SAAS;gBAC1D,4DAAK,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,CAAC,IAAqB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,IAAI,EAAC,MAAM;oBACtF,6DAAM,IAAI,EAAC,MAAM,EAAC,YAAY,EAAE,IAAI,CAAC,oBAAoB,GAAI,CACzD;gBACN,4DAAK,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAC,MAAM;oBAC9F,8DAAQ,CACJ,CACF,CACC,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * The tab is a user interface element that allows users to navigate between different sections of a page.\n * It should be used inside `<bq-tab-group>` component.\n *\n * @example How to use it\n * ```html\n * <bq-tab tab-id=\"1\" controls=\"panel-1\">Tab 1</bq-tab>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/775321-tabs\n * @status stable\n *\n * @attr {boolean} active - If `true` tab is active\n * @attr {string} controls - The tab panel id that the tab controls\n * @attr {boolean} disabled - If `true` tab is disabled\n * @attr {string} orientation - The direction that tab should be render\n * @attr {string} placement - The placement that tab should be render\n * @attr {string} size - The size of the tab\n * @attr {string} tab-id - The id of the tab\n *\n * @event bqClick - Handler to be called when the tab state changes\n * @event bqFocus - Handler to be called when the tab gets focus\n * @event bqBlur - Handler to be called when the tab loses focus\n * @event bqKeyDown - Handler to be called when the tab key is pressed\n *\n * @method vClick - Simulate a click event on the native `<button>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<button>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<button>` HTML element used under the hood\n *\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n *\n * @cssprop --bq-tab--font-size - Font size\n * @cssprop --bq-tab--font-weight - Font weight\n * @cssprop --bq-tab--icon-size-large - Icon size for large tab\n * @cssprop --bq-tab--icon-size-medium - Icon size for medium tab\n * @cssprop --bq-tab--icon-size-small - Icon size for small tab\n * @cssprop --bq-tab--label-icon-gap - Gap between label and icon\n * @cssprop --bq-tab--line-height - Line height\n * @cssprop --bq-tab--padding-horizontal-large - Horizontal padding for large tab\n * @cssprop --bq-tab--padding-horizontal-medium - Horizontal padding for medium tab\n * @cssprop --bq-tab--padding-horizontal-small - Horizontal padding for small tab\n * @cssprop --bq-tab--padding-vertical-large - Vertical padding for large tab\n * @cssprop --bq-tab--padding-vertical-medium - Vertical padding for medium tab\n * @cssprop --bq-tab--padding-vertical-small - Vertical padding for small tab\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n /**\n * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * @internal Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-brand': this.active,\n 'text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-tab.js","sourceRoot":"","sources":["../../../../../../src/components/tab/bq-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAA4C,MAAM,gBAAgB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAMH,MAAM,OAAO,KAAK;IAChB,iBAAiB;IACjB,uBAAuB;IAEf,aAAa,CAAoB;IACjC,WAAW,CAAkB;IAErC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAoB;IAEjC,oBAAoB;IACpB,wCAAwC;IACxC,0CAA0C;IAEjC,QAAQ,GAAkB,IAAI,CAAC;IAC/B,OAAO,GAAY,KAAK,CAAC;IAElC,sBAAsB;IACtB,2BAA2B;IAE3B,4BAA4B;IACY,MAAM,CAAW;IAEzD,6CAA6C;IACpB,QAAQ,CAAU;IAE3C,8BAA8B;IACL,QAAQ,GAAG,KAAK,CAAC;IAE1C,8CAA8C;IACrB,WAAW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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, TTabOrientation, TTabPlacement, TTabSize } from './bq-tab.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * The tab is a user interface element that allows users to navigate between different sections of a page.\n * It should be used inside `<bq-tab-group>` component.\n *\n * @example How to use it\n * ```html\n * <bq-tab tab-id=\"1\" controls=\"panel-1\">Tab 1</bq-tab>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/775321-tabs\n * @status stable\n *\n * @attr {boolean} active - If `true` tab is active\n * @attr {string} controls - The tab panel id that the tab controls\n * @attr {boolean} disabled - If `true` tab is disabled\n * @attr {string} orientation - The direction that tab should be render\n * @attr {string} placement - The placement that tab should be render\n * @attr {string} size - The size of the tab\n * @attr {string} tab-id - The id of the tab\n *\n * @event bqClick - Handler to be called when the tab state changes\n * @event bqFocus - Handler to be called when the tab gets focus\n * @event bqBlur - Handler to be called when the tab loses focus\n * @event bqKeyDown - Handler to be called when the tab key is pressed\n *\n * @method vClick - Simulate a click event on the native `<button>` HTML element used under the hood\n * @method vFocus - Sets focus on the native `<button>` HTML element used under the hood\n * @method vBlur - Remove focus from the native `<button>` HTML element used under the hood\n *\n * @part base - The HTML button used under the hood.\n * @part content - The HTML `<div>` element that holds the content.\n * @part icon - The HTML `<div>` element that holds the icon content.\n * @part text - The HTML `<div>` element that holds the text content.\n * @part underline - The HTML `<div>` element that display active state.\n *\n * @cssprop --bq-tab--font-size - Font size\n * @cssprop --bq-tab--font-weight - Font weight\n * @cssprop --bq-tab--icon-size-large - Icon size for large tab\n * @cssprop --bq-tab--icon-size-medium - Icon size for medium tab\n * @cssprop --bq-tab--icon-size-small - Icon size for small tab\n * @cssprop --bq-tab--label-icon-gap - Gap between label and icon\n * @cssprop --bq-tab--line-height - Line height\n * @cssprop --bq-tab--padding-horizontal-large - Horizontal padding for large tab\n * @cssprop --bq-tab--padding-horizontal-medium - Horizontal padding for medium tab\n * @cssprop --bq-tab--padding-horizontal-small - Horizontal padding for small tab\n * @cssprop --bq-tab--padding-vertical-large - Vertical padding for large tab\n * @cssprop --bq-tab--padding-vertical-medium - Vertical padding for medium tab\n * @cssprop --bq-tab--padding-vertical-small - Vertical padding for small tab\n */\n@Component({\n tag: 'bq-tab',\n styleUrl: './scss/bq-tab.scss',\n shadow: true,\n})\nexport class BqTab {\n // Own Properties\n // ====================\n\n private buttonElement: HTMLButtonElement;\n private iconElement: HTMLSpanElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() tabIndex: number | null = null;\n @State() hasIcon: boolean = false;\n\n // Public Property API\n // ========================\n\n /** If true tab is active */\n @Prop({ reflect: true, mutable: true }) active?: boolean;\n\n /** The tab panel id that the tab controls */\n @Prop({ reflect: true }) controls!: string;\n\n /** If true tab is disabled */\n @Prop({ reflect: true }) disabled = false;\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** The id of the tab */\n @Prop({ reflect: true }) tabId!: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab state changes */\n @Event() bqClick: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab gets focus */\n @Event() bqFocus: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTabElement>;\n\n /** Handler to be called when the tab key is pressed */\n @Event() bqKeyDown: EventEmitter<KeyboardEvent>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n /**\n * Simulate a click event on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.click()`.\n */\n @Method()\n async vClick() {\n this.buttonElement?.click();\n }\n\n /**\n * Sets focus on the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.focus()`.\n */\n @Method()\n async vFocus() {\n this.buttonElement?.focus();\n }\n\n /**\n * Remove focus from the native `<button>` HTML element used under the hood.\n * Use this method instead of the global `element.blur()`.\n */\n @Method()\n async vBlur() {\n this.buttonElement?.blur();\n }\n\n /**\n * @internal Sets tabindex on the native `<button>` HTML element used under the hood.\n * This method is used inside `<bq-tab-group>` to make tab focusable after the active one is focused\n */\n @Method()\n async enableFocus(value: boolean) {\n this.tabIndex = value ? 0 : null;\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleClick = () => {\n this.active = true;\n this.bqClick.emit(this.el);\n };\n\n private handleOnFocus = () => {\n this.bqFocus.emit(this.el);\n };\n\n private handleOnBlur = () => {\n this.bqBlur.emit(this.el);\n };\n\n private handleOnKeyDown = (event: KeyboardEvent) => {\n this.bqKeyDown.emit(event);\n };\n\n private handleIconSlotChange = () => {\n this.hasIcon = hasSlotContent(this.iconElement, 'icon');\n };\n\n private get tabindex(): string {\n // NOTE: this.active is undefined when is not part of bq-tab-group\n return `${this.tabIndex ?? -1 + +(this.active ?? 1)}`;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <button\n ref={(el) => (this.buttonElement = el)}\n class={{\n [`bq-tab bq-tab--${this.size} bq-tab--${this.orientation}-${this.placement}`]: true,\n 'text-brand': this.active,\n 'text-primary': !this.active,\n }}\n id={this.tabId}\n onBlur={this.handleOnBlur}\n onClick={this.handleClick}\n onFocus={this.handleOnFocus}\n onKeyDown={this.handleOnKeyDown}\n disabled={this.disabled}\n role=\"tab\"\n aria-controls={this.controls}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.tabindex}\n part=\"base\"\n >\n <div class=\"flex items-center justify-center\" part=\"content\">\n <div class=\"flex\" ref={(span: HTMLSpanElement) => (this.iconElement = span)} part=\"icon\">\n <slot name=\"icon\" onSlotchange={this.handleIconSlotChange} />\n </div>\n <div class={{ 'line-clamp-1': true, 'ms-[--bq-tab--label-icon-gap]': this.hasIcon }} part=\"text\">\n <slot />\n </div>\n </div>\n </button>\n );\n }\n}\n"]}
|
|
@@ -36,20 +36,29 @@ import { TAB_ORIENTATION, TAB_PLACEMENT, TAB_SIZE, } from "../tab/bq-tab.types";
|
|
|
36
36
|
* @part tabs - The HTML div used to hold the tab buttons.
|
|
37
37
|
*/
|
|
38
38
|
export class BqTabGroup {
|
|
39
|
-
constructor() {
|
|
40
|
-
this.debounceTime = 0;
|
|
41
|
-
this.disableDivider = false;
|
|
42
|
-
this.orientation = 'horizontal';
|
|
43
|
-
this.placement = 'start';
|
|
44
|
-
this.size = 'medium';
|
|
45
|
-
this.value = undefined;
|
|
46
|
-
}
|
|
47
39
|
// Own Properties
|
|
48
40
|
// ====================
|
|
49
41
|
debouncedBqChange;
|
|
50
42
|
// Reference to host HTML element
|
|
51
43
|
// ===================================
|
|
52
44
|
el;
|
|
45
|
+
// State() variables
|
|
46
|
+
// Inlined decorator, alphabetical order
|
|
47
|
+
// =======================================
|
|
48
|
+
// Public Property API
|
|
49
|
+
// ========================
|
|
50
|
+
/** A number representing the delay value applied to bqChange event handler */
|
|
51
|
+
debounceTime = 0;
|
|
52
|
+
/** If true, the underline divider below the tabs won't be shown */
|
|
53
|
+
disableDivider = false;
|
|
54
|
+
/** The direction that tab should be render */
|
|
55
|
+
orientation = 'horizontal';
|
|
56
|
+
/** The placement that tab should be render */
|
|
57
|
+
placement = 'start';
|
|
58
|
+
/** The size of the tab */
|
|
59
|
+
size = 'medium';
|
|
60
|
+
/** A string representing the id of the selected tab. */
|
|
61
|
+
value;
|
|
53
62
|
// Prop lifecycle events
|
|
54
63
|
// =======================
|
|
55
64
|
checkDebounceChange() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-tab-group.js","sourceRoot":"","sources":["../../../../../../src/components/tab-group/bq-tab-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAa,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,GAIT,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,MAAM,OAAO,UAAU;;4BAmBkC,CAAC;8BAGd,KAAK;2BAGU,YAAY;yBAGhB,OAAO;oBAGlB,QAAQ;;;IA9BlD,iBAAiB;IACjB,uBAAuB;IAEf,iBAAiB,CAAyD;IAElF,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAyB;IA2BtC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AQ,CACJ,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * The tab group is a user interface element that allows users wrap a set of tab items.\n *\n * @example How to use it\n * ```html\n * <bq-tab-group value=\"5\">\n * <bq-tab tab-id=\"1\">Tab</bq-tab>\n * <bq-tab tab-id=\"2\" active>Tab</bq-tab>\n * <bq-tab tab-id=\"3\">Long Tab name</bq-tab>\n * <bq-tab tab-id=\"4\" disabled>Tab</bq-tab>\n * </bq-tab-group>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/775321-tabs\n * @status stable\n *\n * @attr {number} debounce-time - A number representing the delay value applied to bqChange event handler\n * @attr {boolean} disable-divider - If true, the underline divider below the tabs won't be shown\n * @attr {string} orientation - The direction that tab should be render\n * @attr {string} placement - The placement that tab should be render\n * @attr {string} size - The size of the tab\n * @attr {string} value - A string representing the id of the selected tab.\n *\n * @event bqChange - Handler to be called when the tab value changes\n *\n * @slot - The bq-tab items\n *\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-tab-group.js","sourceRoot":"","sources":["../../../../../../src/components/tab-group/bq-tab-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAa,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,GAIT,MAA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,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,oBAAoB;IACpB,oCAAoC;IACpC,sCAAsC;IAEtC,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,WAAW,KAAK,UAAU,EAAE;YAC9D,4DACE,KAAK,EAAE;oBACL,CAAC,8BAA8B,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,eAAe,CAAC,EAAE,IAAI;oBACvF,YAAY,EAAE,IAAI,CAAC,cAAc;iBAClC,EACD,IAAI,EAAC,MAAM;gBAEX,4DACE,KAAK,EAAE;wBACL,8CAA8C,EAAE,IAAI;wBACpD,UAAU,EAAE,IAAI,CAAC,WAAW,KAAK,YAAY;qBAC9C,EACD,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,MAAM;oBAEX,8DAAQ,CACJ,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\nimport { debounce, getNextElement, isHTMLElement, isNil, TDebounce, validatePropValue } from '../../shared/utils';\nimport {\n TAB_ORIENTATION,\n TAB_PLACEMENT,\n TAB_SIZE,\n TTabOrientation,\n TTabPlacement,\n TTabSize,\n} from '../tab/bq-tab.types';\n\n/**\n * The tab group is a user interface element that allows users wrap a set of tab items.\n *\n * @example How to use it\n * ```html\n * <bq-tab-group value=\"5\">\n * <bq-tab tab-id=\"1\">Tab</bq-tab>\n * <bq-tab tab-id=\"2\" active>Tab</bq-tab>\n * <bq-tab tab-id=\"3\">Long Tab name</bq-tab>\n * <bq-tab tab-id=\"4\" disabled>Tab</bq-tab>\n * </bq-tab-group>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/775321-tabs\n * @status stable\n *\n * @attr {number} debounce-time - A number representing the delay value applied to bqChange event handler\n * @attr {boolean} disable-divider - If true, the underline divider below the tabs won't be shown\n * @attr {string} orientation - The direction that tab should be render\n * @attr {string} placement - The placement that tab should be render\n * @attr {string} size - The size of the tab\n * @attr {string} value - A string representing the id of the selected tab.\n *\n * @event bqChange - Handler to be called when the tab value changes\n *\n * @slot - The bq-tab items\n *\n * @part base - The HTML div wrapper inside the shadow DOM.\n * @part tabs - The HTML div used to hold the tab buttons.\n */\n@Component({\n tag: 'bq-tab-group',\n styleUrl: './scss/bq-tab-group.scss',\n shadow: true,\n})\nexport class BqTabGroup {\n // Own Properties\n // ====================\n\n private debouncedBqChange: TDebounce<{ value: string; target: HTMLBqTabElement }>;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTabGroupElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** A number representing the delay value applied to bqChange event handler */\n @Prop({ reflect: true, mutable: true }) debounceTime = 0;\n\n /** If true, the underline divider below the tabs won't be shown */\n @Prop({ reflect: true }) disableDivider = false;\n\n /** The direction that tab should be render */\n @Prop({ reflect: true }) orientation?: TTabOrientation = 'horizontal';\n\n /** The placement that tab should be render */\n @Prop({ reflect: true }) placement?: TTabPlacement = 'start';\n\n /** The size of the tab */\n @Prop({ reflect: true }) size: TTabSize = 'medium';\n\n /** A string representing the id of the selected tab. */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('debounceTime')\n checkDebounceChange() {\n if (this.debounceTime < 0) {\n this.debounceTime = Math.max(0, this.debounceTime);\n }\n\n if (this.debouncedBqChange) {\n this.debouncedBqChange.cancel();\n }\n\n this.debouncedBqChange = debounce((event: Parameters<typeof this.debouncedBqChange>[0]) => {\n this.bqChange.emit(event);\n }, this.debounceTime);\n }\n\n @Watch('size')\n @Watch('value')\n @Watch('orientation')\n @Watch('placement')\n checkPropValues() {\n validatePropValue(TAB_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAB_ORIENTATION, 'horizontal', this.el, 'orientation');\n validatePropValue(TAB_PLACEMENT, 'start', this.el, 'placement');\n\n this.bqTabElements.forEach((bqTabElement) => {\n bqTabElement.size = this.size;\n bqTabElement.orientation = this.orientation;\n bqTabElement.placement = this.placement;\n bqTabElement.active = !isNil(this.value) ? bqTabElement.tabId === this.value : false;\n });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Handler to be called when the tab value changes */\n @Event() bqChange: EventEmitter<{ target: HTMLBqTabElement; value: string }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkDebounceChange();\n this.checkPropValues();\n }\n\n componentDidLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n @Listen('keyup', { target: 'body', passive: true, capture: true })\n onKeyUp(event: KeyboardEvent) {\n const { target } = event;\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n this.makeTabsFocusable();\n }\n\n @Listen('bqClick', { passive: true })\n onBqClick(event: CustomEvent<HTMLBqTabElement>) {\n const { detail: target } = event;\n this.bqTabElements.forEach((bqTabElement) => (bqTabElement.active = bqTabElement === target));\n this.debouncedBqChange({ value: target.tabId, target });\n this.selectTab(target);\n }\n\n @Listen('bqKeyDown', { passive: true })\n async onBqKeyDown(event: CustomEvent<KeyboardEvent>) {\n const { target } = event;\n\n // NOTE: ensures the target is an HTML element with the tag name 'bq-tab'\n if (!isHTMLElement(target, 'bq-tab')) return;\n\n const keyActions: { [key: string]: 'forward' | 'backward' } = {\n ArrowDown: 'forward',\n ArrowRight: 'forward',\n ArrowUp: 'backward',\n ArrowLeft: 'backward',\n };\n\n // NOTE: gets the direction based on key pressed\n const direction = keyActions[event.detail.key];\n\n if (!direction) return;\n\n await this.focusTabSibling(target, direction);\n }\n\n @Listen('bqBlur', { capture: true, passive: true })\n onBqBlur() {\n this.restoreTabsFocus();\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private focusTabSibling = async (\n currentTarget: HTMLBqTabElement,\n direction: 'forward' | 'backward',\n ): Promise<void> => {\n let target: HTMLBqTabElement | null = null;\n\n this.bqTabElements.forEach((bqTabElement, index, elements) => {\n bqTabElement.active = false;\n\n if (bqTabElement === currentTarget) {\n target = getNextElement(elements, index, direction);\n }\n });\n\n if (target) {\n await target.vFocus();\n this.selectTab(target);\n }\n };\n\n private makeTabsFocusable = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled) return;\n\n /**\n * This is a \"fire and forget\" operation. The callback itself doesn't do anything special\n * with the asynchronous code (doesn't await it or do anything with the result)\n * Details: https://stackoverflow.com/a/63488201\n */\n (async () => {\n await bqTabElement.enableFocus(true);\n })();\n });\n };\n\n private restoreTabsFocus = (): void => {\n this.bqTabElements.forEach((bqTabElement) => {\n if (bqTabElement.disabled || bqTabElement.active) return;\n\n /** @See line #173 */\n (async () => {\n await bqTabElement.enableFocus(false);\n })();\n });\n };\n\n private get bqTabElements(): HTMLBqTabElement[] {\n return Array.from(this.el.querySelectorAll('bq-tab'));\n }\n\n private selectTab = (target: HTMLBqTabElement): void => {\n const { tabId } = target;\n target.active = true;\n this.value = tabId;\n this.debouncedBqChange({ value: tabId, target });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <Host class={{ 'inline-block': this.orientation === 'vertical' }}>\n <div\n class={{\n [`bq-tab-group bq-tab-group--${this.orientation}-${this.placement} flex is-full`]: true,\n 'no-divider': this.disableDivider,\n }}\n part=\"base\"\n >\n <div\n class={{\n 'bq-tab-group--container flex overflow-x-auto': true,\n 'flex-col': this.orientation !== 'horizontal',\n }}\n role=\"tablist\"\n part=\"tabs\"\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -62,24 +62,36 @@ import { getColorCSSVariable, hasSlotContent, validatePropValue } from "../../sh
|
|
|
62
62
|
* @cssprop --bq-tag--medium-padding-y - Tag medium padding vertical
|
|
63
63
|
*/
|
|
64
64
|
export class BqTag {
|
|
65
|
-
constructor() {
|
|
66
|
-
this.hasPrefix = false;
|
|
67
|
-
this.border = undefined;
|
|
68
|
-
this.clickable = false;
|
|
69
|
-
this.color = undefined;
|
|
70
|
-
this.disabled = false;
|
|
71
|
-
this.hidden = undefined;
|
|
72
|
-
this.removable = false;
|
|
73
|
-
this.selected = false;
|
|
74
|
-
this.size = 'medium';
|
|
75
|
-
this.variant = 'filled';
|
|
76
|
-
}
|
|
77
65
|
// Own Properties
|
|
78
66
|
// ====================
|
|
79
67
|
prefixElem;
|
|
80
68
|
// Reference to host HTML element
|
|
81
69
|
// ===================================
|
|
82
70
|
el;
|
|
71
|
+
// State() variables
|
|
72
|
+
// Inlined decorator, alphabetical order
|
|
73
|
+
// =======================================
|
|
74
|
+
hasPrefix = false;
|
|
75
|
+
// Public Property API
|
|
76
|
+
// ========================
|
|
77
|
+
/** The corner radius of the Tag (will override size's predefined border) */
|
|
78
|
+
border;
|
|
79
|
+
/** If true, the Tag can be clickable */
|
|
80
|
+
clickable = false;
|
|
81
|
+
/** The color style of the Tag */
|
|
82
|
+
color;
|
|
83
|
+
/** If true, the Tag will be disabled (only if clickable = `true`, no interaction allowed) */
|
|
84
|
+
disabled = false;
|
|
85
|
+
/** If true, the Tag component will hidden (only if removable = `true`) */
|
|
86
|
+
hidden;
|
|
87
|
+
/** If true, the Tag component can be removed */
|
|
88
|
+
removable = false;
|
|
89
|
+
/** If true, the Tag is selected (only if clickable = `true`) */
|
|
90
|
+
selected = false;
|
|
91
|
+
/** The size of the Tag component */
|
|
92
|
+
size = 'medium';
|
|
93
|
+
/** The variant of Tag to apply on top of the variant */
|
|
94
|
+
variant = 'filled';
|
|
83
95
|
// Prop lifecycle events
|
|
84
96
|
// =======================
|
|
85
97
|
checkPropValues() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-tag.js","sourceRoot":"","sources":["../../../../../../src/components/tag/bq-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAsD,MAAM,gBAAgB,CAAC;AACtH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAQH,MAAM,OAAO,KAAK;;yBAea,KAAK;;yBASY,KAAK;;wBAML,KAAK;;yBAML,KAAK;wBAGS,KAAK;oBAGvB,QAAQ;uBAGF,QAAQ;;IA5CxD,iBAAiB;IACjB,uBAAuB;IAEf,UAAU,CAAc;IAEhC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAoB;IAsCjC,wBAAwB;IACxB,0BAA0B;IAI1B,eAAe;QACb,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACvD,iBAAiB,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,iBAAiB;IACjB,+CAA+C;IAC/C,iDAAiD;IAEjD,kEAAkE;I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AC,CAAC,CAAC,CAAC,eAAe,GACjG,CACQ,CACb,CACM,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagBorderRadius, TTagColor, TTagSize, TTagVariant } from './bq-tag.types';\nimport { iconSize, textColor } from './helper';\nimport { getColorCSSVariable, hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * The Tag Component is a UI element used to label and categorize content within an application.\n * Tags are commonly used to label items with keywords or categories, making it easier to find and organize content.\n *\n * @example How to use it\n * ```html\n * <bq-tag color=\"success\" size=\"medium\" variant=\"filled\">Success</bq-tag>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/42f8c9-tag\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {string} border - The corner radius of the Tag (will override size's predefined border)\n * @attr {boolean} clickable - If `true`, the Tag can be clickable\n * @attr {\"error\" | \"gray\" | \"info\" | \"success\" | \"warning\"} color - The color style of the Tag\n * @attr {boolean} disabled - If `true`, the Tag will be disabled (only if clickable = `true`, no interaction allowed)\n * @attr {boolean} hidden - If `true`, the Tag component will hidden (only if removable = `true`)\n * @attr {boolean} removable - If `true`, the Tag component can be removed\n * @attr {boolean} selected - If `true`, the Tag is selected (only if clickable = `true`)\n * @attr {\"xsmall\" | \"small\" | \"medium\"} size - The size of the Tag component\n * @attr {\"outline\" | \"filled\"} variant - The variant of Tag to apply on top of the variant\n *\n * @method hide - Method to be called to remove the tag component\n * @method show - Method to be called to show the tag component\n *\n * @event bqClose - Callback handler to be called when the tag is close/hidden\n * @event bqOpen - Callback handler to be called when the tag is not open/shown\n * @event bqBlur - Handler to be called when tag loses focus\n * @event bqClick - Handler to be called when tag is clicked\n * @event bqFocus - Handler to be called when tag is focused\n *\n * @slot prefix - The prefix slot to add an icon or any other content before the text\n * @slot - The text content of the tag\n *\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM.\n * @part prefix - The `<span>` tag element that acts as prefix container (when icon exists in front of tag).\n * @part text - The `<div>` element containing the text of the tag component.\n * @part btn-close - The close button element to remove the tag component.\n *\n * @cssprop --bq-tag--background-color - Tag background color\n * @cssprop --bq-tag--border-color - Tag border color\n * @cssprop --bq-tag--border-radius - Tag border radius\n * @cssprop --bq-tag--border-style - Tag border style\n * @cssprop --bq-tag--border-width - Tag border width\n * @cssprop --bq-tag--small-border-radius - Tag small border radius\n * @cssprop --bq-tag--small-gap - Tag small gap between content\n * @cssprop --bq-tag--small-padding-x - Tag small padding horizontal\n * @cssprop --bq-tag--small-padding-y - Tag small padding vertical\n * @cssprop --bq-tag--medium-gap - Tag medium gap between content\n * @cssprop --bq-tag--medium-padding-x - Tag medium padding horizontal\n * @cssprop --bq-tag--medium-padding-y - Tag medium padding vertical\n */\n@Component({\n tag: 'bq-tag',\n styleUrl: './scss/bq-tag.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTag {\n // Own Properties\n // ====================\n\n private prefixElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTagElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n\n // Public Property API\n // ========================\n\n /** The corner radius of the Tag (will override size's predefined border) */\n @Prop({ reflect: true }) border: TTagBorderRadius;\n\n /** If true, the Tag can be clickable */\n @Prop({ reflect: true }) clickable: boolean = false;\n\n /** The color style of the Tag */\n @Prop({ reflect: true }) color: TTagColor;\n\n /** If true, the Tag will be disabled (only if clickable = `true`, no interaction allowed) */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the Tag component will hidden (only if removable = `true`) */\n @Prop({ reflect: true, mutable: true }) hidden: boolean;\n\n /** If true, the Tag component can be removed */\n @Prop({ reflect: true }) removable: boolean = false;\n\n /** If true, the Tag is selected (only if clickable = `true`) */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /** The size of the Tag component */\n @Prop({ reflect: true }) size: TTagSize = 'medium';\n\n /** The variant of Tag to apply on top of the variant */\n @Prop({ reflect: true }) variant: TTagVariant = 'filled';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('variant')\n checkPropValues() {\n validatePropValue(TAG_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAG_VARIANT, 'filled', this.el, 'variant');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the tag is close/hidden */\n @Event() bqClose: EventEmitter;\n\n /** Callback handler to be called when the tag is not open/shown */\n @Event() bqOpen: EventEmitter;\n\n /** Handler to be called when tag loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is clicked */\n @Event() bqClick: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is focused */\n @Event() bqFocus: EventEmitter<HTMLBqTagElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to remove the tag component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** Method to be called to show the tag component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqClose.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = true;\n }\n };\n\n private handleShow = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqOpen.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = false;\n }\n };\n\n private handleClick = () => {\n // If the tag is not clickable or the tag is disabled, we don't want to handle the click\n if (!this.isClickable || this.disabled) return;\n\n // Emit a click event on the element\n const ev = this.bqClick.emit(this.el);\n // If the event was not prevented, toggle the clickable state\n if (!ev.defaultPrevented) {\n this.selected = !this.selected;\n }\n };\n\n private handleBlur = () => {\n if (!this.isClickable) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (!this.isClickable) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private get isClickable(): boolean {\n return this.clickable && !this.color && !this.hasCustomColor && !this.removable;\n }\n\n private get isRemovable(): boolean {\n return this.removable && !this.isClickable;\n }\n\n private get isHidden(): boolean {\n return this.isRemovable && this.hidden;\n }\n\n private get hasCustomColor(): boolean {\n return this.color !== undefined ? !TAG_COLOR.includes(this.color) : false;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n '--bq-tag--icon-prefix-size': `${iconSize(this.size)}px`,\n ...(this.border && { '--bq-tag--border-radius': `var(--bq-radius--${this.border})` }),\n ...(this.color && { '--bq-tag--background-color': getColorCSSVariable(this.color) ?? this.color }),\n ...(this.hasCustomColor && { '--bq-text--primary': `var(--bq-text--alt)` }),\n };\n\n return (\n <Host style={style} aria-hidden={this.isHidden ? 'true' : 'false'} hidden={this.isHidden ? 'true' : 'false'}>\n <button\n class={{\n [`bq-tag bq-tag__${this.size}`]: true,\n [`bq-tag__${this.color || 'default'} bq-tag__${this.variant}`]: !this.hasCustomColor,\n 'is-clickable': this.isClickable,\n 'is-removable': this.removable,\n // Active/Selected state when clickable\n active: this.isClickable && this.selected,\n // Fixed border radius\n 'has-border': !!this.border,\n }}\n disabled={this.disabled}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n tabindex={this.isClickable ? 0 : -1}\n part=\"wrapper\"\n >\n <span\n class={{ 'bq-tag__prefix inline-flex': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div\n class={{\n 'text-xs': this.size === 'xsmall',\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n }}\n part=\"text\"\n >\n <slot />\n </div>\n {this.isRemovable && !this.disabled && (\n <bq-button class=\"bq-tag__close\" appearance=\"text\" size=\"small\" onClick={this.handleHide} part=\"btn-close\">\n <bq-icon\n size={iconSize(this.size)}\n name=\"x-circle\"\n color={this.color && !this.hasCustomColor ? textColor(this.color)[this.variant] : 'text--primary'}\n />\n </bq-button>\n )}\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-tag.js","sourceRoot":"","sources":["../../../../../../src/components/tag/bq-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAsD,MAAM,gBAAgB,CAAC;AACtH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,iBAAiB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\n\nimport { TAG_COLOR, TAG_SIZE, TAG_VARIANT, TTagBorderRadius, TTagColor, TTagSize, TTagVariant } from './bq-tag.types';\nimport { iconSize, textColor } from './helper';\nimport { getColorCSSVariable, hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * The Tag Component is a UI element used to label and categorize content within an application.\n * Tags are commonly used to label items with keywords or categories, making it easier to find and organize content.\n *\n * @example How to use it\n * ```html\n * <bq-tag color=\"success\" size=\"medium\" variant=\"filled\">Success</bq-tag>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/42f8c9-tag\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-icon\n *\n * @attr {string} border - The corner radius of the Tag (will override size's predefined border)\n * @attr {boolean} clickable - If `true`, the Tag can be clickable\n * @attr {\"error\" | \"gray\" | \"info\" | \"success\" | \"warning\"} color - The color style of the Tag\n * @attr {boolean} disabled - If `true`, the Tag will be disabled (only if clickable = `true`, no interaction allowed)\n * @attr {boolean} hidden - If `true`, the Tag component will hidden (only if removable = `true`)\n * @attr {boolean} removable - If `true`, the Tag component can be removed\n * @attr {boolean} selected - If `true`, the Tag is selected (only if clickable = `true`)\n * @attr {\"xsmall\" | \"small\" | \"medium\"} size - The size of the Tag component\n * @attr {\"outline\" | \"filled\"} variant - The variant of Tag to apply on top of the variant\n *\n * @method hide - Method to be called to remove the tag component\n * @method show - Method to be called to show the tag component\n *\n * @event bqClose - Callback handler to be called when the tag is close/hidden\n * @event bqOpen - Callback handler to be called when the tag is not open/shown\n * @event bqBlur - Handler to be called when tag loses focus\n * @event bqClick - Handler to be called when tag is clicked\n * @event bqFocus - Handler to be called when tag is focused\n *\n * @slot prefix - The prefix slot to add an icon or any other content before the text\n * @slot - The text content of the tag\n *\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM.\n * @part prefix - The `<span>` tag element that acts as prefix container (when icon exists in front of tag).\n * @part text - The `<div>` element containing the text of the tag component.\n * @part btn-close - The close button element to remove the tag component.\n *\n * @cssprop --bq-tag--background-color - Tag background color\n * @cssprop --bq-tag--border-color - Tag border color\n * @cssprop --bq-tag--border-radius - Tag border radius\n * @cssprop --bq-tag--border-style - Tag border style\n * @cssprop --bq-tag--border-width - Tag border width\n * @cssprop --bq-tag--small-border-radius - Tag small border radius\n * @cssprop --bq-tag--small-gap - Tag small gap between content\n * @cssprop --bq-tag--small-padding-x - Tag small padding horizontal\n * @cssprop --bq-tag--small-padding-y - Tag small padding vertical\n * @cssprop --bq-tag--medium-gap - Tag medium gap between content\n * @cssprop --bq-tag--medium-padding-x - Tag medium padding horizontal\n * @cssprop --bq-tag--medium-padding-y - Tag medium padding vertical\n */\n@Component({\n tag: 'bq-tag',\n styleUrl: './scss/bq-tag.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqTag {\n // Own Properties\n // ====================\n\n private prefixElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqTagElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasPrefix = false;\n\n // Public Property API\n // ========================\n\n /** The corner radius of the Tag (will override size's predefined border) */\n @Prop({ reflect: true }) border: TTagBorderRadius;\n\n /** If true, the Tag can be clickable */\n @Prop({ reflect: true }) clickable: boolean = false;\n\n /** The color style of the Tag */\n @Prop({ reflect: true }) color: TTagColor;\n\n /** If true, the Tag will be disabled (only if clickable = `true`, no interaction allowed) */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** If true, the Tag component will hidden (only if removable = `true`) */\n @Prop({ reflect: true, mutable: true }) hidden: boolean;\n\n /** If true, the Tag component can be removed */\n @Prop({ reflect: true }) removable: boolean = false;\n\n /** If true, the Tag is selected (only if clickable = `true`) */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /** The size of the Tag component */\n @Prop({ reflect: true }) size: TTagSize = 'medium';\n\n /** The variant of Tag to apply on top of the variant */\n @Prop({ reflect: true }) variant: TTagVariant = 'filled';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n @Watch('variant')\n checkPropValues() {\n validatePropValue(TAG_SIZE, 'medium', this.el, 'size');\n validatePropValue(TAG_VARIANT, 'filled', this.el, 'variant');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the tag is close/hidden */\n @Event() bqClose: EventEmitter;\n\n /** Callback handler to be called when the tag is not open/shown */\n @Event() bqOpen: EventEmitter;\n\n /** Handler to be called when tag loses focus */\n @Event() bqBlur: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is clicked */\n @Event() bqClick: EventEmitter<HTMLBqTagElement>;\n\n /** Handler to be called when tag is focused */\n @Event() bqFocus: EventEmitter<HTMLBqTagElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /** Method to be called to remove the tag component */\n @Method()\n async hide(): Promise<void> {\n this.handleHide();\n }\n\n /** Method to be called to show the tag component */\n @Method()\n async show(): Promise<void> {\n this.handleShow();\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleHide = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqClose.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = true;\n }\n };\n\n private handleShow = () => {\n if (!this.isRemovable) return;\n\n const ev = this.bqOpen.emit(this.el);\n if (!ev.defaultPrevented) {\n this.hidden = false;\n }\n };\n\n private handleClick = () => {\n // If the tag is not clickable or the tag is disabled, we don't want to handle the click\n if (!this.isClickable || this.disabled) return;\n\n // Emit a click event on the element\n const ev = this.bqClick.emit(this.el);\n // If the event was not prevented, toggle the clickable state\n if (!ev.defaultPrevented) {\n this.selected = !this.selected;\n }\n };\n\n private handleBlur = () => {\n if (!this.isClickable) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (!this.isClickable) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem, 'prefix');\n };\n\n private get isClickable(): boolean {\n return this.clickable && !this.color && !this.hasCustomColor && !this.removable;\n }\n\n private get isRemovable(): boolean {\n return this.removable && !this.isClickable;\n }\n\n private get isHidden(): boolean {\n return this.isRemovable && this.hidden;\n }\n\n private get hasCustomColor(): boolean {\n return this.color !== undefined ? !TAG_COLOR.includes(this.color) : false;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n '--bq-tag--icon-prefix-size': `${iconSize(this.size)}px`,\n ...(this.border && { '--bq-tag--border-radius': `var(--bq-radius--${this.border})` }),\n ...(this.color && { '--bq-tag--background-color': getColorCSSVariable(this.color) ?? this.color }),\n ...(this.hasCustomColor && { '--bq-text--primary': `var(--bq-text--alt)` }),\n };\n\n return (\n <Host style={style} aria-hidden={this.isHidden ? 'true' : 'false'} hidden={this.isHidden ? 'true' : 'false'}>\n <button\n class={{\n [`bq-tag bq-tag__${this.size}`]: true,\n [`bq-tag__${this.color || 'default'} bq-tag__${this.variant}`]: !this.hasCustomColor,\n 'is-clickable': this.isClickable,\n 'is-removable': this.removable,\n // Active/Selected state when clickable\n active: this.isClickable && this.selected,\n // Fixed border radius\n 'has-border': !!this.border,\n }}\n disabled={this.disabled}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n tabindex={this.isClickable ? 0 : -1}\n part=\"wrapper\"\n >\n <span\n class={{ 'bq-tag__prefix inline-flex': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n <div\n class={{\n 'text-xs': this.size === 'xsmall',\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n }}\n part=\"text\"\n >\n <slot />\n </div>\n {this.isRemovable && !this.disabled && (\n <bq-button class=\"bq-tag__close\" appearance=\"text\" size=\"small\" onClick={this.handleHide} part=\"btn-close\">\n <bq-icon\n size={iconSize(this.size)}\n name=\"x-circle\"\n color={this.color && !this.hasCustomColor ? textColor(this.color)[this.variant] : 'text--primary'}\n />\n </bq-button>\n )}\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -78,30 +78,6 @@ import { debounce, hasSlotContent, isHTMLElement, isNil } from "../../shared/uti
|
|
|
78
78
|
* @cssprop --bq-textarea--text-placeholder-color - Textarea placeholder text color
|
|
79
79
|
*/
|
|
80
80
|
export class BqTextarea {
|
|
81
|
-
constructor() {
|
|
82
|
-
this.hasHelperText = false;
|
|
83
|
-
this.hasLabel = false;
|
|
84
|
-
this.autocapitalize = 'off';
|
|
85
|
-
this.autocomplete = 'off';
|
|
86
|
-
this.autocorrect = 'off';
|
|
87
|
-
this.autofocus = undefined;
|
|
88
|
-
this.autoGrow = false;
|
|
89
|
-
this.debounceTime = 0;
|
|
90
|
-
this.disabled = false;
|
|
91
|
-
this.disableResize = false;
|
|
92
|
-
this.form = undefined;
|
|
93
|
-
this.formValidationMessage = undefined;
|
|
94
|
-
this.maxlength = undefined;
|
|
95
|
-
this.name = undefined;
|
|
96
|
-
this.placeholder = undefined;
|
|
97
|
-
this.readonly = false;
|
|
98
|
-
this.required = false;
|
|
99
|
-
this.rows = 5;
|
|
100
|
-
this.spellcheck = false;
|
|
101
|
-
this.validationStatus = 'none';
|
|
102
|
-
this.value = undefined;
|
|
103
|
-
this.wrap = 'soft';
|
|
104
|
-
}
|
|
105
81
|
// Own Properties
|
|
106
82
|
// ====================
|
|
107
83
|
debounceBqInput;
|
|
@@ -113,6 +89,81 @@ export class BqTextarea {
|
|
|
113
89
|
// ===================================
|
|
114
90
|
internals;
|
|
115
91
|
el;
|
|
92
|
+
// State() variables
|
|
93
|
+
// Inlined decorator, alphabetical order
|
|
94
|
+
// =======================================
|
|
95
|
+
hasHelperText = false;
|
|
96
|
+
hasLabel = false;
|
|
97
|
+
// Public Property API
|
|
98
|
+
// ========================
|
|
99
|
+
/**
|
|
100
|
+
* Controls whether or not the textarea field should be capitalized and how.
|
|
101
|
+
* Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.
|
|
102
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize
|
|
103
|
+
*/
|
|
104
|
+
autocapitalize = 'off';
|
|
105
|
+
/**
|
|
106
|
+
* Specifies whether or not the textarea field should have autocomplete enabled.
|
|
107
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
|
|
108
|
+
*/
|
|
109
|
+
autocomplete = 'off';
|
|
110
|
+
/**
|
|
111
|
+
* Controls whether or not the textarea field should have autocorrect enabled.
|
|
112
|
+
* Possible values are 'on' and 'off'.
|
|
113
|
+
*/
|
|
114
|
+
autocorrect = 'off';
|
|
115
|
+
/** If true, the textarea will be focused on component render */
|
|
116
|
+
autofocus;
|
|
117
|
+
/**
|
|
118
|
+
* If `true`, the textarea will automatically grow and shrink to fit its contents.
|
|
119
|
+
* If `false`, the textarea will have a fixed height specified by the `rows` property.
|
|
120
|
+
*/
|
|
121
|
+
autoGrow = false;
|
|
122
|
+
/**
|
|
123
|
+
* The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the textarea value changes.
|
|
124
|
+
* A value of 0 means no debouncing will occur.
|
|
125
|
+
*/
|
|
126
|
+
debounceTime = 0;
|
|
127
|
+
/** If `true`, the user cannot interact with the textarea. */
|
|
128
|
+
disabled = false;
|
|
129
|
+
/** If `true`, it will block the user's ability to resize the textarea. */
|
|
130
|
+
disableResize = false;
|
|
131
|
+
/** The ID of the form that the textarea field belongs to. */
|
|
132
|
+
form;
|
|
133
|
+
/** The native form validation message */
|
|
134
|
+
formValidationMessage;
|
|
135
|
+
/**
|
|
136
|
+
* The maximum number of characters that can be entered into the textarea (`0`: no limit).
|
|
137
|
+
* When enabled, a character counter will be shown underneath the textarea.
|
|
138
|
+
*/
|
|
139
|
+
maxlength;
|
|
140
|
+
/** The name of the textarea element. */
|
|
141
|
+
name;
|
|
142
|
+
/** The placeholder text to show when there is no value. */
|
|
143
|
+
placeholder;
|
|
144
|
+
/** If true, the textarea field cannot be modified. */
|
|
145
|
+
readonly = false;
|
|
146
|
+
/** Indicates whether or not the textarea field is required to be filled out before submitting the form. */
|
|
147
|
+
required = false;
|
|
148
|
+
/** The number of visible text lines for the control. It must be a positive integer. */
|
|
149
|
+
rows = 5;
|
|
150
|
+
/** If true, the textarea content may be checked for spelling errors. */
|
|
151
|
+
spellcheck = false;
|
|
152
|
+
/**
|
|
153
|
+
* The validation status of the textarea.
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* This property is used to indicate the validation status of the textarea. It can be set to one of the following values:
|
|
157
|
+
* - `'none'`: No validation status is set.
|
|
158
|
+
* - `'error'`: The textarea has a validation error.
|
|
159
|
+
* - `'warning'`: The textarea has a validation warning.
|
|
160
|
+
* - `'success'`: The textarea has passed validation.
|
|
161
|
+
*/
|
|
162
|
+
validationStatus = 'none';
|
|
163
|
+
/** The value of the textarea. It can be used to reset the textarea to a previous value. */
|
|
164
|
+
value;
|
|
165
|
+
/** Specifies how the text in a text area is to be wrapped when submitted in a form */
|
|
166
|
+
wrap = 'soft';
|
|
116
167
|
// Prop lifecycle events
|
|
117
168
|
// =======================
|
|
118
169
|
handleValueChange() {
|