@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.
Files changed (75) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +73 -1
  3. package/CHANGELOG.md +27 -2
  4. package/lib/components/Overflow.js +2 -2
  5. package/lib/components/Overflow.js.map +1 -1
  6. package/lib/components/OverflowItem/OverflowItem.js.map +1 -1
  7. package/lib/components/OverflowItem/OverflowItem.types.js +1 -1
  8. package/lib/components/OverflowItem/OverflowItem.types.js.map +1 -1
  9. package/lib/components/OverflowItem/index.js.map +1 -1
  10. package/lib/constants.js.map +1 -1
  11. package/lib/index.js.map +1 -1
  12. package/lib/overflowContext.js.map +1 -1
  13. package/lib/types.js +1 -1
  14. package/lib/types.js.map +1 -1
  15. package/lib/useIsOverflowGroupVisible.js.map +1 -1
  16. package/lib/useIsOverflowItemVisible.js.map +1 -1
  17. package/lib/useOverflowContainer.js.map +1 -1
  18. package/lib/useOverflowCount.js.map +1 -1
  19. package/lib/useOverflowItem.js.map +1 -1
  20. package/lib/useOverflowMenu.js.map +1 -1
  21. package/lib-commonjs/components/Overflow.js +62 -70
  22. package/lib-commonjs/components/Overflow.js.map +1 -1
  23. package/lib-commonjs/components/OverflowItem/OverflowItem.js +16 -21
  24. package/lib-commonjs/components/OverflowItem/OverflowItem.js.map +1 -1
  25. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js +5 -2
  26. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js.map +1 -1
  27. package/lib-commonjs/components/OverflowItem/index.js +6 -8
  28. package/lib-commonjs/components/OverflowItem/index.js.map +1 -1
  29. package/lib-commonjs/constants.js +16 -6
  30. package/lib-commonjs/constants.js.map +1 -1
  31. package/lib-commonjs/index.js +34 -86
  32. package/lib-commonjs/index.js.map +1 -1
  33. package/lib-commonjs/overflowContext.js +21 -16
  34. package/lib-commonjs/overflowContext.js.map +1 -1
  35. package/lib-commonjs/types.js +5 -2
  36. package/lib-commonjs/types.js.map +1 -1
  37. package/lib-commonjs/useIsOverflowGroupVisible.js +9 -11
  38. package/lib-commonjs/useIsOverflowGroupVisible.js.map +1 -1
  39. package/lib-commonjs/useIsOverflowItemVisible.js +9 -11
  40. package/lib-commonjs/useIsOverflowItemVisible.js.map +1 -1
  41. package/lib-commonjs/useOverflowContainer.js +87 -80
  42. package/lib-commonjs/useOverflowContainer.js.map +1 -1
  43. package/lib-commonjs/useOverflowCount.js +14 -15
  44. package/lib-commonjs/useOverflowCount.js.map +1 -1
  45. package/lib-commonjs/useOverflowItem.js +27 -27
  46. package/lib-commonjs/useOverflowItem.js.map +1 -1
  47. package/lib-commonjs/useOverflowMenu.js +41 -30
  48. package/lib-commonjs/useOverflowMenu.js.map +1 -1
  49. package/package.json +8 -7
  50. package/lib-amd/components/Overflow.js +0 -60
  51. package/lib-amd/components/Overflow.js.map +0 -1
  52. package/lib-amd/components/OverflowItem/OverflowItem.js +0 -17
  53. package/lib-amd/components/OverflowItem/OverflowItem.js.map +0 -1
  54. package/lib-amd/components/OverflowItem/OverflowItem.types.js +0 -5
  55. package/lib-amd/components/OverflowItem/OverflowItem.types.js.map +0 -1
  56. package/lib-amd/constants.js +0 -9
  57. package/lib-amd/constants.js.map +0 -1
  58. package/lib-amd/index.js +0 -18
  59. package/lib-amd/index.js.map +0 -1
  60. package/lib-amd/overflowContext.js +0 -25
  61. package/lib-amd/overflowContext.js.map +0 -1
  62. package/lib-amd/types.js +0 -5
  63. package/lib-amd/types.js.map +0 -1
  64. package/lib-amd/useIsOverflowGroupVisible.js +0 -14
  65. package/lib-amd/useIsOverflowGroupVisible.js.map +0 -1
  66. package/lib-amd/useIsOverflowItemVisible.js +0 -14
  67. package/lib-amd/useIsOverflowItemVisible.js.map +0 -1
  68. package/lib-amd/useOverflowContainer.js +0 -84
  69. package/lib-amd/useOverflowContainer.js.map +0 -1
  70. package/lib-amd/useOverflowCount.js +0 -21
  71. package/lib-amd/useOverflowCount.js.map +0 -1
  72. package/lib-amd/useOverflowItem.js +0 -30
  73. package/lib-amd/useOverflowItem.js.map +0 -1
  74. package/lib-amd/useOverflowMenu.js +0 -26
  75. package/lib-amd/useOverflowMenu.js.map +0 -1
@@ -1,26 +1,21 @@
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
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
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,"names":["React","require","react_utilities_1","useOverflowItem_1","exports","OverflowItem","forwardRef","props","ref","id","groupId","priority","children","containerRef","useOverflowItem","applyTriggerPropsToChildren","useMergedRefs"],"sources":["../src/packages/react-components/react-overflow/src/components/OverflowItem/OverflowItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, useMergedRefs } from '@fluentui/react-utilities';\nimport { useOverflowItem } from '../../useOverflowItem';\nimport { OverflowItemProps } from './OverflowItem.types';\n\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 = React.forwardRef((props: OverflowItemProps, ref) => {\n const { id, groupId, priority, children } = props;\n\n const containerRef = useOverflowItem(id, priority, groupId);\n return applyTriggerPropsToChildren(children, {\n ref: useMergedRefs(containerRef, ref),\n });\n});\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AAGA;;;;AAIaG,OAAA,CAAAC,YAAY,gBAAGL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAwB,EAAEC,GAAG,KAAI;EAC7E,MAAM;IAAEC,EAAE;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAQ,CAAE,GAAGL,KAAK;EAEjD,MAAMM,YAAY,GAAGV,iBAAA,CAAAW,eAAe,CAACL,EAAE,EAAEE,QAAQ,EAAED,OAAO,CAAC;EAC3D,OAAOR,iBAAA,CAAAa,2BAA2B,CAACH,QAAQ,EAAE;IAC3CJ,GAAG,EAAEN,iBAAA,CAAAc,aAAa,CAACH,YAAY,EAAEL,GAAG;GACrC,CAAC;AACJ,CAAC,CAAC"}
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
- 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=OverflowItem.types.js.map
8
+
6
9
  //# sourceMappingURL=OverflowItem.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-overflow/src/components/OverflowItem/OverflowItem.types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * OverflowItemProps\n */\nexport type OverflowItemProps = {\n /**\n * The unique identifier for the item used by the overflow manager.\n */\n id: string;\n /**\n * Assigns the item to a group, group visibility can be watched.\n */\n groupId?: string;\n /**\n * A higher priority means the item overflows later.\n */\n priority?: number;\n /**\n * The single child that has overflow item behavior attached.\n */\n children: React.ReactElement;\n};\n"],"mappings":""}
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
- 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