@fluentui/react-table 9.10.5 → 9.10.7
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,103 @@
|
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 23 Oct 2023 09:48:55 GMT",
|
|
6
|
+
"tag": "@fluentui/react-table_v9.10.7",
|
|
7
|
+
"version": "9.10.7",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "lingfangao@hotmail.com",
|
|
12
|
+
"package": "@fluentui/react-table",
|
|
13
|
+
"commit": "17dbeb93ab542e982942aef91ce3747acc8053c4",
|
|
14
|
+
"comment": "fix: use targetDocument resize observer"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-table",
|
|
19
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.42",
|
|
20
|
+
"commit": "e4ef1febe8a185dddc10f8936944d177d50bc396"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-table",
|
|
25
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.52",
|
|
26
|
+
"commit": "e4ef1febe8a185dddc10f8936944d177d50bc396"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-table",
|
|
31
|
+
"comment": "Bump @fluentui/react-radio to v9.1.52",
|
|
32
|
+
"commit": "e4ef1febe8a185dddc10f8936944d177d50bc396"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-table",
|
|
37
|
+
"comment": "Bump @fluentui/react-tabster to v9.14.1",
|
|
38
|
+
"commit": "e4ef1febe8a185dddc10f8936944d177d50bc396"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"date": "Wed, 18 Oct 2023 17:54:08 GMT",
|
|
45
|
+
"tag": "@fluentui/react-table_v9.10.6",
|
|
46
|
+
"version": "9.10.6",
|
|
47
|
+
"comments": {
|
|
48
|
+
"patch": [
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-table",
|
|
52
|
+
"comment": "Bump @fluentui/react-aria to v9.3.43",
|
|
53
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@fluentui/react-table",
|
|
58
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.41",
|
|
59
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-table",
|
|
64
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.51",
|
|
65
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-table",
|
|
70
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.41",
|
|
71
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-table",
|
|
76
|
+
"comment": "Bump @fluentui/react-radio to v9.1.51",
|
|
77
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-table",
|
|
82
|
+
"comment": "Bump @fluentui/react-tabster to v9.14.0",
|
|
83
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-table",
|
|
88
|
+
"comment": "Bump @fluentui/react-utilities to v9.15.1",
|
|
89
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-table",
|
|
94
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.18",
|
|
95
|
+
"commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": "Thu, 12 Oct 2023 14:55:44 GMT",
|
|
6
102
|
"tag": "@fluentui/react-table_v9.10.5",
|
|
7
103
|
"version": "9.10.5",
|
|
8
104
|
"comments": {
|
|
@@ -11,25 +107,25 @@
|
|
|
11
107
|
"author": "beachball",
|
|
12
108
|
"package": "@fluentui/react-table",
|
|
13
109
|
"comment": "Bump @fluentui/react-avatar to v9.5.40",
|
|
14
|
-
"commit": "
|
|
110
|
+
"commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
|
|
15
111
|
},
|
|
16
112
|
{
|
|
17
113
|
"author": "beachball",
|
|
18
114
|
"package": "@fluentui/react-table",
|
|
19
115
|
"comment": "Bump @fluentui/react-checkbox to v9.1.50",
|
|
20
|
-
"commit": "
|
|
116
|
+
"commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
|
|
21
117
|
},
|
|
22
118
|
{
|
|
23
119
|
"author": "beachball",
|
|
24
120
|
"package": "@fluentui/react-table",
|
|
25
121
|
"comment": "Bump @fluentui/react-radio to v9.1.50",
|
|
26
|
-
"commit": "
|
|
122
|
+
"commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
|
|
27
123
|
},
|
|
28
124
|
{
|
|
29
125
|
"author": "beachball",
|
|
30
126
|
"package": "@fluentui/react-table",
|
|
31
127
|
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.17",
|
|
32
|
-
"commit": "
|
|
128
|
+
"commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
|
|
33
129
|
}
|
|
34
130
|
]
|
|
35
131
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,49 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 23 Oct 2023 09:48:55 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.10.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.10.7)
|
|
8
|
+
|
|
9
|
+
Mon, 23 Oct 2023 09:48:55 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.10.6..@fluentui/react-table_v9.10.7)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: use targetDocument resize observer ([PR #29551](https://github.com/microsoft/fluentui/pull/29551) by lingfangao@hotmail.com)
|
|
15
|
+
- Bump @fluentui/react-avatar to v9.5.42 ([commit](https://github.com/microsoft/fluentui/commit/e4ef1febe8a185dddc10f8936944d177d50bc396) by beachball)
|
|
16
|
+
- Bump @fluentui/react-checkbox to v9.1.52 ([commit](https://github.com/microsoft/fluentui/commit/e4ef1febe8a185dddc10f8936944d177d50bc396) by beachball)
|
|
17
|
+
- Bump @fluentui/react-radio to v9.1.52 ([commit](https://github.com/microsoft/fluentui/commit/e4ef1febe8a185dddc10f8936944d177d50bc396) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v9.14.1 ([commit](https://github.com/microsoft/fluentui/commit/e4ef1febe8a185dddc10f8936944d177d50bc396) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.10.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.10.6)
|
|
21
|
+
|
|
22
|
+
Wed, 18 Oct 2023 17:54:08 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.10.5..@fluentui/react-table_v9.10.6)
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- Bump @fluentui/react-aria to v9.3.43 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
28
|
+
- Bump @fluentui/react-avatar to v9.5.41 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
29
|
+
- Bump @fluentui/react-checkbox to v9.1.51 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
30
|
+
- Bump @fluentui/react-context-selector to v9.1.41 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
31
|
+
- Bump @fluentui/react-radio to v9.1.51 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
32
|
+
- Bump @fluentui/react-tabster to v9.14.0 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
33
|
+
- Bump @fluentui/react-utilities to v9.15.1 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
34
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.18 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
|
|
35
|
+
|
|
7
36
|
## [9.10.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.10.5)
|
|
8
37
|
|
|
9
|
-
Thu, 12 Oct 2023 14:
|
|
38
|
+
Thu, 12 Oct 2023 14:55:44 GMT
|
|
10
39
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.10.4..@fluentui/react-table_v9.10.5)
|
|
11
40
|
|
|
12
41
|
### Patches
|
|
13
42
|
|
|
14
|
-
- Bump @fluentui/react-avatar to v9.5.40 ([PR #
|
|
15
|
-
- Bump @fluentui/react-checkbox to v9.1.50 ([PR #
|
|
16
|
-
- Bump @fluentui/react-radio to v9.1.50 ([PR #
|
|
17
|
-
- Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #
|
|
43
|
+
- Bump @fluentui/react-avatar to v9.5.40 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
|
|
44
|
+
- Bump @fluentui/react-checkbox to v9.1.50 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
|
|
45
|
+
- Bump @fluentui/react-radio to v9.1.50 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
|
|
46
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
|
|
18
47
|
|
|
19
48
|
## [9.10.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.10.4)
|
|
20
49
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { canUseDOM } from '@fluentui/react-utilities';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
4
3
|
/**
|
|
@@ -17,7 +16,7 @@ import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts
|
|
|
17
16
|
setWidth(containerWidth || 0);
|
|
18
17
|
}, []);
|
|
19
18
|
// Keep the reference of ResizeObserver in the state, as it should live through renders
|
|
20
|
-
const [resizeObserver] = React.useState(
|
|
19
|
+
const [resizeObserver] = React.useState(()=>createResizeObserverFromDocument(targetDocument, handleResize));
|
|
21
20
|
const measureElementRef = React.useCallback((el)=>{
|
|
22
21
|
if (!targetDocument || !resizeObserver) {
|
|
23
22
|
return;
|
|
@@ -47,3 +46,16 @@ import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts
|
|
|
47
46
|
measureElementRef
|
|
48
47
|
};
|
|
49
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar
|
|
51
|
+
* A utility method that creates a ResizeObserver from a target document
|
|
52
|
+
* @param targetDocument - document to use to create the ResizeObserver
|
|
53
|
+
* @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback
|
|
54
|
+
* @returns a ResizeObserver instance or null if the global does not exist on the document
|
|
55
|
+
*/ export function createResizeObserverFromDocument(targetDocument, callback) {
|
|
56
|
+
var _targetDocument_defaultView;
|
|
57
|
+
if (!(targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.ResizeObserver)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return new targetDocument.defaultView.ResizeObserver(callback);
|
|
61
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useMeasureElement.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["useMeasureElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * Provides a way of reporting element width.\n * Returns\n * `width` - current element width (0 by default),\n * `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure\n */\nexport function useMeasureElement<TElement extends HTMLElement = HTMLElement>() {\n const [width, setWidth] = React.useState(0);\n const container = React.useRef<HTMLElement | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n\n // the handler for resize observer\n const handleResize = React.useCallback(() => {\n const containerWidth = container.current?.getBoundingClientRect().width;\n setWidth(containerWidth || 0);\n }, []);\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(() => createResizeObserverFromDocument(targetDocument, handleResize));\n const measureElementRef = React.useCallback(\n (el: TElement | null) => {\n if (!targetDocument || !resizeObserver) {\n return;\n }\n\n // cleanup previous container\n if (container.current) {\n resizeObserver.unobserve(container.current);\n }\n\n container.current = undefined;\n if (el?.parentElement) {\n container.current = el.parentElement;\n resizeObserver.observe(container.current);\n handleResize();\n }\n },\n [targetDocument, resizeObserver, handleResize],\n );\n\n React.useEffect(() => {\n return () => resizeObserver?.disconnect();\n }, [resizeObserver]);\n\n return { width, measureElementRef };\n}\n\n/**\n * FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar\n * A utility method that creates a ResizeObserver from a target document\n * @param targetDocument - document to use to create the ResizeObserver\n * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback\n * @returns a ResizeObserver instance or null if the global does not exist on the document\n */\nexport function createResizeObserverFromDocument(\n targetDocument: Document | null | undefined,\n callback: ResizeObserverCallback,\n) {\n if (!targetDocument?.defaultView?.ResizeObserver) {\n return null;\n }\n\n return new targetDocument.defaultView.ResizeObserver(callback);\n}\n"],"names":["React","useFluent_unstable","useFluent","useMeasureElement","width","setWidth","useState","container","useRef","undefined","targetDocument","handleResize","useCallback","containerWidth","current","getBoundingClientRect","resizeObserver","createResizeObserverFromDocument","measureElementRef","el","unobserve","parentElement","observe","useEffect","disconnect","callback","defaultView","ResizeObserver"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF;;;;;CAKC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAOC,SAAS,GAAGL,MAAMM,QAAQ,CAAC;IACzC,MAAMC,YAAYP,MAAMQ,MAAM,CAA0BC;IAExD,MAAM,EAAEC,cAAc,EAAE,GAAGR;IAE3B,kCAAkC;IAClC,MAAMS,eAAeX,MAAMY,WAAW,CAAC;YACdL;QAAvB,MAAMM,kBAAiBN,qBAAAA,UAAUO,OAAO,cAAjBP,yCAAAA,mBAAmBQ,qBAAqB,GAAGX,KAAK;QACvEC,SAASQ,kBAAkB;IAC7B,GAAG,EAAE;IAEL,uFAAuF;IACvF,MAAM,CAACG,eAAe,GAAGhB,MAAMM,QAAQ,CAAC,IAAMW,iCAAiCP,gBAAgBC;IAC/F,MAAMO,oBAAoBlB,MAAMY,WAAW,CACzC,CAACO;QACC,IAAI,CAACT,kBAAkB,CAACM,gBAAgB;YACtC;QACF;QAEA,6BAA6B;QAC7B,IAAIT,UAAUO,OAAO,EAAE;YACrBE,eAAeI,SAAS,CAACb,UAAUO,OAAO;QAC5C;QAEAP,UAAUO,OAAO,GAAGL;QACpB,IAAIU,eAAAA,yBAAAA,GAAIE,aAAa,EAAE;YACrBd,UAAUO,OAAO,GAAGK,GAAGE,aAAa;YACpCL,eAAeM,OAAO,CAACf,UAAUO,OAAO;YACxCH;QACF;IACF,GACA;QAACD;QAAgBM;QAAgBL;KAAa;IAGhDX,MAAMuB,SAAS,CAAC;QACd,OAAO,IAAMP,2BAAAA,qCAAAA,eAAgBQ,UAAU;IACzC,GAAG;QAACR;KAAe;IAEnB,OAAO;QAAEZ;QAAOc;IAAkB;AACpC;AAEA;;;;;;CAMC,GACD,OAAO,SAASD,iCACdP,cAA2C,EAC3Ce,QAAgC;QAE3Bf;IAAL,IAAI,EAACA,2BAAAA,sCAAAA,8BAAAA,eAAgBgB,WAAW,cAA3BhB,kDAAAA,4BAA6BiB,cAAc,GAAE;QAChD,OAAO;IACT;IAEA,OAAO,IAAIjB,eAAegB,WAAW,CAACC,cAAc,CAACF;AACvD"}
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
useMeasureElement: function() {
|
|
8
13
|
return useMeasureElement;
|
|
14
|
+
},
|
|
15
|
+
createResizeObserverFromDocument: function() {
|
|
16
|
+
return createResizeObserverFromDocument;
|
|
9
17
|
}
|
|
10
18
|
});
|
|
11
19
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
20
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
21
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
22
|
function useMeasureElement() {
|
|
@@ -23,7 +30,7 @@ function useMeasureElement() {
|
|
|
23
30
|
setWidth(containerWidth || 0);
|
|
24
31
|
}, []);
|
|
25
32
|
// Keep the reference of ResizeObserver in the state, as it should live through renders
|
|
26
|
-
const [resizeObserver] = _react.useState((
|
|
33
|
+
const [resizeObserver] = _react.useState(()=>createResizeObserverFromDocument(targetDocument, handleResize));
|
|
27
34
|
const measureElementRef = _react.useCallback((el)=>{
|
|
28
35
|
if (!targetDocument || !resizeObserver) {
|
|
29
36
|
return;
|
|
@@ -53,3 +60,10 @@ function useMeasureElement() {
|
|
|
53
60
|
measureElementRef
|
|
54
61
|
};
|
|
55
62
|
}
|
|
63
|
+
function createResizeObserverFromDocument(targetDocument, callback) {
|
|
64
|
+
var _targetDocument_defaultView;
|
|
65
|
+
if (!(targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.ResizeObserver)) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return new targetDocument.defaultView.ResizeObserver(callback);
|
|
69
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useMeasureElement.js"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["useMeasureElement.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n/**\n * Provides a way of reporting element width.\n * Returns\n * `width` - current element width (0 by default),\n * `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure\n */ export function useMeasureElement() {\n const [width, setWidth] = React.useState(0);\n const container = React.useRef(undefined);\n const { targetDocument } = useFluent();\n // the handler for resize observer\n const handleResize = React.useCallback(()=>{\n var _container_current;\n const containerWidth = (_container_current = container.current) === null || _container_current === void 0 ? void 0 : _container_current.getBoundingClientRect().width;\n setWidth(containerWidth || 0);\n }, []);\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(()=>createResizeObserverFromDocument(targetDocument, handleResize));\n const measureElementRef = React.useCallback((el)=>{\n if (!targetDocument || !resizeObserver) {\n return;\n }\n // cleanup previous container\n if (container.current) {\n resizeObserver.unobserve(container.current);\n }\n container.current = undefined;\n if (el === null || el === void 0 ? void 0 : el.parentElement) {\n container.current = el.parentElement;\n resizeObserver.observe(container.current);\n handleResize();\n }\n }, [\n targetDocument,\n resizeObserver,\n handleResize\n ]);\n React.useEffect(()=>{\n return ()=>resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();\n }, [\n resizeObserver\n ]);\n return {\n width,\n measureElementRef\n };\n}\n/**\n * FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar\n * A utility method that creates a ResizeObserver from a target document\n * @param targetDocument - document to use to create the ResizeObserver\n * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback\n * @returns a ResizeObserver instance or null if the global does not exist on the document\n */ export function createResizeObserverFromDocument(targetDocument, callback) {\n var _targetDocument_defaultView;\n if (!(targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.ResizeObserver)) {\n return null;\n }\n return new targetDocument.defaultView.ResizeObserver(callback);\n}\n"],"names":["useMeasureElement","createResizeObserverFromDocument","width","setWidth","React","useState","container","useRef","undefined","targetDocument","useFluent","handleResize","useCallback","_container_current","containerWidth","current","getBoundingClientRect","resizeObserver","measureElementRef","el","unobserve","parentElement","observe","useEffect","disconnect","callback","_targetDocument_defaultView","defaultView","ResizeObserver"],"mappings":";;;;;;;;;;;IAOoBA,iBAAiB;eAAjBA;;IA+CAC,gCAAgC;eAAhCA;;;;iEAtDG;qCACyB;AAMrC,SAASD;IAChB,MAAM,CAACE,OAAOC,SAAS,GAAGC,OAAMC,QAAQ,CAAC;IACzC,MAAMC,YAAYF,OAAMG,MAAM,CAACC;IAC/B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,kCAAkC;IAClC,MAAMC,eAAeP,OAAMQ,WAAW,CAAC;QACnC,IAAIC;QACJ,MAAMC,iBAAiB,AAACD,CAAAA,qBAAqBP,UAAUS,OAAO,AAAD,MAAO,QAAQF,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBG,qBAAqB,GAAGd,KAAK;QACrKC,SAASW,kBAAkB;IAC/B,GAAG,EAAE;IACL,uFAAuF;IACvF,MAAM,CAACG,eAAe,GAAGb,OAAMC,QAAQ,CAAC,IAAIJ,iCAAiCQ,gBAAgBE;IAC7F,MAAMO,oBAAoBd,OAAMQ,WAAW,CAAC,CAACO;QACzC,IAAI,CAACV,kBAAkB,CAACQ,gBAAgB;YACpC;QACJ;QACA,6BAA6B;QAC7B,IAAIX,UAAUS,OAAO,EAAE;YACnBE,eAAeG,SAAS,CAACd,UAAUS,OAAO;QAC9C;QACAT,UAAUS,OAAO,GAAGP;QACpB,IAAIW,OAAO,QAAQA,OAAO,KAAK,IAAI,KAAK,IAAIA,GAAGE,aAAa,EAAE;YAC1Df,UAAUS,OAAO,GAAGI,GAAGE,aAAa;YACpCJ,eAAeK,OAAO,CAAChB,UAAUS,OAAO;YACxCJ;QACJ;IACJ,GAAG;QACCF;QACAQ;QACAN;KACH;IACDP,OAAMmB,SAAS,CAAC;QACZ,OAAO,IAAIN,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeO,UAAU;IACxG,GAAG;QACCP;KACH;IACD,OAAO;QACHf;QACAgB;IACJ;AACJ;AAOW,SAASjB,iCAAiCQ,cAAc,EAAEgB,QAAQ;IACzE,IAAIC;IACJ,IAAI,CAAEjB,CAAAA,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAI,AAACiB,CAAAA,8BAA8BjB,eAAekB,WAAW,AAAD,MAAO,QAAQD,gCAAgC,KAAK,IAAI,KAAK,IAAIA,4BAA4BE,cAAc,AAAD,GAAI;QACxO,OAAO;IACX;IACA,OAAO,IAAInB,eAAekB,WAAW,CAACC,cAAc,CAACH;AACzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
|
-
"version": "9.10.
|
|
3
|
+
"version": "9.10.7",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@fluentui/keyboard-keys": "^9.0.6",
|
|
39
|
-
"@fluentui/react-aria": "^9.3.
|
|
40
|
-
"@fluentui/react-avatar": "^9.5.
|
|
41
|
-
"@fluentui/react-checkbox": "^9.1.
|
|
42
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
39
|
+
"@fluentui/react-aria": "^9.3.43",
|
|
40
|
+
"@fluentui/react-avatar": "^9.5.42",
|
|
41
|
+
"@fluentui/react-checkbox": "^9.1.52",
|
|
42
|
+
"@fluentui/react-context-selector": "^9.1.41",
|
|
43
43
|
"@fluentui/react-icons": "^2.0.217",
|
|
44
|
-
"@fluentui/react-radio": "^9.1.
|
|
44
|
+
"@fluentui/react-radio": "^9.1.52",
|
|
45
45
|
"@fluentui/react-shared-contexts": "^9.10.0",
|
|
46
|
-
"@fluentui/react-tabster": "^9.
|
|
46
|
+
"@fluentui/react-tabster": "^9.14.1",
|
|
47
47
|
"@fluentui/react-theme": "^9.1.14",
|
|
48
|
-
"@fluentui/react-utilities": "^9.15.
|
|
49
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
48
|
+
"@fluentui/react-utilities": "^9.15.1",
|
|
49
|
+
"@fluentui/react-jsx-runtime": "^9.0.18",
|
|
50
50
|
"@griffel/react": "^1.5.14",
|
|
51
51
|
"@swc/helpers": "^0.5.1"
|
|
52
52
|
},
|