@fluentui/react-overflow 9.0.11 → 9.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +73 -1
- package/CHANGELOG.md +27 -2
- package/lib/components/Overflow.js +2 -2
- package/lib/components/Overflow.js.map +1 -1
- package/lib/components/OverflowItem/OverflowItem.js.map +1 -1
- package/lib/components/OverflowItem/OverflowItem.types.js +1 -1
- package/lib/components/OverflowItem/OverflowItem.types.js.map +1 -1
- package/lib/components/OverflowItem/index.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/overflowContext.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/useIsOverflowGroupVisible.js.map +1 -1
- package/lib/useIsOverflowItemVisible.js.map +1 -1
- package/lib/useOverflowContainer.js.map +1 -1
- package/lib/useOverflowCount.js.map +1 -1
- package/lib/useOverflowItem.js.map +1 -1
- package/lib/useOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Overflow.js +62 -70
- package/lib-commonjs/components/Overflow.js.map +1 -1
- package/lib-commonjs/components/OverflowItem/OverflowItem.js +16 -21
- package/lib-commonjs/components/OverflowItem/OverflowItem.js.map +1 -1
- package/lib-commonjs/components/OverflowItem/OverflowItem.types.js +5 -2
- package/lib-commonjs/components/OverflowItem/OverflowItem.types.js.map +1 -1
- package/lib-commonjs/components/OverflowItem/index.js +6 -8
- package/lib-commonjs/components/OverflowItem/index.js.map +1 -1
- package/lib-commonjs/constants.js +16 -6
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/index.js +34 -86
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/overflowContext.js +21 -16
- package/lib-commonjs/overflowContext.js.map +1 -1
- package/lib-commonjs/types.js +5 -2
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/useIsOverflowGroupVisible.js +9 -11
- package/lib-commonjs/useIsOverflowGroupVisible.js.map +1 -1
- package/lib-commonjs/useIsOverflowItemVisible.js +9 -11
- package/lib-commonjs/useIsOverflowItemVisible.js.map +1 -1
- package/lib-commonjs/useOverflowContainer.js +87 -80
- package/lib-commonjs/useOverflowContainer.js.map +1 -1
- package/lib-commonjs/useOverflowCount.js +14 -15
- package/lib-commonjs/useOverflowCount.js.map +1 -1
- package/lib-commonjs/useOverflowItem.js +27 -27
- package/lib-commonjs/useOverflowItem.js.map +1 -1
- package/lib-commonjs/useOverflowMenu.js +41 -30
- package/lib-commonjs/useOverflowMenu.js.map +1 -1
- package/package.json +8 -7
- package/lib-amd/components/Overflow.js +0 -60
- package/lib-amd/components/Overflow.js.map +0 -1
- package/lib-amd/components/OverflowItem/OverflowItem.js +0 -17
- package/lib-amd/components/OverflowItem/OverflowItem.js.map +0 -1
- package/lib-amd/components/OverflowItem/OverflowItem.types.js +0 -5
- package/lib-amd/components/OverflowItem/OverflowItem.types.js.map +0 -1
- package/lib-amd/constants.js +0 -9
- package/lib-amd/constants.js.map +0 -1
- package/lib-amd/index.js +0 -18
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/overflowContext.js +0 -25
- package/lib-amd/overflowContext.js.map +0 -1
- package/lib-amd/types.js +0 -5
- package/lib-amd/types.js.map +0 -1
- package/lib-amd/useIsOverflowGroupVisible.js +0 -14
- package/lib-amd/useIsOverflowGroupVisible.js.map +0 -1
- package/lib-amd/useIsOverflowItemVisible.js +0 -14
- package/lib-amd/useIsOverflowItemVisible.js.map +0 -1
- package/lib-amd/useOverflowContainer.js +0 -84
- package/lib-amd/useOverflowContainer.js.map +0 -1
- package/lib-amd/useOverflowCount.js +0 -21
- package/lib-amd/useOverflowCount.js.map +0 -1
- package/lib-amd/useOverflowItem.js +0 -30
- package/lib-amd/useOverflowItem.js.map +0 -1
- package/lib-amd/useOverflowMenu.js +0 -26
- package/lib-amd/useOverflowMenu.js.map +0 -1
@@ -1,26 +1,21 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
exports
|
7
|
-
|
8
|
-
|
9
|
-
const useOverflowItem_1 = /*#__PURE__*/require("../../useOverflowItem");
|
10
|
-
/**
|
11
|
-
* Attaches overflow item behavior to its child registered with the OverflowContext.
|
12
|
-
* It does not render an element of its own.
|
13
|
-
*/
|
14
|
-
exports.OverflowItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
15
|
-
const {
|
16
|
-
id,
|
17
|
-
groupId,
|
18
|
-
priority,
|
19
|
-
children
|
20
|
-
} = props;
|
21
|
-
const containerRef = useOverflowItem_1.useOverflowItem(id, priority, groupId);
|
22
|
-
return react_utilities_1.applyTriggerPropsToChildren(children, {
|
23
|
-
ref: react_utilities_1.useMergedRefs(containerRef, ref)
|
24
|
-
});
|
5
|
+
Object.defineProperty(exports, "OverflowItem", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>OverflowItem
|
25
8
|
});
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
12
|
+
const _useOverflowItem = require("../../useOverflowItem");
|
13
|
+
const OverflowItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
14
|
+
const { id , groupId , priority , children } = props;
|
15
|
+
const containerRef = (0, _useOverflowItem.useOverflowItem)(id, priority, groupId);
|
16
|
+
return (0, _reactUtilities.applyTriggerPropsToChildren)(children, {
|
17
|
+
ref: (0, _reactUtilities.useMergedRefs)(containerRef, ref)
|
18
|
+
});
|
19
|
+
}); //# sourceMappingURL=OverflowItem.js.map
|
20
|
+
|
26
21
|
//# sourceMappingURL=OverflowItem.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/OverflowItem/OverflowItem.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOverflowItem } from '../../useOverflowItem';\n/**\n * Attaches overflow item behavior to its child registered with the OverflowContext.\n * It does not render an element of its own.\n */\nexport const OverflowItem = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n id,\n groupId,\n priority,\n children\n } = props;\n const containerRef = useOverflowItem(id, priority, groupId);\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref)\n });\n});\n//# sourceMappingURL=OverflowItem.js.map"],"names":["OverflowItem","React","forwardRef","props","ref","id","groupId","priority","children","containerRef","useOverflowItem","applyTriggerPropsToChildren","useMergedRefs"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;gCACoC;iCAC3B;AAKzB,MAAMA,eAAe,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACxE,MAAM,EACJC,GAAE,EACFC,QAAO,EACPC,SAAQ,EACRC,SAAQ,EACT,GAAGL;IACJ,MAAMM,eAAeC,IAAAA,gCAAe,EAACL,IAAIE,UAAUD;IACnD,OAAOK,IAAAA,2CAA2B,EAACH,UAAU;QAC3CJ,KAAKQ,IAAAA,6BAAa,EAACH,cAAcL;IACnC;AACF,IACA,wCAAwC"}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
7
|
+
//# sourceMappingURL=OverflowItem.types.js.map
|
8
|
+
|
6
9
|
//# sourceMappingURL=OverflowItem.types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/OverflowItem/OverflowItem.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=OverflowItem.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,8CAA8C"}
|
@@ -1,14 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
exports.OverflowItem = void 0;
|
7
|
-
var OverflowItem_1 = /*#__PURE__*/require("./OverflowItem");
|
8
5
|
Object.defineProperty(exports, "OverflowItem", {
|
9
|
-
|
10
|
-
|
11
|
-
return OverflowItem_1.OverflowItem;
|
12
|
-
}
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>_overflowItem.OverflowItem
|
13
8
|
});
|
9
|
+
const _overflowItem = require("./OverflowItem");
|
10
|
+
//# sourceMappingURL=index.js.map
|
11
|
+
|
14
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/OverflowItem/index.js"],"sourcesContent":["export { OverflowItem } from './OverflowItem';\n//# sourceMappingURL=index.js.map"],"names":["OverflowItem"],"mappings":";;;;+BAASA;;aAAAA,0BAAY;;8BAAQ;CAC7B,iCAAiC"}
|
@@ -1,10 +1,20 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
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
|
+
DATA_OVERFLOWING: ()=>DATA_OVERFLOWING,
|
13
|
+
DATA_OVERFLOW_ITEM: ()=>DATA_OVERFLOW_ITEM,
|
14
|
+
DATA_OVERFLOW_MENU: ()=>DATA_OVERFLOW_MENU
|
5
15
|
});
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
16
|
+
const DATA_OVERFLOWING = 'data-overflowing';
|
17
|
+
const DATA_OVERFLOW_ITEM = 'data-overflow-item';
|
18
|
+
const DATA_OVERFLOW_MENU = 'data-overflow-menu'; //# sourceMappingURL=constants.js.map
|
19
|
+
|
10
20
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/constants.js"],"sourcesContent":["export const DATA_OVERFLOWING = 'data-overflowing';\nexport const DATA_OVERFLOW_ITEM = 'data-overflow-item';\nexport const DATA_OVERFLOW_MENU = 'data-overflow-menu';\n//# sourceMappingURL=constants.js.map"],"names":["DATA_OVERFLOWING","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU"],"mappings":";;;;;;;;;;;IAAaA,gBAAgB,MAAhBA;IACAC,kBAAkB,MAAlBA;IACAC,kBAAkB,MAAlBA;;AAFN,MAAMF,mBAAmB;AACzB,MAAMC,qBAAqB;AAC3B,MAAMC,qBAAqB,sBAClC,qCAAqC"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,89 +1,37 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
});
|
40
|
-
var useIsOverflowItemVisible_1 = /*#__PURE__*/require("./useIsOverflowItemVisible");
|
41
|
-
Object.defineProperty(exports, "useIsOverflowItemVisible", {
|
42
|
-
enumerable: true,
|
43
|
-
get: function () {
|
44
|
-
return useIsOverflowItemVisible_1.useIsOverflowItemVisible;
|
45
|
-
}
|
46
|
-
});
|
47
|
-
var useOverflowContainer_1 = /*#__PURE__*/require("./useOverflowContainer");
|
48
|
-
Object.defineProperty(exports, "useOverflowContainer", {
|
49
|
-
enumerable: true,
|
50
|
-
get: function () {
|
51
|
-
return useOverflowContainer_1.useOverflowContainer;
|
52
|
-
}
|
53
|
-
});
|
54
|
-
var useOverflowCount_1 = /*#__PURE__*/require("./useOverflowCount");
|
55
|
-
Object.defineProperty(exports, "useOverflowCount", {
|
56
|
-
enumerable: true,
|
57
|
-
get: function () {
|
58
|
-
return useOverflowCount_1.useOverflowCount;
|
59
|
-
}
|
60
|
-
});
|
61
|
-
var useOverflowItem_1 = /*#__PURE__*/require("./useOverflowItem");
|
62
|
-
Object.defineProperty(exports, "useOverflowItem", {
|
63
|
-
enumerable: true,
|
64
|
-
get: function () {
|
65
|
-
return useOverflowItem_1.useOverflowItem;
|
66
|
-
}
|
67
|
-
});
|
68
|
-
var useOverflowMenu_1 = /*#__PURE__*/require("./useOverflowMenu");
|
69
|
-
Object.defineProperty(exports, "useOverflowMenu", {
|
70
|
-
enumerable: true,
|
71
|
-
get: function () {
|
72
|
-
return useOverflowMenu_1.useOverflowMenu;
|
73
|
-
}
|
74
|
-
});
|
75
|
-
var overflowContext_1 = /*#__PURE__*/require("./overflowContext");
|
76
|
-
Object.defineProperty(exports, "useOverflowContext", {
|
77
|
-
enumerable: true,
|
78
|
-
get: function () {
|
79
|
-
return overflowContext_1.useOverflowContext;
|
80
|
-
}
|
81
|
-
});
|
82
|
-
var OverflowItem_1 = /*#__PURE__*/require("./components/OverflowItem/OverflowItem");
|
83
|
-
Object.defineProperty(exports, "OverflowItem", {
|
84
|
-
enumerable: true,
|
85
|
-
get: function () {
|
86
|
-
return OverflowItem_1.OverflowItem;
|
87
|
-
}
|
88
|
-
});
|
3
|
+
value: true
|
4
|
+
});
|
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
|
+
Overflow: ()=>_overflow.Overflow,
|
13
|
+
DATA_OVERFLOWING: ()=>_constants.DATA_OVERFLOWING,
|
14
|
+
DATA_OVERFLOW_ITEM: ()=>_constants.DATA_OVERFLOW_ITEM,
|
15
|
+
DATA_OVERFLOW_MENU: ()=>_constants.DATA_OVERFLOW_MENU,
|
16
|
+
useIsOverflowGroupVisible: ()=>_useIsOverflowGroupVisible.useIsOverflowGroupVisible,
|
17
|
+
useIsOverflowItemVisible: ()=>_useIsOverflowItemVisible.useIsOverflowItemVisible,
|
18
|
+
useOverflowContainer: ()=>_useOverflowContainer.useOverflowContainer,
|
19
|
+
useOverflowCount: ()=>_useOverflowCount.useOverflowCount,
|
20
|
+
useOverflowItem: ()=>_useOverflowItem.useOverflowItem,
|
21
|
+
useOverflowMenu: ()=>_useOverflowMenu.useOverflowMenu,
|
22
|
+
useOverflowContext: ()=>_overflowContext.useOverflowContext,
|
23
|
+
OverflowItem: ()=>_overflowItem.OverflowItem
|
24
|
+
});
|
25
|
+
const _overflow = require("./components/Overflow");
|
26
|
+
const _constants = require("./constants");
|
27
|
+
const _useIsOverflowGroupVisible = require("./useIsOverflowGroupVisible");
|
28
|
+
const _useIsOverflowItemVisible = require("./useIsOverflowItemVisible");
|
29
|
+
const _useOverflowContainer = require("./useOverflowContainer");
|
30
|
+
const _useOverflowCount = require("./useOverflowCount");
|
31
|
+
const _useOverflowItem = require("./useOverflowItem");
|
32
|
+
const _useOverflowMenu = require("./useOverflowMenu");
|
33
|
+
const _overflowContext = require("./overflowContext");
|
34
|
+
const _overflowItem = require("./components/OverflowItem/OverflowItem");
|
35
|
+
//# sourceMappingURL=index.js.map
|
36
|
+
|
89
37
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Overflow } from './components/Overflow';\nexport { DATA_OVERFLOWING, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\nexport { useIsOverflowGroupVisible } from './useIsOverflowGroupVisible';\nexport { useIsOverflowItemVisible } from './useIsOverflowItemVisible';\nexport { useOverflowContainer } from './useOverflowContainer';\nexport { useOverflowCount } from './useOverflowCount';\nexport { useOverflowItem } from './useOverflowItem';\nexport { useOverflowMenu } from './useOverflowMenu';\nexport { useOverflowContext } from './overflowContext';\nexport { OverflowItem } from './components/OverflowItem/OverflowItem';\n//# sourceMappingURL=index.js.map"],"names":["Overflow","DATA_OVERFLOWING","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU","useIsOverflowGroupVisible","useIsOverflowItemVisible","useOverflowContainer","useOverflowCount","useOverflowItem","useOverflowMenu","useOverflowContext","OverflowItem"],"mappings":";;;;;;;;;;;IAASA,QAAQ,MAARA,kBAAQ;IACRC,gBAAgB,MAAhBA,2BAAgB;IAAEC,kBAAkB,MAAlBA,6BAAkB;IAAEC,kBAAkB,MAAlBA,6BAAkB;IACxDC,yBAAyB,MAAzBA,oDAAyB;IACzBC,wBAAwB,MAAxBA,kDAAwB;IACxBC,oBAAoB,MAApBA,0CAAoB;IACpBC,gBAAgB,MAAhBA,kCAAgB;IAChBC,eAAe,MAAfA,gCAAe;IACfC,eAAe,MAAfA,gCAAe;IACfC,kBAAkB,MAAlBA,mCAAkB;IAClBC,YAAY,MAAZA,0BAAY;;0BATI;2BACgD;2CAC/B;0CACD;sCACJ;kCACJ;iCACD;iCACA;iCACG;8BACN;CAC7B,iCAAiC"}
|
@@ -1,22 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
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
|
+
OverflowContext: ()=>OverflowContext,
|
13
|
+
useOverflowContext: ()=>useOverflowContext
|
5
14
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
exports.OverflowContext = /*#__PURE__*/react_context_selector_1.createContext(undefined);
|
15
|
+
const _reactContextSelector = require("@fluentui/react-context-selector");
|
16
|
+
const OverflowContext = /*#__PURE__*/ (0, _reactContextSelector.createContext)(undefined);
|
9
17
|
const overflowContextDefaultValue = {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
itemVisibility: {},
|
19
|
+
groupVisibility: {},
|
20
|
+
hasOverflow: false,
|
21
|
+
registerItem: ()=>()=>null,
|
22
|
+
updateOverflow: ()=>null,
|
23
|
+
registerOverflowMenu: ()=>()=>null
|
16
24
|
};
|
17
|
-
|
18
|
-
|
19
|
-
*/
|
20
|
-
const useOverflowContext = selector => react_context_selector_1.useContextSelector(exports.OverflowContext, (ctx = overflowContextDefaultValue) => selector(ctx));
|
21
|
-
exports.useOverflowContext = useOverflowContext;
|
25
|
+
const useOverflowContext = (selector)=>(0, _reactContextSelector.useContextSelector)(OverflowContext, (ctx = overflowContextDefaultValue)=>selector(ctx)); //# sourceMappingURL=overflowContext.js.map
|
26
|
+
|
22
27
|
//# sourceMappingURL=overflowContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/overflowContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const OverflowContext = /*#__PURE__*/createContext(undefined);\nconst overflowContextDefaultValue = {\n itemVisibility: {},\n groupVisibility: {},\n hasOverflow: false,\n registerItem: () => () => null,\n updateOverflow: () => null,\n registerOverflowMenu: () => () => null\n};\n/**\n * @internal\n */\nexport const useOverflowContext = selector => useContextSelector(OverflowContext, (ctx = overflowContextDefaultValue) => selector(ctx));\n//# sourceMappingURL=overflowContext.js.map"],"names":["OverflowContext","useOverflowContext","createContext","undefined","overflowContextDefaultValue","itemVisibility","groupVisibility","hasOverflow","registerItem","updateOverflow","registerOverflowMenu","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IACaA,eAAe,MAAfA;IAYAC,kBAAkB,MAAlBA;;sCAbqC;AAC3C,MAAMD,kBAAkB,WAAW,GAAEE,IAAAA,mCAAa,EAACC;AAC1D,MAAMC,8BAA8B;IAClCC,gBAAgB,CAAC;IACjBC,iBAAiB,CAAC;IAClBC,aAAa,KAAK;IAClBC,cAAc,IAAM,IAAM,IAAI;IAC9BC,gBAAgB,IAAM,IAAI;IAC1BC,sBAAsB,IAAM,IAAM,IAAI;AACxC;AAIO,MAAMT,qBAAqBU,CAAAA,WAAYC,IAAAA,wCAAkB,EAACZ,iBAAiB,CAACa,MAAMT,2BAA2B,GAAKO,SAASE,OAClI,2CAA2C"}
|
package/lib-commonjs/types.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
7
|
+
//# sourceMappingURL=types.js.map
|
8
|
+
|
6
9
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}
|
@@ -1,16 +1,14 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useIsOverflowGroupVisible", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useIsOverflowGroupVisible
|
5
8
|
});
|
6
|
-
|
7
|
-
const overflowContext_1 = /*#__PURE__*/require("./overflowContext");
|
8
|
-
/**
|
9
|
-
* @param id - unique identifier for a group of overflow items
|
10
|
-
* @returns visibility state of the group
|
11
|
-
*/
|
9
|
+
const _overflowContext = require("./overflowContext");
|
12
10
|
function useIsOverflowGroupVisible(id) {
|
13
|
-
|
14
|
-
}
|
15
|
-
|
11
|
+
return (0, _overflowContext.useOverflowContext)((ctx)=>ctx.groupVisibility[id]);
|
12
|
+
} //# sourceMappingURL=useIsOverflowGroupVisible.js.map
|
13
|
+
|
16
14
|
//# sourceMappingURL=useIsOverflowGroupVisible.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/useIsOverflowGroupVisible.js"],"sourcesContent":["import { useOverflowContext } from './overflowContext';\n/**\n * @param id - unique identifier for a group of overflow items\n * @returns visibility state of the group\n */\nexport function useIsOverflowGroupVisible(id) {\n return useOverflowContext(ctx => ctx.groupVisibility[id]);\n}\n//# sourceMappingURL=useIsOverflowGroupVisible.js.map"],"names":["useIsOverflowGroupVisible","id","useOverflowContext","ctx","groupVisibility"],"mappings":";;;;+BAKgBA;;aAAAA;;iCALmB;AAK5B,SAASA,0BAA0BC,EAAE,EAAE;IAC5C,OAAOC,IAAAA,mCAAkB,EAACC,CAAAA,MAAOA,IAAIC,eAAe,CAACH,GAAG;AAC1D,EACA,qDAAqD"}
|
@@ -1,16 +1,14 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useIsOverflowItemVisible", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useIsOverflowItemVisible
|
5
8
|
});
|
6
|
-
|
7
|
-
const overflowContext_1 = /*#__PURE__*/require("./overflowContext");
|
8
|
-
/**
|
9
|
-
* @param id - unique identifier for the item used by the overflow manager
|
10
|
-
* @returns visibility state of an overflow item
|
11
|
-
*/
|
9
|
+
const _overflowContext = require("./overflowContext");
|
12
10
|
function useIsOverflowItemVisible(id) {
|
13
|
-
|
14
|
-
}
|
15
|
-
|
11
|
+
return !!(0, _overflowContext.useOverflowContext)((ctx)=>ctx.itemVisibility[id]);
|
12
|
+
} //# sourceMappingURL=useIsOverflowItemVisible.js.map
|
13
|
+
|
16
14
|
//# sourceMappingURL=useIsOverflowItemVisible.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/useIsOverflowItemVisible.js"],"sourcesContent":["import { useOverflowContext } from './overflowContext';\n/**\n * @param id - unique identifier for the item used by the overflow manager\n * @returns visibility state of an overflow item\n */\nexport function useIsOverflowItemVisible(id) {\n return !!useOverflowContext(ctx => ctx.itemVisibility[id]);\n}\n//# sourceMappingURL=useIsOverflowItemVisible.js.map"],"names":["useIsOverflowItemVisible","id","useOverflowContext","ctx","itemVisibility"],"mappings":";;;;+BAKgBA;;aAAAA;;iCALmB;AAK5B,SAASA,yBAAyBC,EAAE,EAAE;IAC3C,OAAO,CAAC,CAACC,IAAAA,mCAAkB,EAACC,CAAAA,MAAOA,IAAIC,cAAc,CAACH,GAAG;AAC3D,EACA,oDAAoD"}
|
@@ -1,86 +1,93 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
minimumVisible,
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
+
useOverflowContainer: ()=>useOverflowContainer,
|
13
|
+
updateVisibilityAttribute: ()=>updateVisibilityAttribute
|
14
|
+
});
|
15
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
16
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
17
|
+
const _priorityOverflow = require("@fluentui/priority-overflow");
|
18
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
19
|
+
const _constants = require("./constants");
|
20
|
+
const useOverflowContainer = (update, options)=>{
|
21
|
+
const { overflowAxis , overflowDirection , padding , minimumVisible , onUpdateItemVisibility } = options;
|
22
|
+
// DOM ref to the overflow container element
|
23
|
+
const containerRef = _react.useRef(null);
|
24
|
+
const updateOverflowItems = (0, _reactUtilities.useEventCallback)(update);
|
25
|
+
const [overflowManager] = _react.useState(()=>(0, _reactUtilities.canUseDOM)() ? (0, _priorityOverflow.createOverflowManager)() : null);
|
26
|
+
(0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
|
27
|
+
if (!containerRef.current) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
if (overflowManager) {
|
31
|
+
overflowManager.observe(containerRef.current, {
|
32
|
+
overflowDirection: overflowDirection !== null && overflowDirection !== void 0 ? overflowDirection : 'end',
|
33
|
+
overflowAxis: overflowAxis !== null && overflowAxis !== void 0 ? overflowAxis : 'horizontal',
|
34
|
+
padding: padding !== null && padding !== void 0 ? padding : 10,
|
35
|
+
minimumVisible: minimumVisible !== null && minimumVisible !== void 0 ? minimumVisible : 0,
|
36
|
+
onUpdateItemVisibility: onUpdateItemVisibility !== null && onUpdateItemVisibility !== void 0 ? onUpdateItemVisibility : ()=>undefined,
|
37
|
+
onUpdateOverflow: updateOverflowItems !== null && updateOverflowItems !== void 0 ? updateOverflowItems : ()=>undefined
|
38
|
+
});
|
39
|
+
return ()=>{
|
40
|
+
overflowManager.disconnect();
|
41
|
+
};
|
42
|
+
}
|
43
|
+
}, [
|
44
|
+
updateOverflowItems,
|
45
|
+
overflowManager,
|
46
|
+
overflowDirection,
|
47
|
+
overflowAxis,
|
48
|
+
padding,
|
49
|
+
minimumVisible,
|
50
|
+
onUpdateItemVisibility
|
51
|
+
]);
|
52
|
+
const registerItem = _react.useCallback((item)=>{
|
53
|
+
overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addItem(item);
|
54
|
+
item.element.setAttribute(_constants.DATA_OVERFLOW_ITEM, '');
|
55
|
+
return ()=>{
|
56
|
+
item.element.removeAttribute(_constants.DATA_OVERFLOWING);
|
57
|
+
item.element.removeAttribute(_constants.DATA_OVERFLOW_ITEM);
|
58
|
+
overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeItem(item.id);
|
59
|
+
};
|
60
|
+
}, [
|
61
|
+
overflowManager
|
62
|
+
]);
|
63
|
+
const updateOverflow = _react.useCallback(()=>{
|
64
|
+
overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.update();
|
65
|
+
}, [
|
66
|
+
overflowManager
|
67
|
+
]);
|
68
|
+
const registerOverflowMenu = _react.useCallback((el)=>{
|
69
|
+
overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addOverflowMenu(el);
|
70
|
+
el.setAttribute(_constants.DATA_OVERFLOW_MENU, '');
|
71
|
+
return ()=>{
|
72
|
+
overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeOverflowMenu();
|
73
|
+
el.removeAttribute(_constants.DATA_OVERFLOW_MENU);
|
74
|
+
};
|
75
|
+
}, [
|
76
|
+
overflowManager
|
77
|
+
]);
|
78
|
+
return {
|
79
|
+
containerRef,
|
80
|
+
registerItem,
|
81
|
+
updateOverflow,
|
82
|
+
registerOverflowMenu
|
65
83
|
};
|
66
|
-
}, [overflowManager]);
|
67
|
-
return {
|
68
|
-
containerRef,
|
69
|
-
registerItem,
|
70
|
-
updateOverflow,
|
71
|
-
registerOverflowMenu
|
72
|
-
};
|
73
|
-
};
|
74
|
-
exports.useOverflowContainer = useOverflowContainer;
|
75
|
-
const updateVisibilityAttribute = ({
|
76
|
-
item,
|
77
|
-
visible
|
78
|
-
}) => {
|
79
|
-
if (visible) {
|
80
|
-
item.element.removeAttribute(constants_1.DATA_OVERFLOWING);
|
81
|
-
} else {
|
82
|
-
item.element.setAttribute(constants_1.DATA_OVERFLOWING, '');
|
83
|
-
}
|
84
84
|
};
|
85
|
-
|
85
|
+
const updateVisibilityAttribute = ({ item , visible })=>{
|
86
|
+
if (visible) {
|
87
|
+
item.element.removeAttribute(_constants.DATA_OVERFLOWING);
|
88
|
+
} else {
|
89
|
+
item.element.setAttribute(_constants.DATA_OVERFLOWING, '');
|
90
|
+
}
|
91
|
+
}; //# sourceMappingURL=useOverflowContainer.js.map
|
92
|
+
|
86
93
|
//# sourceMappingURL=useOverflowContainer.js.map
|