@fluentui/react-utilities 9.14.0 → 9.14.2
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,37 @@
|
|
2
2
|
"name": "@fluentui/react-utilities",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 09 Oct 2023 20:41:57 GMT",
|
6
|
+
"tag": "@fluentui/react-utilities_v9.14.2",
|
7
|
+
"version": "9.14.2",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
12
|
+
"package": "@fluentui/react-utilities",
|
13
|
+
"commit": "49f0630d6bdf94eadc671ac9fae4805e0a9df1ab",
|
14
|
+
"comment": "chore: add e2e test for useOnScrollOutside"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"date": "Thu, 05 Oct 2023 15:25:34 GMT",
|
21
|
+
"tag": "@fluentui/react-utilities_v9.14.1",
|
22
|
+
"version": "9.14.1",
|
23
|
+
"comments": {
|
24
|
+
"patch": [
|
25
|
+
{
|
26
|
+
"author": "yuanboxue@microsoft.com",
|
27
|
+
"package": "@fluentui/react-utilities",
|
28
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d",
|
29
|
+
"comment": "Revert fix: useOnScrollOutside should invoke callback on dragging scrollbar"
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"date": "Wed, 04 Oct 2023 08:45:47 GMT",
|
6
36
|
"tag": "@fluentui/react-utilities_v9.14.0",
|
7
37
|
"version": "9.14.0",
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,30 @@
|
|
1
1
|
# Change Log - @fluentui/react-utilities
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 09 Oct 2023 20:41:57 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.14.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.14.2)
|
8
|
+
|
9
|
+
Mon, 09 Oct 2023 20:41:57 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.14.1..@fluentui/react-utilities_v9.14.2)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: add e2e test for useOnScrollOutside ([PR #29413](https://github.com/microsoft/fluentui/pull/29413) by yuanboxue@microsoft.com)
|
15
|
+
|
16
|
+
## [9.14.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.14.1)
|
17
|
+
|
18
|
+
Thu, 05 Oct 2023 15:25:34 GMT
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.14.0..@fluentui/react-utilities_v9.14.1)
|
20
|
+
|
21
|
+
### Patches
|
22
|
+
|
23
|
+
- Revert fix: useOnScrollOutside should invoke callback on dragging scrollbar ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by yuanboxue@microsoft.com)
|
24
|
+
|
7
25
|
## [9.14.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.14.0)
|
8
26
|
|
9
|
-
Wed, 04 Oct 2023 08:
|
27
|
+
Wed, 04 Oct 2023 08:45:47 GMT
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.13.5..@fluentui/react-utilities_v9.14.0)
|
11
29
|
|
12
30
|
### Minor changes
|
@@ -19,12 +19,9 @@ import { useEventCallback } from './useEventCallback';
|
|
19
19
|
}
|
20
20
|
element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);
|
21
21
|
element === null || element === void 0 ? void 0 : element.addEventListener('touchmove', listener);
|
22
|
-
// use capture phase because scroll does not bubble
|
23
|
-
element === null || element === void 0 ? void 0 : element.addEventListener('scroll', listener, true);
|
24
22
|
return ()=>{
|
25
23
|
element === null || element === void 0 ? void 0 : element.removeEventListener('wheel', listener);
|
26
24
|
element === null || element === void 0 ? void 0 : element.removeEventListener('touchmove', listener);
|
27
|
-
element === null || element === void 0 ? void 0 : element.removeEventListener('scroll', listener, true);
|
28
25
|
};
|
29
26
|
}, [
|
30
27
|
listener,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useOnScrollOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport type { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside';\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnScrollOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled, contains: containsProp } = options;\n\n const listener = useEventCallback((ev:
|
1
|
+
{"version":3,"sources":["useOnScrollOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport type { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside';\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnScrollOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled, contains: containsProp } = options;\n\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n const contains: UseOnClickOrScrollOutsideOptions['contains'] =\n containsProp || ((parent, child) => !!parent?.contains(child));\n\n const target = ev.composedPath()[0] as HTMLElement;\n const isOutside = refs.every(ref => !contains(ref.current || null, target));\n\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n element?.addEventListener('wheel', listener);\n element?.addEventListener('touchmove', listener);\n\n return () => {\n element?.removeEventListener('wheel', listener);\n element?.removeEventListener('touchmove', listener);\n };\n }, [listener, element, disabled]);\n};\n"],"names":["React","useEventCallback","useOnScrollOutside","options","refs","callback","element","disabled","contains","containsProp","listener","ev","parent","child","target","composedPath","isOutside","every","ref","current","useEffect","addEventListener","removeEventListener"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,qBAAqB;AAGtD;;;CAGC,GACD,OAAO,MAAMC,qBAAqB,CAACC;IACjC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAUC,YAAY,EAAE,GAAGN;IAEtE,MAAMO,WAAWT,iBAAiB,CAACU;QACjC,MAAMH,WACJC,gBAAiB,CAAA,CAACG,QAAQC,QAAU,CAAC,EAACD,mBAAAA,6BAAAA,OAAQJ,QAAQ,CAACK,OAAK;QAE9D,MAAMC,SAASH,GAAGI,YAAY,EAAE,CAAC,EAAE;QACnC,MAAMC,YAAYZ,KAAKa,KAAK,CAACC,CAAAA,MAAO,CAACV,SAASU,IAAIC,OAAO,IAAI,MAAML;QAEnE,IAAIE,aAAa,CAACT,UAAU;YAC1BF,SAASM;QACX;IACF;IAEAX,MAAMoB,SAAS,CAAC;QACd,IAAIb,UAAU;YACZ;QACF;QAEAD,oBAAAA,8BAAAA,QAASe,gBAAgB,CAAC,SAASX;QACnCJ,oBAAAA,8BAAAA,QAASe,gBAAgB,CAAC,aAAaX;QAEvC,OAAO;YACLJ,oBAAAA,8BAAAA,QAASgB,mBAAmB,CAAC,SAASZ;YACtCJ,oBAAAA,8BAAAA,QAASgB,mBAAmB,CAAC,aAAaZ;QAC5C;IACF,GAAG;QAACA;QAAUJ;QAASC;KAAS;AAClC,EAAE"}
|
@@ -27,12 +27,9 @@ const useOnScrollOutside = (options)=>{
|
|
27
27
|
}
|
28
28
|
element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);
|
29
29
|
element === null || element === void 0 ? void 0 : element.addEventListener('touchmove', listener);
|
30
|
-
// use capture phase because scroll does not bubble
|
31
|
-
element === null || element === void 0 ? void 0 : element.addEventListener('scroll', listener, true);
|
32
30
|
return ()=>{
|
33
31
|
element === null || element === void 0 ? void 0 : element.removeEventListener('wheel', listener);
|
34
32
|
element === null || element === void 0 ? void 0 : element.removeEventListener('touchmove', listener);
|
35
|
-
element === null || element === void 0 ? void 0 : element.removeEventListener('scroll', listener, true);
|
36
33
|
};
|
37
34
|
}, [
|
38
35
|
listener,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useOnScrollOutside.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */ export const useOnScrollOutside = (options)=>{\n const { refs, callback, element, disabled, contains: containsProp } = options;\n const listener = useEventCallback((ev)=>{\n const contains = containsProp || ((parent, child)=>!!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));\n const target = ev.composedPath()[0];\n const isOutside = refs.every((ref)=>!contains(ref.current || null, target));\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n React.useEffect(()=>{\n if (disabled) {\n return;\n }\n element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);\n element === null || element === void 0 ? void 0 : element.addEventListener('touchmove', listener);\n
|
1
|
+
{"version":3,"sources":["useOnScrollOutside.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */ export const useOnScrollOutside = (options)=>{\n const { refs, callback, element, disabled, contains: containsProp } = options;\n const listener = useEventCallback((ev)=>{\n const contains = containsProp || ((parent, child)=>!!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));\n const target = ev.composedPath()[0];\n const isOutside = refs.every((ref)=>!contains(ref.current || null, target));\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n React.useEffect(()=>{\n if (disabled) {\n return;\n }\n element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);\n element === null || element === void 0 ? void 0 : element.addEventListener('touchmove', listener);\n return ()=>{\n element === null || element === void 0 ? void 0 : element.removeEventListener('wheel', listener);\n element === null || element === void 0 ? void 0 : element.removeEventListener('touchmove', listener);\n };\n }, [\n listener,\n element,\n disabled\n ]);\n};\n"],"names":["useOnScrollOutside","options","refs","callback","element","disabled","contains","containsProp","listener","useEventCallback","ev","parent","child","target","composedPath","isOutside","every","ref","current","React","useEffect","addEventListener","removeEventListener"],"mappings":";;;;+BAKiBA;;;eAAAA;;;;iEALM;kCACU;AAItB,MAAMA,qBAAqB,CAACC;IACnC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAUC,YAAY,EAAE,GAAGN;IACtE,MAAMO,WAAWC,IAAAA,kCAAgB,EAAC,CAACC;QAC/B,MAAMJ,WAAWC,gBAAiB,CAAA,CAACI,QAAQC,QAAQ,CAAC,CAAED,CAAAA,WAAW,QAAQA,WAAW,KAAK,IAAI,KAAK,IAAIA,OAAOL,QAAQ,CAACM,MAAK,CAAC;QAC5H,MAAMC,SAASH,GAAGI,YAAY,EAAE,CAAC,EAAE;QACnC,MAAMC,YAAYb,KAAKc,KAAK,CAAC,CAACC,MAAM,CAACX,SAASW,IAAIC,OAAO,IAAI,MAAML;QACnE,IAAIE,aAAa,CAACV,UAAU;YACxBF,SAASO;QACb;IACJ;IACAS,OAAMC,SAAS,CAAC;QACZ,IAAIf,UAAU;YACV;QACJ;QACAD,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQiB,gBAAgB,CAAC,SAASb;QACpFJ,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQiB,gBAAgB,CAAC,aAAab;QACxF,OAAO;YACHJ,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQkB,mBAAmB,CAAC,SAASd;YACvFJ,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQkB,mBAAmB,CAAC,aAAad;QAC/F;IACJ,GAAG;QACCA;QACAJ;QACAC;KACH;AACL"}
|