diff --git a/packages/bee-q/src/components.d.ts b/packages/bee-q/src/components.d.ts index 16099a5c9..6897c1f96 100644 --- a/packages/bee-q/src/components.d.ts +++ b/packages/bee-q/src/components.d.ts @@ -177,6 +177,10 @@ export namespace Components { * Hides the dialog */ "close": () => Promise; + /** + * If true will not close on escape press + */ + "disableEscKeyDownClose": boolean; /** * If true will not close on outside click */ @@ -909,6 +913,10 @@ declare namespace LocalJSX { "value": string; } interface BqDialog { + /** + * If true will not close on escape press + */ + "disableEscKeyDownClose"?: boolean; /** * If true will not close on outside click */ diff --git a/packages/bee-q/src/components/dialog/_storybook/bq-dialog.stories.tsx b/packages/bee-q/src/components/dialog/_storybook/bq-dialog.stories.tsx index 66f621d59..58564d86f 100644 --- a/packages/bee-q/src/components/dialog/_storybook/bq-dialog.stories.tsx +++ b/packages/bee-q/src/components/dialog/_storybook/bq-dialog.stories.tsx @@ -19,6 +19,7 @@ const meta: Meta = { 'footer-apperance': { control: 'select', options: [...DIALOG_FOOTER_APPEARANCE] }, 'hide-close-button': { control: 'boolean' }, 'disable-outside-click-close': { control: 'boolean' }, + 'disable-esc-key-down-close': { control: 'boolean' }, }, args: { text: 'text', @@ -44,22 +45,21 @@ const Template = (args: Args) => { footer-apperance=${args['footer-apperance']} ?hide-close-button=${args['hide-close-button']} ?disable-outside-click-close=${args['disable-outside-click-close']} + ?disable-esc-key-down-close=${args['disable-esc-key-down-close']} > -
- -
+

Title

-

+

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

- + + Ghost button + + + Standard button + `; }; @@ -86,31 +86,32 @@ const ConfirmTemplate = (args: Args) => { footer-apperance=${args['footer-apperance']} ?hide-close-button=${args['hide-close-button']} ?disable-outside-click-close=${args['disable-outside-click-close']} + ?disable-esc-key-down-close=${args['disable-esc-key-down-close']} >

Lorem Ipsum ?

-

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

- +

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

+ + Disagree + + + Agree + `; }; @@ -120,5 +121,6 @@ export const Confirm: Story = { args: { 'hide-close-button': true, 'disable-outside-click-close': true, + 'disable-esc-key-down-close': true, }, }; diff --git a/packages/bee-q/src/components/dialog/bq-dialog.tsx b/packages/bee-q/src/components/dialog/bq-dialog.tsx index f314ac2bf..9c791e613 100644 --- a/packages/bee-q/src/components/dialog/bq-dialog.tsx +++ b/packages/bee-q/src/components/dialog/bq-dialog.tsx @@ -1,13 +1,18 @@ -import { h, Component, Prop, Element, Watch, State, Method, Host } from '@stencil/core'; +import { h, Component, Prop, Element, Watch, State, Method, Host, Listen } from '@stencil/core'; import { DIALOG_SIZE, TDialogSize, TDialogFooterAppearance, DIALOG_FOOTER_APPEARANCE } from './bq-dialog.types'; import { hasSlotContent, validatePropValue } from '../../shared/utils'; /** * @part base - The component wrapper container inside the shadow DOM + * @part backdrop - The `
` that displays the background * @part container - The `
` container that holds the dialog content + * @part header - The `
` that holds the icon, title, description and close button * @part icon - The `
` that holds the info icon + * @part title - The `
` that holds the title content * @part button-close - The button that close the dialog on click + * @part description- The `
` that holds the description content + * @part content- The `
` that holds the content * @part footer - The `