@fluentui/dom-utilities
Advanced tools
+43
-1
@@ -5,6 +5,48 @@ { | ||
| { | ||
| "date": "Mon, 24 Jun 2024 07:30:26 GMT", | ||
| "date": "Tue, 08 Oct 2024 07:21:37 GMT", | ||
| "tag": "@fluentui/dom-utilities_v2.3.8", | ||
| "version": "2.3.8", | ||
| "comments": { | ||
| "patch": [ | ||
| { | ||
| "author": "miclo@microsoft.com", | ||
| "package": "@fluentui/dom-utilities", | ||
| "commit": "65d3fdc217bcd5dff76dd3fd9ebb9d9f032f097a", | ||
| "comment": "Fix TypeError in portalContainsElement when element is Document or similar" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "date": "Thu, 01 Aug 2024 07:24:43 GMT", | ||
| "tag": "@fluentui/dom-utilities_v2.3.7", | ||
| "version": "2.3.7", | ||
| "comments": { | ||
| "none": [ | ||
| { | ||
| "author": "vgenaev@gmail.com", | ||
| "package": "@fluentui/dom-utilities", | ||
| "commit": "ff2c81325d734ddff92e606ac681c22c710f262f", | ||
| "comment": "remove redundant forceConsistentCasingInFileNames option" | ||
| }, | ||
| { | ||
| "author": "martinhochel@microsoft.com", | ||
| "package": "@fluentui/dom-utilities", | ||
| "commit": "674cdee6cfb1cb34e6ba1b24f665d0b8751a5dea", | ||
| "comment": "chore: remove npmScope from project name" | ||
| }, | ||
| { | ||
| "author": "martinhochel@microsoft.com", | ||
| "package": "@fluentui/dom-utilities", | ||
| "commit": "3da4204265901049d9ef777df15cb25b881a6284", | ||
| "comment": "chore: add project.json tags" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "date": "Mon, 24 Jun 2024 07:33:22 GMT", | ||
| "tag": "@fluentui/dom-utilities_v2.3.7", | ||
| "version": "2.3.7", | ||
| "comments": { | ||
| "patch": [ | ||
@@ -11,0 +53,0 @@ { |
+11
-2
| # Change Log - @fluentui/dom-utilities | ||
| This log was last generated on Mon, 24 Jun 2024 07:30:26 GMT and should not be manually modified. | ||
| This log was last generated on Tue, 08 Oct 2024 07:21:37 GMT and should not be manually modified. | ||
| <!-- Start content --> | ||
| ## [2.3.8](https://github.com/microsoft/fluentui/tree/@fluentui/dom-utilities_v2.3.8) | ||
| Tue, 08 Oct 2024 07:21:37 GMT | ||
| [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/dom-utilities_v2.3.7..@fluentui/dom-utilities_v2.3.8) | ||
| ### Patches | ||
| - Fix TypeError in portalContainsElement when element is Document or similar ([PR #32996](https://github.com/microsoft/fluentui/pull/32996) by miclo@microsoft.com) | ||
| ## [2.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/dom-utilities_v2.3.7) | ||
| Mon, 24 Jun 2024 07:30:26 GMT | ||
| Mon, 24 Jun 2024 07:33:22 GMT | ||
| [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/dom-utilities_v2.3.6..@fluentui/dom-utilities_v2.3.7) | ||
@@ -11,0 +20,0 @@ |
@@ -14,3 +14,3 @@ define(["require", "exports", "./getParent"], function (require, exports, getParent_1) { | ||
| doc !== null && doc !== void 0 ? doc : (doc = document); | ||
| if (!element || element === doc.body) { | ||
| if (!element || element === doc.body || element instanceof Document) { | ||
| return null; | ||
@@ -17,0 +17,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":";;;;IACA;;;;;OAKG;IACH,SAAgB,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;QAEd,iDAAiD;QACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;QACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;IACpG,CAAC;IAXD,oDAWC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":";;;;IACA;;;;;OAKG;IACH,SAAgB,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;QAEd,iDAAiD;QACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;QACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,IAAI,OAAO,YAAY,QAAQ,EAAE;YACnE,OAAO,IAAI,CAAC;SACb;QACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;IACpG,CAAC;IAXD,oDAWC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body || element instanceof Document) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} |
@@ -22,6 +22,7 @@ define(["require", "exports", "./getVirtualParent"], function (require, exports, getVirtualParent_1) { | ||
| } | ||
| var parentElement; | ||
| // Support looking for parents in shadow DOM | ||
| if (typeof child.assignedElements !== 'function' && ((_a = child.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentNode)) { | ||
| // Element is slotted | ||
| return child.assignedSlot; | ||
| parentElement = child.assignedSlot; | ||
| } | ||
@@ -31,7 +32,8 @@ else if (((_b = child.parentNode) === null || _b === void 0 ? void 0 : _b.nodeType) === 11) { | ||
| // Element is in shadow root | ||
| return child.parentNode.host; | ||
| parentElement = child.parentNode.host; | ||
| } | ||
| else { | ||
| return child.parentNode; | ||
| parentElement = child.parentNode; | ||
| } | ||
| return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null; | ||
| } | ||
@@ -38,0 +40,0 @@ exports.getParent = getParent; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":";;;;IACA;;;;;;OAMG;IACH,SAAgB,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;QAAnC,oCAAA,EAAA,0BAAmC;QAC/E,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;QAE9D,IAAI,MAAM,EAAE;YACV,OAAO,MAAM,CAAC;SACf;QAED,4CAA4C;QAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;YACvG,qBAAqB;YACrB,OAAO,KAAK,CAAC,YAA2B,CAAC;SAC1C;aAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;YAC5C,mCAAmC;YACnC,4BAA4B;YAC5B,OAAQ,KAAK,CAAC,UAAyB,CAAC,IAAmB,CAAC;SAC7D;aAAM;YACL,OAAO,KAAK,CAAC,UAAyB,CAAC;SACxC;IACH,CAAC;IAtBD,8BAsBC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n return child.assignedSlot as HTMLElement;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n return (child.parentNode as ShadowRoot).host as HTMLElement;\n } else {\n return child.parentNode as HTMLElement;\n }\n}\n"]} | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":";;;;IACA;;;;;;OAMG;IACH,SAAgB,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;QAAnC,oCAAA,EAAA,0BAAmC;QAC/E,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;QAE9D,IAAI,MAAM,EAAE;YACV,OAAO,MAAM,CAAC;SACf;QAED,IAAI,aAA4D,CAAC;QACjE,4CAA4C;QAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;YACvG,qBAAqB;YACrB,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;SACpC;aAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;YAC5C,mCAAmC;YACnC,4BAA4B;YAC5B,aAAa,GAAI,KAAK,CAAC,UAAyB,CAAC,IAAI,CAAC;SACvD;aAAM;YACL,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC;SAClC;QAED,OAAO,CAAC,CAAC,aAAa,IAAI,aAAa,YAAY,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IACxF,CAAC;IAzBD,8BAyBC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n let parentElement: Element | HTMLSlotElement | ParentNode | null;\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n parentElement = child.assignedSlot;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n parentElement = (child.parentNode as ShadowRoot).host;\n } else {\n parentElement = child.parentNode;\n }\n\n return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null;\n}\n"]} |
@@ -14,4 +14,5 @@ define(["require", "exports", "./findElementRecursive", "./setPortalAttribute"], function (require, exports, findElementRecursive_1, setPortalAttribute_1) { | ||
| function portalContainsElement(target, parent, doc) { | ||
| var elementMatch = (0, findElementRecursive_1.findElementRecursive)(target, function (testElement) { return parent === testElement || testElement.hasAttribute(setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE); }, doc); | ||
| return elementMatch !== null && elementMatch.hasAttribute(setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE); | ||
| var _a; | ||
| var elementMatch = (0, findElementRecursive_1.findElementRecursive)(target, function (testElement) { var _a; return parent === testElement || !!((_a = testElement.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(testElement, setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE)); }, doc); | ||
| return elementMatch !== null && !!((_a = elementMatch.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(elementMatch, setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE)); | ||
| } | ||
@@ -18,0 +19,0 @@ exports.portalContainsElement = portalContainsElement; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":";;;;IAGA;;;;;;;OAOG;IACH,SAAgB,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;QAC7F,IAAM,YAAY,GAAG,IAAA,2CAAoB,EACvC,MAAM,EACN,UAAC,WAAwB,IAAK,OAAA,MAAM,KAAK,WAAW,IAAI,WAAW,CAAC,YAAY,CAAC,0CAAqB,CAAC,EAAzE,CAAyE,EACvG,GAAG,CACJ,CAAC;QACF,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,YAAY,CAAC,0CAAqB,CAAC,CAAC;IACnF,CAAC;IAPD,sDAOC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || testElement.hasAttribute(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && elementMatch.hasAttribute(DATA_PORTAL_ATTRIBUTE);\n}\n"]} | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":";;;;IAGA;;;;;;;OAOG;IACH,SAAgB,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;;QAC7F,IAAM,YAAY,GAAG,IAAA,2CAAoB,EACvC,MAAM,EACN,UAAC,WAAwB,YAAK,OAAA,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,CAAA,MAAA,WAAW,CAAC,YAAY,4DAAG,0CAAqB,CAAC,CAAA,CAAA,EAAA,EAC3G,GAAG,CACJ,CAAC;QACF,OAAO,YAAY,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA,MAAA,YAAY,CAAC,YAAY,6DAAG,0CAAqB,CAAC,CAAA,CAAC;IACvF,CAAC;IAPD,sDAOC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || !!testElement.hasAttribute?.(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && !!elementMatch.hasAttribute?.(DATA_PORTAL_ATTRIBUTE);\n}\n"]} |
| define(["require", "exports", "@fluentui/set-version"], function (require, exports, set_version_1) { | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| (0, set_version_1.setVersion)('@fluentui/dom-utilities', '2.3.7'); | ||
| (0, set_version_1.setVersion)('@fluentui/dom-utilities', '2.3.8'); | ||
| }); | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;;IAGA,IAAA,wBAAU,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.7');"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;;IAGA,IAAA,wBAAU,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.8');"]} |
@@ -14,3 +14,3 @@ "use strict"; | ||
| doc !== null && doc !== void 0 ? doc : (doc = document); | ||
| if (!element || element === doc.body) { | ||
| if (!element || element === doc.body || element instanceof Document) { | ||
| return null; | ||
@@ -17,0 +17,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC;;;;;GAKG;AACH,SAAgB,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;IAEd,iDAAiD;IACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;IACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;AACpG,CAAC;AAXD,oDAWC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC;;;;;GAKG;AACH,SAAgB,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;IAEd,iDAAiD;IACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;IACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,IAAI,OAAO,YAAY,QAAQ,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;AACpG,CAAC;AAXD,oDAWC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body || element instanceof Document) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} |
@@ -22,6 +22,7 @@ "use strict"; | ||
| } | ||
| var parentElement; | ||
| // Support looking for parents in shadow DOM | ||
| if (typeof child.assignedElements !== 'function' && ((_a = child.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentNode)) { | ||
| // Element is slotted | ||
| return child.assignedSlot; | ||
| parentElement = child.assignedSlot; | ||
| } | ||
@@ -31,9 +32,10 @@ else if (((_b = child.parentNode) === null || _b === void 0 ? void 0 : _b.nodeType) === 11) { | ||
| // Element is in shadow root | ||
| return child.parentNode.host; | ||
| parentElement = child.parentNode.host; | ||
| } | ||
| else { | ||
| return child.parentNode; | ||
| parentElement = child.parentNode; | ||
| } | ||
| return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null; | ||
| } | ||
| exports.getParent = getParent; | ||
| //# sourceMappingURL=getParent.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AACtD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;IAAnC,oCAAA,EAAA,0BAAmC;IAC/E,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IAED,4CAA4C;IAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;QACvG,qBAAqB;QACrB,OAAO,KAAK,CAAC,YAA2B,CAAC;KAC1C;SAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;QAC5C,mCAAmC;QACnC,4BAA4B;QAC5B,OAAQ,KAAK,CAAC,UAAyB,CAAC,IAAmB,CAAC;KAC7D;SAAM;QACL,OAAO,KAAK,CAAC,UAAyB,CAAC;KACxC;AACH,CAAC;AAtBD,8BAsBC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n return child.assignedSlot as HTMLElement;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n return (child.parentNode as ShadowRoot).host as HTMLElement;\n } else {\n return child.parentNode as HTMLElement;\n }\n}\n"]} | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AACtD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;IAAnC,oCAAA,EAAA,0BAAmC;IAC/E,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IAED,IAAI,aAA4D,CAAC;IACjE,4CAA4C;IAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;QACvG,qBAAqB;QACrB,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;KACpC;SAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;QAC5C,mCAAmC;QACnC,4BAA4B;QAC5B,aAAa,GAAI,KAAK,CAAC,UAAyB,CAAC,IAAI,CAAC;KACvD;SAAM;QACL,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC;KAClC;IAED,OAAO,CAAC,CAAC,aAAa,IAAI,aAAa,YAAY,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC;AAzBD,8BAyBC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n let parentElement: Element | HTMLSlotElement | ParentNode | null;\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n parentElement = child.assignedSlot;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n parentElement = (child.parentNode as ShadowRoot).host;\n } else {\n parentElement = child.parentNode;\n }\n\n return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null;\n}\n"]} |
@@ -15,6 +15,7 @@ "use strict"; | ||
| function portalContainsElement(target, parent, doc) { | ||
| var elementMatch = (0, findElementRecursive_1.findElementRecursive)(target, function (testElement) { return parent === testElement || testElement.hasAttribute(setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE); }, doc); | ||
| return elementMatch !== null && elementMatch.hasAttribute(setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE); | ||
| var _a; | ||
| var elementMatch = (0, findElementRecursive_1.findElementRecursive)(target, function (testElement) { var _a; return parent === testElement || !!((_a = testElement.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(testElement, setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE)); }, doc); | ||
| return elementMatch !== null && !!((_a = elementMatch.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(elementMatch, setPortalAttribute_1.DATA_PORTAL_ATTRIBUTE)); | ||
| } | ||
| exports.portalContainsElement = portalContainsElement; | ||
| //# sourceMappingURL=portalContainsElement.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":";;;AAAA,+DAA8D;AAC9D,2DAA6D;AAE7D;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;IAC7F,IAAM,YAAY,GAAG,IAAA,2CAAoB,EACvC,MAAM,EACN,UAAC,WAAwB,IAAK,OAAA,MAAM,KAAK,WAAW,IAAI,WAAW,CAAC,YAAY,CAAC,0CAAqB,CAAC,EAAzE,CAAyE,EACvG,GAAG,CACJ,CAAC;IACF,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,YAAY,CAAC,0CAAqB,CAAC,CAAC;AACnF,CAAC;AAPD,sDAOC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || testElement.hasAttribute(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && elementMatch.hasAttribute(DATA_PORTAL_ATTRIBUTE);\n}\n"]} | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":";;;AAAA,+DAA8D;AAC9D,2DAA6D;AAE7D;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;;IAC7F,IAAM,YAAY,GAAG,IAAA,2CAAoB,EACvC,MAAM,EACN,UAAC,WAAwB,YAAK,OAAA,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,CAAA,MAAA,WAAW,CAAC,YAAY,4DAAG,0CAAqB,CAAC,CAAA,CAAA,EAAA,EAC3G,GAAG,CACJ,CAAC;IACF,OAAO,YAAY,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA,MAAA,YAAY,CAAC,YAAY,6DAAG,0CAAqB,CAAC,CAAA,CAAC;AACvF,CAAC;AAPD,sDAOC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || !!testElement.hasAttribute?.(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && !!elementMatch.hasAttribute?.(DATA_PORTAL_ATTRIBUTE);\n}\n"]} |
@@ -6,3 +6,3 @@ "use strict"; | ||
| var set_version_1 = require("@fluentui/set-version"); | ||
| (0, set_version_1.setVersion)('@fluentui/dom-utilities', '2.3.7'); | ||
| (0, set_version_1.setVersion)('@fluentui/dom-utilities', '2.3.8'); | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,qDAAmD;AACnD,IAAA,wBAAU,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.7');"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,qDAAmD;AACnD,IAAA,wBAAU,EAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.8');"]} |
@@ -11,3 +11,3 @@ import { getParent } from './getParent'; | ||
| doc !== null && doc !== void 0 ? doc : (doc = document); | ||
| if (!element || element === doc.body) { | ||
| if (!element || element === doc.body || element instanceof Document) { | ||
| return null; | ||
@@ -14,0 +14,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;IAEd,iDAAiD;IACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;IACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;AACpG,CAAC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} | ||
| {"version":3,"file":"findElementRecursive.js","sourceRoot":"../src/","sources":["findElementRecursive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA2B,EAC3B,aAAgD,EAChD,GAAc;IAEd,iDAAiD;IACjD,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,QAAQ,EAAC;IACjB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,IAAI,IAAI,OAAO,YAAY,QAAQ,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;AACpG,CAAC","sourcesContent":["import { getParent } from './getParent';\n/**\n * Finds the first parent element where the matchFunction returns true\n * @param element - element to start searching at\n * @param matchFunction - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nexport function findElementRecursive(\n element: HTMLElement | null,\n matchFunction: (element: HTMLElement) => boolean,\n doc?: Document,\n): HTMLElement | null {\n // eslint-disable-next-line no-restricted-globals\n doc ??= document;\n if (!element || element === doc.body || element instanceof Document) {\n return null;\n }\n return matchFunction(element) ? element : findElementRecursive(getParent(element), matchFunction);\n}\n"]} |
+5
-3
@@ -19,6 +19,7 @@ import { getVirtualParent } from './getVirtualParent'; | ||
| } | ||
| var parentElement; | ||
| // Support looking for parents in shadow DOM | ||
| if (typeof child.assignedElements !== 'function' && ((_a = child.assignedSlot) === null || _a === void 0 ? void 0 : _a.parentNode)) { | ||
| // Element is slotted | ||
| return child.assignedSlot; | ||
| parentElement = child.assignedSlot; | ||
| } | ||
@@ -28,8 +29,9 @@ else if (((_b = child.parentNode) === null || _b === void 0 ? void 0 : _b.nodeType) === 11) { | ||
| // Element is in shadow root | ||
| return child.parentNode.host; | ||
| parentElement = child.parentNode.host; | ||
| } | ||
| else { | ||
| return child.parentNode; | ||
| parentElement = child.parentNode; | ||
| } | ||
| return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null; | ||
| } | ||
| //# sourceMappingURL=getParent.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;IAAnC,oCAAA,EAAA,0BAAmC;IAC/E,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IAED,4CAA4C;IAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;QACvG,qBAAqB;QACrB,OAAO,KAAK,CAAC,YAA2B,CAAC;KAC1C;SAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;QAC5C,mCAAmC;QACnC,4BAA4B;QAC5B,OAAQ,KAAK,CAAC,UAAyB,CAAC,IAAmB,CAAC;KAC7D;SAAM;QACL,OAAO,KAAK,CAAC,UAAyB,CAAC;KACxC;AACH,CAAC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n return child.assignedSlot as HTMLElement;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n return (child.parentNode as ShadowRoot).host as HTMLElement;\n } else {\n return child.parentNode as HTMLElement;\n }\n}\n"]} | ||
| {"version":3,"file":"getParent.js","sourceRoot":"../src/","sources":["getParent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,mBAAmC;;IAAnC,oCAAA,EAAA,0BAAmC;IAC/E,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IAED,IAAM,MAAM,GAAG,mBAAmB,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IAED,IAAI,aAA4D,CAAC;IACjE,4CAA4C;IAC5C,IAAI,OAAQ,KAAyB,CAAC,gBAAgB,KAAK,UAAU,KAAI,MAAA,KAAK,CAAC,YAAY,0CAAE,UAAU,CAAA,EAAE;QACvG,qBAAqB;QACrB,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;KACpC;SAAM,IAAI,CAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,QAAQ,MAAK,EAAE,EAAE;QAC5C,mCAAmC;QACnC,4BAA4B;QAC5B,aAAa,GAAI,KAAK,CAAC,UAAyB,CAAC,IAAI,CAAC;KACvD;SAAM;QACL,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC;KAClC;IAED,OAAO,CAAC,CAAC,aAAa,IAAI,aAAa,YAAY,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC","sourcesContent":["import { getVirtualParent } from './getVirtualParent';\n/**\n * Gets the element which is the parent of a given element.\n * If `allowVirtuaParents` is `true`, this method prefers the virtual parent over\n * real DOM parent when present.\n *\n * @public\n */\nexport function getParent(child: HTMLElement, allowVirtualParents: boolean = true): HTMLElement | null {\n if (!child) {\n return null;\n }\n\n const parent = allowVirtualParents && getVirtualParent(child);\n\n if (parent) {\n return parent;\n }\n\n let parentElement: Element | HTMLSlotElement | ParentNode | null;\n // Support looking for parents in shadow DOM\n if (typeof (child as HTMLSlotElement).assignedElements !== 'function' && child.assignedSlot?.parentNode) {\n // Element is slotted\n parentElement = child.assignedSlot;\n } else if (child.parentNode?.nodeType === 11) {\n // nodeType 11 is DOCUMENT_FRAGMENT\n // Element is in shadow root\n parentElement = (child.parentNode as ShadowRoot).host;\n } else {\n parentElement = child.parentNode;\n }\n\n return !!parentElement && parentElement instanceof HTMLElement ? parentElement : null;\n}\n"]} |
@@ -12,5 +12,6 @@ import { findElementRecursive } from './findElementRecursive'; | ||
| export function portalContainsElement(target, parent, doc) { | ||
| var elementMatch = findElementRecursive(target, function (testElement) { return parent === testElement || testElement.hasAttribute(DATA_PORTAL_ATTRIBUTE); }, doc); | ||
| return elementMatch !== null && elementMatch.hasAttribute(DATA_PORTAL_ATTRIBUTE); | ||
| var _a; | ||
| var elementMatch = findElementRecursive(target, function (testElement) { var _a; return parent === testElement || !!((_a = testElement.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(testElement, DATA_PORTAL_ATTRIBUTE)); }, doc); | ||
| return elementMatch !== null && !!((_a = elementMatch.hasAttribute) === null || _a === void 0 ? void 0 : _a.call(elementMatch, DATA_PORTAL_ATTRIBUTE)); | ||
| } | ||
| //# sourceMappingURL=portalContainsElement.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;IAC7F,IAAM,YAAY,GAAG,oBAAoB,CACvC,MAAM,EACN,UAAC,WAAwB,IAAK,OAAA,MAAM,KAAK,WAAW,IAAI,WAAW,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAzE,CAAyE,EACvG,GAAG,CACJ,CAAC;IACF,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || testElement.hasAttribute(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && elementMatch.hasAttribute(DATA_PORTAL_ATTRIBUTE);\n}\n"]} | ||
| {"version":3,"file":"portalContainsElement.js","sourceRoot":"../src/","sources":["portalContainsElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAmB,EAAE,MAAoB,EAAE,GAAc;;IAC7F,IAAM,YAAY,GAAG,oBAAoB,CACvC,MAAM,EACN,UAAC,WAAwB,YAAK,OAAA,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,CAAA,MAAA,WAAW,CAAC,YAAY,4DAAG,qBAAqB,CAAC,CAAA,CAAA,EAAA,EAC3G,GAAG,CACJ,CAAC;IACF,OAAO,YAAY,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA,MAAA,YAAY,CAAC,YAAY,6DAAG,qBAAqB,CAAC,CAAA,CAAC;AACvF,CAAC","sourcesContent":["import { findElementRecursive } from './findElementRecursive';\nimport { DATA_PORTAL_ATTRIBUTE } from './setPortalAttribute';\n\n/**\n * Determine whether a target is within a portal from perspective of root or optional parent.\n * This function only works against portal components that use the setPortalAttribute function.\n * If both parent and child are within the same portal this function will return false.\n * @param target - Element to query portal containment status of.\n * @param parent - Optional parent perspective. Search for containing portal stops at parent\n * (or root if parent is undefined or invalid.)\n */\nexport function portalContainsElement(target: HTMLElement, parent?: HTMLElement, doc?: Document): boolean {\n const elementMatch = findElementRecursive(\n target,\n (testElement: HTMLElement) => parent === testElement || !!testElement.hasAttribute?.(DATA_PORTAL_ATTRIBUTE),\n doc,\n );\n return elementMatch !== null && !!elementMatch.hasAttribute?.(DATA_PORTAL_ATTRIBUTE);\n}\n"]} |
+1
-1
| // Do not modify this file; it is generated as part of publish. | ||
| // The checked in version is a placeholder only and will not be updated. | ||
| import { setVersion } from '@fluentui/set-version'; | ||
| setVersion('@fluentui/dom-utilities', '2.3.7'); | ||
| setVersion('@fluentui/dom-utilities', '2.3.8'); | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.7');"]} | ||
| {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/dom-utilities', '2.3.8');"]} |
+1
-1
| { | ||
| "name": "@fluentui/dom-utilities", | ||
| "version": "2.3.7", | ||
| "version": "2.3.8", | ||
| "description": "DOM utilities for use within Fluent web components", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
+2
-1
| { | ||
| "name": "@fluentui/dom-utilities", | ||
| "name": "dom-utilities", | ||
| "$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
| "projectType": "library", | ||
| "tags": ["v8"], | ||
| "implicitDependencies": [] | ||
| } |
156380
2.63%2153
2.57%