@primereact/core 11.0.0-rc.1 → 11.0.0-rc.3
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/api/{index.d.mts → FilterMatchMode.d.ts} +2 -10
- package/api/FilterOperator.d.ts +5 -0
- package/api/index.d.ts +2 -0
- package/api/index.mjs +0 -1
- package/base/index.d.ts +1 -0
- package/base/index.mjs +1 -2
- package/base/{index.d.mts → useBase.d.ts} +2 -5
- package/component/Component.d.ts +11 -0
- package/component/Component.props.d.ts +3 -0
- package/component/Component.utils.d.ts +12 -0
- package/component/index.d.ts +4 -0
- package/component/index.mjs +1 -2
- package/component/useComponent.d.ts +30 -0
- package/component/useComponentPT.d.ts +9 -0
- package/component/useComponentStyle.d.ts +10 -0
- package/component/useComponentStyleHandler.d.ts +51 -0
- package/component/withComponent.d.ts +24 -0
- package/config/PrimeReact.context.d.ts +4 -0
- package/config/PrimeReact.props.d.ts +2 -0
- package/config/index.d.ts +3 -0
- package/config/index.mjs +3 -2
- package/config/usePrimeReact.d.ts +6 -0
- package/dnd/announcements.d.ts +5 -0
- package/dnd/collision.d.ts +39 -0
- package/dnd/createDnd.d.ts +15 -0
- package/dnd/index.d.ts +3 -0
- package/dnd/index.mjs +1 -2
- package/dnd/sortable.d.ts +56 -0
- package/dnd/utils.d.ts +21 -0
- package/headless/index.d.ts +2 -0
- package/headless/index.mjs +0 -1
- package/headless/useHeadless.d.ts +9 -0
- package/headless/withHeadless.d.ts +15 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.props.d.ts +2 -0
- package/icon/Icon.style.d.ts +2 -0
- package/icon/index.d.ts +5 -0
- package/icon/index.mjs +3 -2
- package/icon/useIcon.d.ts +6 -0
- package/icon/withIcon.d.ts +24 -0
- package/{index.d.mts → index.d.ts} +1 -0
- package/index.mjs +0 -1
- package/license/index.d.ts +1 -0
- package/license/index.mjs +1 -2
- package/license/{index.d.mts → licensebanner.d.ts} +1 -3
- package/locale/Locale.context.d.ts +4 -0
- package/locale/Locale.props.d.ts +2 -0
- package/locale/defaultLocale.d.ts +125 -0
- package/locale/index.d.ts +5 -0
- package/locale/index.mjs +3 -2
- package/locale/useLocale.d.ts +6 -0
- package/motion/Motion.context.d.ts +5 -0
- package/motion/Motion.d.ts +4 -0
- package/motion/Motion.props.d.ts +2 -0
- package/motion/Motion.utils.d.ts +4 -0
- package/motion/index.d.ts +5 -0
- package/motion/index.mjs +3 -2
- package/motion/useMotion.d.ts +23 -0
- package/motion/useMotion.props.d.ts +2 -0
- package/overlay-manager/{index.d.mts → OverlayManager.d.ts} +7 -10
- package/overlay-manager/index.d.ts +1 -0
- package/overlay-manager/index.mjs +1 -2
- package/package.json +14 -11
- package/passthrough/PassThrough.context.d.ts +4 -0
- package/passthrough/PassThrough.props.d.ts +2 -0
- package/passthrough/index.d.ts +3 -0
- package/passthrough/index.mjs +2 -1
- package/passthrough/usePassThrough.d.ts +1 -0
- package/stylesheet/PrimeReactStyleSheet.d.ts +7 -0
- package/stylesheet/index.d.ts +1 -0
- package/stylesheet/index.mjs +1 -2
- package/theme/Theme.context.d.ts +4 -0
- package/theme/Theme.props.d.ts +2 -0
- package/theme/index.d.ts +3 -0
- package/theme/index.mjs +3 -2
- package/theme/useTheme.d.ts +1 -0
- package/umd/index.js +5 -4
- package/use-style/index.d.ts +2 -0
- package/use-style/index.mjs +1 -2
- package/use-style/useStyle.d.ts +2 -0
- package/use-style/useStyle.props.d.ts +1 -0
- package/utils/ConnectedOverlayScrollHandler.d.ts +10 -0
- package/utils/combinedRefs.d.ts +2 -0
- package/utils/createContext.d.ts +9 -0
- package/utils/env.d.ts +1 -0
- package/utils/index.d.ts +10 -0
- package/utils/index.mjs +3 -2
- package/utils/mergeRefs.d.ts +11 -0
- package/utils/overlayEventBus.d.ts +9 -0
- package/utils/stylePreloadRegistry.d.ts +33 -0
- package/utils/styleRegistry.d.ts +19 -0
- package/api/index.mjs.map +0 -1
- package/base/index.mjs.map +0 -1
- package/component/index.d.mts +0 -71
- package/component/index.mjs.map +0 -1
- package/config/index.d.mts +0 -17
- package/config/index.mjs.map +0 -1
- package/dnd/index.d.mts +0 -69
- package/dnd/index.mjs.map +0 -1
- package/headless/index.d.mts +0 -28
- package/headless/index.mjs.map +0 -1
- package/icon/index.d.mts +0 -40
- package/icon/index.mjs.map +0 -1
- package/index.mjs.map +0 -1
- package/license/index.mjs.map +0 -1
- package/locale/index.d.mts +0 -12
- package/locale/index.mjs.map +0 -1
- package/motion/index.d.mts +0 -42
- package/motion/index.mjs.map +0 -1
- package/overlay-manager/index.mjs.map +0 -1
- package/passthrough/index.d.mts +0 -12
- package/passthrough/index.mjs.map +0 -1
- package/stylesheet/index.d.mts +0 -10
- package/stylesheet/index.mjs.map +0 -1
- package/theme/index.d.mts +0 -12
- package/theme/index.mjs.map +0 -1
- package/umd/index.js.map +0 -1
- package/use-style/index.d.mts +0 -7
- package/use-style/index.mjs.map +0 -1
- package/utils/index.d.mts +0 -104
- package/utils/index.mjs.map +0 -1
package/use-style/index.d.mts
DELETED
package/use-style/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/use-style/useStyle.ts","../../src/use-style/useStyle.props.ts"],"sourcesContent":["import { ThemeContext } from '@primereact/core/theme';\nimport type { useStyleLoadOptions } from '@primereact/types/core';\nimport { isClient, isNotEmpty } from '@primeuix/utils';\nimport * as React from 'react';\n\nexport function useStyle() {\n const theme = React.useContext(ThemeContext);\n\n const _load = React.useCallback((loadOptions: useStyleLoadOptions = {}) => {\n const { name, css, element, options = {} } = loadOptions;\n\n if (isClient() && isNotEmpty(css)) {\n let root = element?.getRootNode() as Element | Document | ShadowRoot | null;\n\n if (!root || root === document) root = document.head;\n\n const styleElement = root.querySelector(`style[data-primereact-style-id=\"${name}\"]`) || document.createElement('style');\n\n if (!styleElement.isConnected) {\n // @todo - add attributes and prepend\n if (options?.first) {\n root.prepend(styleElement);\n } else {\n root.appendChild(styleElement);\n }\n\n styleElement.setAttribute('data-primereact-style-id', name || '');\n }\n\n const nextCss = css ?? '';\n\n if (styleElement.textContent !== nextCss) {\n styleElement.textContent = nextCss;\n }\n\n return styleElement;\n }\n }, []);\n\n const load = React.useCallback(\n (loadOptions: useStyleLoadOptions = {}) => {\n const { name, css } = loadOptions;\n\n if (isNotEmpty(loadOptions.css)) {\n // @todo - implement\n if (name && !theme?.stylesheet?.has(name) && !isClient() && name !== 'layer-order') {\n theme?.stylesheet?.add(name, css);\n }\n\n return _load(loadOptions);\n }\n },\n [theme, _load]\n );\n\n const unload = React.useCallback(() => {\n if (theme?.stylesheet) {\n theme.stylesheet.clear();\n }\n }, [theme]);\n\n React.useInsertionEffect(() => {\n theme?.stylesheet?.getStyles()?.forEach((value, key) => {\n _load({ name: key, css: value?.css });\n });\n }, [theme, _load]);\n\n return [load, unload];\n}\n\n// @todo - Remove this\n/*function useCSS(cssMap = {}) {\n const { theme } = usePrimeReact();\n\n if (typeof window === 'undefined') {\n Object.entries(cssMap).forEach(([key, value]) => {\n config?.sheet?.add(key, value.css);\n });\n }\n\n React.useInsertionEffect(() => {\n theme.stylesheet?._styles?.forEach((value, key) => {\n const styleElement = document.head.querySelector(`style[data-primereact-style-id=\"${key}\"]`) || document.createElement('style');\n\n if (!styleElement.isConnected) {\n //setAttributes(styleElement, value.styleOptions);\n value.first ? document.head.prepend(styleElement) : document.head.appendChild(styleElement);\n setAttribute(styleElement, 'data-primereact-style-id', key);\n //styleRef.current.onload = (event: React.ReactEventHandler<HTMLStyleElement>) => onStyleLoaded?.(event, { name: styleNameRef.current });\n //onStyleMounted?.(styleNameRef.current);\n }\n\n styleElement.textContent = value.css;\n });\n });\n //return rule;\n}*/\n","export const defaultUseStyleProps = {};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,yBAE7B,OAAS,YAAAC,EAAU,cAAAC,MAAkB,kBACrC,UAAYC,MAAW,QAEhB,SAASC,GAAW,CACvB,IAAMC,EAAc,aAAWL,CAAY,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AAnB,MAAAC,EAAgC,QAAQ,CAACE,EAAOC,IAAQ,CACpDd,EAAM,CAAE,KAAMc,EAAK,IAAKD,GAAA,YAAAA,EAAO,GAAI,CAAC,CACxC,EACJ,EAAG,CAACd,EAAOC,CAAK,CAAC,EAEV,CAACS,EAAMG,CAAM,CACxB,CCpEO,IAAMG,EAAuB,CAAC","names":["ThemeContext","isClient","isNotEmpty","React","useStyle","theme","_load","loadOptions","name","css","element","options","root","styleElement","nextCss","load","_a","_b","unload","value","key","defaultUseStyleProps"]}
|
package/utils/index.d.mts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import { ThemeProps } from '@primereact/types/core';
|
|
3
|
-
|
|
4
|
-
declare const combinedRefs: <I = unknown>(innerRef?: React$1.Ref<I>, forwardRef?: React$1.Ref<unknown>) => void;
|
|
5
|
-
|
|
6
|
-
declare class ConnectedOverlayScrollHandler {
|
|
7
|
-
private element;
|
|
8
|
-
private listener;
|
|
9
|
-
private scrollableParents;
|
|
10
|
-
private isBound;
|
|
11
|
-
constructor(element: HTMLElement | null, listener?: () => void);
|
|
12
|
-
bindScrollListener(): void;
|
|
13
|
-
unbindScrollListener(): void;
|
|
14
|
-
destroy(): void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare function createSafeContext<T>(defaultValue?: T, message?: string): readonly [({ value, children }: {
|
|
18
|
-
value: T;
|
|
19
|
-
children: React$1.ReactNode;
|
|
20
|
-
}) => React$1.JSX.Element, () => T | undefined];
|
|
21
|
-
declare function createOptionalContext<T>(defaultValue?: T): readonly [({ value, children }: {
|
|
22
|
-
value: T;
|
|
23
|
-
children: React$1.ReactNode;
|
|
24
|
-
}) => React$1.JSX.Element, () => T | undefined];
|
|
25
|
-
|
|
26
|
-
declare const isDev: boolean;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Merge multiple React refs (callback refs and ref objects, mixed) into a
|
|
30
|
-
* single callback ref. Each ref is updated whenever React assigns or clears
|
|
31
|
-
* the underlying value.
|
|
32
|
-
*
|
|
33
|
-
* Use this in component wrappers when you need to forward the rendered
|
|
34
|
-
* element / instance both to the local `elementRef` (used for styles, DOM
|
|
35
|
-
* access, composition) and to a ref the caller passed in via props.
|
|
36
|
-
*/
|
|
37
|
-
declare function mergeRefs<T>(...refs: Array<React$1.Ref<T> | undefined>): React$1.RefCallback<T>;
|
|
38
|
-
|
|
39
|
-
interface OverlayClickPayload {
|
|
40
|
-
originalEvent: Event | React.SyntheticEvent;
|
|
41
|
-
target?: Element | null;
|
|
42
|
-
}
|
|
43
|
-
declare const OverlayEventBus: {
|
|
44
|
-
emit: (name: string, payload?: unknown) => void;
|
|
45
|
-
on: (name: string, cb: (payload: unknown) => void) => void;
|
|
46
|
-
off: (name: string, cb: (payload: unknown) => void) => void;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type StylePreloadPhase = 'ssr' | 'client' | 'both';
|
|
50
|
-
type StylePreloadEntry = {
|
|
51
|
-
id: string;
|
|
52
|
-
css: string;
|
|
53
|
-
phase?: StylePreloadPhase;
|
|
54
|
-
priority?: number;
|
|
55
|
-
};
|
|
56
|
-
type NormalizedStylePreloadEntry = {
|
|
57
|
-
id: string;
|
|
58
|
-
css: string;
|
|
59
|
-
phase: StylePreloadPhase;
|
|
60
|
-
priority: number;
|
|
61
|
-
};
|
|
62
|
-
declare const StylePreloadRegistry: {
|
|
63
|
-
_entries: Map<string, NormalizedStylePreloadEntry>;
|
|
64
|
-
register(entry: StylePreloadEntry): void;
|
|
65
|
-
registerMany(entries?: StylePreloadEntry[]): void;
|
|
66
|
-
has(id: string): boolean;
|
|
67
|
-
getAll(): NormalizedStylePreloadEntry[];
|
|
68
|
-
getForSSR(): NormalizedStylePreloadEntry[];
|
|
69
|
-
getForClient(): NormalizedStylePreloadEntry[];
|
|
70
|
-
clear(): void;
|
|
71
|
-
};
|
|
72
|
-
declare const addStylePreloadsToStyleSheet: (stylesheet: ThemeProps["stylesheet"], styles: {
|
|
73
|
-
id: string;
|
|
74
|
-
css: string;
|
|
75
|
-
}[]) => void;
|
|
76
|
-
declare const upsertStylePreloadsToHead: (styles: {
|
|
77
|
-
id: string;
|
|
78
|
-
css: string;
|
|
79
|
-
}[]) => void;
|
|
80
|
-
|
|
81
|
-
declare const StyleRegistry: {
|
|
82
|
-
_loadedStyleNames: Set<string>;
|
|
83
|
-
_styleRefCount: Map<string, number>;
|
|
84
|
-
getLoadedStyleNames(): Set<string>;
|
|
85
|
-
isStyleNameLoaded(name: string): boolean;
|
|
86
|
-
getStyleRefCount(name: string): number;
|
|
87
|
-
retainStyleName(name: string): boolean;
|
|
88
|
-
releaseStyleName(name: string): boolean;
|
|
89
|
-
setLoadedStyleName(name: string): void;
|
|
90
|
-
deleteLoadedStyleName(name: string): void;
|
|
91
|
-
clearLoadedStyleNames(): void;
|
|
92
|
-
getStats(): {
|
|
93
|
-
totalStyles: number;
|
|
94
|
-
styleRefCounts: {
|
|
95
|
-
name: string;
|
|
96
|
-
refCount: number;
|
|
97
|
-
}[];
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
declare function isValidElement(obj: any): obj is React.ReactElement;
|
|
102
|
-
declare function isElementOfType(obj: any, name: string): boolean;
|
|
103
|
-
|
|
104
|
-
export { ConnectedOverlayScrollHandler, type OverlayClickPayload, OverlayEventBus, type StylePreloadEntry, type StylePreloadPhase, StylePreloadRegistry, StyleRegistry, addStylePreloadsToStyleSheet, combinedRefs, createOptionalContext, createSafeContext, isDev, isElementOfType, isValidElement, mergeRefs, upsertStylePreloadsToHead };
|
package/utils/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/combinedRefs.ts","../../src/utils/ConnectedOverlayScrollHandler.ts","../../src/utils/createContext.tsx","../../src/utils/env.ts","../../src/utils/mergeRefs.ts","../../src/utils/overlayEventBus.ts","../../src/utils/stylePreloadRegistry.ts","../../src/utils/styleRegistry.ts","../../src/utils/index.ts"],"sourcesContent":["import * as React from 'react';\n\nexport const combinedRefs = <I = unknown>(innerRef?: React.Ref<I>, forwardRef?: React.Ref<unknown>) => {\n if (innerRef && forwardRef && forwardRef !== innerRef) {\n if (typeof forwardRef === 'function') {\n forwardRef(innerRef && 'current' in innerRef ? innerRef.current : null);\n } else {\n if ('current' in forwardRef && 'current' in innerRef && forwardRef.current !== innerRef.current) {\n forwardRef.current = innerRef && 'current' in innerRef ? innerRef.current : null;\n }\n }\n }\n};\n","import { getScrollableParents } from '@primeuix/utils/dom';\n\nexport class ConnectedOverlayScrollHandler {\n private element: HTMLElement | null;\n private listener: (() => void) | null;\n private scrollableParents: Element[] | null = null;\n private isBound = false;\n\n constructor(element: HTMLElement | null, listener: () => void = () => {}) {\n this.element = element;\n this.listener = listener;\n }\n\n bindScrollListener() {\n if (!this.element) return;\n\n if (this.isBound) {\n this.unbindScrollListener();\n }\n\n this.scrollableParents = getScrollableParents(this.element);\n\n for (let i = 0; i < this.scrollableParents.length; i++) {\n const parent = this.scrollableParents[i];\n\n if (parent && this.listener) {\n parent.addEventListener('scroll', this.listener);\n }\n }\n\n this.isBound = true;\n }\n\n unbindScrollListener() {\n if (this.scrollableParents && this.listener) {\n for (let i = 0; i < this.scrollableParents.length; i++) {\n const parent = this.scrollableParents[i];\n\n if (parent) {\n parent.removeEventListener('scroll', this.listener);\n }\n }\n }\n\n this.scrollableParents = null;\n this.isBound = false;\n }\n\n destroy() {\n this.unbindScrollListener();\n this.element = null;\n this.listener = null;\n this.scrollableParents = null;\n this.isBound = false;\n }\n}\n","'use client';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\nfunction createContext<T>(defaultValue?: T, fallback?: () => never | T | undefined) {\n const Context = React.createContext<T | undefined>(defaultValue);\n\n const useContext = () => {\n const context = React.useContext(Context);\n\n if (context === undefined) {\n return fallback?.();\n }\n\n return context;\n };\n\n const Provider = ({ value, children }: { value: T; children: React.ReactNode }) => {\n const resolvedChildren = React.useMemo(() => resolve(children, value) as React.ReactNode, [children, value]);\n\n return <Context.Provider value={value}>{resolvedChildren}</Context.Provider>;\n };\n\n return [Provider, useContext] as const;\n}\n\nexport function createSafeContext<T>(defaultValue?: T, message?: string) {\n return createContext<T>(defaultValue, () => {\n throw new Error(message || 'Context must be used within a Provider');\n });\n}\n\nexport function createOptionalContext<T>(defaultValue?: T) {\n return createContext<T>(defaultValue, () => {\n return defaultValue;\n });\n}\n","export const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production';\n","import * as React from 'react';\n\n/**\n * Merge multiple React refs (callback refs and ref objects, mixed) into a\n * single callback ref. Each ref is updated whenever React assigns or clears\n * the underlying value.\n *\n * Use this in component wrappers when you need to forward the rendered\n * element / instance both to the local `elementRef` (used for styles, DOM\n * access, composition) and to a ref the caller passed in via props.\n */\nexport function mergeRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T> {\n return (value: T | null) => {\n for (const ref of refs) {\n if (ref == null) continue;\n\n if (typeof ref === 'function') {\n ref(value);\n } else {\n try {\n (ref as { current: T | null }).current = value;\n } catch {\n // Ignore — caller passed a frozen / read-only ref.\n }\n }\n }\n };\n}\n","import { EventBus } from '@primeuix/utils/eventbus';\n\nexport interface OverlayClickPayload {\n originalEvent: Event | React.SyntheticEvent;\n target?: Element | null;\n}\n\nconst bus = EventBus() as { emit: (name: string, payload?: unknown) => void; on: (name: string, cb: (payload: unknown) => void) => void; off: (name: string, cb: (payload: unknown) => void) => void };\n\nexport const OverlayEventBus = bus;\n","import type { ThemeProps } from '@primereact/types/core';\n\nexport type StylePreloadPhase = 'ssr' | 'client' | 'both';\n\nexport type StylePreloadEntry = {\n id: string;\n css: string;\n phase?: StylePreloadPhase;\n priority?: number;\n};\n\ntype NormalizedStylePreloadEntry = {\n id: string;\n css: string;\n phase: StylePreloadPhase;\n priority: number;\n};\n\nconst normalizeEntry = (entry: StylePreloadEntry): NormalizedStylePreloadEntry => ({\n id: entry.id,\n css: entry.css,\n phase: entry.phase ?? 'both',\n priority: entry.priority ?? 0\n});\n\nconst sortEntries = (entries: NormalizedStylePreloadEntry[]) =>\n entries.sort((a, b) => {\n const byPriority = a.priority - b.priority;\n\n return byPriority !== 0 ? byPriority : a.id.localeCompare(b.id);\n });\n\nexport const StylePreloadRegistry = {\n _entries: new Map<string, NormalizedStylePreloadEntry>(),\n register(entry: StylePreloadEntry) {\n if (!entry.id || !entry.css) {\n return;\n }\n\n this._entries.set(entry.id, normalizeEntry(entry));\n },\n registerMany(entries: StylePreloadEntry[] = []) {\n entries.forEach((entry) => this.register(entry));\n },\n has(id: string) {\n return this._entries.has(id);\n },\n getAll() {\n return sortEntries([...this._entries.values()]);\n },\n getForSSR() {\n return sortEntries([...this._entries.values()].filter((entry) => entry.phase !== 'client'));\n },\n getForClient() {\n return sortEntries([...this._entries.values()].filter((entry) => entry.phase !== 'ssr'));\n },\n clear() {\n this._entries.clear();\n }\n};\n\nexport const addStylePreloadsToStyleSheet = (stylesheet: ThemeProps['stylesheet'], styles: { id: string; css: string }[]) => {\n styles.forEach((style) => {\n if (!stylesheet?.has(style.id)) {\n stylesheet?.add(style.id, style.css);\n }\n });\n};\n\nexport const upsertStylePreloadsToHead = (styles: { id: string; css: string }[]) => {\n styles.forEach((style) => {\n const styleElement = document.head.querySelector(`style[data-primereact-style-id=\"${style.id}\"]`) || document.createElement('style');\n\n if (!styleElement.isConnected) {\n document.head.appendChild(styleElement);\n styleElement.setAttribute('data-primereact-style-id', style.id);\n }\n\n styleElement.textContent = style.css;\n });\n};\n","export const StyleRegistry = {\n _loadedStyleNames: new Set<string>(),\n _styleRefCount: new Map<string, number>(),\n getLoadedStyleNames() {\n return this._loadedStyleNames;\n },\n isStyleNameLoaded(name: string) {\n return (this._styleRefCount.get(name) ?? 0) > 0;\n },\n getStyleRefCount(name: string) {\n return this._styleRefCount.get(name) ?? 0;\n },\n retainStyleName(name: string) {\n const current = this.getStyleRefCount(name);\n const next = current + 1;\n\n this._styleRefCount.set(name, next);\n this._loadedStyleNames.add(name);\n\n return current === 0;\n },\n releaseStyleName(name: string) {\n const current = this.getStyleRefCount(name);\n\n if (current <= 1) {\n this._styleRefCount.delete(name);\n this._loadedStyleNames.delete(name);\n\n return true;\n }\n\n this._styleRefCount.set(name, current - 1);\n\n return false;\n },\n setLoadedStyleName(name: string) {\n this.retainStyleName(name);\n },\n deleteLoadedStyleName(name: string) {\n this._styleRefCount.delete(name);\n this._loadedStyleNames.delete(name);\n },\n clearLoadedStyleNames() {\n this._styleRefCount.clear();\n this._loadedStyleNames.clear();\n },\n getStats() {\n return {\n totalStyles: this._loadedStyleNames.size,\n styleRefCounts: Array.from(this._styleRefCount.entries()).map(([name, refCount]) => ({\n name,\n refCount\n }))\n };\n }\n};\n","export * from './combinedRefs';\nexport * from './ConnectedOverlayScrollHandler';\nexport * from './createContext';\nexport * from './env';\nexport * from './mergeRefs';\nexport * from './overlayEventBus';\nexport * from './stylePreloadRegistry';\nexport * from './styleRegistry';\n\nconst REACT_ELEMENT = Symbol.for('react.element');\nconst REACT_TRANSITIONAL_ELEMENT = Symbol.for('react.transitional.element');\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isValidElement(obj: any): obj is React.ReactElement {\n return typeof obj === 'object' && obj !== null && (obj.$$typeof === REACT_ELEMENT || obj.$$typeof === REACT_TRANSITIONAL_ELEMENT);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isElementOfType(obj: any, name: string): boolean {\n if (typeof obj !== 'object' || obj === null) return false;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const displayName = (obj as any).displayName || (obj.type as any)?.displayName || (obj.type as any)?.name;\n\n return displayName === name || displayName?.includes(`PrimeReact.${name}`) || displayName?.includes(`PrimeReact.UI${name}`);\n}\n"],"mappings":"AAEO,IAAMA,EAAe,CAAcC,EAAyBC,IAAoC,CAC/FD,GAAYC,GAAcA,IAAeD,IACrC,OAAOC,GAAe,WACtBA,EAAWD,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D,IAAMK,EAAeL,EAAY,eAAgBG,EAAAH,EAAI,OAAJ,YAAAG,EAAkB,gBAAgBC,EAAAJ,EAAI,OAAJ,YAAAI,EAAkB,MAErG,OAAOC,IAAgBH,IAAQG,GAAA,YAAAA,EAAa,SAAS,cAAcH,CAAI,OAAOG,GAAA,YAAAA,EAAa,SAAS,gBAAgBH,CAAI,IAC5H","names":["combinedRefs","innerRef","forwardRef","getScrollableParents","ConnectedOverlayScrollHandler","element","listener","i","parent","resolve","React","createContext","defaultValue","fallback","Context","value","children","resolvedChildren","context","createSafeContext","message","createOptionalContext","_a","isDev","mergeRefs","refs","value","ref","e","EventBus","bus","OverlayEventBus","normalizeEntry","entry","_a","_b","sortEntries","entries","a","b","byPriority","StylePreloadRegistry","id","addStylePreloadsToStyleSheet","stylesheet","styles","style","upsertStylePreloadsToHead","styleElement","StyleRegistry","name","_a","current","next","refCount","REACT_ELEMENT","REACT_TRANSITIONAL_ELEMENT","isValidElement","obj","isElementOfType","name","_a","_b","displayName"]}
|