From 7db68eeeb5151035e341fbe5c1a2bd989430c185 Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Wed, 7 Sep 2022 19:13:56 +0000 Subject: [PATCH] feat: add dialog properties to getNativeElementProps --- ...act-utilities-3b90ac0a-38dc-4a1f-876b-613ec6eade09.json | 7 +++++++ .../react-utilities/src/utils/getNativeElementProps.ts | 2 ++ .../react-utilities/src/utils/properties.ts | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 change/@fluentui-react-utilities-3b90ac0a-38dc-4a1f-876b-613ec6eade09.json diff --git a/change/@fluentui-react-utilities-3b90ac0a-38dc-4a1f-876b-613ec6eade09.json b/change/@fluentui-react-utilities-3b90ac0a-38dc-4a1f-876b-613ec6eade09.json new file mode 100644 index 00000000000000..69c8a16b38b3f3 --- /dev/null +++ b/change/@fluentui-react-utilities-3b90ac0a-38dc-4a1f-876b-613ec6eade09.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: add dialog properties to getNativeElementProps", + "packageName": "@fluentui/react-utilities", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-utilities/src/utils/getNativeElementProps.ts b/packages/react-components/react-utilities/src/utils/getNativeElementProps.ts index 6e5b988143d4ed..4064fa4212b83a 100644 --- a/packages/react-components/react-utilities/src/utils/getNativeElementProps.ts +++ b/packages/react-components/react-utilities/src/utils/getNativeElementProps.ts @@ -24,6 +24,7 @@ import { htmlElementProperties, getNativeProps, timeProperties, + dialogProperties, } from './properties'; const nativeElementMap: Record> = { @@ -49,6 +50,7 @@ const nativeElementMap: Record> = { iframe: iframeProperties, img: imgProperties, time: timeProperties, + dialog: dialogProperties, }; /** diff --git a/packages/react-components/react-utilities/src/utils/properties.ts b/packages/react-components/react-utilities/src/utils/properties.ts index a48397bc855c1a..7da928de7680f7 100644 --- a/packages/react-components/react-utilities/src/utils/properties.ts +++ b/packages/react-components/react-utilities/src/utils/properties.ts @@ -411,6 +411,13 @@ export const imgProperties = toObjectMap(htmlElementProperties, [ 'width', // canvas, embed, iframe, img, input, object, video ]); +/** + * An array of DIALOG tag properties and events. + * + * @public + */ +export const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']); + /** * An array of DIV tag properties and events. *