@fluentui/react-dialog 9.5.18 → 9.5.20

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/CHANGELOG.json CHANGED
@@ -2,7 +2,91 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 25 Jul 2023 13:26:21 GMT",
5
+ "date": "Fri, 04 Aug 2023 08:48:25 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.5.20",
7
+ "version": "9.5.20",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-dialog",
13
+ "comment": "Bump @fluentui/react-utilities to v9.11.0",
14
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-dialog",
19
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13",
20
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-dialog",
25
+ "comment": "Bump @fluentui/react-context-selector to v9.1.27",
26
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-dialog",
31
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.1",
32
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-dialog",
37
+ "comment": "Bump @fluentui/react-aria to v9.3.28",
38
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-dialog",
43
+ "comment": "Bump @fluentui/react-tabster to v9.12.0",
44
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-dialog",
49
+ "comment": "Bump @fluentui/react-theme to v9.1.10",
50
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-dialog",
55
+ "comment": "Bump @fluentui/react-portal to v9.3.5",
56
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Tue, 01 Aug 2023 10:17:21 GMT",
63
+ "tag": "@fluentui/react-dialog_v9.5.19",
64
+ "version": "9.5.19",
65
+ "comments": {
66
+ "patch": [
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-dialog",
70
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.0",
71
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-dialog",
76
+ "comment": "Bump @fluentui/react-tabster to v9.11.1",
77
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-dialog",
82
+ "comment": "Bump @fluentui/react-portal to v9.3.4",
83
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Tue, 25 Jul 2023 13:29:18 GMT",
6
90
  "tag": "@fluentui/react-dialog_v9.5.18",
7
91
  "version": "9.5.18",
8
92
  "comments": {
@@ -23,13 +107,13 @@
23
107
  "author": "beachball",
24
108
  "package": "@fluentui/react-dialog",
25
109
  "comment": "Bump @fluentui/react-tabster to v9.11.0",
26
- "commit": "c0c62f9383781f0dbebd800eaa2c64ef761075a2"
110
+ "commit": "e59b4b305eb656c5af005fefbfa2b1f69afcdc43"
27
111
  },
28
112
  {
29
113
  "author": "beachball",
30
114
  "package": "@fluentui/react-dialog",
31
115
  "comment": "Bump @fluentui/react-portal to v9.3.3",
32
- "commit": "c0c62f9383781f0dbebd800eaa2c64ef761075a2"
116
+ "commit": "e59b4b305eb656c5af005fefbfa2b1f69afcdc43"
33
117
  }
34
118
  ]
35
119
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,47 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Tue, 25 Jul 2023 13:26:21 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 04 Aug 2023 08:48:25 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.20)
8
+
9
+ Fri, 04 Aug 2023 08:48:25 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.19..@fluentui/react-dialog_v9.5.20)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-utilities to v9.11.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.27 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.7.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
18
+ - Bump @fluentui/react-aria to v9.3.28 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.12.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
20
+ - Bump @fluentui/react-theme to v9.1.10 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
21
+ - Bump @fluentui/react-portal to v9.3.5 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
22
+
23
+ ## [9.5.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.19)
24
+
25
+ Tue, 01 Aug 2023 10:17:21 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.18..@fluentui/react-dialog_v9.5.19)
27
+
28
+ ### Patches
29
+
30
+ - Bump @fluentui/react-shared-contexts to v9.7.0 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
31
+ - Bump @fluentui/react-tabster to v9.11.1 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
32
+ - Bump @fluentui/react-portal to v9.3.4 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
33
+
7
34
  ## [9.5.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.18)
8
35
 
9
- Tue, 25 Jul 2023 13:26:21 GMT
36
+ Tue, 25 Jul 2023 13:29:18 GMT
10
37
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.17..@fluentui/react-dialog_v9.5.18)
11
38
 
12
39
  ### Patches
13
40
 
14
41
  - chore: Update react-icons version to pick up fowardref change. ([PR #28590](https://github.com/microsoft/fluentui/pull/28590) by ololubek@microsoft.com)
15
42
  - fix: Focus should restore to a DialogTrigger outside of a Dialog ([PR #28530](https://github.com/microsoft/fluentui/pull/28530) by lingfan.gao@microsoft.com)
16
- - Bump @fluentui/react-tabster to v9.11.0 ([PR #28530](https://github.com/microsoft/fluentui/pull/28530) by beachball)
17
- - Bump @fluentui/react-portal to v9.3.3 ([PR #28530](https://github.com/microsoft/fluentui/pull/28530) by beachball)
43
+ - Bump @fluentui/react-tabster to v9.11.0 ([PR #28622](https://github.com/microsoft/fluentui/pull/28622) by beachball)
44
+ - Bump @fluentui/react-portal to v9.3.3 ([PR #28622](https://github.com/microsoft/fluentui/pull/28622) by beachball)
18
45
 
19
46
  ## [9.5.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.17)
20
47
 
@@ -16,7 +16,7 @@ import { useModalAttributes } from '@fluentui/react-tabster';
16
16
  const { triggerAttributes } = useModalAttributes();
17
17
  const handleClick = useEventCallback((event)=>{
18
18
  var _child_props, _child_props_onClick;
19
- (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);
19
+ (_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);
20
20
  if (!event.isDefaultPrevented()) {
21
21
  requestOpenChange({
22
22
  event,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","useEventCallback","useDialogContext_unstable","useDialogSurfaceContext_unstable","useARIAButtonProps","useModalAttributes","useDialogTrigger_unstable","props","isInsideSurfaceDialog","children","disableButtonEnhancement","action","child","requestOpenChange","ctx","triggerAttributes","handleClick","event","onClick","isDefaultPrevented","type","open","triggerChildProps","ref","ariaButtonTriggerChildProps"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,4BAA4B;AAE3G,SAASC,yBAAyB,EAAEC,gCAAgC,QAAQ,iBAAiB;AAC7F,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4B,CAACC,QAAkD;IAC1F,MAAMC,wBAAwBL;IAE9B,MAAM,EAAEM,SAAQ,EAAEC,0BAA2B,KAAK,CAAA,EAAEC,QAASH,wBAAwB,UAAU,MAAM,CAAA,EAAE,GAAGD;IAE1G,MAAMK,QAAQZ,gBAAgBS;IAE9B,MAAMI,oBAAoBX,0BAA0BY,CAAAA,MAAOA,IAAID,iBAAiB;IAChF,MAAM,EAAEE,kBAAiB,EAAE,GAAGV;IAE9B,MAAMW,cAAcf,iBAClB,CAACgB,QAAoF;YACnFL,cAAAA;QAAAA,CAAAA,uBAAAA,CAAAA,eAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOL,KAAK,EAACW,OAAO,cAApBN,kCAAAA,KAAAA,IAAAA,qBAAAA,KAAAA,cAAuBK;QACvB,IAAI,CAACA,MAAME,kBAAkB,IAAI;YAC/BN,kBAAkB;gBAChBI;gBACAG,MAAM;gBACNC,MAAMV,WAAW;YACnB;QACF,CAAC;IACH;IAGF,MAAMW,oBAAoB;QACxB,GAAGV,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOL,KAAK;QACfgB,KAAKX,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOW,GAAG;QACfL,SAASF;QACT,GAAGD,iBAAiB;IACtB;IAEA,MAAMS,8BAA8BpB,mBAClCQ,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,YAAYR,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,MAAMR,MAAMQ,IAAI,GAAG,KAAK,EACpE;QACE,GAAGE,iBAAiB;QACpBF,MAAM;IACR;IAGF,OAAO;QACLX,UAAUV,4BACRU,UACAC,2BAA2BY,oBAAoBE,2BAA2B;IAE9E;AACF,EAAE"}
1
+ {"version":3,"sources":["useDialogTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport type { DialogTriggerProps, DialogTriggerState } from './DialogTrigger.types';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */\nexport const useDialogTrigger_unstable = (props: DialogTriggerProps): DialogTriggerState => {\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n\n const { children, disableButtonEnhancement = false, action = isInsideSurfaceDialog ? 'close' : 'open' } = props;\n\n const child = getTriggerChild(children);\n\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const { triggerAttributes } = useModalAttributes();\n\n const handleClick = useEventCallback(\n (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open',\n });\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: child?.ref,\n onClick: handleClick,\n ...triggerAttributes,\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","useEventCallback","useDialogContext_unstable","useDialogSurfaceContext_unstable","useARIAButtonProps","useModalAttributes","useDialogTrigger_unstable","props","isInsideSurfaceDialog","children","disableButtonEnhancement","action","child","requestOpenChange","ctx","triggerAttributes","handleClick","event","onClick","isDefaultPrevented","type","open","triggerChildProps","ref","ariaButtonTriggerChildProps"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,4BAA4B;AAE3G,SAASC,yBAAyB,EAAEC,gCAAgC,QAAQ,iBAAiB;AAC7F,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4B,CAACC,QAAkD;IAC1F,MAAMC,wBAAwBL;IAE9B,MAAM,EAAEM,SAAQ,EAAEC,0BAA2B,KAAK,CAAA,EAAEC,QAASH,wBAAwB,UAAU,MAAM,CAAA,EAAE,GAAGD;IAE1G,MAAMK,QAAQZ,gBAAgBS;IAE9B,MAAMI,oBAAoBX,0BAA0BY,CAAAA,MAAOA,IAAID,iBAAiB;IAChF,MAAM,EAAEE,kBAAiB,EAAE,GAAGV;IAE9B,MAAMW,cAAcf,iBAClB,CAACgB,QAAoF;YACnFL,cAAAA;QAAAA,CAAAA,uBAAAA,eAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOL,KAAK,CAACW,OAAO,cAApBN,kCAAAA,KAAAA,IAAAA,qBAAAA,KAAAA,cAAuBK;QACvB,IAAI,CAACA,MAAME,kBAAkB,IAAI;YAC/BN,kBAAkB;gBAChBI;gBACAG,MAAM;gBACNC,MAAMV,WAAW;YACnB;QACF,CAAC;IACH;IAGF,MAAMW,oBAAoB;QACxB,GAAGV,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOL,KAAK;QACfgB,KAAKX,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOW,GAAG;QACfL,SAASF;QACT,GAAGD,iBAAiB;IACtB;IAEA,MAAMS,8BAA8BpB,mBAClCQ,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,YAAYR,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,MAAMR,MAAMQ,IAAI,GAAG,KAAK,EACpE;QACE,GAAGE,iBAAiB;QACpBF,MAAM;IACR;IAGF,OAAO;QACLX,UAAUV,4BACRU,UACAC,2BAA2BY,oBAAoBE,2BAA2B;IAE9E;AACF,EAAE"}
@@ -1,4 +1,3 @@
1
- var _element, _disableScrollElementProp;
2
1
  import { useFluent_unstable } from '@fluentui/react-shared-contexts';
3
2
  import { useCallback } from 'react';
4
3
  const disableScrollElementProp = '__fluentDisableScrollElement';
@@ -38,6 +37,7 @@ const disableScrollElementProp = '__fluentDisableScrollElement';
38
37
  };
39
38
  }
40
39
  function assertIsDisableScrollElement(element) {
40
+ var _element, _disableScrollElementProp;
41
41
  var _;
42
42
  (_ = (_element = element)[_disableScrollElementProp = disableScrollElementProp]) !== null && _ !== void 0 ? _ : _element[_disableScrollElementProp] = {
43
43
  count: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"],"names":["element","disableScrollElementProp","useFluent_unstable","useCallback","useDisableBodyScroll","targetDocument","disableScroll","body","target","clientWidth","ownerDocument","documentElement","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle"],"mappings":"IAiDGA,UAAuCC;AAjD1C,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,MAAMF,2BAA2B;AAUjC;;CAEC,GACD,OAAO,SAASG,uBAAuB;IACrC,MAAM,EAAEC,eAAc,EAAE,GAAGH;IAC3B,OAAOC,YAAY,IAAM;QACvB,IAAIE,gBAAgB;YAClB,OAAOC,cAAcD,eAAeE,IAAI;QAC1C,CAAC;IACH,GAAG;QAACF;KAAe;AACrB,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASC,cAAcE,MAAmB,EAAE;QAE9BA;IADnB,MAAM,EAAEC,YAAW,EAAE,GAAGD,OAAOE,aAAa,CAACC,eAAe;QACzCH;IAAnB,MAAMI,aAAaJ,CAAAA,+CAAAA,CAAAA,oCAAAA,OAAOE,aAAa,CAACG,WAAW,cAAhCL,+CAAAA,KAAAA,IAAAA,kCAAkCI,UAAU,cAA5CJ,0DAAAA,+CAAgD,CAAC;IACpEM,6BAA6BN;IAC7B,IAAIA,MAAM,CAACP,yBAAyB,CAACc,KAAK,KAAK,GAAG;QAChDP,OAAOQ,KAAK,CAACC,QAAQ,GAAG;QACxBT,OAAOQ,KAAK,CAACE,YAAY,GAAG,CAAC,EAAEN,aAAaH,YAAY,EAAE,CAAC;IAC7D,CAAC;IACDD,MAAM,CAACP,yBAAyB,CAACc,KAAK;IACtC,OAAO,IAAM;QACXP,MAAM,CAACP,yBAAyB,CAACc,KAAK;QACtC,IAAIP,MAAM,CAACP,yBAAyB,CAACc,KAAK,KAAK,GAAG;YAChDP,OAAOQ,KAAK,CAACC,QAAQ,GAAGT,MAAM,CAACP,yBAAyB,CAACkB,qBAAqB;YAC9EX,OAAOQ,KAAK,CAACE,YAAY,GAAGV,MAAM,CAACP,yBAAyB,CAACmB,yBAAyB;QACxF,CAAC;IACH;AACF,CAAC;AAED,SAASN,6BAA6Bd,OAAoB,EAAiD;;IACzG,MAACA,WAAAA,QAAsC,CAACC,4BAAAA,yBAAyB,iCAAhED,QAAsC,CAACC,0BAAyB,GAAK;QACpEc,OAAO;QACPI,uBAAuBnB,QAAQgB,KAAK,CAACC,QAAQ;QAC7CG,2BAA2BpB,QAAQgB,KAAK,CAACE,YAAY;IACvD,CAAC;AACH"}
1
+ {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nconst disableScrollElementProp = '__fluentDisableScrollElement' as const;\n\ntype FluentDisableScrollElement = HTMLElement & {\n [disableScrollElementProp]: {\n count: number;\n previousOverflowStyle: string;\n previousPaddingRightStyle: string;\n };\n};\n\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */\nexport function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(() => {\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [targetDocument]);\n}\n\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */\nexport function disableScroll(target: HTMLElement) {\n const { clientWidth } = target.ownerDocument.documentElement;\n const innerWidth = target.ownerDocument.defaultView?.innerWidth ?? 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return () => {\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\n\nfunction assertIsDisableScrollElement(element: HTMLElement): asserts element is FluentDisableScrollElement {\n (element as FluentDisableScrollElement)[disableScrollElementProp] ??= {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight,\n };\n}\n"],"names":["useFluent_unstable","useCallback","disableScrollElementProp","useDisableBodyScroll","targetDocument","disableScroll","body","target","clientWidth","ownerDocument","documentElement","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,MAAMC,2BAA2B;AAUjC;;CAEC,GACD,OAAO,SAASC,uBAAuB;IACrC,MAAM,EAAEC,eAAc,EAAE,GAAGJ;IAC3B,OAAOC,YAAY,IAAM;QACvB,IAAIG,gBAAgB;YAClB,OAAOC,cAAcD,eAAeE,IAAI;QAC1C,CAAC;IACH,GAAG;QAACF;KAAe;AACrB,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASC,cAAcE,MAAmB,EAAE;QAE9BA;IADnB,MAAM,EAAEC,YAAW,EAAE,GAAGD,OAAOE,aAAa,CAACC,eAAe;QACzCH;IAAnB,MAAMI,aAAaJ,CAAAA,+CAAAA,CAAAA,oCAAAA,OAAOE,aAAa,CAACG,WAAW,cAAhCL,+CAAAA,KAAAA,IAAAA,kCAAkCI,UAAU,cAA5CJ,0DAAAA,+CAAgD,CAAC;IACpEM,6BAA6BN;IAC7B,IAAIA,MAAM,CAACL,yBAAyB,CAACY,KAAK,KAAK,GAAG;QAChDP,OAAOQ,KAAK,CAACC,QAAQ,GAAG;QACxBT,OAAOQ,KAAK,CAACE,YAAY,GAAG,CAAC,EAAEN,aAAaH,YAAY,EAAE,CAAC;IAC7D,CAAC;IACDD,MAAM,CAACL,yBAAyB,CAACY,KAAK;IACtC,OAAO,IAAM;QACXP,MAAM,CAACL,yBAAyB,CAACY,KAAK;QACtC,IAAIP,MAAM,CAACL,yBAAyB,CAACY,KAAK,KAAK,GAAG;YAChDP,OAAOQ,KAAK,CAACC,QAAQ,GAAGT,MAAM,CAACL,yBAAyB,CAACgB,qBAAqB;YAC9EX,OAAOQ,KAAK,CAACE,YAAY,GAAGV,MAAM,CAACL,yBAAyB,CAACiB,yBAAyB;QACxF,CAAC;IACH;AACF,CAAC;AAED,SAASN,6BAA6BO,OAAoB,EAAiD;QACxGA,UAAuClB;;IAAxC,MAACkB,WAAAA,QAAsC,CAAClB,4BAAAA,yBAAyB,iCAAhEkB,QAAsC,CAAClB,0BAAyB,GAAK;QACpEY,OAAO;QACPI,uBAAuBE,QAAQL,KAAK,CAACC,QAAQ;QAC7CG,2BAA2BC,QAAQL,KAAK,CAACE,YAAY;IACvD,CAAC;AACH"}
@@ -20,7 +20,7 @@ const useDialogTrigger_unstable = (props)=>{
20
20
  const { triggerAttributes } = (0, _reactTabster.useModalAttributes)();
21
21
  const handleClick = (0, _reactUtilities.useEventCallback)((event)=>{
22
22
  var _child_props, _child_props_onClick;
23
- (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);
23
+ (_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);
24
24
  if (!event.isDefaultPrevented()) {
25
25
  requestOpenChange({
26
26
  event,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */ export const useDialogTrigger_unstable = (props)=>{\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n const { children , disableButtonEnhancement =false , action =isInsideSurfaceDialog ? 'close' : 'open' } = props;\n const child = getTriggerChild(children);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const { triggerAttributes } = useModalAttributes();\n const handleClick = useEventCallback((event)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick = (_child_props = child === null || child === void 0 ? void 0 : child.props).onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open'\n });\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick,\n ...triggerAttributes\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useDialogTrigger_unstable","props","isInsideSurfaceDialog","useDialogSurfaceContext_unstable","children","disableButtonEnhancement","action","child","getTriggerChild","requestOpenChange","useDialogContext_unstable","ctx","triggerAttributes","useModalAttributes","handleClick","useEventCallback","event","_child_props","_child_props_onClick","onClick","call","isDefaultPrevented","type","open","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACwD;0BACH;2BACzC;8BACA;AAMxB,MAAMA,4BAA4B,CAACC,QAAQ;IAClD,MAAMC,wBAAwBC,IAAAA,0CAAgC;IAC9D,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAGC,QAAQJ,wBAAwB,UAAU,MAAM,CAAA,EAAG,GAAGD;IAC3G,MAAMM,QAAQC,IAAAA,+BAAe,EAACJ;IAC9B,MAAMK,oBAAoBC,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIF,iBAAiB;IAChF,MAAM,EAAEG,kBAAiB,EAAG,GAAGC,IAAAA,gCAAkB;IACjD,MAAMC,cAAcC,IAAAA,gCAAgB,EAAC,CAACC,QAAQ;QAC1C,IAAIC,cAAcC;QACjBA,CAAAA,uBAAuB,AAACD,CAAAA,eAAeV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMN,KAAK,AAAD,EAAGkB,OAAO,AAAD,MAAO,IAAI,IAAID,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBE,IAAI,CAACH,cAAcD,MAAM;QACjN,IAAI,CAACA,MAAMK,kBAAkB,IAAI;YAC7BZ,kBAAkB;gBACdO;gBACAM,MAAM;gBACNC,MAAMjB,WAAW;YACrB;QACJ,CAAC;IACL;IACA,MAAMkB,oBAAoB;QACtB,GAAGjB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMN,KAAK;QAC5DwB,KAAKlB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMkB,GAAG;QAC5DN,SAASL;QACT,GAAGF,iBAAiB;IACxB;IACA,MAAMc,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACpB,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMe,IAAI,AAAD,MAAO,YAAY,AAACf,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMe,IAAI,AAAD,MAAO,MAAMf,MAAMe,IAAI,GAAG,KAAK,EAAE;QACvN,GAAGE,iBAAiB;QACpBF,MAAM;IACV;IACA,OAAO;QACHlB,UAAUwB,IAAAA,2CAA2B,EAACxB,UAAUC,2BAA2BmB,oBAAoBE,2BAA2B;IAC9H;AACJ"}
1
+ {"version":3,"sources":["useDialogTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable, useDialogSurfaceContext_unstable } from '../../contexts';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useModalAttributes } from '@fluentui/react-tabster';\n/**\n * Create the state required to render DialogTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup Dialog\n *\n * @param props - props from this instance of DialogTrigger\n */ export const useDialogTrigger_unstable = (props)=>{\n const isInsideSurfaceDialog = useDialogSurfaceContext_unstable();\n const { children , disableButtonEnhancement =false , action =isInsideSurfaceDialog ? 'close' : 'open' } = props;\n const child = getTriggerChild(children);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const { triggerAttributes } = useModalAttributes();\n const handleClick = useEventCallback((event)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, event);\n if (!event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n type: 'triggerClick',\n open: action === 'open'\n });\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick,\n ...triggerAttributes\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useDialogTrigger_unstable","props","isInsideSurfaceDialog","useDialogSurfaceContext_unstable","children","disableButtonEnhancement","action","child","getTriggerChild","requestOpenChange","useDialogContext_unstable","ctx","triggerAttributes","useModalAttributes","handleClick","useEventCallback","event","_child_props","_child_props_onClick","onClick","call","isDefaultPrevented","type","open","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren"],"mappings":";;;;+BAUiBA;;aAAAA;;;6DAVM;gCACwD;0BACH;2BACzC;8BACA;AAMxB,MAAMA,4BAA4B,CAACC,QAAQ;IAClD,MAAMC,wBAAwBC,IAAAA,0CAAgC;IAC9D,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAGC,QAAQJ,wBAAwB,UAAU,MAAM,CAAA,EAAG,GAAGD;IAC3G,MAAMM,QAAQC,IAAAA,+BAAe,EAACJ;IAC9B,MAAMK,oBAAoBC,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIF,iBAAiB;IAChF,MAAM,EAAEG,kBAAiB,EAAG,GAAGC,IAAAA,gCAAkB;IACjD,MAAMC,cAAcC,IAAAA,gCAAgB,EAAC,CAACC,QAAQ;QAC1C,IAAIC,cAAcC;QACjBA,CAAAA,uBAAuBD,eAAeV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMN,KAAK,CAACkB,OAAO,AAAD,MAAO,IAAI,IAAID,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBE,IAAI,CAACH,cAAcD,MAAM;QAC/M,IAAI,CAACA,MAAMK,kBAAkB,IAAI;YAC7BZ,kBAAkB;gBACdO;gBACAM,MAAM;gBACNC,MAAMjB,WAAW;YACrB;QACJ,CAAC;IACL;IACA,MAAMkB,oBAAoB;QACtB,GAAGjB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMN,KAAK;QAC5DwB,KAAKlB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMkB,GAAG;QAC5DN,SAASL;QACT,GAAGF,iBAAiB;IACxB;IACA,MAAMc,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACpB,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMe,IAAI,AAAD,MAAO,YAAY,AAACf,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMe,IAAI,AAAD,MAAO,MAAMf,MAAMe,IAAI,GAAG,KAAK,EAAE;QACvN,GAAGE,iBAAiB;QACpBF,MAAM;IACV;IACA,OAAO;QACHlB,UAAUwB,IAAAA,2CAA2B,EAACxB,UAAUC,2BAA2BmB,oBAAoBE,2BAA2B;IAC9H;AACJ"}
@@ -14,7 +14,6 @@ _export(exports, {
14
14
  });
15
15
  const _reactSharedContexts = require("@fluentui/react-shared-contexts");
16
16
  const _react = require("react");
17
- var _element, _disableScrollElementProp;
18
17
  const disableScrollElementProp = '__fluentDisableScrollElement';
19
18
  function useDisableBodyScroll() {
20
19
  const { targetDocument } = (0, _reactSharedContexts.useFluent_unstable)();
@@ -46,6 +45,7 @@ function disableScroll(target) {
46
45
  };
47
46
  }
48
47
  function assertIsDisableScrollElement(element) {
48
+ var _element, _disableScrollElementProp;
49
49
  var _;
50
50
  (_ = (_element = element)[_disableScrollElementProp = disableScrollElementProp]) !== null && _ !== void 0 ? _ : _element[_disableScrollElementProp] = {
51
51
  count: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisableBodyScroll.js"],"sourcesContent":["var _element, _disableScrollElementProp;\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\nconst disableScrollElementProp = '__fluentDisableScrollElement';\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */ export function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(()=>{\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [\n targetDocument\n ]);\n}\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */ export function disableScroll(target) {\n var _target_ownerDocument_defaultView;\n const { clientWidth } = target.ownerDocument.documentElement;\n var _target_ownerDocument_defaultView_innerWidth;\n const innerWidth = (_target_ownerDocument_defaultView_innerWidth = (_target_ownerDocument_defaultView = target.ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.innerWidth) !== null && _target_ownerDocument_defaultView_innerWidth !== void 0 ? _target_ownerDocument_defaultView_innerWidth : 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return ()=>{\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\nfunction assertIsDisableScrollElement(element) {\n var _;\n (_ = (_element = element)[_disableScrollElementProp = disableScrollElementProp]) !== null && _ !== void 0 ? _ : _element[_disableScrollElementProp] = {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight\n };\n}\n"],"names":["useDisableBodyScroll","disableScroll","_element","_disableScrollElementProp","disableScrollElementProp","targetDocument","useFluent_unstable","useCallback","body","target","_target_ownerDocument_defaultView","clientWidth","ownerDocument","documentElement","_target_ownerDocument_defaultView_innerWidth","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element","_"],"mappings":";;;;;;;;;;;IAMoBA,oBAAoB,MAApBA;IAcAC,aAAa,MAAbA;;qCAnBe;uBACP;AAF5B,IAAIC,UAAUC;AAGd,MAAMC,2BAA2B;AAGtB,SAASJ,uBAAuB;IACvC,MAAM,EAAEK,eAAc,EAAG,GAAGC,IAAAA,uCAAkB;IAC9C,OAAOC,IAAAA,kBAAW,EAAC,IAAI;QACnB,IAAIF,gBAAgB;YAChB,OAAOJ,cAAcI,eAAeG,IAAI;QAC5C,CAAC;IACL,GAAG;QACCH;KACH;AACL;AAKW,SAASJ,cAAcQ,MAAM,EAAE;IACtC,IAAIC;IACJ,MAAM,EAAEC,YAAW,EAAG,GAAGF,OAAOG,aAAa,CAACC,eAAe;IAC7D,IAAIC;IACJ,MAAMC,aAAa,AAACD,CAAAA,+CAA+C,AAACJ,CAAAA,oCAAoCD,OAAOG,aAAa,CAACI,WAAW,AAAD,MAAO,IAAI,IAAIN,sCAAsC,KAAK,IAAI,KAAK,IAAIA,kCAAkCK,UAAU,AAAD,MAAO,IAAI,IAAID,iDAAiD,KAAK,IAAIA,+CAA+C,CAAC;IAClXG,6BAA6BR;IAC7B,IAAIA,MAAM,CAACL,yBAAyB,CAACc,KAAK,KAAK,GAAG;QAC9CT,OAAOU,KAAK,CAACC,QAAQ,GAAG;QACxBX,OAAOU,KAAK,CAACE,YAAY,GAAG,CAAC,EAAEN,aAAaJ,YAAY,EAAE,CAAC;IAC/D,CAAC;IACDF,MAAM,CAACL,yBAAyB,CAACc,KAAK;IACtC,OAAO,IAAI;QACPT,MAAM,CAACL,yBAAyB,CAACc,KAAK;QACtC,IAAIT,MAAM,CAACL,yBAAyB,CAACc,KAAK,KAAK,GAAG;YAC9CT,OAAOU,KAAK,CAACC,QAAQ,GAAGX,MAAM,CAACL,yBAAyB,CAACkB,qBAAqB;YAC9Eb,OAAOU,KAAK,CAACE,YAAY,GAAGZ,MAAM,CAACL,yBAAyB,CAACmB,yBAAyB;QAC1F,CAAC;IACL;AACJ;AACA,SAASN,6BAA6BO,OAAO,EAAE;IAC3C,IAAIC;IACHA,CAAAA,IAAI,AAACvB,CAAAA,WAAWsB,OAAM,CAAE,CAACrB,4BAA4BC,yBAAyB,AAAD,MAAO,IAAI,IAAIqB,MAAM,KAAK,IAAIA,IAAIvB,QAAQ,CAACC,0BAA0B,GAAG;QAClJe,OAAO;QACPI,uBAAuBE,QAAQL,KAAK,CAACC,QAAQ;QAC7CG,2BAA2BC,QAAQL,KAAK,CAACE,YAAY;IACzD,CAAC;AACL"}
1
+ {"version":3,"sources":["useDisableBodyScroll.js"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\nconst disableScrollElementProp = '__fluentDisableScrollElement';\n/**\n * hook that disables body scrolling through `overflow: hidden` CSS property\n */ export function useDisableBodyScroll() {\n const { targetDocument } = useFluent_unstable();\n return useCallback(()=>{\n if (targetDocument) {\n return disableScroll(targetDocument.body);\n }\n }, [\n targetDocument\n ]);\n}\n/**\n * disables scrolling from a given element through `overflow: hidden` CSS property\n * @param target - element to disable scrolling from\n * @returns a method for enabling scrolling again\n */ export function disableScroll(target) {\n var _target_ownerDocument_defaultView;\n const { clientWidth } = target.ownerDocument.documentElement;\n var _target_ownerDocument_defaultView_innerWidth;\n const innerWidth = (_target_ownerDocument_defaultView_innerWidth = (_target_ownerDocument_defaultView = target.ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.innerWidth) !== null && _target_ownerDocument_defaultView_innerWidth !== void 0 ? _target_ownerDocument_defaultView_innerWidth : 0;\n assertIsDisableScrollElement(target);\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = 'hidden';\n target.style.paddingRight = `${innerWidth - clientWidth}px`;\n }\n target[disableScrollElementProp].count++;\n return ()=>{\n target[disableScrollElementProp].count--;\n if (target[disableScrollElementProp].count === 0) {\n target.style.overflow = target[disableScrollElementProp].previousOverflowStyle;\n target.style.paddingRight = target[disableScrollElementProp].previousPaddingRightStyle;\n }\n };\n}\nfunction assertIsDisableScrollElement(element) {\n var _element, _disableScrollElementProp;\n var _;\n (_ = (_element = element)[_disableScrollElementProp = disableScrollElementProp]) !== null && _ !== void 0 ? _ : _element[_disableScrollElementProp] = {\n count: 0,\n previousOverflowStyle: element.style.overflow,\n previousPaddingRightStyle: element.style.paddingRight\n };\n}\n"],"names":["useDisableBodyScroll","disableScroll","disableScrollElementProp","targetDocument","useFluent_unstable","useCallback","body","target","_target_ownerDocument_defaultView","clientWidth","ownerDocument","documentElement","_target_ownerDocument_defaultView_innerWidth","innerWidth","defaultView","assertIsDisableScrollElement","count","style","overflow","paddingRight","previousOverflowStyle","previousPaddingRightStyle","element","_element","_disableScrollElementProp","_"],"mappings":";;;;;;;;;;;IAKoBA,oBAAoB,MAApBA;IAcAC,aAAa,MAAbA;;qCAnBe;uBACP;AAC5B,MAAMC,2BAA2B;AAGtB,SAASF,uBAAuB;IACvC,MAAM,EAAEG,eAAc,EAAG,GAAGC,IAAAA,uCAAkB;IAC9C,OAAOC,IAAAA,kBAAW,EAAC,IAAI;QACnB,IAAIF,gBAAgB;YAChB,OAAOF,cAAcE,eAAeG,IAAI;QAC5C,CAAC;IACL,GAAG;QACCH;KACH;AACL;AAKW,SAASF,cAAcM,MAAM,EAAE;IACtC,IAAIC;IACJ,MAAM,EAAEC,YAAW,EAAG,GAAGF,OAAOG,aAAa,CAACC,eAAe;IAC7D,IAAIC;IACJ,MAAMC,aAAa,AAACD,CAAAA,+CAA+C,AAACJ,CAAAA,oCAAoCD,OAAOG,aAAa,CAACI,WAAW,AAAD,MAAO,IAAI,IAAIN,sCAAsC,KAAK,IAAI,KAAK,IAAIA,kCAAkCK,UAAU,AAAD,MAAO,IAAI,IAAID,iDAAiD,KAAK,IAAIA,+CAA+C,CAAC;IAClXG,6BAA6BR;IAC7B,IAAIA,MAAM,CAACL,yBAAyB,CAACc,KAAK,KAAK,GAAG;QAC9CT,OAAOU,KAAK,CAACC,QAAQ,GAAG;QACxBX,OAAOU,KAAK,CAACE,YAAY,GAAG,CAAC,EAAEN,aAAaJ,YAAY,EAAE,CAAC;IAC/D,CAAC;IACDF,MAAM,CAACL,yBAAyB,CAACc,KAAK;IACtC,OAAO,IAAI;QACPT,MAAM,CAACL,yBAAyB,CAACc,KAAK;QACtC,IAAIT,MAAM,CAACL,yBAAyB,CAACc,KAAK,KAAK,GAAG;YAC9CT,OAAOU,KAAK,CAACC,QAAQ,GAAGX,MAAM,CAACL,yBAAyB,CAACkB,qBAAqB;YAC9Eb,OAAOU,KAAK,CAACE,YAAY,GAAGZ,MAAM,CAACL,yBAAyB,CAACmB,yBAAyB;QAC1F,CAAC;IACL;AACJ;AACA,SAASN,6BAA6BO,OAAO,EAAE;IAC3C,IAAIC,UAAUC;IACd,IAAIC;IACHA,CAAAA,IAAI,AAACF,CAAAA,WAAWD,OAAM,CAAE,CAACE,4BAA4BtB,yBAAyB,AAAD,MAAO,IAAI,IAAIuB,MAAM,KAAK,IAAIA,IAAIF,QAAQ,CAACC,0BAA0B,GAAG;QAClJR,OAAO;QACPI,uBAAuBE,QAAQL,KAAK,CAACC,QAAQ;QAC7CG,2BAA2BC,QAAQL,KAAK,CAACE,YAAY;IACzD,CAAC;AACL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.5.18",
3
+ "version": "9.5.20",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,16 +36,16 @@
36
36
  "@fluentui/scripts-tasks": "*"
37
37
  },
38
38
  "dependencies": {
39
- "@fluentui/react-utilities": "^9.10.1",
40
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.12",
39
+ "@fluentui/react-utilities": "^9.11.0",
40
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.13",
41
41
  "@fluentui/keyboard-keys": "^9.0.3",
42
- "@fluentui/react-context-selector": "^9.1.26",
43
- "@fluentui/react-shared-contexts": "^9.6.0",
44
- "@fluentui/react-aria": "^9.3.27",
42
+ "@fluentui/react-context-selector": "^9.1.27",
43
+ "@fluentui/react-shared-contexts": "^9.7.1",
44
+ "@fluentui/react-aria": "^9.3.28",
45
45
  "@fluentui/react-icons": "^2.0.207",
46
- "@fluentui/react-tabster": "^9.11.0",
47
- "@fluentui/react-theme": "^9.1.9",
48
- "@fluentui/react-portal": "^9.3.3",
46
+ "@fluentui/react-tabster": "^9.12.0",
47
+ "@fluentui/react-theme": "^9.1.10",
48
+ "@fluentui/react-portal": "^9.3.5",
49
49
  "@griffel/react": "^1.5.7",
50
50
  "@swc/helpers": "^0.4.14"
51
51
  },