fluentui-extended 2026.8.60 → 2026.8.70

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/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactNode, ReactPortal } from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
3
  import { InputProps, PresenceBadgeStatus } from '@fluentui/react-components';
4
4
 
5
5
  /**
@@ -39,46 +39,32 @@ declare const toTextareaAppearance: (appearance?: FieldAppearance) => TextareaAp
39
39
  declare const toListboxAppearance: (appearance?: FieldAppearance) => ListboxAppearance;
40
40
 
41
41
  interface ParentPortalProps {
42
- /** Content to render in the parent document. */
43
42
  children: ReactNode;
44
- /**
45
- * ID for the container element created in the parent document.
46
- * Defaults to 'fluentui-extended-parent-portal-root'.
47
- */
48
43
  containerId?: string;
49
- /**
50
- * When true, syncs Griffel stylesheets from the iframe to the parent
51
- * document so Fluent components render with full styling.
52
- * Defaults to true.
53
- */
54
44
  syncStyles?: boolean;
55
- /**
56
- * When true, copies Fluent CSS custom properties (theme tokens) from the
57
- * iframe's FluentProvider to the parent container.
58
- * Defaults to true.
59
- */
60
45
  syncTokens?: boolean;
61
- /**
62
- * Interval (ms) for re-syncing CSSOM rules that Griffel inserts via
63
- * insertRule(). Set to 0 to disable periodic sync (only MutationObserver).
64
- * Defaults to 300.
65
- */
66
46
  syncInterval?: number;
67
- /**
68
- * Additional CSS injected into the parent document's <head> for the
69
- * portal container. Overrides default positioning styles.
70
- */
47
+ containerStyles?: string;
48
+ }
49
+ interface UseParentPortalMountOptions {
50
+ containerId?: string;
51
+ syncStyles?: boolean;
52
+ syncTokens?: boolean;
53
+ syncInterval?: number;
71
54
  containerStyles?: string;
72
55
  }
73
56
 
74
57
  /**
75
- * Renders children into the parent document (escaping an iframe) with full
76
- * Fluent UI styling. Wraps content in a FluentProvider so theme tokens and
77
- * Griffel styles are available in the parent DOM.
78
- *
79
- * Falls back to rendering children in-place if not inside an iframe.
58
+ * Hook that returns the parent-document mount node for use with Fluent's
59
+ * `mountNode` prop (e.g. on DialogSurface). Also handles style sync.
60
+ */
61
+ declare function useParentPortalMount(options?: UseParentPortalMountOptions): HTMLElement | undefined;
62
+ /**
63
+ * Renders children into the parent document via createPortal.
64
+ * Use for non-portal Fluent components. For DialogSurface, use
65
+ * useParentPortalMount() with the mountNode prop instead.
80
66
  */
81
- declare function ParentPortal({ children, containerId, syncStyles, syncTokens, syncInterval, containerStyles, }: ParentPortalProps): ReactPortal | React__default.JSX.Element;
67
+ declare function ParentPortal({ children, containerId, syncStyles, syncTokens, syncInterval, containerStyles, }: ParentPortalProps): React__default.JSX.Element;
82
68
 
83
69
  /** Size variants matching FluentUI Input component */
84
70
  type LookupSize = 'small' | 'medium';
@@ -250,6 +236,12 @@ interface LookupProps extends Omit<InputProps, 'onChange' | 'value'> {
250
236
  hoverCardDelayMs?: number;
251
237
  /** Content rendered at the bottom of the card, e.g. an "Open record" link */
252
238
  hoverCardActions?: React.ReactNode;
239
+ /**
240
+ * Mount node for the dropdown Portal. Use when the Lookup is inside a
241
+ * dialog rendered in a parent document (via mountNode) so the listbox
242
+ * appears in the same document as the dialog.
243
+ */
244
+ mountNode?: HTMLElement;
253
245
  }
254
246
 
255
247
  declare const Lookup: React.FC<LookupProps>;
@@ -1511,4 +1503,4 @@ declare const validateQueryBuilderState: (state: QueryBuilderState, fields: Quer
1511
1503
 
1512
1504
  declare const QueryBuilder: React.FC<QueryBuilderProps>;
1513
1505
 
1514
- export { type AttributeMetadata, CommandBar, type CommandBarItem, type CommandBarItemAppearance, type CommandBarProps, DEFAULT_FIELD_APPEARANCE, type DateTimeBehavior, DateTimeField, type DateTimeFieldProps, DateTimeRangeField, type DateTimeRangeFieldChange, type DateTimeRangeFieldProps, type DateTimeRangeValue, type EntityDefinition, EntityGrid, type EntityGridColumn, type EntityGridProps, type EntityGridSort, type EntityGridSortDirection, type FieldAppearance, type ListboxAppearance, Lookup, type LookupOption, type LookupOptionDetail, type LookupProps, OptionSetField, type OptionSetFieldProps, type OptionSetOption, type OptionSetValue, OwnerLookup, type OwnerLookupProps, type OwnerRecord, type OwnerType, ParentPortal, type ParentPortalProps, QueryBuilder, type QueryBuilderApplyResult, type QueryBuilderCondition, type QueryBuilderDataType, type QueryBuilderField, type QueryBuilderGroup, type QueryBuilderOperator, type QueryBuilderOption, type QueryBuilderProps, type QueryBuilderQueryOptions, type QueryBuilderRelatedEntity, type QueryBuilderState, RecordHoverCard, type RecordHoverCardDetail, type RecordHoverCardProps, type RecordHoverCardRecord, type SearchOwnersOptions, type SearchSystemUsersOptions, SystemUserCard, type SystemUserCardProps, type SystemUserContactItem, SystemUserPersona, type SystemUserPersonaProps, type SystemUserPersonaSize, type SystemUserRecord, type TextareaAppearance, type WebApiCollection, WebApiError, clearMetadataCache, formatMultiSelectValue, formatStoredValue, getAttributeOptions, getEntityAttributes, getEntityDefinition, getEntityOptionSets, getOwner, getSystemUser, getWebApiBaseUrl, initialsOf, ownerFromUser, parseFetchXmlToState, parseSelectedValues, parseStoredValue, searchOwners, searchSystemUsers, searchTeams, serializeQueryBuilderState, setWebApiBaseUrl, setWebApiFetch, systemUserImageUrl, toListboxAppearance, toTextareaAppearance, validateFetchXmlSyntax, validateQueryBuilderState, webApiGet };
1506
+ export { type AttributeMetadata, CommandBar, type CommandBarItem, type CommandBarItemAppearance, type CommandBarProps, DEFAULT_FIELD_APPEARANCE, type DateTimeBehavior, DateTimeField, type DateTimeFieldProps, DateTimeRangeField, type DateTimeRangeFieldChange, type DateTimeRangeFieldProps, type DateTimeRangeValue, type EntityDefinition, EntityGrid, type EntityGridColumn, type EntityGridProps, type EntityGridSort, type EntityGridSortDirection, type FieldAppearance, type ListboxAppearance, Lookup, type LookupOption, type LookupOptionDetail, type LookupProps, OptionSetField, type OptionSetFieldProps, type OptionSetOption, type OptionSetValue, OwnerLookup, type OwnerLookupProps, type OwnerRecord, type OwnerType, ParentPortal, type ParentPortalProps, QueryBuilder, type QueryBuilderApplyResult, type QueryBuilderCondition, type QueryBuilderDataType, type QueryBuilderField, type QueryBuilderGroup, type QueryBuilderOperator, type QueryBuilderOption, type QueryBuilderProps, type QueryBuilderQueryOptions, type QueryBuilderRelatedEntity, type QueryBuilderState, RecordHoverCard, type RecordHoverCardDetail, type RecordHoverCardProps, type RecordHoverCardRecord, type SearchOwnersOptions, type SearchSystemUsersOptions, SystemUserCard, type SystemUserCardProps, type SystemUserContactItem, SystemUserPersona, type SystemUserPersonaProps, type SystemUserPersonaSize, type SystemUserRecord, type TextareaAppearance, type UseParentPortalMountOptions, type WebApiCollection, WebApiError, clearMetadataCache, formatMultiSelectValue, formatStoredValue, getAttributeOptions, getEntityAttributes, getEntityDefinition, getEntityOptionSets, getOwner, getSystemUser, getWebApiBaseUrl, initialsOf, ownerFromUser, parseFetchXmlToState, parseSelectedValues, parseStoredValue, searchOwners, searchSystemUsers, searchTeams, serializeQueryBuilderState, setWebApiBaseUrl, setWebApiFetch, systemUserImageUrl, toListboxAppearance, toTextareaAppearance, useParentPortalMount, validateFetchXmlSyntax, validateQueryBuilderState, webApiGet };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactNode, ReactPortal } from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
3
  import { InputProps, PresenceBadgeStatus } from '@fluentui/react-components';
4
4
 
5
5
  /**
@@ -39,46 +39,32 @@ declare const toTextareaAppearance: (appearance?: FieldAppearance) => TextareaAp
39
39
  declare const toListboxAppearance: (appearance?: FieldAppearance) => ListboxAppearance;
40
40
 
41
41
  interface ParentPortalProps {
42
- /** Content to render in the parent document. */
43
42
  children: ReactNode;
44
- /**
45
- * ID for the container element created in the parent document.
46
- * Defaults to 'fluentui-extended-parent-portal-root'.
47
- */
48
43
  containerId?: string;
49
- /**
50
- * When true, syncs Griffel stylesheets from the iframe to the parent
51
- * document so Fluent components render with full styling.
52
- * Defaults to true.
53
- */
54
44
  syncStyles?: boolean;
55
- /**
56
- * When true, copies Fluent CSS custom properties (theme tokens) from the
57
- * iframe's FluentProvider to the parent container.
58
- * Defaults to true.
59
- */
60
45
  syncTokens?: boolean;
61
- /**
62
- * Interval (ms) for re-syncing CSSOM rules that Griffel inserts via
63
- * insertRule(). Set to 0 to disable periodic sync (only MutationObserver).
64
- * Defaults to 300.
65
- */
66
46
  syncInterval?: number;
67
- /**
68
- * Additional CSS injected into the parent document's <head> for the
69
- * portal container. Overrides default positioning styles.
70
- */
47
+ containerStyles?: string;
48
+ }
49
+ interface UseParentPortalMountOptions {
50
+ containerId?: string;
51
+ syncStyles?: boolean;
52
+ syncTokens?: boolean;
53
+ syncInterval?: number;
71
54
  containerStyles?: string;
72
55
  }
73
56
 
74
57
  /**
75
- * Renders children into the parent document (escaping an iframe) with full
76
- * Fluent UI styling. Wraps content in a FluentProvider so theme tokens and
77
- * Griffel styles are available in the parent DOM.
78
- *
79
- * Falls back to rendering children in-place if not inside an iframe.
58
+ * Hook that returns the parent-document mount node for use with Fluent's
59
+ * `mountNode` prop (e.g. on DialogSurface). Also handles style sync.
60
+ */
61
+ declare function useParentPortalMount(options?: UseParentPortalMountOptions): HTMLElement | undefined;
62
+ /**
63
+ * Renders children into the parent document via createPortal.
64
+ * Use for non-portal Fluent components. For DialogSurface, use
65
+ * useParentPortalMount() with the mountNode prop instead.
80
66
  */
81
- declare function ParentPortal({ children, containerId, syncStyles, syncTokens, syncInterval, containerStyles, }: ParentPortalProps): ReactPortal | React__default.JSX.Element;
67
+ declare function ParentPortal({ children, containerId, syncStyles, syncTokens, syncInterval, containerStyles, }: ParentPortalProps): React__default.JSX.Element;
82
68
 
83
69
  /** Size variants matching FluentUI Input component */
84
70
  type LookupSize = 'small' | 'medium';
@@ -250,6 +236,12 @@ interface LookupProps extends Omit<InputProps, 'onChange' | 'value'> {
250
236
  hoverCardDelayMs?: number;
251
237
  /** Content rendered at the bottom of the card, e.g. an "Open record" link */
252
238
  hoverCardActions?: React.ReactNode;
239
+ /**
240
+ * Mount node for the dropdown Portal. Use when the Lookup is inside a
241
+ * dialog rendered in a parent document (via mountNode) so the listbox
242
+ * appears in the same document as the dialog.
243
+ */
244
+ mountNode?: HTMLElement;
253
245
  }
254
246
 
255
247
  declare const Lookup: React.FC<LookupProps>;
@@ -1511,4 +1503,4 @@ declare const validateQueryBuilderState: (state: QueryBuilderState, fields: Quer
1511
1503
 
1512
1504
  declare const QueryBuilder: React.FC<QueryBuilderProps>;
1513
1505
 
1514
- export { type AttributeMetadata, CommandBar, type CommandBarItem, type CommandBarItemAppearance, type CommandBarProps, DEFAULT_FIELD_APPEARANCE, type DateTimeBehavior, DateTimeField, type DateTimeFieldProps, DateTimeRangeField, type DateTimeRangeFieldChange, type DateTimeRangeFieldProps, type DateTimeRangeValue, type EntityDefinition, EntityGrid, type EntityGridColumn, type EntityGridProps, type EntityGridSort, type EntityGridSortDirection, type FieldAppearance, type ListboxAppearance, Lookup, type LookupOption, type LookupOptionDetail, type LookupProps, OptionSetField, type OptionSetFieldProps, type OptionSetOption, type OptionSetValue, OwnerLookup, type OwnerLookupProps, type OwnerRecord, type OwnerType, ParentPortal, type ParentPortalProps, QueryBuilder, type QueryBuilderApplyResult, type QueryBuilderCondition, type QueryBuilderDataType, type QueryBuilderField, type QueryBuilderGroup, type QueryBuilderOperator, type QueryBuilderOption, type QueryBuilderProps, type QueryBuilderQueryOptions, type QueryBuilderRelatedEntity, type QueryBuilderState, RecordHoverCard, type RecordHoverCardDetail, type RecordHoverCardProps, type RecordHoverCardRecord, type SearchOwnersOptions, type SearchSystemUsersOptions, SystemUserCard, type SystemUserCardProps, type SystemUserContactItem, SystemUserPersona, type SystemUserPersonaProps, type SystemUserPersonaSize, type SystemUserRecord, type TextareaAppearance, type WebApiCollection, WebApiError, clearMetadataCache, formatMultiSelectValue, formatStoredValue, getAttributeOptions, getEntityAttributes, getEntityDefinition, getEntityOptionSets, getOwner, getSystemUser, getWebApiBaseUrl, initialsOf, ownerFromUser, parseFetchXmlToState, parseSelectedValues, parseStoredValue, searchOwners, searchSystemUsers, searchTeams, serializeQueryBuilderState, setWebApiBaseUrl, setWebApiFetch, systemUserImageUrl, toListboxAppearance, toTextareaAppearance, validateFetchXmlSyntax, validateQueryBuilderState, webApiGet };
1506
+ export { type AttributeMetadata, CommandBar, type CommandBarItem, type CommandBarItemAppearance, type CommandBarProps, DEFAULT_FIELD_APPEARANCE, type DateTimeBehavior, DateTimeField, type DateTimeFieldProps, DateTimeRangeField, type DateTimeRangeFieldChange, type DateTimeRangeFieldProps, type DateTimeRangeValue, type EntityDefinition, EntityGrid, type EntityGridColumn, type EntityGridProps, type EntityGridSort, type EntityGridSortDirection, type FieldAppearance, type ListboxAppearance, Lookup, type LookupOption, type LookupOptionDetail, type LookupProps, OptionSetField, type OptionSetFieldProps, type OptionSetOption, type OptionSetValue, OwnerLookup, type OwnerLookupProps, type OwnerRecord, type OwnerType, ParentPortal, type ParentPortalProps, QueryBuilder, type QueryBuilderApplyResult, type QueryBuilderCondition, type QueryBuilderDataType, type QueryBuilderField, type QueryBuilderGroup, type QueryBuilderOperator, type QueryBuilderOption, type QueryBuilderProps, type QueryBuilderQueryOptions, type QueryBuilderRelatedEntity, type QueryBuilderState, RecordHoverCard, type RecordHoverCardDetail, type RecordHoverCardProps, type RecordHoverCardRecord, type SearchOwnersOptions, type SearchSystemUsersOptions, SystemUserCard, type SystemUserCardProps, type SystemUserContactItem, SystemUserPersona, type SystemUserPersonaProps, type SystemUserPersonaSize, type SystemUserRecord, type TextareaAppearance, type UseParentPortalMountOptions, type WebApiCollection, WebApiError, clearMetadataCache, formatMultiSelectValue, formatStoredValue, getAttributeOptions, getEntityAttributes, getEntityDefinition, getEntityOptionSets, getOwner, getSystemUser, getWebApiBaseUrl, initialsOf, ownerFromUser, parseFetchXmlToState, parseSelectedValues, parseStoredValue, searchOwners, searchSystemUsers, searchTeams, serializeQueryBuilderState, setWebApiBaseUrl, setWebApiFetch, systemUserImageUrl, toListboxAppearance, toTextareaAppearance, useParentPortalMount, validateFetchXmlSyntax, validateQueryBuilderState, webApiGet };
package/dist/index.js CHANGED
@@ -109,29 +109,12 @@ function serializeSheet(sheet) {
109
109
  return "";
110
110
  }
111
111
  }
112
- function ParentPortal({
113
- children,
114
- containerId = DEFAULT_CONTAINER_ID,
115
- syncStyles = true,
116
- syncTokens = true,
117
- syncInterval = 300,
118
- containerStyles
119
- }) {
120
- const [container, setContainer] = React15.useState(null);
112
+ function useSyncStyles(active, containerId, syncInterval) {
121
113
  const intervalRef = React15.useRef(null);
122
114
  const observerRef = React15.useRef(null);
123
115
  const mirrorMapRef = React15.useRef(/* @__PURE__ */ new Map());
124
116
  React15.useEffect(() => {
125
- const parentDoc = getParentDocument();
126
- if (!parentDoc) return;
127
- const el = getOrCreateContainer(parentDoc, containerId, containerStyles);
128
- if (syncTokens) copyFluentTokens(el);
129
- setContainer(el);
130
- return () => {
131
- };
132
- }, [containerId, containerStyles, syncTokens]);
133
- React15.useEffect(() => {
134
- if (!syncStyles || !container) return;
117
+ if (!active) return;
135
118
  const parentDoc = getParentDocument();
136
119
  if (!parentDoc) return;
137
120
  const mirrorMap = mirrorMapRef.current;
@@ -170,7 +153,42 @@ function ParentPortal({
170
153
  for (const mirror of mirrorMap.values()) mirror.remove();
171
154
  mirrorMap.clear();
172
155
  };
173
- }, [syncStyles, syncInterval, container, containerId]);
156
+ }, [active, syncInterval, containerId]);
157
+ }
158
+ function useParentPortalMount(options) {
159
+ const {
160
+ containerId = DEFAULT_CONTAINER_ID,
161
+ syncStyles = true,
162
+ syncTokens = true,
163
+ syncInterval = 300,
164
+ containerStyles
165
+ } = options ?? {};
166
+ const [container, setContainer] = React15.useState(null);
167
+ React15.useEffect(() => {
168
+ const parentDoc = getParentDocument();
169
+ if (!parentDoc) return;
170
+ const el = getOrCreateContainer(parentDoc, containerId, containerStyles);
171
+ if (syncTokens) copyFluentTokens(el);
172
+ setContainer(el);
173
+ }, [containerId, containerStyles, syncTokens]);
174
+ useSyncStyles(syncStyles && container !== null, containerId, syncInterval);
175
+ return container ?? void 0;
176
+ }
177
+ function ParentPortal({
178
+ children,
179
+ containerId = DEFAULT_CONTAINER_ID,
180
+ syncStyles = true,
181
+ syncTokens = true,
182
+ syncInterval = 300,
183
+ containerStyles
184
+ }) {
185
+ const container = useParentPortalMount({
186
+ containerId,
187
+ syncStyles,
188
+ syncTokens,
189
+ syncInterval,
190
+ containerStyles
191
+ });
174
192
  if (!container) {
175
193
  return /* @__PURE__ */ React15__namespace.default.createElement(React15__namespace.default.Fragment, null, children);
176
194
  }
@@ -1121,6 +1139,7 @@ var Lookup = ({
1121
1139
  hoverCardTarget = "both",
1122
1140
  hoverCardDelayMs = 400,
1123
1141
  hoverCardActions,
1142
+ mountNode,
1124
1143
  multiSelect = false,
1125
1144
  maxSelection,
1126
1145
  selectedKeys: selectedKeysProp,
@@ -1576,7 +1595,7 @@ var Lookup = ({
1576
1595
  }
1577
1596
  )),
1578
1597
  /* @__PURE__ */ React15__namespace.createElement("span", { className: styles.tagInputIcons }, loading ? /* @__PURE__ */ React15__namespace.createElement(reactComponents.Spinner, { size: "tiny" }) : /* @__PURE__ */ React15__namespace.createElement("span", { className: styles.chevronIcon }, /* @__PURE__ */ React15__namespace.createElement(reactIcons.SearchRegular, null)))
1579
- ), showDropdown && /* @__PURE__ */ React15__namespace.createElement(reactComponents.Portal, null, /* @__PURE__ */ React15__namespace.createElement(
1598
+ ), showDropdown && /* @__PURE__ */ React15__namespace.createElement(reactComponents.Portal, { mountNode }, /* @__PURE__ */ React15__namespace.createElement(
1580
1599
  "div",
1581
1600
  {
1582
1601
  className: styles.dropdownPortal,
@@ -9924,6 +9943,7 @@ exports.setWebApiFetch = setWebApiFetch;
9924
9943
  exports.systemUserImageUrl = systemUserImageUrl;
9925
9944
  exports.toListboxAppearance = toListboxAppearance;
9926
9945
  exports.toTextareaAppearance = toTextareaAppearance;
9946
+ exports.useParentPortalMount = useParentPortalMount;
9927
9947
  exports.validateFetchXmlSyntax = validateFetchXmlSyntax;
9928
9948
  exports.validateQueryBuilderState = validateQueryBuilderState;
9929
9949
  exports.webApiGet = webApiGet;