@fluentui/react-overflow 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.json +11 -11
  2. package/CHANGELOG.md +8 -8
  3. package/lib/components/Overflow.js +7 -7
  4. package/lib/components/Overflow.js.map +1 -1
  5. package/lib/components/OverflowItem/OverflowItem.js +3 -3
  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 +1 -1
  10. package/lib/components/OverflowItem/index.js.map +1 -1
  11. package/lib/constants.js +3 -3
  12. package/lib/constants.js.map +1 -1
  13. package/lib/index.js +10 -10
  14. package/lib/index.js.map +1 -1
  15. package/lib/overflowContext.js +1 -1
  16. package/lib/overflowContext.js.map +1 -1
  17. package/lib/types.js +1 -1
  18. package/lib/types.js.map +1 -1
  19. package/lib/useIsOverflowGroupVisible.js +1 -1
  20. package/lib/useIsOverflowGroupVisible.js.map +1 -1
  21. package/lib/useIsOverflowItemVisible.js +1 -1
  22. package/lib/useIsOverflowItemVisible.js.map +1 -1
  23. package/lib/useOverflowContainer.js +18 -18
  24. package/lib/useOverflowContainer.js.map +1 -1
  25. package/lib/useOverflowCount.js +1 -1
  26. package/lib/useOverflowCount.js.map +1 -1
  27. package/lib/useOverflowItem.js +4 -4
  28. package/lib/useOverflowItem.js.map +1 -1
  29. package/lib/useOverflowMenu.js +5 -5
  30. package/lib/useOverflowMenu.js.map +1 -1
  31. package/lib-commonjs/components/Overflow.js +70 -62
  32. package/lib-commonjs/components/Overflow.js.map +1 -1
  33. package/lib-commonjs/components/OverflowItem/OverflowItem.js +21 -16
  34. package/lib-commonjs/components/OverflowItem/OverflowItem.js.map +1 -1
  35. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js +2 -5
  36. package/lib-commonjs/components/OverflowItem/OverflowItem.types.js.map +1 -1
  37. package/lib-commonjs/components/OverflowItem/index.js +8 -6
  38. package/lib-commonjs/components/OverflowItem/index.js.map +1 -1
  39. package/lib-commonjs/constants.js +6 -16
  40. package/lib-commonjs/constants.js.map +1 -1
  41. package/lib-commonjs/index.js +86 -34
  42. package/lib-commonjs/index.js.map +1 -1
  43. package/lib-commonjs/overflowContext.js +16 -21
  44. package/lib-commonjs/overflowContext.js.map +1 -1
  45. package/lib-commonjs/types.js +2 -5
  46. package/lib-commonjs/types.js.map +1 -1
  47. package/lib-commonjs/useIsOverflowGroupVisible.js +11 -9
  48. package/lib-commonjs/useIsOverflowGroupVisible.js.map +1 -1
  49. package/lib-commonjs/useIsOverflowItemVisible.js +11 -9
  50. package/lib-commonjs/useIsOverflowItemVisible.js.map +1 -1
  51. package/lib-commonjs/useOverflowContainer.js +80 -87
  52. package/lib-commonjs/useOverflowContainer.js.map +1 -1
  53. package/lib-commonjs/useOverflowCount.js +15 -14
  54. package/lib-commonjs/useOverflowCount.js.map +1 -1
  55. package/lib-commonjs/useOverflowItem.js +27 -27
  56. package/lib-commonjs/useOverflowItem.js.map +1 -1
  57. package/lib-commonjs/useOverflowMenu.js +30 -41
  58. package/lib-commonjs/useOverflowMenu.js.map +1 -1
  59. package/package.json +8 -7
  60. package/.swcrc +0 -39
@@ -1,93 +1,86 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
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
- useOverflowContainer: ()=>useOverflowContainer,
13
- updateVisibilityAttribute: ()=>updateVisibilityAttribute
4
+ value: true
14
5
  });
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 ?? "end",
33
- overflowAxis: overflowAxis ?? "horizontal",
34
- padding: padding ?? 10,
35
- minimumVisible: minimumVisible ?? 0,
36
- onUpdateItemVisibility: onUpdateItemVisibility ?? (()=>undefined),
37
- onUpdateOverflow: 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?.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?.removeItem(item.id);
59
- };
60
- }, [
61
- overflowManager
62
- ]);
63
- const updateOverflow = _react.useCallback(()=>{
64
- overflowManager?.update();
65
- }, [
66
- overflowManager
67
- ]);
68
- const registerOverflowMenu = _react.useCallback((el)=>{
69
- overflowManager?.addOverflowMenu(el);
70
- el.setAttribute(_constants.DATA_OVERFLOW_MENU, "");
71
- return ()=>{
72
- overflowManager?.removeOverflowMenu();
73
- el.removeAttribute(_constants.DATA_OVERFLOW_MENU);
74
- };
75
- }, [
76
- overflowManager
77
- ]);
78
- return {
79
- containerRef,
80
- registerItem,
81
- updateOverflow,
82
- registerOverflowMenu
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);
83
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);
65
+ };
66
+ }, [overflowManager]);
67
+ return {
68
+ containerRef,
69
+ registerItem,
70
+ updateOverflow,
71
+ registerOverflowMenu
72
+ };
84
73
  };
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
-
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
+ };
85
+ exports.updateVisibilityAttribute = updateVisibilityAttribute;
93
86
  //# sourceMappingURL=useOverflowContainer.js.map
@@ -1 +1 @@
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 ?? \"end\",\n overflowAxis: overflowAxis ?? \"horizontal\",\n padding: padding ?? 10,\n minimumVisible: minimumVisible ?? 0,\n onUpdateItemVisibility: onUpdateItemVisibility ?? (() => undefined),\n onUpdateOverflow: 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?.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?.removeItem(item.id);\n };\n }, [overflowManager]);\n const updateOverflow = React.useCallback(() => {\n overflowManager?.update();\n }, [overflowManager]);\n const registerOverflowMenu = React.useCallback(el => {\n overflowManager?.addOverflowMenu(el);\n el.setAttribute(DATA_OVERFLOW_MENU, \"\");\n return () => {\n 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":";;;;;;;;;;;IAUaA,oBAAoB,MAApBA;IAyDAC,yBAAyB,MAAzBA;;;6DAnEU;kCACe;gCACiC;2BACE;AAOlE,MAAMD,uBAAuB,CAACE,QAAQC,UAAY;IACvD,MAAM,EACJC,aAAY,EACZC,kBAAiB,EACjBC,QAAO,EACPC,eAAc,EACdC,uBAAsB,EACvB,GAAGL;IACJ,4CAA4C;IAC5C,MAAMM,eAAeC,OAAMC,MAAM,CAAC,IAAI;IACtC,MAAMC,sBAAsBC,IAAAA,gCAAgB,EAACX;IAC7C,MAAM,CAACY,gBAAgB,GAAGJ,OAAMK,QAAQ,CAAC,IAAMC,IAAAA,yBAAS,MAAKC,IAAAA,uCAAqB,MAAK,IAAI;IAC3FC,IAAAA,yCAAyB,EAAC,IAAM;QAC9B,IAAI,CAACT,aAAaU,OAAO,EAAE;YACzB;QACF,CAAC;QACD,IAAI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,KAAKE,OAAO,CAACC,YAAY,CAACG,2BAAgB,EAAE;IAC9C,CAAC;AACH,GACA,gDAAgD"}
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":["../../../../../../../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,oBAAo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AAA,CAAAvC,oBAAoB,GAAAA,oBAAA;AAkF1B,MAAMwC,yBAAyB,GAA2BA,CAAC;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,19 +1,20 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
+ value: true
4
5
  });
5
- Object.defineProperty(exports, "useOverflowCount", {
6
- enumerable: true,
7
- get: ()=>useOverflowCount
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);
8
18
  });
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
-
19
+ exports.useOverflowCount = useOverflowCount;
19
20
  //# sourceMappingURL=useOverflowCount.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/useOverflowCount.js"],"sourcesContent":["import { useOverflowContext } from \"./overflowContext\";\n/**\n * @returns Number of items that are overflowing\n */\nexport const useOverflowCount = () => useOverflowContext(v => {\n return Object.entries(v.itemVisibility).reduce((acc, [id, visible]) => {\n if (!visible) {\n acc++;\n }\n return acc;\n }, 0);\n});\n//# sourceMappingURL=useOverflowCount.js.map"],"names":["useOverflowCount","useOverflowContext","v","Object","entries","itemVisibility","reduce","acc","id","visible"],"mappings":";;;;+BAIaA;;aAAAA;;iCAJsB;AAI5B,MAAMA,mBAAmB,IAAMC,IAAAA,mCAAkB,EAACC,CAAAA,IAAK;QAC5D,OAAOC,OAAOC,OAAO,CAACF,EAAEG,cAAc,EAAEC,MAAM,CAAC,CAACC,KAAK,CAACC,IAAIC,QAAQ,GAAK;YACrE,IAAI,CAACA,SAAS;gBACZF;YACF,CAAC;YACD,OAAOA;QACT,GAAG;IACL,IACA,4CAA4C"}
1
+ {"version":3,"names":["overflowContext_1","require","useOverflowCount","useOverflowContext","v","Object","entries","itemVisibility","reduce","acc","id","visible","exports"],"sources":["../../../../../../../packages/react-components/react-overflow/src/useOverflowCount.ts"],"sourcesContent":["import { useOverflowContext } from './overflowContext';\n\n/**\n * @returns Number of items that are overflowing\n */\nexport const useOverflowCount = () =>\n useOverflowContext(v => {\n return Object.entries(v.itemVisibility).reduce((acc, [id, visible]) => {\n if (!visible) {\n acc++;\n }\n\n return acc;\n }, 0);\n });\n"],"mappings":";;;;;;AAAA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA;;;AAGO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BF,iBAAA,CAAAG,kBAAkB,CAACC,CAAC,IAAG;EACrB,OAAOC,MAAM,CAACC,OAAO,CAACF,CAAC,CAACG,cAAc,CAAC,CAACC,MAAM,CAAC,CAACC,GAAG,EAAE,CAACC,EAAE,EAAEC,OAAO,CAAC,KAAI;IACpE,IAAI,CAACA,OAAO,EAAE;MACZF,GAAG,EAAE;;IAGP,OAAOA,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC;AACP,CAAC,CAAC;AATSG,OAAA,CAAAV,gBAAgB,GAAAA,gBAAA"}
@@ -1,34 +1,34 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useOverflowItem", {
6
- enumerable: true,
7
- get: ()=>useOverflowItem
4
+ value: true
8
5
  });
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 _overflowContext = require("./overflowContext");
6
+ exports.useOverflowItem = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ const overflowContext_1 = /*#__PURE__*/require("./overflowContext");
10
+ /**
11
+ * @internal
12
+ * Registers an overflow item
13
+ * @param id - unique identifier for the item used by the overflow manager
14
+ * @param priority - higher priority means the item overflows later
15
+ * @param groupId - assigns the item to a group, group visibility can be watched
16
+ * @returns ref to assign to an intrinsic HTML element
17
+ */
13
18
  function useOverflowItem(id, priority, groupId) {
14
- const ref = _react.useRef(null);
15
- const registerItem = (0, _overflowContext.useOverflowContext)((v)=>v.registerItem);
16
- (0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
17
- if (ref.current) {
18
- return registerItem({
19
- element: ref.current,
20
- id,
21
- priority: priority ?? 0,
22
- groupId
23
- });
24
- }
25
- }, [
19
+ const ref = React.useRef(null);
20
+ const registerItem = overflowContext_1.useOverflowContext(v => v.registerItem);
21
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
22
+ if (ref.current) {
23
+ return registerItem({
24
+ element: ref.current,
26
25
  id,
27
- priority,
28
- registerItem,
26
+ priority: priority !== null && priority !== void 0 ? priority : 0,
29
27
  groupId
30
- ]);
31
- return ref;
32
- } //# sourceMappingURL=useOverflowItem.js.map
33
-
28
+ });
29
+ }
30
+ }, [id, priority, registerItem, groupId]);
31
+ return ref;
32
+ }
33
+ exports.useOverflowItem = useOverflowItem;
34
34
  //# sourceMappingURL=useOverflowItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/useOverflowItem.js"],"sourcesContent":["import * as React from \"react\";\nimport { useIsomorphicLayoutEffect } from \"@fluentui/react-utilities\";\nimport { useOverflowContext } from \"./overflowContext\";\n/**\n * @internal\n * Registers an overflow item\n * @param id - unique identifier for the item used by the overflow manager\n * @param priority - higher priority means the item overflows later\n * @param groupId - assigns the item to a group, group visibility can be watched\n * @returns ref to assign to an intrinsic HTML element\n */\nexport function useOverflowItem(id, priority, groupId) {\n const ref = React.useRef(null);\n const registerItem = useOverflowContext(v => v.registerItem);\n useIsomorphicLayoutEffect(() => {\n if (ref.current) {\n return registerItem({\n element: ref.current,\n id,\n priority: priority ?? 0,\n groupId\n });\n }\n }, [id, priority, registerItem, groupId]);\n return ref;\n}\n//# sourceMappingURL=useOverflowItem.js.map"],"names":["useOverflowItem","id","priority","groupId","ref","React","useRef","registerItem","useOverflowContext","v","useIsomorphicLayoutEffect","current","element"],"mappings":";;;;+BAWgBA;;aAAAA;;;6DAXO;gCACmB;iCACP;AAS5B,SAASA,gBAAgBC,EAAE,EAAEC,QAAQ,EAAEC,OAAO,EAAE;IACrD,MAAMC,MAAMC,OAAMC,MAAM,CAAC,IAAI;IAC7B,MAAMC,eAAeC,IAAAA,mCAAkB,EAACC,CAAAA,IAAKA,EAAEF,YAAY;IAC3DG,IAAAA,yCAAyB,EAAC,IAAM;QAC9B,IAAIN,IAAIO,OAAO,EAAE;YACf,OAAOJ,aAAa;gBAClBK,SAASR,IAAIO,OAAO;gBACpBV;gBACAC,UAAUA,YAAY;gBACtBC;YACF;QACF,CAAC;IACH,GAAG;QAACF;QAAIC;QAAUK;QAAcJ;KAAQ;IACxC,OAAOC;AACT,EACA,2CAA2C"}
1
+ {"version":3,"names":["React","require","react_utilities_1","overflowContext_1","useOverflowItem","id","priority","groupId","ref","useRef","registerItem","useOverflowContext","v","useIsomorphicLayoutEffect","current","element","exports"],"sources":["../../../../../../../packages/react-components/react-overflow/src/useOverflowItem.ts"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\n\n/**\n * @internal\n * Registers an overflow item\n * @param id - unique identifier for the item used by the overflow manager\n * @param priority - higher priority means the item overflows later\n * @param groupId - assigns the item to a group, group visibility can be watched\n * @returns ref to assign to an intrinsic HTML element\n */\nexport function useOverflowItem<TElement extends HTMLElement>(id: string, priority?: number, groupId?: string) {\n const ref = React.useRef<TElement>(null);\n const registerItem = useOverflowContext(v => v.registerItem);\n\n useIsomorphicLayoutEffect(() => {\n if (ref.current) {\n return registerItem({\n element: ref.current,\n id,\n priority: priority ?? 0,\n groupId,\n });\n }\n }, [id, priority, registerItem, groupId]);\n\n return ref;\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AAEA;;;;;;;;AAQA,SAAgBG,eAAeA,CAA+BC,EAAU,EAAEC,QAAiB,EAAEC,OAAgB;EAC3G,MAAMC,GAAG,GAAGR,KAAK,CAACS,MAAM,CAAW,IAAI,CAAC;EACxC,MAAMC,YAAY,GAAGP,iBAAA,CAAAQ,kBAAkB,CAACC,CAAC,IAAIA,CAAC,CAACF,YAAY,CAAC;EAE5DR,iBAAA,CAAAW,yBAAyB,CAAC,MAAK;IAC7B,IAAIL,GAAG,CAACM,OAAO,EAAE;MACf,OAAOJ,YAAY,CAAC;QAClBK,OAAO,EAAEP,GAAG,CAACM,OAAO;QACpBT,EAAE;QACFC,QAAQ,EAAEA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,CAAC;QACvBC;OACD,CAAC;;EAEN,CAAC,EAAE,CAACF,EAAE,EAAEC,QAAQ,EAAEI,YAAY,EAAEH,OAAO,CAAC,CAAC;EAEzC,OAAOC,GAAG;AACZ;AAhBAQ,OAAA,CAAAZ,eAAA,GAAAA,eAAA"}
@@ -1,46 +1,35 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useOverflowMenu", {
6
- enumerable: true,
7
- get: ()=>useOverflowMenu
4
+ value: true
8
5
  });
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 _overflowContext = require("./overflowContext");
13
- const _useOverflowCount = require("./useOverflowCount");
6
+ exports.useOverflowMenu = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ const overflowContext_1 = /*#__PURE__*/require("./overflowContext");
10
+ const useOverflowCount_1 = /*#__PURE__*/require("./useOverflowCount");
14
11
  function useOverflowMenu(id) {
15
- const elementId = (0, _reactUtilities.useId)("overflow-menu", id);
16
- const overflowCount = (0, _useOverflowCount.useOverflowCount)();
17
- const registerOverflowMenu = (0, _overflowContext.useOverflowContext)((v)=>v.registerOverflowMenu);
18
- const updateOverflow = (0, _overflowContext.useOverflowContext)((v)=>v.updateOverflow);
19
- const ref = _react.useRef(null);
20
- const isOverflowing = overflowCount > 0;
21
- (0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
22
- if (ref.current) {
23
- return registerOverflowMenu(ref.current);
24
- }
25
- }, [
26
- registerOverflowMenu,
27
- isOverflowing,
28
- elementId
29
- ]);
30
- (0, _reactUtilities.useIsomorphicLayoutEffect)(()=>{
31
- if (isOverflowing) {
32
- updateOverflow();
33
- }
34
- }, [
35
- isOverflowing,
36
- updateOverflow,
37
- ref
38
- ]);
39
- return {
40
- ref,
41
- overflowCount,
42
- isOverflowing
43
- };
44
- } //# sourceMappingURL=useOverflowMenu.js.map
45
-
12
+ const elementId = react_utilities_1.useId('overflow-menu', id);
13
+ const overflowCount = useOverflowCount_1.useOverflowCount();
14
+ const registerOverflowMenu = overflowContext_1.useOverflowContext(v => v.registerOverflowMenu);
15
+ const updateOverflow = overflowContext_1.useOverflowContext(v => v.updateOverflow);
16
+ const ref = React.useRef(null);
17
+ const isOverflowing = overflowCount > 0;
18
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
19
+ if (ref.current) {
20
+ return registerOverflowMenu(ref.current);
21
+ }
22
+ }, [registerOverflowMenu, isOverflowing, elementId]);
23
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
24
+ if (isOverflowing) {
25
+ updateOverflow();
26
+ }
27
+ }, [isOverflowing, updateOverflow, ref]);
28
+ return {
29
+ ref,
30
+ overflowCount,
31
+ isOverflowing
32
+ };
33
+ }
34
+ exports.useOverflowMenu = useOverflowMenu;
46
35
  //# sourceMappingURL=useOverflowMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/useOverflowMenu.js"],"sourcesContent":["import * as React from \"react\";\nimport { useId, useIsomorphicLayoutEffect } from \"@fluentui/react-utilities\";\nimport { useOverflowContext } from \"./overflowContext\";\nimport { useOverflowCount } from \"./useOverflowCount\";\nexport function useOverflowMenu(id) {\n const elementId = useId(\"overflow-menu\", id);\n const overflowCount = useOverflowCount();\n const registerOverflowMenu = useOverflowContext(v => v.registerOverflowMenu);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const ref = React.useRef(null);\n const isOverflowing = overflowCount > 0;\n useIsomorphicLayoutEffect(() => {\n if (ref.current) {\n return registerOverflowMenu(ref.current);\n }\n }, [registerOverflowMenu, isOverflowing, elementId]);\n useIsomorphicLayoutEffect(() => {\n if (isOverflowing) {\n updateOverflow();\n }\n }, [isOverflowing, updateOverflow, ref]);\n return {\n ref,\n overflowCount,\n isOverflowing\n };\n}\n//# sourceMappingURL=useOverflowMenu.js.map"],"names":["useOverflowMenu","id","elementId","useId","overflowCount","useOverflowCount","registerOverflowMenu","useOverflowContext","v","updateOverflow","ref","React","useRef","isOverflowing","useIsomorphicLayoutEffect","current"],"mappings":";;;;+BAIgBA;;aAAAA;;;6DAJO;gCAC0B;iCACd;kCACF;AAC1B,SAASA,gBAAgBC,EAAE,EAAE;IAClC,MAAMC,YAAYC,IAAAA,qBAAK,EAAC,iBAAiBF;IACzC,MAAMG,gBAAgBC,IAAAA,kCAAgB;IACtC,MAAMC,uBAAuBC,IAAAA,mCAAkB,EAACC,CAAAA,IAAKA,EAAEF,oBAAoB;IAC3E,MAAMG,iBAAiBF,IAAAA,mCAAkB,EAACC,CAAAA,IAAKA,EAAEC,cAAc;IAC/D,MAAMC,MAAMC,OAAMC,MAAM,CAAC,IAAI;IAC7B,MAAMC,gBAAgBT,gBAAgB;IACtCU,IAAAA,yCAAyB,EAAC,IAAM;QAC9B,IAAIJ,IAAIK,OAAO,EAAE;YACf,OAAOT,qBAAqBI,IAAIK,OAAO;QACzC,CAAC;IACH,GAAG;QAACT;QAAsBO;QAAeX;KAAU;IACnDY,IAAAA,yCAAyB,EAAC,IAAM;QAC9B,IAAID,eAAe;YACjBJ;QACF,CAAC;IACH,GAAG;QAACI;QAAeJ;QAAgBC;KAAI;IACvC,OAAO;QACLA;QACAN;QACAS;IACF;AACF,EACA,2CAA2C"}
1
+ {"version":3,"names":["React","require","react_utilities_1","overflowContext_1","useOverflowCount_1","useOverflowMenu","id","elementId","useId","overflowCount","useOverflowCount","registerOverflowMenu","useOverflowContext","v","updateOverflow","ref","useRef","isOverflowing","useIsomorphicLayoutEffect","current","exports"],"sources":["../../../../../../../packages/react-components/react-overflow/src/useOverflowMenu.ts"],"sourcesContent":["import * as React from 'react';\nimport { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\nimport { useOverflowCount } from './useOverflowCount';\n\nexport function useOverflowMenu<TElement extends HTMLElement>(id?: string) {\n const elementId = useId('overflow-menu', id);\n const overflowCount = useOverflowCount();\n const registerOverflowMenu = useOverflowContext(v => v.registerOverflowMenu);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const ref = React.useRef<TElement>(null);\n const isOverflowing = overflowCount > 0;\n\n useIsomorphicLayoutEffect(() => {\n if (ref.current) {\n return registerOverflowMenu(ref.current);\n }\n }, [registerOverflowMenu, isOverflowing, elementId]);\n\n useIsomorphicLayoutEffect(() => {\n if (isOverflowing) {\n updateOverflow();\n }\n }, [isOverflowing, updateOverflow, ref]);\n\n return { ref, overflowCount, isOverflowing };\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,iBAAA,gBAAAF,OAAA;AACA,MAAAG,kBAAA,gBAAAH,OAAA;AAEA,SAAgBI,eAAeA,CAA+BC,EAAW;EACvE,MAAMC,SAAS,GAAGL,iBAAA,CAAAM,KAAK,CAAC,eAAe,EAAEF,EAAE,CAAC;EAC5C,MAAMG,aAAa,GAAGL,kBAAA,CAAAM,gBAAgB,EAAE;EACxC,MAAMC,oBAAoB,GAAGR,iBAAA,CAAAS,kBAAkB,CAACC,CAAC,IAAIA,CAAC,CAACF,oBAAoB,CAAC;EAC5E,MAAMG,cAAc,GAAGX,iBAAA,CAAAS,kBAAkB,CAACC,CAAC,IAAIA,CAAC,CAACC,cAAc,CAAC;EAChE,MAAMC,GAAG,GAAGf,KAAK,CAACgB,MAAM,CAAW,IAAI,CAAC;EACxC,MAAMC,aAAa,GAAGR,aAAa,GAAG,CAAC;EAEvCP,iBAAA,CAAAgB,yBAAyB,CAAC,MAAK;IAC7B,IAAIH,GAAG,CAACI,OAAO,EAAE;MACf,OAAOR,oBAAoB,CAACI,GAAG,CAACI,OAAO,CAAC;;EAE5C,CAAC,EAAE,CAACR,oBAAoB,EAAEM,aAAa,EAAEV,SAAS,CAAC,CAAC;EAEpDL,iBAAA,CAAAgB,yBAAyB,CAAC,MAAK;IAC7B,IAAID,aAAa,EAAE;MACjBH,cAAc,EAAE;;EAEpB,CAAC,EAAE,CAACG,aAAa,EAAEH,cAAc,EAAEC,GAAG,CAAC,CAAC;EAExC,OAAO;IAAEA,GAAG;IAAEN,aAAa;IAAEQ;EAAa,CAAE;AAC9C;AArBAG,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-overflow",
3
- "version": "0.0.0-nightly-20230317-1454.1",
3
+ "version": "0.0.0-nightly-20230321-0440.1",
4
4
  "description": "React bindings for @fluentui/priority-overflow",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -24,7 +24,7 @@
24
24
  "test": "jest --passWithNoTests",
25
25
  "storybook": "start-storybook",
26
26
  "type-check": "tsc -b tsconfig.json",
27
- "generate-api": "just-scripts generate-api"
27
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@fluentui/eslint-plugin": "*",
@@ -33,12 +33,12 @@
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/priority-overflow": "0.0.0-nightly-20230317-1454.1",
37
- "@fluentui/react-context-selector": "0.0.0-nightly-20230317-1454.1",
38
- "@fluentui/react-theme": "0.0.0-nightly-20230317-1454.1",
39
- "@fluentui/react-utilities": "0.0.0-nightly-20230317-1454.1",
36
+ "@fluentui/priority-overflow": "0.0.0-nightly-20230321-0440.1",
37
+ "@fluentui/react-context-selector": "0.0.0-nightly-20230321-0440.1",
38
+ "@fluentui/react-theme": "0.0.0-nightly-20230321-0440.1",
39
+ "@fluentui/react-utilities": "0.0.0-nightly-20230321-0440.1",
40
40
  "@griffel/react": "^1.5.2",
41
- "@swc/helpers": "^0.4.14"
41
+ "tslib": "^2.1.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@types/react": ">=16.8.0 <19.0.0",
@@ -51,6 +51,7 @@
51
51
  "exports": {
52
52
  ".": {
53
53
  "types": "./dist/index.d.ts",
54
+ "node": "./lib-commonjs/index.js",
54
55
  "import": "./lib/index.js",
55
56
  "require": "./lib-commonjs/index.js"
56
57
  },
package/.swcrc DELETED
@@ -1,39 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/swcrc",
3
- "env": {
4
- "targets": {
5
- "chrome": "84",
6
- "edge": "84",
7
- "firefox": "75",
8
- "opera": "73",
9
- "safari": "14.1"
10
- },
11
- "bugfixes": true
12
- },
13
- "exclude": [
14
- "/testing",
15
- "/**/*.cy.ts",
16
- "/**/*.cy.tsx",
17
- "/**/*.spec.ts",
18
- "/**/*.spec.tsx",
19
- "/**/*.test.ts",
20
- "/**/*.test.tsx"
21
- ],
22
- "jsc": {
23
- "parser": {
24
- "syntax": "typescript",
25
- "tsx": true,
26
- "decorators": false,
27
- "dynamicImport": false
28
- },
29
- "externalHelpers": true,
30
- "transform": {
31
- "react": {
32
- "runtime": "classic",
33
- "useSpread": true
34
- }
35
- }
36
- },
37
- "minify": false,
38
- "sourceMaps": true
39
- }