@fluentui/react-overflow 9.0.11 → 9.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +46 -1
- package/CHANGELOG.md +16 -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,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
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/useOverflowContainer.js"],"sourcesContent":["import * as React from 'react';\nimport { createOverflowManager } from '@fluentui/priority-overflow';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\n/**\n * @internal\n * @param update - Callback when overflow state changes\n * @param options - Options to configure the overflow container\n * @returns - ref to attach to an intrinsic HTML element and imperative functions\n */\nexport const useOverflowContainer = (update, options) => {\n const {\n overflowAxis,\n overflowDirection,\n padding,\n minimumVisible,\n onUpdateItemVisibility\n } = options;\n // DOM ref to the overflow container element\n const containerRef = React.useRef(null);\n const updateOverflowItems = useEventCallback(update);\n const [overflowManager] = React.useState(() => canUseDOM() ? createOverflowManager() : null);\n useIsomorphicLayoutEffect(() => {\n if (!containerRef.current) {\n return;\n }\n if (overflowManager) {\n overflowManager.observe(containerRef.current, {\n overflowDirection: overflowDirection !== null && overflowDirection !== void 0 ? overflowDirection : 'end',\n overflowAxis: overflowAxis !== null && overflowAxis !== void 0 ? overflowAxis : 'horizontal',\n padding: padding !== null && padding !== void 0 ? padding : 10,\n minimumVisible: minimumVisible !== null && minimumVisible !== void 0 ? minimumVisible : 0,\n onUpdateItemVisibility: onUpdateItemVisibility !== null && onUpdateItemVisibility !== void 0 ? onUpdateItemVisibility : () => undefined,\n onUpdateOverflow: updateOverflowItems !== null && updateOverflowItems !== void 0 ? updateOverflowItems : () => undefined\n });\n return () => {\n overflowManager.disconnect();\n };\n }\n }, [updateOverflowItems, overflowManager, overflowDirection, overflowAxis, padding, minimumVisible, onUpdateItemVisibility]);\n const registerItem = React.useCallback(item => {\n overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addItem(item);\n item.element.setAttribute(DATA_OVERFLOW_ITEM, '');\n return () => {\n item.element.removeAttribute(DATA_OVERFLOWING);\n item.element.removeAttribute(DATA_OVERFLOW_ITEM);\n overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeItem(item.id);\n };\n }, [overflowManager]);\n const updateOverflow = React.useCallback(() => {\n overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.update();\n }, [overflowManager]);\n const registerOverflowMenu = React.useCallback(el => {\n overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addOverflowMenu(el);\n el.setAttribute(DATA_OVERFLOW_MENU, '');\n return () => {\n overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeOverflowMenu();\n el.removeAttribute(DATA_OVERFLOW_MENU);\n };\n }, [overflowManager]);\n return {\n containerRef,\n registerItem,\n updateOverflow,\n registerOverflowMenu\n };\n};\nexport const updateVisibilityAttribute = ({\n item,\n visible\n}) => {\n if (visible) {\n item.element.removeAttribute(DATA_OVERFLOWING);\n } else {\n item.element.setAttribute(DATA_OVERFLOWING, '');\n }\n};\n//# sourceMappingURL=useOverflowContainer.js.map"],"names":["useOverflowContainer","updateVisibilityAttribute","update","options","overflowAxis","overflowDirection","padding","minimumVisible","onUpdateItemVisibility","containerRef","React","useRef","updateOverflowItems","useEventCallback","overflowManager","useState","canUseDOM","createOverflowManager","useIsomorphicLayoutEffect","current","observe","undefined","onUpdateOverflow","disconnect","registerItem","useCallback","item","addItem","element","setAttribute","DATA_OVERFLOW_ITEM","removeAttribute","DATA_OVERFLOWING","removeItem","id","updateOverflow","registerOverflowMenu","el","addOverflowMenu","DATA_OVERFLOW_MENU","removeOverflowMenu","visible"],"mappings":"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"}
|
@@ -1,20 +1,19 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
exports
|
7
|
-
|
8
|
-
|
9
|
-
* @returns Number of items that are overflowing
|
10
|
-
*/
|
11
|
-
const useOverflowCount = () => overflowContext_1.useOverflowContext(v => {
|
12
|
-
return Object.entries(v.itemVisibility).reduce((acc, [id, visible]) => {
|
13
|
-
if (!visible) {
|
14
|
-
acc++;
|
15
|
-
}
|
16
|
-
return acc;
|
17
|
-
}, 0);
|
5
|
+
Object.defineProperty(exports, "useOverflowCount", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useOverflowCount
|
18
8
|
});
|
19
|
-
|
9
|
+
const _overflowContext = require("./overflowContext");
|
10
|
+
const useOverflowCount = ()=>(0, _overflowContext.useOverflowContext)((v)=>{
|
11
|
+
return Object.entries(v.itemVisibility).reduce((acc, [id, visible])=>{
|
12
|
+
if (!visible) {
|
13
|
+
acc++;
|
14
|
+
}
|
15
|
+
return acc;
|
16
|
+
}, 0);
|
17
|
+
}); //# sourceMappingURL=useOverflowCount.js.map
|
18
|
+
|
20
19
|
//# sourceMappingURL=useOverflowCount.js.map
|