@fluentui/react-positioning 9.5.4 → 9.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +55 -1
  3. package/CHANGELOG.md +24 -2
  4. package/lib/constants.js.map +1 -1
  5. package/lib/createArrowStyles.js.map +1 -1
  6. package/lib/createPositionManager.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +1 -2
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/middleware/coverTarget.js.map +1 -1
  11. package/lib/middleware/flip.js.map +1 -1
  12. package/lib/middleware/index.js.map +1 -1
  13. package/lib/middleware/intersecting.js.map +1 -1
  14. package/lib/middleware/maxSize.js.map +1 -1
  15. package/lib/middleware/offset.js.map +1 -1
  16. package/lib/middleware/shift.js.map +1 -1
  17. package/lib/types.js +1 -1
  18. package/lib/types.js.map +1 -1
  19. package/lib/usePositioning.js +23 -21
  20. package/lib/usePositioning.js.map +1 -1
  21. package/lib/usePositioningMouseTarget.js.map +1 -1
  22. package/lib/utils/debounce.js +1 -2
  23. package/lib/utils/debounce.js.map +1 -1
  24. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  25. package/lib/utils/getBoundary.js.map +1 -1
  26. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  27. package/lib/utils/getReactFiberFromNode.js +1 -0
  28. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  29. package/lib/utils/getScrollParent.js +5 -6
  30. package/lib/utils/getScrollParent.js.map +1 -1
  31. package/lib/utils/hasAutoFocusFilter.js +2 -2
  32. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  33. package/lib/utils/index.js.map +1 -1
  34. package/lib/utils/mergeArrowOffset.js +3 -4
  35. package/lib/utils/mergeArrowOffset.js.map +1 -1
  36. package/lib/utils/parseFloatingUIPlacement.js +1 -2
  37. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  38. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  39. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  40. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  41. package/lib/utils/toggleScrollListener.js.map +1 -1
  42. package/lib/utils/useCallbackRef.js.map +1 -1
  43. package/lib/utils/writeArrowUpdates.js +1 -2
  44. package/lib/utils/writeArrowUpdates.js.map +1 -1
  45. package/lib/utils/writeContainerupdates.js +4 -4
  46. package/lib/utils/writeContainerupdates.js.map +1 -1
  47. package/lib-commonjs/constants.js +18 -7
  48. package/lib-commonjs/constants.js.map +1 -1
  49. package/lib-commonjs/createArrowStyles.js +60 -88
  50. package/lib-commonjs/createArrowStyles.js.map +1 -1
  51. package/lib-commonjs/createPositionManager.js +103 -117
  52. package/lib-commonjs/createPositionManager.js.map +1 -1
  53. package/lib-commonjs/createVirtualElementFromClick.js +27 -26
  54. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  55. package/lib-commonjs/index.js +24 -51
  56. package/lib-commonjs/index.js.map +1 -1
  57. package/lib-commonjs/middleware/coverTarget.js +34 -37
  58. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  59. package/lib-commonjs/middleware/flip.js +31 -38
  60. package/lib-commonjs/middleware/flip.js.map +1 -1
  61. package/lib-commonjs/middleware/index.js +10 -9
  62. package/lib-commonjs/middleware/index.js.map +1 -1
  63. package/lib-commonjs/middleware/intersecting.js +24 -22
  64. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  65. package/lib-commonjs/middleware/maxSize.js +34 -40
  66. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  67. package/lib-commonjs/middleware/offset.js +11 -12
  68. package/lib-commonjs/middleware/offset.js.map +1 -1
  69. package/lib-commonjs/middleware/shift.js +29 -37
  70. package/lib-commonjs/middleware/shift.js.map +1 -1
  71. package/lib-commonjs/types.js +5 -2
  72. package/lib-commonjs/types.js.map +1 -1
  73. package/lib-commonjs/usePositioning.js +200 -164
  74. package/lib-commonjs/usePositioning.js.map +1 -1
  75. package/lib-commonjs/usePositioningMouseTarget.js +34 -37
  76. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  77. package/lib-commonjs/utils/debounce.js +22 -21
  78. package/lib-commonjs/utils/debounce.js.map +1 -1
  79. package/lib-commonjs/utils/fromFloatingUIPlacement.js +30 -35
  80. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  81. package/lib-commonjs/utils/getBoundary.js +21 -22
  82. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  83. package/lib-commonjs/utils/getFloatingUIOffset.js +23 -35
  84. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  85. package/lib-commonjs/utils/getReactFiberFromNode.js +45 -41
  86. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  87. package/lib-commonjs/utils/getScrollParent.js +52 -56
  88. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  89. package/lib-commonjs/utils/hasAutoFocusFilter.js +18 -17
  90. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  91. package/lib-commonjs/utils/index.js +19 -18
  92. package/lib-commonjs/utils/index.js.map +1 -1
  93. package/lib-commonjs/utils/mergeArrowOffset.js +33 -32
  94. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  95. package/lib-commonjs/utils/parseFloatingUIPlacement.js +15 -14
  96. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  97. package/lib-commonjs/utils/resolvePositioningShorthand.js +63 -61
  98. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  99. package/lib-commonjs/utils/toFloatingUIPadding.js +23 -25
  100. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  101. package/lib-commonjs/utils/toFloatingUIPlacement.js +31 -33
  102. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  103. package/lib-commonjs/utils/toggleScrollListener.js +20 -24
  104. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  105. package/lib-commonjs/utils/useCallbackRef.js +39 -53
  106. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  107. package/lib-commonjs/utils/writeArrowUpdates.js +19 -24
  108. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  109. package/lib-commonjs/utils/writeContainerupdates.js +37 -45
  110. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  111. package/package.json +7 -6
  112. package/lib-amd/constants.js +0 -10
  113. package/lib-amd/constants.js.map +0 -1
  114. package/lib-amd/createArrowStyles.js +0 -62
  115. package/lib-amd/createArrowStyles.js.map +0 -1
  116. package/lib-amd/createPositionManager.js +0 -97
  117. package/lib-amd/createPositionManager.js.map +0 -1
  118. package/lib-amd/createVirtualElementFromClick.js +0 -32
  119. package/lib-amd/createVirtualElementFromClick.js.map +0 -1
  120. package/lib-amd/index.js +0 -13
  121. package/lib-amd/index.js.map +0 -1
  122. package/lib-amd/middleware/coverTarget.js +0 -32
  123. package/lib-amd/middleware/coverTarget.js.map +0 -1
  124. package/lib-amd/middleware/flip.js +0 -19
  125. package/lib-amd/middleware/flip.js.map +0 -1
  126. package/lib-amd/middleware/index.js +0 -11
  127. package/lib-amd/middleware/index.js.map +0 -1
  128. package/lib-amd/middleware/intersecting.js +0 -33
  129. package/lib-amd/middleware/intersecting.js.map +0 -1
  130. package/lib-amd/middleware/maxSize.js +0 -33
  131. package/lib-amd/middleware/maxSize.js.map +0 -1
  132. package/lib-amd/middleware/offset.js +0 -14
  133. package/lib-amd/middleware/offset.js.map +0 -1
  134. package/lib-amd/middleware/shift.js +0 -17
  135. package/lib-amd/middleware/shift.js.map +0 -1
  136. package/lib-amd/types.js +0 -5
  137. package/lib-amd/types.js.map +0 -1
  138. package/lib-amd/usePositioning.js +0 -161
  139. package/lib-amd/usePositioning.js.map +0 -1
  140. package/lib-amd/usePositioningMouseTarget.js +0 -39
  141. package/lib-amd/usePositioningMouseTarget.js.map +0 -1
  142. package/lib-amd/utils/debounce.js +0 -27
  143. package/lib-amd/utils/debounce.js.map +0 -1
  144. package/lib-amd/utils/fromFloatingUIPlacement.js +0 -37
  145. package/lib-amd/utils/fromFloatingUIPlacement.js.map +0 -1
  146. package/lib-amd/utils/getBoundary.js +0 -26
  147. package/lib-amd/utils/getBoundary.js.map +0 -1
  148. package/lib-amd/utils/getFloatingUIOffset.js +0 -25
  149. package/lib-amd/utils/getFloatingUIOffset.js.map +0 -1
  150. package/lib-amd/utils/getReactFiberFromNode.js +0 -48
  151. package/lib-amd/utils/getReactFiberFromNode.js.map +0 -1
  152. package/lib-amd/utils/getScrollParent.js +0 -64
  153. package/lib-amd/utils/getScrollParent.js.map +0 -1
  154. package/lib-amd/utils/hasAutoFocusFilter.js +0 -31
  155. package/lib-amd/utils/hasAutoFocusFilter.js.map +0 -1
  156. package/lib-amd/utils/index.js +0 -20
  157. package/lib-amd/utils/index.js.map +0 -1
  158. package/lib-amd/utils/mergeArrowOffset.js +0 -38
  159. package/lib-amd/utils/mergeArrowOffset.js.map +0 -1
  160. package/lib-amd/utils/parseFloatingUIPlacement.js +0 -20
  161. package/lib-amd/utils/parseFloatingUIPlacement.js.map +0 -1
  162. package/lib-amd/utils/resolvePositioningShorthand.js +0 -31
  163. package/lib-amd/utils/resolvePositioningShorthand.js.map +0 -1
  164. package/lib-amd/utils/toFloatingUIPadding.js +0 -25
  165. package/lib-amd/utils/toFloatingUIPadding.js.map +0 -1
  166. package/lib-amd/utils/toFloatingUIPlacement.js +0 -40
  167. package/lib-amd/utils/toFloatingUIPlacement.js.map +0 -1
  168. package/lib-amd/utils/toggleScrollListener.js +0 -26
  169. package/lib-amd/utils/toggleScrollListener.js.map +0 -1
  170. package/lib-amd/utils/useCallbackRef.js +0 -55
  171. package/lib-amd/utils/useCallbackRef.js.map +0 -1
  172. package/lib-amd/utils/writeArrowUpdates.js +0 -21
  173. package/lib-amd/utils/writeArrowUpdates.js.map +0 -1
  174. package/lib-amd/utils/writeContainerupdates.js +0 -41
  175. package/lib-amd/utils/writeContainerupdates.js.map +0 -1
@@ -1,45 +1,40 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- exports.fromFloatingUIPlacement = void 0;
7
- const parseFloatingUIPlacement_1 = /*#__PURE__*/require("./parseFloatingUIPlacement");
8
- const getPositionMap = () => ({
9
- top: 'above',
10
- bottom: 'below',
11
- right: 'after',
12
- left: 'before'
5
+ Object.defineProperty(exports, "fromFloatingUIPlacement", {
6
+ enumerable: true,
7
+ get: ()=>fromFloatingUIPlacement
13
8
  });
9
+ const _parseFloatingUIPlacement = require("./parseFloatingUIPlacement");
10
+ const getPositionMap = ()=>({
11
+ top: 'above',
12
+ bottom: 'below',
13
+ right: 'after',
14
+ left: 'before'
15
+ });
14
16
  // Floating UI automatically flips alignment
15
17
  // https://github.com/floating-ui/floating-ui/issues/1563
16
- const getAlignmentMap = position => {
17
- if (position === 'above' || position === 'below') {
18
+ const getAlignmentMap = (position)=>{
19
+ if (position === 'above' || position === 'below') {
20
+ return {
21
+ start: 'start',
22
+ end: 'end'
23
+ };
24
+ }
18
25
  return {
19
- start: 'start',
20
- end: 'end'
26
+ start: 'top',
27
+ end: 'bottom'
21
28
  };
22
- }
23
- return {
24
- start: 'top',
25
- end: 'bottom'
26
- };
27
- };
28
- /**
29
- * Maps Floating UI placement to positioning values
30
- * @see positioningHelper.test.ts for expected placement values
31
- */
32
- const fromFloatingUIPlacement = placement => {
33
- const {
34
- side,
35
- alignment: floatingUIAlignment
36
- } = parseFloatingUIPlacement_1.parseFloatingUIPlacement(placement);
37
- const position = getPositionMap()[side];
38
- const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];
39
- return {
40
- position,
41
- alignment
42
- };
43
29
  };
44
- exports.fromFloatingUIPlacement = fromFloatingUIPlacement;
30
+ const fromFloatingUIPlacement = (placement)=>{
31
+ const { side , alignment: floatingUIAlignment } = (0, _parseFloatingUIPlacement.parseFloatingUIPlacement)(placement);
32
+ const position = getPositionMap()[side];
33
+ const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];
34
+ return {
35
+ position,
36
+ alignment
37
+ };
38
+ }; //# sourceMappingURL=fromFloatingUIPlacement.js.map
39
+
45
40
  //# sourceMappingURL=fromFloatingUIPlacement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["parseFloatingUIPlacement_1","require","getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","fromFloatingUIPlacement","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/fromFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Alignment as FloatingUIAlignment, Placement } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\nimport { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\n\nconst getPositionMap = (): Record<Side, Position> => ({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (position: Position): Record<FloatingUIAlignment, Alignment> => {\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end',\n };\n }\n\n return {\n start: 'top',\n end: 'bottom',\n };\n};\n\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const fromFloatingUIPlacement = (placement: Placement): { position: Position; alignment?: Alignment } => {\n const { side, alignment: floatingUIAlignment } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n\n return { position, alignment };\n};\n"],"mappings":";;;;;;AAEA,MAAAA,0BAAA,gBAAAC,OAAA;AAEA,MAAMC,cAAc,GAAGA,CAAA,MAA+B;EACpDC,GAAG,EAAE,OAAO;EACZC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;CACP,CAAC;AAEF;AACA;AACA,MAAMC,eAAe,GAAIC,QAAkB,IAA4C;EACrF,IAAIA,QAAQ,KAAK,OAAO,IAAIA,QAAQ,KAAK,OAAO,EAAE;IAChD,OAAO;MACLC,KAAK,EAAE,OAAO;MACdC,GAAG,EAAE;KACN;;EAGH,OAAO;IACLD,KAAK,EAAE,KAAK;IACZC,GAAG,EAAE;GACN;AACH,CAAC;AAED;;;;AAIO,MAAMC,uBAAuB,GAAIC,SAAoB,IAAmD;EAC7G,MAAM;IAAEC,IAAI;IAAEC,SAAS,EAAEC;EAAmB,CAAE,GAAGf,0BAAA,CAAAgB,wBAAwB,CAACJ,SAAS,CAAC;EACpF,MAAMJ,QAAQ,GAAGN,cAAc,EAAE,CAACW,IAAI,CAAC;EACvC,MAAMC,SAAS,GAAGC,mBAAmB,IAAIR,eAAe,CAACC,QAAQ,CAAC,CAACO,mBAAmB,CAAC;EAEvF,OAAO;IAAEP,QAAQ;IAAEM;EAAS,CAAE;AAChC,CAAC;AANYG,OAAA,CAAAN,uBAAuB,GAAAA,uBAAA"}
1
+ {"version":3,"sources":["../../lib/utils/fromFloatingUIPlacement.js"],"sourcesContent":["import { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\nconst getPositionMap = () => ({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before'\n});\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = position => {\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end'\n };\n }\n return {\n start: 'top',\n end: 'bottom'\n };\n};\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const fromFloatingUIPlacement = placement => {\n const {\n side,\n alignment: floatingUIAlignment\n } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n return {\n position,\n alignment\n };\n};\n//# sourceMappingURL=fromFloatingUIPlacement.js.map"],"names":["fromFloatingUIPlacement","getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement"],"mappings":";;;;+BAyBaA;;aAAAA;;0CAzB4B;AACzC,MAAMC,iBAAiB,IAAO,CAAA;QAC5BC,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,MAAM;IACR,CAAA;AACA,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMC,kBAAkBC,CAAAA,WAAY;IAClC,IAAIA,aAAa,WAAWA,aAAa,SAAS;QAChD,OAAO;YACLC,OAAO;YACPC,KAAK;QACP;IACF,CAAC;IACD,OAAO;QACLD,OAAO;QACPC,KAAK;IACP;AACF;AAKO,MAAMT,0BAA0BU,CAAAA,YAAa;IAClD,MAAM,EACJC,KAAI,EACJC,WAAWC,oBAAmB,EAC/B,GAAGC,IAAAA,kDAAwB,EAACJ;IAC7B,MAAMH,WAAWN,gBAAgB,CAACU,KAAK;IACvC,MAAMC,YAAYC,uBAAuBP,gBAAgBC,SAAS,CAACM,oBAAoB;IACvF,OAAO;QACLN;QACAK;IACF;AACF,GACA,mDAAmD"}
@@ -1,28 +1,27 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getBoundary", {
6
+ enumerable: true,
7
+ get: ()=>getBoundary
5
8
  });
6
- exports.getBoundary = void 0;
7
- const getScrollParent_1 = /*#__PURE__*/require("./getScrollParent");
8
- /**
9
- * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.
10
- */
9
+ const _getScrollParent = require("./getScrollParent");
11
10
  function getBoundary(element, boundary) {
12
- if (boundary === 'window') {
13
- return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
14
- }
15
- if (boundary === 'clippingParents') {
16
- return 'clippingAncestors';
17
- }
18
- if (boundary === 'scrollParent') {
19
- let boundariesNode = getScrollParent_1.getScrollParent(element);
20
- if (boundariesNode.nodeName === 'BODY') {
21
- boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
11
+ if (boundary === 'window') {
12
+ return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
13
+ }
14
+ if (boundary === 'clippingParents') {
15
+ return 'clippingAncestors';
22
16
  }
23
- return boundariesNode;
24
- }
25
- return boundary;
26
- }
27
- exports.getBoundary = getBoundary;
17
+ if (boundary === 'scrollParent') {
18
+ let boundariesNode = (0, _getScrollParent.getScrollParent)(element);
19
+ if (boundariesNode.nodeName === 'BODY') {
20
+ boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
21
+ }
22
+ return boundariesNode;
23
+ }
24
+ return boundary;
25
+ } //# sourceMappingURL=getBoundary.js.map
26
+
28
27
  //# sourceMappingURL=getBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getScrollParent_1","require","getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getBoundary.ts"],"sourcesContent":["import type { Boundary as FloatingUIBoundary } from '@floating-ui/dom';\n\nimport { getScrollParent } from './getScrollParent';\nimport type { Boundary } from '../types';\n\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */\nexport function getBoundary(element: HTMLElement | null, boundary?: Boundary): FloatingUIBoundary | undefined {\n if (boundary === 'window') {\n return element?.ownerDocument!.documentElement;\n }\n\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n\n if (boundary === 'scrollParent') {\n let boundariesNode: HTMLElement | undefined = getScrollParent(element);\n\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element?.ownerDocument!.documentElement;\n }\n\n return boundariesNode;\n }\n\n return boundary;\n}\n"],"mappings":";;;;;;AAEA,MAAAA,iBAAA,gBAAAC,OAAA;AAGA;;;AAGA,SAAgBC,WAAWA,CAACC,OAA2B,EAAEC,QAAmB;EAC1E,IAAIA,QAAQ,KAAK,QAAQ,EAAE;IACzB,OAAOD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;EAGhD,IAAIF,QAAQ,KAAK,iBAAiB,EAAE;IAClC,OAAO,mBAAmB;;EAG5B,IAAIA,QAAQ,KAAK,cAAc,EAAE;IAC/B,IAAIG,cAAc,GAA4BP,iBAAA,CAAAQ,eAAe,CAACL,OAAO,CAAC;IAEtE,IAAII,cAAc,CAACE,QAAQ,KAAK,MAAM,EAAE;MACtCF,cAAc,GAAGJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;IAG1D,OAAOC,cAAc;;EAGvB,OAAOH,QAAQ;AACjB;AApBAM,OAAA,CAAAR,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"sources":["../../lib/utils/getBoundary.js"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */\nexport function getBoundary(element, boundary) {\n if (boundary === 'window') {\n return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;\n }\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n if (boundary === 'scrollParent') {\n let boundariesNode = getScrollParent(element);\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;\n }\n return boundariesNode;\n }\n return boundary;\n}\n//# sourceMappingURL=getBoundary.js.map"],"names":["getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName"],"mappings":";;;;+BAIgBA;;aAAAA;;iCAJgB;AAIzB,SAASA,YAAYC,OAAO,EAAEC,QAAQ,EAAE;IAC7C,IAAIA,aAAa,UAAU;QACzB,OAAOD,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQE,aAAa,CAACC,eAAe;IAChG,CAAC;IACD,IAAIF,aAAa,mBAAmB;QAClC,OAAO;IACT,CAAC;IACD,IAAIA,aAAa,gBAAgB;QAC/B,IAAIG,iBAAiBC,IAAAA,gCAAe,EAACL;QACrC,IAAII,eAAeE,QAAQ,KAAK,QAAQ;YACtCF,iBAAiBJ,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQE,aAAa,CAACC,eAAe;QAC1G,CAAC;QACD,OAAOC;IACT,CAAC;IACD,OAAOH;AACT,EACA,uCAAuC"}
@@ -1,40 +1,28 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getFloatingUIOffset", {
6
+ enumerable: true,
7
+ get: ()=>getFloatingUIOffset
5
8
  });
6
- exports.getFloatingUIOffset = void 0;
7
- const fromFloatingUIPlacement_1 = /*#__PURE__*/require("./fromFloatingUIPlacement");
8
- /**
9
- * Shim to transform offset values from this library to Floating UI
10
- * @param rawOffset Offset from this library
11
- * @returns An offset value compatible with Floating UI
12
- */
9
+ const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement");
13
10
  function getFloatingUIOffset(rawOffset) {
14
- if (!rawOffset) {
15
- return rawOffset;
16
- }
17
- if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {
18
- return rawOffset;
19
- }
20
- return ({
21
- rects: {
22
- floating,
23
- reference
24
- },
25
- placement
26
- }) => {
27
- const {
28
- position,
29
- alignment
30
- } = fromFloatingUIPlacement_1.fromFloatingUIPlacement(placement);
31
- return rawOffset({
32
- positionedRect: floating,
33
- targetRect: reference,
34
- position,
35
- alignment
36
- });
37
- };
38
- }
39
- exports.getFloatingUIOffset = getFloatingUIOffset;
11
+ if (!rawOffset) {
12
+ return rawOffset;
13
+ }
14
+ if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {
15
+ return rawOffset;
16
+ }
17
+ return ({ rects: { floating , reference } , placement })=>{
18
+ const { position , alignment } = (0, _fromFloatingUIPlacement.fromFloatingUIPlacement)(placement);
19
+ return rawOffset({
20
+ positionedRect: floating,
21
+ targetRect: reference,
22
+ position,
23
+ alignment
24
+ });
25
+ };
26
+ } //# sourceMappingURL=getFloatingUIOffset.js.map
27
+
40
28
  //# sourceMappingURL=getFloatingUIOffset.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["fromFloatingUIPlacement_1","require","getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetValue =\n | number\n | {\n /**\n * The axis that runs along the side of the floating element.\n * @default 0\n */\n mainAxis?: number;\n /**\n * The axis that runs along the alignment of the floating element.\n * @default 0\n */\n crossAxis?: number;\n /**\n * When set to a number, overrides the `crossAxis` value for aligned\n * (non-centered/base) placements and works logically. A positive number\n * will move the floating element in the direction of the opposite edge\n * to the one that is aligned, while a negative number the reverse.\n * @default null\n */\n alignmentAxis?: number | null;\n };\n\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetFunction = (args: MiddlewareArguments) => FloatingUIOffsetValue;\n\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */\nexport function getFloatingUIOffset(\n rawOffset: Offset | undefined,\n): FloatingUIOffsetValue | FloatingUIOffsetFunction | undefined {\n if (!rawOffset) {\n return rawOffset;\n }\n\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n\n return ({ rects: { floating, reference }, placement }) => {\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({ positionedRect: floating, targetRect: reference, position, alignment });\n };\n}\n"],"mappings":";;;;;;AAEA,MAAAA,yBAAA,gBAAAC,OAAA;AAgCA;;;;;AAKA,SAAgBC,mBAAmBA,CACjCC,SAA6B;EAE7B,IAAI,CAACA,SAAS,EAAE;IACd,OAAOA,SAAS;;EAGlB,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IAClE,OAAOA,SAAS;;EAGlB,OAAO,CAAC;IAAEC,KAAK,EAAE;MAAEC,QAAQ;MAAEC;IAAS,CAAE;IAAEC;EAAS,CAAE,KAAI;IACvD,MAAM;MAAEC,QAAQ;MAAEC;IAAS,CAAE,GAAGT,yBAAA,CAAAU,uBAAuB,CAACH,SAAS,CAAC;IAClE,OAAOJ,SAAS,CAAC;MAAEQ,cAAc,EAAEN,QAAQ;MAAEO,UAAU,EAAEN,SAAS;MAAEE,QAAQ;MAAEC;IAAS,CAAE,CAAC;EAC5F,CAAC;AACH;AAfAI,OAAA,CAAAX,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"sources":["../../lib/utils/getFloatingUIOffset.js"],"sourcesContent":["import { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */\nexport function getFloatingUIOffset(rawOffset) {\n if (!rawOffset) {\n return rawOffset;\n }\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n return ({\n rects: {\n floating,\n reference\n },\n placement\n }) => {\n const {\n position,\n alignment\n } = fromFloatingUIPlacement(placement);\n return rawOffset({\n positionedRect: floating,\n targetRect: reference,\n position,\n alignment\n });\n };\n}\n//# sourceMappingURL=getFloatingUIOffset.js.map"],"names":["getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect"],"mappings":";;;;+BAMgBA;;aAAAA;;yCANwB;AAMjC,SAASA,oBAAoBC,SAAS,EAAE;IAC7C,IAAI,CAACA,WAAW;QACd,OAAOA;IACT,CAAC;IACD,IAAI,OAAOA,cAAc,YAAY,OAAOA,cAAc,UAAU;QAClE,OAAOA;IACT,CAAC;IACD,OAAO,CAAC,EACNC,OAAO,EACLC,SAAQ,EACRC,UAAS,EACV,CAAA,EACDC,UAAS,EACV,GAAK;QACJ,MAAM,EACJC,SAAQ,EACRC,UAAS,EACV,GAAGC,IAAAA,gDAAuB,EAACH;QAC5B,OAAOJ,UAAU;YACfQ,gBAAgBN;YAChBO,YAAYN;YACZE;YACAC;QACF;IACF;AACF,EACA,+CAA+C"}
@@ -1,49 +1,53 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getReactFiberFromNode", {
6
+ enumerable: true,
7
+ get: ()=>getReactFiberFromNode
5
8
  });
6
- exports.getReactFiberFromNode = void 0;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
11
  var WorkTag;
8
- (function (WorkTag) {
9
- WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
10
- WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
11
- WorkTag[WorkTag["IndeterminateComponent"] = 2] = "IndeterminateComponent";
12
- WorkTag[WorkTag["HostRoot"] = 3] = "HostRoot";
13
- WorkTag[WorkTag["HostPortal"] = 4] = "HostPortal";
14
- WorkTag[WorkTag["HostComponent"] = 5] = "HostComponent";
15
- WorkTag[WorkTag["HostText"] = 6] = "HostText";
16
- WorkTag[WorkTag["Fragment"] = 7] = "Fragment";
17
- WorkTag[WorkTag["Mode"] = 8] = "Mode";
18
- WorkTag[WorkTag["ContextConsumer"] = 9] = "ContextConsumer";
19
- WorkTag[WorkTag["ContextProvider"] = 10] = "ContextProvider";
20
- WorkTag[WorkTag["ForwardRef"] = 11] = "ForwardRef";
21
- WorkTag[WorkTag["Profiler"] = 12] = "Profiler";
22
- WorkTag[WorkTag["SuspenseComponent"] = 13] = "SuspenseComponent";
23
- WorkTag[WorkTag["MemoComponent"] = 14] = "MemoComponent";
24
- WorkTag[WorkTag["SimpleMemoComponent"] = 15] = "SimpleMemoComponent";
25
- WorkTag[WorkTag["LazyComponent"] = 16] = "LazyComponent";
26
- WorkTag[WorkTag["IncompleteClassComponent"] = 17] = "IncompleteClassComponent";
27
- WorkTag[WorkTag["DehydratedFragment"] = 18] = "DehydratedFragment";
28
- WorkTag[WorkTag["SuspenseListComponent"] = 19] = "SuspenseListComponent";
29
- WorkTag[WorkTag["FundamentalComponent"] = 20] = "FundamentalComponent";
30
- WorkTag[WorkTag["ScopeComponent"] = 21] = "ScopeComponent";
12
+ (function(WorkTag) {
13
+ WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
14
+ WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
15
+ WorkTag[WorkTag["IndeterminateComponent"] = 2] = "IndeterminateComponent";
16
+ WorkTag[WorkTag["HostRoot"] = 3] = "HostRoot";
17
+ WorkTag[WorkTag["HostPortal"] = 4] = "HostPortal";
18
+ WorkTag[WorkTag["HostComponent"] = 5] = "HostComponent";
19
+ WorkTag[WorkTag["HostText"] = 6] = "HostText";
20
+ WorkTag[WorkTag["Fragment"] = 7] = "Fragment";
21
+ WorkTag[WorkTag["Mode"] = 8] = "Mode";
22
+ WorkTag[WorkTag["ContextConsumer"] = 9] = "ContextConsumer";
23
+ WorkTag[WorkTag["ContextProvider"] = 10] = "ContextProvider";
24
+ WorkTag[WorkTag["ForwardRef"] = 11] = "ForwardRef";
25
+ WorkTag[WorkTag["Profiler"] = 12] = "Profiler";
26
+ WorkTag[WorkTag["SuspenseComponent"] = 13] = "SuspenseComponent";
27
+ WorkTag[WorkTag["MemoComponent"] = 14] = "MemoComponent";
28
+ WorkTag[WorkTag["SimpleMemoComponent"] = 15] = "SimpleMemoComponent";
29
+ WorkTag[WorkTag["LazyComponent"] = 16] = "LazyComponent";
30
+ WorkTag[WorkTag["IncompleteClassComponent"] = 17] = "IncompleteClassComponent";
31
+ WorkTag[WorkTag["DehydratedFragment"] = 18] = "DehydratedFragment";
32
+ WorkTag[WorkTag["SuspenseListComponent"] = 19] = "SuspenseListComponent";
33
+ WorkTag[WorkTag["FundamentalComponent"] = 20] = "FundamentalComponent";
34
+ WorkTag[WorkTag["ScopeComponent"] = 21] = "ScopeComponent";
31
35
  })(WorkTag || (WorkTag = {}));
32
36
  function getReactFiberFromNode(elm) {
33
- if (!elm) {
34
- return null;
35
- }
36
- for (const k in elm) {
37
- // React 16 uses "__reactInternalInstance$" prefix
38
- // React 17 uses "__reactFiber$" prefix
39
- // https://github.com/facebook/react/pull/18377
40
- if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {
41
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
42
- // @ts-ignore
43
- return elm[k];
37
+ if (!elm) {
38
+ return null;
44
39
  }
45
- }
46
- throw new Error('getReactFiber(): Failed to find a React Fiber on a node');
47
- }
48
- exports.getReactFiberFromNode = getReactFiberFromNode;
40
+ for(const k in elm){
41
+ // React 16 uses "__reactInternalInstance$" prefix
42
+ // React 17 uses "__reactFiber$" prefix
43
+ // https://github.com/facebook/react/pull/18377
44
+ if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {
45
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
46
+ // @ts-ignore
47
+ return elm[k];
48
+ }
49
+ }
50
+ throw new Error('getReactFiber(): Failed to find a React Fiber on a node');
51
+ } //# sourceMappingURL=getReactFiberFromNode.js.map
52
+
49
53
  //# sourceMappingURL=getReactFiberFromNode.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["WorkTag","getReactFiberFromNode","elm","k","indexOf","Error","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"mappings":";;;;;;AAuEA,IAAKA,OAuBJ;AAvBD,WAAKA,OAAO;EACVA,OAAA,CAAAA,OAAA,gDAAqB;EACrBA,OAAA,CAAAA,OAAA,0CAAkB;EAClBA,OAAA,CAAAA,OAAA,0DAA0B;EAC1BA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,kCAAc;EACdA,OAAA,CAAAA,OAAA,wCAAiB;EACjBA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,sBAAQ;EACRA,OAAA,CAAAA,OAAA,4CAAmB;EACnBA,OAAA,CAAAA,OAAA,6CAAoB;EACpBA,OAAA,CAAAA,OAAA,mCAAe;EACfA,OAAA,CAAAA,OAAA,+BAAa;EACbA,OAAA,CAAAA,OAAA,iDAAsB;EACtBA,OAAA,CAAAA,OAAA,yCAAkB;EAClBA,OAAA,CAAAA,OAAA,qDAAwB;EACxBA,OAAA,CAAAA,OAAA,yCAAkB;EAClBA,OAAA,CAAAA,OAAA,+DAA6B;EAC7BA,OAAA,CAAAA,OAAA,mDAAuB;EACvBA,OAAA,CAAAA,OAAA,yDAA0B;EAC1BA,OAAA,CAAAA,OAAA,uDAAyB;EACzBA,OAAA,CAAAA,OAAA,2CAAmB;AACrB,CAAC,EAvBIA,OAAO,KAAPA,OAAO;AAsLZ,SAAgBC,qBAAqBA,CAACC,GAAqB;EACzD,IAAI,CAACA,GAAG,EAAE;IACR,OAAO,IAAI;;EAGb,KAAK,MAAMC,CAAC,IAAID,GAAG,EAAE;IACnB;IACA;IACA;IACA,IAAIC,CAAC,CAACC,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAID,CAAC,CAACC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;MACnF;MACA;MACA,OAAOF,GAAG,CAACC,CAAC,CAAC;;;EAIjB,MAAM,IAAIE,KAAK,CAAC,yDAAyD,CAAC;AAC5E;AAjBAC,OAAA,CAAAL,qBAAA,GAAAA,qBAAA"}
1
+ {"version":3,"sources":["../../lib/utils/getReactFiberFromNode.js"],"sourcesContent":["import * as React from 'react';\nvar WorkTag;\n(function (WorkTag) {\n WorkTag[WorkTag[\"FunctionComponent\"] = 0] = \"FunctionComponent\";\n WorkTag[WorkTag[\"ClassComponent\"] = 1] = \"ClassComponent\";\n WorkTag[WorkTag[\"IndeterminateComponent\"] = 2] = \"IndeterminateComponent\";\n WorkTag[WorkTag[\"HostRoot\"] = 3] = \"HostRoot\";\n WorkTag[WorkTag[\"HostPortal\"] = 4] = \"HostPortal\";\n WorkTag[WorkTag[\"HostComponent\"] = 5] = \"HostComponent\";\n WorkTag[WorkTag[\"HostText\"] = 6] = \"HostText\";\n WorkTag[WorkTag[\"Fragment\"] = 7] = \"Fragment\";\n WorkTag[WorkTag[\"Mode\"] = 8] = \"Mode\";\n WorkTag[WorkTag[\"ContextConsumer\"] = 9] = \"ContextConsumer\";\n WorkTag[WorkTag[\"ContextProvider\"] = 10] = \"ContextProvider\";\n WorkTag[WorkTag[\"ForwardRef\"] = 11] = \"ForwardRef\";\n WorkTag[WorkTag[\"Profiler\"] = 12] = \"Profiler\";\n WorkTag[WorkTag[\"SuspenseComponent\"] = 13] = \"SuspenseComponent\";\n WorkTag[WorkTag[\"MemoComponent\"] = 14] = \"MemoComponent\";\n WorkTag[WorkTag[\"SimpleMemoComponent\"] = 15] = \"SimpleMemoComponent\";\n WorkTag[WorkTag[\"LazyComponent\"] = 16] = \"LazyComponent\";\n WorkTag[WorkTag[\"IncompleteClassComponent\"] = 17] = \"IncompleteClassComponent\";\n WorkTag[WorkTag[\"DehydratedFragment\"] = 18] = \"DehydratedFragment\";\n WorkTag[WorkTag[\"SuspenseListComponent\"] = 19] = \"SuspenseListComponent\";\n WorkTag[WorkTag[\"FundamentalComponent\"] = 20] = \"FundamentalComponent\";\n WorkTag[WorkTag[\"ScopeComponent\"] = 21] = \"ScopeComponent\";\n})(WorkTag || (WorkTag = {}));\nexport function getReactFiberFromNode(elm) {\n if (!elm) {\n return null;\n }\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n//# sourceMappingURL=getReactFiberFromNode.js.map"],"names":["getReactFiberFromNode","WorkTag","elm","k","indexOf","Error"],"mappings":";;;;+BA0BgBA;;aAAAA;;;6DA1BO;AACvB,IAAIC;AACH,CAAA,SAAUA,OAAO,EAAE;IAClBA,OAAO,CAACA,OAAO,CAAC,oBAAoB,GAAG,EAAE,GAAG;IAC5CA,OAAO,CAACA,OAAO,CAAC,iBAAiB,GAAG,EAAE,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,yBAAyB,GAAG,EAAE,GAAG;IACjDA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,aAAa,GAAG,EAAE,GAAG;IACrCA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,EAAE,GAAG;IACxCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG;IAC/BA,OAAO,CAACA,OAAO,CAAC,kBAAkB,GAAG,EAAE,GAAG;IAC1CA,OAAO,CAACA,OAAO,CAAC,kBAAkB,GAAG,GAAG,GAAG;IAC3CA,OAAO,CAACA,OAAO,CAAC,aAAa,GAAG,GAAG,GAAG;IACtCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG;IACpCA,OAAO,CAACA,OAAO,CAAC,oBAAoB,GAAG,GAAG,GAAG;IAC7CA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,GAAG,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,sBAAsB,GAAG,GAAG,GAAG;IAC/CA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,GAAG,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,2BAA2B,GAAG,GAAG,GAAG;IACpDA,OAAO,CAACA,OAAO,CAAC,qBAAqB,GAAG,GAAG,GAAG;IAC9CA,OAAO,CAACA,OAAO,CAAC,wBAAwB,GAAG,GAAG,GAAG;IACjDA,OAAO,CAACA,OAAO,CAAC,uBAAuB,GAAG,GAAG,GAAG;IAChDA,OAAO,CAACA,OAAO,CAAC,iBAAiB,GAAG,GAAG,GAAG;AAC5C,CAAA,EAAGA,WAAYA,CAAAA,UAAU,CAAC,CAAA;AACnB,SAASD,sBAAsBE,GAAG,EAAE;IACzC,IAAI,CAACA,KAAK;QACR,OAAO,IAAI;IACb,CAAC;IACD,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf,CAAC;IACH;IACA,MAAM,IAAIE,MAAM,2DAA2D;AAC7E,EACA,iDAAiD"}
@@ -1,68 +1,64 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hasScrollParent = exports.getScrollParent = exports.getParentNode = void 0;
7
1
  /**
8
2
  * Returns the parent node or the host of the node argument.
9
3
  * @param node - DOM node.
10
4
  * @returns - parent DOM node.
11
- */
12
- const getParentNode = node => {
13
- if (node.nodeName === 'HTML') {
14
- return node;
15
- }
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- return node.parentNode || node.host;
5
+ */ "use strict";
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ function _export(target, all) {
10
+ for(var name in all)Object.defineProperty(target, name, {
11
+ enumerable: true,
12
+ get: all[name]
13
+ });
14
+ }
15
+ _export(exports, {
16
+ getParentNode: ()=>getParentNode,
17
+ getScrollParent: ()=>getScrollParent,
18
+ hasScrollParent: ()=>hasScrollParent
19
+ });
20
+ const getParentNode = (node)=>{
21
+ if (node.nodeName === 'HTML') {
22
+ return node;
23
+ }
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ return node.parentNode || node.host;
18
26
  };
19
- exports.getParentNode = getParentNode;
20
27
  /**
21
28
  * Returns CSS styles of the given node.
22
29
  * @param node - DOM node.
23
30
  * @returns - CSS styles.
24
- */
25
- const getStyleComputedProperty = node => {
26
- var _a;
27
- if (node.nodeType !== 1) {
28
- return {};
29
- }
30
- const window = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
31
- return window.getComputedStyle(node, null);
31
+ */ const getStyleComputedProperty = (node)=>{
32
+ var _node_ownerDocument;
33
+ if (node.nodeType !== 1) {
34
+ return {};
35
+ }
36
+ const window = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;
37
+ return window.getComputedStyle(node, null);
32
38
  };
33
- /**
34
- * Returns the first scrollable parent of the given element.
35
- * @param node - DOM node.
36
- * @returns - the first scrollable parent.
37
- */
38
- const getScrollParent = node => {
39
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
40
- const parentNode = node && exports.getParentNode(node);
41
- // eslint-disable-next-line
42
- if (!parentNode) return document.body;
43
- switch (parentNode.nodeName) {
44
- case 'HTML':
45
- case 'BODY':
46
- return parentNode.ownerDocument.body;
47
- case '#document':
48
- return parentNode.body;
49
- }
50
- // If any of the overflow props is defined for the node then we return it as the parent
51
- const {
52
- overflow,
53
- overflowX,
54
- overflowY
55
- } = getStyleComputedProperty(parentNode);
56
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
57
- return parentNode;
58
- }
59
- return exports.getScrollParent(parentNode);
39
+ const getScrollParent = (node)=>{
40
+ // Return body, `getScroll` will take care to get the correct `scrollTop` from it
41
+ const parentNode = node && getParentNode(node);
42
+ // eslint-disable-next-line
43
+ if (!parentNode) return document.body;
44
+ switch(parentNode.nodeName){
45
+ case 'HTML':
46
+ case 'BODY':
47
+ return parentNode.ownerDocument.body;
48
+ case '#document':
49
+ return parentNode.body;
50
+ }
51
+ // If any of the overflow props is defined for the node then we return it as the parent
52
+ const { overflow , overflowX , overflowY } = getStyleComputedProperty(parentNode);
53
+ if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
54
+ return parentNode;
55
+ }
56
+ return getScrollParent(parentNode);
60
57
  };
61
- exports.getScrollParent = getScrollParent;
62
- const hasScrollParent = node => {
63
- var _a;
64
- const scrollParentElement = exports.getScrollParent(node);
65
- return scrollParentElement ? scrollParentElement !== ((_a = scrollParentElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.body) : false;
66
- };
67
- exports.hasScrollParent = hasScrollParent;
58
+ const hasScrollParent = (node)=>{
59
+ var _scrollParentElement_ownerDocument;
60
+ const scrollParentElement = getScrollParent(node);
61
+ return scrollParentElement ? scrollParentElement !== ((_scrollParentElement_ownerDocument = scrollParentElement.ownerDocument) === null || _scrollParentElement_ownerDocument === void 0 ? void 0 : _scrollParentElement_ownerDocument.body) : false;
62
+ }; //# sourceMappingURL=getScrollParent.js.map
63
+
68
64
  //# sourceMappingURL=getScrollParent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getParentNode","node","nodeName","parentNode","host","exports","getStyleComputedProperty","nodeType","window","_a","ownerDocument","defaultView","getComputedStyle","getScrollParent","document","body","overflow","overflowX","overflowY","test","hasScrollParent","scrollParentElement"],"sources":["../src/packages/react-components/react-positioning/src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nconst getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const window = node.ownerDocument?.defaultView;\n return window!.getComputedStyle(node, null);\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return (parentNode as unknown as Document).body;\n }\n\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow! + overflowY! + overflowX)) {\n return parentNode;\n }\n\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"],"mappings":";;;;;;AAAA;;;;;AAKO,MAAMA,aAAa,GAAIC,IAAiB,IAAiB;EAC9D,IAAIA,IAAI,CAACC,QAAQ,KAAK,MAAM,EAAE;IAC5B,OAAOD,IAAI;;EAEb;EACA,OAAOA,IAAI,CAACE,UAAU,IAAKF,IAAY,CAACG,IAAI;AAC9C,CAAC;AANYC,OAAA,CAAAL,aAAa,GAAAA,aAAA;AAQ1B;;;;;AAKA,MAAMM,wBAAwB,GAAIL,IAAiB,IAAkC;;EACnF,IAAIA,IAAI,CAACM,QAAQ,KAAK,CAAC,EAAE;IACvB,OAAO,EAAE;;EAGX,MAAMC,MAAM,GAAG,CAAAC,EAAA,GAAAR,IAAI,CAACS,aAAa,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,WAAW;EAC9C,OAAOH,MAAO,CAACI,gBAAgB,CAACX,IAAI,EAAE,IAAI,CAAC;AAC7C,CAAC;AAED;;;;;AAKO,MAAMY,eAAe,GAAIZ,IAAmC,IAAiB;EAClF;EACA,MAAME,UAAU,GAAGF,IAAI,IAAII,OAAA,CAAAL,aAAa,CAACC,IAAmB,CAAC;EAC7D;EACA,IAAI,CAACE,UAAU,EAAE,OAAOW,QAAQ,CAACC,IAAI;EAErC,QAAQZ,UAAU,CAACD,QAAQ;IACzB,KAAK,MAAM;IACX,KAAK,MAAM;MACT,OAAOC,UAAU,CAACO,aAAc,CAACK,IAAI;IACvC,KAAK,WAAW;MACd,OAAQZ,UAAkC,CAACY,IAAI;EAAC;EAGpD;EACA,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAS,CAAE,GAAGZ,wBAAwB,CAACH,UAAU,CAAC;EAC/E,IAAI,uBAAuB,CAACgB,IAAI,CAACH,QAAS,GAAGE,SAAU,GAAGD,SAAS,CAAC,EAAE;IACpE,OAAOd,UAAU;;EAGnB,OAAOE,OAAA,CAAAQ,eAAe,CAACV,UAAU,CAAC;AACpC,CAAC;AArBYE,OAAA,CAAAQ,eAAe,GAAAA,eAAA;AAuBrB,MAAMO,eAAe,GAAInB,IAAmC,IAAa;;EAC9E,MAAMoB,mBAAmB,GAAgBhB,OAAA,CAAAQ,eAAe,CAACZ,IAAI,CAAC;EAC9D,OAAOoB,mBAAmB,GAAGA,mBAAmB,MAAK,CAAAZ,EAAA,GAAAY,mBAAmB,CAACX,aAAa,cAAAD,EAAA,uBAAAA,EAAA,CAAEM,IAAI,IAAG,KAAK;AACtG,CAAC;AAHYV,OAAA,CAAAe,eAAe,GAAAA,eAAA"}
1
+ {"version":3,"sources":["../../lib/utils/getScrollParent.js"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */export const getParentNode = node => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || node.host;\n};\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nconst getStyleComputedProperty = node => {\n var _node_ownerDocument;\n if (node.nodeType !== 1) {\n return {};\n }\n const window = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;\n return window.getComputedStyle(node, null);\n};\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = node => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument.body;\n case '#document':\n return parentNode.body;\n }\n // If any of the overflow props is defined for the node then we return it as the parent\n const {\n overflow,\n overflowX,\n overflowY\n } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return parentNode;\n }\n return getScrollParent(parentNode);\n};\nexport const hasScrollParent = node => {\n var _scrollParentElement_ownerDocument;\n const scrollParentElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== ((_scrollParentElement_ownerDocument = scrollParentElement.ownerDocument) === null || _scrollParentElement_ownerDocument === void 0 ? void 0 : _scrollParentElement_ownerDocument.body) : false;\n};\n//# sourceMappingURL=getScrollParent.js.map"],"names":["getParentNode","getScrollParent","hasScrollParent","node","nodeName","parentNode","host","getStyleComputedProperty","_node_ownerDocument","nodeType","window","ownerDocument","defaultView","getComputedStyle","document","body","overflow","overflowX","overflowY","test","_scrollParentElement_ownerDocument","scrollParentElement"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;IAAeA,aAAa,MAAbA;IAyBHC,eAAe,MAAfA;IAuBAC,eAAe,MAAfA;;AAhDH,MAAMF,gBAAgBG,CAAAA,OAAQ;IACtC,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC5B,OAAOD;IACT,CAAC;IACD,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAIF,KAAKG,IAAI;AACrC;AACA;;;;CAIC,GACD,MAAMC,2BAA2BJ,CAAAA,OAAQ;IACvC,IAAIK;IACJ,IAAIL,KAAKM,QAAQ,KAAK,GAAG;QACvB,OAAO,CAAC;IACV,CAAC;IACD,MAAMC,SAAS,AAACF,CAAAA,sBAAsBL,KAAKQ,aAAa,AAAD,MAAO,IAAI,IAAIH,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBI,WAAW;IAC/I,OAAOF,OAAOG,gBAAgB,CAACV,MAAM,IAAI;AAC3C;AAMO,MAAMF,kBAAkBE,CAAAA,OAAQ;IACrC,iFAAiF;IACjF,MAAME,aAAaF,QAAQH,cAAcG;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOS,SAASC,IAAI;IACrC,OAAQV,WAAWD,QAAQ;QACzB,KAAK;QACL,KAAK;YACH,OAAOC,WAAWM,aAAa,CAACI,IAAI;QACtC,KAAK;YACH,OAAOV,WAAWU,IAAI;IAC1B;IACA,uFAAuF;IACvF,MAAM,EACJC,SAAQ,EACRC,UAAS,EACTC,UAAS,EACV,GAAGX,yBAAyBF;IAC7B,IAAI,wBAAwBc,IAAI,CAACH,WAAWE,YAAYD,YAAY;QAClE,OAAOZ;IACT,CAAC;IACD,OAAOJ,gBAAgBI;AACzB;AACO,MAAMH,kBAAkBC,CAAAA,OAAQ;IACrC,IAAIiB;IACJ,MAAMC,sBAAsBpB,gBAAgBE;IAC5C,OAAOkB,sBAAsBA,wBAAyB,CAAA,AAACD,CAAAA,qCAAqCC,oBAAoBV,aAAa,AAAD,MAAO,IAAI,IAAIS,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCL,IAAI,AAAD,IAAK,KAAK;AACtP,GACA,2CAA2C"}
@@ -1,30 +1,31 @@
1
- "use strict";
2
-
3
1
  //
4
2
  // Dev utils to detect if nodes have "autoFocus" props.
5
3
  //
4
+ "use strict";
6
5
  Object.defineProperty(exports, "__esModule", {
7
- value: true
6
+ value: true
8
7
  });
9
- exports.hasAutofocusFilter = void 0;
10
- const getReactFiberFromNode_1 = /*#__PURE__*/require("./getReactFiberFromNode");
8
+ Object.defineProperty(exports, "hasAutofocusFilter", {
9
+ enumerable: true,
10
+ get: ()=>hasAutofocusFilter
11
+ });
12
+ const _getReactFiberFromNode = require("./getReactFiberFromNode");
11
13
  /**
12
14
  * Detects if a passed HTML node has "autoFocus" prop on a React's fiber. Is needed as React handles autofocus behavior
13
15
  * in React DOM and will not pass "autoFocus" to an actual HTML.
14
16
  *
15
17
  * @param node
16
- */
17
- function hasAutofocusProp(node) {
18
- var _a;
19
- // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166
20
- const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';
21
- if (isAutoFocusableElement) {
22
- return !!((_a = getReactFiberFromNode_1.getReactFiberFromNode(node)) === null || _a === void 0 ? void 0 : _a.pendingProps.autoFocus);
23
- }
24
- return false;
18
+ */ function hasAutofocusProp(node) {
19
+ // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166
20
+ const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';
21
+ if (isAutoFocusableElement) {
22
+ var _getReactFiberFromNode1;
23
+ return !!((_getReactFiberFromNode1 = (0, _getReactFiberFromNode.getReactFiberFromNode)(node)) === null || _getReactFiberFromNode1 === void 0 ? void 0 : _getReactFiberFromNode1.pendingProps.autoFocus);
24
+ }
25
+ return false;
25
26
  }
26
27
  function hasAutofocusFilter(node) {
27
- return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
28
- }
29
- exports.hasAutofocusFilter = hasAutofocusFilter;
28
+ return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
29
+ } //# sourceMappingURL=hasAutoFocusFilter.js.map
30
+
30
31
  //# sourceMappingURL=hasAutoFocusFilter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getReactFiberFromNode_1","require","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_a","getReactFiberFromNode","pendingProps","autoFocus","hasAutofocusFilter","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/hasAutoFocusFilter.ts"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\n\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */\nfunction hasAutofocusProp(node: Node): boolean {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement =\n node.nodeName === 'BUTTON' ||\n node.nodeName === 'INPUT' ||\n node.nodeName === 'SELECT' ||\n node.nodeName === 'TEXTAREA';\n\n if (isAutoFocusableElement) {\n return !!getReactFiberFromNode(node)?.pendingProps.autoFocus;\n }\n\n return false;\n}\n\nexport function hasAutofocusFilter(node: Node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"mappings":";;AAAA;AACA;AACA;;;;;AAEA,MAAAA,uBAAA,gBAAAC,OAAA;AAEA;;;;;;AAMA,SAASC,gBAAgBA,CAACC,IAAU;;EAClC;EACA,MAAMC,sBAAsB,GAC1BD,IAAI,CAACE,QAAQ,KAAK,QAAQ,IAC1BF,IAAI,CAACE,QAAQ,KAAK,OAAO,IACzBF,IAAI,CAACE,QAAQ,KAAK,QAAQ,IAC1BF,IAAI,CAACE,QAAQ,KAAK,UAAU;EAE9B,IAAID,sBAAsB,EAAE;IAC1B,OAAO,CAAC,EAAC,CAAAE,EAAA,GAAAN,uBAAA,CAAAO,qBAAqB,CAACJ,IAAI,CAAC,cAAAG,EAAA,uBAAAA,EAAA,CAAEE,YAAY,CAACC,SAAS;;EAG9D,OAAO,KAAK;AACd;AAEA,SAAgBC,kBAAkBA,CAACP,IAAU;EAC3C,OAAOD,gBAAgB,CAACC,IAAI,CAAC,GAAGQ,UAAU,CAACC,aAAa,GAAGD,UAAU,CAACE,WAAW;AACnF;AAFAC,OAAA,CAAAJ,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"sources":["../../lib/utils/hasAutoFocusFilter.js"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */\nfunction hasAutofocusProp(node) {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';\n if (isAutoFocusableElement) {\n var _getReactFiberFromNode;\n return !!((_getReactFiberFromNode = getReactFiberFromNode(node)) === null || _getReactFiberFromNode === void 0 ? void 0 : _getReactFiberFromNode.pendingProps.autoFocus);\n }\n return false;\n}\nexport function hasAutofocusFilter(node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n//# sourceMappingURL=hasAutoFocusFilter.js.map"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_getReactFiberFromNode","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAiBcA;;aAAAA;;uCAhBsB;AACtC;;;;;CAKC,GACD,SAASC,iBAAiBC,IAAI,EAAE;IAC9B,gJAAgJ;IAChJ,MAAMC,yBAAyBD,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK,WAAWF,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK;IAC1I,IAAID,wBAAwB;QAC1B,IAAIE;QACJ,OAAO,CAAC,CAAE,CAAA,AAACA,CAAAA,0BAAyBC,IAAAA,4CAAqB,EAACJ,KAAI,MAAO,IAAI,IAAIG,4BAA2B,KAAK,IAAI,KAAK,IAAIA,wBAAuBE,YAAY,CAACC,SAAS,AAAD;IACxK,CAAC;IACD,OAAO,KAAK;AACd;AACO,SAASR,mBAAmBE,IAAI,EAAE;IACvC,OAAOD,iBAAiBC,QAAQO,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACnF,EACA,8CAA8C"}