@fluentui/react-utilities 9.17.0 → 9.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
# Change Log - @fluentui/react-utilities
|
2
2
|
|
3
|
-
This log was last generated on Tue,
|
3
|
+
This log was last generated on Tue, 30 Jan 2024 23:12:35 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.18.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.18.0)
|
8
|
+
|
9
|
+
Tue, 30 Jan 2024 23:12:35 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.17.0..@fluentui/react-utilities_v9.18.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- getParent() version with ShadowDOM support. ([PR #30429](https://github.com/microsoft/fluentui/pull/30429) by marata@microsoft.com)
|
15
|
+
|
7
16
|
## [9.17.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.17.0)
|
8
17
|
|
9
|
-
Tue, 23 Jan 2024 15:
|
18
|
+
Tue, 23 Jan 2024 15:11:00 GMT
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.16.1..@fluentui/react-utilities_v9.17.0)
|
11
20
|
|
12
21
|
### Minor changes
|
@@ -19,5 +19,9 @@ import { isVirtualElement } from './isVirtualElement';
|
|
19
19
|
return virtualParent;
|
20
20
|
}
|
21
21
|
}
|
22
|
-
|
22
|
+
const parent = child.parentNode;
|
23
|
+
if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
24
|
+
return parent.host;
|
25
|
+
}
|
26
|
+
return parent;
|
23
27
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["getParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n\ntype GetParentOptions = {\n /**\n * Indicates if getParent() should ignore a virtual parent.\n * @internal\n */\n skipVirtual?: boolean;\n};\n\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */\nfunction getVirtualParent(child: Node): Node | null {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */\nexport function getParent(child: Node | null, options: GetParentOptions = {}): Node | null {\n if (!child) {\n return null;\n }\n\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n\n if (virtualParent) {\n return virtualParent;\n }\n }\n\n
|
1
|
+
{"version":3,"sources":["getParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n\ntype GetParentOptions = {\n /**\n * Indicates if getParent() should ignore a virtual parent.\n * @internal\n */\n skipVirtual?: boolean;\n};\n\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */\nfunction getVirtualParent(child: Node): Node | null {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */\nexport function getParent(child: Node | null, options: GetParentOptions = {}): Node | null {\n if (!child) {\n return null;\n }\n\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n\n if (virtualParent) {\n return virtualParent;\n }\n }\n\n const parent = child.parentNode;\n\n if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return (parent as ShadowRoot).host;\n }\n\n return parent;\n}\n"],"names":["isVirtualElement","getVirtualParent","child","_virtual","parent","getParent","options","skipVirtual","virtualParent","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,qBAAqB;AAUtD;;;CAGC,GACD,SAASC,iBAAiBC,KAAW;IACnC,OAAOF,iBAAiBE,SAASA,MAAMC,QAAQ,CAACC,MAAM,IAAI,OAAO;AACnE;AAEA;;;;CAIC,GACD,OAAO,SAASC,UAAUH,KAAkB,EAAEI,UAA4B,CAAC,CAAC;IAC1E,IAAI,CAACJ,OAAO;QACV,OAAO;IACT;IAEA,IAAI,CAACI,QAAQC,WAAW,EAAE;QACxB,MAAMC,gBAAgBP,iBAAiBC;QAEvC,IAAIM,eAAe;YACjB,OAAOA;QACT;IACF;IAEA,MAAMJ,SAASF,MAAMO,UAAU;IAE/B,IAAIL,UAAUA,OAAOM,QAAQ,KAAKC,KAAKC,sBAAsB,EAAE;QAC7D,OAAO,AAACR,OAAsBS,IAAI;IACpC;IAEA,OAAOT;AACT"}
|
@@ -25,5 +25,9 @@ function getParent(child, options = {}) {
|
|
25
25
|
return virtualParent;
|
26
26
|
}
|
27
27
|
}
|
28
|
-
|
28
|
+
const parent = child.parentNode;
|
29
|
+
if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
30
|
+
return parent.host;
|
31
|
+
}
|
32
|
+
return parent;
|
29
33
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["getParent.js"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */ function getVirtualParent(child) {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */ export function getParent(child, options = {}) {\n if (!child) {\n return null;\n }\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n if (virtualParent) {\n return virtualParent;\n }\n }\n
|
1
|
+
{"version":3,"sources":["getParent.js"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */ function getVirtualParent(child) {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */ export function getParent(child, options = {}) {\n if (!child) {\n return null;\n }\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n if (virtualParent) {\n return virtualParent;\n }\n }\n const parent = child.parentNode;\n if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return parent.host;\n }\n return parent;\n}\n"],"names":["getParent","getVirtualParent","child","isVirtualElement","_virtual","parent","options","skipVirtual","virtualParent","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host"],"mappings":";;;;+BAWoBA;;;eAAAA;;;kCAXa;AACjC;;;CAGC,GAAG,SAASC,iBAAiBC,KAAK;IAC/B,OAAOC,IAAAA,kCAAgB,EAACD,SAASA,MAAME,QAAQ,CAACC,MAAM,IAAI,OAAO;AACrE;AAKW,SAASL,UAAUE,KAAK,EAAEI,UAAU,CAAC,CAAC;IAC7C,IAAI,CAACJ,OAAO;QACR,OAAO;IACX;IACA,IAAI,CAACI,QAAQC,WAAW,EAAE;QACtB,MAAMC,gBAAgBP,iBAAiBC;QACvC,IAAIM,eAAe;YACf,OAAOA;QACX;IACJ;IACA,MAAMH,SAASH,MAAMO,UAAU;IAC/B,IAAIJ,UAAUA,OAAOK,QAAQ,KAAKC,KAAKC,sBAAsB,EAAE;QAC3D,OAAOP,OAAOQ,IAAI;IACtB;IACA,OAAOR;AACX"}
|