@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.
Files changed (74) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +46 -1
  3. package/CHANGELOG.md +16 -2
  4. package/lib/components/Overflow.js.map +1 -1
  5. package/lib/components/OverflowItem/OverflowItem.js.map +1 -1
  6. package/lib/components/OverflowItem/OverflowItem.types.js +1 -1
  7. package/lib/components/OverflowItem/OverflowItem.types.js.map +1 -1
  8. package/lib/components/OverflowItem/index.js.map +1 -1
  9. package/lib/constants.js.map +1 -1
  10. package/lib/index.js.map +1 -1
  11. package/lib/overflowContext.js.map +1 -1
  12. package/lib/types.js +1 -1
  13. package/lib/types.js.map +1 -1
  14. package/lib/useIsOverflowGroupVisible.js.map +1 -1
  15. package/lib/useIsOverflowItemVisible.js.map +1 -1
  16. package/lib/useOverflowContainer.js.map +1 -1
  17. package/lib/useOverflowCount.js.map +1 -1
  18. package/lib/useOverflowItem.js.map +1 -1
  19. package/lib/useOverflowMenu.js.map +1 -1
  20. package/lib-commonjs/components/Overflow.js +62 -70
  21. package/lib-commonjs/components/Overflow.js.map +1 -1
  22. package/lib-commonjs/components/OverflowItem/OverflowItem.js +16 -21
  23. package/lib-commonjs/components/OverflowItem/OverflowItem.js.map +1 -1
  24. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js +5 -2
  25. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js.map +1 -1
  26. package/lib-commonjs/components/OverflowItem/index.js +6 -8
  27. package/lib-commonjs/components/OverflowItem/index.js.map +1 -1
  28. package/lib-commonjs/constants.js +16 -6
  29. package/lib-commonjs/constants.js.map +1 -1
  30. package/lib-commonjs/index.js +34 -86
  31. package/lib-commonjs/index.js.map +1 -1
  32. package/lib-commonjs/overflowContext.js +21 -16
  33. package/lib-commonjs/overflowContext.js.map +1 -1
  34. package/lib-commonjs/types.js +5 -2
  35. package/lib-commonjs/types.js.map +1 -1
  36. package/lib-commonjs/useIsOverflowGroupVisible.js +9 -11
  37. package/lib-commonjs/useIsOverflowGroupVisible.js.map +1 -1
  38. package/lib-commonjs/useIsOverflowItemVisible.js +9 -11
  39. package/lib-commonjs/useIsOverflowItemVisible.js.map +1 -1
  40. package/lib-commonjs/useOverflowContainer.js +87 -80
  41. package/lib-commonjs/useOverflowContainer.js.map +1 -1
  42. package/lib-commonjs/useOverflowCount.js +14 -15
  43. package/lib-commonjs/useOverflowCount.js.map +1 -1
  44. package/lib-commonjs/useOverflowItem.js +27 -27
  45. package/lib-commonjs/useOverflowItem.js.map +1 -1
  46. package/lib-commonjs/useOverflowMenu.js +41 -30
  47. package/lib-commonjs/useOverflowMenu.js.map +1 -1
  48. package/package.json +8 -7
  49. package/lib-amd/components/Overflow.js +0 -60
  50. package/lib-amd/components/Overflow.js.map +0 -1
  51. package/lib-amd/components/OverflowItem/OverflowItem.js +0 -17
  52. package/lib-amd/components/OverflowItem/OverflowItem.js.map +0 -1
  53. package/lib-amd/components/OverflowItem/OverflowItem.types.js +0 -5
  54. package/lib-amd/components/OverflowItem/OverflowItem.types.js.map +0 -1
  55. package/lib-amd/constants.js +0 -9
  56. package/lib-amd/constants.js.map +0 -1
  57. package/lib-amd/index.js +0 -18
  58. package/lib-amd/index.js.map +0 -1
  59. package/lib-amd/overflowContext.js +0 -25
  60. package/lib-amd/overflowContext.js.map +0 -1
  61. package/lib-amd/types.js +0 -5
  62. package/lib-amd/types.js.map +0 -1
  63. package/lib-amd/useIsOverflowGroupVisible.js +0 -14
  64. package/lib-amd/useIsOverflowGroupVisible.js.map +0 -1
  65. package/lib-amd/useIsOverflowItemVisible.js +0 -14
  66. package/lib-amd/useIsOverflowItemVisible.js.map +0 -1
  67. package/lib-amd/useOverflowContainer.js +0 -84
  68. package/lib-amd/useOverflowContainer.js.map +0 -1
  69. package/lib-amd/useOverflowCount.js +0 -21
  70. package/lib-amd/useOverflowCount.js.map +0 -1
  71. package/lib-amd/useOverflowItem.js +0 -30
  72. package/lib-amd/useOverflowItem.js.map +0 -1
  73. package/lib-amd/useOverflowMenu.js +0 -26
  74. package/lib-amd/useOverflowMenu.js.map +0 -1
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.OverflowItem = void 0;
7
- var OverflowItem_1 = /*#__PURE__*/require("./OverflowItem");
8
5
  Object.defineProperty(exports, "OverflowItem", {
9
- enumerable: true,
10
- get: function () {
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,"names":["OverflowItem_1","require","Object","defineProperty","exports","enumerable","get","OverflowItem"],"sources":["../src/packages/react-components/react-overflow/src/components/OverflowItem/index.ts"],"sourcesContent":["export type { OverflowItemProps } from './OverflowItem.types';\nexport { OverflowItem } from './OverflowItem';\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,cAAA,CAAAO,YAAY;EAAA;AAAA"}
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
- value: true
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
- exports.DATA_OVERFLOW_MENU = exports.DATA_OVERFLOW_ITEM = exports.DATA_OVERFLOWING = void 0;
7
- exports.DATA_OVERFLOWING = 'data-overflowing';
8
- exports.DATA_OVERFLOW_ITEM = 'data-overflow-item';
9
- exports.DATA_OVERFLOW_MENU = 'data-overflow-menu';
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,"names":["exports","DATA_OVERFLOWING","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU"],"sources":["../src/packages/react-components/react-overflow/src/constants.ts"],"sourcesContent":["export const DATA_OVERFLOWING = 'data-overflowing';\nexport const DATA_OVERFLOW_ITEM = 'data-overflow-item';\nexport const DATA_OVERFLOW_MENU = 'data-overflow-menu';\n"],"mappings":";;;;;;AAAaA,OAAA,CAAAC,gBAAgB,GAAG,kBAAkB;AACrCD,OAAA,CAAAE,kBAAkB,GAAG,oBAAoB;AACzCF,OAAA,CAAAG,kBAAkB,GAAG,oBAAoB"}
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"}
@@ -1,89 +1,37 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.OverflowItem = exports.useOverflowContext = exports.useOverflowMenu = exports.useOverflowItem = exports.useOverflowCount = exports.useOverflowContainer = exports.useIsOverflowItemVisible = exports.useIsOverflowGroupVisible = exports.DATA_OVERFLOW_MENU = exports.DATA_OVERFLOW_ITEM = exports.DATA_OVERFLOWING = exports.Overflow = void 0;
7
- var Overflow_1 = /*#__PURE__*/require("./components/Overflow");
8
- Object.defineProperty(exports, "Overflow", {
9
- enumerable: true,
10
- get: function () {
11
- return Overflow_1.Overflow;
12
- }
13
- });
14
- var constants_1 = /*#__PURE__*/require("./constants");
15
- Object.defineProperty(exports, "DATA_OVERFLOWING", {
16
- enumerable: true,
17
- get: function () {
18
- return constants_1.DATA_OVERFLOWING;
19
- }
20
- });
21
- Object.defineProperty(exports, "DATA_OVERFLOW_ITEM", {
22
- enumerable: true,
23
- get: function () {
24
- return constants_1.DATA_OVERFLOW_ITEM;
25
- }
26
- });
27
- Object.defineProperty(exports, "DATA_OVERFLOW_MENU", {
28
- enumerable: true,
29
- get: function () {
30
- return constants_1.DATA_OVERFLOW_MENU;
31
- }
32
- });
33
- var useIsOverflowGroupVisible_1 = /*#__PURE__*/require("./useIsOverflowGroupVisible");
34
- Object.defineProperty(exports, "useIsOverflowGroupVisible", {
35
- enumerable: true,
36
- get: function () {
37
- return useIsOverflowGroupVisible_1.useIsOverflowGroupVisible;
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,"names":["Overflow_1","require","Object","defineProperty","exports","enumerable","get","Overflow","constants_1","DATA_OVERFLOWING","DATA_OVERFLOW_ITEM","DATA_OVERFLOW_MENU","useIsOverflowGroupVisible_1","useIsOverflowGroupVisible","useIsOverflowItemVisible_1","useIsOverflowItemVisible","useOverflowContainer_1","useOverflowContainer","useOverflowCount_1","useOverflowCount","useOverflowItem_1","useOverflowItem","useOverflowMenu_1","useOverflowMenu","overflowContext_1","useOverflowContext","OverflowItem_1","OverflowItem"],"sources":["../src/packages/react-components/react-overflow/src/index.ts"],"sourcesContent":["export { Overflow } from './components/Overflow';\nexport type { OverflowProps } from './components/Overflow';\nexport { DATA_OVERFLOWING, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\nexport type { UseOverflowContainerReturn } from './types';\nexport { useIsOverflowGroupVisible } from './useIsOverflowGroupVisible';\nexport { useIsOverflowItemVisible } from './useIsOverflowItemVisible';\nexport { useOverflowContainer } from './useOverflowContainer';\nexport { useOverflowCount } from './useOverflowCount';\nexport { useOverflowItem } from './useOverflowItem';\nexport { useOverflowMenu } from './useOverflowMenu';\n\nexport { useOverflowContext } from './overflowContext';\n\nexport type { OverflowItemProps } from './components/OverflowItem/OverflowItem.types';\nexport { OverflowItem } from './components/OverflowItem/OverflowItem';\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,UAAA,CAAAO,QAAQ;EAAA;AAAA;AAEjB,IAAAC,WAAA,gBAAAP,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,WAAA,CAAAC,gBAAgB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,WAAA,CAAAE,kBAAkB;EAAA;AAAA;AAAER,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,WAAA,CAAAG,kBAAkB;EAAA;AAAA;AAEjE,IAAAC,2BAAA,gBAAAX,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,2BAAA,CAAAC,yBAAyB;EAAA;AAAA;AAClC,IAAAC,0BAAA,gBAAAb,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAQ,0BAAA,CAAAC,wBAAwB;EAAA;AAAA;AACjC,IAAAC,sBAAA,gBAAAf,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAU,sBAAA,CAAAC,oBAAoB;EAAA;AAAA;AAC7B,IAAAC,kBAAA,gBAAAjB,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAY,kBAAA,CAAAC,gBAAgB;EAAA;AAAA;AACzB,IAAAC,iBAAA,gBAAAnB,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAc,iBAAA,CAAAC,eAAe;EAAA;AAAA;AACxB,IAAAC,iBAAA,gBAAArB,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAgB,iBAAA,CAAAC,eAAe;EAAA;AAAA;AAExB,IAAAC,iBAAA,gBAAAvB,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAkB,iBAAA,CAAAC,kBAAkB;EAAA;AAAA;AAG3B,IAAAC,cAAA,gBAAAzB,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAoB,cAAA,CAAAC,YAAY;EAAA;AAAA"}
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
- value: true
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
- exports.useOverflowContext = exports.OverflowContext = void 0;
7
- const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
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
- itemVisibility: {},
11
- groupVisibility: {},
12
- hasOverflow: false,
13
- registerItem: () => () => null,
14
- updateOverflow: () => null,
15
- registerOverflowMenu: () => () => null
18
+ itemVisibility: {},
19
+ groupVisibility: {},
20
+ hasOverflow: false,
21
+ registerItem: ()=>()=>null,
22
+ updateOverflow: ()=>null,
23
+ registerOverflowMenu: ()=>()=>null
16
24
  };
17
- /**
18
- * @internal
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,"names":["react_context_selector_1","require","exports","OverflowContext","createContext","undefined","overflowContextDefaultValue","itemVisibility","groupVisibility","hasOverflow","registerItem","updateOverflow","registerOverflowMenu","useOverflowContext","selector","useContextSelector","ctx"],"sources":["../src/packages/react-components/react-overflow/src/overflowContext.ts"],"sourcesContent":["import type { OverflowGroupState, OverflowItemEntry } from '@fluentui/priority-overflow';\nimport { ContextSelector, createContext, useContextSelector, Context } from '@fluentui/react-context-selector';\n\n/**\n * @internal\n */\nexport interface OverflowContextValue {\n itemVisibility: Record<string, boolean>;\n groupVisibility: Record<string, OverflowGroupState>;\n hasOverflow: boolean;\n registerItem: (item: OverflowItemEntry) => () => void;\n registerOverflowMenu: (el: HTMLElement) => () => void;\n updateOverflow: (padding?: number) => void;\n}\n\nexport const OverflowContext = createContext<OverflowContextValue | undefined>(\n undefined,\n) as Context<OverflowContextValue>;\n\nconst overflowContextDefaultValue: OverflowContextValue = {\n itemVisibility: {},\n groupVisibility: {},\n hasOverflow: false,\n registerItem: () => () => null,\n updateOverflow: () => null,\n registerOverflowMenu: () => () => null,\n};\n\n/**\n * @internal\n */\nexport const useOverflowContext = <SelectedValue>(selector: ContextSelector<OverflowContextValue, SelectedValue>) =>\n useContextSelector(OverflowContext, (ctx = overflowContextDefaultValue) => selector(ctx));\n"],"mappings":";;;;;;AACA,MAAAA,wBAAA,gBAAAC,OAAA;AAcaC,OAAA,CAAAC,eAAe,gBAAGH,wBAAA,CAAAI,aAAa,CAC1CC,SAAS,CACuB;AAElC,MAAMC,2BAA2B,GAAyB;EACxDC,cAAc,EAAE,EAAE;EAClBC,eAAe,EAAE,EAAE;EACnBC,WAAW,EAAE,KAAK;EAClBC,YAAY,EAAEA,CAAA,KAAM,MAAM,IAAI;EAC9BC,cAAc,EAAEA,CAAA,KAAM,IAAI;EAC1BC,oBAAoB,EAAEA,CAAA,KAAM,MAAM;CACnC;AAED;;;AAGO,MAAMC,kBAAkB,GAAmBC,QAA8D,IAC9Gd,wBAAA,CAAAe,kBAAkB,CAACb,OAAA,CAAAC,eAAe,EAAE,CAACa,GAAG,GAAGV,2BAA2B,KAAKQ,QAAQ,CAACE,GAAG,CAAC,CAAC;AAD9Ed,OAAA,CAAAW,kBAAkB,GAAAA,kBAAA"}
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"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
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,"names":[],"sources":["../src/packages/react-components/react-overflow/src/types.ts"],"sourcesContent":["import * as React from 'react';\nimport { OverflowContextValue } from './overflowContext';\n\n/**\n * @internal\n */\nexport interface UseOverflowContainerReturn<TElement extends HTMLElement>\n extends Pick<OverflowContextValue, 'registerItem' | 'updateOverflow' | 'registerOverflowMenu'> {\n /**\n * Ref to apply to the container that will overflow\n */\n containerRef: React.RefObject<TElement>;\n}\n"],"mappings":""}
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
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useIsOverflowGroupVisible", {
6
+ enumerable: true,
7
+ get: ()=>useIsOverflowGroupVisible
5
8
  });
6
- exports.useIsOverflowGroupVisible = void 0;
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
- return overflowContext_1.useOverflowContext(ctx => ctx.groupVisibility[id]);
14
- }
15
- exports.useIsOverflowGroupVisible = useIsOverflowGroupVisible;
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,"names":["overflowContext_1","require","useIsOverflowGroupVisible","id","useOverflowContext","ctx","groupVisibility","exports"],"sources":["../src/packages/react-components/react-overflow/src/useIsOverflowGroupVisible.ts"],"sourcesContent":["import { OverflowGroupState } from '@fluentui/priority-overflow';\nimport { useOverflowContext } from './overflowContext';\n\n/**\n * @param id - unique identifier for a group of overflow items\n * @returns visibility state of the group\n */\nexport function useIsOverflowGroupVisible(id: string): OverflowGroupState {\n return useOverflowContext(ctx => ctx.groupVisibility[id]);\n}\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA;;;;AAIA,SAAgBC,yBAAyBA,CAACC,EAAU;EAClD,OAAOH,iBAAA,CAAAI,kBAAkB,CAACC,GAAG,IAAIA,GAAG,CAACC,eAAe,CAACH,EAAE,CAAC,CAAC;AAC3D;AAFAI,OAAA,CAAAL,yBAAA,GAAAA,yBAAA"}
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
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useIsOverflowItemVisible", {
6
+ enumerable: true,
7
+ get: ()=>useIsOverflowItemVisible
5
8
  });
6
- exports.useIsOverflowItemVisible = void 0;
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
- return !!overflowContext_1.useOverflowContext(ctx => ctx.itemVisibility[id]);
14
- }
15
- exports.useIsOverflowItemVisible = useIsOverflowItemVisible;
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,"names":["overflowContext_1","require","useIsOverflowItemVisible","id","useOverflowContext","ctx","itemVisibility","exports"],"sources":["../src/packages/react-components/react-overflow/src/useIsOverflowItemVisible.ts"],"sourcesContent":["import { useOverflowContext } from './overflowContext';\n\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: string): boolean {\n return !!useOverflowContext(ctx => ctx.itemVisibility[id]);\n}\n"],"mappings":";;;;;;AAAA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA;;;;AAIA,SAAgBC,wBAAwBA,CAACC,EAAU;EACjD,OAAO,CAAC,CAACH,iBAAA,CAAAI,kBAAkB,CAACC,GAAG,IAAIA,GAAG,CAACC,cAAc,CAACH,EAAE,CAAC,CAAC;AAC5D;AAFAI,OAAA,CAAAL,wBAAA,GAAAA,wBAAA"}
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
- value: true
3
+ value: true
5
4
  });
6
- exports.updateVisibilityAttribute = exports.useOverflowContainer = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const priority_overflow_1 = /*#__PURE__*/require("@fluentui/priority-overflow");
9
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
- const constants_1 = /*#__PURE__*/require("./constants");
11
- /**
12
- * @internal
13
- * @param update - Callback when overflow state changes
14
- * @param options - Options to configure the overflow container
15
- * @returns - ref to attach to an intrinsic HTML element and imperative functions
16
- */
17
- const useOverflowContainer = (update, options) => {
18
- const {
19
- overflowAxis,
20
- overflowDirection,
21
- padding,
22
- minimumVisible,
23
- onUpdateItemVisibility
24
- } = options;
25
- // DOM ref to the overflow container element
26
- const containerRef = React.useRef(null);
27
- const updateOverflowItems = react_utilities_1.useEventCallback(update);
28
- const [overflowManager] = React.useState(() => react_utilities_1.canUseDOM() ? priority_overflow_1.createOverflowManager() : null);
29
- react_utilities_1.useIsomorphicLayoutEffect(() => {
30
- if (!containerRef.current) {
31
- return;
32
- }
33
- if (overflowManager) {
34
- overflowManager.observe(containerRef.current, {
35
- overflowDirection: overflowDirection !== null && overflowDirection !== void 0 ? overflowDirection : 'end',
36
- overflowAxis: overflowAxis !== null && overflowAxis !== void 0 ? overflowAxis : 'horizontal',
37
- padding: padding !== null && padding !== void 0 ? padding : 10,
38
- minimumVisible: minimumVisible !== null && minimumVisible !== void 0 ? minimumVisible : 0,
39
- onUpdateItemVisibility: onUpdateItemVisibility !== null && onUpdateItemVisibility !== void 0 ? onUpdateItemVisibility : () => undefined,
40
- onUpdateOverflow: updateOverflowItems !== null && updateOverflowItems !== void 0 ? updateOverflowItems : () => undefined
41
- });
42
- return () => {
43
- overflowManager.disconnect();
44
- };
45
- }
46
- }, [updateOverflowItems, overflowManager, overflowDirection, overflowAxis, padding, minimumVisible, onUpdateItemVisibility]);
47
- const registerItem = React.useCallback(item => {
48
- overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addItem(item);
49
- item.element.setAttribute(constants_1.DATA_OVERFLOW_ITEM, '');
50
- return () => {
51
- item.element.removeAttribute(constants_1.DATA_OVERFLOWING);
52
- item.element.removeAttribute(constants_1.DATA_OVERFLOW_ITEM);
53
- overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeItem(item.id);
54
- };
55
- }, [overflowManager]);
56
- const updateOverflow = React.useCallback(() => {
57
- overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.update();
58
- }, [overflowManager]);
59
- const registerOverflowMenu = React.useCallback(el => {
60
- overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.addOverflowMenu(el);
61
- el.setAttribute(constants_1.DATA_OVERFLOW_MENU, '');
62
- return () => {
63
- overflowManager === null || overflowManager === void 0 ? void 0 : overflowManager.removeOverflowMenu();
64
- el.removeAttribute(constants_1.DATA_OVERFLOW_MENU);
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
- exports.updateVisibilityAttribute = updateVisibilityAttribute;
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,"names":["React","require","priority_overflow_1","react_utilities_1","constants_1","useOverflowContainer","update","options","overflowAxis","overflowDirection","padding","minimumVisible","onUpdateItemVisibility","containerRef","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","exports","updateVisibilityAttribute","visible"],"sources":["../src/packages/react-components/react-overflow/src/useOverflowContainer.ts"],"sourcesContent":["import * as React from 'react';\nimport { createOverflowManager } from '@fluentui/priority-overflow';\n\n/**\n * @internal\n */\nimport type {\n OnUpdateItemVisibility,\n OnUpdateOverflow,\n OverflowItemEntry,\n OverflowManager,\n ObserveOptions,\n} from '@fluentui/priority-overflow';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { UseOverflowContainerReturn } from './types';\nimport { DATA_OVERFLOWING, DATA_OVERFLOW_ITEM, DATA_OVERFLOW_MENU } from './constants';\n\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 = <TElement extends HTMLElement>(\n update: OnUpdateOverflow,\n options: Omit<ObserveOptions, 'onUpdateOverflow'>,\n): UseOverflowContainerReturn<TElement> => {\n const { overflowAxis, overflowDirection, padding, minimumVisible, onUpdateItemVisibility } = options;\n\n // DOM ref to the overflow container element\n const containerRef = React.useRef<TElement>(null);\n const updateOverflowItems = useEventCallback(update);\n\n const [overflowManager] = React.useState<OverflowManager | null>(() =>\n canUseDOM() ? createOverflowManager() : null,\n );\n\n useIsomorphicLayoutEffect(() => {\n if (!containerRef.current) {\n return;\n }\n\n if (overflowManager) {\n overflowManager.observe(containerRef.current, {\n overflowDirection: overflowDirection ?? 'end',\n overflowAxis: overflowAxis ?? 'horizontal',\n padding: padding ?? 10,\n minimumVisible: minimumVisible ?? 0,\n onUpdateItemVisibility: onUpdateItemVisibility ?? (() => undefined),\n onUpdateOverflow: updateOverflowItems ?? (() => undefined),\n });\n\n return () => {\n overflowManager.disconnect();\n };\n }\n }, [\n updateOverflowItems,\n overflowManager,\n overflowDirection,\n overflowAxis,\n padding,\n minimumVisible,\n onUpdateItemVisibility,\n ]);\n\n const registerItem = React.useCallback(\n (item: OverflowItemEntry) => {\n overflowManager?.addItem(item);\n item.element.setAttribute(DATA_OVERFLOW_ITEM, '');\n\n return () => {\n item.element.removeAttribute(DATA_OVERFLOWING);\n item.element.removeAttribute(DATA_OVERFLOW_ITEM);\n overflowManager?.removeItem(item.id);\n };\n },\n [overflowManager],\n );\n\n const updateOverflow = React.useCallback(() => {\n overflowManager?.update();\n }, [overflowManager]);\n\n const registerOverflowMenu = React.useCallback(\n (el: HTMLElement) => {\n overflowManager?.addOverflowMenu(el);\n el.setAttribute(DATA_OVERFLOW_MENU, '');\n\n return () => {\n overflowManager?.removeOverflowMenu();\n el.removeAttribute(DATA_OVERFLOW_MENU);\n };\n },\n [overflowManager],\n );\n\n return {\n containerRef,\n registerItem,\n updateOverflow,\n registerOverflowMenu,\n };\n};\n\nexport const updateVisibilityAttribute: OnUpdateItemVisibility = ({ item, visible }) => {\n if (visible) {\n item.element.removeAttribute(DATA_OVERFLOWING);\n } else {\n item.element.setAttribute(DATA_OVERFLOWING, '');\n }\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,mBAAA,gBAAAD,OAAA;AAYA,MAAAE,iBAAA,gBAAAF,OAAA;AAEA,MAAAG,WAAA,gBAAAH,OAAA;AAEA;;;;;;AAMO,MAAMI,oBAAoB,GAAGA,CAClCC,MAAwB,EACxBC,OAAiD,KACT;EACxC,MAAM;IAAEC,YAAY;IA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AAC;EAAEhB,IAAI;EAAEiB;AAAO,CAAE,KAAI;EACrF,IAAIA,OAAO,EAAE;IACXjB,IAAI,CAACE,OAAO,CAACG,eAAe,CAAC9B,WAAA,CAAA+B,gBAAgB,CAAC;GAC/C,MAAM;IACLN,IAAI,CAACE,OAAO,CAACC,YAAY,CAAC5B,WAAA,CAAA+B,gBAAgB,EAAE,EAAE,CAAC;;AAEnD,CAAC;AANYS,OAAA,CAAAC,yBAAyB,GAAAA,yBAAA"}
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":";;;;;;;;;;;IAUa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"use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.useOverflowCount = void 0;
7
- const overflowContext_1 = /*#__PURE__*/require("./overflowContext");
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
- exports.useOverflowCount = useOverflowCount;
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